:root {
  --field: #4c9a3c;
  --paper: #f7efc8;
  --paper-2: #ebe3b4;
  --panel: #fff8d6;
  --ink: #181810;
  --muted: #3a3824;
  --line: #181810;
  --seal: #2f6d22;
  --seal-dark: #1d4a16;
  --pine: #1d4a16;
  --gold: #f0c030;
  --danger: #c42018;
  --shadow: 4px 4px 0 #181810;
  --pixel: "Press Start 2P", "Pixelify Sans", monospace;
  --sans: "Pixelify Sans", "Noto Sans TC", "Segoe UI", sans-serif;
  --serif: "Pixelify Sans", "Noto Sans TC", sans-serif;
  --cjk: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --brand: "Fraunces", Georgia, serif;
  --header: 72px;
  --radius: 0;
  --font-scale: 1;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--ink); }
img, .pixel-logo { image-rendering: pixelated; image-rendering: crisp-edges; }

body {
  font-family: var(--sans);
  color: var(--ink);
  letter-spacing: 0;
  font-size: calc(16px * var(--font-scale, 1));
  overflow: hidden;
  background-color: var(--field);
  background-image:
    linear-gradient(90deg, rgba(24, 24, 16, 0.14) 50%, transparent 50%),
    linear-gradient(rgba(24, 24, 16, 0.14) 50%, transparent 50%);
  background-size: 16px 16px;
}
body[data-theme="ink"] {
  --field: #0a1610;
  --paper: #18241c;
  --paper-2: #203028;
  --panel: #24362c;
  --ink: #f3f6cc;
  --muted: #c5d4a4;
  --line: #f3f6cc;
  --seal: #6ec04a;
  --seal-dark: #3d8c28;
  --pine: #3d8c28;
  --gold: #f0c030;
  --danger: #f06048;
  --shadow: 4px 4px 0 #081008;
}
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}

h1, h2, h3, h4, em, .wordmark em, .device strong, .review-card .zh, .bubble .zh {
  font-family: var(--serif);
  font-style: normal;
  font-weight: 700;
}
.han, .catalog-grid strong, .zh { font-family: var(--cjk), var(--serif); }

.kicker, .eyebrow, .brand-kicker, .stat span, .plan-chip, .studio-chip, .badge, .device-live {
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.setup, .landing, .app { min-height: 100%; }
.setup {
  display: grid;
  place-items: center;
  padding: 24px;
}
.setup-card, .panel, .modal-card, .review-card, .device, .scene-card {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
}
.setup-card {
  width: min(440px, 100%);
  padding: 28px 24px;
  text-align: center;
}
.seal {
  width: 96px;
  height: 96px;
  margin: 0 auto 12px;
  background: transparent;
  border: 0;
  display: grid;
  place-items: center;
  overflow: visible;
  image-rendering: pixelated;
}
.seal.sm {
  width: 56px;
  height: 56px;
  margin: 0;
  border: 0;
}
.pixel-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-kicker {
  margin: 0;
  color: var(--seal-dark);
}
body[data-theme="ink"] .brand-kicker { color: var(--gold); }
h1 { margin: 10px 0 12px; font-size: 28px; font-weight: 700; }
.bar {
  height: 14px;
  background: var(--ink);
  overflow: hidden;
  margin: 22px 0 14px;
  border: 3px solid var(--ink);
}
#setup-bar, #widget-load-bar {
  height: 100%;
  width: 4%;
  background: repeating-linear-gradient(90deg, var(--gold) 0 8px, #d8a018 8px 10px);
  transition: width 0.2s steps(8);
}
.hint, .muted, .lede, .opt, .fine { color: var(--muted); }
.hint, .lede, .fine { line-height: 1.45; }
.fine { font-size: 13px; margin-top: 16px; }
.error { color: var(--danger); font-size: 13px; font-weight: 700; }

.land-nav, .site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
}
.land-nav {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--panel);
  border-bottom: 4px solid var(--ink);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: none;
}
.brand-wordmark {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  line-height: 1;
}
.brand-wordmark .wm-voice,
.brand-wordmark .wm-grove {
  font-family: var(--pixel);
  font-weight: 400;
  text-transform: lowercase;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
}
.brand-wordmark .wm-voice {
  font-size: 18px;
  color: var(--ink);
}
.brand-wordmark .wm-grove {
  font-size: 14px;
  color: var(--muted);
  transform: translateY(2px);
}
.wordmark em {
  font-family: var(--pixel);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
}
.brand-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.brand-copy em { font-size: 10px; }
.brand-copy span { font-family: var(--pixel); font-size: 8px; color: var(--muted); }
.land-links { display: flex; gap: 22px; }
.land-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.land-cta { display: flex; align-items: center; gap: 8px; }
.text-btn {
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  color: var(--seal-dark);
  padding: 8px 0;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
body[data-theme="ink"] .text-btn { color: var(--gold); }

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 32px;
}
.eyebrow {
  margin: 0 0 14px;
  color: var(--seal-dark);
}
body[data-theme="ink"] .eyebrow { color: var(--gold); }
.hero h1 {
  font-size: clamp(28px, 4.4vw, 48px);
  line-height: 1.15;
  margin: 0 0 16px;
  font-weight: 700;
}
.hero .lede { font-size: 17px; max-width: 34em; margin: 0; }
.hero-actions, .review-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

