:root {
  --ink: #24302b;
  --ink-soft: #69736e;
  --paper: #f1eee5;
  --paper-deep: #e5dfd2;
  --card: #f8f5ed;
  --moss: #426653;
  --coral: #c6674f;
  --sun: #e3b85e;
  --line: rgba(36, 48, 43, 0.18);
  --shadow: 0 24px 60px rgba(46, 48, 39, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 13% 6%, rgba(227, 184, 94, 0.28), transparent 24rem),
    radial-gradient(circle at 92% 42%, rgba(66, 102, 83, 0.14), transparent 30rem),
    var(--paper);
  font-family: "Atkinson Hyperlegible", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: block;
  flex: 0 1 auto;
  text-decoration: none;
}

.brand img {
  display: block;
  width: clamp(152px, 18vw, 214px);
  height: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 28px);
}

.scoreboard {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-stat {
  display: grid;
  gap: 2px;
}

.score-stat > span {
  font-size: 0.58rem;
}

.scoreboard strong {
  color: var(--coral);
  font-family: "Fraunces", serif;
  font-size: 1.55rem;
  line-height: 1;
}

.score-divider {
  width: 1px;
  height: 30px;
  background: var(--line);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.45fr);
  gap: 9vw;
  align-items: end;
  padding: 80px 2vw 72px;
}

.progress-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 1px;
  margin-bottom: 72px;
  border: 1px solid var(--line);
  background: var(--line);
}

.badge-card,
.score-ledger {
  background: var(--paper);
}

.badge-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
  padding: clamp(30px, 5vw, 60px);
}

.badge-emblem {
  display: grid;
  place-items: center;
  width: clamp(92px, 12vw, 142px);
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--card);
  box-shadow: 8px 8px 0 var(--sun);
  color: var(--ink-soft);
  font-family: "Fraunces", serif;
  font-size: clamp(2.8rem, 6vw, 5rem);
  transition: transform 240ms ease, background-color 240ms ease, color 240ms ease;
}

