:root {
  color-scheme: light;
  --ink: #142033;
  --muted: #5c6a7d;
  --paper: #fffaf2;
  --paper-strong: #fff;
  --line: rgba(20, 32, 51, 0.12);
  --navy: #12233f;
  --blue: #0b6f8f;
  --cyan: #22b8cf;
  --mint: #27d3a2;
  --sun: #ffbf3f;
  --coral: #ff6b7a;
  --grape: #7c5cff;
  --lime: #b6e34a;
  --shadow: 0 24px 80px rgba(18, 35, 63, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 191, 63, 0.35), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(124, 92, 255, 0.24), transparent 26%),
    radial-gradient(circle at 78% 78%, rgba(39, 211, 162, 0.28), transparent 26%),
    linear-gradient(135deg, #fff7dc 0%, #e7fbff 42%, #f5edff 100%);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}

.shape {
  position: absolute;
  display: block;
  border: 3px solid rgba(18, 35, 63, 0.08);
  animation: floaty 10s ease-in-out infinite;
}

.shape-one {
  width: 140px;
  height: 140px;
  left: 5vw;
  top: 14vh;
  border-radius: 36px;
  background: rgba(255, 107, 122, 0.2);
}

.shape-two {
  width: 90px;
  height: 90px;
  right: 10vw;
  top: 20vh;
  border-radius: 999px;
  background: rgba(34, 184, 207, 0.24);
  animation-delay: -2s;
}

.shape-three {
  width: 180px;
  height: 90px;
  right: 16vw;
  bottom: 9vh;
  border-radius: 999px;
  background: rgba(255, 191, 63, 0.22);
  animation-delay: -4s;
}

.shape-four {
  width: 110px;
  height: 110px;
  left: 18vw;
  bottom: 12vh;
  transform: rotate(20deg);
  background: rgba(124, 92, 255, 0.18);
  animation-delay: -6s;
}

.app {
  position: relative;
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 42px);
}

.screen {
  animation: enter 360ms ease both;
}

.hidden {
  display: none !important;
}

.profile-screen,
.role-screen {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
}

.hero-panel,
.mission-control,
.coach-panel,
.trend-panel,
.training-panel,
.question-stage,
.result-hero,
.training-card {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  position: relative;
  width: min(760px, 100%);
  padding: clamp(26px, 6vw, 56px);
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  top: -50px;
  border-radius: 50%;
  background: conic-gradient(from 90deg, var(--sun), var(--coral), var(--grape), var(--cyan), var(--sun));
  opacity: 0.26;
  animation: spin 10s linear infinite;
}

.quest-mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 28px);
  gap: 9px;
  width: max-content;
  margin-bottom: 18px;
}

.quest-mark span {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--sun);
  box-shadow: 0 8px 20px rgba(255, 191, 63, 0.35);
}

.quest-mark span:nth-child(2) {
  background: var(--cyan);
  animation: bounce 1.8s ease-in-out infinite;
}

.quest-mark span:nth-child(3) {
  background: var(--coral);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

h1 {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  font-size: clamp(3.4rem, 11vw, 7.5rem);
  line-height: 0.88;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 56ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.55;
}

.profile-form {
  position: relative;
  z-index: 1;
  margin-top: 28px;
}

.role-panel h1 {
  font-size: clamp(3rem, 9vw, 6.2rem);
}

.role-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.role-card {
  min-height: 168px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(255, 191, 63, 0.3), rgba(255, 255, 255, 0.86));
  color: var(--navy);
  text-align: left;
  box-shadow: 0 16px 34px rgba(18, 35, 63, 0.12);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.role-card.parent {
  background: linear-gradient(135deg, rgba(34, 184, 207, 0.28), rgba(255, 255, 255, 0.86));
}

.role-card:hover,
.role-card.selected {
  border-color: var(--cyan);
  box-shadow: 0 20px 42px rgba(34, 184, 207, 0.2);
  transform: translateY(-2px);
}

.role-card strong,
.role-card span {
  display: block;
}

.role-card strong {
  margin-bottom: 12px;
  font-size: 2rem;
  font-weight: 1000;
}

.role-card span {
  color: var(--muted);
  font-weight: 850;
  line-height: 1.45;
}

.password-form {
  position: relative;
  z-index: 1;
  margin-top: 18px;
}

.password-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 950;
}

.profile-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 900;
}

