:root {
  --bg-top: #f8efe0;
  --bg-mid: #ebf6ef;
  --bg-bottom: #dcebf8;
  --ink: #1f3242;
  --muted: #6d8091;
  --teal: #1d9e9a;
  --teal-soft: #4bc3bb;
  --gold: #f4c55a;
  --gold-deep: #d6932d;
  --danger: #e56e66;
  --danger-soft: rgba(229, 110, 102, 0.16);
  --panel: rgba(255, 255, 255, 0.62);
  --panel-strong: rgba(255, 255, 255, 0.82);
  --shadow: 0 24px 48px rgba(72, 104, 123, 0.16);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(244, 197, 90, 0.18), transparent 20%),
    radial-gradient(circle at 90% 14%, rgba(29, 158, 154, 0.14), transparent 20%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 44%, var(--bg-bottom) 100%);
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
  user-select: none;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: calc(24px + var(--safe-top)) 0 calc(40px + var(--safe-bottom));
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
  color: var(--teal);
}

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

h1,
h2 {
  font-family: "Baloo 2", cursive;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

h1 {
  margin: 10px 0 0;
  font-size: clamp(44px, 6vw, 78px);
}

h2 {
  margin: 8px 0 0;
  font-size: clamp(34px, 4.4vw, 54px);
}

.primary,
.ghost,
.back-btn {
  padding: 14px 18px;
  border-radius: 18px;
  font-weight: 800;
}

.primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-soft));
  color: #fff;
  box-shadow: 0 18px 32px rgba(29, 158, 154, 0.24);
}

.ghost,
.back-btn {
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.ghost.compact {
  padding: 12px 14px;
}

.back-icon-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  font-size: 30px;
  line-height: 1;
}

.hero-panel,
.screen-panel,
.game-screen {
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-panel,
.screen-panel {
  background: var(--panel);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  gap: 24px;
  padding: 28px;
}

.hero-lead,
.brief-copy,
.hero-note p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions,
.button-stack {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 22px;
}

.home-primary {
  width: auto;
}

.hero-side {
  display: grid;
  align-content: space-between;
  gap: 16px;
}

.hero-badge,
.hero-note,
.pill,
.brief-points span,
.result-tags span,
.progress-chip,
.preview-chip,
.target-pill,
.readout-card,
.hud > div {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.hero-badge {
  justify-self: end;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--teal);
  font-weight: 800;
}

.hero-note,
.spotlight-card,
.pack-item,
.progress-item,
.brief-example,
.feedback-banner,
.progress-stats {
  border-radius: 28px;
}

.hero-note,
.spotlight-card,
.pack-item,
.progress-item {
  padding: 20px;
}

.hero-note {
  background: rgba(255, 255, 255, 0.52);
}

.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.spotlight-card {
  min-height: 220px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.7), transparent 38%),
    rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.58);
}

.spotlight-card-main {
  background:
    radial-gradient(circle at 12% 0, rgba(244, 197, 90, 0.22), transparent 28%),
    rgba(255, 255, 255, 0.62);
}

.spotlight-card h3,
.pack-item h3,
.progress-item h3 {
  margin: 8px 0 10px;
  font-size: 26px;
  font-family: "Baloo 2", cursive;
}

.spotlight-card p,
.pack-item p,
.progress-item p {
  color: var(--muted);
  line-height: 1.6;
}

.card-row,
.pack-meta,
.pack-row,
.progress-row,
.section-top,
.hud,
.game-header,
.prompt-row,
.status-bar,
.meter-copy {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.card-row {
  margin-top: 18px;
}

.preview-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.preview-chip,
.brief-points span,
.pill,
.result-tags span {
  padding: 9px 12px;
  border-radius: 999px;
}

.preview-chip {
  font-size: 13px;
  color: var(--ink);
}

.screen-panel {
  padding: 24px;
}

.section-top {
  align-items: flex-start;
}

.pack-list,
.progress-list,
.button-stack {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.pack-item,
.progress-item {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.72), transparent 42%),
    rgba(255, 255, 255, 0.5);
}

.pack-meta {
  align-items: flex-start;
}