.badge-card[data-tier="bronze"] .badge-emblem { background: #b98258; color: #fff8ec; }
.badge-card[data-tier="silver"] .badge-emblem { background: #b8c1c7; color: #26323a; }
.badge-card[data-tier="gold"] .badge-emblem { background: #d7ad34; color: #3d2a00; transform: rotate(-5deg) scale(1.04); }

.badge-copy h2,
.score-ledger h2 {
  margin: 0;
  font-family: "Fraunces", serif;
}

.badge-copy h2 { font-size: clamp(1.65rem, 3vw, 2.65rem); }

.badge-copy > p:not(.eyebrow):not(.level-next) {
  max-width: 560px;
  margin: 12px 0 22px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.level-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 35, 31, 0.1);
}

.level-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 500ms ease;
}

.level-next {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-ledger { padding: clamp(30px, 4vw, 46px); }

.score-ledger-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.score-ledger-heading > span { color: var(--ink-soft); font-size: 0.68rem; }
.score-history { display: grid; max-height: 220px; overflow: auto; }

.score-history-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.score-history-row strong { color: var(--moss); font-family: "Fraunces", serif; font-size: 1.05rem; }
.score-history-empty { margin: 24px 0 0; color: var(--ink-soft); font-size: 0.78rem; line-height: 1.6; }

.eyebrow,
.game-kicker {
  margin: 0 0 14px;
  color: var(--coral);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Fraunces", serif;
}

h1 {
  max-width: 780px;
  font-size: clamp(3.7rem, 8vw, 7.4rem);
  line-height: 0.84;
  letter-spacing: -0.055em;
}

h1 em {
  color: var(--moss);
  font-weight: 600;
}

.intro-note {
  margin: 0 0 7px;
  padding-left: 22px;
  color: var(--ink-soft);
  border-left: 2px solid var(--sun);
  font-size: 0.83rem;
  line-height: 1.8;
}

.game-library {
  padding: 36px 0 78px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 34px;
}

.section-heading h2 {
  font-size: clamp(2.5rem, 5vw, 4.6rem);
}

.game-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-rows: repeat(2, minmax(260px, auto));
  gap: 16px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.game-card:hover {
  z-index: 1;
  transform: translateY(-5px) rotate(-0.25deg);
  box-shadow: var(--shadow);
}

.game-card:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

.card-words {
  grid-row: span 2;
  min-height: 556px;
  border-radius: 4px 38px 4px 4px;
  background: var(--card);
}

.card-number {
  border-radius: 4px 4px 4px 30px;
  background: var(--moss);
  color: #f7f2e8;
}

.card-symbols {
  border-radius: 30px 4px 4px 4px;
  background: var(--sun);
}

.card-listening {
  grid-column: 1 / -1;
  min-height: 330px;
  border-radius: 4px 4px 38px 4px;
  background: var(--paper-deep);
}

.card-spatial {
  border-radius: 4px 4px 4px 30px;
  background: rgba(105, 115, 110, 0.12);
}

.card-assamese {
  border-radius: 30px 4px 4px 4px;
  background: rgba(198, 103, 79, 0.14);
}

.card-hindi {
  border-radius: 4px 30px 4px 4px;
  background: rgba(94, 130, 168, 0.14);
}

.card-puzzle {
  border-radius: 4px 4px 30px 4px;
  background: rgba(227, 184, 94, 0.16);
}

.puzzle-sample {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(6px, 1.4vw, 11px);
  width: clamp(180px, 26vw, 260px);
}

.puzzle-sample span {
  aspect-ratio: 1;
  border: 1px solid rgba(36, 48, 43, 0.4);
  border-radius: 6px;
}

.puzzle-sample span:nth-child(3),
.puzzle-sample span:nth-child(6),
.puzzle-sample span:nth-child(9) {
  border-color: var(--coral);
  background: var(--sun);
}

.game-card-number {
  align-self: flex-end;
  font-size: 0.7rem;
  opacity: 0.65;
}

.game-card p {
  margin: 0 0 8px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.68;
}

.game-card h3 {
  max-width: 560px;
  margin: 0 0 24px;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.card-number h3,
.card-symbols h3,
.card-listening h3 {
  font-size: clamp(2rem, 3vw, 3.4rem);
}

.listening-sample {
  display: flex;
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
  justify-content: center;
  color: var(--moss);
  font-family: "Fraunces", serif;
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 1;
}

.sound-rings {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(94px, 14vw, 150px);
  aspect-ratio: 1;
  border: 1px solid var(--coral);
  border-radius: 50%;
}

.sound-rings::before {
  content: "▶";
  margin-left: 7px;
  color: var(--coral);
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-size: 0.32em;
}

.sound-rings i {
  position: absolute;
  inset: calc(var(--ring, 1) * -10px);
  border: 1px solid rgba(203, 91, 70, var(--ring-opacity, 0.42));
  border-radius: 50%;
}

.sound-rings i:nth-child(2) { --ring: 2; --ring-opacity: 0.26; }
.sound-rings i:nth-child(3) { --ring: 3; --ring-opacity: 0.16; }

.card-link {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 5px;
  border-bottom: 1px solid currentColor;
  font-size: 0.76rem;
}

.word-sample {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  max-width: 530px;
  transform: rotate(-4deg);
}

.word-sample span {
  color: var(--moss);
  font-family: "Fraunces", serif;
  font-size: clamp(2.9rem, 7vw, 6.8rem);
  font-style: italic;
  line-height: 0.8;
  opacity: 0.28;
}

.number-sample {
  align-self: center;
  color: var(--sun);
  font-family: "Fraunces", serif;
  font-size: clamp(3.2rem, 6vw, 6rem);
  font-variant-numeric: tabular-nums;
  line-height: 0.78;
  letter-spacing: 0.1em;
  opacity: 0.65;
  transform: rotate(3deg);
}

.symbol-sample {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.symbol-sample span {
  display: grid;
  place-items: center;
  width: clamp(48px, 6vw, 76px);
  aspect-ratio: 1;
  border: 1px solid rgba(36, 48, 43, 0.5);
  border-radius: 50% 50% 43% 57%;
  font-size: clamp(1.5rem, 3vw, 2.8rem);
}

.spatial-sample {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.6vw, 14px);
  width: clamp(140px, 20vw, 200px);
}

.spatial-sample span {
  aspect-ratio: 1;
  border: 1px solid rgba(36, 48, 43, 0.4);
  border-radius: 6px;
}

.spatial-sample span:nth-child(2),
.spatial-sample span:nth-child(6),
.spatial-sample span:nth-child(7) {
  border-color: var(--coral);
  background: var(--sun);
}

.assamese-sample {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  max-width: 400px;
  transform: rotate(-3deg);
}

.assamese-sample span {
  color: var(--coral);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
  opacity: 0.55;
}

.hindi-sample {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  max-width: 400px;
  transform: rotate(3deg);
}

.hindi-sample span {
  color: #5e82a8;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
  opacity: 0.55;
}

.task-manager {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: clamp(36px, 8vw, 110px);
  padding: 72px 0 86px;
  border-top: 1px solid var(--line);
}

.task-heading h2 {
  font-size: clamp(2.8rem, 5vw, 5.2rem);
}

.task-content {
  min-width: 0;
}

.task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 10px;
}

.task-form input {
  width: 100%;
  padding: 15px 16px;
  border-color: var(--line);
}

.task-form .primary-button {
  min-width: 110px;
}

.task-status {
  min-height: 20px;
  margin: 14px 0 4px;
  color: var(--coral);
  font-size: 0.68rem;
}

.task-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 64px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 245, 237, 0.48);
}

