:root {
  color-scheme: dark;
  --bg: #0d1220;
  --panel: #151c2e;
  --panel-2: #1b2438;
  --panel-3: #202b42;
  --ink: #f5f1e7;
  --muted: #9aa6bd;
  --line: #2a3650;
  --cyan: #77e6d5;
  --blue: #66a8ff;
  --amber: #ffcf69;
  --orange: #ff8c5a;
  --pink: #f47ba7;
  --red: #ff6f72;
  --green: #76d68f;
  --shadow: 0 22px 60px rgba(0, 0, 0, .28);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

button,
input,
select { font: inherit; }

button { color: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(119, 230, 213, .45);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

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

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(119, 230, 213, .09);
  border-radius: 50%;
}

.ambient::before { width: 48vw; height: 48vw; right: -26vw; top: 8vh; }
.ambient::after { width: 30vw; height: 30vw; left: -18vw; bottom: -8vw; }

.ambient i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(245, 241, 231, .55);
  box-shadow: 0 0 12px rgba(245, 241, 231, .4);
}

.ambient i:nth-child(1) { left: 7%; top: 16%; }
.ambient i:nth-child(2) { left: 18%; top: 73%; width: 2px; height: 2px; }
.ambient i:nth-child(3) { left: 36%; top: 11%; }
.ambient i:nth-child(4) { left: 52%; top: 62%; width: 2px; height: 2px; }
.ambient i:nth-child(5) { left: 69%; top: 22%; }
.ambient i:nth-child(6) { left: 86%; top: 55%; width: 2px; height: 2px; }
.ambient i:nth-child(7) { left: 92%; top: 12%; }
.ambient i:nth-child(8) { left: 75%; top: 87%; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 76px;
  padding: 12px max(24px, calc((100vw - 1460px) / 2));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  background: rgba(13, 18, 32, .94);
  border-bottom: 1px solid rgba(154, 166, 189, .16);
  backdrop-filter: blur(18px);
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cyan);
  background: var(--cyan);
  color: #10202a;
  font: 900 22px/1 Georgia, serif;
  transform: rotate(-5deg);
  box-shadow: 6px 6px 0 #26324a;
}

.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 17px; letter-spacing: .08em; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: .24em; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  background: #111829;
}

.nav-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.nav-btn span { margin-right: 6px; color: var(--cyan); }
.nav-btn:hover { color: var(--ink); }
.nav-btn.active { background: var(--panel-3); color: var(--ink); }

.player-chip {
  justify-self: end;
  min-width: 174px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  text-align: left;
}

.player-chip:hover { border-color: var(--cyan); }
.player-chip > span:last-child { display: grid; min-width: 0; }
.player-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.player-chip small { color: var(--muted); font-size: 10px; }

.avatar {
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--amber);
  color: #34280d;
  font-weight: 900;
}

#app {
  width: min(1460px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.view { animation: view-in .35s ease both; }

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  gap: 22px;
}

.dashboard-main { min-width: 0; }

.hero-panel {
  min-height: 392px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(360px, .72fr);
  overflow: hidden;
  border: 1px solid #303d59;
  background: #131a2b;
  box-shadow: var(--shadow);
}

.hero-panel::before {
  content: "WQ / 001";
  position: absolute;
  right: 17px;
  top: 14px;
  z-index: 2;
  color: #50607f;
  font: 700 9px/1 Consolas, monospace;
  letter-spacing: .2em;
}

.hero-copy {
  position: relative;
  z-index: 3;
  align-self: center;
  padding: 56px 28px 52px 52px;
}

.overline,
.side-kicker,
.result-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font: 800 10px/1.2 Consolas, monospace;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.overline i {
  width: 18px;
  height: 2px;
  background: var(--cyan);
}

.hero-copy h1 {
  margin: 20px 0 18px;
  font-size: clamp(38px, 4.2vw, 66px);
  line-height: 1.1;
  letter-spacing: -.05em;
}

.hero-copy h1 em {
  color: var(--amber);
  font-style: normal;
  font-family: Georgia, "Songti SC", serif;
  font-weight: 500;
}

.hero-copy p {
  max-width: 590px;
  margin: 0;
  color: #b3bdd0;
  font-size: 15px;
  line-height: 1.85;
}