.device {
  padding: 16px;
  box-shadow:
    0 0 0 8px #2c2c20,
    0 0 0 12px var(--ink),
    8px 8px 0 var(--ink);
}
body[data-theme="ink"] .device {
  box-shadow:
    0 0 0 8px #081008,
    0 0 0 12px var(--ink),
    8px 8px 0 #081008;
}
.device-top, .device-goals {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.device-top { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.device-live { color: var(--danger); }
.device .han { font-size: 36px; margin: 8px 0; }
.device-goals { margin-bottom: 16px; }
.device-goals span {
  flex: 1;
  font-size: 11px;
  border: 3px solid var(--ink);
  padding: 7px 6px;
  text-align: center;
  color: var(--muted);
  background: var(--paper);
}
.device-goals span.on {
  background: var(--gold);
  color: var(--ink);
}
.device-chat { display: grid; gap: 10px; }
.device .bubble {
  width: max-content;
  max-width: 82%;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
}
.device .bubble.you {
  justify-self: end;
  background: var(--ink);
  color: var(--panel);
}
.device .bubble small, .device .bubble em {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 11px;
  opacity: 0.75;
}
.device .bubble strong { font-size: 18px; font-weight: 700; }

.proof {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1120px;
  margin: 12px auto 0;
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  background: var(--panel);
}
.proof div {
  padding: 22px 28px;
  font-size: 14px;
  color: var(--muted);
}
.proof div + div { border-left: 4px solid var(--ink); }
.proof b {
  display: block;
  font-size: 28px;
  color: var(--ink);
  margin-bottom: 4px;
}

.method, .catalog {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px;
}
.method header, .catalog header { max-width: 640px; margin-bottom: 36px; }
.method h2, .catalog h2, .course-head h2 {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 36px);
  font-weight: 700;
  line-height: 1.2;
}
.method-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.method-grid article {
  padding: 16px;
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
}
.method-grid span {
  font-family: var(--pixel);
  color: var(--seal-dark);
  font-size: 10px;
}
body[data-theme="ink"] .method-grid span { color: var(--gold); }
.method-grid h3 { margin: 10px 0 8px; font-size: 20px; }
.method-grid p { margin: 0; color: var(--muted); line-height: 1.45; }
.method-hero { padding-top: 20px; }
.method-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 920px;
  width: 100%;
  margin-inline: auto;
}
.method-step {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 8px;
  width: 100%;
  min-height: 200px;
  box-sizing: border-box;
}
.method-steps-more {
  margin-top: 12px;
}
.method-step h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  min-height: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.method-step .primary-btn { align-self: center; text-decoration: none; margin-top: auto; }
.method-step-soon { opacity: 0.62; }
.method-soon-badge { align-self: center; font-size: 8px; }
.method-step .primary-btn:disabled {
  cursor: not-allowed;
  box-shadow: none;
  background: var(--paper-2);
  color: var(--muted);
}
.method-step .primary-btn:disabled:hover { background: var(--paper-2); }
.step-mascot {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  object-fit: contain;
  object-position: center;
  display: block;
  margin-inline: auto;
}
.step-mascot-logo {
  image-rendering: auto;
}
.view-wide { max-width: 1040px; }
.reading-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.reading-shelf {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 14px 14px 16px;
  min-height: 140px;
}
.reading-shelf h3 { margin: 6px 0 8px; font-size: 18px; }
.reading-shelf .muted { margin: 0; font-size: 13px; line-height: 1.4; }
.repeat-note {
  margin: 4px 0 0;
  font-family: var(--pixel);
  font-size: 10px;
  text-transform: uppercase;
}
.cards-collection,
.cards-catalog {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cards-row,
.cards-next {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  text-align: left;
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.cards-row h3,
.cards-next h3 {
  margin: 0;
  font-size: 18px;
}
.cards-row p,
.cards-next p {
  margin: 4px 0 0;
}
.cards-row .cards-row-actions,
.cards-next .cards-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cards-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 10px;
}
.cards-section-head .label { margin: 0; }
#cards-study-all {
  width: 100%;
  margin-top: 4px;
}
#cards-study-all:disabled {
  opacity: 0.55;
  cursor: default;
}
.cards-make { margin-bottom: 28px; }
.cards-make textarea { width: 100%; }
.cards-next { margin: 20px 0 8px; outline: 4px solid var(--gold); }
.cards-kicker {
  margin: 0;
  font-family: var(--pixel);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
}
.cards-prompt {
  margin: 0 0 8px;
  font-family: var(--pixel);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
}
.cards-catalog-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.cards-study { max-width: 560px; }
.cards-card { min-height: 220px; display: grid; align-content: center; }
.cards-grades {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.cards-grades[hidden] { display: none; }
.cards-grades button { width: 100%; }
.cards-study-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cards-study-head .review-meta { margin: 0; }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.catalog-grid figure {
  margin: 0;
  background: #000;
  color: #f8f0c8;
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 20px 12px 16px;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
}
.catalog-grid strong { font-size: 36px; font-weight: 700; }
.catalog-grid figcaption {
  font-family: var(--pixel);
  font-size: 8px;
  opacity: 0.85;
  margin-top: 8px;
}

.land-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 24px 32px;
  border-top: 4px solid var(--ink);
  background: var(--paper-2);
  text-align: center;
}
.land-foot-primary,
.land-foot-secondary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
}
.land-foot a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.4;
}
.land-foot a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.land-foot-primary a {
  font-weight: 700;
  color: var(--ink);
}
.land-foot-secondary a {
  font-weight: 400;
  color: var(--muted);
}