.progress-chip {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.briefing-panel {
  display: grid;
  gap: 18px;
}

.mode-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.mode-panel-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.mode-panel-top h3 {
  margin: 8px 0 0;
  font-size: 24px;
  font-family: "Baloo 2", cursive;
}

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

.mode-option {
  width: 100%;
  padding: 14px 16px;
  border-radius: 22px;
  text-align: left;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62)),
    radial-gradient(circle at top right, rgba(76, 195, 187, 0.12), transparent 40%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 14px 24px rgba(72, 104, 123, 0.1);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.mode-option strong,
.mode-option small {
  display: block;
}

.mode-option strong {
  font-size: 18px;
  line-height: 1.1;
}

.mode-option small {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.mode-option.is-active {
  border-color: rgba(29, 158, 154, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 20px 32px rgba(29, 158, 154, 0.16);
  transform: translateY(-1px);
}

.brief-points {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.brief-example {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.52);
  font-weight: 700;
  flex-wrap: wrap;
}

.arrow {
  color: var(--gold-deep);
  font-weight: 800;
}

.game-screen {
  padding: 18px;
  background: var(--panel);
  display: grid;
  gap: 14px;
}

.game-screen > * {
  min-width: 0;
}

.game-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

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

.hud > div {
  padding: 12px 14px;
  border-radius: 24px;
  text-align: center;
}

.hud small,
.readout-card small {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--teal);
  font-weight: 800;
}

.hud strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.prompt-row {
  margin-top: 0;
  display: block;
  min-width: 0;
}

.target-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.listen-row {
  display: flex;
  gap: 10px;
  min-width: 0;
  align-items: center;
}

.replay-inline {
  flex: 0 0 auto;
  align-self: center;
}

.replay-icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  color: var(--teal);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.replay-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.target-pill {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 28px;
  width: min(100%, 520px);
  min-height: 74px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82)),
    radial-gradient(circle at top left, rgba(76, 195, 187, 0.12), transparent 34%);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 16px 30px rgba(72, 104, 123, 0.12);
}

.target-pill[data-cue-kind="picture"] {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  width: min(100%, 620px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86)),
    radial-gradient(circle at 14% 0%, rgba(244, 197, 90, 0.3), transparent 34%);
  min-height: 132px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 22px 36px rgba(214, 147, 45, 0.14);
}

.target-pill[data-cue-kind="gloss"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.8)),
    radial-gradient(circle at 88% 0%, rgba(76, 195, 187, 0.16), transparent 30%);
}

.target-pill strong {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.02;
}

.target-visual {
  display: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 18px;
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1;
  background:
    linear-gradient(180deg, rgba(255, 249, 235, 0.94), rgba(255, 241, 205, 0.84)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.72), transparent 62%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 22px rgba(214, 147, 45, 0.16);
}

.target-visual.has-visual {
  display: inline-flex;
}

.target-visual[data-visual-type="image"] {
  background-image: var(--target-visual-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 84% 84%;
  color: transparent;
  font-size: 0;
}

.target-pill[data-cue-kind="picture"] .target-visual.has-visual {
  width: 112px;
  height: 112px;
  border-radius: 30px;
  font-size: clamp(60px, 6vw, 76px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 16px 26px rgba(214, 147, 45, 0.18);
}

.target-pill[data-cue-kind="picture"] .target-visual[data-visual-type="image"].has-visual {
  background-size: 90% 90%;
}

.target-pill[data-has-visual="true"] .dot {
  display: none;
}

.target-pill[data-cue-kind="picture"] strong {
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.04;
}

.target-meaning {
  margin: 0;
  color: var(--muted);
  display: none;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 6px rgba(29, 158, 154, 0.14);
}

.gesture-readouts {
  display: none;
}

.readout-card {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 20px;
}

.readout-card strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.feedback-banner {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 7;
  pointer-events: none;
  min-height: 0;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  line-height: 1.45;
  box-shadow: 0 10px 22px rgba(72, 104, 123, 0.12);
  backdrop-filter: blur(12px);
}

.feedback-banner:empty {
  padding: 0;
  border-width: 0;
  box-shadow: none;
}

.feedback-banner[data-state="success"] {
  color: #177a74;
  background: rgba(184, 242, 225, 0.82);
}

.feedback-banner[data-state="failure"] {
  color: #b64c42;
  background: rgba(255, 232, 227, 0.9);
}

.viewport-wrap {
  margin-top: 0;
  padding: 6px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.4);
  width: 100%;
  min-width: 0;
}

.viewport {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  width: 100%;
  min-width: 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.7), transparent 20%),
    linear-gradient(180deg, #edf8f7 0%, #e6f3fb 56%, #eef4ff 100%);
  touch-action: none;
  user-select: none;
}