.hero-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.primary-action,
.secondary-action,
.text-action,
.mini-action {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  min-height: 48px;
  padding: 0 20px;
  background: var(--amber);
  color: #261f10;
  box-shadow: 5px 5px 0 #785d24;
}

.primary-action:hover { transform: translate(-1px, -1px); box-shadow: 7px 7px 0 #785d24; }
.primary-action span { margin-right: 7px; }
.primary-action.compact { min-height: 42px; }

.secondary-action {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.text-action {
  min-height: 48px;
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
}

.text-action span { color: var(--cyan); }

.space-scene {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  background: #18223a;
  border-left: 1px solid #303d59;
}

.space-scene::before,
.space-scene::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(119, 230, 213, .22);
}

.space-scene::before { width: 310px; height: 310px; top: 25px; right: 8px; }
.space-scene::after { width: 240px; height: 240px; top: 60px; right: 43px; border-style: dashed; }

.planet {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 900;
}

.planet-main {
  width: 178px;
  height: 178px;
  right: 80px;
  top: 90px;
  z-index: 2;
  background: var(--cyan);
  color: #142c36;
  border: 14px solid #55bcaf;
  box-shadow: inset -24px -18px 0 rgba(17, 69, 76, .18), 0 20px 45px rgba(0, 0, 0, .25);
  font-size: 58px;
}

.planet-main::before,
.planet-main::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(20, 44, 54, .12);
}

.planet-main::before { width: 24px; height: 24px; top: 27px; left: 31px; }
.planet-main::after { width: 15px; height: 15px; bottom: 34px; right: 27px; }

.planet-ring {
  position: absolute;
  width: 250px;
  height: 56px;
  border: 8px solid var(--amber);
  border-radius: 50%;
  transform: rotate(-15deg);
  z-index: -1;
}

.planet-small {
  width: 57px;
  height: 57px;
  left: 50px;
  top: 65px;
  background: var(--pink);
  color: #3c1830;
  font-size: 21px;
  box-shadow: 8px 8px 0 #7c3f60;
}

.word-tile {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  background: #f0eee6;
  color: #172033;
  border: 4px solid #293853;
  font: 900 16px/1 Consolas, monospace;
  box-shadow: 7px 7px 0 rgba(0, 0, 0, .22);
}

.tile-one { width: 56px; height: 50px; right: 40px; top: 42px; transform: rotate(7deg); }
.tile-two { width: 58px; height: 52px; left: 30px; bottom: 62px; transform: rotate(-8deg); background: var(--amber); }

.ship {
  position: absolute;
  left: 112px;
  bottom: 52px;
  z-index: 5;
  width: 112px;
  height: 46px;
  background: #eff1f4;
  border: 5px solid #26324a;
  border-radius: 56% 65% 35% 48%;
  transform: rotate(-11deg);
  box-shadow: 9px 9px 0 rgba(0, 0, 0, .2);
}

.ship::before {
  content: "";
  position: absolute;
  width: 32px;
  height: 26px;
  top: -23px;
  left: 35px;
  border: 5px solid #26324a;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  background: var(--blue);
}

.ship i,
.ship b {
  position: absolute;
  left: -28px;
  width: 31px;
  height: 9px;
  background: var(--orange);
  border: 3px solid #26324a;
}