.task-toggle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}

.task-item.is-complete .task-toggle {
  background: var(--moss);
}

.task-item.is-complete .task-name {
  color: var(--ink-soft);
  text-decoration: line-through;
}

.task-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-time {
  color: var(--moss);
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.task-delete {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1.25rem;
}

.task-empty {
  padding: 28px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.companion-tools {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: clamp(36px, 8vw, 110px);
  padding: 72px 0 86px;
  border-top: 1px solid var(--line);
}

.companion-heading h2 {
  font-size: clamp(2.8rem, 5vw, 5.2rem);
}

.companion-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.companion-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.companion-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--ink);
}

.companion-card:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

.companion-card.card-hydration {
  border-radius: 4px 28px 4px 4px;
  background: var(--card);
}

.companion-card.card-rehab {
  border-radius: 28px 4px 4px 4px;
  background: rgba(227, 184, 94, 0.18);
}

.companion-card.card-diet {
  cursor: pointer;
  border-radius: 4px 4px 4px 28px;
  background: rgba(198, 103, 79, 0.12);
  text-align: left;
}

button.companion-card.card-diet {
  font: inherit;
}

.companion-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.companion-pill {
  color: var(--coral);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.companion-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-family: "Fraunces", serif;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.companion-card-link span:last-child {
  color: var(--coral);
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-size: 1.25rem;
  transition: transform 150ms ease;
}

.companion-card:hover .companion-card-link span:last-child {
  transform: translate(2px, -2px);
}

.diet-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.diet-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 48, 43, 0.55);
  backdrop-filter: blur(6px);
}

.diet-modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px 32px 4px 4px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.diet-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 30px 18px;
  border-bottom: 1px solid var(--line);
}

.diet-modal-header h2 {
  margin: 4px 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

.diet-modal-header .eyebrow {
  margin: 0;
}

.diet-header-tools {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.diet-lang-toggle {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.diet-lang-toggle button {
  margin: 0;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.diet-lang-toggle button.is-on {
  background: var(--moss);
  color: var(--paper);
}

.diet-quiz-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.diet-quiz-toolbar .diet-quiz-intro {
  margin: 0;
}

.diet-quiz-speak {
  justify-self: start;
}

.diet-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  transition: background-color 150ms ease, transform 150ms ease;
}

.diet-close:hover {
  background: rgba(36, 48, 43, 0.06);
  transform: rotate(90deg);
}

.diet-modal-body {
  overflow-y: auto;
  padding: 24px 30px 32px;
}

.diet-quiz-intro {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.7;
}

.diet-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(36, 48, 43, 0.12);
  overflow: hidden;
}

.diet-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--moss);
  transition: width 220ms ease;
}