.profile-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input,
textarea {
  width: 100%;
  border: 2px solid rgba(11, 111, 143, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
}

input {
  min-height: 58px;
  padding: 0 18px;
  font-size: 1.2rem;
  font-weight: 800;
}

textarea {
  min-height: 260px;
  padding: 18px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 5px rgba(34, 184, 207, 0.16);
}

.button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  padding: 0 20px;
  font-weight: 950;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--grape));
  box-shadow: 0 14px 28px rgba(11, 111, 143, 0.25);
}

.button-soft {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.button-compact {
  min-height: 42px;
  border-radius: 14px;
  padding: 0 14px 0 10px;
  font-size: 0.92rem;
}

.button-compact span {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  margin-right: 8px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--sun), var(--coral));
  font-weight: 1000;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}

.kid-action {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 22px rgba(18, 35, 63, 0.1);
}

.grammar-action span {
  position: relative;
  background: linear-gradient(135deg, #ffbf3f, #ff6b7a);
  font-size: 1rem;
}

.grammar-action span::before,
.grammar-action span::after {
  content: "";
  position: absolute;
  background: #fff;
}

.grammar-action span::before {
  width: 16px;
  height: 8px;
  left: 7px;
  top: 8px;
  border-radius: 999px 999px 6px 6px;
}

.grammar-action span::after {
  width: 11px;
  height: 11px;
  right: 5px;
  bottom: 5px;
  border-radius: 50%;
}

.games-action span {
  background: linear-gradient(135deg, var(--grape), var(--cyan));
  font-size: 1.1rem;
}

.switch-corner {
  position: absolute;
  top: clamp(12px, 2vw, 22px);
  right: clamp(12px, 2vw, 22px);
  z-index: 8;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 0.78rem;
  opacity: 0.82;
  box-shadow: 0 8px 20px rgba(18, 35, 63, 0.08);
}

.parent-corner-actions {
  position: absolute;
  top: clamp(12px, 2vw, 22px);
  right: clamp(12px, 2vw, 22px);
  z-index: 8;
  display: flex;
  gap: 8px;
}

.parent-corner-button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 0.78rem;
  opacity: 0.86;
  box-shadow: 0 8px 20px rgba(18, 35, 63, 0.08);
}

.button-danger {
  color: #fff;
  background: linear-gradient(135deg, #c92a2a, var(--coral));
  box-shadow: 0 14px 28px rgba(201, 42, 42, 0.18);
}

.saved-profiles {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.saved-label {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.profile-chip,
.training-chip {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--navy);
  background: #fff;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(18, 35, 63, 0.1);
}

.app-header,
.test-topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.star-bank,
.timer {
  min-width: 116px;
  padding: 12px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff7d4, #fff);
  border: 1px solid rgba(255, 191, 63, 0.45);
  text-align: center;
  box-shadow: 0 14px 30px rgba(255, 191, 63, 0.16);
}

.star-bank span,
.timer span {
  display: block;
  font-size: 1.8rem;
  font-weight: 1000;
}

.star-bank small,
.timer small {
  color: var(--muted);
  font-weight: 900;
}

.dashboard-grid,
.insight-grid,
.parent-grid {
  display: grid;
  gap: 18px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
}

.insight-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  margin-top: 18px;
}

.parent-recommendation,
.parent-card {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.parent-recommendation {
  margin-bottom: 18px;
  padding: clamp(18px, 3vw, 28px);
  background:
    linear-gradient(135deg, rgba(255, 191, 63, 0.36), rgba(39, 211, 162, 0.2)),
    rgba(255, 250, 242, 0.9);
}

.parent-recommendation h3 {
  margin-bottom: 8px;
}

.parent-recommendation p {
  max-width: 78ch;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 820;
  line-height: 1.5;
}

.parent-grid {
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1fr);
  margin-bottom: 18px;
}

.parent-grid.wide {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.parent-card {
  padding: clamp(18px, 3vw, 26px);
}

.parent-profile-list {
  display: grid;
  gap: 10px;
}

.parent-profile-button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--navy);
  text-align: left;
  font-weight: 950;
}

.parent-profile-button.active {
  border-color: var(--cyan);
  box-shadow: 0 10px 24px rgba(34, 184, 207, 0.16);
}

.parent-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.parent-stat {
  min-height: 104px;
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
}

.parent-stat strong,
.parent-stat span {
  display: block;
}

.parent-stat strong {
  font-size: 2rem;
  line-height: 1;
}

