:root {
  --bg-top: #bde0fe;
  --bg-bottom: #a2d2ff;
  --card-bg: #ffffff;
  --ink: #2b2d42;
  --accent: #ffb703;
  --yes: #38b000;
  --no: #e63946;
  font-size: clamp(14px, 2.3vh, 18px);
}

* { box-sizing: border-box; }

html {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Comic Sans MS", "Segoe UI Rounded", "Trebuchet MS", Verdana, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  flex: 0 0 auto;
}

.topbar h1 {
  font-size: 1.25rem;
  margin: 0;
}

.score {
  background: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-weight: bold;
  font-size: 1.05rem;
  box-shadow: 0 3px 0 rgba(0,0,0,0.1);
}

main {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  padding: 0 0.8rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.5rem, 1.6vh, 1rem);
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.question-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  flex: 0 0 auto;
}

.mascot {
  font-size: clamp(1.6rem, 5.5vh, 2.8rem);
  line-height: 1;
  transition: transform 0.25s ease;
}
.mascot.happy { animation: bounce 0.6s ease; }
.mascot.sad { animation: shake 0.5s ease; }

@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-18px) rotate(-8deg); }
  60% { transform: translateY(0) rotate(8deg); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.speak-btn {
  font-size: 1.1rem;
  font-weight: bold;
  background: #fff;
  border: none;
  border-radius: 18px;
  padding: 0.65rem 1.1rem;
  box-shadow: 0 4px 0 #d8d8e0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  max-width: 100%;
}
.speak-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #d8d8e0;
}

.feedback {
  min-height: 1.5rem;
  font-size: 1.15rem;
  font-weight: bold;
}
.feedback.correct { color: var(--yes); }
.feedback.wrong { color: var(--no); }

.hand {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  justify-items: center;
  align-content: center;
  flex: 1 1 auto;
  min-height: 0;
}

.card {
  background: var(--card-bg);
  border-radius: 14px;
  width: 100%;
  max-width: 130px;
  height: 100%;
  max-height: 30vh;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  box-shadow: 0 5px 0 rgba(0,0,0,0.12);
  border: 3px solid #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card svg {
  width: 100%;
  flex: 1;
  min-height: 0;
}

.card-label {
  text-transform: capitalize;
  font-weight: bold;
  font-size: 0.85rem;
  color: var(--ink);
  margin-top: 0.1rem;
}

.card.highlight-correct {
  border-color: var(--yes);
  transform: scale(1.08) rotate(-2deg);
  box-shadow: 0 0 0 5px rgba(56,176,0,0.25), 0 5px 0 rgba(0,0,0,0.12);
}

.answer-buttons {
  display: flex;
  gap: 1rem;
  width: 100%;
  justify-content: center;
  flex: 0 0 auto;
}

.thumb-btn {
  flex: 1;
  max-width: 220px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: bold;
  padding: 0.65rem 0.5rem;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 5px 0 rgba(0,0,0,0.18);
}

.thumb-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.18);
}

.thumb-up { background: var(--yes); }
.thumb-down { background: var(--no); }

.thumb-icon { font-size: 1.7rem; }

.thumb-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.controls {
  display: flex;
  justify-content: center;
  flex: 0 0 auto;
}

.secondary-btn {
  background: var(--accent);
  border: none;
  border-radius: 14px;
  padding: 0.55rem 1.2rem;
  font-size: 0.95rem;
  font-weight: bold;
  color: #4a2c00;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}
.secondary-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

@media (max-width: 420px) {
  .thumb-icon { font-size: 1.5rem; }
}

@media (min-width: 640px) {
  .card {
    max-width: 150px;
    max-height: 200px;
  }
}

.start-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.start-mascot {
  font-size: 5rem;
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@media (prefers-reduced-motion: reduce) {
  .start-mascot { animation: none; }
}

.start-btn {
  font-size: 1.5rem;
  font-weight: bold;
  background: var(--accent);
  border: none;
  border-radius: 24px;
  padding: 1.1rem 2rem;
  color: #4a2c00;
  box-shadow: 0 6px 0 rgba(0,0,0,0.18);
  cursor: pointer;
  animation: pulse 1.4s ease-in-out infinite;
}
.start-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.18);
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .start-btn { animation: none; }
}

.start-overlay.hidden {
  display: none;
}