.world {
  position: relative;
  width: 2600px;
  height: 720px;
  transform: translate3d(0, 0, 0);
}

.world::after {
  content: "";
  position: absolute;
  left: 60px;
  right: 40px;
  bottom: 28px;
  height: 20px;
  border-radius: 999px;
  background: rgba(89, 119, 144, 0.12);
  filter: blur(8px);
}

.platform-layer {
  position: absolute;
  inset: 0;
}

.platform {
  position: absolute;
  width: 144px;
  height: 96px;
  transform: rotate(-10deg);
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.platform.is-source {
  cursor: default;
}

.platform-top,
.platform-front,
.platform-side,
.platform-label {
  position: absolute;
}

.platform-top {
  inset: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffaf0 0%, #fff1cc 100%);
  box-shadow: 0 18px 26px rgba(65, 97, 122, 0.14);
}

.platform-front {
  left: 0;
  right: 20px;
  bottom: -24px;
  height: 28px;
  border-radius: 0 0 18px 18px;
  background: #edf7fd;
  transform: skewX(-35deg);
}

.platform-side {
  top: 14px;
  right: -20px;
  width: 28px;
  bottom: -8px;
  border-radius: 0 18px 18px 0;
  background: #d9ecf0;
  transform: skewY(-55deg);
}

.platform-label {
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 12px 0;
  text-align: center;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.04;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: balance;
}

.platform-label.is-long {
  font-size: clamp(16px, 2.1vw, 21px);
  letter-spacing: -0.02em;
}

.platform-label.is-compact {
  padding-top: 18px;
  font-size: clamp(13px, 1.7vw, 17px);
  line-height: 1.08;
}

.platform.is-source .platform-top {
  background: linear-gradient(180deg, #fffaf0 0%, #f7ebce 100%);
}

.platform.is-source .platform-label {
  font-size: clamp(18px, 2.2vw, 22px);
}

.platform.is-aimed .platform-top {
  background: linear-gradient(180deg, #b8f2e1 0%, #73ceb1 100%);
}

.platform.is-aimed {
  filter: drop-shadow(0 14px 24px rgba(29, 158, 154, 0.2));
}

.platform.is-success {
  transform: rotate(-10deg) translateY(12px) scaleY(0.98);
}

.platform.is-success .platform-top {
  background: linear-gradient(180deg, #ffe39b 0%, #f4c55a 100%);
}

.platform.is-wrong .platform-top {
  background: linear-gradient(180deg, #ffe8e3 0%, #ffd0c7 100%);
}

.platform.reveal-correct .platform-top {
  box-shadow:
    0 18px 26px rgba(65, 97, 122, 0.14),
    0 0 0 8px rgba(244, 197, 90, 0.18);
}

.runner {
  position: absolute;
  width: 82px;
  height: 102px;
  pointer-events: none;
  z-index: 4;
}

.runner-shadow {
  position: absolute;
  left: 10px;
  bottom: 6px;
  width: 62px;
  height: 16px;
  border-radius: 999px;
  background: rgba(63, 97, 124, 0.18);
  filter: blur(5px);
}

.runner-body {
  position: absolute;
  left: 10px;
  bottom: 18px;
  width: 62px;
  height: 62px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 36% 38%, #ffffff 0 3px, transparent 3px),
    radial-gradient(circle at 64% 38%, #ffffff 0 3px, transparent 3px),
    linear-gradient(180deg, #253d53 0%, #162b3b 100%);
  box-shadow: 0 18px 22px rgba(30, 53, 74, 0.22);
  transform-origin: center bottom;
}

.runner.charging .runner-body {
  height: 42px;
  bottom: 24px;
  border-radius: 24px 24px 18px 18px;
}

.runner.success .runner-body {
  background:
    radial-gradient(circle at 36% 38%, #ffffff 0 3px, transparent 3px),
    radial-gradient(circle at 64% 38%, #ffffff 0 3px, transparent 3px),
    linear-gradient(180deg, #1d9e9a 0%, #177a74 100%);
}

.trajectory {
  position: absolute;
  height: 0;
  border-top: 3px dashed rgba(29, 158, 154, 0.35);
  opacity: 0;
  pointer-events: none;
  transform-origin: left center;
}

.trajectory.visible {
  opacity: 1;
}

.gesture-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.gesture-anchor,
.gesture-vector,
.gesture-pill,
.feedback-pill {
  position: absolute;
  opacity: 0;
  transition: opacity 120ms ease;
}

.gesture-anchor.is-visible,
.gesture-vector.is-visible,
.gesture-pill.is-visible,
.feedback-pill.is-visible {
  opacity: 1;
}

.gesture-anchor {
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow:
    0 0 0 12px rgba(29, 158, 154, 0.14),
    0 0 0 26px rgba(29, 158, 154, 0.08);
}

.gesture-vector {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(29, 158, 154, 0.24), rgba(29, 158, 154, 0.84));
  transform-origin: left center;
}

.gesture-pill,
.feedback-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 28px rgba(77, 97, 117, 0.14);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.gesture-pill {
  white-space: nowrap;
}

.feedback-pill {
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
}

.feedback-pill.success {
  background: rgba(184, 242, 225, 0.9);
  color: #177a74;
}

.feedback-pill.failure {
  background: rgba(255, 232, 227, 0.92);
  color: #b64c42;
}

.status-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 28px rgba(72, 104, 123, 0.14);
  backdrop-filter: blur(10px);
  z-index: 7;
  pointer-events: none;
}

.status-copy strong {
  display: block;
  font-size: 16px;
}

.status-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 13px;
}

.meter-panel {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.meter-strip-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 800;
}

.meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(29, 52, 72, 0.08);
  overflow: hidden;
}

.meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal) 0%, var(--gold) 100%);
  transition: width 80ms linear;
}

.result-summary {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.result-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.progress-stats > div {
  padding: 18px;
  text-align: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
}

.progress-stats strong {
  display: block;
  font-size: 32px;
}

.page-shell {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.page-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 180px;
  background:
    radial-gradient(circle at 14% 12%, rgba(244, 197, 90, 0.26), transparent 34%),
    radial-gradient(circle at 86% 0%, rgba(29, 158, 154, 0.18), transparent 30%);
  pointer-events: none;
}

.page-shell::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  height: 28px;
  border-radius: 999px;
  background: rgba(89, 119, 144, 0.08);
  filter: blur(10px);
  pointer-events: none;
}

.page-shell > * {
  position: relative;
  z-index: 1;
}

.page-shell-home {
  background:
    radial-gradient(circle at 14% 0%, rgba(244, 197, 90, 0.18), transparent 28%),
    radial-gradient(circle at 88% 2%, rgba(29, 158, 154, 0.14), transparent 24%),
    var(--panel);
}

.page-copy,
.page-side {
  min-width: 0;
}

.page-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.nav-pill {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 12px 24px rgba(72, 104, 123, 0.1);
}

.page-card-grid {
  position: relative;
}

.page-lead {
  margin-bottom: 0;
}

.hero-note,
.spotlight-card,
.pack-item,
.progress-item,
.stage-card,
.progress-stats > div {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.58)),
    radial-gradient(circle at top right, rgba(76, 195, 187, 0.12), transparent 36%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 18px 30px rgba(72, 104, 123, 0.1);
}

.hero-note::before,
.spotlight-card::before,
.pack-item::before,
.progress-item::before,
.stage-card::before,
.progress-stats > div::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 72px;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.72), transparent 72%);
  pointer-events: none;
}

