@font-face {
  font-family: "Barlow Condensed";
  src: url("./art/barlow-condensed-black-italic.ttf") format("truetype");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #091e25;
  --deck: #102a32;
  --ivory: #f6edda;
  --orange: #ff8647;
  --mint: #a6c6bb;
  --line: #355058;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", system-ui, sans-serif;
  color: var(--ivory);
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse at 64% 28%, #15333a, var(--ink) 72%);
}
button {
  font: inherit; cursor: pointer; color: inherit; background: none; border: 0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button:focus-visible, canvas:focus-visible { outline: 3px solid #f9ce89; outline-offset: 3px; }
button:active { filter: brightness(.91); }
[hidden] { display: none !important; }
button, h1, h2, p { margin: 0; }
.symbols, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; pointer-events: none; }
.dock {
  width: min(1240px, 100%); margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) clamp(16px, 5vw, 70px) max(28px, env(safe-area-inset-bottom));
}
.mast { display: flex; align-items: center; justify-content: space-between; min-height: 62px; margin-bottom: 12px; }
.brand, .mast-actions, .guide-button, .icon-button, .cover-meta, .cover-meta span, .cover-tag, .signal-bars, .outfit-heading,
.primary, .choice, .in-clock, .crew-stat, .steer, .rig-trigger, .radio { display: flex; align-items: center; }
.brand { gap: 10px; font-size: 16px; line-height: 1; font-weight: 700; letter-spacing: -.045em; }
.brand-mark { display: grid; place-items: center; height: 30px; width: 30px; border: 1px solid #536e70; border-radius: 50%; font-size: 20px; background: #133a3b; }
.mast-actions { gap: 10px; }
.guide-button, .icon-button { min-height: 44px; justify-content: center; }
.guide-button { gap: 7px; padding: 0 10px; font-weight: 600; font-size: 14px; }
.guide-button .icon { color: var(--mint); width: 18px; height: 18px; }
.icon-button { width: 44px; border: 1px solid var(--line); background: #102a31; border-radius: 50%; }
.cover {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 326px; height: clamp(326px, 52svh, 488px); display: flex; align-items: center;
  border: 1px solid #496067; border-radius: 5px; background: #041a26;
}
.cover-art {
  position: absolute; top: -7%; right: 0; z-index: -2; height: 114%; width: auto;
  mask-image: linear-gradient(90deg,transparent,#000 24%);
}
.cover::after {
  pointer-events: none; content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #051b25 0%, rgba(4,24,33,.96) 17%, rgba(4,24,33,.68) 35%, transparent 65%);
}
.cover-copy { padding: 38px clamp(24px, 4.2vw, 58px); }
.eyebrow, .cover-meta, .record, .telemetry > div > span, .rig-trigger small, .dialog-kicker {
  font-family: var(--mono); font-size: .77rem; text-transform: uppercase; font-weight: 600; letter-spacing: .115em;
}
.cover-tag { gap: 11px; color: #d9e5d4; }
.signal-bars { gap: 3px; transform: skewX(-18deg); }
.signal-bars i { width: 5px; height: 12px; background: var(--orange); }
h1 {
  font: italic 900 clamp(5rem, 8.05vw, 7.65rem)/.98 "Barlow Condensed", Impact, sans-serif;
  letter-spacing: -.036em; margin: 11px 0 13px -4px; white-space: nowrap;
}
h1 span { color: var(--orange); }
.brief { max-width: 320px; font-size: clamp(1rem, 1.6vw, 1.2rem); line-height: 1.48; color: #eee9d9; font-weight: 500; }
.cover-meta { gap: 13px; margin-top: 29px; font-size: .75rem; letter-spacing: .055em; color: #b4ccc3; }
.cover-meta span { gap: 7px; }
.cover-meta .icon { width: 16px; height: 16px; }
.cover-meta i { width: 3px; height: 3px; background: #98aea6; border-radius: 50%; }
.outfit { padding: 22px 0 0; }
.outfit-heading { justify-content: space-between; min-height: 30px; margin-bottom: 12px; gap: 8px; }
.outfit h2 { font-size: 1.4rem; font-weight: 700; line-height: 1.2; letter-spacing: -.035em; }
.record { color: var(--mint); font-size: .75rem; letter-spacing: .055em; }
.dispatch { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,.43fr); gap: clamp(16px,3vw,36px); align-items: center; }
.rigs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.rig-card {
  position: relative; display: flex; align-items: center; gap: 5px;
  min-height: 87px; text-align: left; padding: 12px 20px 12px 6px;
  border: 1px solid var(--line); border-radius: 4px; background: #102a31;
}
.rig-card[aria-pressed="true"] { border-color: #dd925e; background: linear-gradient(120deg,#263a38,#1b3032); box-shadow: inset 0 0 0 1px #ac79494d; }
.rig-art { width: clamp(54px,6.5vw,82px); height: auto; flex-shrink: 0; }
.rig-copy strong, .rig-copy small { display: block; }
.rig-copy strong { line-height: 1.3; font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; }
.rig-copy small { color: #b1c7bf; font-size: .85rem; line-height: 1.35; margin-top: 2px; }
.choice { position: absolute; top: 8px; right: 8px; width: 14px; height: 14px; border: 1px solid #597278; border-radius: 50%; justify-content: center; }
.choice .icon { width: 11px; height: 11px; visibility: hidden; color: #16292b; }
.rig-card[aria-pressed="true"] .choice { background: var(--orange); border-color: var(--orange); }
.rig-card[aria-pressed="true"] .choice .icon { visibility: visible; }
.primary {
  justify-content: center; gap: 9px; width: 100%; min-height: 52px;
  padding: 11px 16px; border: 1px solid #ff9e63; border-radius: 4px;
  background: var(--orange); color: #192727; font-size: 1.05rem; font-weight: 700;
}
.primary .icon { width: 18px; height: 18px; }
.control-note { color: #b0c3bc; font-size: .79rem; text-align: center; margin-top: 8px; line-height: 1.4; }
.touch-note { display: none; }
.noscript { margin-top: 1rem; }
@media (hover: hover) {
  .icon-button:hover, .guide-button:hover, .steer:hover, .secondary:hover { color: #fff; background: #224047; }
  .rig-card:hover { border-color: #bbc7ac; }
  .primary:hover, .rig-trigger:not([aria-disabled="true"]):hover { background: #ff9a63; }
}
@media (pointer: coarse) { .touch-note { display: block; } .key-note { display: none; } }

/* The chart always uses the same navigable width, including on a wide screen. */
.mission {
  height: 100vh; height: 100dvh; overflow: hidden; padding: 0 max(env(safe-area-inset-right), 0px) 0 max(env(safe-area-inset-left), 0px);
  display: grid; place-items: center;
  background: linear-gradient(#071a23e8,#071b22ed), url("./art/nightwake.webp") center / cover;
}
.cockpit {
  width: min(100%, 68dvh, 570px); height: 100%; max-height: 1000px;
  display: grid; grid-template-rows: auto minmax(0,1fr) auto 5px; overflow: hidden;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); background: #10272f;
  box-shadow: 0 0 0 1px #496269, 0 16px 100px #0009;
}
.runbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 16px; background: linear-gradient(125deg,#213b40,#112b33); border-bottom: 1px solid #62837f; }
.station { margin-right: auto; }
.station .eyebrow { font-size: .69rem; color: #e7be88; letter-spacing: .12em; }
.station h2 { margin-top: 1px; font-size: 1.34rem; line-height: 1.13; letter-spacing: -.035em; }
.runbar .icon-button { width: 44px; border-color: #4f6b6c; }
.in-clock { gap: 5px; font: 650 .98rem var(--mono); color: #dfebd9; }
.in-clock .icon { width: 16px; height: 16px; color: var(--mint); }
.chart { min-width: 0; min-height: 0; overflow: hidden; position: relative; background: #0b4550; }
#water { display: block; width: 100%; height: 100%; touch-action: none; outline-offset: -3px; user-select: none; -webkit-user-select: none; }
.telemetry {
  position: absolute; left: 0; right: 0; top: 0; pointer-events: none;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 10px 17px 24px;
  background: linear-gradient(#092c38ed,#0b3041b8 70%,transparent);
}
.telemetry > div > span { display: block; font-size: .68rem; color: #c0d3c7; margin-bottom: 2px; letter-spacing: .09em; }
.telemetry strong { font: bold 1.12rem var(--mono); font-variant-numeric: tabular-nums; color: var(--ivory); }
.crew-stat { gap: 4px; }
.crew-stat b { font: inherit; }
.crew-stat small { font-size: .8rem; color: #c3cfc0; }
.crew-stat .icon { width: 17px; height: 17px; color: #f6c86d; }
.hull-stat { text-align: center; }
#hull { display: flex; justify-content: center; gap: 3px; padding-top: 4px; }
#hull i { width: 10px; height: 11px; transform: skewX(-16deg); background: #a2e0b9; border: 1px solid #afdebf; }
#hull i.lost { background: #264750; border-color: #688581; }
.score-stat { text-align: right; }
.radio {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 20px); gap: 7px; padding: 7px 10px;
  border: 1px solid #6c8a84; border-radius: 4px; background: #0b282fed; color: #efe5c9;
  font-weight: 600; font-size: .84rem; line-height: 1.3; pointer-events: none;
}
.radio .icon { width: 17px; height: 17px; color: #ffc47e; }
.helm { display: grid; grid-template-columns: minmax(48px, .38fr) minmax(0,1.3fr) minmax(48px,.38fr); gap: 8px; padding: 9px 10px; border-top: 1px solid #72948b; background: #122c34; }
.helm button { min-height: 50px; border-radius: 4px; touch-action: none; user-select: none; -webkit-user-select: none; }
.steer { justify-content: center; border: 1px solid #516e70; background: #1c3b42; }
.steer .icon { width: 24px; height: 24px; }
.rig-trigger { position: relative; overflow: hidden; isolation: isolate; gap: 9px; justify-content: center; border: 1px solid #e99558; background: var(--orange); color: #172b2d; }
.rig-trigger .icon { width: 23px; height: 23px; }
.rig-trigger strong, .rig-trigger small { display: block; }
.rig-trigger strong { font-size: 1rem; font-weight: 700; }
.rig-trigger small { font-size: .64rem; margin-top: 1px; letter-spacing: .1em; }
.rig-trigger[aria-disabled="true"] { border-color: #6e8985; background: #213b42; color: #dae7dc; }
.charge-fill { position: absolute; inset: 0; transform-origin: left; z-index: -1; background: #52706e; pointer-events: none; }
.rig-trigger:not([aria-disabled="true"]) .charge-fill { display: none; }
.passage { position: relative; background: #2b464c; }
.passage i { display: block; height: 100%; background: var(--orange); width: 100%; transform-origin: left; transform: scaleX(0); }
.passage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,transparent 33.1%,#0b242b 33.1% 33.6%,transparent 33.6% 66.4%,#0b242b 66.4% 66.9%,transparent 66.9%); }

dialog {
  color: var(--ivory); width: min(408px,calc(100% - 30px)); max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  border: 1px solid #6d8783; border-top: 3px solid var(--orange); border-radius: 6px;
  padding: 22px; background: #142e35; box-shadow: 0 15px 70px #001117b3; overscroll-behavior: contain;
}
dialog::backdrop { background: rgba(4,16,22,.72); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-kicker { color: #e2b183; font-size: .72rem; }
.dialog-head .icon-button { margin: -9px -9px -7px 0; background: transparent; border-color: transparent; }
dialog h2 { font: italic 900 2.7rem/1.02 "Barlow Condensed",Impact,sans-serif; text-transform: uppercase; letter-spacing: -.015em; margin: 10px 0 8px; }
#panel-title:focus { outline: none; }
.dialog-intro, .dialog-note { color: #d0ddd2; font-size: .96rem; line-height: 1.48; }
.dialog-note { font-size: .86rem; color: #bad1c8; margin: 14px 0; }
.legend { padding: 0; margin: 16px 0 12px; list-style: none; }
.legend li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #37535a; }
.legend canvas { width: 43px; height: 38px; flex-shrink: 0; border-radius: 3px; background: #124855; }
.legend strong { display: block; font-size: .9rem; }
.legend span { display: block; font-size: .82rem; line-height: 1.35; color: #bfd1c7; }
.dialog-actions { display: grid; gap: 7px; margin-top: 18px; }
.secondary { min-height: 44px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 4px; color: #e2e8d9; }
.plain { min-height: 44px; font-size: .88rem; color: #bbd0c7; }
.report { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 18px 0 12px; padding: 12px 0; border-block: 1px solid #426068; }
.report dt { color: #bed1c7; font: .7rem var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.report dd { margin: 3px 0 0; font-size: 1.35rem; font-weight: 700; }

@media (max-width: 820px) {
  .dock { padding-inline: max(18px,env(safe-area-inset-left)) max(18px,env(safe-area-inset-right)); max-width: 730px; }
  .cover { height: clamp(310px, 48svh, 420px); }
  .cover-copy { padding: 24px; }
  .cover::after { background: linear-gradient(90deg,#061c25eb 0%,#061c25a6 26%,transparent 72%); }
  .dispatch { grid-template-columns: 1fr; gap: 15px; }
  .rig-art { width: 78px; }
  .rig-card { min-height: 74px; }
}
@media (max-width: 560px) {
  .dock { padding-top: max(3px,env(safe-area-inset-top)); padding-inline: max(14px,env(safe-area-inset-left)) max(14px,env(safe-area-inset-right)); }
  .mast { min-height: 54px; margin-bottom: 3px; }
  .brand { gap: 7px; font-size: 15px; }
  .brand-mark { width: 26px; height: 26px; font-size: 17px; }
  .mast-actions { gap: 0; }
  .mast .icon-button { border-color: transparent; background: transparent; width: 44px; }
  .guide-button { font-size: .83rem; padding-inline: 6px; }
  .cover { height: clamp(292px, 48svh, 410px); min-height: 0; align-items: flex-end; }
  .cover-art { top: 0; width: 100%; height: 92%; object-fit: cover; object-position: 74% top; mask-image: none; }
  .cover::after { background: linear-gradient(0deg,#051b25 0%,#051b25f7 11%,#051b25df 24%,#051b2570 43%,transparent 65%); }
  .cover-copy { width: 100%; padding: 15px 17px 17px; }
  .cover-tag { font-size: .65rem; letter-spacing: .1em; gap: 7px; }
  .signal-bars { gap: 2px; }
  .signal-bars i { width: 4px; height: 9px; }
  h1 { font-size: clamp(3.75rem,16.25vw,5.05rem); margin: 2px 0 3px -2px; }
  .brief { font-size: .94rem; line-height: 1.32; max-width: 300px; }
  .cover-meta { margin-top: 11px; font-size: .66rem; gap: 10px; }
  .cover-meta span { gap: 5px; }
  .cover-meta .icon { width: 14px; height: 14px; }
  .outfit { padding-top: 15px; }
  .outfit-heading { margin-bottom: 7px; min-height: 24px; }
  .outfit h2 { font-size: 1.1rem; }
  .rigs { gap: 8px; }
  .rig-card { align-items: flex-start; flex-direction: column; justify-content: flex-end; gap: 0; padding: 4px 10px 9px; min-height: 91px; }
  .rig-art { width: 68px; height: 36px; object-fit: contain; margin-left: -5px; }
  .rig-copy strong { font-size: .96rem; }
  .rig-copy small { font-size: .77rem; margin-top: 0; }
  .choice { right: 8px; top: 8px; }
  .dispatch { gap: 11px; }
  .control-note { margin-top: 6px; }
  .cockpit { width: 100%; max-height: none; }
}
@media (max-width: 360px) {
  .dock { padding-inline: 10px; }
  .cover { height: 282px; }
  .cover-copy { padding: 12px; }
  .rig-card { padding-inline: 7px; }
  .record { font-size: .66rem; }
}
@media (orientation: landscape) and (max-height: 530px) {
  .mission { padding: env(safe-area-inset-top) max(env(safe-area-inset-right),8px) env(safe-area-inset-bottom) max(env(safe-area-inset-left),8px); }
  .cockpit { width: min(100%,840px); padding: 0; grid-template-columns: minmax(110px,1fr) minmax(0,78dvh) minmax(116px,1fr); grid-template-rows: minmax(0,1fr) 4px; }
  .runbar, .helm { flex-direction: column; justify-content: center; align-items: stretch; display: flex; border: 0; padding: 8px; }
  .station { margin: 0 0 9px; }
  .in-clock { margin-bottom: 5px; }
  .station h2 { font-size: 1.1rem; }
  .helm button { min-height: 44px; }
  .rig-trigger { gap: 4px; padding: 8px 4px; }
  .rig-trigger strong { font-size: .84rem; }
  .rig-trigger .icon { width: 17px; }
  .passage { grid-column: 1 / -1; }
  .telemetry { padding: 5px 8px 12px; }
  .telemetry strong { font-size: .85rem; }
  .radio { font-size: .71rem; bottom: 4px; }
}