.diet-progress-label {
  margin: 10px 0 20px;
  color: var(--ink-soft);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.diet-question h3 {
  margin: 0 0 18px;
  font-family: "Fraunces", serif;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.25;
}

.diet-options {
  display: grid;
  gap: 10px;
}

.diet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 3px 18px 3px 3px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.85rem;
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.diet-option:hover {
  border-color: var(--moss);
  background: rgba(66, 102, 83, 0.08);
  transform: translateY(-1px);
}

.diet-option:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
}

.diet-option-letter {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(36, 48, 43, 0.08);
  color: var(--moss);
  font-family: "Fraunces", serif;
  font-size: 0.95rem;
}

.diet-plan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.diet-plan-actions .primary-button {
  min-width: 0;
}

.diet-listen.is-on {
  border-color: rgba(66, 102, 83, 0.45);
  background: rgba(66, 102, 83, 0.1);
  color: var(--moss);
}

.diet-plan-summary {
  margin: 0 0 20px;
  padding: 16px 18px;
  border-left: 3px solid var(--sun);
  background: rgba(227, 184, 94, 0.14);
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.7;
}

.diet-plan-output h3 {
  margin: 26px 0 12px;
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
}

.diet-plan-output h4 {
  margin: 22px 0 8px;
  color: var(--moss);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.diet-plan-output ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.8;
}

.diet-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 3px 18px 3px 3px;
}

.diet-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.diet-table th,
.diet-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

.diet-table thead th {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.diet-table tbody tr:last-child td {
  border-bottom: 0;
}

.diet-table tbody th {
  color: var(--coral);
  font-family: "Fraunces", serif;
  font-size: 0.95rem;
  white-space: nowrap;
}

.diet-note {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.7;
}

@media (max-width: 760px) {
  .diet-modal {
    align-items: flex-end;
    padding: 12px;
  }

  .diet-modal-panel {
    max-height: 92vh;
    border-radius: 4px 22px 4px 4px;
  }

  .diet-modal-header {
    padding: 20px 20px 14px;
  }

  .diet-modal-body {
    padding: 18px 20px 26px;
  }

  .diet-plan-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .diet-plan-actions .primary-button,
  .diet-plan-actions .text-button {
    width: 100%;
    text-align: center;
  }

  .diet-plan-actions .ambient-toggle {
    justify-content: center;
  }
}

.ai-helper {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1.2fr);
  gap: clamp(40px, 9vw, 120px);
  align-items: center;
  margin-bottom: 86px;
  padding: clamp(34px, 6vw, 76px);
  border: 1px solid var(--line);
  border-radius: 42px 4px 42px 4px;
  background: var(--ink);
  color: var(--paper);
}

.helper-copy h2 {
  font-size: clamp(2.5rem, 5vw, 5.4rem);
  line-height: 0.95;
}

.helper-copy h2 em {
  color: var(--sun);
}

.helper-copy > p:last-child {
  max-width: 420px;
  margin: 30px 0 0;
  color: rgba(241, 238, 229, 0.65);
  font-size: 0.77rem;
  line-height: 1.7;
}

.helper-form label {
  display: block;
  margin-bottom: 12px;
  color: rgba(241, 238, 229, 0.72);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.helper-form textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 18px;
  border: 1px solid rgba(241, 238, 229, 0.38);
  border-radius: 3px 22px 3px 3px;
  background: rgba(241, 238, 229, 0.08);
  color: var(--paper);
  font: inherit;
  line-height: 1.6;
}

.helper-form textarea::placeholder {
  color: rgba(241, 238, 229, 0.35);
}

.helper-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
}

