:root {
  color-scheme: dark;
  --ink: #ecf3ec;
  --muted: #91a39c;
  --line: rgba(180, 211, 195, .17);
  --mint: #86edb5;
  --amber: #e3b365;
  --red: #ff7f8e;
  --bg: #061014;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, "Cascadia Mono", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", monospace;
  --font-serif: Georgia, "Times New Roman", "Songti SC", "STSong", "SimSun", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font-sans); }
button { font: inherit; }
.w3-shell { position: relative; width: 100vw; height: 100vh; min-height: 560px; overflow: hidden; background: radial-gradient(ellipse at 58% 42%, #10262a 0%, #071216 48%, #03090c 100%); }
#world-earth, #world-planet, #world-system, #world-starmap { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
#world-earth[hidden], #world-planet[hidden] { display: none; }
#world-planet[hidden] { display: none; }
.w3-stars { position: absolute; inset: 0; pointer-events: none; opacity: .45; background-image: radial-gradient(circle at 20% 20%, rgba(184, 226, 207, .45) 0 1px, transparent 1.5px), radial-gradient(circle at 72% 12%, rgba(184, 226, 207, .35) 0 1px, transparent 1.5px), radial-gradient(circle at 84% 68%, rgba(184, 226, 207, .28) 0 1px, transparent 1.5px); background-size: 330px 260px, 410px 310px, 280px 240px; }
.w3-top { position: absolute; z-index: 4; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; gap: 18px; padding: 20px 26px; pointer-events: none; }
.w3-planets, .w3-res, .w3-clock { pointer-events: auto; }
.w3-planets { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: rgba(5, 15, 19, .58); backdrop-filter: blur(14px); }
.w3-planet { border: 0; background: transparent; color: var(--muted); padding: 8px 10px; border-radius: 5px; font: 600 9px/1.2 var(--font-mono); letter-spacing: .09em; text-transform: uppercase; cursor: pointer; }
.w3-planet:hover { color: var(--ink); background: rgba(131, 226, 169, .08); }
.w3-planet.is-active { color: #06120e; background: var(--mint); }
.w3-planet i { display: block; margin-top: 3px; font-style: normal; font-size: 7px; opacity: .6; letter-spacing: .05em; }
.w3-planet-dot { display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.w3-res { margin-left: auto; display: flex; gap: 0; padding: 4px 2px; border: 1px solid var(--line); border-radius: 8px; background: rgba(5, 15, 19, .62); backdrop-filter: blur(14px); }
.w3-chip { min-width: 66px; padding: 7px 10px; border-right: 1px solid rgba(180, 211, 195, .09); }
.w3-chip:last-child { border-right: 0; }
.w3-chip span { display: block; color: var(--muted); font: 500 7px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.w3-chip strong { display: block; margin-top: 6px; font: 600 12px/1 var(--font-mono); }
.w3-chip strong small { color: var(--muted); font-size: 8px; font-weight: 500; }
.w3-chip.is-warn strong { color: var(--amber); }
.w3-clock { min-width: 74px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(5, 15, 19, .62); backdrop-filter: blur(14px); text-align: right; }
.w3-clock span { font: 400 22px/1 var(--font-serif); }
.w3-clock small { display: block; margin-top: 4px; color: var(--muted); font: 500 7px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.w3-quests { position: absolute; z-index: 4; right: 26px; top: 100px; width: min(290px, 27vw); padding: 16px 17px 15px; border: 1px solid var(--line); border-radius: 9px; background: rgba(5, 15, 19, .64); backdrop-filter: blur(16px); transition: width .2s ease, padding .2s ease; }
.w3-quest-head { display: flex; align-items: center; justify-content: space-between; }
.w3-quest-toggle { border: 0; background: none; color: var(--muted); font-size: 12px; line-height: 1; cursor: pointer; padding: 2px 4px; border-radius: 3px; transition: transform .2s ease, color .2s ease; }
.w3-quest-toggle:hover { color: var(--mint); }
.w3-quests.is-collapsed .w3-quest-toggle { transform: rotate(180deg); }
.w3-quests.is-collapsed h2,
.w3-quests.is-collapsed #w3-quest-list,
.w3-quests.is-collapsed .w3-hint,
.w3-quests.is-collapsed .w3-log-open { display: none; }
.w3-quests.is-collapsed .w3-kicker { margin: 0; }
.w3-kicker { margin: 0 0 7px; color: var(--amber); font: 600 8px/1.2 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; }
.w3-quests h2 { margin: 0 0 14px; font-family: var(--font-serif); font-weight: 400; font-size: 30px; letter-spacing: -.04em; }
.w3-quest { display: grid; grid-template-columns: 9px 1fr; gap: 9px; padding: 10px 0; border-top: 1px solid rgba(180, 211, 195, .1); }
.w3-quest-dot { width: 7px; height: 7px; margin-top: 4px; border: 1px solid var(--mint); border-radius: 50%; }
.w3-quest.is-done .w3-quest-dot { background: var(--mint); }
.w3-quest.is-done strong { color: var(--muted); text-decoration: line-through; }
.w3-quest strong { display: block; font-size: 11px; line-height: 1.35; }
.w3-quest small { display: block; margin-top: 3px; color: var(--muted); font: 500 8px/1.4 var(--font-mono); }
.w3-quest button { border: 0; background: none; color: var(--mint); padding: 0; margin-top: 4px; font: 600 8px/1.2 var(--font-mono); letter-spacing: .07em; cursor: pointer; }
.w3-quest button:hover { text-decoration: underline; }
.w3-hint { margin: 14px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.w3-context { position: absolute; z-index: 5; left: 26px; bottom: 28px; width: min(330px, calc(100vw - 52px)); padding: 14px 16px; border: 1px solid rgba(134, 237, 181, .3); border-radius: 8px; background: rgba(5, 16, 18, .76); backdrop-filter: blur(16px); }
.w3-context h3 { margin: 4px 0 6px; font-family: var(--font-serif); font-weight: 400; font-size: 24px; letter-spacing: -.03em; }
.w3-context p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.w3-context .w3-meta { margin: 8px 0 12px; font: 500 8px/1.4 var(--font-mono); color: var(--muted); }
.w3-context .w3-enter { border: 1px solid rgba(134, 237, 181, .5); background: var(--mint); color: #06120e; border-radius: 4px; padding: 9px 11px; font: 700 9px/1 var(--font-mono); letter-spacing: .06em; cursor: pointer; }
.w3-context .w3-enter:hover { background: #adffd0; }
.w3-end { position: absolute; z-index: 5; right: 26px; bottom: 28px; border: 1px solid rgba(134, 237, 181, .5); background: rgba(9, 23, 23, .78); color: var(--mint); padding: 12px 14px; border-radius: 7px; font: 600 10px/1 var(--font-mono); letter-spacing: .07em; cursor: pointer; }
.w3-end:hover { background: var(--mint); color: #06120e; }
.w3-end span { margin-left: 6px; }
.w3-menu { position: absolute; z-index: 5; right: 144px; bottom: 30px; width: 30px; height: 30px; border: 1px solid var(--line); background: rgba(5, 15, 19, .65); color: var(--muted); border-radius: 6px; cursor: pointer; }
.w3-menu:hover { color: var(--ink); }

/* Language switch: a single compact <button> showing both language labels.
   The active label is highlighted from <html data-lang>; it is the same
   control at every breakpoint (see the responsive ordering below). */
.w3-lang {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 15, 19, .62);
  backdrop-filter: blur(14px);
  color: var(--muted);
  font: 600 9px/1 var(--font-mono);
  letter-spacing: .1em;
  cursor: pointer;
}
.w3-lang:hover { color: var(--ink); border-color: rgba(134, 237, 181, .4); }
.w3-lang-opt { opacity: .55; }
.w3-lang-sep { opacity: .4; }
html[data-lang="zh"] .w3-lang-opt[data-lang-opt="zh"],
html[data-lang="en"] .w3-lang-opt[data-lang-opt="en"] { color: var(--mint); opacity: 1; }
button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* CJK typography: drop the wide Latin tracking on Chinese labels. */
:lang(zh-CN) .w3-kicker,
:lang(zh-CN) .w3-planet,
:lang(zh-CN) .w3-chip span,
:lang(zh-CN) .w3-clock small,
:lang(zh-CN) .w3-lock span,
:lang(zh-CN) .w3-lang { letter-spacing: .04em; text-transform: none; }
:lang(zh-CN) .w3-quest button,
:lang(zh-CN) .w3-log-open,
:lang(zh-CN) .w3-build-hint,
:lang(zh-CN) .w3-surface-hint { letter-spacing: .02em; }
:lang(zh-CN) .w3-quests h2,
:lang(zh-CN) .w3-context h3,
:lang(zh-CN) .w3-log-head h2,
:lang(zh-CN) .w3-surface h2,
:lang(zh-CN) .w3-launch-head h2,
:lang(zh-CN) .w3-build-top h2 { letter-spacing: 0; }
.w3-tip { position: absolute; z-index: 7; pointer-events: none; max-width: 240px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: rgba(3, 11, 14, .92); color: var(--ink); font: 500 9px/1.4 var(--font-mono); }
.w3-lock { position: absolute; z-index: 6; left: 50%; top: 45%; transform: translate(-50%, -50%); text-align: center; padding: 14px 20px; border: 1px solid rgba(227, 179, 101, .3); background: rgba(5, 15, 19, .64); border-radius: 7px; pointer-events: none; }
.w3-lock span { display: block; color: var(--amber); font: 600 8px/1.2 var(--font-mono); letter-spacing: .15em; text-transform: uppercase; }
.w3-lock strong { display: block; margin-top: 7px; color: var(--muted); font-family: var(--font-serif); font-weight: 400; font-size: 19px; }
.w3-toast { position: absolute; z-index: 20; left: 50%; bottom: 90px; transform: translateX(-50%); max-width: 360px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 6px; background: rgba(5, 15, 19, .9); color: var(--ink); font: 500 10px/1.4 var(--font-mono); opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.w3-toast.is-on { opacity: 1; }
.w3-toast.is-warn { border-color: rgba(255, 127, 142, .45); color: #ffb6c0; }
.w3-build { position: absolute; z-index: 10; inset: 0; background: #071116; }
#world-build { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.w3-build[hidden] { display: none; }
.w3-build-top { position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; gap: 20px; padding: 20px 26px; pointer-events: none; }
.w3-build-top > * { pointer-events: auto; }
.w3-back { border: 1px solid var(--line); background: rgba(5, 15, 19, .7); color: var(--mint); border-radius: 5px; padding: 8px 10px; font: 600 9px/1 var(--font-mono); cursor: pointer; }
.w3-build-top h2 { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.05em; }
.w3-build-top .w3-kicker { margin-bottom: 4px; }
.w3-build-balance { margin-left: auto; text-align: right; color: var(--muted); font: 500 8px/1.6 var(--font-mono); }
.w3-build-balance strong { display: block; color: var(--ink); font-size: 11px; }
.w3-build-strip { position: absolute; z-index: 3; left: 26px; right: 26px; bottom: 26px; padding: 12px 14px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(5, 15, 19, .78); backdrop-filter: blur(16px); }
.w3-build-strip h3 { margin: 0; color: var(--ink); font-family: var(--font-serif); font-weight: 400; font-size: 20px; }
.w3-build-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.w3-build-card { border: 1px solid rgba(180, 211, 195, .13); background: rgba(8, 26, 26, .7); color: var(--ink); border-radius: 4px; padding: 7px 8px; text-align: left; cursor: pointer; }
.w3-build-card strong { display: block; font-size: 9px; line-height: 1.2; }
.w3-build-card small { display: block; margin-top: 3px; color: var(--muted); font: 500 7px/1.3 var(--font-mono); }
.w3-build-card:hover:not(:disabled), .w3-build-card.is-placing { border-color: rgba(134, 237, 181, .6); background: rgba(28, 64, 48, .6); }
.w3-build-card:disabled { opacity: .4; cursor: not-allowed; }
.w3-build-hint { position: absolute; z-index: 3; left: 26px; bottom: 185px; color: var(--muted); font: 500 8px/1.4 var(--font-mono); }
@media (max-width: 900px) {
  .w3-top { flex-wrap: wrap; padding: 12px; gap: 8px; }
  .w3-planets { order: 1; }
  .w3-clock { order: 2; margin-left: auto; }
  .w3-lang { order: 3; margin-left: auto; min-height: 34px; padding: 0 10px; }
  .w3-res { order: 4; width: 100%; overflow-x: auto; }
  .w3-chip { flex: 0 0 auto; min-width: 58px; padding: 6px 8px; }
  .w3-quests { top: 196px; right: 12px; width: min(224px, 56vw); max-height: calc(100vh - 330px); overflow-y: auto; padding: 11px 12px; }
  .w3-quests h2 { font-size: 22px; }
  .w3-quests .w3-hint { display: none; }
  .w3-quest { padding: 8px 0; }
  .w3-context { left: 12px; bottom: 74px; width: min(290px, calc(100vw - 24px)); }
  .w3-end { right: 12px; bottom: 20px; }
  .w3-menu { right: 115px; bottom: 21px; }
  .w3-build-top { padding: 12px; flex-wrap: wrap; gap: 10px; }
  .w3-build-balance { width: 100%; text-align: left; margin-left: 0; }
  .w3-build-strip { left: 12px; right: 12px; bottom: 12px; padding: 9px 10px; }
  .w3-build-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .w3-build-hint { left: 12px; bottom: 220px; }
}

/* Galaxy backdrop and solar-system layer. */
#world-earth, #world-planet, #world-system { z-index: 1; }
#world-system[hidden] { display: none; }
.w3-galaxy {
  position: absolute; inset: -8%; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(2, 8, 12, .68) 0%, rgba(2, 8, 12, .30) 38%, rgba(2, 8, 12, .22) 62%, rgba(2, 8, 12, .72) 100%),
    radial-gradient(ellipse at 50% 48%, transparent 12%, rgba(2, 7, 11, .34) 100%),
    url('../img/nasa-milky-way.0ed7b66d81.webp');
  background-size: cover, cover, cover;
  background-position: center, center, center 46%;
  background-repeat: no-repeat;
}
.w3-stars { z-index: 0; opacity: .78; background-image: radial-gradient(circle at 12% 34%, rgba(220, 239, 255, .65) 0 1px, transparent 1.6px), radial-gradient(circle at 44% 68%, rgba(255, 237, 208, .48) 0 1px, transparent 1.6px), radial-gradient(circle at 66% 22%, rgba(220, 239, 255, .5) 0 1px, transparent 1.5px), radial-gradient(circle at 88% 54%, rgba(255, 237, 208, .4) 0 1px, transparent 1.5px), radial-gradient(circle at 24% 82%, rgba(220, 239, 255, .38) 0 1px, transparent 1.4px); background-size: 300px 240px, 420px 320px, 360px 280px, 510px 390px, 450px 350px; }
.w3-shell { background: #02070b; }
.w3-build { z-index: 10; }

.w3-credit {
  position: absolute; z-index: 5; left: 50%; bottom: 10px; transform: translateX(-50%);
  margin: 0; color: rgba(203, 222, 213, .38); font: 500 7px/1.3 var(--font-mono);
  letter-spacing: .06em; pointer-events: none; white-space: nowrap;
}
@media (max-width: 900px) { .w3-credit { display: none; } }

/* Launch pad */
.w3-launch { position: absolute; z-index: 15; inset: 0; background: rgba(2, 8, 12, .18); }
.w3-launch[hidden] { display: none; }
#world-launch { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.w3-launch-head { position: absolute; z-index: 2; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; gap: 20px; padding: 20px 26px; pointer-events: none; }
.w3-launch-head > * { pointer-events: auto; }
.w3-launch-head h2 { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.2rem, 4.4vw, 3.8rem); letter-spacing: -.055em; }
.w3-launch-panel { position: absolute; z-index: 2; right: 26px; bottom: 28px; width: min(300px, calc(100vw - 52px)); padding: 15px 16px; border: 1px solid var(--line); border-radius: 8px; background: rgba(5, 15, 19, .75); backdrop-filter: blur(16px); }
.w3-launch-targets { display: flex; gap: 5px; margin: 8px 0 12px; }
.w3-launch-targets button { flex: 1; border: 1px solid var(--line); background: rgba(8, 26, 26, .7); color: var(--muted); border-radius: 4px; padding: 8px 6px; font: 600 9px/1 var(--font-mono); letter-spacing: .07em; cursor: pointer; }
.w3-launch-targets button.is-active { border-color: rgba(134, 237, 181, .58); color: var(--mint); background: rgba(28, 64, 48, .55); }
.w3-launch-go { width: 100%; border: 0; border-radius: 4px; background: var(--mint); color: #06120e; padding: 12px; font: 700 10px/1 var(--font-mono); letter-spacing: .07em; cursor: pointer; }
.w3-launch-go:disabled { opacity: .45; cursor: wait; }
.w3-launch-payloads { display: flex; gap: 5px; margin: 4px 0 7px; }
.w3-launch-payloads button { flex: 1; border: 1px solid var(--line); background: rgba(8, 26, 26, .7); color: var(--muted); border-radius: 4px; padding: 7px 5px; font: 600 8px/1 var(--font-mono); letter-spacing: .04em; cursor: pointer; }
.w3-launch-payloads button.is-active { border-color: rgba(134, 237, 181, .58); color: var(--mint); background: rgba(28, 64, 48, .55); }
.w3-launch-payloads button:disabled { opacity: .5; cursor: not-allowed; }
.w3-launch-payload-desc { min-height: 22px; margin: 0 0 9px; color: var(--muted); font: 500 8px/1.4 var(--font-mono); }
.w3-launch-cost { margin: 0 0 7px; color: var(--amber); font: 600 8px/1.4 var(--font-mono); letter-spacing: .05em; }
.w3-launch-status { margin: 10px 0 0; color: var(--muted); font: 500 8px/1.5 var(--font-mono); }
.w3-launch-count { position: absolute; z-index: 3; left: 50%; top: 44%; transform: translate(-50%, -50%); color: var(--mint); font: 300 clamp(4rem, 14vw, 10rem)/1 var(--font-serif); text-shadow: 0 0 40px rgba(134, 237, 181, .28); opacity: 0; pointer-events: none; }
.w3-launch-count.is-on { opacity: 1; }
/* Surface construction */
.w3-surface { position: absolute; z-index: 6; left: 26px; right: 26px; bottom: 26px; padding: 12px 14px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(5, 15, 19, .78); backdrop-filter: blur(16px); }
.w3-surface[hidden] { display: none; }
.w3-surface-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.w3-surface h2 { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: 26px; letter-spacing: -.04em; }
.w3-surface-meta { margin: 5px 0 8px; color: var(--muted); font: 500 8px/1.5 var(--font-mono); }
.w3-surface-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.w3-surface-card { border: 1px solid rgba(180, 211, 195, .13); background: rgba(8, 26, 26, .7); color: var(--ink); border-radius: 4px; padding: 7px 8px; text-align: left; cursor: pointer; }
.w3-surface-card strong { display: block; font-size: 9px; line-height: 1.2; }
.w3-surface-card small { display: block; margin-top: 3px; color: var(--muted); font: 500 7px/1.3 var(--font-mono); }
.w3-surface-card:hover:not(:disabled) { border-color: rgba(134, 237, 181, .6); background: rgba(28, 64, 48, .6); }
.w3-surface-card:disabled { opacity: .4; cursor: not-allowed; }
.w3-surface-hint { margin: 8px 0 0; color: var(--muted); font: 500 8px/1.4 var(--font-mono); }
.w3-context .w3-launch-open { margin-left: 6px; border: 1px solid rgba(227, 179, 101, .45); background: transparent; color: var(--amber); border-radius: 4px; padding: 9px 10px; font: 700 9px/1 var(--font-mono); letter-spacing: .06em; cursor: pointer; }
.w3-context .w3-launch-open:hover { background: rgba(227, 179, 101, .12); }
/* Still opens the pad so the player can read why a launch is gated. */
.w3-context .w3-launch-open.is-blocked { border-color: rgba(227, 179, 101, .22); color: rgba(227, 179, 101, .62); }
.w3-context .w3-launch-open.is-blocked:hover { background: rgba(227, 179, 101, .07); }
.w3-context .w3-launch-open:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 900px) {
  .w3-launch-head { padding: 12px; flex-wrap: wrap; gap: 10px; }
  .w3-launch-panel { right: 12px; bottom: 18px; width: calc(100vw - 24px); }
  .w3-surface { left: 12px; right: 12px; bottom: 12px; padding: 9px 10px; }
  .w3-surface-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .w3-surface-head { gap: 8px; }
  .w3-surface h2 { font-size: 21px; }
}

body.is-launching .w3-top,
body.is-launching .w3-quests,
body.is-launching .w3-end,
body.is-launching .w3-menu,
body.is-launching .w3-credit {
  opacity: 0; pointer-events: none;
}

.w3-log-open { border: 0; background: none; color: var(--mint); padding: 0; margin-top: 10px; font: 600 8px/1.2 var(--font-mono); letter-spacing: .07em; cursor: pointer; }
.w3-log-open:hover { text-decoration: underline; }
.w3-logpanel { position: absolute; z-index: 12; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 40px)); max-height: min(72vh, 680px); overflow-y: auto; padding: 18px 20px; border: 1px solid rgba(134, 237, 181, .22); border-radius: 9px; background: rgba(4, 14, 18, .93); backdrop-filter: blur(18px); }
.w3-logpanel[hidden] { display: none; }
/* v7.2: the command deck carries six tabs and two-column cards — a wider
   overlay keeps it scannable on desktop without touching the mission log. */
#w3-research-panel { width: min(760px, calc(100vw - 40px)); max-height: min(80vh, 760px); }
.w3-log-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.w3-log-head h2 { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: 32px; letter-spacing: -.045em; }
.w3-log-body { margin-top: 14px; }
.w3-accident { padding: 12px 13px; border: 1px solid rgba(255, 127, 142, .34); border-radius: 6px; background: rgba(68, 21, 28, .32); margin-bottom: 12px; }
.w3-accident h3 { margin: 0 0 6px; color: #ffb6c0; font-family: var(--font-serif); font-weight: 400; font-size: 22px; }
.w3-accident p { margin: 4px 0; color: #e6c8cc; font: 500 9px/1.55 var(--font-mono); }
.w3-mission { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(180, 211, 195, .1); align-items: baseline; }
.w3-mission-year { color: var(--muted); font: 600 9px/1.2 var(--font-mono); }
.w3-mission strong { font-size: 11px; }
.w3-mission small { display: block; margin-top: 3px; color: var(--muted); font: 500 8px/1.4 var(--font-mono); }
.w3-mission-result { font: 700 8px/1.2 var(--font-mono); letter-spacing: .07em; color: var(--mint); }
.w3-mission-result.is-fail { color: var(--red); }
.w3-log-empty { color: var(--muted); font: 500 10px/1.5 var(--font-mono); }
@media (max-width: 900px) { .w3-logpanel { width: calc(100vw - 24px); max-height: 78vh; padding: 13px 14px; } }

.w3-command-tabs { display: flex; gap: 4px; margin-top: 12px; border-bottom: 1px solid rgba(180,211,195,.12); }
.w3-command-tabs button { border: 0; background: transparent; color: var(--muted); padding: 8px 10px; font: 600 8px/1 var(--font-mono); letter-spacing: .07em; cursor: pointer; border-bottom: 1px solid transparent; }
.w3-command-tabs button.is-active { color: var(--mint); border-bottom-color: var(--mint); }
.w3-command-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid rgba(180,211,195,.1); }
.w3-command-row > div { flex: 1; }
.w3-command-row strong { display: block; font-size: 10px; }
.w3-command-row small { display: block; margin-top: 3px; color: var(--muted); font: 500 8px/1.4 var(--font-mono); }
.w3-command-row button { border: 1px solid rgba(134,237,181,.4); background: rgba(28,64,48,.5); color: var(--mint); border-radius: 4px; padding: 6px 8px; font: 700 8px/1 var(--font-mono); cursor: pointer; }
.w3-command-row button:disabled { opacity: .35; cursor: not-allowed; }
.w3-command-row button.is-active { background: var(--mint); color: #06120e; }

.w3-record { margin: 12px 0; padding: 12px 13px; border: 1px solid rgba(134,237,181,.25); border-radius: 6px; background: rgba(10,34,28,.45); }
.w3-record h3 { margin: 0 0 8px; font-family: var(--font-serif); font-weight: 400; font-size: 24px; color: var(--mint); }
.w3-record p { margin: 4px 0; color: var(--muted); font: 500 9px/1.5 var(--font-mono); }

/* ------------------------------------------------------------------------- */
/* v7.2 command deck — ledger / diplomacy / policies / records               */
/* ------------------------------------------------------------------------- */

.w3-deck-block { margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(180, 211, 195, .12); }
.w3-deck-block:first-child { margin-top: 4px; border-top: 0; padding-top: 0; }
.w3-deck-title { margin: 0 0 4px; color: var(--mint); font: 700 8px/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.w3-deck-hint { margin: 0 0 8px; color: var(--muted); font: 500 8px/1.5 var(--font-mono); }
.w3-deck-subtitle { margin: 10px 0 2px; color: var(--muted); font: 600 7px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.w3-deck-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.w3-deck-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 11px; border: 1px solid rgba(180, 211, 195, .14); border-radius: 6px; background: rgba(8, 26, 26, .55); }
.w3-deck-card h4 { margin: 0; color: var(--ink); font: 600 9px/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.w3-deck-card strong { font-size: 10px; }
.w3-deck-card small { color: var(--muted); font: 500 8px/1.45 var(--font-mono); }
.w3-deck-card .w3-command-row { padding: 4px 0; border-top: 0; }
.w3-deck-card .w3-deck-act { align-self: flex-start; }
.w3-deck-value-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; }
.w3-deck-value-row > span { color: var(--muted); font: 600 8px/1.2 var(--font-mono); }
.w3-deck-value { color: var(--mint); font-family: var(--font-serif); font-weight: 400; font-size: 28px; letter-spacing: -.03em; }
.w3-deck-bar { position: relative; height: 5px; margin: 8px 0 4px; overflow: hidden; border-radius: 3px; background: rgba(180, 211, 195, .13); }
.w3-deck-bar > span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, rgba(111, 247, 200, .55), var(--mint)); }
.w3-deck-tag { display: inline-block; padding: 3px 6px; border: 1px solid rgba(180, 211, 195, .22); border-radius: 3px; color: var(--muted); font: 700 7px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.w3-deck-tag.is-on { border-color: rgba(111, 247, 200, .45); color: var(--mint); background: rgba(111, 247, 200, .1); }
.w3-deck-tag.is-off { opacity: .75; }
.w3-deck-tag.is-warn { border-color: rgba(255, 196, 120, .5); color: var(--amber); background: rgba(255, 196, 120, .08); }
.w3-deck-act { padding: 6px 8px; border: 1px solid rgba(134, 237, 181, .4); border-radius: 4px; background: rgba(28, 64, 48, .5); color: var(--mint); font: 700 8px/1 var(--font-mono); white-space: nowrap; cursor: pointer; }
.w3-deck-act:hover:not(:disabled) { border-color: rgba(134, 237, 181, .75); background: rgba(40, 86, 64, .6); }
.w3-deck-act:disabled { opacity: .35; cursor: not-allowed; }
.w3-deck-act.is-active { background: var(--mint); color: #06120e; }
.w3-deck-grid--stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.w3-deck-stat { display: flex; flex-direction: column; gap: 4px; padding: 8px 9px; border: 1px solid rgba(180, 211, 195, .12); border-radius: 5px; background: rgba(8, 26, 26, .5); }
.w3-deck-stat span { color: var(--muted); font: 500 7px/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.w3-deck-stat strong { color: var(--ink); font: 600 14px/1 var(--font-mono); }
.w3-deck-line { margin: 4px 0; color: var(--muted); font: 500 8.5px/1.55 var(--font-mono); }
.w3-objective { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(180, 211, 195, .1); }
.w3-objective > div { flex: 1; }
.w3-objective strong { display: block; font-size: 10px; }
.w3-objective small { display: block; margin-top: 2px; color: var(--muted); font: 500 8px/1.4 var(--font-mono); }
.w3-objective .w3-deck-tag { margin-top: 2px; }

/* diplomacy: expandable nation rows --------------------------------------- */
.w3-nation { border-top: 1px solid rgba(180, 211, 195, .1); }
.w3-nation-summary { display: grid; grid-template-columns: auto minmax(0, 1.2fr) auto auto; gap: 8px; align-items: baseline; padding: 8px 0; list-style: none; cursor: pointer; }
.w3-nation-summary::-webkit-details-marker { display: none; }
.w3-nation-summary::before { content: "›"; margin-right: 2px; color: var(--mint); font: 700 10px/1 var(--font-mono); }
.w3-nation[open] .w3-nation-summary::before { content: "⌄"; }
.w3-nation-summary:hover { color: var(--mint); }
.w3-nation-name { font-size: 10px; }
.w3-nation-rel, .w3-nation-coop { color: var(--muted); font: 600 8px/1.2 var(--font-mono); white-space: nowrap; }
.w3-nation-coop { color: var(--mint); }
.w3-nation-count { grid-column: 1 / -1; color: var(--muted); font: 500 8px/1.4 var(--font-mono); }
.w3-nation-body { padding: 2px 0 10px; }
.w3-diplo-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid rgba(180, 211, 195, .08); }
.w3-diplo-kind { flex: 1; color: var(--ink); font: 600 8px/1.3 var(--font-mono); }
.w3-diplo-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 5px; }

/* refits ------------------------------------------------------------------ */
.w3-surface-refit { border-color: rgba(255, 196, 120, .3); }
.w3-surface-refit .w3-deck-bar { height: 4px; margin: 5px 0 0; }
.w3-refit-panel {
  position: absolute; z-index: 4; right: 26px; bottom: 168px;
  width: min(340px, calc(100vw - 52px)); max-height: min(46vh, 380px); overflow-y: auto;
  padding: 12px 14px; border: 1px solid rgba(255, 196, 120, .28); border-radius: 8px;
  background: rgba(5, 15, 19, .9); backdrop-filter: blur(16px);
}
.w3-refit-panel[hidden] { display: none; }
.w3-refit-panel h3 { margin: 0; color: var(--amber); font-family: var(--font-serif); font-weight: 400; font-size: 22px; }
.w3-refit-body { margin: 4px 0 6px; color: var(--muted); font: 500 8px/1.5 var(--font-mono); }
.w3-refit-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid rgba(180, 211, 195, .1); }
.w3-refit-row > div { flex: 1; min-width: 0; }
.w3-refit-row strong { display: block; font-size: 9px; }
.w3-refit-row small { display: block; margin-top: 2px; color: var(--muted); font: 500 7.5px/1.4 var(--font-mono); }
.w3-refit-row .w3-deck-bar { margin: 4px 0 0; }
.w3-chip-mode { min-width: 118px; }
.w3-chip-mode strong { font-size: 9px; line-height: 1.25; }
.w3-start-option-meta { color: var(--mint) !important; font-weight: 600 !important; }

@media (max-width: 900px) {
  .w3-deck-grid, .w3-deck-grid--stats { grid-template-columns: 1fr; }
  .w3-refit-panel { right: 12px; bottom: 210px; }
  .w3-nation-summary { grid-template-columns: auto 1fr auto; }
}

/* Narrow desktop: tighten the top bar so the wider Chinese resource chips
   keep the resource row, the language switch and the clock on one line. */
@media (max-width: 1080px) and (min-width: 901px) {
  .w3-top { gap: 10px; padding: 16px 18px; }
  .w3-planets { gap: 3px; }
  .w3-planet { padding: 7px 8px; }
  .w3-chip { min-width: 56px; padding: 6px 8px; }
  .w3-chip span { letter-spacing: .08em; }
  .w3-chip strong { font-size: 11px; }
  .w3-lang { min-height: 34px; padding: 0 9px; }
  .w3-clock { min-width: 68px; padding: 7px 10px; }
}

/* Short desktop viewports: compact the objective tracker so all 10 quests,
   the hint and both panel buttons fit without clipping (CJK line-height makes
   the zh list a little taller than the en one). */
@media (max-height: 960px) and (min-width: 901px) {
  .w3-quests { top: 88px; padding: 12px 15px; }
  .w3-quests .w3-kicker { margin-bottom: 5px; }
  .w3-quests h2 { margin-bottom: 10px; font-size: 24px; }
  .w3-quest { padding: 7px 0; }
  .w3-quest strong { font-size: 10px; }
  .w3-quest small { margin-top: 2px; font-size: 7px; line-height: 1.35; }
  .w3-quest button { margin-top: 2px; }
  .w3-hint { margin-top: 9px; font-size: 8px; line-height: 1.45; }
  .w3-log-open { margin-top: 7px; }
}

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

/* ------------------------------------------------------------------------- */
/* Complete Edition — start screen, mission pad, event overlay                */
/* ------------------------------------------------------------------------- */

.w3-start {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: clamp(16px, 4vw, 48px);
  background: #03090c;
  isolation: isolate;
}
/* The Complete Edition start screen sits on a captured in-game Earth hero:
   the planet glows behind the panel, the left edge stays dark for copy. The
   hero is a pseudo-element so the slow drift is a compositor transform. */
.w3-start::before {
  content: '';
  position: absolute;
  inset: -2.5%;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(3, 9, 12, .95) 0%, rgba(3, 9, 12, .88) 38%, rgba(3, 9, 12, .30) 66%, rgba(3, 9, 12, .78) 100%),
    radial-gradient(ellipse at 22% 8%, rgba(134, 237, 181, .16), transparent 52%),
    radial-gradient(ellipse at 82% 18%, rgba(227, 179, 101, .10), transparent 46%),
    url('../img/v7-start-earth.15981eea79.jpg') center 44% / cover no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .w3-start::before { animation: w3-hero-drift 52s ease-in-out infinite alternate; }
}
@keyframes w3-hero-drift {
  from { transform: scale(1); }
  to { transform: scale(1.045); }
}
.w3-start[hidden] { display: none; }
.w3-start-panel {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  margin: auto;
  padding: clamp(22px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(10, 26, 28, .93), rgba(4, 12, 15, .96));
  backdrop-filter: blur(18px);
  box-shadow: 0 34px 90px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .04);
  animation: w3-start-in 260ms ease-out both;
}
@media (min-width: 900px) {
  .w3-start { justify-content: flex-start; padding-left: clamp(28px, 7vw, 112px); }
  .w3-start-panel { margin: 0; }
}
.w3-start-title {
  margin: 4px 0 6px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(40px, 8vw, 76px);
  line-height: .98;
  letter-spacing: -.03em;
  color: var(--ink);
}
.w3-start-sub {
  margin: 0 0 10px;
  color: var(--mint);
  font: 500 clamp(13px, 1.6vw, 17px)/1.4 var(--font-sans);
}
.w3-start-lede {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(12px, 1.4vw, 14px);
  line-height: 1.7;
}
.w3-start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(20px, 3vw, 30px);
}
.w3-start-button {
  appearance: none;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 23, 23, .72);
  color: var(--ink);
  font: 600 12px/1.2 var(--font-mono);
  letter-spacing: .04em;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.w3-start-button:hover { border-color: rgba(134, 237, 181, .55); background: rgba(134, 237, 181, .1); }
.w3-start-button:active { transform: translateY(1px); }
.w3-start-button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.w3-start-button--primary {
  border-color: rgba(134, 237, 181, .6);
  background: linear-gradient(120deg, rgba(134, 237, 181, .24), rgba(134, 237, 181, .06));
  color: #eafff4;
}
.w3-start-button[hidden] { display: none; }
.w3-start-save {
  margin: 14px 0 0;
  color: var(--muted);
  font: 500 10px/1.6 var(--font-mono);
}
.w3-start-version {
  margin: 14px 0 0;
  color: var(--muted);
  font: 500 8px/1.5 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.w3-start-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(180, 211, 195, .12);
}
.w3-start-list[hidden] { display: none; }
.w3-start-list .w3-kicker { grid-column: 1 / -1; margin: 0; }
.w3-start-option {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(7, 19, 21, .72);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.w3-start-option:hover { border-color: rgba(134, 237, 181, .5); background: rgba(134, 237, 181, .07); }
.w3-start-option:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.w3-start-option strong { font-size: 12px; line-height: 1.3; }
.w3-start-option small { color: var(--muted); font: 500 9px/1.5 var(--font-mono); }
.w3-start-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(180, 211, 195, .1);
}
.w3-start-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 15, 19, .62);
  color: var(--muted);
  font: 600 10px/1 var(--font-mono);
  cursor: pointer;
}
.w3-start-lang [data-lang-opt] { opacity: .55; }
html[data-lang="zh"] .w3-start-lang [data-lang-opt="zh"],
html[data-lang="en"] .w3-start-lang [data-lang-opt="en"] { opacity: 1; color: var(--mint); }
.w3-start-lang:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.w3-start-back {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 600 10px/1 var(--font-mono);
  cursor: pointer;
}
.w3-start-back:hover { color: var(--ink); background: rgba(180, 211, 195, .08); }
.w3-start-back[hidden] { display: none; }
@keyframes w3-start-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Mission pad ------------------------------------------------------------- */
.w3-mission-card {
  display: grid;
  gap: 3px;
  margin: 6px 0 14px;
  padding: 12px 13px;
  border: 1px solid rgba(134, 237, 181, .22);
  border-radius: 8px;
  background: rgba(9, 28, 24, .45);
}
.w3-mission-card h3 { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: 24px; line-height: 1.1; }
.w3-mission-card .w3-mission-code { margin: 0; color: var(--mint); font: 600 8px/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.w3-mission-card .w3-kicker { margin: 10px 0 2px; }
.w3-mission-line { margin: 0; font: 500 10px/1.5 var(--font-mono); color: var(--ink); }
.w3-mission-reqs { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.w3-mission-reqs li { position: relative; padding-left: 15px; font: 500 9px/1.5 var(--font-mono); color: var(--muted); }
.w3-mission-reqs li::before { content: "○"; position: absolute; left: 0; top: 0; font-size: 9px; }
.w3-mission-reqs li.is-met { color: var(--mint); }
.w3-mission-reqs li.is-met::before { content: "●"; }
.w3-mission-reqs li.is-missing::before { content: "○"; color: var(--amber); }
.w3-mission-gates-wrap { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(180, 211, 195, .14); }
.w3-mission-gates-wrap[hidden] { display: none; }
.w3-launch-go:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Event overlay ----------------------------------------------------------- */
.w3-event {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: clamp(14px, 4vw, 44px);
  background: radial-gradient(ellipse at 50% 0%, rgba(227, 179, 101, .12), transparent 55%), rgba(3, 9, 12, .88);
  backdrop-filter: blur(8px);
}
.w3-event[hidden] { display: none; }
.w3-event-panel {
  width: min(680px, 100%);
  margin: auto;
  padding: clamp(20px, 3.4vw, 36px);
  border: 1px solid rgba(227, 179, 101, .34);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(18, 20, 16, .98), rgba(6, 10, 10, .99));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .55);
}
.w3-event-title { margin: 4px 0 10px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(28px, 4.4vw, 44px); line-height: 1.06; letter-spacing: -.02em; }
.w3-event-body { margin: 0 0 16px; color: var(--muted); font-size: clamp(13px, 1.5vw, 15px); line-height: 1.7; }
.w3-event-choices { display: grid; gap: 8px; }
.w3-event-choice {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(10, 22, 22, .8);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.w3-event-choice:hover { border-color: rgba(227, 179, 101, .55); background: rgba(227, 179, 101, .08); }
.w3-event-choice:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.w3-event-choice strong { font-size: 13px; }
.w3-event-choice small { color: var(--muted); font: 500 9px/1.5 var(--font-mono); }
.w3-event-required { margin: 16px 0 0; color: var(--amber); font: 600 8px/1.5 var(--font-mono); letter-spacing: .06em; }

@media (max-width: 720px) {
  .w3-start { padding: 0; }
  .w3-start-panel { min-height: 100%; border-radius: 0; padding: 22px 16px 30px; }
  .w3-start-actions { display: grid; grid-template-columns: 1fr; }
  .w3-start-button { width: 100%; text-align: center; }
  .w3-start-list { grid-template-columns: 1fr; }
  .w3-event { padding: 0; }
  .w3-event-panel { min-height: 100%; border-radius: 0; padding: 22px 16px 30px; }
}

/* ------------------------------------------------------------------------- */
/* v7.1 desktop shell — settings, field manual, gamepad legend, focus ring    */
/* ------------------------------------------------------------------------- */

/* Top-bar icon buttons (settings / fullscreen) */
.w3-icon {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 15, 19, .62);
  backdrop-filter: blur(14px);
  color: var(--muted);
  font: 400 15px/1 var(--font-mono);
  cursor: pointer;
}
.w3-icon:hover { color: var(--ink); border-color: rgba(134, 237, 181, .4); }
.w3-icon[aria-pressed="true"] { color: var(--mint); border-color: rgba(134, 237, 181, .5); }

/* Controller/keyboard focus ring: :focus-visible alone is unreliable for
   programmatic (gamepad) focus, so the input runtime toggles this class. */
.w3-focus-ring,
.w3-focus-ring:focus {
  outline: 2px solid var(--mint) !important;
  outline-offset: 2px !important;
}
body.is-input-keyboard .w3-focus-ring { box-shadow: 0 0 0 5px rgba(134, 237, 181, .12); }

/* Locked frontier overlay: exact unlock mission + a route to the pad. */
.w3-lock {
  pointer-events: none;
  width: min(360px, calc(100vw - 60px));
  padding: 18px 22px 20px;
  border: 1px solid rgba(227, 179, 101, .34);
  border-radius: 12px;
  background: rgba(5, 14, 18, .82);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}
.w3-lock span { color: var(--amber); }
.w3-lock strong { margin-top: 8px; color: var(--ink); font-size: 21px; line-height: 1.4; }
.w3-lock-go {
  pointer-events: auto;
  margin-top: 14px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(227, 179, 101, .6);
  border-radius: 6px;
  background: rgba(227, 179, 101, .16);
  color: var(--amber);
  font: 700 9px/1 var(--font-mono);
  letter-spacing: .07em;
  cursor: pointer;
}
.w3-lock-go:hover { background: var(--amber); color: #1a1207; }
:lang(zh-CN) .w3-lock-go { letter-spacing: .02em; }

/* Gamepad connect legend (auto-hides; disableable in Settings). */
.w3-legend {
  position: fixed;
  z-index: 60;
  right: 26px;
  bottom: 96px;
  width: 258px;
  padding: 14px 16px;
  border: 1px solid rgba(134, 237, 181, .3);
  border-radius: 12px;
  background: rgba(4, 14, 18, .94);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 54px rgba(0, 0, 0, .55);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.w3-legend[hidden] { display: none; }
.w3-legend.is-on { opacity: 1; transform: none; }
.w3-legend .w3-kicker { color: var(--mint); }
.w3-legend-grid { display: grid; gap: 7px; margin: 0 0 10px; }
.w3-legend-grid > div { display: flex; align-items: baseline; gap: 10px; }
.w3-legend-grid dt { flex: 0 0 62px; color: var(--ink); font: 700 9px/1 var(--font-mono); letter-spacing: .05em; }
.w3-legend-grid dd { margin: 0; color: var(--muted); font: 500 10px/1.3 var(--font-sans); }
.w3-legend-hint { margin: 0; color: rgba(145, 163, 156, .75); font: 500 8px/1.4 var(--font-mono); }

/* Shared modal shell for Settings and the Field manual. */
.w3-settings,
.w3-manual {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: clamp(16px, 3.4vw, 52px);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(134, 237, 181, .1), transparent 55%),
    radial-gradient(ellipse at 16% 96%, rgba(227, 179, 101, .06), transparent 46%),
    rgba(3, 9, 12, .9);
  backdrop-filter: blur(10px);
}
.w3-settings[hidden],
.w3-manual[hidden] { display: none; }
.w3-settings-panel,
.w3-manual-panel {
  width: min(880px, 100%);
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(10, 26, 28, .97), rgba(4, 12, 15, .985));
  box-shadow: 0 34px 90px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.w3-settings-panel {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 1000px);
  padding: clamp(20px, 2.6vw, 32px) clamp(20px, 3vw, 38px);
}
.w3-manual-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(980px, 100%);
  max-height: min(90vh, 1040px);
  padding: clamp(20px, 2.8vw, 34px) clamp(20px, 3vw, 40px);
}
/* Soft bottom fade hints that the manual scrolls instead of cutting a line. */
.w3-manual-panel::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 52px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, rgba(4, 12, 15, 0), rgba(4, 12, 15, .94));
  pointer-events: none;
}
.w3-settings-head,
.w3-manual-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex: 0 0 auto;
}
.w3-settings-head h2,
.w3-manual-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(30px, 3vw, 42px);
  letter-spacing: -.045em;
}
.w3-settings-body {
  min-height: 0;
  margin-top: 10px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.w3-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 15px 0;
  border-top: 1px solid rgba(180, 211, 195, .1);
}
.w3-set-row:first-child { border-top: 0; }
.w3-set-copy h3,
.w3-set-block h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: -.02em;
}
.w3-set-copy p,
.w3-set-block p {
  max-width: 48ch;
  margin: 0;
  color: var(--muted);
  font: 500 10px/1.55 var(--font-mono);
}
.w3-seg {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(5, 15, 19, .66);
}
.w3-seg button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: 600 9px/1 var(--font-mono);
  letter-spacing: .05em;
  white-space: nowrap;
  cursor: pointer;
}
.w3-seg button:hover { color: var(--ink); }
.w3-seg button.is-active { background: var(--mint); color: #06120e; }
:lang(zh-CN) .w3-seg button { letter-spacing: .02em; }
.w3-set-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 20px; }
.w3-switch {
  min-width: 84px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 24, 22, .8);
  color: var(--muted);
  font: 700 9px/1 var(--font-mono);
  letter-spacing: .05em;
  cursor: pointer;
}
.w3-switch:hover { border-color: rgba(134, 237, 181, .35); color: var(--ink); }
.w3-switch[aria-pressed="true"] {
  border-color: rgba(134, 237, 181, .5);
  background: rgba(28, 64, 48, .62);
  color: var(--mint);
}
.w3-range { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 500 9px/1 var(--font-mono); }
.w3-range input { width: 158px; accent-color: var(--mint); cursor: pointer; }
.w3-set-block { padding: 16px 0; border-top: 1px solid rgba(180, 211, 195, .1); }
.w3-settings-archive {
  display: grid;
  gap: 6px;
  max-height: 216px;
  margin: 11px 0 13px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.w3-set-action {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(134, 237, 181, .4);
  border-radius: 6px;
  background: rgba(28, 64, 48, .5);
  color: var(--mint);
  font: 700 9px/1 var(--font-mono);
  letter-spacing: .05em;
  cursor: pointer;
}
.w3-set-action:hover { background: rgba(134, 237, 181, .16); }
.w3-set-action.is-warn {
  border-color: rgba(255, 127, 142, .45);
  background: rgba(68, 21, 28, .35);
  color: #ffb6c0;
}
.w3-set-action.is-warn:hover { background: rgba(255, 127, 142, .16); }
.w3-settings-foot {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(180, 211, 195, .12);
}
:lang(zh-CN) .w3-set-action,
:lang(zh-CN) .w3-switch { letter-spacing: .02em; }

/* Field manual body */
.w3-manual-body {
  min-height: 0;
  margin-top: 16px;
  padding-right: 12px;
  padding-bottom: 34px;
  overflow-y: auto;
  outline: none;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}
.w3-manual-body:focus-visible {
  outline: 2px solid rgba(134, 237, 181, .5);
  outline-offset: 6px;
  border-radius: 10px;
}
.w3-manual-intro { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.w3-manual-section { padding: 15px 0; border-top: 1px solid rgba(180, 211, 195, .1); }
.w3-manual-section h3 {
  margin: 0 0 9px;
  color: var(--mint);
  font: 600 9px/1.2 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.w3-manual-section p { margin: 0; color: var(--ink); font-size: 12.5px; line-height: 1.75; opacity: .92; }
.w3-manual-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.w3-manual-grid article {
  padding: 13px 14px;
  border: 1px solid rgba(180, 211, 195, .12);
  border-radius: 9px;
  background: rgba(8, 22, 20, .5);
}
.w3-manual-grid h4 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: -.02em;
}
.w3-manual-grid p { font-size: 11px; line-height: 1.7; color: var(--muted); opacity: 1; }
.w3-manual-tips { margin: 0; padding-left: 18px; color: var(--ink); font-size: 12.5px; line-height: 1.9; }
.w3-manual-tips li::marker { color: var(--mint); }
:lang(zh-CN) .w3-manual-section h3 { letter-spacing: .04em; text-transform: none; }

/* Run archive rows (start screen, settings, ending) */
.w3-archive-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(180, 211, 195, .12);
  border-radius: 7px;
  background: rgba(8, 22, 20, .55);
}
.w3-archive-row .w3-archive-copy { display: grid; gap: 2px; min-width: 0; }
.w3-archive-row strong { font: 600 11px/1.3 var(--font-sans); }
.w3-archive-row small { color: var(--muted); font: 500 9px/1.35 var(--font-mono); }
.w3-archive-row .w3-archive-date { margin-left: auto; flex: 0 0 auto; color: rgba(145, 163, 156, .7); font: 500 8px/1 var(--font-mono); }
.w3-archive-empty { margin: 0; color: var(--muted); font: 500 10px/1.5 var(--font-mono); }

/* Start screen: recent missions + settings/manual entry points */
.w3-start-archive {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(180, 211, 195, .12);
}
.w3-start-archive[hidden] { display: none; }
.w3-start-archive .w3-kicker { margin-bottom: 8px; }
.w3-start-archive-list { display: grid; gap: 6px; }

/* Ending screen: "this run is archived" line (injected by the shell). */
.w3-ending-archive {
  order: -1;
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 1px solid rgba(134, 237, 181, .3);
  border-radius: 9px;
  background: rgba(10, 34, 28, .55);
  color: var(--mint);
  font: 700 10px/1.3 var(--font-mono);
  letter-spacing: .07em;
}
.w3-ending-archive small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font: 500 9px/1.5 var(--font-mono);
  letter-spacing: 0;
}
:lang(zh-CN) .w3-ending-archive { letter-spacing: .02em; }

