:root {
  color-scheme: light;
  --ink: #32142f;
  --muted: #72566d;
  --paper: #fff6fb;
  --panel: #ffffff;
  --teal: #27b0a8;
  --yellow: #ffd166;
  --coral: #ff6f91;
  --green: #51b86d;
  --blue: #4776d0;
  --violet: #8b5bd6;
  --pink: #ff8bc7;
  --plum: #7b1e5d;
  --line: rgba(123, 30, 93, 0.16);
  --shadow: 0 18px 45px rgba(123, 30, 93, 0.16);
  --soft-shadow: 0 12px 28px rgba(123, 30, 93, 0.14);
  --profile-primary: #ff8bc7;
  --profile-accent: #ffd166;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 139, 199, 0.34), transparent 32rem),
    radial-gradient(circle at 88% 12%, rgba(255, 209, 102, 0.28), transparent 26rem),
    linear-gradient(180deg, #fff0f8 0%, var(--paper) 44%, #fff9e8 100%);
  color: var(--ink);
  font-family: Inter, ui-rounded, "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  min-width: 0;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

.app-shell {
  margin: 0 auto;
  max-width: 1220px;
  min-height: 100vh;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  position: relative;
}

[hidden] {
  display: none !important;
}

.hero {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(300px, 1fr) minmax(280px, 0.48fr);
  min-height: 332px;
  position: relative;
}

.login-hero {
  min-height: min(720px, calc(100vh - 92px));
}

.sky-art {
  background:
    linear-gradient(90deg, rgba(45, 18, 51, 0.36), rgba(45, 18, 51, 0.02) 44%, rgba(18, 52, 59, 0.2)),
    linear-gradient(135deg, #7b1e5d 0%, #bd3f8c 48%, #27b0a8 100%);
  border-radius: 8px;
  box-shadow: var(--shadow);
  grid-column: 1 / -1;
  inset: 0;
  overflow: hidden;
  position: absolute;
  z-index: 0;
}

.sky-art::after {
  background:
    linear-gradient(90deg, rgba(18, 52, 59, 0.18), rgba(255, 255, 255, 0.08), rgba(18, 52, 59, 0.14));
  bottom: 0;
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.hero-illustration {
  bottom: 0;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.98;
  position: absolute;
  right: 0;
  width: 100%;
}

.planet {
  border-radius: 999px;
  position: absolute;
}

.planet-one {
  background: linear-gradient(135deg, var(--yellow), #fff7b8);
  height: 138px;
  right: 10%;
  top: 26px;
  width: 138px;
}

.planet-two {
  background: linear-gradient(135deg, var(--pink), #ffc2de);
  bottom: 42px;
  height: 82px;
  right: 31%;
  width: 82px;
}

.rocket {
  background: #fffaf0;
  border: 5px solid rgba(18, 52, 59, 0.25);
  border-radius: 50% 50% 42% 42%;
  height: 130px;
  left: 44%;
  position: absolute;
  top: 72px;
  transform: rotate(20deg);
  width: 62px;
}

.rocket::before {
  background: var(--plum);
  border-radius: 999px;
  content: "";
  height: 30px;
  left: 11px;
  position: absolute;
  top: 28px;
  width: 30px;
}

.rocket::after {
  background: linear-gradient(var(--yellow), var(--pink));
  border-radius: 0 0 18px 18px;
  bottom: -42px;
  content: "";
  height: 44px;
  left: 13px;
  position: absolute;
  width: 28px;
}

.rocket span {
  background: var(--pink);
  bottom: 8px;
  height: 26px;
  left: -15px;
  position: absolute;
  transform: skewY(-26deg);
  width: 22px;
}

.star {
  background: #fff6bf;
  border-radius: 999px;
  box-shadow: 0 0 12px #fff6bf;
  height: 8px;
  position: absolute;
  width: 8px;
}

.s1 { left: 9%; top: 18%; }
.s2 { left: 23%; top: 55%; }
.s3 { right: 18%; top: 58%; }
.s4 { right: 48%; top: 18%; }

.hero-copy,
.player-panel {
  position: relative;
  z-index: 1;
}

.login-card {
  max-width: 312px;
}

.hero-copy {
  align-self: end;
  color: white;
  padding: 36px 28px 26px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.hero-badges span {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: white;
  font-size: 0.85rem;
  font-weight: 900;
  padding: 9px 12px;
  white-space: nowrap;
}

.kicker,
.brand-kicker,
.panel-label {
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-kicker {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  display: inline-block;
  padding: 8px 12px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.45rem, 5vw, 4.4rem);
  line-height: 0.95;
  margin-bottom: 0;
  max-width: 420px;
}

h2 {
  margin-bottom: 0;
}

.intro {
  font-size: 1.12rem;
  line-height: 1.5;
  margin-bottom: 0;
  max-width: 600px;
}

.player-panel,
.progress-panel,
.game-card {
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 252, 0.9));
  border: 1px solid rgba(123, 30, 93, 0.16);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.player-panel {
  align-self: end;
  display: grid;
  gap: 7px;
  margin: 14px;
  padding: 10px 12px;
}

.panel-title-row {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.panel-title-row.small {
  align-items: baseline;
  margin-bottom: 8px;
}

.tab-button,
.primary-action,
.secondary-action,
.icon-action,
.answer-button,
.memory-tile,
.tile-button {
  border-radius: 8px;
  min-height: 48px;
}

.login-panel {
  background:
    linear-gradient(135deg, rgba(255, 240, 248, 0.94), rgba(239, 255, 252, 0.9));
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 8px;
}

.login-panel label,
.parent-dashboard label {
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  font-weight: 850;
  gap: 4px;
  min-width: 0;
}

.login-panel p {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  margin: 0;
}

.pin-row {
  display: grid;
  gap: 5px;
  grid-template-columns: minmax(0, 1fr) 82px;
}

.login-help.error {
  color: var(--coral);
}

.login-help.success {
  color: var(--green);
}

input,
select {
  background: white;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
}

.dashboard {
  display: grid;
  gap: 18px;
  grid-template-columns: 330px minmax(0, 1fr);
  margin-top: 18px;
}

.parent-dashboard {
  display: grid;
  gap: 18px;
  grid-template-columns: 360px minmax(0, 1fr);
  margin-top: 18px;
}

.progress-panel {
  align-content: start;
  display: grid;
  gap: 18px;
  padding: 20px;
  position: relative;
}

.progress-panel::before {
  background: linear-gradient(180deg, var(--profile-primary), var(--profile-accent));
  border-radius: 999px;
  content: "";
  height: calc(100% - 34px);
  left: 0;
  opacity: 0.72;
  position: absolute;
  top: 17px;
  width: 5px;
}

.progress-panel h2,
.game-header h2 {
  font-size: 1.5rem;
  line-height: 1.15;
}

.meter-wrap p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  margin: 8px 0 0;
}

.path-text {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 8px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-meter {
  background: rgba(123, 30, 93, 0.1);
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
  padding: 3px;
}

.daily-meter span {
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--teal));
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 180ms ease;
  width: 0%;
}

.stat-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
}

.stat-grid div {
  background: linear-gradient(135deg, #fff7fc, #effffc);
  border: 1px solid rgba(123, 30, 93, 0.08);
  border-radius: 8px;
  min-width: 0;
  padding: 12px 8px;
  text-align: center;
}

.stat-grid span {
  display: block;
  font-size: clamp(0.92rem, 2.3vw, 1.25rem);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.stat-grid p {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 850;
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}

.reward-panel {
  background: linear-gradient(135deg, rgba(255, 240, 248, 0.9), rgba(239, 255, 252, 0.84));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.mission-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(239, 255, 252, 0.78));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.mission-panel .panel-title-row span {
  color: var(--plum);
  font-size: 0.82rem;
  font-weight: 950;
}

.mission-list {
  display: grid;
  gap: 7px;
}

.mission-item {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(123, 30, 93, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 38px;
  padding: 7px;
}

.mission-item span {
  background: #fff0f8;
  border-radius: 8px;
  color: var(--plum);
  font-size: 0.76rem;
  font-weight: 950;
  padding: 6px 4px;
  text-align: center;
}

.mission-item strong {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.15;
}

.mission-item.done {
  background: linear-gradient(135deg, #fff2bc, #e7fff8);
  border-color: rgba(39, 176, 168, 0.3);
}

.reward-title span {
  color: var(--plum);
  font-size: 0.82rem;
  font-weight: 950;
}

.reward-track {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reward-node {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(123, 30, 93, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: 38px minmax(0, 1fr);
  min-height: 52px;
  padding: 7px;
}

.reward-node span {
  align-items: center;
  background: #f2ddeb;
  border-radius: 8px;
  color: rgba(50, 20, 47, 0.42);
  display: flex;
  font-size: 0.9rem;
  font-weight: 950;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.reward-node strong {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward-node.earned {
  background: linear-gradient(135deg, #fff2bc, #ffd9ec);
  border-color: #f5bf42;
  box-shadow: 0 8px 18px rgba(245, 191, 66, 0.2);
}

.reward-node.earned span {
  background: white;
  color: var(--plum);
}

.reward-node.earned strong {
  color: var(--ink);
}

.check-line {
  align-items: center;
  display: flex !important;
  gap: 8px !important;
}

.check-line input {
  min-height: 0;
}

.subject-checks {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, 1fr);
}

.history-panel {
  background: #f7fbf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 168px;
  overflow: auto;
}

.history-item {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  padding: 8px;
}

.family-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 22px 0;
}

.family-card {
  background: #fff7fc;
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 14px;
}

.family-card.active {
  background: #fff0f8;
  border-color: var(--yellow);
}

.family-card h3,
.family-card p {
  margin: 0;
}

.family-card h3 {
  font-size: 1.1rem;
}

.family-card p,
.family-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-card strong {
  font-size: 1.3rem;
}

.play-area {
  min-width: 0;
}

.game-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab-button {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-button.active {
  background: linear-gradient(135deg, var(--plum), var(--pink));
  color: white;
}

.tab-button[disabled] {
  opacity: 0.42;
}

.game-card {
  min-height: 512px;
  padding: 22px;
  overflow: hidden;
  position: relative;
}

.game-card::before {
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--teal));
  content: "";
  height: 6px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.game-header {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.guide-row {
  align-items: center;
  display: flex;
  gap: 14px;
}

.guide-character {
  background: #fff;
  border: 4px solid white;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  flex: 0 0 auto;
  height: 82px;
  position: relative;
  width: 82px;
}

.guide-character img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.guide-character::before,
.guide-character::after {
  content: none;
}

.guide-character::before {
  left: 22px;
}

.guide-character::after {
  right: 22px;
}

.guide-character span {
  display: none;
}

.guide-character.math { border-color: #ffd166; }
.guide-character.words { border-color: #ff8bc7; }
.guide-character.science { border-color: #27b0a8; }
.guide-character.geography { border-color: #4776d0; }
.guide-character.logic { border-color: #8b5bd6; }
.guide-character.memory { border-color: #ffd166; }
.guide-character.puzzle { border-color: #12343b; }
.guide-character.art { border-color: #ff6f91; }

.primary-action,
.secondary-action,
.icon-action {
  border: 0;
  font-weight: 900;
  overflow: hidden;
  padding: 0 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-action {
  background: linear-gradient(135deg, var(--plum), var(--pink));
  color: white;
  min-width: 134px;
}

.login-card .primary-action {
  min-width: 0;
  padding: 0 10px;
}

.login-card .icon-action {
  min-width: 0;
  padding: 0 10px;
}

.secondary-action,
.icon-action {
  background: #e9f1ef;
  color: var(--ink);
}

.sign-out-action {
  background: #fff0f8;
  border: 2px solid var(--line);
  color: var(--plum);
}

.global-sign-out {
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--soft-shadow);
  color: var(--plum);
  font-weight: 950;
  min-height: 42px;
  padding: 0 16px;
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  top: max(14px, env(safe-area-inset-top));
  z-index: 20;
}

.answer-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.answer-button,
.tile-button {
  background: linear-gradient(180deg, #ffffff, #fff8fc);
  border: 2px solid var(--line);
  box-shadow: 0 8px 16px rgba(18, 52, 59, 0.07);
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
  min-height: 82px;
  overflow: hidden;
  padding: 12px;
  text-overflow: ellipsis;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  white-space: nowrap;
}

.answer-button:hover,
.tile-button:hover {
  border-color: rgba(123, 30, 93, 0.34);
  box-shadow: 0 12px 24px rgba(123, 30, 93, 0.13);
}

.picture-button {
  display: grid;
  font-size: 1rem;
  gap: 8px;
  justify-items: center;
  white-space: nowrap;
}

.picture-button strong {
  align-items: center;
  background: #f3f8f6;
  border-radius: 8px;
  display: flex;
  font-size: 2.5rem;
  height: 78px;
  justify-content: center;
  width: 100%;
}

.counting-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.counting-prompt {
  align-items: center;
  background: linear-gradient(135deg, #fff7fc, #e8fffb);
  border: 2px solid rgba(123, 30, 93, 0.14);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 142px;
  padding: 18px;
}

.count-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 310px;
}

.count-group span {
  align-items: center;
  background: linear-gradient(135deg, #fff, #fff0f8);
  border: 2px solid rgba(123, 30, 93, 0.12);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(123, 30, 93, 0.1);
  color: var(--profile-primary);
  display: flex;
  font-size: 2.05rem;
  font-weight: 950;
  height: 54px;
  justify-content: center;
  line-height: 1;
  width: 54px;
}

.count-symbol {
  color: var(--plum);
  font-size: 1.45rem;
  font-weight: 950;
}

.counting-answer {
  gap: 10px;
  min-height: 156px;
}

.counting-answer strong {
  color: var(--plum);
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.answer-button:active,
.tab-button:active,
.primary-action:active,
.secondary-action:active,
.icon-action:active,
.tile-button:active {
  transform: translateY(1px);
}

.answer-button.correct {
  background: #e7f7df;
  border-color: var(--green);
}

.answer-button.wrong {
  background: #ffe7e3;
  border-color: var(--coral);
}

.feedback {
  background: linear-gradient(135deg, #fff0f8, #effffc);
  border-radius: 8px;
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.4;
  margin-top: 18px;
  min-height: 62px;
  overflow: hidden;
  padding: 16px;
  text-overflow: ellipsis;
  white-space: normal;
}

.feedback.good {
  background: linear-gradient(135deg, #e7f7df, #fff8c8);
  border: 2px solid rgba(81, 184, 109, 0.35);
  color: #246d35;
}

.feedback.try {
  background: linear-gradient(135deg, #fff0f8, #fff7df);
  border: 2px solid rgba(255, 111, 145, 0.3);
}

.mascot-crew {
  align-items: end;
  bottom: 72px;
  display: flex;
  gap: 16px;
  position: absolute;
  right: 11%;
  z-index: 1;
}

.mascot {
  border: 5px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 30px rgba(50, 20, 47, 0.18);
  position: relative;
}

.mascot::before,
.mascot::after,
.mascot-face::before,
.mascot-face::after {
  content: "";
  position: absolute;
}

.mascot::before,
.mascot::after {
  background: var(--ink);
  border-radius: 999px;
  height: 8px;
  top: 32%;
  width: 8px;
}

.mascot::before { left: 28%; }
.mascot::after { right: 28%; }

.mascot-face::before {
  border: 3px solid var(--ink);
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0 0 999px 999px;
  bottom: 26%;
  height: 10px;
  left: 34%;
  width: 32%;
}

.mascot-crown {
  background: linear-gradient(135deg, var(--yellow), #fff2bc);
  border-radius: 8px;
  height: 92px;
  width: 92px;
}

.mascot-crown .mascot-face::after {
  background: linear-gradient(135deg, var(--pink), var(--plum));
  clip-path: polygon(0 100%, 18% 35%, 38% 70%, 50% 8%, 64% 70%, 84% 35%, 100% 100%);
  height: 30px;
  left: 12px;
  top: -24px;
  width: 58px;
}

.mascot-gem {
  background: linear-gradient(135deg, #ffffff, #9ff0e8 45%, var(--teal));
  clip-path: polygon(50% 0, 100% 34%, 82% 100%, 18% 100%, 0 34%);
  height: 88px;
  width: 88px;
}

.mascot-star {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  clip-path: polygon(50% 0, 63% 32%, 98% 35%, 72% 57%, 80% 92%, 50% 74%, 20% 92%, 28% 57%, 2% 35%, 37% 32%);
  height: 96px;
  width: 96px;
}

.memory-board,
.tile-board {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 24px;
}

.memory-timer {
  background: linear-gradient(135deg, #fff7fc, #effffc);
  border: 2px solid rgba(123, 30, 93, 0.14);
  border-radius: 8px;
  color: var(--plum);
  font-size: 1.05rem;
  font-weight: 950;
  grid-column: 1 / -1;
  min-height: 44px;
  padding: 10px 12px;
  text-align: center;
}

.memory-tile {
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--violet), var(--pink));
  border: 0;
  color: white;
  font-size: clamp(1.25rem, 5vw, 2.3rem);
  font-weight: 900;
  min-height: 0;
  position: relative;
}

.memory-tile.matched {
  background: var(--green);
}

.memory-tile .tile-front {
  display: none;
}

.memory-tile.revealed .tile-front,
.memory-tile.matched .tile-front {
  display: inline;
}

.memory-tile.revealed .tile-back,
.memory-tile.matched .tile-back {
  display: none;
}

.spelling-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  white-space: nowrap;
}

.letter-slot,
.letter-tile {
  align-items: center;
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex: 0 0 56px;
  font-size: 1.5rem;
  font-weight: 900;
  justify-content: center;
}

.letter-slot {
  background: #f3f8f6;
  border: 2px dashed var(--line);
}

.letter-tile {
  background: white;
  border: 2px solid var(--plum);
  color: var(--plum);
}

.spelling-controls {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.spelling-backspace {
  min-width: 128px;
}

.drawing-canvas {
  background: white;
  border: 2px solid var(--line);
  border-radius: 8px;
  display: block;
  height: 320px;
  touch-action: none;
  width: 100%;
}

.draw-tools {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.draw-tool {
  border: 0;
  border-radius: 8px;
  min-height: 48px;
}

.draw-tool.active {
  outline: 4px solid rgba(18, 52, 59, 0.2);
}

.crown-mark {
  background: linear-gradient(135deg, #fff7b8, var(--yellow));
  border: 5px solid rgba(255, 255, 255, 0.55);
  bottom: 34px;
  height: 74px;
  left: 11%;
  position: absolute;
  transform: rotate(-8deg);
  width: 150px;
}

.crown-mark::before {
  background:
    linear-gradient(135deg, transparent 0 50%, #fff7b8 51%),
    linear-gradient(45deg, transparent 0 50%, #ffd166 51%);
  content: "";
  height: 72px;
  left: 0;
  position: absolute;
  right: 0;
  top: -58px;
}

.crown-mark span {
  background: var(--plum);
  border-radius: 999px;
  display: block;
  height: 18px;
  left: 66px;
  position: absolute;
  top: 28px;
  width: 18px;
}

.gem {
  background: linear-gradient(135deg, #fff, #9ff0e8 42%, var(--teal));
  clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
  height: 58px;
  position: absolute;
  width: 58px;
}

.gem-one {
  left: 32%;
  top: 38px;
  transform: rotate(12deg);
}

.gem-two {
  bottom: 96px;
  right: 8%;
  transform: rotate(-16deg);
}

.site-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.82rem;
  font-weight: 850;
  gap: 12px;
  justify-content: space-between;
  padding: 18px 4px 0;
}

.site-footer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero,
  .dashboard,
  .parent-dashboard {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 540px;
  }

  .hero-copy {
    padding: 26px 18px 0;
  }

  .player-panel {
    align-self: end;
    margin: 0 12px 12px;
  }

  .rocket {
    left: 62%;
    opacity: 0.82;
    top: 178px;
  }

  .mascot-crew {
    bottom: 112px;
    right: 24px;
    transform: scale(0.78);
    transform-origin: bottom right;
  }

  .game-card {
    min-height: 450px;
    padding: 16px;
  }

  .game-header {
    display: grid;
  }

  .guide-row {
    align-items: start;
  }

  .primary-action {
    width: 100%;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 3.2rem;
  }

  .pin-row {
    grid-template-columns: 1fr;
  }

  .mascot-crew {
    opacity: 0.7;
    right: -8px;
    transform: scale(0.62);
  }

  .guide-character {
    height: 58px;
    width: 58px;
  }

  .guide-character::before,
  .guide-character::after {
    top: 22px;
  }

  .guide-character::before { left: 16px; }
  .guide-character::after { right: 16px; }

  .guide-character span {
    bottom: 14px;
    left: 18px;
  }

  .answer-grid {
    grid-template-columns: 1fr;
  }

  .memory-board,
  .tile-board {
    grid-template-columns: repeat(3, 1fr);
  }

  .family-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .family-grid {
    grid-template-columns: 1fr;
  }
}