.parent-stat span {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 850;
}

.parent-table {
  display: grid;
  gap: 10px;
}

.parent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
}

.parent-row h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.25;
}

.parent-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 780;
}

.parent-row strong {
  align-self: center;
  min-width: 92px;
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 191, 63, 0.2);
  color: var(--navy);
  text-align: center;
}

.parent-row details {
  grid-column: 1 / -1;
}

.parent-row summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 1000;
}

.parent-row .detail-panel {
  margin-top: 10px;
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 760;
  line-height: 1.45;
}

.mission-control,
.coach-panel,
.trend-panel,
.training-panel {
  padding: clamp(18px, 3vw, 28px);
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading.compact {
  margin-bottom: 10px;
}

.level-map {
  display: grid;
  gap: 12px;
}

.level-node {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 84px;
  border: 2px solid transparent;
  border-radius: 22px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
  transition:
    transform 160ms ease,
    border 160ms ease,
    box-shadow 160ms ease;
}

.level-node:hover,
.level-node:focus-visible {
  border-color: rgba(34, 184, 207, 0.5);
  box-shadow: 0 12px 28px rgba(34, 184, 207, 0.16);
  transform: translateY(-2px);
  outline: 0;
}

.level-node.completed .level-orb {
  background: linear-gradient(135deg, var(--mint), var(--cyan));
}

.level-node[data-level="8"] {
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(255, 191, 63, 0.2)),
    rgba(255, 255, 255, 0.82);
  border-color: rgba(124, 92, 255, 0.24);
}

.level-node[data-level="8"] .level-orb {
  background: linear-gradient(135deg, var(--grape), var(--coral));
}

.level-orb {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--sun), var(--coral));
  font-size: 1.35rem;
  font-weight: 1000;
}

.level-copy strong,
.level-score {
  display: block;
  font-weight: 1000;
}

.level-copy small,
.level-score small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.level-score {
  min-width: 70px;
  text-align: right;
}

.coach-panel {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(150deg, rgba(18, 35, 63, 0.96), rgba(11, 111, 143, 0.9)),
    var(--navy);
}

.coach-panel .eyebrow,
.coach-panel p {
  color: rgba(255, 255, 255, 0.78);
}

.coach-panel h3 {
  color: #fff;
}

.coach-panel::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -60px;
  bottom: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 191, 63, 0.5), transparent 70%);
}

.coach-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.coach-stats div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
}

.coach-stats strong,
.coach-stats span {
  display: block;
}

.coach-stats strong {
  font-size: 1.35rem;
}

.coach-stats span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.8rem;
  font-weight: 800;
}

.chart-wrap {
  min-height: 220px;
}

.chart-wrap svg {
  width: 100%;
  height: auto;
}

.chart-axis {
  stroke: rgba(20, 32, 51, 0.16);
  stroke-width: 3;
}

.trend-line {
  fill: none;
  stroke: url(#trendGradient);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 10px rgba(11, 111, 143, 0.18));
}

.trend-dot {
  fill: #fff;
  stroke: var(--grape);
  stroke-width: 5;
}

.training-queue {
  display: grid;
  gap: 10px;
}

.training-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border-radius: 18px;
}

.training-chip small {
  color: var(--blue);
  font-weight: 900;
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 22px;
  border: 2px dashed rgba(11, 111, 143, 0.18);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
  font-weight: 850;
}

.empty-state.bright {
  background: rgba(39, 211, 162, 0.12);
  color: var(--navy);
}

.test-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  grid-template-columns: auto 1fr auto;
  padding: 12px 0;
  backdrop-filter: blur(18px);
}

.test-title h2 {
  font-size: clamp(1.45rem, 4vw, 2.6rem);
}

.timer {
  background: linear-gradient(135deg, #e8fff8, #fff);
  border-color: rgba(39, 211, 162, 0.48);
}

.timer.urgent {
  background: linear-gradient(135deg, #fff0f1, #fff);
  border-color: rgba(255, 107, 122, 0.65);
  animation: pulse 1s ease-in-out infinite;
}

.test-progress {
  height: 14px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
}

.test-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sun), var(--mint), var(--cyan), var(--grape));
  transition: width 220ms ease;
}

.question-stage {
  padding: clamp(20px, 4vw, 38px);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.question-meta span {
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 1000;
}

#questionPrompt {
  white-space: pre-line;
  font-size: clamp(1.45rem, 4vw, 2.5rem);
  line-height: 1.18;
}

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

