:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --ink: #eaf2f3; --muted: #819ba6; --cyan: #78dbd6; --amber: #f3c77d; --green: #96e3b8; --line: #9abdc11b; }
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 12% 0, #16303960, transparent 58%), #091216; }
button, input { font: inherit; }
button { cursor: pointer; transition: background .15s, border-color .15s; }
button:active { transform: translateY(1px); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
[hidden] { display: none !important; }
.app { width: min(1460px, calc(100% - 56px)); height: 100vh; height: 100dvh; min-height: 730px; margin: auto; padding: 22px 0 13px; display: flex; flex-direction: column; gap: 11px; }
.masthead { display: flex; align-items: center; gap: 32px; padding-bottom: 7px; flex-shrink: 0; }
.identity { display: flex; align-items: center; gap: 12px; }
.dock-mark { width: 45px; height: 53px; padding: 1px; border: 1px solid #78dbd62e; border-radius: 9px; }
h1 { font-size: 44px; line-height: .92; margin: 0; font-weight: 800; letter-spacing: -.08em; }
h1 span { color: var(--cyan); }
.eyebrow { margin: 8px 0 0; color: var(--muted); font-size: 7px; letter-spacing: .18em; font-weight: 700; }
.brand-logo { display: block; position: relative; width: 100px; height: 49px; overflow: hidden; opacity: .5; margin-right: auto; }
.brand-logo img { position: absolute; width: 132px; height: auto; max-width: none; left: -16px; top: -9px; filter: invert(1); mix-blend-mode: screen; }
.brand-logo:hover { opacity: .9; }
.scoreboard { display: flex; align-items: stretch; gap: 29px; margin-left: auto; }
.scoreboard > div { min-width: 50px; }
.scoreboard span { display: block; color: var(--muted); font-size: 8px; font-weight: 650; letter-spacing: .12em; }
.scoreboard strong { display: block; margin-top: 5px; font-size: 29px; font-weight: 550; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.scoreboard > div:first-child strong { color: var(--cyan); }
.scoreboard .watch-clock { padding-left: 24px; border-left: 1px solid var(--line); }
.time-track { height: 2px; background: #ffffff0e; margin-top: 6px; }
.time-track i { display: block; width: 100%; height: 100%; background: var(--cyan); transform-origin: left; }
.watch-clock.urgent strong { color: var(--amber); }
.watch-clock.urgent i { background: var(--amber); }
.game-shell { flex: 1 1 auto; min-height: 440px; display: flex; flex-direction: column; border: 1px solid #668c973b; border-radius: 12px; overflow: hidden; background: #102026; box-shadow: 0 20px 70px #0005; }
.chart-header { min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 19px; border-bottom: 1px solid var(--line); background: #111e24; }
.mission-pill { display: flex; align-items: center; gap: 9px; font-size: 9px; letter-spacing: .12em; color: #c5d9d9; font-weight: 650; }
.status-led { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px #96e3b840; }
.chart-label { color: #718c94; font-size: 8px; letter-spacing: .12em; white-space: nowrap; }
.chart-label > span { margin-left: 18px; color: #bbd1d3; }
.challenge-pill { display: flex; align-items: center; gap: 8px; color: var(--amber); font-size: 8px; letter-spacing: .07em; margin-left: auto; }
.challenge-pill strong { font-size: 16px; letter-spacing: -.04em; }
.challenge-pill small { font-size: 8px; color: #a29b84; }
.challenge-pill.beaten, .challenge-pill.beaten small { color: var(--green); }
.board-wrap { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #102a34; }
canvas { display: block; width: 100%; height: 100%; object-fit: contain; outline-offset: -3px !important; }
.chart-key { position: absolute; bottom: 12px; left: 16px; pointer-events: none; display: flex; gap: 13px; padding: 6px 8px; border-radius: 3px; background: #0a1b2380; color: #8facb4; font-size: 6px; letter-spacing: .08em; }
.chart-key span { display: flex; align-items: center; gap: 5px; }
.chart-key i { display: inline-block; width: 5px; height: 5px; border: 1px solid #dce4df; }
.chart-key span:nth-child(2) i { border-color: var(--green); background: #96e3b83a; }
.bridge-console { display: grid; grid-template-columns: minmax(180px, .85fr) minmax(150px, .72fr) minmax(260px, 1.45fr); gap: 30px; padding: 13px 20px; min-height: 87px; border-top: 1px solid var(--line); background: #111e24; }
.telemetry { display: flex; gap: 24px; }
.telemetry > div { white-space: nowrap; }
.telemetry span { display: block; color: var(--muted); font-size: 8px; letter-spacing: .13em; margin-bottom: 1px; }
.telemetry strong { font-size: 23px; font-weight: 550; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.telemetry small { color: #8ca7ab; margin-left: 4px; font-size: 9px; }
.stop-readout { display: block; margin-top: 4px; color: #8ba5ab; font-size: 7px; letter-spacing: .07em; }
.stop-readout strong { color: #9fb6b8; font-size: 8px; font-weight: 500; letter-spacing: 0; margin-left: 6px; }
.engine-panel { padding-top: 2px; }
.engine-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 8px; color: var(--muted); letter-spacing: .1em; }
.engine-row strong { font-size: 8px; font-weight: 650; color: var(--cyan); }
.engine-track { height: 6px; margin: 12px 0 13px; position: relative; background: #ffffff08; border-radius: 2px; }
.engine-track > i { position: absolute; top: 0; height: 100%; left: 50%; width: 0; background: var(--cyan); }
.engine-track > b { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: #b1c6c359; }
.rudder-row { display: flex; align-items: center; gap: 9px; color: #708d98; font-size: 6px; letter-spacing: .1em; }
.rudder-track { position: relative; flex: 1; height: 2px; background: #526c7455; }
.rudder-track::after { content: ''; position: absolute; top: -2px; bottom: -2px; left: 50%; width: 1px; background: #8ca19b70; }
.rudder-track i { position: absolute; height: 6px; width: 4px; top: -2px; left: 50%; margin-left: -2px; background: var(--amber); z-index: 1; }
.docking-panel { border-left: 1px solid var(--line); padding-left: 26px; }
.docking-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.docking-heading > span { color: #c8ded8; font-size: 9px; letter-spacing: .04em; font-weight: 650; }
.docking-heading strong { font-size: 17px; font-weight: 550; white-space: nowrap; color: var(--green); }
.docking-heading small { font-size: 6px; color: var(--muted); letter-spacing: .1em; }
.docking-checks { display: flex; justify-content: space-between; gap: 8px; color: #93aab0; font-size: 7px; letter-spacing: .06em; }
.docking-checks span::before { content: ''; display: inline-block; width: 4px; height: 4px; border: 1px solid #526d77; margin-right: 4px; border-radius: 50%; }
.docking-checks span.met { color: var(--green); }
.docking-checks span.met::before { border-color: var(--green); background: var(--green); }
.berth-progress { background: #96e3b814; height: 3px; margin-top: 9px; border-radius: 2px; overflow: hidden; }
.berth-progress i { display: block; width: 100%; height: 100%; background: var(--green); transform: scaleX(0); transform-origin: left; }
.tug-status { flex-shrink: 0; border-top: 1px solid var(--line); background: #172228; color: #baa579; font-size: 8px; font-weight: 650; letter-spacing: .08em; padding: 8px 20px; }
.tug-status.ready { color: var(--amber); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.statusline { color: #7e99a1; font-size: 9px; line-height: 1.5; }
.toolbar button { color: #c1d3d6; font-size: 10px; background: none; border: 0; padding: 5px 0 5px 12px; white-space: nowrap; }
.toolbar button span { color: var(--cyan); margin-left: 12px; }
footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; min-height: 45px; gap: 8px 35px; color: #92a9b0; font-size: 9px; flex-shrink: 0; }
.control-group { display: grid; gap: 4px; }
.control-group > strong { font-size: 6px; font-weight: 650; letter-spacing: .15em; color: #647f87; }
.control-group p { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
kbd { display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 4px; border: 1px solid #8ca2a327; border-bottom-width: 2px; border-radius: 4px; color: #c6d9dc; background: #d1e7e805; font-family: inherit; font-weight: 500; font-size: 9px; }
.history { flex-shrink: 0; padding-top: 11px; border-top: 1px solid var(--line); font-size: 10px; color: #819ba4; }
.history summary { display: flex; justify-content: space-between; cursor: pointer; list-style: none; }
.history summary::-webkit-details-marker { display: none; }
.history summary > span:first-child { font-size: 8px; letter-spacing: .13em; }
.history summary > span:last-child { font-size: 9px; }
.history summary b { margin-left: 16px; font-weight: 500; color: var(--cyan); }
.history ol { max-height: 95px; overflow: auto; line-height: 1.9; padding-left: 24px; margin: 8px 0 0; }
#storage-status { font-size: 10px; color: var(--amber); margin: 0; }
#storage-status:empty { display: none; }
.overlay { position: absolute; inset: 0; z-index: 4; display: flex; padding: 20px; overflow-y: auto; background: #06131ca3; backdrop-filter: blur(5px); }
.overlay.hidden { display: none; }
.card { flex: 0 0 auto; width: min(510px, 100%); margin: auto; padding: 25px 30px 21px; border: 1px solid #96b7bc35; border-radius: 12px; background: linear-gradient(125deg, #1a3039f7, #0d1e26fc); box-shadow: 0 24px 70px #0007; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-top .eyebrow { margin: 0; font-size: 7px; letter-spacing: .13em; }
.watch-badge { color: var(--amber); font-size: 7px; letter-spacing: .1em; white-space: nowrap; }
.card h2 { font-size: clamp(30px, 3.1vw, 43px); font-weight: 650; line-height: 1.02; letter-spacing: -.05em; margin: 19px 0 13px; }
.card h2 span { color: var(--cyan); }
.card > p:not(.hint):not(.share-hint) { color: #a0b7bf; font-size: 11px; line-height: 1.65; margin: 0 0 19px; }
.mode-picker { border: 0; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mode-picker legend { font-size: 7px; font-weight: 700; color: #9db5bc; letter-spacing: .14em; margin-bottom: 10px; }
.mode-picker label { cursor: pointer; position: relative; }
.mode-picker input { position: absolute; top: 15px; left: 11px; width: 11px; height: 11px; margin: 0; accent-color: var(--cyan); }
.mode-picker label > span { display: block; padding: 12px 11px 12px 31px; border: 1px solid #8eafb52b; border-radius: 6px; background: #0a1a2150; }
.mode-picker label:has(input:checked) > span { border-color: #78dbd680; background: #78dbd60b; }
.mode-picker label:has(input:focus-visible) > span { outline: 2px solid var(--cyan); outline-offset: 3px; }
.mode-picker strong { display: block; font-weight: 600; font-size: 11px; }
.mode-picker b { float: right; color: var(--cyan); font-weight: 500; }
.mode-picker small { display: block; font-size: 8px; color: #809ca7; margin-top: 5px; }
.card > .mode-help { min-height: 34px; font-size: 10px !important; line-height: 1.55 !important; margin-bottom: 15px !important; }
.briefing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; border-top: 1px solid var(--line); padding: 13px 0 18px; }
.briefing strong { color: #cbe4df; font-size: 18px; font-weight: 550; }
.briefing span { display: block; color: #6d909b; font-size: 6px; letter-spacing: .05em; margin-top: 3px; }
.overlay-actions { display: flex; flex-direction: column; gap: 8px; }
.primary { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border: 1px solid transparent; border-radius: 6px; background: var(--cyan); color: #0e2a2f; font-size: 12px; font-weight: 750; }
.primary:hover { background: #a0eeea; }
.primary.secondary, .share-button { border: 1px solid #8eafb531; background: #ffffff05; color: #b2cbd2; font-size: 10px; padding: 10px 16px; border-radius: 6px; }
.primary.secondary:hover, .share-button:hover { background: #ffffff0b; }
.card .hint { font-size: 8px; color: #78949e; line-height: 1.6; text-align: center; margin: 12px 0; }
.quick-controls { display: flex; justify-content: center; gap: 17px; font-size: 8px; color: #89a4ad; }
.quick-controls kbd { min-width: 19px; height: 20px; margin-right: 2px; font-size: 8px; }
.round-summary { display: flex; gap: 12px; justify-content: space-around; border: 1px solid #96e3b825; border-radius: 6px; padding: 12px; margin-bottom: 16px; font-size: 9px; color: #8caaa9; }
.round-summary strong { display: block; color: var(--green); font-size: 20px; font-weight: 550; }
.share-hint { color: #8ca8b2; font-size: 9px; line-height: 1.5; }
.toast { position: absolute; top: 17px; left: 50%; z-index: 5; transform: translate(-50%, -6px); opacity: 0; pointer-events: none; max-width: calc(100% - 30px); padding: 11px 18px; border: 1px solid #90c4be5c; border-radius: 7px; background: #091c24ed; text-align: center; color: #c3d7d7; font-size: 11px; box-shadow: 0 10px 35px #0005; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast strong { color: var(--cyan); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-height: 950px) { .app { gap: 14px; padding-top: 28px; padding-bottom: 18px; } .masthead { padding-bottom: 10px; } }
@media (max-width: 1000px) { .brand-logo { display: none; } .masthead { gap: 20px; } .scoreboard { gap: 22px; } .bridge-console { gap: 20px; padding-left: 15px; padding-right: 15px; } .docking-panel { padding-left: 18px; } }
@media (max-height: 800px) and (min-width: 701px) {
  .app { min-height: 620px; padding-top: 10px; padding-bottom: 7px; gap: 7px; }
  .masthead { padding-bottom: 2px; } h1 { font-size: 36px; } .dock-mark { height: 44px; width: 38px; }
  .scoreboard strong { font-size: 25px; } .scoreboard span { font-size: 7px; } .time-track { margin-top: 4px; }
  .game-shell { min-height: 390px; } .chart-header { min-height: 32px; } .bridge-console { min-height: 74px; padding-top: 8px; padding-bottom: 8px; }
  footer { min-height: 34px; gap: 8px 28px; font-size: 8px; } .control-group > strong { font-size: 6px; } .history { padding-top: 8px; }
  .card { padding: 19px 25px 16px; } .card h2 { font-size: 31px; margin-top: 14px; margin-bottom: 10px; }
  .card > p:not(.hint):not(.share-hint) { margin-bottom: 12px; } .card .hint { margin: 9px 0; }
  .briefing { padding: 9px 0 12px; } .mode-picker { margin-bottom: 8px; }
}
@media (max-width: 760px) {
  .app { width: calc(100% - 24px); min-height: 860px; padding-top: 14px; }
  .masthead { flex-wrap: wrap; } .scoreboard { gap: 18px; } .scoreboard .watch-clock { padding-left: 16px; }
  .chart-label { display: none; } .mission-pill { font-size: 8px; letter-spacing: .04em; }
  .bridge-console { grid-template-columns: 1fr 1fr; gap: 13px 20px; padding: 11px 14px; }
  .docking-panel { grid-column: 1 / -1; padding-left: 0; padding-top: 10px; border-left: 0; border-top: 1px solid var(--line); }
  .docking-heading { margin-bottom: 6px; } .docking-checks { justify-content: flex-start; gap: 16px; }
  .game-shell { min-height: 560px; } .telemetry { gap: 25px; } .telemetry strong { font-size: 22px; }
  .chart-key { display: none; } footer { gap: 10px 22px; }
}
@media (max-width: 480px) {
  .app { width: calc(100% - 18px); min-height: 940px; gap: 9px; }
  h1 { font-size: 35px; } .masthead { gap: 16px; } .identity .eyebrow { font-size: 6px; }
  .scoreboard { flex: 1; justify-content: space-between; gap: 12px; }
  .scoreboard strong { font-size: 22px; } .scoreboard span { font-size: 6px; }
  .game-shell { min-height: 600px; } .chart-header { padding: 9px 12px; flex-wrap: wrap; }
  .challenge-pill { margin-left: 0; } .bridge-console { gap: 12px; }
  .overlay { padding: 12px; } .card { padding: 20px 17px; } .card-top .eyebrow { font-size: 6px; }
  .card h2 { font-size: 32px; } .mode-picker label > span { padding-left: 28px; } .mode-picker strong { font-size: 10px; }
  .mode-picker small { font-size: 7px; } .mode-picker b { display: none; }
  .quick-controls { gap: 10px; } .statusline { font-size: 8px; } footer { justify-content: flex-start; font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Shared collection navigation inside the game menu. */
.card .games-navigation { margin-top: 18px; border-top: 1px solid #ffffff20; padding-top: 15px; }
.card .games-navigation a { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid #ffffff30; border-radius: 8px; color: #eef5ed; background: #ffffff08; text-decoration: none; font-size: 13px; font-weight: 600; }
.card .games-navigation a:hover { background: #ffffff16; border-color: #ffffff60; }
.card .menu-credit { margin-top: 14px; color: #aab9bc; text-align: center; font-size: 10px; line-height: 1.6; }
.card .menu-credit a { color: #d6e1df; text-underline-offset: 3px; }
