:root { color-scheme:dark; --bg:#111225; --card:#1b1b35; --ink:#faf2e8; --muted:#c8c4df; --line:#3b395a; --sun:#ffd28e; --route:#75f1ce; --blocked:#ff8e82; font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
*, *::before, *::after { box-sizing:border-box; }
[hidden] { display:none!important; }
body { margin:0; background:radial-gradient(ellipse at 65% 0%,#2e294d 0%,var(--bg) 50%); color:var(--ink); font-size:1rem; line-height:1.45; }
h1,h2,h3,p { margin:0; }
button, a { -webkit-tap-highlight-color:transparent; }
button { font:inherit; cursor:pointer; }
button:disabled { cursor:default; }
a { color:var(--ink); text-underline-offset:.22em; }
:focus-visible { outline:3px solid var(--route); outline-offset:3px; }
.wrap { width:min(100% - 2rem,75rem); margin-inline:auto; }
.skip { position:absolute; top:.5rem; left:.75rem; z-index:2; padding:.5rem .75rem; background:var(--card); transform:translateY(-150%); }
.skip:focus { transform:none; }
.topbar { border-bottom:1px solid var(--line); background:#15142b; }
.topbar-inner,.footer { display:flex; justify-content:space-between; align-items:center; gap:1rem; min-height:3.8rem; }
.brand { display:inline-flex; align-items:center; gap:.5rem; font-weight:780; letter-spacing:-.04em; text-decoration:none; }
.brand-mark { display:inline-block; width:1rem; height:1rem; border:3px solid var(--sun); transform:rotate(45deg); border-radius:.18rem; }
.rules-link { font-weight:650; }
.intro { padding:clamp(1.5rem,4vw,2.85rem) 0 1.25rem; display:flex; justify-content:space-between; gap:1.25rem; align-items:end; }
h1 { font-size:clamp(2.1rem,5vw,5.05rem); font-weight:850; letter-spacing:-.082em; line-height:1.02; }
h1 em { color:var(--sun); font-style:normal; background:linear-gradient(110deg,#ffdb9b,#ffa5ad 92%); background-clip:text; -webkit-text-fill-color:transparent; }
.intro p { margin-top:.65rem; color:var(--muted); max-width:38rem; }
.game-date { color:var(--muted); font-weight:650; white-space:nowrap; }
.scores { display:grid; grid-template-columns:1fr 1fr auto; gap:.6rem; margin-bottom:.8rem; }
.score { background:#24223f; border:1px solid var(--line); border-radius:.62rem; padding:.55rem .85rem; display:flex; justify-content:space-between; align-items:center; gap:.35rem; color:var(--muted); font-weight:620; }
.score strong { color:var(--ink); font-variant-numeric:tabular-nums; font-size:1.3rem; }
.button { padding:.5rem .8rem; min-height:2.8rem; border-radius:.55rem; border:1px solid transparent; font-weight:760; white-space:nowrap; }
.button.hot { background:linear-gradient(110deg,#ffd596,#ffa88e); color:#301c22; border-color:#ffd0a3; }
.button.hot:hover:not(:disabled) { background:#ffe2a6; }
.start-arrow { margin-left:.48rem; }
#start { min-width:12.4rem; }
#start:disabled .start-arrow { display:none; }
.button.quiet { background:#2c2a49; color:var(--ink); border-color:#524e74; }
.button.quiet:hover:not(:disabled) { background:#3c395c; }
.button:disabled { opacity:.56; }
.game { display:grid; grid-template-columns:minmax(0,1.98fr) minmax(18rem,1fr); align-items:start; gap:.85rem; }
.map-card,.dispatch,.result { background:var(--card); border:1px solid var(--line); border-radius:.95rem; padding:clamp(.75rem,2vw,1.25rem); }
.map-top { display:flex; justify-content:space-between; gap:.65rem; flex-wrap:wrap; align-items:center; margin-bottom:.75rem; }
h2 { font-size:1.35rem; line-height:1.2; letter-spacing:-.045em; }
h3 { font-size:1rem; margin:.8rem 0 .35rem; }
.map-toggle { min-height:2.15rem; padding:.19rem .66rem; background:#25223e; border:1px solid #565071; color:var(--muted); border-radius:.5rem; font-size:.88rem; font-weight:700; }
.map-toggle[aria-pressed="true"] { background:#332753; border-color:#8d76bb; color:#f2e2ff; }
.map-key { display:flex; gap:.45rem 1rem; flex-wrap:wrap; color:var(--muted); font-size:.86rem; margin-top:.77rem; }
.map-key span { display:inline-flex; gap:.28rem; align-items:center; }
.map-key i { display:inline-block; width:.85rem; height:.25rem; border-radius:3px; background:#93a8c4; }
.map-key .line-used { background:var(--route); }
.map-key .line-closed { height:0; border-top:3px dashed var(--blocked); background:transparent; }
.board { display:grid; grid-template-columns:repeat(11,minmax(0,1fr)); grid-template-rows:repeat(9,minmax(0,1fr)); aspect-ratio:11 / 9; padding:.32rem; border:1px solid #53537f; border-radius:.75rem; background:#1b2445; touch-action:manipulation; overflow:hidden; }
.board > * { display:flex; align-items:center; justify-content:center; min-width:0; min-height:0; }
.board .node { align-self:center; justify-self:center; position:relative; z-index:1; color:var(--ink); font-weight:810; }
.board .node:not(.stop):not(.depot) { width:.36rem; height:.36rem; border-radius:50%; background:#a3b5d1; }
.board .depot,.board .stop { width:93%; height:90%; min-height:1.65rem; font-size:clamp(.72rem,2vw,1rem); border-radius:24%; border:1px solid #a98438; }
.board .depot { background:#e8eef9; color:#1e2e43; border-color:#c9d8ef; }
.board .stop { background:var(--sun); color:#342201; }
.board .stop:disabled:not(.picked) { opacity:.74; }
.board .stop.picked { background:var(--route); border-color:var(--route); color:#123c37; }
.road { position:relative; border:none; }
.road::before { content:""; position:absolute; background:#6882a6; }
.road.horizontal::before { width:195%; height:3px; }
.road.vertical::before { width:3px; height:195%; }
.road.used::before { background:var(--route); box-shadow:0 0 10px #6eebd36a; }
.road.closed.horizontal::before { width:83%; height:0; border-top:3px dashed var(--blocked); background:transparent; }
.road.closed.vertical::before { width:0; height:83%; border-left:3px dashed var(--blocked); background:transparent; }
.map-key .depot-key { width:1.25rem; height:1.25rem; display:grid; place-items:center; color:#26244a; background:#d5ddff; font-weight:800; font-style:normal; }
.board.city-mode {
  position:relative; display:block; padding:0; aspect-ratio:1.57;
  background:
    radial-gradient(ellipse at 51% 79%,#161a416e 5%,transparent 48%),
    radial-gradient(ellipse at 29% 4%,#885f9f 0%,transparent 62%),
    linear-gradient(155deg,#27244d,#5b6197 58%,#9294bd);
}
.city-mode > :not(.city-canvas):not(.stop):not(.depot) { display:none; }
.city-mode .city-canvas { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.city-mode .node.stop,.city-mode .node.depot {
  position:absolute; left:var(--marker-x); top:var(--marker-y); transform:translate(-50%,-50%);
  width:clamp(1.75rem,3.15vw,2.35rem); height:auto; aspect-ratio:1; border-radius:38%;
  padding:0; font-size:clamp(.75rem,1.5vw,1rem); border:2px solid #211d40;
  box-shadow:0 .15rem .42rem #181530a8; opacity:1;
}
.city-mode .node.depot { background:#d5ddff; }
.city-mode .node.stop:hover:not(:disabled) { background:#fff0c6; box-shadow:0 0 0 .22rem #fff0c669; }
.city-mode .node.stop.picked { color:#172b27; border-color:#213654; }
.panel-note { margin:.35rem 0 .65rem; color:var(--muted); }
.stop-list { display:grid; gap:.35rem; }
.stop-card { display:flex; align-items:center; justify-content:space-between; gap:.5rem; text-align:left; padding:.4rem .62rem; min-height:2.75rem; border:1px solid #4a466e; border-radius:.5rem; background:#262442; color:var(--ink); }
.stop-card:hover:not(:disabled) { background:#353156; }
.stop-card.picked { border-color:var(--route); color:var(--route); }
.stop-card strong { display:inline-grid; place-items:center; background:#443751; width:1.55rem; height:1.55rem; border-radius:.36rem; color:var(--sun); margin-right:.2rem; }
.stop-card small { color:var(--muted); font-size:.9rem; white-space:nowrap; }
.route { min-height:2.05rem; color:#e5f6fc; background:#141429; border:1px solid #494669; border-radius:.42rem; padding:.42rem .62rem; overflow-wrap:anywhere; }
.controls,.result-actions { display:flex; flex-wrap:wrap; gap:.45rem; margin-top:.65rem; }
.controls .hot { margin-left:auto; }
.notice { color:#ffbfbb; margin-top:.55rem; font-size:.92rem; overflow-wrap:anywhere; }
.notice:empty { display:none; }
.result { margin-top:.85rem; border-color:#61ae9d; display:flex; justify-content:space-between; align-items:center; gap:.8rem; }
.result p { color:#e0e9f6; margin-top:.32rem; }
.result-actions { margin-top:0; }
.rules { padding:1.6rem 0; }
.rules li { padding:.22rem 0; }
.rules p,.footer { color:var(--muted); }
.footer { border-top:1px solid var(--line); font-size:.91rem; }
@media (max-width:50rem) {
  .game { grid-template-columns:1fr; }
  .board { max-height:65vh; }
}
@media (max-width:32rem) {
  .wrap { width:calc(100% - 1.25rem); }
  .intro,.result { flex-direction:column; align-items:flex-start; gap:.65rem; }
  .scores { position:sticky; top:0; z-index:3; grid-template-columns:1fr 1fr; padding-block:.32rem; background:var(--bg); }
  .scores .hot { grid-column:1 / -1; }
  .map-card,.dispatch { padding:.72rem; }
  .board { aspect-ratio:11 / 9; }
  .board.city-mode { aspect-ratio:1.27; }
  .map-key { column-gap:.7rem; }
}