.app {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: var(--header) auto 1fr;
  background: var(--paper);
}
.site-header {
  height: var(--header);
  background: var(--panel);
  border-bottom: 4px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 5;
}
.stats { display: flex; gap: 14px; }
.stat {
  background: var(--paper);
  border: 3px solid var(--ink);
  padding: 4px 8px;
  text-align: left;
  cursor: default;
  font: inherit;
  min-width: 72px;
  box-shadow: 2px 2px 0 var(--ink);
}
.stat b { display: block; font-size: 16px; }
.avatar {
  width: 36px;
  height: 36px;
  border: 3px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  font-family: var(--pixel);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.tabs, .dock {
  display: flex;
  gap: 0;
  padding: 0 12px;
  background: var(--panel);
  border-bottom: 4px solid var(--ink);
}
.tabs button, .dock button {
  background: none;
  border: 0;
  border-bottom: 4px solid transparent;
  padding: 12px 14px;
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
}
.tabs button.active, .dock button.active {
  color: var(--ink);
  background: var(--gold);
  border-bottom-color: var(--ink);
}
.tabs button.active::before,
.dock button.active::before {
  content: "▶";
  margin-right: 6px;
}
.dock {
  display: none;
  position: sticky;
  bottom: 0;
  border-top: 4px solid var(--ink);
  border-bottom: 0;
  justify-content: space-around;
}
.stage { overflow: auto; padding: 24px 24px 56px; background: var(--paper); }
.app.on-home .stage { padding: 16px 24px 48px; overflow: auto; }
.app.in-lesson .stage { padding: 0; overflow: hidden; background: var(--panel); }
.widget-band {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 24px 8px;
}
.lesson-widget {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 340px;
}
.lesson-widget.is-loading { height: 340px; }
.lesson-widget.is-play { height: 480px; }
.app.in-lesson .widget-band {
  max-width: 1180px;
  height: 100%;
  min-height: 100%;
  padding: 12px 16px 16px;
  box-sizing: border-box;
}
.app.in-lesson .lesson-widget {
  height: 100%;
  flex: 1;
}
.app.in-lesson .widget-idle,
.app.in-lesson .widget-loading,
.app.in-lesson .home-story,
.app.in-lesson .land-foot { display: none !important; }
.app.in-lesson #home-page { height: 100%; }
.widget-chrome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 14px;
  border-bottom: 4px solid var(--ink);
  background: var(--gold);
  flex: none;
}
.widget-chrome-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.widget-chrome-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-chrome .kicker { margin: 0; color: var(--ink); }
.widget-chrome-actions { display: flex; align-items: center; gap: 8px; flex: none; }
a.play-home-link {
  display: grid;
  place-items: center;
  text-decoration: none;
  color: inherit;
}
.open-browser {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 3px solid var(--ink);
  background: var(--seal);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
}
.open-browser:hover { background: var(--seal-dark); color: #fff; }
@keyframes widget-nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.widget-idle, .widget-loading, .widget-stage {
  flex: 1;
  min-height: 0;
}
.widget-idle { display: flex; flex-direction: column; }
.widget-cover {
  height: 100%;
  position: relative;
  background-color: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  color: #f8f0c8;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 28px 32px;
  overflow: hidden;
}
.widget-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 6, 0.28) 0%, rgba(8, 12, 6, 0.78) 100%);
  pointer-events: none;
}
.widget-cover-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 36em;
}
.widget-cover strong {
  font-family: var(--cjk), var(--serif);
  font-size: 56px;
  line-height: 1;
  margin-bottom: 18px;
  text-shadow: 3px 3px 0 #000;
}
.widget-cover .eyebrow { color: var(--gold); margin-bottom: 8px; }
.widget-cover h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  text-shadow: 3px 3px 0 #000;
}
.widget-cover p { margin: 0; max-width: 28em; color: #c8d898; text-shadow: 2px 2px 0 #000; }
.widget-cover #try-lesson {
  margin-top: 22px;
  animation: widget-nudge 1.6s steps(2) 0.4s 5;
}
.widget-loading {
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 32px;
  background: var(--panel);
}
.widget-loading .kicker { margin: 0; }
.widget-loading #widget-load-msg {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
}
.widget-bar { width: min(360px, 80%); margin: 0 auto; height: 14px; }
.widget-stage { display: flex; flex-direction: column; }
.widget-stage .play {
  flex: 1;
  min-height: 0;
  height: auto;
  max-width: none;
  width: 100%;
  padding: 12px 14px 8px;
}
.app.on-home .play { grid-template-columns: 200px minmax(0, 1fr); gap: 0 14px; }
.app.on-home .practice-rail { padding-right: 12px; }
.app.on-home .practice-rail h2 { font-size: 20px; }
.app.on-home #play-setting,
.app.on-home #word-rows,
.app.on-home #phrases-label { display: none; }
.app.on-home .play-tools { display: none; }
.app.in-lesson .open-browser { display: none !important; }
.home-story {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 24px;
}
.home-story.method,
.home-story.catalog { padding: 40px 24px 24px; }
.home-story h2 {
  margin: 0 0 20px;
  font-size: clamp(24px, 3.6vw, 36px);
  font-weight: 700;
  line-height: 1.15;
}
.app.on-home .land-foot {
  max-width: 1120px;
  margin: 32px auto 0;
}
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.story-grid p {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
}
.view { max-width: 860px; margin: 0 auto; }
.view.play { max-width: none; height: 100%; }
.course-head { margin-bottom: 8px; }
.kicker {
  margin: 0 0 8px;
  color: var(--seal-dark);
  font-weight: 400;
}
body[data-theme="ink"] .kicker { color: var(--gold); }
.course-head .lede { margin: 10px 0 0; max-width: 36em; }
.course-path { padding: 8px 0 32px; }

.unit { margin: 36px 0 8px; }
.unit-banner {
  color: #f8f0c8;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  image-rendering: pixelated;
}
.unit-banner p { margin: 6px 0 0; opacity: 0.85; font-size: 14px; font-family: var(--sans); }
.unit-banner h3 { margin: 0; font-size: 22px; }
.unit-flag {
  background: var(--gold);
  border: 3px solid var(--ink);
  color: var(--ink);
  padding: 8px 12px;
  font-family: var(--pixel);
  font-size: 8px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
}
.unit-flag:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.unit-path {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  padding: 40px 0 20px;
}
.unit-path::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 50%;
  width: 4px;
  background: var(--ink);
}
.skill-node {
  width: 72px;
  height: 72px;
  border: 4px solid var(--ink);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  color: var(--ink);
}
.skill-node:nth-child(odd) { margin-left: -108px; }
.skill-node:nth-child(even) { margin-right: -108px; }
.skill-node .han { font-size: 22px; font-weight: 700; line-height: 1; }
.skill-node.done {
  background: var(--gold);
}
.skill-node.current {
  background: var(--seal);
  color: #f8f0c8;
}
.skill-node.locked { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.skill-node .caption {
  position: absolute;
  top: calc(100% + 10px);
  width: 130px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--sans);
  text-align: center;
  color: var(--ink);
}