.ship i { top: 6px; }
.ship b { bottom: 6px; width: 42px; left: -39px; }
.ship span { position: absolute; right: 20px; top: 12px; width: 13px; height: 13px; border-radius: 50%; background: var(--cyan); border: 3px solid #26324a; }

.orbit-line { position: absolute; left: 28px; bottom: 18px; width: 270px; height: 88px; border-bottom: 2px dashed rgba(119, 230, 213, .26); border-radius: 50%; transform: rotate(-11deg); }
.scene-star { position: absolute; color: var(--amber); }
.scene-star.s1 { left: 43%; top: 36px; }
.scene-star.s2 { right: 25px; bottom: 32px; color: var(--cyan); font-size: 30px; }
.scene-star.s3 { left: 44px; top: 178px; color: var(--blue); }

.edition-switcher {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 18px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #111829;
}

.edition-heading {
  display: grid;
  align-content: center;
  gap: 8px;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.edition-heading > span {
  color: var(--cyan);
  font: 800 9px/1 Consolas, monospace;
  letter-spacing: .17em;
}

.edition-heading h2 { margin: 0 0 5px; font-size: 17px; }
.edition-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }

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

.edition-option {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #161f32;
  cursor: pointer;
  text-align: left;
}

.edition-option:hover { border-color: #667896; background: #1b263b; }
.edition-option.active { border-color: var(--cyan); background: #1a2b3a; box-shadow: inset 0 -3px 0 var(--cyan); }
.edition-option:nth-child(2).active { border-color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }
.edition-option:nth-child(3).active { border-color: var(--amber); box-shadow: inset 0 -3px 0 var(--amber); }
.edition-option:nth-child(4).active { border-color: var(--pink); box-shadow: inset 0 -3px 0 var(--pink); }

.edition-option > b { color: #56637c; font: 900 18px/1 Georgia, serif; }
.edition-option > span { min-width: 0; display: grid; gap: 2px; }
.edition-option strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.edition-option small { overflow: hidden; color: var(--muted); font: 700 8px/1.2 Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.edition-option i { color: var(--cyan); font-style: normal; }
.edition-option:nth-child(2) i { color: var(--blue); }
.edition-option:nth-child(3) i { color: var(--amber); }
.edition-option:nth-child(4) i { color: var(--pink); }

.status-strip {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, .65fr);
  gap: 1px;
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--line);
}

.level-progress,
.status-metric {
  min-height: 98px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #131a2b;
}

.level-progress > div:last-child { flex: 1; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; }
.level-progress strong { font-size: 17px; }
.level-progress small { grid-column: 2; grid-row: 3; color: var(--muted); font-size: 9px; }

.level-orbit {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  box-shadow: inset 0 0 0 6px #1c3240;
}

.level-orbit span { font: 900 22px/1 Georgia, serif; color: var(--cyan); }
.metric-label { color: var(--muted); font-size: 10px; letter-spacing: .08em; }

.xp-track { grid-column: 1 / -1; height: 5px; margin-top: 8px; background: #283149; overflow: hidden; }
.xp-track i { display: block; width: 0; height: 100%; background: var(--cyan); transition: width .45s ease; }

.status-metric strong { display: block; margin-top: 3px; font-size: 18px; }
.status-metric b { font-size: inherit; }

.metric-icon {
  flex: 0 0 37px;
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-weight: 900;
}

.metric-icon.fire { color: var(--orange); }
.metric-icon.coin { color: var(--amber); }
.metric-icon.mastery { color: var(--green); }

.mode-section,
.map-section { margin-top: 42px; }

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

.section-heading > div { display: flex; align-items: baseline; gap: 10px; }
.section-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.section-heading p strong { color: var(--cyan); }
.section-index { color: var(--cyan); font: 800 10px/1 Consolas, monospace; }

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

.mode-card {
  min-height: 112px;
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #151c2e;
  cursor: pointer;
  text-align: left;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.mode-card:hover { transform: translateY(-3px); border-color: currentColor; background: #192238; }
.mode-card.meaning { color: var(--cyan); }
.mode-card.listening { color: var(--blue); }
.mode-card.spelling { color: var(--amber); }
.mode-card.mixed { color: var(--pink); }

.mode-symbol {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  background: #101727;
  font: 900 23px/1 Georgia, serif;
}

.mode-copy { display: grid; gap: 3px; }
.mode-copy small { font: 700 9px/1 Consolas, monospace; letter-spacing: .15em; color: currentColor; }
.mode-copy strong { color: var(--ink); font-size: 17px; }
.mode-copy em { color: var(--muted); font-style: normal; font-size: 12px; }
.mode-arrow { color: currentColor; font-size: 22px; }

.mini-action { padding: 8px 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; }
.mini-action:hover { border-color: var(--cyan); color: var(--ink); }

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

.unit-card {
  min-height: 155px;
  position: relative;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #131a2b;
  cursor: pointer;
  text-align: left;
}

.unit-card:hover,
.unit-card.selected { border-color: var(--cyan); }
.unit-card.selected::after { content: "已选择"; position: absolute; right: 10px; top: 10px; color: #102a2b; background: var(--cyan); padding: 3px 6px; font-size: 9px; font-weight: 900; }

.unit-number { color: #4b5872; font: 900 30px/1 Georgia, serif; }
.unit-card h3 { margin: 20px 0 4px; font-size: 15px; }
.unit-card p { margin: 0; color: var(--muted); font-size: 10px; }
.unit-progress { height: 3px; margin-top: 14px; background: #29334a; }
.unit-progress i { display: block; height: 100%; background: var(--cyan); }

.dashboard-side { display: grid; align-content: start; gap: 14px; }
.mission-card,
.mini-board,
.tip-card { border: 1px solid var(--line); background: #151c2e; }

.mission-card { position: relative; padding: 22px; overflow: hidden; }
.mission-card::after { content: "✦"; position: absolute; right: -12px; top: -25px; color: rgba(255, 207, 105, .08); font-size: 132px; line-height: 1; }

.mission-date { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin: 20px 0 18px; }
.mission-date strong { font: 900 48px/1 Georgia, serif; color: var(--amber); }
.mission-date span { color: var(--muted); font: 800 10px/1.35 Consolas, monospace; }
.mission-card h2 { position: relative; z-index: 1; margin: 0; font-size: 19px; }
.mission-card h2 small { display: inline-block; margin-left: 5px; color: var(--cyan); font: 700 9px/1 Consolas, monospace; vertical-align: middle; }
.mission-card ul { position: relative; z-index: 1; display: grid; gap: 12px; margin: 18px 0; padding: 0; list-style: none; }
.mission-card li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.mission-card li b { color: var(--ink); }
.mission-card > button { position: relative; z-index: 1; width: 100%; min-height: 42px; border: 0; background: var(--amber); color: #281f0b; font-weight: 900; cursor: pointer; }
.mission-card > button span { margin-right: 6px; }

.mini-board { padding: 20px; }
.side-title { display: flex; justify-content: space-between; align-items: start; margin-bottom: 16px; }
.side-title h2 { margin: 5px 0 0; font-size: 17px; }
.side-title button { width: 34px; height: 34px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.mini-board ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; counter-reset: pilot; }
.mini-board li:not(.loading-row) { counter-increment: pilot; display: grid; grid-template-columns: 25px 30px 1fr auto; gap: 8px; align-items: center; min-height: 43px; border-bottom: 1px solid rgba(42, 54, 80, .62); font-size: 11px; }
.mini-board li:not(.loading-row)::before { content: counter(pilot, decimal-leading-zero); color: #64718b; font: 700 9px/1 Consolas, monospace; }
.rank-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #26324a; color: var(--cyan); font-weight: 900; }
.mini-board li:nth-child(1) .rank-avatar { background: var(--amber); color: #34280d; }
.mini-board li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-board li b { color: var(--amber); }

.loading-row { color: var(--muted); font-size: 12px; padding: 15px 0; }

.tip-card { position: relative; min-height: 138px; padding: 22px; background: #202b42; }
.tip-card > span { position: absolute; right: 14px; top: 1px; color: rgba(119, 230, 213, .15); font: 900 70px/1 Georgia, serif; }
.tip-card p { position: relative; margin: 0 0 15px; color: #d6dce7; font: 500 14px/1.75 Georgia, "Songti SC", serif; }
.tip-card small { color: var(--cyan); font-size: 9px; letter-spacing: .12em; }

/* Game */
.game-shell { width: min(920px, 100%); margin: 0 auto; }
.game-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; margin-bottom: 20px; }
.game-header > div:nth-child(2) span { color: var(--cyan); font: 700 10px/1 Consolas, monospace; letter-spacing: .1em; }
.game-header h1 { margin: 3px 0 0; font-size: 20px; }

.icon-button {
  width: 45px;
  height: 45px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-size: 20px;
}

.game-live-stats { display: flex; gap: 7px; }
.game-live-stats span { min-width: 64px; height: 39px; display: flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel); }
.game-live-stats i { color: var(--amber); font-style: normal; }
.game-live-stats span:first-child i { color: var(--red); }
.game-live-stats b { font-size: 13px; }

.question-progress { height: 6px; background: #273149; overflow: hidden; }
.question-progress i { display: block; height: 100%; width: 10%; background: var(--cyan); transition: width .35s ease; }
.question-count { display: flex; justify-content: space-between; margin: 9px 2px 16px; color: var(--muted); font: 700 10px/1 Consolas, monospace; letter-spacing: .08em; }

.question-card { position: relative; min-height: 548px; padding: 38px 54px 46px; border: 1px solid #33415d; background: #151c2e; box-shadow: var(--shadow); }
.question-card.correct { border-color: var(--green); }
.question-card.wrong { border-color: var(--red); }

.question-meta { display: flex; justify-content: space-between; align-items: center; }
.question-meta > span { color: var(--cyan); font: 800 10px/1 Consolas, monospace; letter-spacing: .12em; }
.speak-button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); background: #1c263d; cursor: pointer; color: #d7deeb; font-size: 11px; font-weight: 800; }
.speak-button span { color: var(--cyan); margin-right: 6px; }
.speak-button:hover { border-color: var(--cyan); }

.question-instruction { margin: 30px 0 8px; color: var(--muted); font-size: 13px; text-align: center; }
.question-prompt { min-height: 84px; display: grid; place-items: center; color: var(--ink); font: 900 clamp(38px, 7vw, 66px)/1.1 Georgia, serif; text-align: center; overflow-wrap: anywhere; }
.question-prompt.listening-prompt { font-family: inherit; font-size: clamp(22px, 4vw, 34px); color: var(--cyan); }
.question-hint { margin: 5px 0 30px; color: #64718b; font: 700 10px/1.3 Consolas, monospace; text-align: center; }

.answer-area { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-button { min-height: 67px; display: grid; grid-template-columns: 31px 1fr; align-items: center; gap: 12px; padding: 11px 16px; border: 1px solid var(--line); background: #1a2337; cursor: pointer; text-align: left; font-weight: 700; }
.choice-button:hover:not(:disabled) { border-color: var(--cyan); background: #202d45; transform: translateY(-1px); }
.choice-button:disabled { cursor: default; }
.choice-button .choice-index { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid #40506e; color: var(--muted); font: 800 10px/1 Consolas, monospace; }
.choice-button.correct { border-color: var(--green); background: rgba(118, 214, 143, .12); }
.choice-button.wrong { border-color: var(--red); background: rgba(255, 111, 114, .1); }
.choice-button.correct .choice-index { background: var(--green); border-color: var(--green); color: #102719; }
.choice-button.wrong .choice-index { background: var(--red); border-color: var(--red); color: #361113; }

.spelling-wrap { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.spelling-input { min-width: 0; height: 64px; padding: 0 20px; border: 1px solid var(--line); background: #0f1626; color: var(--ink); font-size: 23px; font-family: Georgia, serif; letter-spacing: .06em; }
.spelling-input::placeholder { color: #4c5870; font-size: 15px; }
.spelling-submit { min-width: 118px; border: 0; background: var(--cyan); color: #10252a; font-weight: 900; cursor: pointer; }
.spelling-submit:hover { background: #98eee1; }

.feedback { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: start; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); background: #111828; }
.feedback-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #102719; font-weight: 900; }
.feedback.wrong .feedback-icon { background: var(--red); color: #351113; }
.feedback strong { font-size: 13px; }
.feedback p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.next-question { width: 100%; min-height: 48px; margin-top: 12px; border: 0; background: var(--amber); color: #291f0a; font-weight: 900; cursor: pointer; }
.next-question span { margin-left: 8px; }
.keyboard-tip { color: #58657d; font-size: 10px; text-align: center; }

/* Word archive */
.page-heading { min-height: 210px; display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 26px; padding: 34px 38px; border: 1px solid var(--line); background: #151c2e; }
.page-heading h1 { margin: 16px 0 8px; font-size: clamp(36px, 6vw, 62px); line-height: 1; letter-spacing: -.05em; }
.page-heading p { max-width: 700px; margin: 0; color: var(--muted); }
.archive-stat { min-width: 168px; padding-left: 25px; border-left: 1px solid var(--line); }
.archive-stat strong { display: block; color: var(--amber); font: 900 54px/1 Georgia, serif; }
.archive-stat span { color: var(--muted); font-size: 11px; }

.archive-toolbar { display: grid; grid-template-columns: 1fr 170px 210px 170px; gap: 10px; margin-bottom: 16px; }
.archive-toolbar label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.archive-toolbar input,
.archive-toolbar select { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 0; background: #131a2b; color: var(--ink); padding: 0 13px; }
.search-box { position: relative; align-self: end; }
.search-box span { position: absolute; left: 14px; bottom: 13px; color: var(--cyan); font-size: 18px; }
.search-box input { padding-left: 42px; }

.word-list-meta { display: flex; justify-content: space-between; gap: 18px; padding: 13px 18px; border: 1px solid var(--line); border-bottom: 0; background: rgba(16, 23, 39, .78); color: var(--cyan); font: 800 10px/1.4 Consolas, monospace; }
.word-list-meta small { color: var(--muted); font: 500 10px/1.4 var(--sans); }

.word-list-head,
.word-row { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(300px, 1.4fr) 130px 50px; gap: 18px; align-items: center; }
.word-list-head { min-height: 39px; padding: 0 18px; color: #66738d; font: 700 9px/1 Consolas, monospace; letter-spacing: .1em; }
.word-row { min-height: 86px; padding: 13px 18px; border-top: 1px solid var(--line); background: rgba(21, 28, 46, .72); }
.word-row:last-child { border-bottom: 1px solid var(--line); }
.word-main { display: grid; gap: 3px; }
.word-main strong { font: 700 21px/1.2 Georgia, serif; }
.word-main span { color: var(--cyan); font-size: 11px; }
.word-example { color: #b4bfd2; font-size: 12px; }
.word-status { display: inline-flex; width: max-content; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.word-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #53607a; }
.word-status.mastered { color: var(--green); }
.word-status.mastered::before { background: var(--green); }
.word-status.learning { color: var(--amber); }
.word-status.learning::before { background: var(--amber); }
.word-speak { width: 37px; height: 37px; border: 1px solid var(--line); background: #1c263d; cursor: pointer; color: var(--cyan); }
.word-speak:hover { border-color: var(--cyan); }
.load-more-words { display: block; width: min(320px, 100%); min-height: 46px; margin: 22px auto 0; border: 1px solid #40506e; background: #182237; color: var(--cyan); cursor: pointer; font-weight: 900; }
.load-more-words:hover { border-color: var(--cyan); background: #1e2c46; }
.load-more-words[hidden] { display: none; }
.empty-state { padding: 60px 20px; border: 1px solid var(--line); color: var(--muted); text-align: center; }

/* Leaderboard */
.board-heading { align-items: center; }
.board-tabs { display: flex; gap: 1px; width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 20px; border: 1px solid var(--line); background: var(--line); }
.board-tabs button { flex: 0 0 auto; min-height: 42px; padding: 0 18px; border: 0; background: #131a2b; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 800; }
.board-tabs button.active { background: var(--cyan); color: #10252a; }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; margin: 0 auto 20px; max-width: 880px; }
.podium-card { min-height: 170px; display: grid; place-items: center; align-content: center; gap: 6px; border: 1px solid var(--line); background: #151c2e; text-align: center; }
.podium-card.first { min-height: 205px; border-color: var(--amber); order: 2; }
.podium-card.second { order: 1; }
.podium-card.third { order: 3; }
.podium-avatar { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: #26324a; color: var(--cyan); font-size: 18px; font-weight: 900; }
.podium-card.first .podium-avatar { width: 62px; height: 62px; background: var(--amber); color: #34280d; }
.podium-card strong { max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-card b { color: var(--amber); font: 900 22px/1 Georgia, serif; }
.podium-card small { color: var(--muted); }

.ranking-table { border: 1px solid var(--line); }
.ranking-row { min-height: 64px; display: grid; grid-template-columns: 70px minmax(150px, 1.3fr) minmax(100px, .8fr) 100px 100px 110px; align-items: center; gap: 12px; padding: 0 20px; border-top: 1px solid var(--line); background: #151c2e; font-size: 12px; }
.ranking-row.heading { min-height: 42px; border-top: 0; background: #101727; color: #65718a; font: 700 9px/1 Consolas, monospace; letter-spacing: .08em; }
.ranking-row .pilot-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ranking-row .pilot-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-row .score { color: var(--amber); font-weight: 900; }

/* Dialogs */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(5, 8, 15, .8); backdrop-filter: blur(8px); }

.result-dialog,
.profile-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  margin: auto;
  padding: 36px;
  border: 1px solid #3b4966;
  border-radius: 0;
  background: #151c2e;
  box-shadow: 0 35px 100px rgba(0, 0, 0, .65);
  text-align: center;
}

.dialog-close { position: absolute; right: 12px; top: 12px; width: 35px; height: 35px; border: 1px solid var(--line); background: #111827; cursor: pointer; font-size: 20px; }
.result-dialog h2,
.profile-dialog h2 { margin: 13px 0 6px; font-size: 26px; }
.result-dialog > p,
.profile-dialog > p { margin: 0; color: var(--muted); font-size: 12px; }
.result-score { display: grid; place-items: center; margin: 25px auto 20px; }
.result-score strong { color: var(--amber); font: 900 66px/1 Georgia, serif; }
.result-score span { color: #69758d; font: 700 9px/1 Consolas, monospace; letter-spacing: .2em; }
.result-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.result-metrics div { min-height: 72px; display: grid; place-items: center; align-content: center; border-right: 1px solid var(--line); }
.result-metrics div:last-child { border-right: 0; }
.result-metrics strong { font-size: 17px; }
.result-metrics span { color: var(--muted); font-size: 9px; }
.review-summary { margin-top: 14px; padding: 13px; background: #101727; color: var(--muted); font-size: 11px; line-height: 1.7; text-align: left; }
.result-actions { justify-content: center; margin-top: 20px; }
.result-burst { height: 24px; color: var(--amber); }
.result-burst span { font-size: 25px; }

.profile-dialog { width: min(430px, calc(100% - 28px)); text-align: left; }
.profile-dialog label { display: grid; gap: 8px; margin: 24px 0 15px; color: var(--muted); font-size: 10px; }
.profile-dialog input { height: 50px; padding: 0 14px; border: 1px solid var(--line); background: #0f1626; color: var(--ink); font-size: 17px; }
.profile-dialog .primary-action { width: 100%; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translateX(-50%); max-width: min(440px, calc(100% - 32px)); padding: 12px 16px; border: 1px solid var(--cyan); background: #162335; color: var(--ink); box-shadow: var(--shadow); font-size: 12px; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 1fr auto; }
  .main-nav { position: fixed; left: 50%; bottom: 14px; z-index: 50; transform: translateX(-50%); box-shadow: 0 10px 35px rgba(0,0,0,.45); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mission-card, .mini-board, .tip-card { min-height: 280px; }
  .status-strip { grid-template-columns: 1.2fr repeat(3, .7fr); }
  .edition-switcher { grid-template-columns: 180px 1fr; }
  .edition-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  #app { width: min(100% - 28px, 760px); }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-copy { padding: 45px 38px; }
  .space-scene { min-height: 300px; border-left: 0; border-top: 1px solid #303d59; }
  .planet-main { top: 55px; right: 22%; }
  .ship { left: 22%; bottom: 40px; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .edition-switcher { grid-template-columns: 1fr; }
  .edition-heading { padding: 0 0 13px; border-right: 0; border-bottom: 1px solid var(--line); }
  .unit-map { grid-template-columns: repeat(3, 1fr); }
  .dashboard-side { grid-template-columns: 1fr 1fr; }
  .tip-card { grid-column: 1 / -1; min-height: auto; }
  .word-list-head { display: none; }
  .word-row { grid-template-columns: 1fr auto; }
  .word-example { grid-column: 1; }
  .word-status { grid-column: 1; }
  .word-speak { grid-column: 2; grid-row: 1 / 4; }
  .archive-toolbar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .topbar { min-height: 65px; padding: 9px 14px; gap: 10px; }
  .brand-mark { width: 38px; height: 38px; font-size: 19px; box-shadow: 4px 4px 0 #26324a; }
  .brand strong { font-size: 14px; }
  .brand small { font-size: 7px; }
  .player-chip { min-width: 0; width: 41px; height: 41px; padding: 3px; border: 0; background: transparent; }
  .player-chip > span:last-child { display: none; }
  .avatar { width: 36px; height: 36px; }
  .main-nav { width: calc(100% - 24px); bottom: 8px; justify-content: stretch; }
  .nav-btn { flex: 1; padding: 0 7px; font-size: 10px; }
  #app { width: calc(100% - 24px); padding-top: 12px; padding-bottom: 88px; }
  .hero-panel { min-height: 0; }
  .hero-copy { padding: 36px 24px 32px; }
  .hero-copy h1 { margin-top: 17px; font-size: 38px; }
  .hero-copy p { font-size: 13px; line-height: 1.75; }
  .hero-actions { align-items: stretch; }
  .hero-actions button { flex: 1 1 170px; }
  .space-scene { min-height: 250px; }
  .space-scene::before { width: 230px; height: 230px; top: 8px; right: -12px; }
  .space-scene::after { width: 180px; height: 180px; top: 33px; right: 13px; }
  .planet-main { width: 130px; height: 130px; top: 61px; right: 45px; border-width: 10px; font-size: 43px; }
  .planet-ring { width: 182px; height: 42px; border-width: 6px; }
  .planet-small { left: 28px; top: 30px; }
  .ship { left: 75px; bottom: 28px; transform: rotate(-11deg) scale(.82); transform-origin: left bottom; }
  .tile-one { right: 18px; top: 24px; }
  .tile-two { left: 15px; bottom: 25px; }
  .status-strip { grid-template-columns: 1fr 1fr; }
  .edition-switcher { padding: 13px; }
  .edition-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edition-option { min-height: 66px; grid-template-columns: auto 1fr; }
  .edition-option > i { display: none; }
  .edition-option strong { white-space: normal; }
  .level-progress { grid-column: 1 / -1; }
  .status-metric { min-height: 76px; padding: 12px; }
  .status-metric:last-child { grid-column: 1 / -1; }
  .mode-section, .map-section { margin-top: 32px; }
  .section-heading { align-items: start; }
  .section-heading p { display: none; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { min-height: 98px; grid-template-columns: 54px 1fr auto; }
  .mode-symbol { width: 54px; height: 54px; }
  .unit-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit-card { min-height: 135px; padding: 13px; }
  .unit-card h3 { margin-top: 16px; }
  .dashboard-side { grid-template-columns: 1fr; }
  .mission-card, .mini-board, .tip-card { min-height: auto; }

  .game-header { grid-template-columns: auto 1fr; }
  .game-live-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .game-live-stats span { min-width: 0; }
  .question-card { min-height: 520px; padding: 25px 16px 28px; }
  .question-instruction { margin-top: 23px; }
  .question-prompt { min-height: 72px; font-size: 43px; }
  .answer-area { grid-template-columns: 1fr; }
  .choice-button { min-height: 58px; }
  .spelling-wrap { grid-template-columns: 1fr; }
  .spelling-input { height: 58px; }
  .spelling-submit { min-height: 48px; }

  .page-heading { min-height: 0; display: block; padding: 28px 22px; }
  .page-heading h1 { font-size: 43px; }
  .archive-stat { margin-top: 25px; padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .archive-stat strong { font-size: 42px; }
  .archive-toolbar { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .word-list-meta { align-items: flex-start; flex-direction: column; gap: 4px; padding: 12px 13px; }
  .word-row { padding: 13px; }
  .word-example { font-size: 11px; }
  .board-heading .primary-action { margin-top: 24px; width: 100%; }
  .board-tabs { width: 100%; }
  .podium { gap: 5px; }
  .podium-card { min-height: 148px; padding: 10px 3px; }
  .podium-card.first { min-height: 176px; }
  .podium-avatar { width: 42px; height: 42px; }
  .podium-card.first .podium-avatar { width: 50px; height: 50px; }
  .podium-card b { font-size: 18px; }
  .ranking-row { grid-template-columns: 42px 1fr 70px; min-height: 58px; padding: 0 10px; }
  .ranking-row span:nth-child(3),
  .ranking-row span:nth-child(4),
  .ranking-row span:nth-child(5) { display: none; }
  .result-dialog, .profile-dialog { padding: 30px 18px 22px; }
  .result-metrics { grid-template-columns: repeat(2, 1fr); }
  .result-metrics div:nth-child(2) { border-right: 0; }
  .result-metrics div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

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