.options-grid.mini {
  margin-top: 12px;
}

.option-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  border: 2px solid rgba(20, 32, 51, 0.1);
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-align: left;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.option-card:hover,
.option-card:focus-visible,
.option-card.selected {
  border-color: var(--cyan);
  box-shadow: 0 12px 28px rgba(34, 184, 207, 0.16);
  transform: translateY(-1px);
  outline: 0;
}

.option-card span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--sun), var(--coral));
  color: #fff;
  font-weight: 1000;
}

.option-card.correct {
  border-color: var(--mint);
  background: rgba(39, 211, 162, 0.12);
}

.option-card.wrong {
  border-color: var(--coral);
  background: rgba(255, 107, 122, 0.12);
}

.test-actions,
.result-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.result-hero {
  padding: clamp(22px, 5vw, 42px);
  text-align: center;
}

.result-hero h2 {
  margin-bottom: 12px;
}

.result-score {
  display: grid;
  width: min(250px, 100%);
  min-height: 160px;
  place-items: center;
  margin: 22px auto;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--sun), var(--coral));
  color: #fff;
  box-shadow: 0 20px 46px rgba(255, 107, 122, 0.24);
}

.result-score strong,
.result-score span {
  display: block;
}

.result-score strong {
  font-size: 4rem;
  line-height: 0.9;
}

.result-score span {
  font-weight: 900;
}

.result-actions {
  justify-content: center;
  flex-wrap: wrap;
}

.review-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.review-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
}

.review-card h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  white-space: pre-line;
}

.review-card p {
  color: var(--muted);
}

.answer-note {
  margin-bottom: 0;
  font-weight: 900;
}

.training-header {
  margin-bottom: 18px;
}

.training-card {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  padding: clamp(20px, 4vw, 34px);
}

.game-stage {
  position: relative;
  min-height: min(68vh, 640px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(18, 35, 63, 0.95), rgba(11, 111, 143, 0.88)),
    var(--navy);
  box-shadow: var(--shadow);
  touch-action: none;
}

.game-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.75) 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 191, 63, 0.8) 1px, transparent 2px);
  background-position: 0 0, 40px 60px;
  background-size: 90px 90px, 130px 130px;
  opacity: 0.28;
  animation: starfield 8s linear infinite;
}