/* Narrow desktop: stack label + control so long Chinese and English labels
   never squeeze the segmented controls. */
@media (max-width: 1180px) {
  .w3-set-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .w3-set-controls { width: 100%; justify-content: space-between; }
  .w3-manual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w3-icon { width: 34px; height: 34px; font-size: 13px; }
}
@media (max-width: 1180px) and (min-width: 901px) {
  .w3-top { gap: 10px; padding: 16px 18px; }
}

/* Precise disabled-build reasons (surface cards and Earth build cards). */
.w3-surface-card .w3-surface-reason,
.w3-build-card .w3-build-reason {
  margin-top: 4px;
  color: var(--amber);
  font: 600 7px/1.35 var(--font-mono);
  letter-spacing: .02em;
}
.w3-surface-card:disabled .w3-surface-reason { opacity: 1; }
.w3-accident-loss { color: var(--amber) !important; }

.w3-start-util {
  border: 1px solid var(--line);
  background: rgba(5, 15, 19, .62);
  color: var(--muted);
}
.w3-start-util:hover { border-color: rgba(134, 237, 181, .4); color: var(--ink); background: rgba(134, 237, 181, .08); }

/* ------------------------------------------------------------------------- */
/* v7.1 desktop polish — 1920 and 2560/ultrawide balance                      */
/* ------------------------------------------------------------------------- */
@media (min-width: 1600px) {
  .w3-top { gap: 22px; padding: 24px clamp(30px, 3.2vw, 76px); }
  .w3-planets { padding: 5px; }
  .w3-planet { padding: 10px 13px; font-size: 10px; }
  .w3-chip { min-width: 82px; padding: 9px 14px; }
  .w3-chip span { font-size: 8px; }
  .w3-chip strong { font-size: 14px; }
  .w3-clock { min-width: 92px; padding: 10px 16px; }
  .w3-clock span { font-size: 27px; }
  .w3-lang { min-height: 42px; padding: 0 14px; font-size: 10px; }
  .w3-icon { width: 42px; height: 42px; font-size: 16px; }
  .w3-quests { top: 120px; right: clamp(30px, 3.2vw, 76px); width: 344px; padding: 20px 22px 18px; }
  .w3-quests h2 { font-size: 34px; }
  .w3-quest { padding: 12px 0; }
  .w3-quest strong { font-size: 12px; }
  .w3-quest small { font-size: 9px; }
  .w3-hint { font-size: 10px; }
  .w3-log-open { font-size: 9px; }
  .w3-context { left: clamp(30px, 3.2vw, 76px); bottom: 34px; width: 384px; padding: 18px 20px; }
  .w3-context h3 { font-size: 28px; }
  .w3-end { right: clamp(30px, 3.2vw, 76px); bottom: 34px; padding: 14px 18px; font-size: 11px; }
  .w3-menu { right: calc(clamp(30px, 3.2vw, 76px) + 140px); bottom: 36px; width: 36px; height: 36px; }
  .w3-launch-head, .w3-build-top { padding: 24px clamp(30px, 3.2vw, 76px); }
  .w3-launch-panel { right: clamp(30px, 3.2vw, 76px); bottom: 36px; width: 366px; padding: 20px 22px; }
  .w3-mission-card h3 { font-size: 28px; }
  .w3-mission-line { font-size: 11px; }
  .w3-mission-reqs li { font-size: 10px; }
  .w3-launch-go { padding: 14px; font-size: 11px; }
  .w3-surface { left: clamp(30px, 3.2vw, 76px); right: clamp(30px, 3.2vw, 76px); bottom: 34px; padding: 18px 20px 16px; }
  .w3-surface h2 { font-size: 30px; }
  .w3-surface-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  .w3-surface-card { padding: 10px 11px; }
  .w3-surface-card strong { font-size: 10px; }
  .w3-surface-card small { font-size: 8px; }
  .w3-surface-meta, .w3-surface-hint { font-size: 9px; }
  .w3-logpanel { width: min(720px, calc(100vw - 80px)); max-height: min(76vh, 860px); padding: 26px 30px; }
  .w3-log-head h2 { font-size: 40px; }
  .w3-log-body { margin-top: 18px; }
  .w3-command-row { padding: 10px 0; }
  .w3-command-row strong { font-size: 12px; }
  .w3-command-row small { font-size: 9px; }
  .w3-command-row button { padding: 8px 11px; font-size: 9px; }
  .w3-command-tabs button { padding: 10px 14px; font-size: 9px; }
  .w3-toast { bottom: 104px; max-width: 440px; padding: 11px 16px; font-size: 11px; }
  .w3-legend { width: 286px; bottom: 112px; }
  .w3-start { padding-left: clamp(48px, 7vw, 168px); }
  .w3-start-panel { width: min(880px, 100%); padding: clamp(32px, 3.4vw, 52px); }
  .w3-start-title { font-size: clamp(56px, 5.2vw, 84px); }
  .w3-start-lede { font-size: 15px; }
  .w3-event-panel { width: min(820px, 100%); padding: clamp(28px, 3.6vw, 44px); }
  .w3-event-title { font-size: clamp(34px, 2.6vw, 50px); }
  .w3-event-body { font-size: 16px; }
  .w3-event-choice { padding: 15px 18px; }
  .w3-event-choice strong { font-size: 14px; }
  .w3-event-choice small { font-size: 10px; }
  .w3-settings-panel { width: min(960px, 100%); }
  .w3-manual-panel { width: min(1040px, 100%); }
  html body .gfe-end .gfe-end__panel { width: min(1160px, 100%); padding: 44px 48px; }
}
@media (min-width: 2100px) {
  .w3-top { padding: 28px clamp(76px, 4vw, 128px); }
  .w3-quests { top: 132px; right: clamp(76px, 4vw, 128px); width: 384px; }
  .w3-context { left: clamp(76px, 4vw, 128px); width: 424px; }
  .w3-end { right: clamp(76px, 4vw, 128px); }
  .w3-menu { right: calc(clamp(76px, 4vw, 128px) + 150px); }
  .w3-launch-panel { right: clamp(76px, 4vw, 128px); width: 404px; }
  .w3-surface { left: clamp(76px, 4vw, 128px); right: clamp(76px, 4vw, 128px); }
  .w3-surface-cards { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .w3-start { padding-left: clamp(128px, 10vw, 280px); }
  .w3-start-panel { width: min(1000px, 100%); }
  html body .gfe-end .gfe-end__panel { width: min(1340px, 100%); }
  .w3-event-panel { width: min(900px, 100%); }
}

/* ------------------------------------------------------------------------- */
/* Motion policy (Settings → Motion). The prefers-reduced-motion media query  */
/* above stays the system contract; the explicit policy adds a document-level  */
/* override for users who choose "reduced" on a machine that allows motion.   */
/* ------------------------------------------------------------------------- */
html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
  scroll-behavior: auto !important;
}
html[data-motion="full"] .w3-start::before { animation: w3-hero-drift 52s ease-in-out infinite alternate !important; }
html[data-motion="full"] .w3-start-panel { animation: w3-start-in 260ms ease-out both !important; }
html[data-motion="full"] .w3-toast { transition: opacity .2s ease !important; }
html[data-motion="full"] .w3-legend { transition: opacity .18s ease, transform .18s ease !important; }