.speak-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 22px;
}
.scene-card {
  text-align: left;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.scene-card .scene-art {
  height: 110px;
  background-color: var(--paper-2);
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-bottom: 3px solid var(--ink);
}
.scene-card .scene-body {
  padding: 14px 16px 16px;
}
.scene-card .han {
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 8px;
}
.scene-card h4 { margin: 8px 0 4px; font-size: 16px; }
.scene-card p { margin: 0; color: var(--muted); font-size: 13px; }
.scene-card .loc {
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--seal-dark);
  margin-top: 8px;
}
.modal-scene-art {
  width: 100%;
  height: 140px;
  margin: 0 0 14px;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.badge {
  display: inline-block;
  color: var(--muted);
  border: 3px solid var(--ink);
  padding: 3px 7px;
  background: var(--paper);
}
.badge.done { background: var(--gold); color: var(--ink); }
.delete {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 3px solid var(--ink);
  background: var(--paper);
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.primary-btn, .ghost-btn, .mic {
  border: 3px solid var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.primary-btn {
  background: var(--gold);
  color: var(--ink);
  padding: 12px 16px;
  box-shadow: 4px 4px 0 var(--ink);
}
.primary-btn:hover { background: #ffd24a; }
.primary-btn:active, .ghost-btn:active, .mic:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}
.primary-btn.lg, .ghost-btn.lg { padding: 14px 20px; font-size: 16px; }
.ghost-btn {
  background: var(--panel);
  color: var(--ink);
  padding: 10px 14px;
  box-shadow: 3px 3px 0 var(--ink);
}
.panel { padding: 20px; display: grid; gap: 12px; }
label, .label { font-size: 13px; font-weight: 700; display: grid; gap: 6px; }
input, textarea, select {
  width: 100%;
  border: 3px solid var(--ink);
  padding: 10px;
  font: inherit;
  background: var(--panel);
  color: var(--ink);
  box-shadow: inset 2px 2px 0 rgba(24, 24, 16, 0.12);
}
body[data-theme="ink"] input,
body[data-theme="ink"] textarea,
body[data-theme="ink"] select {
  background: #102018;
  color: var(--ink);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button {
  border: 3px solid var(--ink);
  background: var(--panel);
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.chips button.active {
  background: var(--gold);
  color: var(--ink);
}
.chips button.active::before { content: "▶ "; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }
.plan-box {
  background: var(--paper);
  border: 3px solid var(--ink);
  padding: 14px;
}
.form-status { min-height: 1.2em; color: var(--muted); }
.section-title { margin: 28px 0 8px; font-size: 22px; }

.review-card {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 36px;
  cursor: pointer;
}
.review-card .zh { font-size: 44px; font-weight: 700; }
.review-card .py { margin-top: 10px; color: var(--muted); }

.play {
  max-width: 1180px;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0 20px;
  min-height: 0;
}
.practice-rail {
  overflow: auto;
  padding-right: 16px;
  border-right: 4px solid var(--ink);
  min-height: 0;
}
.practice-rail h2 { margin: 0 0 4px; font-size: 24px; }
.practice-rail .lede { margin: 8px 0 18px; font-size: 14px; }
.practice-rail .label { margin: 18px 0 8px; }
.practice-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}
.play-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.goals { display: grid; gap: 8px; }
.play .goals { grid-template-columns: 1fr; margin-bottom: 0; }
.goal {
  background: var(--panel);
  border: 3px solid var(--ink);
  padding: 10px;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  box-shadow: 2px 2px 0 var(--ink);
}
.goal.done { background: var(--gold); color: var(--ink); }
.mark {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  flex: none;
  margin-top: 3px;
  opacity: 0.5;
}
.goal.done .mark { background: var(--ink); border-color: var(--ink); opacity: 1; }
.banner {
  background: var(--ink);
  color: var(--panel);
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 3px solid var(--ink);
}
.banner-cta {
  border: 3px solid var(--panel);
  background: transparent;
  color: var(--panel);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}
.transcript {
  background: var(--panel);
  border: 4px solid var(--ink);
  padding: 14px;
  overflow: auto;
  min-height: 0;
  flex: 1;
  box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 6px var(--ink);
}
.word-rows { display: grid; gap: 8px; }
.word-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  align-items: center;
}
.word-row button {
  border: 3px solid var(--ink);
  background: var(--gold);
  height: 36px;
  cursor: pointer;
}
.zh { font-weight: 700; }
.py, .en { font-size: 13px; color: var(--muted); }
.bubble-row { display: flex; margin: 10px 0; }
.bubble-row.learner { justify-content: flex-end; }
.bubble-row.action { justify-content: center; }
.bubble {
  max-width: 78%;
  background: var(--paper);
  border: 3px solid var(--ink);
  padding: 10px 12px;
  box-shadow: 3px 3px 0 var(--ink);
}
.bubble.action {
  background: transparent;
  border: none;
  color: var(--muted, #6b6458);
  font-style: italic;
  font-size: 0.92rem;
  box-shadow: none;
  padding: 4px 8px;
}
.bubble-row.learner .bubble {
  background: var(--ink);
  color: var(--panel);
}
.bubble-row.learner .py,
.bubble-row.learner .en,
.bubble-row.learner .who { color: rgba(248, 240, 200, 0.75); }
.who {
  font-family: var(--pixel);
  font-size: 8px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 4px;
}
.speak-mini {
  margin-top: 6px;
  border: 0;
  background: transparent;
  text-decoration: underline;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  color: inherit;
}
.hint-card {
  margin: 10px 0;
  background: var(--panel);
  border: 4px solid var(--gold);
  padding: 12px;
  box-shadow: var(--shadow);
}
.talk-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 0 8px;
}
.mic {
  min-width: 168px;
  height: 56px;
  background: var(--gold);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.4;
}
.mic.rec { background: var(--danger); color: #fff; }
.type-form { display: flex; gap: 8px; }
.recap { text-align: center; padding: 40px 24px; }
.done-goals { list-style: none; padding: 0; text-align: left; }
.done-goals li { padding: 8px 0; border-bottom: 3px solid var(--ink); }
.done-goals li.on { color: var(--seal-dark); font-weight: 700; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 24, 16, 0.72);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}
.modal-card { width: min(500px, 100%); padding: 24px; position: relative; }
.signup-card { text-align: left; }
.signup-card h3 { margin: 0 0 8px; font-size: 24px; }
.signup-card .lede { margin: 0 0 20px; }
.signup-card form { display: grid; gap: 12px; }
.signup-card .text-btn { margin-top: 12px; padding-left: 0; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 3px solid var(--ink);
  background: var(--gold);
  font-size: 18px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  box-shadow: 2px 2px 0 var(--ink);
}
.modal-card h3 { margin: 0 0 8px; font-size: 24px; }
.task-list { padding-left: 18px; color: var(--muted); }
.quiz-choice {
  display: block;
  width: 100%;
  text-align: left;
  margin: 8px 0;
  padding: 12px;
  border: 3px solid var(--ink);
  background: var(--panel);
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.quiz-choice:hover { background: var(--gold); }

@media (max-width: 900px) {
  .story-grid { grid-template-columns: 1fr; }
  .widget-band { padding: 16px 16px 8px; }
  .lesson-widget,
  .lesson-widget.is-loading { height: 300px; }
  .lesson-widget.is-play { height: min(72vh, 520px); }
  .widget-cover { padding: 28px 20px; }
  .widget-cover strong { font-size: 42px; }
  .open-browser span, .open-browser { font-size: 12px; padding: 7px 9px; }
  .home-story,
  .home-story.method,
  .home-story.catalog { padding: 36px 16px 16px; }
  .hero, .method-grid, .method-steps, .proof { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: 1fr 1fr; }
  .play,
  .app.on-home .play { grid-template-columns: 1fr; }
  .practice-rail {
    border-right: 0;
    border-bottom: 4px solid var(--ink);
    padding-right: 0;
    padding-bottom: 12px;
    max-height: 38%;
  }
  .hero { gap: 28px; padding-top: 32px; }
  .method-grid article, .proof div + div { border-left: 0; }
  .land-links { display: none; }
  .app { grid-template-rows: var(--header) 1fr auto; }
  .tabs { display: none; }
  .dock { display: flex; }
  .stats .stat:nth-child(2) { display: none; }
  .skill-node:nth-child(odd), .skill-node:nth-child(even) { margin: 0; }
  .stage { padding: 18px 16px 28px; }
  .app.on-home .stage,
  .app.in-lesson .stage { padding: 0; }
  .hero, .method, .catalog { padding-left: 16px; padding-right: 16px; }
  .land-nav, .site-header, .land-foot { padding-left: 16px; padding-right: 16px; }
  .wordmark em, .brand-copy em { font-size: 10px; }
}

@media (max-width: 1100px) {
  .method-grid { grid-template-columns: 1fr 1fr; }
  .method-steps { grid-template-columns: 1fr; max-width: none; }
  .method-steps-more { grid-template-columns: 1fr; }
}

.culture, .cando {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 8px 0 0;
}
.review-meta { color: var(--muted); margin: 0 0 12px; font-size: 13px; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
#cards-due-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.4em;
  margin-left: 4px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 8px;
  font-family: var(--pixel);
  border: 2px solid var(--ink);
}
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type="search"] { min-width: min(280px, 100%); }
.daily-card {
  background: var(--ink);
  color: var(--panel);
  padding: 18px 20px;
  margin-bottom: 18px;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
}
.daily-card h3 { margin: 4px 0 8px; }
.daily-card .kicker { color: var(--gold); }
.daily-card .primary-btn { background: var(--gold); color: var(--ink); }
.dash-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.dash-tile {
  border: 4px solid var(--ink);
  background: var(--panel);
  text-align: left;
  padding: 16px 14px;
  cursor: pointer;
  font: inherit;
  box-shadow: var(--shadow);
}
.dash-tile b {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
}
.dash-tile span { color: var(--muted); font-size: 12px; }
.lab-block {
  background: var(--panel);
  border: 4px solid var(--ink);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.lab-block h3 { margin: 0 0 8px; }
.tone-row, .measure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.tone-row article, .measure-grid article {
  background: var(--paper);
  padding: 12px;
  border: 3px solid var(--ink);
}
.tone-row b { font-size: 28px; }
.pinyin-line { display: flex; flex-wrap: wrap; gap: 6px; }
.pinyin-line span {
  border: 3px solid var(--ink);
  padding: 4px 8px;
  font-size: 13px;
  background: var(--panel);
}
.journal-list { display: grid; gap: 12px; }
.journal-card {
  background: var(--panel);
  border: 4px solid var(--ink);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.journal-card h3 { margin: 0 0 6px; }
.journal-card .ghost-btn { margin-right: 8px; margin-top: 8px; }
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.award {
  border: 4px solid var(--ink);
  background: var(--panel);
  padding: 14px;
  opacity: 0.45;
}
.award.on { opacity: 1; background: var(--gold); }
.heat {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 4px;
  margin-top: 16px;
}
.heat i {
  display: block;
  aspect-ratio: 1;
  background: var(--gold);
  border: 2px solid var(--ink);
}
.file-btn { display: inline-flex; align-items: center; cursor: pointer; }
.account-panel label { display: grid; gap: 6px; margin-bottom: 12px; }
@media (max-width: 900px) {
  .dash-row { grid-template-columns: 1fr 1fr; }
}

.market, .gate, .setup {
  height: 100%;
  overflow: auto;
  background: var(--paper);
}
.market-hero { padding-top: 36px; }
.market-widget-slot {
  min-width: 0;
}
.play-embed-host {
  width: 100%;
  height: 340px;
  overflow: hidden;
  background: transparent;
}
.lesson-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}
.market-widget-slot #play-host,
.market-widget-slot .widget-band,
.market-widget-slot .lesson-widget {
  height: auto;
  min-height: 0;
}
.market-widget-slot .widget-band { max-width: none; padding: 0; }
.market-widget-slot .lesson-widget { height: 340px; }
.market-widget-slot .lesson-widget.is-play { height: min(72vh, 520px); }
.app.on-home #app-widget-slot .play-embed-host {
  max-width: 860px;
  margin: 0 auto 16px;
}
.app.in-lesson .play-embed-host { display: none !important; }
.plan-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 720px;
}
.plan-compare ul { padding-left: 18px; color: var(--muted); }
.plan-compare article.on { outline: 4px solid var(--gold); }
.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
}
.gate-card { width: min(520px, 100%); padding: 28px 24px; }
.gate-card .seal { margin-bottom: 12px; }
.premium-card { width: min(720px, 100%); }
.premium-table { margin: 18px 0; border: 4px solid var(--ink); background: var(--panel); }
.premium-row {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr 0.6fr;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 3px solid var(--ink);
  font-size: 14px;
}
.premium-row.head { font-weight: 700; background: var(--gold); }
.plan-chip, .studio-chip {
  border: 3px solid var(--ink);
  padding: 4px 8px;
  background: var(--panel);
}
.plan-chip { background: var(--gold); }
.theme-toggle { padding: 6px 10px; font-family: var(--pixel); font-size: 8px; }
.dashboard { max-width: 980px; }
#home-page.dashboard {
  max-width: none;
  display: flex;
  flex-direction: column;
}
#home-page.dashboard > .dash-hero,
#home-page.dashboard > .continue-card,
#home-page.dashboard > .dash-grid,
#home-page.dashboard > section:not(.home-roadmap) {
  max-width: 980px;
  width: 100%;
}
.home-roadmap {
  width: 100%;
  align-self: stretch;
}
.dash-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.dash-metrics {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 12px;
  text-align: right;
}
.dash-metrics > div {
  background: var(--panel);
  border: 3px solid var(--ink);
  padding: 8px 10px;
  box-shadow: 3px 3px 0 var(--ink);
}
.dash-metrics b { display: block; font-size: 20px; }
.dash-metrics span { color: var(--muted); font-size: 11px; }
.continue-card {
  background: var(--ink);
  color: var(--panel);
  padding: 20px;
  margin-bottom: 16px;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
}
.continue-card .kicker { color: var(--gold); }
.continue-card h3 { color: var(--panel); }
.continue-card .primary-btn { margin-top: 12px; }

