:root {
  color-scheme: dark; --back:#0a1723; --panel:#14293a; --panel-deep:#102333; --line:#3c5a70;
  --text:#eef7ff; --dim:#acc1d1; --green:#ffd474; --gold:#ffd27b; --error:#ffc1a6;
  font-family: "Noto Sans TC", "Noto Sans CJK TC", system-ui, sans-serif;
}
* {box-sizing:border-box}
body {margin:0;color:var(--text);background:radial-gradient(ellipse at 50% 0%, #203c54 0, var(--back) 65%);font-size:16px;min-height:100vh}
[hidden] {display:none!important}
main {width:100%;max-width:800px;margin:auto;padding:22px 24px 0}
h1,h2,h3,p {margin:0}
h1 {font-size:clamp(1.9rem,4.4vw,2.8rem);letter-spacing:.025em;line-height:1.15}
h2 {font-size:clamp(1.35rem,3.7vw,1.8rem);line-height:1.3;letter-spacing:.025em}
header {display:flex;justify-content:space-between;align-items:flex-end;gap:18px;margin:12px 0 22px;flex-wrap:wrap}
.brand {display:flex;gap:11px;align-items:center;color:var(--green);font-size:.72rem;letter-spacing:.15em;font-weight:750;margin-bottom:11px}
.brand-mark {display:inline-grid;place-items:center;width:24px;height:24px;color:#302219;background:var(--green);border-radius:6px;font:900 11px/1 system-ui;letter-spacing:0}
header .tools {display:flex;gap:7px;align-items:center}
button,a,input {font:inherit}
button {cursor:pointer;min-height:44px;border:1px solid var(--line);border-radius:8px;padding:9px 14px;background:#1e394f;color:var(--text);font-weight:700;line-height:1.33}
button:disabled {cursor:default;opacity:.52}
button:not(:disabled):hover {border-color:var(--green)}
:focus-visible {outline:3px solid var(--gold);outline-offset:3px}
.secondary {background:transparent}
.primary {background:var(--green);color:#342017;border-color:transparent}
.primary:not(:disabled):hover {background:#ffe1af}
.full {width:100%}
.small {font-size:.84rem}
.subtle {color:var(--dim);line-height:1.6}
.card {border:1px solid var(--line);background:var(--panel);border-radius:16px;overflow:hidden;box-shadow:0 16px 56px #0413229c}
.top {padding:18px 21px 16px}
#stats {display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:.83rem;color:var(--dim);font-variant-numeric:tabular-nums}
#stats strong {color:var(--green)}
#ticker {display:grid;gap:4px;margin:11px 0 17px}
#ticker i {display:block;height:4px;border-radius:2px;background:#345064}
#ticker i.done {background:var(--green)}
#ticker i.current {background:var(--gold)}
#info {color:var(--dim);line-height:1.55;margin-top:6px}
#question {line-height:1.45;margin:11px 0 10px;font-weight:750}
#options {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.option {display:flex;align-items:center;gap:9px;text-align:left;padding:7px 10px;background:#193449;font-size:.92rem}
.option span {display:grid;place-items:center;flex:0 0 24px;height:24px;border-radius:5px;background:#30536a;color:var(--dim);font:700 .74rem system-ui}
.option[aria-pressed=true] {border-color:var(--gold);background:#344757}
.option[aria-pressed=true] span {background:var(--gold);color:#291e14}
.map {margin:0 15px;background:linear-gradient(#10283e30,#0c2135a8),url(harbor.webp) center/cover,#132b3d;overflow:hidden;border:1px solid #4c6e83;border-radius:11px}
#scene {width:100%;height:auto;aspect-ratio:8/5;display:block;touch-action:pan-y}
#scene.drag {touch-action:none;cursor:grab}
.actions {padding:13px 21px 17px;display:grid;gap:9px}
#startForm {display:grid;grid-template-columns:1fr auto;gap:9px}
#name {width:100%;min-height:44px;border:1px solid #53728a;background:#0f2636;color:var(--text);border-radius:8px;padding:8px 10px}
#feedback,#error,#result p {padding:10px 12px;border-radius:7px;background:#102635;border-inline-start:3px solid #577990;font-size:.91rem;line-height:1.55}
#feedback.good {border-color:var(--green)}
#feedback.wrong,#error {border-color:var(--gold);color:var(--error)}
#control {display:grid;gap:8px}
#choice-row {display:flex;gap:7px;flex-wrap:wrap}
#choice-row button {flex:1 1 75px}
#choice-row button[aria-pressed=true] {border-color:var(--gold);color:var(--gold)}
#slider-row {display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;min-height:44px}
#range {width:100%;min-height:42px;accent-color:var(--gold);cursor:pointer}
#range-readout {color:var(--gold);font-weight:750;min-width:55px;text-align:center}
#extra {display:flex;flex-wrap:wrap;gap:7px}
#extra button {font-size:.82rem}
.section {margin-top:16px;padding:17px 20px 18px;border:1px solid var(--line);border-radius:13px;background:var(--panel-deep)}
.section h2 {font-size:1.05rem;margin-bottom:10px}
#archive {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
#archive button {text-align:left;font-size:.83rem}
#archive span {color:var(--green);margin-right:6px;font-variant-numeric:tabular-nums}
#result {display:grid;gap:8px}
#result h2 {margin:0}
.receipts {padding-top:3px;display:grid;gap:7px}
.receipts div {display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.receipts output {font-size:.81rem;overflow-wrap:anywhere;max-width:100%;color:var(--dim)}
#board table {width:100%;border-collapse:collapse;margin:9px 0}
#board td,#board th {padding:8px 4px;border-bottom:1px solid #36596f;text-align:left;overflow-wrap:anywhere}
#board td {font-size:.85rem}
#board th {font-size:.76rem;color:var(--dim)}
#board nav {display:flex;flex-wrap:wrap;gap:7px;align-items:center}
footer {padding:20px 0 26px;text-align:center;color:var(--dim);font-size:.84rem}
a {color:var(--green)}
@media(max-width:560px) {
  main {padding:10px 11px 0}
  header {margin:10px 0 14px}
  .top {padding:13px 13px 12px}
  .actions {padding:11px 13px}
  .map {margin:0 8px}
  #options {grid-template-columns:1fr}
  #startForm {grid-template-columns:1fr}
  #archive {grid-template-columns:repeat(2,minmax(0,1fr))}
}
