/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #e0f4ff 0%, #d4edda 100%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px 40px;
  font-family: 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
}

/* ===== Wrapper ===== */
.quiz-wrapper {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 100, 180, 0.12);
  overflow: hidden;
  padding: 0 0 32px;
}

/* ===== Header ===== */
.quiz-header {
  background: linear-gradient(135deg, #1a73e8, #0d9488);
  padding: 28px 24px 20px;
  text-align: center;
  color: white;
}

.quiz-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.quiz-subtitle {
  font-size: 0.95rem;
  margin-top: 4px;
  opacity: 0.85;
}

/* ===== Progress ===== */
.quiz-progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a73e8, #0d9488);
  transition: width 0.4s ease;
  width: 0%;
}

.quiz-progress-text {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  padding: 10px 0 0;
}

/* ===== Main Quiz Area ===== */
.quiz-main {
  padding: 20px 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* ===== Bird Photo ===== */
.bird-photo-box {
  width: 100%;
  height: 260px;
  border-radius: 16px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.bird-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.bird-photo--loading {
  opacity: 0;
}

/* ===== Answer Buttons ===== */
.answer-list {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.answer-btn {
  width: 100%;
  padding: 16px 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #1e3a5f;
  background: #eef6ff;
  border: 2px solid #bfdbfe;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, color 0.15s;
  line-height: 1.4;
  word-break: keep-all;
}

.answer-btn:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-2px);
}

.answer-btn:active:not(:disabled) {
  transform: translateY(0);
}

.answer-btn:disabled {
  cursor: not-allowed;
}

/* Correct state */
.answer-btn--correct {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #ffffff !important;
  transform: none;
}

/* Wrong state */
.answer-btn--wrong {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
  animation: shake 0.45s ease;
}

@keyframes shake {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-8px); }
  30%  { transform: translateX(8px); }
  45%  { transform: translateX(-6px); }
  60%  { transform: translateX(6px); }
  75%  { transform: translateX(-3px); }
  90%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

/* ===== Next Button ===== */
.next-btn-box {
  width: 100%;
  display: none;
}

.next-btn-box--visible {
  display: block;
}

.next-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #1a73e8, #0d9488);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.next-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.next-btn:active {
  transform: translateY(0);
}

/* ===== Result Panel ===== */
.result-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 24px 0;
  text-align: center;
}

.result-panel--visible {
  display: flex;
}

.result-emoji {
  font-size: 5rem;
  line-height: 1;
  animation: pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
  0%   { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.result-heading {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e3a5f;
}

.result-score-text {
  font-size: 1.1rem;
  color: #475569;
}

.result-score-num {
  font-size: 2.4rem;
  font-weight: 800;
  color: #1a73e8;
}

.result-comment {
  font-size: 1rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 12px 20px;
  border-radius: 10px;
  width: 100%;
}

.retry-btn {
  margin-top: 8px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #1a73e8, #0d9488);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.retry-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.retry-btn:active {
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 400px) {
  .quiz-title {
    font-size: 1.3rem;
  }

  .bird-photo-box {
    height: 210px;
  }

  .answer-btn {
    font-size: 0.9rem;
    padding: 13px 8px;
  }
}