/* Home pixel roadmap banner */
.home-roadmap {
  --roadmap-h: clamp(220px, 34vh, 360px);
  height: var(--roadmap-h);
  min-height: var(--roadmap-h);
  flex: 0 0 var(--roadmap-h);
  margin: 16px 24px 12px;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  background: #6b9e45;
  z-index: 5;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: stretch;
}
.market .home-roadmap {
  margin: 12px 24px 8px;
  width: auto;
  align-self: stretch;
}
.market {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: auto;
}
.roadmap-arrow {
  z-index: 6;
  border: 0;
  border-right: 4px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  font-family: var(--pixel);
  font-size: 14px;
  cursor: pointer;
  image-rendering: pixelated;
  box-shadow: inset -3px 0 0 rgba(24,24,16,0.15);
}
.roadmap-arrow-right {
  border-right: 0;
  border-left: 4px solid var(--ink);
  box-shadow: inset 3px 0 0 rgba(24,24,16,0.15);
}
.roadmap-arrow:hover:not(:disabled) { background: #ffe08a; }
.roadmap-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}
.home-roadmap-scroll {
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.home-roadmap-scroll::-webkit-scrollbar { display: none; height: 0; }
.home-roadmap-track {
  position: relative;
  height: 100%;
  min-width: 100%;
  width: max-content;
  padding: 0;
  background: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.roadmap-bands {
  display: flex;
  align-items: stretch;
  height: 100%;
  min-height: 100%;
  min-width: 100%;
}
.roadmap-band {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1 0 auto;
  min-width: max(520px, calc(100vw - 200px));
  padding: 52px 20px 26px;
  background-size: auto 100%;
  background-position: left bottom;
  background-repeat: repeat-x;
  image-rendering: auto;
  border-right: 0;
}
.roadmap-band-label {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  margin: 0;
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--panel);
  color: var(--ink);
  border: 3px solid var(--ink);
  padding: 5px 8px;
  box-shadow: 3px 3px 0 var(--ink);
}
.roadmap-shared-path {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34px;
  height: 8px;
  background:
    repeating-linear-gradient(
      90deg,
      #9a9a9a 0 8px,
      #7a7a7a 8px 12px,
      #b0b0b0 12px 16px
    );
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  pointer-events: none;
  z-index: 1;
  opacity: 0.92;
}
.roadmap-band-nodes {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-evenly;
  gap: 28px;
  width: 100%;
  padding: 0 10px;
  min-height: 40px;
}
.roadmap-finish {
  flex: 0 0 auto;
  min-width: 120px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 20px 18px;
  background:
    linear-gradient(180deg, rgba(247,239,200,0.55), rgba(247,239,200,0.15)),
    url("/static/roadmap-bg-c1.png?v=immerse1") left bottom / auto 100% repeat-x;
  image-rendering: auto;
  border-left: 4px solid var(--ink);
  position: relative;
  z-index: 2;
}
.roadmap-finish-flag {
  font-family: var(--pixel);
  font-size: 14px;
  background: var(--gold);
  color: var(--ink);
  border: 3px solid var(--ink);
  padding: 8px 10px;
  box-shadow: 3px 3px 0 var(--ink);
}
.roadmap-finish-copy {
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--panel);
  border: 2px solid var(--ink);
  padding: 4px 6px;
}
.roadmap-node {
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 3px solid var(--ink);
  background: var(--panel);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  image-rendering: pixelated;
}
.roadmap-node::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: #d8c890;
}
.roadmap-node.done { background: var(--gold); }
.roadmap-node.done::after {
  background: var(--gold);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.roadmap-node.current,
.roadmap-node.here:not(.done) {
  background: var(--seal);
  transform: translateY(-6px);
}
.roadmap-node.current::after,
.roadmap-node.here:not(.done)::after { background: #7ed957; }
.roadmap-node:hover,
.roadmap-node:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  z-index: 4;
}
.roadmap-dude {
  position: absolute;
  width: 56px;
  height: 56px;
  bottom: 42px;
  transform: translateX(-50%);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center bottom;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  z-index: 3;
  animation: roadmap-idle 0.75s steps(1) infinite;
  filter: drop-shadow(2px 2px 0 rgba(24, 24, 16, 0.55));
}
@keyframes roadmap-idle {
  0%, 32% { background-image: url("/static/roadmap-dude-1.png"); }
  33%, 65% { background-image: url("/static/roadmap-dude-2.png"); }
  66%, 100% { background-image: url("/static/roadmap-dude-3.png"); }
}
.home-roadmap-tip {
  position: fixed;
  z-index: 40;
  min-width: 0;
  max-width: 220px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  pointer-events: none;
  transform: translate(-50%, -100%);
  white-space: nowrap;
}
.home-roadmap-tip strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
  margin: 0;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-roadmap-tip .tip-meta {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--seal-dark);
}
.home-roadmap-tip .kicker,
.home-roadmap-tip p,
.home-roadmap-tip .tip-status { display: none; }