.helper-actions > span {
  color: rgba(241, 238, 229, 0.42);
  font-size: 0.66rem;
}

.helper-actions-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.helper-actions .primary-button {
  min-width: 170px;
  box-shadow: 5px 5px 0 var(--sun);
}

.voice-toggle {
  border-color: rgba(241, 238, 229, 0.35);
  background: rgba(241, 238, 229, 0.08);
  color: rgba(241, 238, 229, 0.75);
}

.voice-toggle.is-on {
  border-color: var(--sun);
  background: rgba(227, 184, 94, 0.2);
  color: var(--sun);
}

.helper-answer {
  position: relative;
  margin-top: 28px;
  padding: 22px 24px 22px 46px;
  border-left: 2px solid var(--sun);
  background: rgba(241, 238, 229, 0.08);
  color: var(--paper);
  font-family: "Fraunces", serif;
  font-size: 1.25rem;
  line-height: 1.45;
  animation: panel-in 350ms both;
}

.helper-answer::before {
  content: "A";
  position: absolute;
  top: 24px;
  left: 16px;
  color: var(--sun);
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-size: 0.65rem;
}

.helper-answer.is-error {
  border-left-color: var(--coral);
}

.game-view {
  padding-top: 24px;
}

.game-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 4px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.back-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  transition: transform 150ms ease;
}

.back-button:hover {
  transform: translateX(-4px);
}

.back-button span {
  color: var(--coral);
  font-size: 1.1rem;
}

.game-tabs {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr 1fr;
  border-block: 1px solid var(--line);
}

.game-tab {
  position: relative;
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 78px;
  padding: 18px 26px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color 180ms ease, background-color 180ms ease;
}

.game-tab:last-child {
  border-right: 0;
}

.game-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 4px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms ease;
}

.game-tab:hover,
.game-tab.is-active {
  background: rgba(248, 245, 237, 0.58);
}

.game-tab.is-active::after {
  transform: scaleX(1);
}

.tab-index {
  color: var(--coral);
  font-size: 0.68rem;
}

.game-stage {
  padding: 44px 0 86px;
}

.game-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 5vw, 62px);
  border: 1px solid var(--line);
  border-radius: 4px 36px 4px 36px;
  background: rgba(248, 245, 237, 0.8);
  box-shadow: var(--shadow);
  animation: panel-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.game-panel::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -65px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(66, 102, 83, 0.16);
  border-radius: 43% 57% 60% 40%;
  transform: rotate(18deg);
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-meta {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
}

h2 {
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.round-counter {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.round-counter span {
  color: var(--ink);
}

.playfield {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  margin: 42px 0 28px;
  padding: 60px 7%;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(36, 48, 43, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 48, 43, 0.045) 1px, transparent 1px),
    rgba(241, 238, 229, 0.62);
  background-size: 28px 28px;
}

.instruction {
  position: absolute;
  top: 18px;
  left: 20px;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.word-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 24px;
  max-width: 720px;
}

.memory-word {
  display: inline-block;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4.8vw, 4.5rem);
  line-height: 1;
  animation: word-arrive 400ms both;
}

.memory-word:nth-child(even) {
  color: var(--moss);
  font-style: italic;
}

.memory-word.is-fading {
  animation: word-fade 720ms forwards;
}

@keyframes word-arrive {
  from { opacity: 0; transform: translateY(12px) rotate(-2deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes word-fade {
  to { opacity: 0; transform: translateY(-10px); filter: blur(8px); }
}

.word-placeholder {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.recall-area,
.number-entry,
.symbol-recall,
.listening-entry {
  width: min(100%, 620px);
  text-align: center;
  animation: panel-in 350ms both;
}

.recall-area label,
.number-entry label,
.listening-entry label {
  display: block;
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
}

input {
  min-width: 0;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--card);
  color: var(--ink);
}

#word-input {
  padding: 15px 17px;
  border-right: 0;
}

.small-button {
  padding: 14px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.answer-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 35px;
  margin-top: 20px;
}

.answer-chip {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--paper-deep);
  font-size: 0.72rem;
}

.number-display {
  font-family: "Fraunces", serif;
  font-size: clamp(3.2rem, 10vw, 8rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0.075em;
  transition: opacity 250ms ease, filter 250ms ease;
}

.number-display.is-hiding {
  opacity: 0;
  filter: blur(10px);
}

#number-input {
  width: min(100%, 410px);
  padding: 12px 20px;
  text-align: center;
  font-family: "Fraunces", serif;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}

.symbol-stream,
.symbol-answer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 2vw, 22px);
}

