*{box-sizing:border-box}body{margin:0;background:#f2efe5;color:#263f37;font:16px/1.5 system-ui,sans-serif}header,main{max-width:1020px;margin:auto;padding:20px 28px}header{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #c6c8b8}a{color:inherit;text-decoration:none}button{font:inherit;color:inherit;cursor:pointer;border:1px solid #bbc2b3;border-radius:6px;background:transparent;padding:7px 14px}button:focus-visible,a:focus-visible{outline:3px solid #dd9630;outline-offset:2px}main{display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:48px;align-items:center;padding-top:32px}.heading,.players,.switch{display:flex;align-items:center;justify-content:space-between}.heading{margin-bottom:16px}h1,h2,h3,p{margin:0}h1{font: bold clamp(32px,5vw,52px)/1.15 Georgia,serif;letter-spacing:.05em}h1 span{font-size:.5em;margin-left:.4em}#round,h3{font-size:14px;color:#617166}.frame{background:#243f36;border:6px double #8c9578;border-radius:12px;padding:clamp(8px,2vw,20px);box-shadow:0 8px 16px #213d321c}#board{display:grid;grid-template-columns:repeat(6,1fr);gap:clamp(4px,1vw,9px)}.cell{position:relative;aspect-ratio:1.17;padding:0;background:#344f45;border:1px solid #678071;border-radius:6px;font:bold clamp(16px,3vw,28px) Georgia,serif}.back{background:repeating-linear-gradient(45deg,#517566 0 1px,#466858 1px 5px);border:3px double #99ac8f;color:#d4d8ae;box-shadow:0 2px 0 #112f24}.back span{display:inline-grid;place-items:center;border:1px solid #99ac8f;border-radius:50%;width:1.6em;height:1.6em;font-size:.68em}.piece{background:#f4e7c7;border:3px double #a89d7b;box-shadow:0 2px 0 #ab9574}.red,.players strong:first-child{color:#a83929}.blue,.players strong:last-child{color:#2c5570}.selected,.target{outline:3px solid #ffca63;outline-offset:-3px}.empty.target:after{content:'';display:block;margin:auto;width:12px;height:12px;background:#ffd37b;border-radius:50%}.back:hover{filter:brightness(1.12)}aside{border-top:3px solid #354f43;padding-top:20px}h2{font-size:23px}h3{margin:20px 0 7px}.players{font-size:14px;margin:12px 0 24px}.switch{background:#e2e4d8;padding:4px;border-radius:8px}.switch button{width:50%;border:0}.switch button[aria-pressed=true],#reset,dialog button{background:#304e40;color:white}.status{padding:20px 0;border-bottom:1px solid #c8ccbd}.status p,#last{font-size:15px;line-height:1.65}#reset{width:100%;margin-top:22px}dialog{max-width:min(440px,92vw);max-height:85vh;background:#faf7ec;color:inherit;border:1px solid #aab19e;border-radius:12px;padding:24px}dialog::backdrop{background:#162e25aa}dialog p,dialog form{margin-top:10px}@media(max-width:700px){main{grid-template-columns:1fr;gap:22px;padding:20px 14px}header{padding:12px 16px}aside{padding-top:12px}.players{margin:8px 0}.heading{margin-bottom:10px}}

/* The route drawing and the interactive stations share one coordinate system. */
.table{width:100%;max-width:520px;margin:auto}
.frame{padding:6px;background:#e1d8b8;border-color:#6c765e}
.map{position:relative;aspect-ratio:500/780}
#routes,#board{position:absolute;inset:0;width:100%;height:100%}
#board{display:block}
#routes line{stroke:#778169;stroke-width:2.4}
#routes .rail line{stroke:#405647;stroke-width:6}
#routes .rail .sleepers{stroke:#e1d8b8;stroke-width:3;stroke-dasharray:6 5}
#routes text{fill:#68745d;font:bold 18px serif;text-anchor:middle}
.cell{position:absolute;transform:translate(-50%,-50%);width:14%;height:4.8%;aspect-ratio:auto;font-size:clamp(14px,2vw,20px);line-height:1}
.cell.empty{color:#52614b;background:#e5dfc9;font-size:13px}
.cell.camp{width:8.4%;height:5.4%;border-radius:50%}
.cell.base{outline:2px solid #7d5636;outline-offset:2px}
.cell.base:after{content:'大本营';position:absolute;left:50%;top:100%;transform:translateX(-50%);background:#e1d8b8;color:#69462c;font:bold clamp(10px,1.3vw,13px)/1.2 serif;white-space:nowrap}
.cell.empty.target:after{display:none}
.cell.target,.cell.selected{outline:3px solid #d98a13;outline-offset:1px}
.cell.empty.target{background:#ffe099;color:#493919}
.cell.base.empty:after{display:none}
@media(min-width:701px){main{max-width:900px;align-items:start}.table{max-width:min(100%,max(360px,54vh))}aside{margin-top:76px}}

#notice{margin:0 0 9px;padding:9px 12px;border-left:4px solid #39739a;border-radius:3px;background:#e1eaf0;color:#193e59;font-size:14px;font-weight:650}
.cell[data-mark]{box-shadow:0 0 0 3px #28678e}
.cell[data-mark]::before{content:attr(data-mark);position:absolute;z-index:1;top:-7px;right:-7px;padding:2px 4px;border-radius:4px;background:#205b82;color:white;font:bold 11px/1.2 system-ui}
.cell[data-mark="起"]{border-style:dashed}
@media(prefers-reduced-motion:no-preference){
  .cell[data-mark="至"],.cell[data-mark="翻"]{animation:arrival .55s ease-out}
  @keyframes arrival{from{box-shadow:0 0 0 8px #4784a8}to{box-shadow:0 0 0 3px #28678e}}
}

#result{width:min(360px,90vw);text-align:center;padding:30px 20px;border-top:5px solid currentColor}
#result[data-outcome="red"]{color:#983826}
#result[data-outcome="blue"]{color:#255676}
.result-flag{display:block;font:48px/1 serif}
#result-title{font-size:clamp(32px,8vw,44px)}
#result-detail{color:#263f37}
#result form{display:flex;justify-content:center;gap:12px;margin-top:22px}
#result button:first-child{background:transparent;color:#304e40}