/* ========================================================================= */
/* v7.2 meta layer — achievement catalog, three save slots                   */
/* ========================================================================= */

/* Achievement tier accents (shared by the start strip, gallery and deck). */
.w3-ach-tier-bronze { --ach-color: #d08a54; }
.w3-ach-tier-silver { --ach-color: #cbd7d2; }
.w3-ach-tier-gold { --ach-color: var(--amber); }
.w3-ach-tier-platinum { --ach-color: #9fd8ff; }

/* ------------------------------------------------- start screen: profiles */
.w3-start-profiles {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(180, 211, 195, .12);
}
.w3-start-profiles-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 14px;
}
.w3-start-profiles-head .w3-kicker { margin: 0; }
.w3-start-hint {
  color: var(--muted);
  font: 500 8px/1.45 var(--font-mono);
}
.w3-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}
.w3-slot-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 96px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 19, 21, .72);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.w3-slot-card:hover { border-color: rgba(134, 237, 181, .4); background: rgba(134, 237, 181, .06); }
.w3-slot-card:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.w3-slot-card.is-selected {
  border-color: rgba(134, 237, 181, .6);
  background: linear-gradient(160deg, rgba(134, 237, 181, .13), rgba(7, 19, 21, .78));
  box-shadow: inset 0 0 0 1px rgba(134, 237, 181, .18);
}
.w3-slot-card.is-empty { border-style: dashed; }
.w3-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.w3-slot-index {
  color: var(--amber);
  font: 700 7px/1 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.w3-slot-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.w3-slot-tag {
  padding: 2px 5px;
  border: 1px solid rgba(180, 211, 195, .22);
  border-radius: 3px;
  color: var(--muted);
  font: 700 6.5px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.w3-slot-tag.is-active { border-color: rgba(134, 237, 181, .5); color: var(--mint); background: rgba(134, 237, 181, .1); }
.w3-slot-tag.is-selected { border-color: rgba(227, 179, 101, .5); color: var(--amber); }
.w3-slot-copy { display: grid; gap: 2px; min-width: 0; }
.w3-slot-title { font: 600 11px/1.3 var(--font-sans); }
.w3-slot-copy small {
  color: var(--muted);
  font: 500 8px/1.4 var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.w3-slot-copy .w3-slot-campaign { color: rgba(227, 179, 101, .85); }
.w3-slot-actions { display: flex; gap: 4px; margin-top: auto; padding-top: 4px; }
.w3-slot-action {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(134, 237, 181, .35);
  border-radius: 4px;
  background: rgba(28, 64, 48, .38);
  color: var(--mint);
  font: 700 7px/1 var(--font-mono);
  letter-spacing: .06em;
  cursor: pointer;
  white-space: nowrap;
}
.w3-slot-action:hover { background: rgba(134, 237, 181, .16); }
.w3-slot-action:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }
.w3-slot-action.is-primary { border-color: rgba(134, 237, 181, .6); background: rgba(134, 237, 181, .16); }
.w3-slot-action.is-warn { border-color: rgba(255, 127, 142, .4); background: rgba(68, 21, 28, .3); color: #ffb6c0; }
.w3-slot-action.is-warn:hover { background: rgba(255, 127, 142, .16); }
.w3-slot-action:disabled { opacity: .4; cursor: default; background: rgba(8, 22, 20, .4); }

/* ------------------------------------------- start screen: achievements */
.w3-start-achievements {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(180, 211, 195, .12);
}
.w3-start-ach-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}
.w3-start-ach-head .w3-kicker { margin: 0; }
.w3-start-ach-count { color: var(--mint); font: 600 8px/1 var(--font-mono); letter-spacing: .06em; }
.w3-start-ach-more {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 600 8px/1 var(--font-mono);
  letter-spacing: .06em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.w3-start-ach-more:hover { color: var(--mint); }
.w3-start-ach-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.w3-start-ach-chip {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(180, 211, 195, .12);
  border-left: 2px solid var(--ach-color, var(--line));
  border-radius: 5px;
  background: rgba(8, 22, 20, .55);
}
.w3-start-ach-chip strong {
  overflow: hidden;
  font: 600 9.5px/1.3 var(--font-sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.w3-start-ach-chip small { color: var(--muted); font: 500 7.5px/1.3 var(--font-mono); }
.w3-start-ach-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font: 500 8.5px/1.5 var(--font-mono);
}

/* --------------------------------------------- settings: save slots rows */
.w3-settings-slots { display: grid; gap: 6px; margin: 10px 0 12px; }
.w3-save-slot {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(180, 211, 195, .12);
  border-radius: 7px;
  background: rgba(8, 22, 20, .55);
}
.w3-save-slot.is-active {
  border-color: rgba(134, 237, 181, .38);
  background: rgba(20, 48, 38, .5);
}
.w3-save-slot.is-empty { border-style: dashed; }
.w3-save-slot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.w3-save-slot-head strong {
  color: var(--amber);
  font: 700 7.5px/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.w3-save-slot-copy { display: grid; gap: 2px; min-width: 0; }
.w3-save-slot-copy span { font: 600 10px/1.3 var(--font-sans); }
.w3-save-slot-copy small { color: var(--muted); font: 500 8px/1.35 var(--font-mono); }
.w3-save-slot-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.w3-save-slots--deck { margin: 10px 0 0; }

/* ------------------------------------------- settings / deck: badge gallery */
.w3-ach-summary { margin: 10px 0 12px; }
.w3-ach-summary .w3-deck-bar { height: 6px; margin: 0 0 6px; }
.w3-ach-summary-line { margin: 0; color: var(--muted); font: 500 8.5px/1.4 var(--font-mono); }
.w3-ach-gallery {
  display: grid;
  gap: 14px;
  padding-right: 8px;
}
.w3-ach-category-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.w3-ach-category-head h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: -.02em;
}
.w3-ach-category-head span { color: var(--muted); font: 600 7.5px/1 var(--font-mono); letter-spacing: .08em; }
.w3-ach-items { display: grid; gap: 4px; }
.w3-ach-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid rgba(180, 211, 195, .1);
  border-radius: 6px;
  background: rgba(8, 22, 20, .5);
}
.w3-ach-item.is-locked { opacity: .6; }
.w3-ach-item.is-unlocked { border-color: color-mix(in srgb, var(--ach-color, var(--mint)) 32%, transparent); }
.w3-ach-mark {
  flex: 0 0 auto;
  color: var(--ach-color, var(--line));
  font: 400 12px/1.3 var(--font-sans);
}
.w3-ach-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.w3-ach-copy strong { font: 600 10px/1.35 var(--font-sans); }
.w3-ach-copy small { color: var(--muted); font: 500 8px/1.4 var(--font-mono); }
.w3-ach-copy .w3-ach-date { color: rgba(134, 237, 181, .82); }
.w3-ach-copy .w3-ach-progress-text { color: rgba(227, 179, 101, .85); }
.w3-ach-copy .w3-deck-bar { height: 4px; margin: 3px 0 1px; }
.w3-ach-empty { margin: 0; color: var(--muted); font: 500 9px/1.5 var(--font-mono); }
.w3-deck-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 700px) {
  .w3-slot-grid { grid-template-columns: 1fr; }
  .w3-slot-card { min-height: 0; }
  .w3-start-ach-list { grid-template-columns: 1fr; }
  .w3-save-slot { grid-template-columns: 1fr; align-items: flex-start; }
  .w3-save-slot-actions { justify-content: flex-start; }
}
@media (min-width: 1400px) {
  .w3-start-panel { width: min(940px, 100%); }
  .w3-slot-grid { gap: 10px; }
}

/* Ending screen: achievements unlocked by the run that just ended. */
.w3-ending-achievements {
  order: -1;
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 1px solid rgba(227, 179, 101, .34);
  border-radius: 9px;
  background: rgba(48, 38, 18, .42);
  color: var(--amber);
  font: 700 10px/1.4 var(--font-mono);
  letter-spacing: .04em;
}

/* Shorter desktop windows: compact the start panel so the three profile cards,
   badges, archive and footer all fit without scrolling at 1280×800/1440×900. */
@media (min-width: 900px) and (max-height: 950px) {
  .w3-start-panel { padding: clamp(18px, 2.4vw, 30px); }
  .w3-start-title { font-size: clamp(36px, 4.6vw, 58px); }
  .w3-start-sub { margin-bottom: 6px; font-size: 14px; }
  .w3-start-lede { font-size: 12px; line-height: 1.55; }
  .w3-start-actions { margin-top: 14px; }
  .w3-start-button { min-height: 42px; padding: 10px 18px; }
  .w3-start-save { margin-top: 9px; }
  .w3-start-profiles { margin-top: 11px; padding-top: 10px; }
  .w3-slot-grid { margin-top: 7px; }
  .w3-slot-card { min-height: 84px; padding: 8px 9px; }
  .w3-start-achievements { margin-top: 9px; padding-top: 9px; }
  .w3-start-archive { margin-top: 11px; padding-top: 9px; }
  .w3-start-version { margin-top: 8px; }
  .w3-start-foot { margin-top: 12px; padding-top: 10px; }
}

/* ------------------------------------------------------------------------- */
/* v7.3 Mars Charter endgame panel (top of the Diplomacy tab)                 */
/* ------------------------------------------------------------------------- */

.w3-charter-panel {
  position: relative;
  margin: 6px 0 18px;
  padding: 15px 16px 13px;
  border: 1px solid rgba(255, 196, 120, .36);
  border-radius: 8px;
  background: linear-gradient(158deg, rgba(56, 42, 18, .55), rgba(8, 26, 26, .74));
  box-shadow: inset 0 0 0 1px rgba(255, 196, 120, .05);
}
.w3-charter-panel.is-locked {
  border-color: var(--line);
  background: rgba(8, 26, 26, .52);
  box-shadow: none;
}
.w3-charter-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.w3-charter-head h3 { margin: 0; color: var(--ink); font-family: var(--font-serif); font-weight: 400; font-size: 30px; letter-spacing: -.035em; }
.w3-charter-panel.is-locked .w3-charter-head h3 { color: var(--muted); }
.w3-charter-formula { margin: 10px 0 2px; color: var(--ink); font: 500 8.5px/1.55 var(--font-mono); }
.w3-charter-breakdown { margin: 2px 0 7px; color: var(--muted); font: 500 8px/1.5 var(--font-mono); }
.w3-charter-coop .w3-deck-tag { margin-bottom: 2px; }
.w3-charter-advisor {
  display: flex; align-items: flex-start; gap: 9px;
  margin: 10px 0 0; padding: 9px 10px;
  border: 1px solid rgba(255, 196, 120, .32); border-radius: 5px;
  background: rgba(255, 196, 120, .07);
}
.w3-charter-advisor-tag {
  flex: 0 0 auto; margin-top: 1px;
  color: var(--amber); font: 700 7px/1.2 var(--font-mono);
  letter-spacing: .12em; text-transform: uppercase;
}
.w3-charter-advisor p { margin: 0; color: var(--ink); font: 500 8.5px/1.55 var(--font-mono); }
.w3-charter-plan { margin: 9px 0 0; color: var(--mint); font: 500 8px/1.5 var(--font-mono); }
.w3-charter-plan-hint { margin: 3px 0 0; color: var(--muted); font: 500 8px/1.5 var(--font-mono); }
.w3-charter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 5px; }
.w3-charter-nation {
  display: flex; flex-direction: column; gap: 4px;
  padding: 9px 10px; border: 1px solid rgba(180, 211, 195, .16); border-radius: 6px;
  background: rgba(8, 26, 26, .6);
}
.w3-charter-nation.is-ready {
  border-color: rgba(134, 237, 181, .58);
  background: rgba(14, 44, 34, .62);
  box-shadow: 0 0 12px rgba(111, 247, 200, .12);
}
.w3-charter-nation.is-signed { opacity: .64; border-color: rgba(134, 237, 181, .26); }
.w3-charter-nation-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.w3-charter-nation-head strong { font-size: 10px; }
.w3-charter-line { color: var(--muted); font: 500 8px/1.45 var(--font-mono); }
.w3-charter-line.is-warn { color: var(--amber); }
.w3-charter-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.w3-charter-income {
  margin: 10px 0 0; padding-top: 8px;
  border-top: 1px solid rgba(180, 211, 195, .1);
  color: var(--muted); font: 500 8px/1.5 var(--font-mono);
}
.w3-charter-unlocked-note { margin: 9px 0; color: var(--muted); font: 500 8.5px/1.55 var(--font-mono); }
.w3-gate-go {
  margin-left: 6px; padding: 3px 6px;
  border: 1px solid rgba(255, 196, 120, .45); border-radius: 3px;
  background: rgba(255, 196, 120, .1); color: var(--amber);
  font: 700 7px/1 var(--font-mono); cursor: pointer;
}
.w3-gate-go:hover { background: rgba(255, 196, 120, .2); }
.w3-charter-gate-hint { margin-top: 7px; color: var(--amber); }

@media (max-width: 900px) {
  .w3-charter-grid { grid-template-columns: minmax(0, 1fr); }
  .w3-charter-head h3 { font-size: 24px; }
}
.w3-charter-done { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; margin-top: 10px; }
.w3-charter-done-line { margin: 0; color: var(--ink); font: 500 8.5px/1.5 var(--font-mono); }
.w3-charter-done-line + .w3-charter-done-line { color: var(--muted); }
.w3-mission-effect { margin: 4px 0 10px; color: var(--amber); font: 500 8.5px/1.5 var(--font-mono); }
.w3-mission-effect[hidden] { display: none; }
