/* Whiteout Station */
* { box-sizing: border-box; }
html { background: #071624; }
body { margin: 0; min-height: 100vh; font-family: "Fredoka", system-ui, sans-serif; color: #eaf6ff;
  background: radial-gradient(ellipse at 50% -10%, rgba(88, 214, 190, 0.22), transparent 55%), radial-gradient(ellipse at 90% 0%, rgba(124, 92, 214, 0.18), transparent 45%), linear-gradient(180deg, #0c2a40, #08192a 60%, #050d17);
  background-attachment: fixed; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: "Lilita One", "Fredoka", sans-serif; font-weight: 400; letter-spacing: 0.02em; }
button { font: inherit; }
.wo { max-width: 1320px; margin: 0 auto; padding: 0 1rem 2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; border: 0; border-radius: 12px; padding: 0.6rem 1.1rem; cursor: pointer; font-weight: 700; font-size: 1rem; color: #fff;
  background: linear-gradient(180deg, #3cc2a8, #1f8f86); box-shadow: 0 4px 0 #11585a; text-decoration: none; transition: transform 0.12s, filter 0.12s; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
.btn.ghost { background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 2px rgba(143, 227, 211, 0.4); }
.btn.warm { background: linear-gradient(180deg, #ffb24a, #e0782b); box-shadow: 0 4px 0 #8f4410; }
.btn.sm { padding: 0.4rem 0.75rem; font-size: 0.9rem; border-radius: 10px; }
.btn:focus-visible, .seg button:focus-visible, .act:focus-visible, .node:focus-visible { outline: 3px solid #ffd76a; outline-offset: 2px; }

/* ---------------- home screen (layout from game-home.css) */
.panel { background: rgba(8, 30, 48, 0.82); border-radius: 18px; padding: 1.1rem 1.2rem; box-shadow: inset 0 0 0 2px rgba(143, 227, 211, 0.16), 0 10px 26px rgba(0, 0, 0, 0.35); }
.panel h2 { margin: 0 0 0.6rem; font-size: 1.4rem; color: #fff; }
.panel h3 { margin: 0.9rem 0 0.4rem; color: #8fe3d3; font-size: 1.05rem; }
.muted { color: rgba(222, 240, 255, 0.72); }
.roster { display: grid; gap: 0.55rem; }
.rrow { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 0.7rem; align-items: center; padding: 0.45rem 0.6rem; border-radius: 14px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 4px 0 0 var(--rc); }
.rrow img { width: 58px; height: 58px; object-fit: cover; object-position: 50% 15%; border-radius: 50%; background: var(--rc); box-shadow: 0 0 0 3px var(--rc); }
.rrow b { display: block; font-size: 1.05rem; }
.rrow small { color: rgba(222, 240, 255, 0.75); line-height: 1.3; display: block; }
.rrow input { width: 100%; margin-top: 0.3rem; padding: 0.3rem 0.5rem; border: 0; border-radius: 8px; font: 600 0.95rem "Fredoka", sans-serif; background: #eaf6ff; color: #082033; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; }
.seg button { border: 0; border-radius: 10px; padding: 0.4rem 0.75rem; cursor: pointer; font-weight: 700; color: #dff4ff; background: rgba(255, 255, 255, 0.1); }
.seg button.on { color: #052033; background: #8fe3d3; }
.diff-note { margin: 0.4rem 0 0.8rem; }
.start-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

/* ---------------- game */
.chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.7rem; border-radius: 999px; font-weight: 700; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1.5px rgba(143, 227, 211, 0.25); white-space: nowrap; }
.chip.good { box-shadow: inset 0 0 0 2px #59d68b; color: #b9f5cd; }
.chip.bad { box-shadow: inset 0 0 0 2px #ff7a6b; color: #ffd0c9; }
.chip.storm { box-shadow: inset 0 0 0 2px #9fb7ff; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
.side { display: grid; gap: 0.8rem; }

/* the map */
.board { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #dcecf7 url("/img/whiteout/map-bg.webp") center / cover; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 3px rgba(255, 255, 255, 0.5); user-select: none; }
.board .compound { position: absolute; left: 1%; top: 6%; width: 44%; height: 88%; border-radius: 46% 40% 40% 46%; background: radial-gradient(ellipse at 50% 50%, rgba(255, 220, 170, 0.35), rgba(255, 255, 255, 0) 70%); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.35); }
.board svg.paths { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.paths .hall { stroke: #b9c7d4; stroke-width: 2.6; stroke-linecap: round; }
.paths .hall-in { stroke: #f2a65a; stroke-width: 1.1; stroke-linecap: round; }
.paths .trail { stroke: #6f8fb0; stroke-width: 0.9; stroke-dasharray: 1.6 1.6; stroke-linecap: round; fill: none; }
.paths .trail.cut { stroke: #fff; stroke-width: 1.6; opacity: 0.9; }
.node { position: absolute; transform: translate(-50%, -50%); width: 14%; aspect-ratio: 1; display: grid; place-items: center; border: 0; padding: 0; background: none; cursor: default; }
.node img.art { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(20, 40, 60, 0.35)); transition: filter 0.2s, transform 0.2s; }
.node .lbl { position: absolute; left: 50%; top: -6%; transform: translateX(-50%); z-index: 4; white-space: nowrap; padding: 0.12rem 0.55rem; border-radius: 999px; font: 700 clamp(0.6rem, 1.05vw, 0.82rem) "Fredoka", sans-serif; color: #0b2a40; background: rgba(255, 255, 255, 0.92); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.node.dmg img.art { filter: grayscale(0.7) brightness(0.8) drop-shadow(0 6px 6px rgba(20, 40, 60, 0.35)); }
.node.dmg::after { content: "⚠️ Damaged"; position: absolute; top: 4%; left: 50%; transform: translateX(-50%); padding: 0.1rem 0.45rem; border-radius: 8px; font: 700 clamp(0.55rem, 0.95vw, 0.75rem) "Fredoka", sans-serif; color: #fff; background: #d0463a; white-space: nowrap; }
.node.fog::before { content: ""; position: absolute; inset: -12%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.55) 55%, rgba(255, 255, 255, 0) 72%); z-index: 2; pointer-events: none; animation: fog 4s ease-in-out infinite alternate; }
@keyframes fog { to { transform: scale(1.06) rotate(4deg); } }
.node.go { cursor: pointer; }
.node.go img.art { filter: drop-shadow(0 0 0.5rem #ffd76a) drop-shadow(0 0 0.25rem #ffd76a); }
.node.go:hover img.art { transform: scale(1.05); }
.node.pick { cursor: pointer; }
.node.pick:hover img.art, .node.chosen img.art { filter: drop-shadow(0 0 0.55rem #8fe3d3) drop-shadow(0 0 0.25rem #8fe3d3); }
.tags { position: absolute; top: 14%; right: -6%; display: grid; gap: 2px; justify-items: end; z-index: 3; pointer-events: none; }
.tag { display: inline-flex; align-items: center; gap: 2px; padding: 0.08rem 0.35rem; border-radius: 8px; font: 700 clamp(0.52rem, 0.9vw, 0.72rem) "Fredoka", sans-serif; background: rgba(8, 30, 48, 0.88); color: #fff; white-space: nowrap; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); }
.tag.secret { background: #ffd76a; color: #3a2400; }
.tag.sig { box-shadow: 0 0 0 2px var(--rc), 0 2px 5px rgba(0, 0, 0, 0.3); }
.ground { position: absolute; left: -2%; top: 8%; display: flex; flex-direction: column; gap: 1px; z-index: 3; pointer-events: none; }
.ground img { width: clamp(14px, 2.2vw, 26px); height: auto; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }
.token { position: absolute; z-index: 5; width: 4.6%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; transition: left 0.55s cubic-bezier(.4, 0, .2, 1), top 0.55s cubic-bezier(.4, 0, .2, 1); }
.token img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 12%; background: var(--rc); box-shadow: 0 0 0 3px var(--rc), 0 4px 8px rgba(0, 0, 0, 0.45); }
.token.now img { box-shadow: 0 0 0 3px #ffd76a, 0 0 0 6px var(--rc), 0 0 18px #ffd76a; }
.token.frozen img { filter: saturate(0.2) brightness(1.25) hue-rotate(160deg); box-shadow: 0 0 0 3px #bfe9ff, 0 0 16px #bfe9ff; }
.token .carry { position: absolute; right: -28%; bottom: -18%; width: 55%; height: auto; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
.token .pips { position: absolute; left: 50%; bottom: -26%; transform: translateX(-50%); display: flex; gap: 1px; }
.token .pips i { width: clamp(4px, 0.55vw, 7px); height: clamp(4px, 0.55vw, 7px); border-radius: 50%; background: #ff9b4a; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.token .pips i.off { background: #a9c7dc; }
.token .band { position: absolute; left: 50%; bottom: -30%; transform: translateX(-50%); padding: 0 0.3rem; border-radius: 6px; font: 700 clamp(0.48rem, 0.8vw, 0.66rem) "Fredoka", sans-serif; white-space: nowrap; color: #fff; }
.band.warm { background: #e0782b; } .band.cold { background: #3c86c9; } .band.freezing { background: #6e57d6; } .band.frozen { background: #a8dcff; color: #08304a; }

/* side panels */
.turn { --rc: #8fe3d3; }
.turn .who { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 0.7rem; align-items: center; }
.turn .who img { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; background: var(--rc); box-shadow: 0 0 0 3px var(--rc); }
.turn .who b { font-size: 1.2rem; }
.acts-left { display: inline-flex; gap: 4px; margin-left: 0.3rem; vertical-align: middle; }
.acts-left i { width: 12px; height: 12px; border-radius: 50%; background: #ffd76a; }
.acts-left i.off { background: rgba(255, 255, 255, 0.18); }
.actions { display: grid; gap: 0.4rem; margin-top: 0.7rem; }
.act { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; width: 100%; text-align: left; border: 0; border-radius: 12px; padding: 0.55rem 0.75rem; cursor: pointer; color: #eaf6ff; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1.5px rgba(143, 227, 211, 0.22); font-weight: 600; }
.act:hover { background: rgba(143, 227, 211, 0.18); }
.act small { flex: none; color: #ffd76a; font-weight: 700; }
.act.key { background: rgba(255, 178, 74, 0.2); box-shadow: inset 0 0 0 2px #ffb24a; }
.act.end { background: rgba(255, 255, 255, 0.04); }
.hint { margin: 0.5rem 0 0; font-size: 0.92rem; color: rgba(222, 240, 255, 0.78); }
.secret { margin-top: 0.7rem; border-radius: 14px; padding: 0.6rem 0.75rem; background: rgba(255, 215, 106, 0.12); box-shadow: inset 0 0 0 2px rgba(255, 215, 106, 0.55); }
.secret b { color: #ffd76a; }
.forecast { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; margin-top: 0.45rem; }
.forecast figure { margin: 0; border-radius: 10px; overflow: hidden; background: #0b2234; }
.forecast img { display: block; width: 100%; aspect-ratio: 1.6; object-fit: cover; }
.forecast figcaption { padding: 0.25rem 0.4rem; font-size: 0.78rem; line-height: 1.25; }
.crewlist { display: grid; gap: 0.35rem; }
.crow { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; font-size: 0.92rem; }
.crow img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; background: var(--rc); box-shadow: 0 0 0 2px var(--rc); }
.crow .w { font-weight: 700; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; max-height: 220px; overflow: auto; font-size: 0.9rem; }
.log li { padding: 0.25rem 0.45rem; border-radius: 8px; background: rgba(255, 255, 255, 0.04); line-height: 1.35; }
.sigpick { display: grid; gap: 0.45rem; margin-top: 0.6rem; }
.sigpick .seg button { padding: 0.5rem 0.8rem; }

/* overlays */
.veil { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1rem; background: rgba(3, 12, 22, 0.86); backdrop-filter: blur(6px); }
.card { width: min(520px, 100%); border-radius: 22px; overflow: hidden; background: #0c2a40; box-shadow: 0 0 0 3px rgba(143, 227, 211, 0.4), 0 24px 60px rgba(0, 0, 0, 0.6); text-align: center; animation: pop 0.35s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } }
.card img.art { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card .body { padding: 1rem 1.2rem 1.2rem; }
.card h2 { margin: 0 0 0.35rem; font-size: 1.7rem; color: #fff; }
.card p { margin: 0 0 0.6rem; color: #dff4ff; }
.card ul { text-align: left; margin: 0.4rem 0 0.8rem; padding-left: 1.2rem; color: #dff4ff; }
.card .portrait { width: 120px; height: 120px; margin: 1.1rem auto 0; border-radius: 50%; object-fit: cover; object-position: 50% 12%; background: var(--rc); box-shadow: 0 0 0 4px var(--rc); display: block; }
.toasts { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 70; display: grid; gap: 0.4rem; width: min(560px, calc(100vw - 2rem)); pointer-events: none; }
.toast { padding: 0.6rem 0.9rem; border-radius: 12px; background: rgba(8, 30, 48, 0.95); box-shadow: 0 0 0 2px rgba(143, 227, 211, 0.45), 0 10px 24px rgba(0, 0, 0, 0.45); animation: pop 0.25s both; }
.rules { text-align: left; max-height: min(70vh, 640px); overflow: auto; }
.rules h3 { color: #8fe3d3; margin: 0.9rem 0 0.3rem; }
.rules p, .rules li { color: #dff4ff; line-height: 1.5; }
.gate { max-width: 520px; margin: 3rem auto; text-align: center; }

@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wo { padding: 0 0.5rem 1.5rem; }
  .rrow { grid-template-columns: 48px minmax(0, 1fr); }
  .rrow img { width: 48px; height: 48px; }
  .rrow .seg { grid-column: 1 / -1; }
  .board { border-radius: 14px; aspect-ratio: 4 / 3.4; }
  .token { width: 7.5%; }
  .node { width: 18%; }
  .node .lbl { font-size: 0.58rem; padding: 0.08rem 0.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .token { transition: none; }
  .node.fog::before, .card, .toast { animation: none; }
}

/* online lobby (shared board-online.js markup) */
.label { display: flex; align-items: center; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; color: #8fe3d3; }
.bad { color: #ff9b8f; }
.ol-gate { text-align: center; padding: 0.6rem 0 0.2rem; }
.ol-gate p { margin: 0 0 0.9rem; }
.ol-head { display: flex; align-items: center; justify-content: space-between; }
.ol-head .label { margin: 0; }
.ol-list { list-style: none; margin: 0.4rem 0 0.9rem; padding: 0; display: grid; gap: 0.4rem; }
.ol-game { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.55rem 0.75rem; border-radius: 12px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 2px rgba(143, 227, 211, 0.2); }
.ol-game.mine, .ol-game.invite { background: rgba(255, 215, 106, 0.12); box-shadow: inset 0 0 0 2px #ffd76a; }
.ol-who small { display: block; color: rgba(222, 240, 255, 0.75); font-size: 0.85rem; margin-top: 0.1rem; }
.ol-you { color: #ffd76a; }
.ol-btns { display: flex; gap: 0.35rem; flex-shrink: 0; }
.ol-empty { padding: 0.5rem 0.2rem; }
.ol-new { display: grid; gap: 0.5rem; }
.ol-new input { width: 100%; padding: 0.55rem 0.7rem; border-radius: 10px; border: 0; font: inherit; background: #eaf6ff; color: #082033; }
.ol .small { font-size: 0.85rem; margin: 0.6rem 0 0; }
.ol-loading { text-align: center; padding: 4rem 1rem; font-size: 1.1rem; }
.ol-new .seg button { display: grid; text-align: left; }
.ol-new .seg small { font-weight: 500; opacity: 0.85; }
.ol-clock { display: inline-block; margin-left: 0.5rem; padding: 0.1rem 0.55rem; border-radius: 999px; background: rgba(255, 255, 255, 0.85); color: #0b2a40; font-weight: 700; font-variant-numeric: tabular-nums; }
.ol-clock.low { background: #ffe1dc; color: #a3241a; }
.ol-more-row { display: flex; align-items: center; gap: 0.4rem; }
.ol-more-row input { flex: 1; min-width: 0; }
.ol-add { justify-self: start; }
.ol-bots { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; }
.ol-step { display: inline-flex; align-items: center; gap: 0.45rem; }
.ol-level { display: none !important; }
#app.ol-wait .actions, #app.ol-wait .sigpick { opacity: 0.55; pointer-events: none; }

/* ---------------- home screen: icy colours for the shared game-home.css layout */
.setup { --gh-frame: #0b2a40; --gh-frame-2: #3cc2a8; --gh-line: #c9e2ee; --gh-accent: #1f8f86; --gh-accent-soft: rgba(60, 194, 168, 0.35); }
.setup .gh-title h1 { color: #fff; font-size: clamp(2.6rem, 8vw, 4.6rem); text-shadow: 0 4px 0 #0b2a40, 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 40px rgba(120, 230, 210, 0.45); }
.setup .gh-shade { background: linear-gradient(180deg, rgba(6, 22, 36, 0) 38%, rgba(6, 22, 36, 0.88)); }
.hero-snow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-snow i { position: absolute; top: -6%; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 6px rgba(255, 255, 255, 0.8); animation: snowfall linear infinite; }
.hero-snow i:nth-child(3n) { width: 4px; height: 4px; }
@keyframes snowfall { to { transform: translate(-40px, 260px); opacity: 0.2; } }
.setup .gh-card { color: #0b2a40; background: linear-gradient(180deg, #f7fcff, #e4f2f9); box-shadow: 0 0 0 3px #0b2a40, 0 16px 34px rgba(0, 0, 0, 0.45); }
.setup .gh-card > h2 { color: #0b2a40; }
.setup .gh-modes .gh-mode { color: #0b2a40; background: #fff; }
.setup .gh-modes .gh-mode.on { background: #e3faf4; }
.setup .field { margin: 0.9rem 0; }
.setup .label { color: #1f5b73; font-weight: 700; }
.setup .muted { color: #4d6c7e; }
.setup .level-hint { margin: 0.4rem 0 0; }
.setup .seg button { flex: 1 1 auto; color: #0b2a40; background: #fff; box-shadow: inset 0 0 0 2px #c9e2ee; }
.setup .seg button.on { color: #fff; background: linear-gradient(180deg, #3cc2a8, #1f8f86); box-shadow: 0 3px 0 #11585a; }
.setup .btn.ghost { color: #0b2a40; background: #fff; box-shadow: inset 0 0 0 2px #c9e2ee; }
.setup .btn.big { width: 100%; padding: 0.85rem 1.2rem; font-size: 1.15rem; margin-top: 0.6rem; background: linear-gradient(180deg, #ffb24a, #e0782b); box-shadow: 0 4px 0 #8f4410; }
.setup:not(.is-local) .local-only { display: none; }
.setup.is-local .ai-only { display: none; }
.setup.is-online .offline-only, .setup.is-online .local-only { display: none; }
.setup:not(.is-online) .online-only { display: none; }
.role-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; }
.role-pick button { display: grid; justify-items: center; gap: 0.25rem; padding: 0.7rem 0.5rem 0.75rem; border: 0; border-radius: 16px; cursor: pointer; text-align: center; color: #0b2a40; background: #fff; box-shadow: inset 0 0 0 2px #c9e2ee; transition: transform 0.15s, box-shadow 0.15s; }
.role-pick button:hover { transform: translateY(-2px); }
.role-pick button.on { background: #fff; box-shadow: inset 0 0 0 3px var(--rc), 0 0 0 3px rgba(60, 194, 168, 0.25); }
.role-pick img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 14%; background: var(--rc); box-shadow: 0 0 0 3px var(--rc); }
.role-pick b { font-size: 0.98rem; }
.role-pick small { font-size: 0.8rem; line-height: 1.3; color: #4d6c7e; }
.setup .rrow { background: #fff; box-shadow: inset 0 0 0 2px #c9e2ee, inset 5px 0 0 var(--rc); }
.setup .rrow small { color: #4d6c7e; }
.setup .rrow input { background: #f1f8fc; box-shadow: inset 0 0 0 2px #c9e2ee; }
.setup .ol-game { background: #fff; box-shadow: inset 0 0 0 2px #c9e2ee; }
.setup .ol-game.mine, .setup .ol-game.invite { background: #fff8e1; box-shadow: inset 0 0 0 2px #f0b429; }
.setup .ol-who small { color: #4d6c7e; }
.setup .ol-new input { background: #fff; box-shadow: inset 0 0 0 2px #c9e2ee; }
.setup .ol-you { color: #b06a00; }
@media (prefers-reduced-motion: reduce) { .hero-snow i { animation: none; } }
@media (max-width: 640px) {
  .role-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-pick img { width: 54px; height: 54px; }
}

/* ---------------- game top bar (same layout as the other games) */
.topbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.6rem 1.4rem; padding: 0.65rem 1.2rem; margin-bottom: 1rem;
  background: linear-gradient(180deg, rgba(16, 52, 78, 0.97), rgba(7, 26, 42, 0.97)); border-bottom: 3px solid #04121e; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.brand-logo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px #8fe3d3, 0 4px 10px rgba(0, 0, 0, 0.5); flex: none; }
.brand h1 { margin: 0; font-size: 1.5rem; line-height: 1; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 0 18px rgba(120, 230, 210, 0.4); white-space: nowrap; }
.brand small { display: block; font-size: 0.8rem; color: #bfe3f0; margin-top: 0.2rem; }
.top-mid { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.day-meter { display: flex; align-items: center; gap: 0.7rem; }
.dm-label { white-space: nowrap; font-size: 0.95rem; }
.dm-label b { font-family: "Lilita One", sans-serif; font-size: 1.2rem; color: #8fe3d3; }
.dm-bar { flex: 1; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; max-width: 360px; }
.dm-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8fe3d3, #9fb7ff, #ff8a7a); transition: width 0.4s ease; }
.top-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.top-chips .chip { font-size: 0.82rem; padding: 0.22rem 0.6rem; }
.top-actions { display: flex; gap: 0.5rem; }
.top-actions .btn { white-space: nowrap; display: inline-flex; align-items: center; }
.top-actions .gh-dice { width: 1.2rem; height: 1.2rem; vertical-align: -0.2em; }
@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0.6rem 0.8rem; }
  .top-mid { grid-column: 1 / -1; grid-row: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; }
}
@media (max-width: 560px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); gap: 0.45rem 0.5rem; padding: 0.5rem 0.65rem; margin-bottom: 0.6rem; }
  .brand { gap: 0.4rem; }
  .brand-logo { width: 30px; height: 30px; box-shadow: 0 0 0 2px #8fe3d3; }
  .brand h1 { font-size: 1.05rem; }
  .brand small { display: none; }
  .top-actions { grid-row: 1; grid-column: 2; justify-content: flex-end; gap: 0.25rem; }
  .top-actions .bt { display: none; }
  .top-actions .btn { width: 31px; height: 31px; padding: 0; justify-content: center; font-size: 0.95rem; box-shadow: none; }
  .top-mid { grid-row: 2; }
}
@media (max-width: 360px) { .brand-logo { display: none; } }

/* ---------------- rulebook (same layout as the other games' rulebooks) */
.modal-back { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; padding: 1rem; background: rgba(3, 12, 22, 0.75); backdrop-filter: blur(3px); }
.modal { position: relative; width: min(600px, 100%); max-height: 92vh; overflow-y: auto; color: #0b2a40; border-radius: 20px; padding: 1.3rem 1.4rem;
  background: linear-gradient(180deg, #f7fcff, #e8f4fa); box-shadow: 0 0 0 3px #0b2a40, 0 0 0 6px #3cc2a8, 0 24px 60px rgba(0, 0, 0, 0.6); animation: pop 0.3s cubic-bezier(.34, 1.56, .64, 1) both; }
.modal-back.wide .modal { width: min(900px, 100%); }
.modal h2 { margin: 0 0 0.6rem; padding-right: 2.4rem; font-size: 1.7rem; color: #0b2a40; }
.modal-x { position: absolute; top: 0.6rem; right: 0.7rem; border: 0; background: rgba(11, 42, 64, 0.08); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem; color: #0b2a40; z-index: 2; }
.modal-x:hover { background: rgba(11, 42, 64, 0.16); }
.modal .btn.ghost { color: #0b2a40; background: #fff; box-shadow: inset 0 0 0 2px #c9e2ee; }
.rules-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.8rem; }
.rules-tabs button { border: 0; border-radius: 999px; padding: 0.35rem 0.75rem; cursor: pointer; font-weight: 600; background: #fff; box-shadow: inset 0 0 0 2px #c9e2ee; color: #0b2a40; }
.rules-tabs button.on { color: #fff; background: linear-gradient(180deg, #3cc2a8, #1f8f86); box-shadow: none; }
.rules-body p, .rules-body li { line-height: 1.5; color: #173b52; }
.rules-body table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 0.5rem 0; }
.rules-body th, .rules-body td { text-align: left; padding: 0.35rem 0.45rem; border-bottom: 1px solid #c9e2ee; }
.rules-body th { color: #1f5b73; }
.rulebook { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.rb-toc { position: sticky; top: 0; flex-direction: column; flex-wrap: nowrap; gap: 0.25rem; margin: 0; }
.rb-toc-head { font-family: "Lilita One", sans-serif; font-weight: 400; letter-spacing: 0.03em; font-size: 1.05rem; color: #4d6c7e; padding: 0 0.3rem 0.2rem; }
.rb-toc button { text-align: left; border-radius: 10px; padding: 0.4rem 0.6rem; display: flex; gap: 0.45rem; align-items: baseline; }
.rb-toc button span { font-variant-numeric: tabular-nums; color: #4d6c7e; min-width: 1.2em; }
.rb-toc button.on span { color: #e3faf4; }
.rb-ch { margin: 0 0 0.6rem; font-size: 1.75rem; color: #0b2a40; border-bottom: 3px solid #0b2a40; padding-bottom: 0.35rem; }
.rb-ch small { display: block; font-family: "Fredoka", sans-serif; font-size: 0.8rem; font-weight: 600; color: #4d6c7e; letter-spacing: 0.08em; text-transform: uppercase; }
.rb-sec { margin: 1rem 0 0.35rem; font-family: "Lilita One", sans-serif; font-weight: 400; font-size: 1.25rem; letter-spacing: 0.02em; color: #0b2a40; }
.rb-sec span { color: #1f8f86; margin-right: 0.25rem; }
.rb-flow { padding-left: 1.3rem; display: grid; gap: 0.3rem; }
.rb-flow li::marker { font-weight: 800; color: #1f8f86; }
.rb-ex { padding: 0.55rem 0.8rem; border-left: 4px solid #3c86c9; background: rgba(60, 134, 201, 0.1); border-radius: 0 10px 10px 0; font-size: 0.94rem; }
.rb-terms { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 0.9rem; margin: 0.4rem 0; }
.rb-terms dt { font-weight: 700; color: #0b2a40; }
.rb-terms dd { margin: 0; color: #173b52; }
.rb-nav { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 1.2rem; padding-top: 0.8rem; border-top: 2px solid #c9e2ee; }
.rb-crew { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin: 0.7rem 0; }
.rb-crew figure { margin: 0; text-align: center; font-weight: 700; font-size: 0.85rem; }
.rb-crew img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: 50% 14%; background: var(--rc); box-shadow: 0 0 0 3px var(--rc); display: block; margin: 0 auto 0.35rem; }
.rb-role { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 0.9rem; align-items: center; }
.rb-role img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: 50% 14%; background: var(--rc); box-shadow: 0 0 0 3px var(--rc); }
.rb-place { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0.8rem; align-items: center; margin: 0.5rem 0; }
.rb-place img { width: 96px; height: 76px; object-fit: contain; }
.rb-place p { margin: 0.15rem 0 0; }
.rb-storm img { object-fit: cover; border-radius: 10px; box-shadow: 0 0 0 2px #c9e2ee; }
@media (max-width: 700px) {
  .rulebook { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  .rb-toc { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.2rem; }
  .rb-toc-head { display: none; }
  .rb-toc button { flex: 0 0 auto; white-space: nowrap; }
  .rb-terms { grid-template-columns: 1fr; gap: 0.1rem; }
  .rb-terms dd { margin-bottom: 0.4rem; }
  .rb-crew { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rb-nav .btn { font-size: 0.8rem; }
}

/* ---------------- turn guidance */
.yourturn { margin-top: 0.7rem; padding: 0.5rem 0.75rem; border-radius: 12px; font-family: "Lilita One", sans-serif; font-size: 1.15rem; letter-spacing: 0.02em; color: #052033; background: linear-gradient(180deg, #ffe08a, #ffc94a); box-shadow: 0 3px 0 #b8860b; }
.act-h { margin: 0.9rem 0 0.1rem; font-size: 1rem; color: #8fe3d3; }
.act-h small { font-family: "Fredoka", sans-serif; font-size: 0.8rem; font-weight: 500; color: rgba(222, 240, 255, 0.7); letter-spacing: 0; }
.act.walk span { display: grid; gap: 0.1rem; }
.act.walk em { font-style: normal; font-size: 0.8rem; font-weight: 500; color: rgba(222, 240, 255, 0.72); }
.step { display: flex; align-items: center; gap: 0.5rem; margin: 0.15rem 0; }
.step b { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: rgba(255, 255, 255, 0.15); font-size: 0.85rem; flex: none; }
.step.done b { background: #3cc2a8; color: #052033; }
.node.go .lbl { background: #ffd76a; }
.node.go .lbl::after { content: " · walk here"; font-weight: 600; }
