* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: 'Chalkboard SE', 'Comic Sans MS', 'Arial Rounded MT Bold', system-ui, sans-serif;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  min-height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 620px;
  margin: 0 auto;
}

/* ── Header ─────────────────────────────────────── */
#header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(255,255,255,0.6);
}

.stat {
  font-size: 1.5rem;
  font-weight: bold;
  color: #555;
}

#reset-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0.45;
  padding: 4px 6px;
  border-radius: 8px;
  transition: opacity 0.15s;
}
#reset-btn:hover { opacity: 0.9; }

/* ── Quiz area ───────────────────────────────────── */
#quiz-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px;
  gap: 20px;
  overflow: hidden;
}

/* ── Instruction ─────────────────────────────────── */
.instruction {
  font-size: 1.25rem;
  color: #666;
  text-align: center;
}

/* ── Question card ───────────────────────────────── */
.question-card {
  background: white;
  border-radius: 32px;
  padding: 24px 48px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  text-align: center;
  min-width: 180px;
}

.big-number {
  font-size: 8rem;
  font-weight: 900;
  color: #e17055;
  line-height: 1;
  text-shadow: 4px 4px 0 rgba(225,112,85,0.18);
}

/* ── Emoji grid (in card and in buttons) ─────────── */
.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  max-width: 180px;
  margin: 0 auto;
}

.emoji-grid.large .emoji-dot { font-size: 2rem; }
.emoji-grid.small .emoji-dot { font-size: 1.7rem; }

/* ── Choices ─────────────────────────────────────── */
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  max-width: 520px;
}

.choice-btn {
  border: none;
  border-radius: 22px;
  padding: 16px 10px;
  font-size: 2.6rem;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  color: white;
  min-height: 110px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.18);
  transition: transform 0.08s, box-shadow 0.08s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.choice-btn:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.18);
}
.choice-btn:disabled { cursor: default; }

.choices > .choice-btn:nth-child(1) { background: #ff7675; }
.choices > .choice-btn:nth-child(2) { background: #4facfe; }
.choices > .choice-btn:nth-child(3) { background: #43d08a; }
.choices > .choice-btn:nth-child(4) { background: #fdd835; color: #555; }

/* Feedback */
.choice-btn.correct {
  background: #00b894 !important;
  color: white !important;
  animation: pop 0.45s ease;
}
.choice-btn.wrong {
  background: #e17055 !important;
  color: white !important;
  animation: shake 0.4s ease;
}

@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-9px); }
  75%       { transform: translateX(9px); }
}

/* ── Feedback badge (correct / wrong flash) ──────── */
.feedback-badge {
  position: fixed;
  top: 50%;
  left: 50%;
  font-size: 7rem;
  pointer-events: none;
  z-index: 200;
  animation: badgePop 0.7s ease forwards;
}

@keyframes badgePop {
  0%   { transform: translate(-50%, -50%) scale(0);   opacity: 1; }
  50%  { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1);   opacity: 0; }
}

/* ── Overlay ─────────────────────────────────────── */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 100;
  text-align: center;
  padding: 20px;
}
#overlay.hidden { display: none; }

.overlay-emoji {
  font-size: 7rem;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.overlay-title { font-size: 2.4rem; font-weight: 900; color: #e17055; }
.overlay-sub   { font-size: 1.4rem; color: #636e72; }

@keyframes popIn {
  from { transform: scale(0) rotate(-15deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

/* ── Complete screen ─────────────────────────────── */
.complete-screen {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.complete-screen h1 { font-size: 3rem; color: #e17055; }
.complete-screen p  { font-size: 1.5rem; color: #636e72; }

.play-again-btn {
  background: #6c5ce7;
  color: white;
  border: none;
  border-radius: 22px;
  padding: 18px 44px;
  font-size: 1.6rem;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 0 #4834d4;
  transition: transform 0.08s, box-shadow 0.08s;
}
.play-again-btn:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 #4834d4;
}