.game-stage.meteor {
  background: linear-gradient(180deg, #201245, #0b6f8f);
}

.game-stage.rainbow {
  background: linear-gradient(180deg, #0e3150, #7c5cff);
}

.game-stage.number {
  background: linear-gradient(180deg, #14351f, #0b6f8f);
}

.game-stage.comet {
  background: linear-gradient(180deg, #36164d, #12233f);
}

.game-stage.treasure {
  background: linear-gradient(180deg, #513515, #0b6f8f);
}

.game-stage.cosmic {
  background: linear-gradient(180deg, #101329, #7c5cff);
}

.game-stage.final {
  background: linear-gradient(180deg, #111827, #c92a2a);
}

.game-stage.burst .player-ship,
.game-stage.rainbow .player-ship,
.game-stage.comet .player-ship,
.game-stage.cosmic .player-ship,
.game-stage.final .player-ship {
  display: none;
}

.game-stage.drift .player-ship,
.game-stage.meteor .player-ship,
.game-stage.number .player-ship,
.game-stage.treasure .player-ship {
  height: 42px;
  width: 96px;
  border-radius: 18px 18px 10px 10px;
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(255,255,255,0.9) 16% 30%, transparent 30% 70%, rgba(255,255,255,0.9) 70% 84%, transparent 84%),
    linear-gradient(135deg, var(--coral), var(--sun));
}

.game-hud {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 2;
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.game-hud strong,
.game-hud span {
  display: block;
}

.game-hud strong {
  font-size: 2rem;
  line-height: 1;
}

.player-ship {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 3;
  width: 112px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--sun), var(--coral));
  box-shadow: 0 0 30px rgba(255, 191, 63, 0.6);
  transform: translateX(-50%);
}

.falling-star {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--sun), #fff3a3);
  color: var(--navy);
  font-weight: 1000;
  box-shadow: 0 0 22px rgba(255, 191, 63, 0.75);
}

.burst-target {
  border: 0;
  border-radius: 50% 50% 46% 46%;
  transform: translateX(-50%);
}

.burst-target::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 2px;
  height: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.game-help {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  max-width: 320px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 850;
  text-align: right;
}

.games-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grammar-gym {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
}

.grammar-spotlight,
.grammar-card {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.88);
  box-shadow: var(--shadow);
}

.grammar-spotlight {
  padding: clamp(20px, 4vw, 32px);
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(255, 191, 63, 0.18)),
    rgba(255, 250, 242, 0.9);
}

.grammar-spotlight h3 {
  margin-bottom: 12px;
}

.grammar-spotlight p {
  color: var(--muted);
  font-weight: 820;
  line-height: 1.5;
}

.grammar-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.grammar-card {
  min-height: 160px;
  padding: 18px;
}

.grammar-card strong,
.grammar-card span,
.grammar-card small {
  display: block;
}

.grammar-card strong {
  margin-bottom: 8px;
  font-size: 1.18rem;
  font-weight: 1000;
}

.grammar-card span {
  color: var(--muted);
  font-weight: 820;
  line-height: 1.45;
}

.grammar-card small {
  margin-top: 12px;
  color: var(--blue);
  font-weight: 1000;
}

.grammar-card .button {
  margin-top: 14px;
  width: 100%;
}

.game-tile {
  min-height: 210px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: 20px;
  background: rgba(255, 250, 242, 0.88);
  box-shadow: var(--shadow);
  text-align: left;
}

.game-tile strong,
.game-tile span,
.game-tile small {
  display: block;
}

.game-tile strong {
  margin-bottom: 8px;
  font-size: 1.35rem;
  font-weight: 1000;
}

.game-tile span {
  color: var(--muted);
  font-weight: 820;
  line-height: 1.45;
}

.game-tile small {
  margin-top: 14px;
  color: var(--blue);
  font-weight: 1000;
}

.game-tile .button {
  margin-top: 16px;
  width: 100%;
}

.lesson-badge {
  display: inline-flex;
  margin-bottom: 16px;
  border-radius: 999px;
  padding: 10px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--grape));
  font-weight: 1000;
}

.training-steps ol {
  display: grid;
  gap: 10px;
  padding-left: 22px;
  color: var(--muted);
  font-weight: 780;
}

.example-box {
  margin-top: 18px;
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 191, 63, 0.18);
  color: var(--navy);
  font-weight: 950;
}

.mini-feedback {
  margin-top: 14px;
  color: var(--muted);
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 20;
  width: min(520px, calc(100% - 32px));
  border-radius: 999px;
  padding: 14px 18px;
  background: var(--navy);
  color: #fff;
  text-align: center;
  font-weight: 1000;
  box-shadow: 0 18px 44px rgba(18, 35, 63, 0.28);
  animation: toastIn 220ms ease both;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  overflow: hidden;
}

.confetti-layer span {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 18px;
  border-radius: 4px;
  animation: fall 1.9s ease-in forwards;
}

@keyframes floaty {
  0%,
  100% {
    translate: 0 0;
    rotate: 0deg;
  }
  50% {
    translate: 0 -24px;
    rotate: 8deg;
  }
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes pulse {
  50% {
    transform: scale(1.03);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes fall {
  to {
    top: 105vh;
    transform: translateX(40px) rotate(540deg);
    opacity: 0;
  }
}

@keyframes starfield {
  to {
    background-position: 0 180px, 40px 240px;
  }
}

@media (max-width: 860px) {
  .dashboard-grid,
  .insight-grid,
  .training-card,
  .parent-grid,
  .parent-grid.wide,
  .games-list,
  .grammar-gym,
  .grammar-list {
    grid-template-columns: 1fr;
  }

  .app-header,
  .test-topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .header-actions,
  .test-actions,
  .result-actions {
    flex-wrap: wrap;
  }

  .timer,
  .star-bank {
    text-align: left;
  }

  .toast {
    left: 16px;
    right: 16px;
    top: 16px;
    width: auto;
  }
}

@media (max-width: 620px) {
  .profile-input-row,
  .options-grid,
  .level-node,
  .review-card,
  .role-grid,
  .parent-overview,
  .parent-row {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .switch-corner {
    width: auto;
  }

  .parent-corner-button {
    width: auto;
  }

  .section-heading {
    display: grid;
  }

  .level-score {
    text-align: left;
  }

  .coach-stats {
    grid-template-columns: 1fr;
  }

  .test-topbar {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
