/* The timeline names use ⊦ and subscript digits, and neither Space Grotesk
   nor DM Mono contains any of them. Rather than fall through to whatever the
   machine has, both are built from Space Grotesk's own digits and its own
   OS/2 subscript metrics by tools/make_marks_font.py, so the fork mark is a
   subscript to the same degree as the numbers beside it. One face per weight,
   about 1.4 KB each, reached per character from behind the real face. */
@font-face {
  font-family: 'Chrono Marks';
  src: url('assets/fonts/chrono-marks-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Chrono Marks';
  src: url('assets/fonts/chrono-marks-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #080b17;
  --panel: rgba(16, 21, 39, .86);
  --panel-edge: rgba(137, 155, 209, .16);
  --muted: #a9b2ca;
  --text: #f2f4ff;
  --cyan: #50e5e1;
  --violet: #a68bff;
  --pink: #ff7bc2;
  --mono: 'DM Mono', 'Chrono Marks', monospace;
  --sans: 'Space Grotesk', 'Chrono Marks', sans-serif;
}
* { box-sizing: border-box; }
/* Form controls do not inherit font-family: left alone a button renders in the
   browser's own UI font, which is how every timeline card and history-row
   label ended up set in Arial. That is wrong on its own, and it also broke the
   timeline names, because Arial has the subscript digits but not U+22A6, so
   the fork mark alone fell through to a system font and came back full height
   next to subscript-sized numbers. Only the family is inherited; each control
   keeps the size and weight it sets for itself. */
button, input, select, textarea { font-family: inherit; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--sans); overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0; z-index: -2; opacity: .38; background-image: linear-gradient(rgba(115,131,186,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(115,131,186,.055) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, black, transparent 92%); }
.space-glow { position: fixed; pointer-events: none; border-radius: 50%; filter: blur(90px); opacity: .17; z-index: -1; }
.glow-a { width: 440px; height: 440px; background: #3b50f2; left: 21%; top: 22%; }
.glow-b { width: 360px; height: 360px; background: #6d2fb5; right: 4%; top: 50%; opacity: .12; }
.app-shell { width: min(1560px, 100%); min-height: 100vh; margin: auto; padding: 0 34px; display: flex; flex-direction: column; }
.topbar { height: 78px; flex: none; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(145,160,205,.12); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #e8ebff; text-decoration: none; font-weight: 700; letter-spacing: .13em; font-size: 13px; }
.brand-light { color: #7782aa; font-weight: 500; margin-left: 4px; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 8px); grid-template-rows: repeat(2, 8px); gap: 2px; transform: rotate(-8deg); }
.brand-mark i { display: block; background: var(--cyan); border-radius: 2px; box-shadow: 0 0 10px #50e5e188; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: #8f88ff; box-shadow: 0 0 10px #8f88ff88; }
.top-status { display: flex; align-items: center; gap: 9px; color: #a1aac7; font: 12px var(--mono); letter-spacing: .12em; }
.live-dot, .legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.app-shell.paused .live-dot { background: #ffc267; box-shadow: 0 0 10px #ffc267; }
.status-divider { width: 1px; height: 14px; margin: 0 5px; background: #39415d; }
.mono { font-family: var(--mono); }
.top-actions { display: flex; align-items: center; gap: 7px; }
.icon-button { width: 33px; height: 33px; border: 1px solid #363d5b; border-radius: 8px; background: #151a2d; color: #bbc3e2; font-size: 20px; cursor: pointer; transition: .2s; }
.icon-button:hover { color: var(--cyan); border-color: var(--cyan); transform: rotate(-25deg); }
.pause-button { font-size: 14px; font-weight: 700; }
.pause-button:hover { transform: none; }

/* --- sound controls ------------------------------------------------------ */
.volume-control { display: flex; align-items: center; gap: 8px; height: 33px; padding: 0 9px 0 4px; border: 1px solid #2e3552; border-radius: 9px; background: rgba(17,22,40,.7); }
.volume-button { width: 26px; height: 26px; border: 0; background: none; display: grid; place-items: center; padding: 0; }
.volume-button:hover { transform: none; border-color: transparent; }
.volume-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.volume-button .speaker-cone { fill: currentColor; stroke-width: 1.2; }
.volume-button .speaker-slash { opacity: 0; transition: opacity .16s; }
.volume-button.muted { color: #6f7898; }
.volume-button.muted .speaker-wave { opacity: 0; }
.volume-button.muted .speaker-slash { opacity: 1; stroke: #ff7b95; }
.volume-slider { -webkit-appearance: none; appearance: none; width: 86px; height: 4px; border-radius: 3px; background: linear-gradient(90deg, var(--cyan), #6f7ce8); cursor: pointer; outline-offset: 4px; }
.volume-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #e9edff; border: 2px solid #0b1020; box-shadow: 0 0 9px rgba(80,229,225,.55); cursor: pointer; }
.volume-slider::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #e9edff; border: 2px solid #0b1020; box-shadow: 0 0 9px rgba(80,229,225,.55); cursor: pointer; }
.volume-control:has(.volume-button.muted) .volume-slider { background: #39415d; }
.start-screen { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; overflow-y: auto; padding: 24px; background: radial-gradient(ellipse at 50% 43%, rgba(36,47,103,.42), transparent 58%), rgba(5,8,18,.82); backdrop-filter: blur(11px); }
.start-screen.hidden { display: none; }
.start-card { position: relative; width: min(610px, 100%); overflow: hidden; padding: clamp(26px, 5vw, 48px); border: 1px solid rgba(143,160,224,.24); border-radius: 18px; background: linear-gradient(145deg, rgba(18,24,45,.97), rgba(9,13,27,.97)); box-shadow: 0 30px 100px rgba(0,0,0,.5), 0 0 60px rgba(85,101,231,.12); }
.start-card::before { content: ''; position: absolute; width: 280px; height: 280px; top: -190px; right: -130px; border-radius: 50%; background: var(--violet); opacity: .18; filter: blur(70px); pointer-events: none; }
.start-brand { display: flex; align-items: center; gap: 11px; color: #e8ebff; font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.start-eyebrow { margin: 35px 0 12px; color: var(--cyan); font: 11px var(--mono); letter-spacing: .18em; }
.start-title { margin: 0; font-size: clamp(38px, 7vw, 62px); line-height: .98; letter-spacing: -.065em; font-weight: 600; }
.start-title span { color: transparent; background: linear-gradient(95deg, #a99aff 8%, #64e8e0 80%); background-clip: text; -webkit-background-clip: text; }
.start-copy { max-width: 460px; margin: 18px 0 24px; color: #a4aecb; font-size: 13px; line-height: 1.7; }
.start-features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.start-feature { display: flex; align-items: center; gap: 11px; min-height: 62px; padding: 10px 12px; border: 1px solid rgba(139,155,211,.14); border-radius: 9px; background: rgba(12,17,33,.7); }
.start-feature-key { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: #d0c3ff; background: rgba(166,139,255,.14); font: 12px var(--mono); }
.start-feature:nth-child(2) .start-feature-key { color: #8ff1ec; background: rgba(80,229,225,.12); }
.start-feature strong, .start-feature span { display: block; }
.start-feature strong { color: #e3e7fb; font-size: 13px; font-weight: 600; }
.start-feature div span { margin-top: 4px; color: #a8b2ce; font-size: 11px; }
.start-button { display: flex; justify-content: space-between; align-items: center; width: 100%; height: 48px; padding: 0 16px; border: 1px solid rgba(131,232,228,.4); border-radius: 8px; color: #07151c; background: linear-gradient(100deg, #68e6df, #8ce3bd); font: 600 13px var(--sans); cursor: pointer; box-shadow: 0 8px 30px rgba(80,229,225,.13); transition: transform .18s, box-shadow .18s; }
.start-button:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(80,229,225,.22); }
.start-button span { font-size: 20px; }
.start-footnote { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; color: #a2adcb; font-size: 11px; }
.start-footnote kbd { min-width: 18px; height: 18px; padding: 0 4px; font-size: 10px; }
.start-footnote > span { color: #8792b0; margin: 0 2px; }
.travel-modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; transition: padding .28s ease; background: rgba(4,7,16,.78); backdrop-filter: blur(12px); }
.travel-modal.hidden { display: none; }
.travel-modal-card { transition: transform .28s ease; }
.travel-modal.previewing { padding-left: 372px; padding-right: 372px; }
.travel-preview { position: fixed; z-index: 31; top: 22px; right: 22px; width: min(326px, 92vw); max-height: calc(100vh - 44px); display: flex; flex-direction: column; gap: 6px; padding: 18px; overflow: auto; border: 1px solid rgba(143,160,224,.34); border-radius: 14px; background: linear-gradient(160deg,#18203c,#0a0f21); box-shadow: -20px 0 60px rgba(0,0,0,.5); transform: translateX(calc(100% + 26px)); transition: transform .28s ease; }
.travel-preview.shown { transform: none; }
.travel-preview[hidden] { display: none; }
.source-preview { left: 22px; right: auto; transform: translateX(calc(-100% - 26px)); border-color: rgba(158,137,255,.34); box-shadow: 20px 0 60px rgba(0,0,0,.5); }
.displacement-note { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 7px 9px; border-radius: 7px; background: rgba(158,137,255,.1); color: #9aa4c1; font: 10px var(--mono); letter-spacing: .08em; }
.displacement-note b { font-weight: 400; }
.displacement-note .depart b { color: #ffbf73; }
.displacement-note .arrive b { color: var(--cyan); }
.trajectory { margin: 0 0 16px; padding: 12px 14px; border: 1px dashed rgba(158,137,255,.38); border-radius: 9px; background: rgba(158,137,255,.07); }
.trajectory[hidden] { display: none; }
.trajectory-title { margin-bottom: 8px; color: #c6b8ff; font: 10px var(--mono); letter-spacing: .14em; }
.trajectory-line { display: flex; align-items: center; gap: 10px; padding: 3px 0; color: #dce5ff; font: 12px var(--sans); }
.trajectory-end { flex: 0 0 132px; color: #9aa4c1; font: 11px var(--mono); }
.trajectory-line .trajectory-end:last-child { flex: 1 1 auto; text-align: right; }
.trajectory-piece canvas { display: block; width: 58px; height: 34px; }
.trajectory-arrow { color: #9e89ff; font: 13px var(--mono); letter-spacing: -.08em; }
.trajectory-line.reverse .trajectory-arrow { color: var(--cyan); }
.trajectory-note { margin-top: 8px; color: #8f9ab8; font-size: 11px; }

.travel-preview h3 { font-size: 19px; color: #e8ecff; }
.preview-close { top: 10px; right: 10px; }
.preview-label { color: #9aa4c1; font: 11px var(--mono); letter-spacing: .08em; }
.preview-body { display: flex; gap: 12px; margin-top: 10px; }
.preview-body canvas { display: block; }
.preview-body > canvas { width: 180px; height: 360px; border: 1px solid rgba(131,149,201,.2); border-radius: 8px; background: #080c18; }
.preview-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.preview-slot { padding: 6px; border: 1px solid rgba(131,149,201,.17); border-radius: 8px; background: rgba(16,21,39,.85); }
.preview-slot canvas { width: 74px; height: 50px; }
.preview-slot .queue-canvas { height: 34px; opacity: .72; border-top: 1px solid rgba(131,149,201,.12); }
.preview-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 12px 0 10px; }
.preview-stats div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 6px; background: rgba(80,229,225,.06); }
.preview-stats dt { color: #8f9ab8; font: 10px var(--mono); letter-spacing: .1em; }
.preview-stats dd { color: #dce5ff; font: 11px var(--mono); }
.preview-confirm { margin-top: 4px; width: 100%; }
.start-button .confirm-label { font: 600 13px var(--sans); }
@media (max-width: 1240px) {
  .travel-modal.previewing { padding-left: 330px; padding-right: 330px; }
  .travel-preview { width: min(292px, 46vw); }
  .preview-body > canvas { width: 150px; height: 300px; }
  .preview-slot canvas { width: 62px; }
}
/* Below this the card cannot hold the trajectory between two panels, so the
   board you are leaving gives up its panel and stays on the trajectory. */
@media (max-width: 1010px) {
  .source-preview { display: none; }
  .travel-modal.previewing { padding-left: 20px; }
}
@media (max-width: 780px) {
  .travel-preview { top: auto; left: 12px; right: 12px; bottom: 12px; width: auto; max-height: 72vh; transform: translateY(calc(100% + 18px)); }
  .preview-body > canvas { width: 180px; height: 360px; }
  .travel-modal.previewing { padding-right: 20px; }
}
.travel-modal-card { position: relative; width: min(900px,100%); max-height: min(760px,calc(100vh - 40px)); overflow: auto; padding: 28px; border: 1px solid rgba(143,160,224,.3); border-radius: 16px; background: linear-gradient(145deg,#161d38,#0b1022); box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.modal-close { position:absolute; top:14px; right:16px; width:30px; height:30px; border:0; background:transparent; color:#9da8c7; font-size:24px; cursor:pointer; }
.travel-modal-card h2 { font-size:24px; }
.modal-copy { color:#96a1c1; font-size:12px; margin:8px 0 20px; }
.modal-history { position:relative; max-height:430px; min-height:248px; overflow:auto; border:1px solid rgba(128,145,192,.14); border-radius:8px; background:rgba(6,10,21,.58); cursor:grab; scrollbar-color:#3d4567 #11172a; scrollbar-width:thin; }
.modal-history:active { cursor:grabbing; }
.modal-map-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:2px 0 7px; }
.modal-map-hint { margin:0; color:#8e99bb; font:10px var(--mono); letter-spacing:.1em; }
.board-search { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:14px 0 4px; padding:9px 11px; border:1px solid var(--panel-edge); border-radius:10px; background:rgba(8,13,27,.55); }
.search-label { margin:0; color:#cbd3ef; font:500 10px var(--mono); letter-spacing:.16em; }
.search-hint { display:block; margin-top:3px; color:#7d87a8; letter-spacing:.06em; text-transform:none; }
.search-pieces { display:flex; gap:5px; flex-wrap:wrap; }
.search-piece { padding:4px 5px; border:1px solid rgba(126,145,199,.22); border-radius:7px; background:#080d1c; cursor:pointer; transition:.15s; }
.search-piece:hover { border-color:rgba(166,139,255,.55); }
.search-piece canvas { display:block; width:30px; height:20px; }
.search-piece[aria-pressed="true"] { border-color:var(--chip); background:#101733; box-shadow:0 0 0 1px var(--chip), 0 0 12px -2px var(--chip); }
.search-count { margin-left:auto; color:#8e99bb; font:500 10px var(--mono); font-variant-numeric:tabular-nums; letter-spacing:.1em; }
.history-map.searching .history-node:not(.search-hit) { opacity:.22; }
.history-map .history-node.search-hit { opacity:1; border-color:var(--hit); box-shadow:0 0 0 1px var(--hit), 0 0 16px -3px var(--hit); }
.map-tools { display:flex; align-items:center; gap:9px; }
/* The zoom and transfer controls travel with the map when it expands, so
   the group that holds them is separate from the button that expands it. */
.history-tools { display:flex; align-items:center; gap:9px; }
.history-dialog-heading #history-map-tools { margin-left:auto; }
.map-zoom { display:flex; align-items:center; gap:2px; padding:2px; border:1px solid #2e3552; border-radius:8px; background:rgba(17,22,40,.7); }
.zoom-step { width:24px; height:24px; display:grid; place-items:center; border:0; border-radius:6px; background:transparent; color:#bbc3e2; font:600 15px var(--sans); line-height:1; cursor:pointer; transition:.15s; }
.zoom-step:hover:not(:disabled) { background:#1d2442; color:var(--cyan); }
.zoom-step:disabled { opacity:.3; cursor:default; }
/* Labelled, because a lone glyph does not say what it turns off. The label
   names the thing; the pressed state says whether it is showing. */
.transfers-toggle { width:auto; height:28px; display:inline-flex; align-items:center; gap:6px; padding:0 9px; border:1px solid #2e3552; border-radius:8px; background:rgba(17,22,40,.7); font-size:13px; }
.transfers-toggle .toggle-label { font:10px var(--mono); letter-spacing:.12em; text-transform:uppercase; }
.transfers-toggle[aria-pressed="true"] { color:var(--cyan); border-color:rgba(80,229,225,.45); }
.transfers-toggle[aria-pressed="false"] { color:#6f7898; }
/* Put the transfer plates away without touching the routes they sit on. */
.history-map.hide-transfers .travel-tag, .history-map.hide-transfers .travel-drift { display:none; }
.zoom-level { min-width:38px; text-align:center; color:#9aa5c6; font:500 10px var(--mono); font-variant-numeric:tabular-nums; }
.map-expand { width:30px; height:30px; font-size:15px; line-height:1; }
.map-expand:hover { transform:none; }
.travel-modal.maximized .travel-modal-card { width:min(1680px,100%); height:calc(100vh - 40px); max-height:calc(100vh - 40px); display:flex; flex-direction:column; }
.travel-modal.maximized .travel-modal-card > * { flex:none; }
.travel-modal.maximized .modal-history { flex:1 1 auto; max-height:none; min-height:0; }
.modal-timeline { padding:13px; border:1px solid rgba(130,149,205,.18); border-radius:10px; background:rgba(8,13,27,.62); }
.modal-timeline.selected { border-color:var(--cyan); box-shadow:inset 3px 0 var(--cyan); }
.modal-timeline-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; color:#e4e8ff; font-size:12px; }
.modal-timeline-head span { color:#a2adcb; font:11px var(--mono); }
.modal-checkpoints { display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; }
.modal-checkpoint { flex:0 0 78px; padding:4px; border:1px solid rgba(126,145,199,.2); border-radius:6px; background:#080d1c; color:#a9b3cf; cursor:pointer; font:10px var(--mono); }
.modal-checkpoint:hover,.modal-checkpoint.selected { border-color:var(--violet); color:#ded5ff; }
.modal-checkpoint canvas { display:block; width:68px; height:74px; margin-bottom:4px; }
.modal-selection { display:flex; justify-content:space-between; gap:14px; margin:18px 0; padding:11px 13px; border-radius:8px; background:rgba(80,229,225,.07); color:#a8b2ce; font:11px var(--mono); }
.modal-selection strong { color:#dce5ff; font:13px var(--sans); }
.modal-actions { display:flex; justify-content:flex-end; gap:9px; align-items:center; }
.help-button { display:inline-flex; align-items:center; gap:7px; height:33px; padding:0 11px; border:1px solid #3c4568; border-radius:8px; background:#151a2d; color:#cbd3ef; font:12px var(--sans); cursor:pointer; transition:.18s; }
.help-button:hover { color:var(--cyan); border-color:rgba(80,229,225,.5); }
.start-howto { display:block; width:100%; margin-top:10px; padding:10px; border:1px solid rgba(139,155,211,.2); border-radius:8px; background:rgba(12,17,33,.7); color:#b6c0df; font:12px var(--sans); cursor:pointer; transition:.18s; }
.start-howto:hover { color:var(--cyan); border-color:rgba(80,229,225,.4); }
.howto-card { width:min(820px,100%); }
.howto-card .modal-copy { margin-bottom:22px; }
.howto-section { padding:15px 0; border-top:1px solid rgba(128,145,192,.14); }
.howto-section h3 { margin:0 0 8px; color:#e6ebff; font-size:14px; font-weight:600; letter-spacing:-.01em; }
.howto-section p { margin:0 0 9px; color:#b4bdd8; font-size:13px; line-height:1.65; }
.howto-section p:last-child { margin-bottom:0; }
.howto-section strong { color:#e9edff; font-weight:600; }
.howto-section em { color:#d5dcf6; font-style:normal; text-decoration:underline; text-decoration-color:rgba(166,139,255,.5); text-underline-offset:3px; }
.howto-section kbd { margin:0 2px; }
.howto-section.danger h3 { color:#ff9db0; }
.howto-keys { display:grid; grid-template-columns:repeat(3,1fr); gap:9px 16px; }
.howto-keys span { display:flex; align-items:center; gap:6px; color:#a8b2ce; font-size:12px; }
.howto-card .modal-actions { margin-top:20px; }
@media (max-width:650px) { .howto-keys { grid-template-columns:1fr 1fr; } }
.modal-confirm { width:220px; height:40px; }
.game-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(215px, 250px) minmax(380px, 1fr) minmax(270px, 330px); gap: 28px; align-items: start; padding: 27px 0 23px; }
.left-rail, .right-rail { display: flex; flex-direction: column; gap: 17px; }
.panel { background: linear-gradient(145deg, rgba(20,26,47,.91), rgba(13,17,32,.88)); border: 1px solid var(--panel-edge); border-radius: 14px; box-shadow: 0 14px 46px rgba(0,0,0,.2); }
.timeline-panel { padding: 18px 15px 14px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0 0 6px; color: #a8b2ce; font: 11px var(--mono); letter-spacing: .17em; }
h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.count-badge { display: inline-grid; place-items: center; width: 21px; height: 21px; margin-left: 5px; border-radius: 6px; background: rgba(80,229,225,.12); color: var(--cyan); font: 13px var(--mono); vertical-align: 2px; }
.orbit-icon, .pulse-icon { color: var(--violet); font-size: 24px; line-height: 1; }
.panel-copy { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 11px 0 14px; }
.timeline-list { display: flex; flex-direction: column; gap: 8px; max-height: 350px; overflow-y: auto; padding: 1px 3px 1px 0; }
.timeline-card { width: 100%; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 10px; text-align: left; padding: 9px; border-radius: 9px; border: 1px solid rgba(128,145,192,.14); color: #b1bad7; background: rgba(18,23,42,.68); cursor: pointer; transition: .18s; }
.timeline-card:hover { border-color: rgba(153,172,234,.38); transform: translateY(-1px); }
.timeline-card.sealed { opacity: .5; cursor: not-allowed; border-style: dashed; border-color: rgba(255,113,141,.32); background: rgba(24,16,26,.6); }
.timeline-card.sealed:hover { transform: none; border-color: rgba(255,113,141,.32); }
.timeline-card.sealed .timeline-meta { color: #ff8fa4; }
.history-row-label:disabled { cursor: not-allowed; }
.sealed-label { color: #ff8fa4; }
.timeline-card.selected { border-color: rgba(80,229,225,.55); background: linear-gradient(100deg, rgba(80,229,225,.12), rgba(22,29,51,.76)); box-shadow: inset 2px 0 var(--cyan), 0 0 22px rgba(80,229,225,.05); }

/* --- timelines still owing a lock before travel recharges ---------------- */
:root { --charge-amber: #ffc267; }
.timeline-card { position: relative; }
.timeline-card.needs-lock { border-color: rgba(255,194,103,.46); background: linear-gradient(100deg, rgba(255,194,103,.09), rgba(22,29,51,.76)); }
.timeline-card.needs-lock:hover { border-color: rgba(255,194,103,.7); }
.timeline-state { white-space: nowrap; }
.timeline-card.needs-lock .timeline-state { color: var(--charge-amber); }
.timeline-card.needs-lock.selected { border-color: rgba(255,194,103,.6); background: linear-gradient(100deg, rgba(80,229,225,.11), rgba(255,194,103,.09) 62%, rgba(22,29,51,.76)); box-shadow: inset 2px 0 var(--cyan), 0 0 22px rgba(255,194,103,.09); }
.charge-pip { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--charge-amber); box-shadow: 0 0 9px rgba(255,194,103,.85); animation: charge-pulse 1.8s ease-in-out infinite; }
.timeline-card.sealed .charge-pip { opacity: .55; }
@keyframes charge-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.72); } }
.history-row.needs-lock .history-row-label { box-shadow: inset 2px 0 rgba(255,194,103,.65); }
@media (prefers-reduced-motion: reduce) { .charge-pip { animation: none; } }
.timeline-preview { width: 42px; height: 48px; border-radius: 5px; background: #080c18; border: 1px solid rgba(130,151,203,.15); }
/* Same reasoning as the map's lane labels: the name carries the timeline's
   whole ancestry in subscripts, so it is the one thing on the card that has
   to be readable without leaning in. */
.timeline-name { display: block; color: #e3e7fa; font-size: 18px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.timeline-meta { display: block; margin-top: 5px; color: #a2adcb; font: 11px var(--mono); }
.timeline-clock { text-align: right; font: 11px var(--mono); color: #a9b3cf; }
.timeline-clock small { display: block; margin-top: 5px; color: #8e9ab9; font-size: 10px; }
.timeline-legend { margin-top: 13px; color: #a2adcb; font: 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 6px; height: 6px; }
.controls-panel { padding: 17px 15px 15px; }
.controls-panel .eyebrow { margin-bottom: 13px; }
.control-row { display: flex; align-items: center; gap: 5px; min-height: 29px; color: #b7bfd8; font-size: 12px; }
.control-row span { margin-left: 4px; margin-right: 7px; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid #39415e; border-bottom-width: 2px; border-radius: 5px; background: #171d33; color: #c3cbea; font: 11px var(--mono); white-space: nowrap; }
.control-footnote { color: #98a2c0; font-size: 11px; line-height: 1.5; margin: 11px 0 0; }
.control-footnote kbd { height: 16px; min-width: 17px; font-size: 10px; }
.play-column { min-width: 0; display: flex; flex-direction: column; align-items: center; }
.board-heading { width: min(100%, 500px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; padding: 0 1px 16px; gap: 22px; }
.board-title-line { display: flex; align-items: center; gap: 9px; }
h1 { margin: 0; font-size: 31px; line-height: 1.1; letter-spacing: -.045em; font-weight: 600; }
.time-chip { padding: 4px 7px; border-radius: 5px; border: 1px solid rgba(166,139,255,.22); background: rgba(166,139,255,.1); color: #bcaaff; font: 11px var(--mono); }
.board-stats { display: flex; align-items: end; gap: 24px; text-align: right; }
.board-stats div { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.stat-label { color: #aab5d4; font: 11px var(--mono); letter-spacing: .11em; white-space: nowrap; }
.board-stats strong { color: #ffffff; font: 700 23px var(--mono); line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(166,139,255,.22); }
.board-stats small { color: #b8c2df; font: 12px var(--mono); line-height: 1.2; white-space: nowrap; }
.board-stats > div:first-child { min-width: 232px; padding: 8px 11px; border: 1px solid rgba(166,139,255,.28); border-radius: 8px; background: linear-gradient(135deg, rgba(115,83,208,.16), rgba(18,24,45,.5)); }
.board-stats > div:last-child strong { font-size: 21px; }
.board-stage { display: flex; align-items: flex-start; justify-content: center; gap: 11px; width: 100%; }

/* --- jump cinema: push in on the board, play, pull back --------------- */
.app-shell > *, .game-layout > *, .play-column > *, .board-stage > * { transition: opacity .42s ease, filter .42s ease; }
.board-frame { transition: transform .42s cubic-bezier(.2,.75,.25,1), opacity .42s ease, filter .42s ease; }
.jump-cinema .board-frame { transform: scale(1.12); z-index: 20; }
.jump-cinema .app-shell > *:not(.game-layout),
.jump-cinema .game-layout > *:not(.play-column),
.jump-cinema .play-column > *:not(.board-stage),
.jump-cinema .board-stage > *:not(.board-frame) { opacity: .2; filter: blur(2.5px); }
.jump-vignette { position: fixed; inset: 0; z-index: 12; pointer-events: none; opacity: 0; transition: opacity .42s ease; background: radial-gradient(ellipse at 50% 46%, rgba(4,7,16,0) 14%, rgba(4,7,16,.8) 66%); }
.jump-cinema .jump-vignette { opacity: 1; }
/* A jump is something happening, so the board must not wear its paused face. */
.app-shell.jump-live .pause-overlay { display: none !important; }
.app-shell.jump-live.paused .live-dot { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

/* --- an open modal owns the scroll ------------------------------------ */
body.modal-open { overflow: hidden; }
.travel-modal, .travel-modal-card, .modal-history, .howto-card { overscroll-behavior: contain; }

.board-frame { position: relative; padding: 7px; border-radius: 9px; border: 1px solid rgba(132,153,213,.27); background: linear-gradient(140deg, #171e36, #0c1020 60%); box-shadow: 0 0 0 4px rgba(71,87,144,.045), 0 22px 70px rgba(0,0,0,.42), 0 0 35px rgba(96,124,223,.09); }
#game-canvas { display: block; width: min(300px, calc((100vh - 280px) * .5)); height: auto; max-height: calc(100vh - 290px); background: #080c17; border-radius: 3px; }
.next-rail { display: flex; flex-direction: column; gap: 9px; padding-top: 1px; }
.mini-piece-box { width: 101px; min-height: 91px; padding: 8px 6px 4px; border: 1px solid rgba(131,149,201,.17); border-radius: 8px; background: rgba(16,21,39,.85); }
.mini-piece-box:first-child { min-height: 77px; }
.mini-label { display: flex; justify-content: space-between; align-items: center; color: #a2adcb; font: 10px var(--mono); letter-spacing: .1em; }
.mini-label kbd { min-width: 16px; width: 16px; height: 16px; padding: 0; font-size: 10px; }
.mini-piece-box canvas { display: block; width: 88px; height: 66px; }
.next-box { min-height: 0; }
.mini-piece-box .queue-canvas { width: 88px; height: 39px; opacity: .72; border-top: 1px solid rgba(131,149,201,.12); }
.drop-hint { width: min(100%, 430px); padding: 10px 2px 0; color: #a2adcb; font-size: 12px; display: flex; align-items: flex-start; gap: 4px; }
.hint-star { color: #9e89ff; line-height: 1.45; }
.hint-end { margin-left: auto; color: #9aa4c1; font: 11px var(--mono); line-height: 1.45; white-space: nowrap; }
.hint-end b { color: var(--cyan); font-weight: 400; }
.instability-warning { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.45; }
.warn-row { color: #ffbf73; }
.warn-row.critical { color: #ff718d; animation: instability-blink 1s ease-in-out infinite; }
#score-meta { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: 4px 16px; width: 100%; margin-top: 2px; text-align: left; font: 12px var(--mono); }
#score-meta span { color: #98a2c0; font-size: 10px; letter-spacing: .1em; }
#score-meta b { justify-self: end; color: #dfe5ff; font-weight: 500; font-variant-numeric: tabular-nums; }
#score-meta .need { color: #ff8fa4; }
@keyframes instability-blink { 50% { opacity: .45; } }
.howto-panel { margin-bottom: 20px; padding: 18px; }
.howto-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px 22px; margin-top:15px; }
.howto-grid p { margin:0; color:#b0b9d4; font-size:12px; line-height:1.55; }
.howto-grid strong { color:#e2e7ff; font-size:13px; }
@media (max-width: 650px) { .howto-grid { grid-template-columns:1fr 1fr; gap:12px; } }
.board-overlay { position: absolute; inset: 7px; background: rgba(6,9,19,.83); backdrop-filter: blur(5px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border-radius: 3px; }
.board-overlay.hidden { display: none; }
.pause-overlay { z-index: 2; background: rgba(6,9,19,.58); backdrop-filter: blur(2px); }
.pause-overlay p { max-width: 190px; margin: -3px 0 3px; color: #a4afce; text-align: center; font-size: 12px; line-height: 1.5; }
.pause-overlay .small-button { display: inline-flex; align-items: center; gap: 9px; }
.pause-overlay .small-button kbd { height: 16px; min-width: 16px; }
.overlay-kicker { color: var(--pink); font: 11px var(--mono); letter-spacing: .18em; }
.board-overlay strong { font-size: 20px; letter-spacing: .04em; }
.board-overlay p { max-width: 250px; margin: -2px 0 5px; color: #b6c0df; text-align: center; font-size: 13px; line-height: 1.5; }
.temporal-forced { z-index: 5; background: rgba(10,5,18,.97); animation: temporal-shake .18s ease-in-out 5; border: 1px solid rgba(255,113,141,.75); box-shadow: inset 0 0 35px rgba(255,62,107,.2), 0 0 30px rgba(255,62,107,.22); }
.temporal-forced .overlay-kicker { color: #ff718d; }
.temporal-forced strong { max-width: 100%; overflow: hidden; font-size: clamp(18px, 8vw, 30px); color: #fff; white-space: nowrap; letter-spacing: 0; text-shadow: 0 0 22px rgba(255,113,141,.75); font-variant-numeric: tabular-nums; }
.temporal-forced .small-button { display: none; }
@keyframes temporal-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes temporal-pulse { 0% { opacity: 0; } 12% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
.small-button { padding: 8px 10px; background: #171e37; border: 1px solid #4d577d; color: #c6cee8; border-radius: 6px; font: 12px var(--sans); cursor: pointer; }
.right-rail { gap: 13px; }
.travel-panel { padding: 18px 15px 14px; }
.travel-panel h2 { font-size: 15px; }
.field-label { display: block; margin: 15px 0 6px; color: #a2adcb; font: 10px var(--mono); letter-spacing: .12em; }
.select-control { width: 100%; height: 34px; padding: 0 9px; border-radius: 6px; border: 1px solid rgba(130,148,201,.22); background: #10162a; color: #cbd2eb; font: 12px var(--sans); outline: none; }
.select-control:focus { border-color: var(--violet); }
.jump-card { margin-top: 13px; padding: 11px 10px 10px; border-radius: 9px; background: rgba(10,14,27,.58); border: 1px solid rgba(134,150,205,.15); }
.time-card { border-top: 1px solid rgba(166,139,255,.35); }
.multi-card { border-top: 1px solid rgba(80,229,225,.33); }
.jump-top { display: flex; gap: 9px; align-items: center; }
.jump-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; font: 12px var(--mono); }
.time-icon { color: #c2aeff; background: rgba(166,139,255,.13); }
.multi-icon { color: #82f2ed; background: rgba(80,229,225,.12); }
.jump-top h3 { margin: 0; font-size: 13px; font-weight: 600; }
.jump-top p { margin: 3px 0 0; color: #a2adcb; font-size: 11px; }
.jump-card .field-label { margin-top: 12px; }
.jump-button { margin-top: 9px; width: 100%; height: 32px; padding: 0 8px 0 10px; display: flex; justify-content: space-between; align-items: center; border-radius: 6px; cursor: pointer; font: 12px var(--sans); transition: .18s; }
.jump-button:disabled { cursor: not-allowed; opacity: .42; filter: grayscale(.3); }
.time-button { border: 1px solid rgba(166,139,255,.3); color: #d4c8ff; background: rgba(115,83,208,.15); }
.time-button:not(:disabled):hover { background: rgba(115,83,208,.28); box-shadow: 0 0 18px rgba(166,139,255,.12); }
.multi-button { border: 1px solid rgba(80,229,225,.26); color: #abf7f1; background: rgba(35,144,146,.13); }
.multi-button:not(:disabled):hover { background: rgba(35,144,146,.25); box-shadow: 0 0 18px rgba(80,229,225,.1); }
.jump-button kbd { min-width: 19px; height: 19px; background: rgba(5,10,22,.35); border-color: rgba(165,182,231,.25); color: inherit; }
.sync-readout { display: flex; align-items: center; gap: 6px; margin-top: 11px; color: #a4aecc; font-size: 11px; }
.sync-lamp { width: 6px; height: 6px; border-radius: 50%; background: #65708c; }
.sync-lamp.synced { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.sync-lamp.desynced { background: #ffb66c; box-shadow: 0 0 8px #ffb66c; }
.sync-readout .mono { margin-left: auto; color: #9aa6c7; font-size: 10px; }
.charge-box { margin-top: 15px; padding: 11px 10px 0; border-top: 1px solid rgba(139,155,204,.13); }
.charge-heading { display: flex; justify-content: space-between; color: #a8b2ce; font: 10px var(--mono); letter-spacing: .1em; }
.charge-heading .mono { color: var(--cyan); }
.charge-track { height: 4px; margin: 9px 0 7px; border-radius: 5px; background: #252c44; overflow: hidden; }
.charge-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #49d8dc, #948aff); transition: width .25s ease; }
.charge-caption { margin: 0; color: #98a2c0; font-size: 11px; line-height: 1.45; }
.rule-panel { padding: 13px 15px; }
.rule-panel .eyebrow { margin-bottom: 7px; }
.rule-panel p:last-child { color: #b2bbd6; font-size: 11px; line-height: 1.5; margin: 0; }
.bottom-bar { flex: none; min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid rgba(145,160,205,.12); color: #98a2c0; font: 10px var(--mono); letter-spacing: .08em; }
.bottom-bar b { color: #aeb8d4; font-weight: 400; }
.bottom-bar i { color: var(--violet); font-style: normal; margin: 0 4px; }
.message { text-align: right; color: #b0b9d4; letter-spacing: 0; font: 11px var(--sans); max-width: 34%; }
.message.flash { color: var(--cyan); }
.history-panel { flex: none; margin: 0 0 14px; padding: 14px 15px 12px; overflow: hidden; }
.history-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding-bottom: 10px; }
.history-heading h2 { font-size: 15px; }
.history-guide { color: #a2adcb; font: 11px var(--mono); }
.history-guide-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 8px rgba(166,139,255,.7); }
.guide-separator { color: #6d7896; padding: 0 5px; }
.history-scroll { position: relative; overflow: auto; max-height: 300px; min-height: 112px; border: 1px solid rgba(128,145,192,.14); border-radius: 8px; background: rgba(6,10,21,.58); cursor: grab; scrollbar-color: #3d4567 #11172a; scrollbar-width: thin; }
.history-scroll:active { cursor: grabbing; }
/* Both maps are dragged to pan, so a drag must not start selecting the
   labels and captions it passes over, or pick a board up as an image. */
.history-scroll, .modal-history { user-select: none; -webkit-user-select: none; }
.history-scroll canvas, .modal-history canvas { -webkit-user-drag: none; pointer-events: none; }
.history-map { position: relative; min-height: 120px; width: max-content; padding: 0 12px 10px 0; }
.history-axis, .history-row { display: grid; grid-template-columns: 156px auto; }
.axis-label { position: sticky; left: 0; z-index: 4; background: #0b1020; }
.static-label, .static-label:disabled { cursor: default; }
.history-axis { height: 24px; align-items: end; color: #98a3c2; font: 10px var(--mono); }
.axis-label { padding-left: 12px; padding-bottom: 4px; color: #939fbf; letter-spacing: .12em; }
.axis-track { position: relative; height: 24px; }
.axis-tick { position: absolute; bottom: 3px; transform: translateX(-50%); white-space: nowrap; }
.axis-tick::after { content: ''; position: absolute; left: 50%; top: 13px; height: 5px; border-left: 1px solid #3e4764; }
.history-row { position: relative; min-height: 83px; }
.history-row-label { position: sticky; left: 0; z-index: 4; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 4px 7px 5px 12px; border: 0; border-bottom: 1px solid rgba(117,134,182,.12); border-right: 1px solid rgba(117,134,182,.18); background: #0b1020; color: #e0e5f8; text-align: left; cursor: pointer; }
.history-row-label:hover .row-name { color: var(--cyan); }
/* The lane name is what identifies the timeline, and its ancestry is written
   in subscripts, so it has to survive being read at a glance. The column is
   widened to match rather than letting a deep name ellipsise away. */
.row-name { max-width: 136px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.row-meta { margin-top: 5px; color: #9aa4c2; font: 11px var(--mono); }
.row-live { display: inline-block; margin-top: 5px; color: var(--cyan); font: 11px var(--mono); letter-spacing: .1em; }
.row-live + .row-live { margin-top: 2px; }
.row-live { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-live.needs-label { color: var(--charge-amber); }
.history-row-track { position: relative; min-height: 83px; border-bottom: 1px solid rgba(117,134,182,.12); }
.history-row-track::before { content: ''; position: absolute; top: var(--lane-y, 40px); left: 18px; right: 22px; height: 1px; background: linear-gradient(90deg, rgba(126,142,191,.18), rgba(126,142,191,.08)); }
.history-row.current .history-row-track::before { background: linear-gradient(90deg, rgba(80,229,225,.38), rgba(126,142,191,.08)); }
/* --- a collapsed timeline: on the map, and plainly gone ----------------- */
/* Dim enough to read as closed, light enough to still read. The boards are
   the record of what that timeline did, which is the reason to keep it. */
.history-row.collapsed .history-row-track { opacity: .86; }
/* Hatched over, the way a closed road is. */
.history-row.collapsed .history-row-track::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(-45deg, rgba(255,113,141,.11) 0 6px, transparent 6px 15px);
}
/* Its lane is broken rather than drawn through. */
.history-row.collapsed .history-row-track::before {
  background: repeating-linear-gradient(90deg, rgba(255,113,141,.55) 0 7px, transparent 7px 15px);
}
.history-row.collapsed .history-node {
  filter: grayscale(.55) brightness(.82);
  border-color: rgba(255,113,141,.45) !important;
  box-shadow: none !important;
  cursor: not-allowed;
}
.history-row.collapsed .history-node:hover { transform: translateX(-50%); }
.history-row.collapsed .history-row-label {
  box-shadow: inset 3px 0 rgba(255,113,141,.85);
  background: linear-gradient(90deg, rgba(40,12,22,.96), #0b1020 70%);
}
.history-row.collapsed .row-name { color: #ff9fb1; text-decoration: line-through; text-decoration-color: rgba(255,113,141,.6); }
.lost-label { color: #ff7b95 !important; font-weight: 600; letter-spacing: .14em; }
.history-node { position: absolute; z-index: 1; top: 5px; width: 62px; height: 73px; padding: 3px 4px 2px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; border: 1px solid rgba(120,138,187,.23); border-radius: 6px; background: rgba(14,19,35,.96); color: #a6b0cd; cursor: pointer; transform: translateX(-50%); transition: .15s; }
.history-node:hover:not(:disabled) { border-color: rgba(166,139,255,.65); transform: translateX(-50%) translateY(-2px); color: #d6cbff; }
.history-node:disabled { cursor: default; opacity: .65; }
.history-node.selected-destination { border-color: var(--violet); box-shadow: 0 0 14px rgba(166,139,255,.18); color: #d6cbff; }
.history-node.live-node { border-color: rgba(80,229,225,.42); }
.history-node canvas { display: block; width: 48px; height: auto; aspect-ratio: 4 / 5; flex: none; border-radius: 0; }
/* Zoomed out past reading a board: marks in the lane's colour, and labels
   reduced to their names so the rows can close up. */
.history-map.compact .history-node { padding: 0; border-radius: 2px; opacity: .85; }
.history-map.compact .history-node.selected-destination,
.history-map.compact .history-node.search-hit { opacity: 1; }
.history-map.compact .row-meta, .history-map.compact .row-live { display: none; }
.history-map.compact .row-name { font-size: 10px; max-width: 118px; }
.history-map.compact .history-row-label { padding: 2px 6px 2px 10px; }
.history-node span { font: inherit; line-height: 1.2; flex: none; }
.branch-svg { position: absolute; z-index: 3; pointer-events: none; overflow: visible; }
.route-casing { fill: none; stroke: #060a15; stroke-width: 5; stroke-opacity: .8; stroke-linecap: round; }
.split-line { fill: none; stroke-width: 1.6; stroke-opacity: .75; stroke-dasharray: 3 4; }
.split-pip { fill-opacity: .55; }
.travel-line { fill: none; stroke-width: 2; stroke-opacity: .95; stroke-linecap: round; }
/* A route into time nothing was recorded at: it fades out where the map ends. */
.travel-void { stroke-dasharray: 2 7; stroke-opacity: .8; }
.void-mark circle { fill: none; stroke-width: 1.4; stroke-opacity: .85; stroke-dasharray: 2.4 2.6; }
.void-mark line { stroke-width: 1.4; stroke-opacity: .6; }
.travel-tag .travel-plate { fill: #0c1122; }
.travel-tag text { font: 600 13px var(--mono); letter-spacing: .06em; }
.travel-tag .travel-plate { stroke-width: 1.4; stroke-opacity: .9; }
/* The direction of a jump, so it carries its own dark edge and reads over
   whatever board it happens to be crossing. */
.travel-chevron { fill: none; stroke-width: 2.6; stroke-opacity: 1; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 2.5px rgba(6,10,21,.95)); }
.travel-drift { font: 600 10px var(--mono); letter-spacing: .12em; paint-order: stroke; stroke: #060a15; stroke-width: 3px; stroke-linejoin: round; }
.map-key { display: inline-flex; align-items: center; gap: 5px; }
.map-key i { display: inline-block; width: 17px; border-top: 2px solid currentColor; }
.key-split { color: #93a0c8; }
.key-split i { border-top-style: dashed; }
.key-time { color: #ffd166; }
.key-multi { color: #7ef0ff; }
.key-transfer { color: #c8b6ff; }
.key-transfer i { width:auto; border-top:0; font-style:normal; font-size:12px; line-height:1; }

@media (max-width: 650px) {
  .history-panel { width: 100%; padding: 12px 9px 9px; }
  .history-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .history-guide { font-size: 10px; }
  .history-scroll { max-height: 260px; }
  .history-axis, .history-row { grid-template-columns: 104px auto; }
  .history-map { padding-right: 8px; }
  .history-node { width: 56px; }
}

/* Travel consoles are workspaces, not dialogs: give the map the whole viewport
   and let the destination/trajectory controls float above it. */
#travel-modal,
#travel-modal.previewing { padding: 0; place-items: stretch; }
#travel-modal > .travel-modal-card,
#travel-modal.maximized > .travel-modal-card {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 30px 30px 24px;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 20%, #182342 0%, #0b1022 58%, #070b16 100%);
}
#travel-modal > .travel-modal-card > .modal-history { flex: 1 1 auto; min-height: 0; max-height: none; }
#travel-modal > .travel-modal-card > .modal-selection,
#travel-modal > .travel-modal-card > .trajectory,
#travel-modal > .travel-modal-card > .modal-actions {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  box-shadow: 0 0 34px rgba(4,7,16,.5);
}
#travel-modal > .travel-modal-card > .modal-selection { margin: 10px 0 0; }
#travel-modal > .travel-modal-card > .trajectory { margin: 10px 0 0; }
#travel-modal > .travel-modal-card > .modal-actions { margin-top: 10px; }
/* Frontier alignment drops the whole branch overlay, so every key goes with
   it and the hint is left saying only what the map is now showing. */
.travel-modal.multi-mode .modal-map-hint .map-key,
.travel-modal.multi-mode .modal-map-hint .guide-separator { display: none; }
.travel-modal.multi-mode .modal-map-hint::before {
  content: 'CURRENT BOARDS ALIGNED'; color: var(--cyan); font-weight: 600;
}
.travel-modal.multi-mode .history-row.current .history-row-track::before {
  height: 2px;
  background: linear-gradient(90deg, rgba(80,229,225,.16), rgba(80,229,225,.9), rgba(80,229,225,.16));
  box-shadow: 0 0 10px rgba(80,229,225,.28);
}
.travel-modal.multi-mode .history-row.current .live-node {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(80,229,225,.35), 0 0 18px rgba(80,229,225,.18);
}
@media (max-width: 650px) {
  #travel-modal > .travel-modal-card,
  #travel-modal.maximized > .travel-modal-card { padding: 22px 12px 14px; }
}
@media (max-width: 1120px) {
  .app-shell { padding: 0 20px; }
  .game-layout { grid-template-columns: 210px minmax(340px,1fr) 280px; gap: 16px; }
  .next-rail { gap: 6px; }
  .mini-piece-box { width: 86px; }
  .mini-piece-box canvas { width: 74px; }
}
@media (max-width: 900px) {
  .game-layout { grid-template-columns: minmax(190px, .75fr) minmax(350px, 1.25fr); }
  .right-rail { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .travel-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .travel-panel > .section-heading, .travel-panel > .field-label, .travel-panel > #target-timeline, .travel-panel > .charge-box { grid-column: 1 / -1; }
  .jump-card { margin-top: 9px; }
  #game-canvas { width: min(300px, calc((100vh - 350px) * .5)); }
}
@media (max-width: 650px) {
  .start-screen { padding: 14px; }
  .start-card { padding: 25px 21px; border-radius: 14px; }
  .start-eyebrow { margin-top: 27px; }
  .start-copy { font-size: 12px; }
  .start-features { gap: 7px; }
  .start-feature { gap: 8px; padding: 8px; }
  .start-feature div span { font-size: 10px; }
  .start-footnote { gap: 4px; font-size: 10px; }
  .app-shell { padding: 0 12px; }
  .topbar { height: 58px; }
  .volume-slider { width: 54px; }
  .volume-control { gap: 6px; padding: 0 7px 0 3px; }
  .top-status { font-size: 10px; gap: 6px; }
  .brand { font-size: 12px; gap: 7px; }
  .brand-mark { transform: scale(.82) rotate(-8deg); }
  .game-layout { display: flex; flex-direction: column; gap: 13px; padding: 16px 0; }
  .play-column { order: 0; width: 100%; }
  .left-rail { order: 1; width: 100%; }
  .right-rail { order: 2; width: 100%; display: flex; }
  .timeline-panel { width: 100%; }
  .timeline-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
  .timeline-card { grid-template-columns: 34px minmax(0,1fr); gap: 7px; padding: 7px; }
  .timeline-preview { width: 34px; height: 38px; }
  .timeline-clock { display: none; }
  .controls-panel { display: grid; grid-template-columns: repeat(2,1fr); gap: 0 8px; }
  .controls-panel .eyebrow, .control-footnote { grid-column: 1 / -1; }
  .board-heading, .drop-hint { width: min(100%, 440px); }
  .board-heading { gap: 10px; }
  .board-stats { gap: 8px; }
  .board-stats > div:first-child { min-width: 0; padding: 6px 7px; }
  .board-stats strong { font-size: 17px; }
  .board-stats small { font-size: 10px; }
  .board-stage { gap: 8px; }
  #game-canvas { width: min(64vw, 300px); max-height: none; }
  .next-rail { flex-direction: column; }
  .mini-piece-box { width: 78px; min-height: 81px; }
  .mini-piece-box canvas { width: 64px; }
  .bottom-bar { flex-wrap: wrap; padding: 8px 0; font-size: 9px; }
  .message { max-width: 100%; width: 100%; text-align: left; }
}
