:root {
  --electric: #68dcff;
  --light-blue: #c2f3ff;
  --pool: #102939;
  --signal: #1a92c5;
  --wiring: #55c4f94c;
  --warning: #ffc388;
  --confirmed: #9cf0d4;
}

.project-feature { position: relative; isolation: isolate; }
.project-feature::before {
  content: ''; position: absolute; pointer-events: none; z-index: -1; inset: 0 46% 0 0;
  background: url(assets/sea-circuit.svg) center / 720px auto; opacity: .35;
  mask-image: linear-gradient(90deg,#000,transparent 95%);
}
.project-feature .eyebrow span { background: var(--electric); }
.project-feature .primary { background: var(--electric); color: #0b2330; }
.project-feature .primary:hover { background: var(--light-blue); }

.underway,.underway .topbar { background: #071722; }
.underway .topbar { border-color: #4cc8ff4d; }
.underway .brand svg { color: var(--electric); }
.underway #count,.underway #audioBtn { color: var(--electric); }
.bridge { background: #081a27; }
#sea::before {
  content: ''; z-index: -1; position: absolute; pointer-events: none; inset: 0;
  background: url(assets/sea-circuit.svg) left top / min(58%,830px) auto repeat-y;
  mask-image: linear-gradient(90deg,#000 0%,#000a 12%,transparent 35%,transparent 100%);
  opacity: .52;
}
.scene-title h1 { color: #edfaff; }
.scene-title .eyebrow { color: #b8eaff; }
.scene-title .eyebrow span { background: var(--electric); box-shadow: 0 0 8px #46c4f8; }
.telemetry { border-color: #6ad7fa90; background: #091d2ade; }
.telemetry b { color: var(--light-blue); }
.minimap { border-color: #3daccb; box-shadow: 0 0 0 4px #0a2b3d83,inset 0 0 15px #3fcbf145; }
.minimap #mapVessel path { fill: var(--electric); }
.helm,.camera-controls { border-color: #79d6f27e; background: #091e2bdf; }
.instrument[aria-pressed='true'] { color: var(--light-blue); border-color: #7adfff95; background: #24546a; }
.station-pin i { background: #3fcaff; border-color: #d6f9ff; box-shadow: 0 0 0 4px #5bd3ff54,0 0 15px #72d7f7; }
.station-pin span { border: 1px solid #52bcdd78; background: #091f30e9; }
.scene-signal {
  position: absolute; left: var(--gutter); bottom: 81px; display: flex; gap: 9px; align-items: center;
  min-height: 29px; padding: 5px 9px; color: #cbf1ff; border: 1px solid #55c9f381; background: #071d2bee;
  border-radius: 3px; font: 650 .72rem/1.35 var(--mono); max-width: calc(90% - 15px);
}
.scene-signal span,.pilot-channel-icon::after {
  flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--electric);
  box-shadow: 0 0 9px var(--electric);
}
.scene-signal[data-type='warning'] { color: var(--warning); border-color: #ffc38891; }
.scene-signal[data-type='warning'] span { background: var(--warning); box-shadow: 0 0 7px #ffc388ab; }
.scene-signal[data-type='complete'] span { background: var(--confirmed); box-shadow: 0 0 7px var(--confirmed); }
.bridge-hint { background: #071722; color: #b4cedc; }
.stations-bar { background: #3ba6d150; border-color: #4bbbe58c; }
.station-select { background: #0a2232; position: relative; }
.station-select::after {
  content: ''; position: absolute; width: 20px; height: 6px; top: 4px; right: 8px;
  background: linear-gradient(90deg,#47bbec77 11%,transparent 11%,transparent 43%,#47bbec77 43%,#47bbec77 54%,transparent 54%);
  clip-path: polygon(0 0,100% 0,72% 100%,0 100%);
}
.station-select svg { color: var(--electric); filter: drop-shadow(0 0 5px #39c5ff45); }
.station-select:hover { background: #12354b; }
.station-select[aria-pressed='true'] { background: #12354b; box-shadow: inset 0 2px var(--electric),inset 0 10px 19px #3fcaff1b; }
.station-select small { color: #b0cfdf; }
.station-select.done svg { color: var(--confirmed); }

.station {
  --station-edge: #4ab0d561;
  border-color: var(--station-edge);
  background: radial-gradient(ellipse at 80% 0,#102c3f,#0a1b2b 57%);
  width: clamp(376px, 35.5vw, 575px);
  position: relative;
}
.station-header {
  background: linear-gradient(90deg,#0b2130 2%,#09213280 77%),url(assets/sea-circuit.svg) 55% 45% / 520px auto;
  border-bottom: 1px solid #43c9f429; padding-block: 12px 10px;
}
.station-header .eyebrow { color: #c2e8f7; letter-spacing: .13em; }
.station-header h2 { color: #ecf9ff; }
.station-tabs { background: #061826; border-color: #61cdf44d; }
.station-tabs button { color: #a9c5d7; }
.station-tabs button[aria-pressed='true'] { color: var(--light-blue); background: linear-gradient(0deg,#2eaef629,#2eaef605 85%); border-color: var(--electric); }
.station-tabs button:hover { background: #143447; }
.station-body { scrollbar-color: #36627c #0a1d2b; color: #e0f0f7; }
.station-body .primary,.vote .primary,.log .primary { color: #042231; background: var(--electric); }
.station-body .primary:hover,.vote .primary:hover,.log .primary:hover { background: var(--light-blue); }
.station-body .primary:disabled { opacity: .41; }
.station-body .primary:focus-visible,.utility-button:focus-visible { outline-color: var(--light-blue); }

.mission-photo {
  min-height: 103px; display: grid; align-items: end; position: relative; isolation: isolate; overflow: hidden;
  background: #193749; border: 1px solid #6cd4f357; border-radius: 4px; margin-bottom: 11px;
}
.mission-photo img,.mission-photo::after { width: 100%; height: 100%; inset: 0; position: absolute; }
.mission-photo img { z-index: -2; object-fit: cover; object-position: center 46%; }
.mission-photo::after { content: ''; z-index: -1; background: linear-gradient(0deg,#061523f5,transparent 95%); }
.mission-photo > div { padding: 10px 12px 8px; }
#missionTitle { margin: 2px 0 0; font-size: 2.2rem; color: #f0faff; }
.mission-position { color: #c4edff; font: 650 .65rem var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.pilot-channel {
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; column-gap: 9px;
  padding: 9px; margin: 0 0 13px; background: #0c293c; border: 1px solid #57c6ef69; border-radius: 4px;
}
.pilot-channel-icon {
  position: relative; padding: 7px; width: 34px; height: 34px; border-radius: 4px; border: 1px solid #64cbf97b;
  color: var(--electric); background: #133e55; display: grid; place-items: center;
}
.pilot-channel-icon svg { width: 18px; height: 18px; }
.pilot-channel-icon::after { content: ''; position: absolute; top: -2px; right: -2px; width: 5px; height: 5px; }
.pilot-channel[data-mode='signal'] .pilot-channel-icon::after { animation: beacon 1.1s ease-in-out infinite alternate; }
.pilot-channel[data-mode='warning'] { border-color: #ffc38891; }
.pilot-channel[data-mode='warning'] .pilot-channel-icon::after { background: var(--warning); box-shadow: none; }
.pilot-channel[data-mode='complete'] .pilot-channel-icon { color: var(--confirmed); border-color: #9cf0d479; }
.pilot-channel strong { display: flex; gap: 3px 7px; align-items: baseline; flex-wrap: wrap; color: #caf3ff; font-size: .82rem; }
.pilot-channel strong small { color: #a0bdd2; font: 530 .66rem var(--mono); }
#gameTask { margin: 3px 0 0; font-size: .85rem; line-height: 1.36; }
.utility-button {
  min-height: 31px; padding: 5px 8px; font-size: .77rem; font-weight: 750; color: var(--light-blue);
  border: 1px solid #60cbf267; background: #0d2839; border-radius: 3px; line-height: 1.3;
}
.utility-button:hover,.utility-button[aria-pressed='true'] { background: #1b4c64; border-color: var(--electric); }
.utility-button:disabled { opacity: .43; }
.mission-actions { gap: 11px; }
#activity .launch-task { min-width: min(240px,100%); justify-self: stretch; }
.launch-task svg { filter: drop-shadow(0 0 6px #7ae5ff); }
.feedback { color: #a7d8ff; min-height: 1rem; margin-top: 8px; font: 600 .73rem/1.4 var(--mono); }
.pilot-channel[data-mode='warning'] + #activity + .feedback { color: var(--warning); }
.pilot-channel[data-mode='complete'] + #activity + .feedback { color: var(--confirmed); }
.ask-pilot,.technical-check { margin-top: 9px; border: 1px solid #47b7e33b; border-radius: 3px; background: #0d2535; }
.ask-pilot summary,.technical-check summary { color: #bae9ff; cursor: pointer; padding: 8px 9px; font-size: .8rem; font-weight: 700; }
.ask-pilot form,.technical-check > div { padding: 3px 9px 9px; }
.ask-pilot label { display: block; color: #c2d8e7; font-size: .73rem; margin-bottom: 5px; }
.ask-pilot form > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px; }
.ask-pilot input { min-width: 0; border: 1px solid #66bedd7c; background: #081c2a; border-radius: 3px; color: white; font: inherit; padding: 5px; }
@keyframes beacon { 100% { box-shadow: 0 0 11px 2px var(--electric); opacity: .52; } }

.signal-tape {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; margin: 0; list-style: none;
  background: #071d2d url(assets/sea-circuit.svg) 25% 40% / 385px auto; border: 1px solid #55c5ec5b; border-radius: 3px;
}
.signal-tape li {
  min-width: 60px; display: flex; align-items: center; gap: 5px; min-height: 33px; padding: 4px 6px; color: #a2bdcc;
  background: #0b2436; border: 1px solid #2f7da076; border-radius: 3px; font: 650 .75rem var(--mono);
}
.signal-tape li::before { content: ''; border: 1px solid currentColor; width: 5px; height: 5px; border-radius: 50%; }
.signal-tape li.transmitting { border-color: var(--electric); color: var(--light-blue); background: #16455c; box-shadow: 0 0 12px #59c7fd5d; }
.signal-tape li.transmitting::before { background: var(--electric); animation: beacon .55s alternate infinite; }
.signal-tape li.received { color: var(--confirmed); }
.signal-tape li.received::before { background: currentColor; }

.input-card { display: flex; align-items: start; gap: 7px; background: #113548; border-color: #56c2eb52; }
.input-card svg { width: 18px; height: 18px; flex: none; color: var(--electric); }
.input-card:hover,.media-tile:hover { border-color: var(--electric); }
.input-card .card-caption { min-width: 0; margin: 0; }
.input-card strong { font: 780 .82rem/1.35 var(--body); color: #e4f8ff; }
.input-card small { display: block; margin-top: 5px; color: #b7cedc; font-size: .69rem; }
.brief-receipt { display: grid; grid-template-columns: auto 1fr; gap: 4px 9px; background: #0b2435; border: 1px solid #60c6ec4b; padding: 8px; border-radius: 3px; font-size: .75rem; }
.brief-receipt dt { font-weight: 800; color: #bceeff; }
.brief-receipt dd { margin: 0; }
.coast,.missing,.recorded { fill: none; }
.coast { stroke: #65a8c3; stroke-width: .6; }
.missing { stroke: #ffbd87; stroke-width: 1.7; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4; }
.recorded { stroke: #67dfff; stroke-width: 2.5; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px #5af); }
.live-chart { min-height: 112px; background-color: #0a2638; border-color: #60cbf34c; }
.plot-point { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%,-50%); width: 8px; height: 8px; border-radius: 50%; color: #839cab; background: #0d2c3e; border: 1px solid currentColor; opacity: .66; }
.plot-point.pending,.plot-point.accepted { color: var(--electric); box-shadow: 0 0 9px #65c9ffaa; opacity: 1; }
.plot-point.pending { animation: beacon .7s alternate infinite; width: 11px; height: 11px; }
.plot-point.accepted { background: var(--electric); }
.plot-point.gap { color: var(--warning); border-radius: 2px; opacity: 1; background: var(--warning); }
.packet-display { color: #aee5ff; font: 630 .73rem var(--mono); }
.game-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.range-target { position: relative; height: 46px; color: var(--light-blue); }
.range-target #signalTarget { position: absolute; top: 23px; transform: translateX(-50%); white-space: nowrap; }
#frequency { accent-color: var(--electric); }
.scope.tuned { color: var(--electric); box-shadow: 0 0 11px #71c8f23d; }
.frequency-label output { color: var(--electric); }
.viewfinder { border-color: #55c2e759; }
.view-sector { background: linear-gradient(#163e56 47%,#285c71 48%,#112b38 74%); }
.view-sector .spout { color: #d3f4ff; filter: drop-shadow(0 0 4px #67c8ff); }
.draft-page {
  min-height: 65px; display: grid; gap: 5px; padding: 6px 8px; color: #c8edff; border: 1px solid #50b9e24c;
  background: #10293b; border-radius: 4px; font-size: .73rem;
}
.draft-media { display: flex; gap: 5px; }
.draft-media img { margin-top: 3px; width: 55px; height: 36px; object-fit: cover; border: 1px solid #66c6ea; }

.mindmap,.flow-map {
  position: relative; isolation: isolate; overflow: hidden; background: #081e30 url(assets/sea-circuit.svg) center / 520px auto;
  border: 1px solid #56bee56d; border-radius: 4px;
}
.mindmap { margin: 13px 0; min-height: 151px; display: grid; align-items: center; padding: 9px; grid-template-columns: 37% 1fr; column-gap: 16%; }
.mindmap > svg,.flow-map > svg { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mindmap > svg path,.flow-map > svg path { fill: none; stroke: #4ebfec7b; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.mindmap > svg .mind-signal { stroke: var(--electric); stroke-width: 2.1; stroke-dasharray: 13 208; animation: wire 3s linear infinite; }
@keyframes wire { from { stroke-dashoffset: 213; } to { stroke-dashoffset: 0; } }
.mind-core {
  justify-self: center; width: 95%; color: var(--light-blue); border: 1px solid #60d6ff9e; border-radius: 4px;
  background: #102c3e; box-shadow: 0 0 14px #53c9fe49,inset 0 0 12px #53c9fe24; padding: 9px 3px; text-align: center;
}
.mind-core svg { width: 27px; height: 27px; color: var(--electric); margin: 1px auto 3px; }
.mind-core strong { font-size: .78rem; }
.mind-branches { display: grid; gap: 5px; }
.mind-branches button,.flow-nodes button {
  display: flex; gap: 6px; align-items: center; min-height: 38px; text-align: left; color: #c4e3f3;
  padding: 5px 6px; border-radius: 3px; border: 1px solid #58bcdf71; background: #0c283c; font-size: .76rem; font-weight: 700;
}
.mind-branches button:hover,.mind-branches button[aria-pressed='true'],.flow-nodes button:hover,.flow-nodes button[aria-pressed='true'] {
  color: #f0fbff; background: #17425a; border-color: var(--electric); box-shadow: 0 0 9px #68ceff52;
}
.mind-branches svg,.flow-nodes svg { width: 17px; height: 17px; flex: none; color: var(--electric); }

.explorer-detail {
  border: 1px solid #59b1d65a; border-radius: 4px; background: #102b3b;
  padding: 10px; font-size: .84rem; overflow: hidden;
}
.detail-heading { display: flex; gap: 8px; align-items: center; margin-bottom: 7px; }
.detail-heading svg { width: 24px; height: 24px; color: var(--electric); flex: none; }
.detail-heading span { font: 650 .65rem/1.3 var(--mono); color: #a7ddf4; letter-spacing: .045em; }
.detail-heading h3 { margin: 1px 0 0; font-size: 1.64rem; }
.service-image { position: relative; margin: -10px -10px 10px; height: 95px; }
.service-image img { height: 100%; width: 100%; object-fit: cover; object-position: 50% 45%; }
.service-image figcaption { position: absolute; inset: auto 0 0; padding: 3px 8px; font-size: .63rem; color: white; background: #071c2cbd; text-align: end; }
.output-list { padding: 0; margin: 5px 0 0; display: grid; gap: 6px; list-style: none; }
.output-list li { display: flex; gap: 6px; align-items: start; }
.output-list svg { width: 17px; height: 17px; color: var(--electric); flex: none; margin-top: 2px; }
.crew-list { display: grid; gap: 4px 8px; grid-template-columns: auto 1fr; }
.crew-list dt { color: var(--electric); font-weight: 750; }
.flow-controls { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 8px; }
.flow-map { padding: 7px 8px; margin-bottom: 9px; min-height: 152px; }
.flow-map > svg path[data-link] { stroke: #36647d; stroke-width: 2; }
.flow-map > svg path.passed { stroke: var(--electric); filter: drop-shadow(0 0 4px #67d5ff); }
.flow-map > svg path.passing { stroke-dasharray: 10 7; animation: pulse-link .8s cubic-bezier(.2,.8,.3,1) both; }
@keyframes pulse-link { from { stroke-dashoffset: 50; } to { stroke-dashoffset: 0; } }
.flow-map.fault > svg path { stroke: #9c684f; stroke-dasharray: 5 5; }
.flow-nodes { list-style: none; padding: 0; margin: 0; display: grid; align-items: stretch; grid-template-columns: 1fr 1fr; gap: 11px 19px; }
.flow-nodes li:nth-child(3) { grid-area: 2/2; }
.flow-nodes li:nth-child(4) { grid-area: 2/1; }
.flow-nodes button { min-height: 63px; width: 100%; height: 100%; }
.flow-nodes button.passed { border-color: #51bcdfaa; }
.flow-nodes button strong,.flow-nodes button small { display: block; line-height: 1.23; }
.flow-nodes button small { color: #b6d6e6; font-size: .65rem; margin-top: 3px; }
.technical-check p { font-size: .81rem; }
.vote { border-color: #49c3f56e; background: #071c2c; }

@media (max-width: 900px) {
  .scene-signal { left: 19px; }
}
@media (max-width: 720px) {
  .station { width: 100%; border-top-color: var(--station-edge); }
  .station-header { padding-block: 6px; }
  .scene-signal { left: 9px; bottom: 56px; font-size: .63rem; }
  .bridge-main:has(.station:not([hidden])) { grid-template-rows: minmax(96px,.33fr) minmax(0,1fr); }
  .station-body { padding-top: 8px; }
  .mission-photo { min-height: 70px; margin-bottom: 7px; }
  .mission-photo > div { padding: 7px; }
  #missionTitle { font-size: 1.8rem; }
  .pilot-channel { margin-bottom: 8px; padding: 7px; column-gap: 6px; }
  .pilot-channel-icon { width: 30px; height: 30px; }
  #gameTask { font-size: .79rem; }
  .mindmap { min-height: 134px; }
  .mind-branches button { min-height: 33px; }
}
@media (prefers-reduced-motion: reduce) {
  #sea::before,.project-feature::before,.station-header,.signal-tape,.mindmap,.flow-map { background-image: none; }
  .scene-signal span,.pilot-channel-icon::after,.signal-tape li::before,.mindmap > svg .mind-signal,.flow-map .passing,.plot-point.pending { animation: none !important; }
}

/* The three ports stay in view while the mission instruments change. */
.mission-route {
  margin-top: 13px; padding: 10px; position: relative; isolation: isolate; overflow: hidden;
  background: #071e30 url(assets/sea-circuit.svg) center / 470px auto;
  border: 1px solid #54bfe877; border-radius: 4px; min-height: 72px;
}
.mission-route > svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.mission-route > svg path { fill: none; stroke: #66cfff8e; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.mission-route > svg .route-current { stroke: #89e7ff; stroke-width: 2; opacity: 0; stroke-dasharray: 9 85; }
.mission-route[data-stage='1'] > svg .route-current,
.mission-route[data-stage='2'] > svg .route-current { opacity: 1; animation: wire 1.65s linear infinite; }
.mission-route[data-stage='3'] > svg .route-current { opacity: 1; stroke: var(--confirmed); stroke-dasharray: none; }
.mission-route ol { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; list-style: none; padding: 0; margin: 0; }
.mission-route li {
  align-self: stretch; display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 48px;
  border-radius: 4px; border: 1px solid #50abc372; background: #0a2638; color: #bee5f5; font: 620 .71rem var(--mono);
}
.mission-route li svg { width: 20px; height: 20px; color: #7cc8e5; }
.mission-route li.linked { background: #164762; border-color: var(--electric); box-shadow: 0 0 13px #53ceff54; }
.mission-route li.linked svg { color: var(--electric); }
.mission-route[data-stage='3'] li { border-color: #96f0d6a5; }
.mission-route[data-stage='3'] li svg { color: var(--confirmed); }
@media (prefers-reduced-motion: reduce) {
  .mission-route { background-image: none; }
  .mission-route > svg .route-current { animation: none !important; }
}