@media (max-width: 720px) {
  .home-roadmap {
    grid-template-columns: 36px 1fr 36px;
    --roadmap-h: clamp(200px, 32vh, 300px);
  }
  .roadmap-band { min-width: max(280px, calc(100vw - 140px)); }
  .roadmap-arrow { font-size: 12px; }
}

.market.is-browsing-scenes {
  overflow: hidden;
}
.scenes-browser {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 24px 24px;
  gap: 12px;
}
.scenes-browser-bar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.scenes-browser-title {
  flex: 1 1 180px;
  min-width: 0;
}
.scenes-browser-title h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
}
.scenes-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}
.scenes-tool {
  display: grid;
  gap: 4px;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.scenes-tool select {
  font-family: var(--sans);
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--panel);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 6px 8px;
  min-width: 160px;
}
.scenes-browser-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.9fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
}
.scenes-table-wrap {
  overflow: auto;
  border: 4px solid var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
  min-height: 0;
}
.scenes-table {
  width: 100%;
  border-collapse: collapse;
}
.scenes-table th,
.scenes-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(24, 24, 16, 0.18);
  vertical-align: middle;
}
.scenes-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--gold);
  border-bottom: 3px solid var(--ink);
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.scenes-table tbody tr {
  cursor: pointer;
}
.scenes-table tbody tr:hover {
  filter: brightness(0.97);
}
.scenes-table tbody tr.is-selected {
  box-shadow: inset 4px 0 0 0 var(--ink), inset 0 0 0 2px var(--ink);
  font-weight: 700;
}
.scenes-table tbody tr[data-cefr="Pre A1"],
.scenes-table tbody tr[data-cefr="A1"] { background: #d7e8b8; }
.scenes-table tbody tr[data-cefr="A2"] { background: #f3d98a; }
.scenes-table tbody tr[data-cefr="B1"] { background: #c8dce8; }
.scenes-table tbody tr[data-cefr="B2"] { background: #f0c4a8; }
.scenes-table tbody tr[data-cefr="C1"] { background: #d4c4e8; }
.scenes-table td strong {
  display: inline;
  margin-right: 8px;
}
.scenes-level {
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.04em;
}
.scenes-last {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--gold);
  padding: 2px 6px;
  vertical-align: middle;
}
.scenes-preview {
  min-height: 0;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  background: #11180e;
}
.scenes-preview-art {
  height: 100%;
  min-height: 320px;
  position: relative;
  background-color: #11180e;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  color: #f8f0c8;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.scenes-preview-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 6, 0.18) 0%, rgba(8, 12, 6, 0.82) 100%);
  pointer-events: none;
}
.scenes-preview-copy {
  position: relative;
  z-index: 1;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.scenes-preview-copy .eyebrow { color: var(--gold); margin: 0; }
.scenes-preview-copy strong {
  font-family: var(--cjk), var(--serif);
  font-size: 42px;
  line-height: 1;
  text-shadow: 3px 3px 0 #000;
}
.scenes-preview-copy h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
  text-shadow: 3px 3px 0 #000;
}
.scenes-preview-copy p {
  margin: 0;
  color: #c8d898;
  text-shadow: 2px 2px 0 #000;
  max-width: 34em;
}
.scenes-preview-copy .primary-btn { margin-top: 8px; }

@media (max-width: 640px) {
  .scenes-browser-body { grid-template-columns: 1fr; }
  .scenes-preview-art { min-height: 220px; }
  .scenes-table-wrap { max-height: 42vh; }
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.deck-list { display: grid; gap: 8px; }
.deck-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: center;
  background: var(--panel);
  border: 3px solid var(--ink);
  padding: 12px 14px;
  box-shadow: 3px 3px 0 var(--ink);
}
.app.in-lesson #play-host,
.app.in-lesson #play-host .widget-band,
.app.in-lesson #play-host .lesson-widget,
.app.in-lesson #play-host .widget-stage,
.app.in-lesson #play-host .play {
  height: 100%;
  min-height: 0;
}
.app.in-lesson #play-host .lesson-widget {
  border: 0;
  box-shadow: none;
  height: 100%;
}
.app.in-lesson .widget-chrome { display: none; }
body.play-page {
  position: relative;
  overflow: hidden;
  background-image: none;
}
body.embedded-play {
  height: auto;
  overflow: hidden;
  background: transparent;
}
body.embedded-play #setup,
body.embedded-play #market,
body.embedded-play #app {
  display: none !important;
}
body.embedded-play #play-host,
body.embedded-play .widget-band {
  height: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}
body.embedded-play .lesson-widget {
  height: 340px;
  border: 4px solid var(--ink);
  box-shadow: none;
}
body.embedded-play .lesson-widget.is-loading { height: 340px; }
body.embedded-play .lesson-widget.is-play { height: min(72vh, 520px); }
body.embedded-play .play {
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 0 14px;
}
body.embedded-play .practice-rail { padding-right: 12px; }
body.embedded-play .practice-rail h2 { font-size: 20px; }
body.embedded-play #play-setting,
body.embedded-play #word-rows,
body.embedded-play #phrases-label,
body.embedded-play .play-tools { display: none; }
body.embedded-play a.play-home-link { pointer-events: none; }
body.embedded-play #view-done {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 16px;
  background: var(--paper);
  z-index: 5;
}
body.standalone-play {
  background: var(--paper);
}
body.standalone-play #setup,
body.standalone-play #market,
body.standalone-play #app { display: none !important; }
body.standalone-play #play-host,
body.standalone-play .widget-band,
body.standalone-play .lesson-widget,
body.standalone-play .widget-stage,
body.standalone-play .play {
  height: 100%;
  max-width: none;
  min-height: 0;
}
body.standalone-play .widget-band { padding: 0; }
body.standalone-play .lesson-widget {
  border: 0;
  box-shadow: none;
  height: 100vh;
}
body.standalone-play .open-browser { display: none !important; }
body.standalone-play #view-done {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 24px;
  background: var(--paper);
  z-index: 5;
}
@media (max-width: 900px) {
  .plan-compare, .dash-grid, .dash-hero { grid-template-columns: 1fr; display: grid; }
  .dash-metrics { grid-template-columns: repeat(2, 1fr); text-align: left; }
  body.embedded-play .play { grid-template-columns: 1fr; }
}