.symbol-stream span,
.symbol-answer span {
  display: grid;
  place-items: center;
  width: clamp(55px, 10vw, 110px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50% 50% 44% 56%;
  background: var(--card);
  font-size: clamp(1.8rem, 5vw, 4rem);
  opacity: 0.22;
}

.symbol-stream span.is-lit {
  opacity: 1;
  border-color: var(--coral);
  background: var(--sun);
  transform: scale(1.05) rotate(-3deg);
  transition: transform 150ms ease, opacity 150ms ease, background-color 150ms ease;
}

.symbol-recall p {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.symbol-answer {
  justify-content: center;
}

.symbol-answer span {
  width: clamp(48px, 8vw, 74px);
  opacity: 1;
  background: rgba(248, 245, 237, 0.62);
}

.symbol-keypad {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 24px;
}

.symbol-key {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--ink);
  background: var(--card);
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease;
}

.symbol-key:hover {
  background: var(--sun);
  transform: translateY(-3px) rotate(-2deg);
}

.listening-playfield {
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr);
  gap: clamp(30px, 7vw, 90px);
  min-height: 410px;
}

.listening-prompt {
  display: grid;
  justify-items: center;
  gap: 20px;
  text-align: center;
}

.listening-prompt p {
  max-width: 290px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.7;
}

.audio-orb {
  display: grid;
  place-items: center;
  width: clamp(150px, 20vw, 210px);
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  border-radius: 47% 53% 44% 56%;
  background: var(--sun);
  color: var(--ink);
  cursor: pointer;
  transform: rotate(-3deg);
  transition: transform 180ms ease, border-radius 180ms ease;
}

.audio-orb:hover:not(:disabled) {
  border-radius: 55% 45% 52% 48%;
  transform: rotate(2deg) scale(1.03);
}

.audio-orb:disabled {
  cursor: default;
  opacity: 0.45;
}

.audio-orb-icon {
  margin: 16px 0 -26px 8px;
  color: var(--coral);
  font-size: 2.5rem;
}

.audio-orb span:last-child {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.listening-entry {
  display: grid;
  justify-items: center;
}

#listening-input {
  width: min(100%, 440px);
  padding: 18px 20px;
  text-align: center;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 5vw, 4rem);
}

.slow-button {
  margin-top: 18px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--moss);
  cursor: pointer;
  font-size: 0.68rem;
}

.slow-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.assamese-text {
  font-family: "Noto Sans Bengali", "Atkinson Hyperlegible", sans-serif;
}

.mizo-text {
  font-family: "Atkinson Hyperlegible", sans-serif;
}

.manipuri-text {
  font-family: "Noto Sans Meetei Mayek", "Atkinson Hyperlegible", sans-serif;
}

.bangla-text {
  font-family: "Noto Sans Bengali", "Atkinson Hyperlegible", sans-serif;
}

.hindi-text {
  font-family: "Noto Sans Devanagari", "Atkinson Hyperlegible", sans-serif;
}