.spotlight-card-main {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62)),
    radial-gradient(circle at 14% 0, rgba(244, 197, 90, 0.26), transparent 28%);
}

.pack-row span,
.card-row span,
.result-summary,
.progress-item p {
  color: var(--muted);
}

.brief-flow {
  gap: 12px;
}

.brief-flow span {
  justify-content: center;
  text-align: center;
}

.result-actions {
  margin-top: 24px;
}

.page-primary-cta {
  min-height: 56px;
}

.progress-stats > div span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

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

  .status-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .meter-panel {
    min-width: 0;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100%, calc(100% - 20px));
    padding: calc(10px + var(--safe-top)) 0 calc(18px + var(--safe-bottom));
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 30px;
  }

  .screen-panel,
  .hero-panel,
  .game-screen {
    border-radius: 24px;
  }

  .screen-panel,
  .hero-panel {
    padding: 18px;
  }

  .page-topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .nav-pill {
    width: fit-content;
    padding: 10px 14px;
  }

  .game-screen {
    padding: 10px;
    gap: 6px;
  }

  .hero-actions,
  .button-stack {
    grid-template-columns: 1fr;
  }

  .hero-actions > *,
  .button-stack > * {
    width: 100%;
  }

  .hero-side {
    gap: 12px;
  }

  .hero-badge {
    justify-self: start;
  }

  .spotlight-grid,
  .page-card-grid,
  .pack-list,
  .progress-list {
    gap: 12px;
  }

  .hero-note,
  .spotlight-card,
  .pack-item,
  .progress-item,
  .stage-card,
  .progress-stats > div {
    border-radius: 22px;
  }

  .section-top,
  .pack-meta,
  .pack-row,
  .progress-row {
    flex-direction: column;
    align-items: stretch;
  }

  .game-header {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 4px;
    align-items: center;
  }

  .hud {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .hud > div {
    min-height: 40px;
    padding: 0 10px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .hud small {
    display: inline;
    font-size: 11px;
    letter-spacing: 0;
  }

  .hud strong {
    display: inline;
    margin-top: 0;
    font-size: 15px;
  }

  .prompt-row {
    gap: 4px;
  }

  .target-stack {
    gap: 4px;
  }

  .mode-panel {
    padding: 16px;
  }

  .mode-panel-top {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-panel-top h3 {
    font-size: 22px;
  }

  .mode-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mode-option {
    padding: 12px 14px;
    border-radius: 18px;
  }

  .target-stack .eyebrow {
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  .back-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 24px;
  }

  .replay-inline {
    align-self: stretch;
  }

  .replay-icon-btn {
    width: 36px;
    height: 36px;
  }

  .replay-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .target-pill strong {
    font-size: clamp(20px, 7.4vw, 26px);
  }

  .target-pill {
    width: 100%;
    min-height: 64px;
    padding: 10px 12px;
    border-radius: 20px;
    gap: 10px;
  }

  .target-pill[data-cue-kind="picture"] {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    min-height: 116px;
  }

  .listen-row {
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
  }

  .target-visual {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 24px;
  }

  .target-pill[data-cue-kind="picture"] .target-visual.has-visual {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    font-size: 56px;
  }

  .target-meaning {
    flex: 1 1 auto;
    font-size: 13px;
    line-height: 1.28;
  }

  .feedback-banner {
    display: none;
  }

  .viewport-wrap {
    padding: 3px;
    border-radius: 16px;
  }

  .viewport {
    min-height: auto;
    height: clamp(500px, 70svh, 620px);
    border-radius: 18px;
  }

  .world {
    height: 660px;
  }

  .world::after {
    left: 32px;
    right: 24px;
    bottom: 18px;
    height: 16px;
  }

  .platform-label {
    padding: 14px 8px 0;
    font-size: 15px;
    line-height: 1.02;
  }

  .platform-label.is-long {
    font-size: 13px;
  }

  .platform-label.is-compact {
    padding-top: 12px;
    font-size: 11px;
    line-height: 1.04;
  }

  .feedback-pill,
  .gesture-pill {
    font-size: 13px;
    padding: 8px 12px;
  }

  .status-bar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
  }

  .status-copy {
    display: none;
  }

  .meter-panel {
    min-width: 0;
    gap: 0;
  }

  .meter-strip-label {
    display: none;
  }

  .meter {
    height: 8px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 12px 24px rgba(72, 104, 123, 0.14);
    backdrop-filter: blur(8px);
  }

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

  .card-row,
  .pack-row {
    flex-direction: column;
    align-items: stretch;
  }

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

  .brief-example {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .viewport {
    height: clamp(472px, 68svh, 580px);
  }
}