.auth-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  visibility: hidden;
}
.auth-sheet.is-open {
  pointer-events: auto;
  visibility: visible;
}
.auth-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(24, 24, 16, 0.48);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.22s ease;
}
.auth-sheet.is-open .auth-sheet-backdrop { opacity: 1; }
.auth-sheet-panel {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(420px, calc(100% - 20px));
  transform: translate(-50%, -108%);
  background: var(--panel);
  border: 4px solid var(--ink);
  border-top: 0;
  box-shadow: var(--shadow);
  padding: 22px 20px 16px;
  transition: transform 0.34s cubic-bezier(.2, 1.05, .32, 1);
}
.auth-sheet.is-open .auth-sheet-panel { transform: translate(-50%, 0); }
.auth-sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 3px solid var(--ink);
  background: var(--gold);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.auth-sheet-panel h2 { margin: 0 0 6px; font-size: 28px; }
.auth-sheet-panel .lede { margin: 0 0 14px; }
.auth-sheet-panel form { display: grid; gap: 10px; }
.auth-sheet-panel .primary-btn { width: 100%; }
.auth-viewport { overflow: hidden; }
.auth-track {
  display: flex;
  width: 200%;
  transition: transform 0.38s cubic-bezier(.2, .8, .2, 1);
}
.auth-sheet.is-code .auth-track { transform: translateX(-50%); }
.auth-pane {
  width: 50%;
  flex: 0 0 50%;
  padding-right: 12px;
  box-sizing: border-box;
}
.auth-code-boxes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.auth-digit {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  padding: 12px 0;
  box-shadow: 3px 3px 0 var(--ink);
}
.auth-digit:focus { outline: 3px solid var(--gold); background: #fff; }
body.reduce-motion .auth-sheet-panel,
body.reduce-motion .auth-sheet-backdrop,
body.reduce-motion .auth-track {
  transition: none;
}

.site-page {
  flex: 1;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 28px 24px 48px;
  text-align: left;
}
.site-page h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.1;
}
.site-page h2 {
  margin: 28px 0 10px;
  font-size: 22px;
  line-height: 1.2;
}
.site-page h3 {
  margin: 18px 0 8px;
  font-size: 17px;
}
.site-page .lede {
  margin: 0 0 16px;
  font-size: 18px;
  max-width: 38em;
  color: var(--ink);
}
.site-page p,
.site-page li {
  font-size: 16px;
  line-height: 1.55;
}
.site-page p { margin: 0 0 14px; }
.site-page ol,
.site-page ul {
  margin: 0 0 16px;
  padding-left: 22px;
}
.site-page a { color: var(--seal-dark); }
.site-page a:hover { color: var(--ink); }
.site-page .method-soon-badge {
  display: inline-block;
  margin: 0 0 16px;
}
.tldr {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin: 0 0 22px;
}
.tldr .kicker { margin-bottom: 8px; }
.tldr ul { margin: 0; }
.site-faq {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.site-faq details {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 4px 16px 12px;
}
.site-faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 17px;
  padding: 12px 0;
  list-style: none;
}
.site-faq summary::-webkit-details-marker { display: none; }
.site-faq summary::before {
  content: "+";
  display: inline-block;
  width: 1.1em;
  font-family: var(--pixel);
  font-size: 10px;
  font-weight: 400;
}
.site-faq details[open] summary::before { content: "–"; }
.site-faq details p:last-child { margin-bottom: 4px; }
.contact-form {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
}
.contact-form label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 700;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  padding: 8px 10px;
  width: 100%;
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.land-foot a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 720px) {
  .site-page { padding: 20px 16px 36px; }
}