.recall-area > p {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.language-switcher {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  margin: 22px 0 -20px;
  color: var(--ink-soft);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.language-options {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

.language-options button {
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.04em;
  text-transform: none;
  transition: background-color 140ms ease, color 140ms ease;
}

.language-options button[aria-pressed="true"] {
  background: var(--moss);
  color: var(--paper);
}

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

.spatial-playfield {
  padding: 44px 7%;
}

.spatial-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 2vw, 16px);
  width: min(100%, 420px);
}

.spatial-cell {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: default;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.spatial-cell.is-lit {
  border-color: var(--coral);
  background: var(--sun);
  transform: scale(1.04);
}

.spatial-grid.is-recall .spatial-cell {
  cursor: pointer;
}

.spatial-grid.is-recall .spatial-cell:hover {
  border-color: var(--ink);
}

.spatial-cell.is-picked {
  border-color: var(--moss);
  background: rgba(66, 102, 83, 0.28);
}

.spatial-cell.is-target {
  border-color: var(--moss);
  box-shadow: inset 0 0 0 3px var(--moss);
}

.spatial-cell.is-wrong {
  border-color: var(--coral);
  background: rgba(198, 103, 79, 0.25);
}

.word-select-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 620px;
}

.word-key {
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.word-key:hover {
  transform: translateY(-2px);
}

.word-key.is-picked {
  border-color: var(--moss);
  background: rgba(66, 102, 83, 0.18);
}

.word-key.is-target {
  border-color: var(--moss);
  box-shadow: inset 0 0 0 2px var(--moss);
}

.word-key.is-wrong {
  border-color: var(--coral);
  background: rgba(198, 103, 79, 0.18);
}

.game-actions {
  display: flex;
  gap: 22px;
  align-items: center;
}

.primary-button,
.text-button,
footer button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  position: relative;
  min-width: 210px;
  padding: 16px 23px;
  background: var(--coral);
  color: #fffaf0;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.primary-button:active {
  transform: translate(6px, 6px);
  box-shadow: 0 0 0 var(--ink);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.text-button {
  padding: 10px 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
}

.result-message {
  min-height: 25px;
  margin-top: 22px;
  color: var(--moss);
  font-size: 0.8rem;
  line-height: 1.6;
}

.result-message.is-miss {
  color: var(--coral);
}

.puzzle-playfield {
  padding: 54px 6%;
}

.puzzle-upload-label {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px 40px;
  border: 1px dashed var(--ink-soft);
  border-radius: 4px 24px 4px 24px;
  background: rgba(248, 245, 237, 0.7);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.puzzle-upload:hover .puzzle-upload-label,
.puzzle-upload-label:hover {
  border-color: var(--moss);
  background: rgba(66, 102, 83, 0.08);
}

#puzzle-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.puzzle-upload-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.puzzle-upload-hint {
  color: var(--ink-soft);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.puzzle-board-wrap {
  display: grid;
  justify-items: center;
  gap: 26px;
  width: 100%;
}

.puzzle-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  border: 2px solid var(--ink-soft);
  background: rgba(36, 48, 43, 0.08);
}

.puzzle-slot {
  position: relative;
  overflow: hidden;
  border: 1px dashed rgba(36, 48, 43, 0.35);
}

.puzzle-slot::after {
  content: attr(data-slot);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(36, 48, 43, 0.28);
  font-size: 0.72rem;
  pointer-events: none;
}

.puzzle-slot .puzzle-piece + ::after,
.puzzle-slot:has(.puzzle-piece)::after {
  content: none;
}

.puzzle-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(248, 245, 237, 0.55);
}

.puzzle-piece {
  position: relative;
  overflow: visible;
  cursor: grab;
  transition: transform 140ms ease;
}

.puzzle-piece:active {
  cursor: grabbing;
}

.puzzle-piece:hover {
  transform: translateY(-3px);
}

.puzzle-piece-image {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
}

.puzzle-piece.is-correct {
  outline: 3px solid var(--moss);
  outline-offset: 2px;
}

.puzzle-piece.is-wrong {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .puzzle-board-wrap {
    gap: 18px;
  }

  .puzzle-tray {
    gap: 8px;
    padding: 8px;
  }
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  padding: 30px 0 50px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.footer-copy {
  display: grid;
  gap: 8px;
}

.footer-copy p {
  margin: 0;
}

.footer-credit {
  color: var(--ink);
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

footer button:not(.ambient-toggle) {
  padding: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--ink-soft);
}

.ambient-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(248, 245, 237, 0.55);
  color: var(--ink-soft);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.ambient-toggle:hover {
  transform: translateY(-2px);
}

.ambient-toggle.is-on {
  border-color: rgba(66, 102, 83, 0.45);
  background: rgba(66, 102, 83, 0.1);
  color: var(--moss);
}

.ambient-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.speaker-icon {
  width: 17px;
  height: 17px;
  overflow: visible;
  fill: currentColor;
}

.speaker-icon path:not(:first-child) {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.6;
}

.mute-slash,
.ambient-toggle.is-on .mute-slash {
  display: none;
}

.ambient-toggle:not(.is-on) .sound-wave {
  display: none;
}

.ambient-toggle:not(.is-on) .mute-slash {
  display: block;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    gap: 12px;
    padding-top: 20px;
  }

  .brand img {
    width: clamp(120px, 32vw, 160px);
  }

  .header-actions {
    gap: 10px;
  }

  .header-actions .ambient-toggle {
    padding: 7px;
  }

  .header-actions .ambient-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .scoreboard {
    gap: 7px;
  }

  .score-divider { height: 25px; }
  .scoreboard strong { font-size: 1.25rem; }
  .score-stat > span { font-size: 0.5rem; }

  .intro {
    grid-template-columns: 1fr;
    gap: 38px;
    padding: 58px 8px 54px;
  }

  .progress-dashboard {
    grid-template-columns: 1fr;
    margin-bottom: 54px;
  }

  .badge-card { grid-template-columns: 1fr; }
  .badge-emblem { width: 96px; }

  h1 {
    font-size: clamp(3.3rem, 17vw, 5.6rem);
  }

  .intro-note {
    max-width: 430px;
  }

  .game-library {
    padding-bottom: 54px;
  }

  .game-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .game-card,
  .card-words {
    grid-row: auto;
    min-height: 340px;
  }

  .card-listening {
    grid-column: auto;
  }

  .word-sample span {
    font-size: clamp(2.7rem, 15vw, 5rem);
  }

  .task-manager {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 54px 0;
  }

  .task-form {
    grid-template-columns: 1fr 130px;
  }

  .task-form .primary-button {
    grid-column: 1 / -1;
    width: calc(100% - 6px);
  }

  .task-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .task-time {
    grid-column: 2;
    font-size: 1rem;
  }

  .task-delete {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .companion-tools {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 0 54px;
  }

  .companion-actions {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ai-helper {
    grid-template-columns: 1fr;
    margin-bottom: 54px;
    padding: 34px 22px;
    border-radius: 28px 3px 28px 3px;
  }

  .helper-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .helper-actions-right {
    width: 100%;
  }

  .helper-actions .primary-button {
    flex: 1 1 auto;
    width: auto;
  }

  .game-window-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(241, 238, 229, 0.94);
    backdrop-filter: blur(12px);
  }

  .game-tabs {
    grid-template-columns: 1fr;
  }

  .game-tab {
    min-height: 58px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .game-tab:last-child {
    border-bottom: 0;
  }

  .game-panel {
    border-radius: 3px 24px 3px 24px;
  }

  .language-switcher {
    align-items: flex-end;
    flex-direction: column;
    margin-bottom: -12px;
  }

  .language-options { max-width: 100%; }
  .language-options button { padding-inline: 9px; font-size: 0.58rem; }

  .playfield {
    min-height: 360px;
    margin-top: 32px;
    padding: 65px 18px 38px;
  }

  .listening-playfield {
    grid-template-columns: 1fr;
    gap: 38px;
    padding-top: 70px;
  }

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

  #word-input {
    border-right: 1px solid var(--ink);
    border-bottom: 0;
  }

  .game-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .primary-button {
    width: calc(100% - 6px);
  }

  footer {
    align-items: flex-start;
    gap: 20px;
    flex-direction: column;
  }

  .footer-actions {
    width: 100%;
    justify-content: space-between;
  }
}

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