/* Spelling Bee & Geography — kid-friendly styles.
   Big touch targets, big type, readable on iPad in both orientations. */

:root {
  --ink: #22303f;
  --muted: #5b6b7d;
  --bg: #fdf6e3;
  --card: #ffffff;
  --talia: #2e86ab;
  --talia-dark: #1f5f7a;
  --marina: #e07a5f;
  --marina-dark: #b25a41;
  --green: #4caf7d;
  --green-dark: #35855c;
  --gold: #f2b705;
  --red: #d64545;
  --line: #e8ddc4;
  --radius: 20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 20px;
  line-height: 1.45;
}

#app { max-width: 860px; margin: 0 auto; padding: 16px 20px 48px; }

.screen { display: none; }
.screen.active { display: block; }

h1 { font-size: 2.1rem; line-height: 1.15; margin: 0.4em 0 0.2em; text-align: center; }
h2 { font-size: 1.5rem; margin: 0.6em 0 0.4em; }
h3 { font-size: 1.2rem; margin: 1em 0 0.4em; }
p { margin: 0.5em 0; }
.subtitle { text-align: center; color: var(--muted); font-size: 1.05rem; margin-top: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 16px;
  padding: 16px 26px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--talia);
  color: #fff;
  min-height: 60px;
  min-width: 140px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
  touch-action: manipulation;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); }
.btn.secondary { background: #eef1f4; color: var(--ink); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1); }
.btn.green { background: var(--green); }
.btn.warn { background: var(--red); }
.btn.big { font-size: 1.35rem; padding: 20px 34px; min-height: 72px; }
.btn.block { display: block; width: 100%; margin: 10px 0; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.btn-row .btn { flex: 1 1 160px; }

/* ---------- Profile picker ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 28px 0 10px;
}
.profile-card {
  border: none;
  border-radius: var(--radius);
  padding: 30px 18px 26px;
  cursor: pointer;
  color: #fff;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
  touch-action: manipulation;
}
.profile-card:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15); }
.profile-card.talia { background: var(--talia); }
.profile-card.marina { background: var(--marina); }
.profile-card .emoji { font-size: 3rem; line-height: 1; display: block; margin-bottom: 8px; }
.profile-card .name { font-size: 1.7rem; font-weight: 800; display: block; }
.profile-card .meta { font-size: 1.05rem; opacity: 0.95; display: block; margin-top: 4px; }

/* ---------- Cards & badges ---------- */
.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
}
.badge {
  display: inline-block;
  background: #fff3c4;
  border: 2px solid var(--gold);
  color: #7a5b00;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 4px 0;
}
.badge.off { background: #eef1f4; border-color: #c9d2da; color: var(--muted); }

.notice {
  background: #fff3c4;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 16px 0;
  font-weight: 600;
}

/* ---------- Game buttons ---------- */
.game-grid { display: grid; gap: 14px; margin: 18px 0; }
.game-btn {
  border: none;
  border-radius: var(--radius);
  padding: 22px 20px;
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  text-align: left;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
  touch-action: manipulation;
}
.game-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15); }
.game-btn small { display: block; font-size: 0.95rem; font-weight: 500; opacity: 0.95; margin-top: 4px; }
.game-btn.spelling { background: var(--talia); }
.game-btn.geography { background: var(--green); }
.game-btn.math { background: #7c5cbf; }

/* ---------- Trophy shelf ---------- */
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.trophy {
  background: #fffaf0;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
}
.trophy .g { font-weight: 800; font-size: 1.05rem; }
.trophy .n { font-size: 1.6rem; font-weight: 800; color: var(--gold); text-shadow: 0 1px 0 rgba(0,0,0,0.15); }
.trophy .s { font-size: 0.9rem; color: var(--muted); }

.round-list { list-style: none; margin: 8px 0; padding: 0; }
.round-list li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid #f0e8d2; font-size: 1rem;
}
.round-list li:last-child { border-bottom: none; }
.round-list .when { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

/* ---------- Game screen ---------- */
.progress-line { font-weight: 700; color: var(--muted); text-align: center; margin: 6px 0 2px; }
.question-box {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  margin: 14px 0;
  text-align: center;
}
.question-box .q { font-size: 1.6rem; font-weight: 800; }
.question-box .hint { color: var(--muted); font-size: 1.05rem; margin-top: 10px; }
.question-box .big-word { font-size: 2rem; font-weight: 800; letter-spacing: 0.06em; }

.answer-input {
  width: 100%;
  font-size: 1.4rem;
  padding: 16px 18px;
  border: 3px solid var(--line);
  border-radius: 16px;
  margin: 10px 0;
}
.answer-input:focus { outline: none; border-color: var(--talia); }

.choices { display: grid; gap: 12px; margin: 14px 0; }
.choice-btn {
  border: 3px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 64px;
  text-align: left;
  touch-action: manipulation;
}
.choice-btn.correct { border-color: var(--green); background: #e7f7ee; }
.choice-btn.wrong { border-color: var(--red); background: #fdecea; }

.mic-btn {
  border: none;
  border-radius: 999px;
  width: 92px; height: 92px;
  font-size: 2.4rem;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
  touch-action: manipulation;
}
.mic-btn.listening { background: var(--green); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }

.heard { font-size: 1.1rem; color: var(--muted); min-height: 1.5em; }
.feedback { font-size: 1.4rem; font-weight: 800; min-height: 1.6em; margin: 8px 0; }
.feedback.good { color: var(--green-dark); }
.feedback.bad { color: var(--red); }

/* Number pad (Math Lab) */
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 420px; margin: 14px auto; }
.pad button {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 14px;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 16px 0;
  min-height: 64px;
  cursor: pointer;
  touch-action: manipulation;
}
.pad button:active { background: #f0ead6; }

/* ---------- Results ---------- */
.stars-big { font-size: 3rem; letter-spacing: 0.1em; color: var(--gold); text-shadow: 0 2px 0 rgba(0,0,0,0.15); }
.score-big { font-size: 2.6rem; font-weight: 800; }
.level-note {
  font-size: 1.3rem; font-weight: 800; color: var(--green-dark);
  background: #e7f7ee; border: 2px solid var(--green);
  border-radius: 16px; padding: 14px; margin: 14px 0;
}

/* ---------- Grown-ups ---------- */
.grownups-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0e8d2; }
.grownups-row:last-child { border-bottom: none; }
select, .toggle {
  font-size: 1.1rem; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: #fff; min-height: 52px;
}
label.switch { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
label.switch input { width: 28px; height: 28px; }

.link-btn {
  background: none; border: none; color: var(--muted); text-decoration: underline;
  font-size: 1rem; cursor: pointer; padding: 12px; min-height: 48px;
}

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.topbar .back { flex: 0 0 auto; }

/* ---------- Layout tweaks ---------- */
@media (max-width: 600px) {
  html, body { font-size: 18px; }
  .profile-grid { grid-template-columns: 1fr; }
  .shelf { grid-template-columns: 1fr; }
  h1 { font-size: 1.8rem; }
  .question-box .q { font-size: 1.35rem; }
}
@media (min-width: 700px) {
  .choices { grid-template-columns: 1fr 1fr; }
}
