.fs {
  --bg: #0d0905; --paper: #140f08; --ink: #ffb547; --dim: #a8792f;
  --alert: #ff6a4d; --rule: #4a3618; --display: "VT323", monospace;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark; background: var(--bg); color: var(--ink);
  font: 14px/1.35 var(--mono);
}
@media (min-width: 1100px) {
  .fs .ship-details { display: contents; }
  .fs .ship-details summary { display: none; }
  .fs .nearby-map { width: min(240px, 100%); }
}
.fs [hidden] { display: none !important; }
.fs button, .fs input { font: inherit; }
.fs button { min-height: 32px; padding: 0 10px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; }
.fs button:hover, .fs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.fs button:focus-visible, .fs input:focus-visible, .fs .scan-cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.fs .intro { display: none; }
.fs.standalone .intro { min-height: 100vh; box-sizing: border-box; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 16px; text-align: center; }
.fs.standalone .intro[hidden] { display: none; }
.fs.standalone .intro-art { position: relative; width: min(100%, 620px); min-height: 150px; }
.fs.standalone .ascii { position: absolute; inset: 0; margin: 0; color: var(--dim); font: 14px/1.2 var(--mono); white-space: pre; overflow: hidden; }
.fs.standalone .ascii-one { animation: fs-fade-one 5s infinite; }
.fs.standalone .ascii-two { opacity: 0; animation: fs-fade-two 5s infinite; }
.fs.standalone .intro-kicker, .fs.standalone .intro-status { margin: 0; color: var(--dim); font-size: 11px; letter-spacing: .12em; }
.fs.standalone .intro h1 { margin: 0; font: 72px/.9 var(--display); letter-spacing: .06em; }
.fs.standalone .intro-copy { max-width: 58ch; margin: 0; color: var(--dim); }
.fs.standalone .intro-start { min-height: 40px; background: var(--ink); color: var(--paper); }
@keyframes fs-fade-one { 0%,45% { opacity: 1; } 55%,100% { opacity: 0; } }
@keyframes fs-fade-two { 0%,45% { opacity: 0; } 55%,100% { opacity: 1; } }
body:has(.fs.standalone) .site-header, body:has(.fs.standalone) > .site-footer { display: none; }
.fs .wrap { max-width: 1240px; min-height: calc(100vh - 64px); box-sizing: border-box; margin: 0 auto; padding: 8px 16px 12px; display: grid; grid-template-rows: auto 1fr auto auto auto; gap: 8px; }
.fs.standalone .wrap { max-width: 1240px; height: 100vh; min-height: 0; padding-block: 8px 12px; overflow: hidden; }
.fs .topbar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px; border-bottom: 1px solid var(--ink); padding-bottom: 6px; }
.fs .titleline { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.fs h1 { margin: 0; font: 32px/.9 var(--display); letter-spacing: .06em; }
.fs .sub { margin: 0; color: var(--dim); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.fs .dedication { grid-column: 1/-1; margin: 0; color: var(--dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs .top-controls, .fs .modebar { display: flex; align-items: center; gap: 4px; }
.fs .top-controls button { min-height: 28px; padding-inline: 8px; font-size: 12px; }
.fs .adventure-home { color: var(--dim); font-size: 11px; text-decoration: none; white-space: nowrap; }
.fs .adventure-home:hover { color: var(--ink); }
.fs .bridge { position: relative; min-height: 480px; display: grid; grid-template-columns: 360px minmax(0, 1fr) 300px; gap: 8px; overflow: hidden; }
.fs .panel { min-width: 0; min-height: 0; border: 1px solid var(--rule); background: rgba(20,15,8,.6); padding: 8px; }
.fs .section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.fs h2, .fs .label { margin: 0; font: 20px/1 var(--display); letter-spacing: .08em; }
.fs .section-head span { color: var(--dim); font-size: 11px; }
.fs .scanbox { display: flex; flex-direction: column; }
.fs .scan { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; width: min(100%, 336px); aspect-ratio: 1; margin: 0 auto; }
.fs .scan-cell { display: grid; place-items: center; min-width: 0; border: 1px solid transparent; color: var(--dim); font-size: clamp(14px, 2vw, 22px); cursor: pointer; }
.fs .scan-cell:hover, .fs .scan-cell.target { border-color: var(--ink); }
.fs .scan-cell.ship { background: var(--ink); color: var(--paper); font-weight: 600; }
.fs .scan-cell.raider { color: var(--alert); font-weight: 600; }
.fs .scan-cell.outpost { color: var(--ink); font-weight: 600; }
.fs .scan-cell.star { color: var(--dim); }
.fs .hint { margin: 8px 0 0; color: var(--dim); font-size: 11px; }
.fs .printout { overflow: hidden; display: flex; flex-direction: column; }
.fs .log { overflow-y: auto; margin: 0; white-space: pre-wrap; word-break: break-word; }
.fs .log div { min-height: 1.35em; }
.fs .log-map { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; margin: 8px 0; }
.fs .log-map span { padding: 2px; border: 1px solid var(--rule); color: var(--dim); text-align: center; font-size: 10px; }
.fs .log-map .current { border-color: var(--ink); color: var(--ink); }
.fs .log-map .hostile { color: var(--alert); }
.fs .log div::before { content: "D" attr(data-day) " "; color: var(--dim); }
.fs .log .echo { font-weight: 600; margin-top: 4px; }
.fs .log .alert { color: var(--alert); font-weight: 600; }
.fs .log .note { color: var(--dim); }
.fs .status { overflow-y: auto; }
.fs .status-block { border-bottom: 1px solid var(--rule); padding-bottom: 8px; margin-bottom: 8px; }
.fs .status-block:last-child { border-bottom: 0; margin-bottom: 0; }
.fs .status-title { color: var(--dim); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.fs .status-grid { display: grid; grid-template-columns: max-content 1fr; gap: 3px 8px; }
.fs .status-grid dt { color: var(--dim); font-size: 11px; text-transform: uppercase; }
.fs .status-grid dd { margin: 0; font-weight: 600; }
.fs .bar { height: 6px; margin-top: 3px; border: 1px solid var(--rule); }
.fs .bar i { display: block; height: 100%; background: var(--ink); }
.fs .bar.low i { background: var(--alert); }
.fs .chip, .fs .system-chip { display: inline-block; border: 1px solid var(--rule); padding: 1px 5px; font-size: 11px; }
.fs .chip.red, .fs .system-chip.bad { color: var(--alert); border-color: var(--alert); }
.fs .pips { letter-spacing: 2px; }
.fs .pip { color: var(--ink); }.fs .pip.empty { color: var(--rule); }
.fs .nearby-map { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.fs .nearby-cell { min-height: 28px; display: grid; place-items: center; border: 1px solid var(--rule); color: var(--dim); font-size: 11px; }
.fs .nearby-cell.current { border-color: var(--ink); color: var(--ink); }
.fs .nearby-cell.hostile { color: var(--alert); }
.fs .tap-panel, .fs .typepanel { min-width: 0; }
.fs .typepanel form { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.fs .typepanel label { color: var(--dim); font-size: 11px; letter-spacing: .1em; }
.fs #cmd { width: 100%; box-sizing: border-box; min-height: 36px; border: 1px solid var(--rule); background: transparent; color: var(--ink); padding: 0 8px; text-transform: uppercase; }
.fs .autocomplete { margin: 4px 0 0; color: var(--dim); font-size: 11px; }
.fs .toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; border-top: 1px solid var(--rule); padding-top: 8px; }
.fs .tool-group { display: flex; align-items: end; gap: 4px; padding-right: 8px; border-right: 1px solid var(--rule); }
.fs .tool-group span { color: var(--dim); font-size: 10px; letter-spacing: .1em; writing-mode: vertical-rl; transform: rotate(180deg); }
.fs .toolbar button { white-space: nowrap; }
.fs .new-game { margin-left: auto; border-color: transparent; }
.fs .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fs .actions button, .fs .params button { min-height: 36px; }
.fs .params { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; }
.fs .ptitle { margin: 0; font: 20px var(--display); }
.fs .prow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fs .val { min-width: 6ch; text-align: center; }
.fs footer { color: var(--dim); font-size: 11px; }
.fs .mission-overlay { position: absolute; inset: 8px; z-index: 3; display: grid; place-items: center; background: rgba(13,9,5,.88); }
.fs .mission-card { max-width: 360px; border: 1px solid var(--ink); background: var(--paper); padding: 16px; text-align: center; }
.fs .mission-card h2 { margin-bottom: 8px; }
@media (max-width: 1100px) {
  .fs .bridge { grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-rows: minmax(280px, 1fr) 40vh; }
  .fs .printout { grid-column: 1/-1; grid-row: 2; }
}
@media (min-width: 1101px) {
  body:has(.fs.standalone) { overflow: hidden; }
  .fs.standalone .bridge { min-height: 0; }
}
@media (max-width: 680px) {
  .fs .wrap, .fs.standalone .wrap { height: auto; min-height: 100vh; overflow: visible; padding: 8px; padding-bottom: 56px; gap: 8px; }
  .fs .topbar { grid-template-columns: 1fr; }
  .fs .titleline { gap: 8px; }.fs h1 { font-size: 32px; }.fs .sub { font-size: 9px; }
  .fs .dedication { display: none; }.fs .top-controls { position: absolute; top: 8px; right: 8px; }
  .fs .bridge { min-height: 0; display: flex; flex-direction: column; overflow: visible; }
  .fs .scanbox { flex: 0 0 auto; }.fs .scan { width: min(100%, 320px); }
  .fs .status { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 180px; overflow: auto; }
  .fs .nearby { grid-column: 1/-1; }.fs .printout { height: 35vh; min-height: 180px; }
  .fs .toolbar { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; padding: 6px 8px; background: var(--paper); overflow-x: auto; flex-wrap: nowrap; }
  .fs .tool-group { flex-shrink: 0; }.fs .tool-group span { display: none; }.fs .new-game { margin-left: 0; }
  .fs .standalone .wrap { padding-bottom: 56px; }
}
@media (pointer: coarse) {
  .fs button { min-height: 44px; }.fs .top-controls button { min-height: 32px; }.fs .scan-cell { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .fs.standalone .ascii { animation: none; }.fs.standalone .ascii-two { display: none; }
}

/* Compact bridge layout */
.fs .wrap { max-width: none; height: calc(100dvh - 64px); min-height: 0; padding: 8px 16px; grid-template-rows: 44px minmax(0, 1fr) auto auto; }
.fs.standalone .wrap { height: 100dvh; }
.fs .topbar { height: 44px; box-sizing: border-box; grid-template-columns: 1fr auto; padding-bottom: 4px; }
.fs .top-controls { gap: 6px; }
.fs .top-controls .about, .fs .top-controls .new-game { border-color: transparent; padding-inline: 5px; font-size: 11px; }
.fs .dedication, .fs footer { display: none; }
.fs .bridge { height: 100%; min-height: 460px; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) minmax(280px, 320px); }
.fs .panel { padding: 8px; }
.fs .scanbox { min-height: 0; }
.fs .scan-body { container-type: size; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.fs .scan { --side: min(100cqw, 100cqh); width: var(--side); height: var(--side); max-width: none; aspect-ratio: auto; margin: 0; display: grid; grid-template-columns: auto repeat(8, 1fr); grid-template-rows: auto repeat(8, 1fr); gap: 2px; }
.fs .scan .axis { display: grid; place-items: center; color: var(--dim); font-size: 11px; }
.fs .scan-cell { font-size: min(22px, calc(var(--side) / 14)); }
.fs .scan-cell.ship { width: 100%; height: 100%; box-sizing: border-box; }
.fs .hint { margin: 6px 0 0; }
.fs .log { font-size: 14px; }
.fs .log div { min-height: 1.2em; }
.fs .status { overflow: auto; }
.fs .status-block { padding-bottom: 6px; margin-bottom: 6px; }
.fs .status-title { margin-bottom: 3px; font-size: 10px; }
.fs .bar { height: 4px; margin-top: 2px; }
.fs .status-grid { gap: 2px 6px; }
.fs .status-grid dd { font-size: 14px; }
.fs .pace { color: var(--ink); font-size: 11px; }
.fs .pace.behind { color: var(--alert); }
.fs .system-chip { margin: 1px 1px 1px 0; padding: 1px 4px; }
.fs .nearby { position: relative; }
.fs .nearby-map { width: min(240px, 100%); margin: 0 auto; }
.fs .nearby-cell { min-height: 30px; }
.fs .nearby-frame { color: var(--dim); font-size: 9px; }
.fs .nearby-label { text-align: center; line-height: 1.2; }
.fs .nearby-row { display: flex; align-items: center; gap: 4px; }
.fs .nearby-side { width: 10px; text-align: center; }
.fs .ship-details summary { color: var(--dim); cursor: pointer; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.fs .typepanel form { grid-template-columns: 1fr auto; }
.fs .typepanel label { display: none; }
.fs #cmd { border: 0; border-bottom: 1px solid var(--ink); min-height: 36px; }
.fs #cmd:focus { border-bottom-width: 2px; outline: 0; }
.fs .autocomplete { margin: 2px 0 0; font-size: 12px; }
.fs .toolbar { gap: 6px; padding-top: 6px; }
.fs .tool-group { align-items: end; padding-right: 6px; }
.fs .tool-group span { writing-mode: horizontal-tb; transform: none; align-self: flex-start; margin-right: 3px; }
.fs .mission-overlay, .fs .briefing-overlay { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: rgba(13,9,5,.88); }
.fs .briefing-overlay { z-index: 5; }
.fs .briefing-card { position: relative; width: min(560px, calc(100% - 32px)); box-sizing: border-box; border: 1px solid var(--ink); background: var(--paper); padding: 24px; text-align: center; }
.fs .briefing-card h2 { margin: 0 0 12px; font: 56px/.9 var(--display); letter-spacing: .08em; }
.fs .briefing-close { position: absolute; top: 6px; right: 6px; border: 0; font-size: 24px; }
.fs .briefing-dedication { margin: 0 auto 16px; color: var(--ink); font: 26px/1.05 var(--display); }
.fs .briefing-summary, .fs .briefing-quick { margin: 8px auto; max-width: 52ch; color: var(--dim); }
.fs .briefing-quick { padding: 8px; border-block: 1px solid var(--rule); }
.fs .briefing-difficulty, .fs .briefing-actions { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.fs .briefing-start, .fs .briefing-continue { background: var(--ink); color: var(--paper); }
.fs .briefing-credit { margin: 16px 0 0; color: var(--dim); font-size: 10px; }
.fs #difficultyTag { color: var(--dim); }
.fs .briefing-new-row { display: flex; align-items: flex-start; justify-content: center; gap: 12px; margin-top: 12px; }
.fs .briefing-new-row > span { align-self: center; color: var(--dim); font-size: 12px; }
.fs .briefing-choice { display: grid; gap: 2px; justify-items: center; }
.fs .briefing-choice small { color: var(--dim); font-size: 12px; }
.fs .briefing-replace { margin: 8px 0 0; color: var(--dim); font-size: 11px; }
.fs .briefing-continue { min-width: 180px; }
@media (max-width: 1099px) {
  .fs .bridge { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(280px, 1fr) 32vh; }
  .fs .printout { grid-column: 1/-1; grid-row: 2; }
}
@media (max-width: 899px) and (min-width: 700px) {
  .fs .toolbar { flex-wrap: wrap; }
}
@media (max-width: 699px) {
  .fs .wrap, .fs.standalone .wrap { height: auto; min-height: 100dvh; padding: 8px 8px 58px; }
  .fs .topbar { grid-template-columns: 1fr; height: auto; min-height: 44px; }
  .fs .titleline { padding-right: 150px; }
  .fs .top-controls { position: absolute; top: 8px; right: 8px; gap: 2px; }
  .fs .top-controls .about { font-size: 0; padding-inline: 2px; }
  .fs .top-controls .about::first-letter { font-size: 18px; }
  .fs .top-controls .new-game { display: block; font-size: 9px; padding-inline: 2px; }
  .fs .bridge { height: auto; min-height: 0; display: flex; flex-direction: column; overflow: visible; gap: 8px; }
  .fs .scanbox { height: min(92vw, 360px); }
  .fs .status { max-height: none; overflow: visible; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .fs .status-block:nth-child(n+3) { display: none; }
  .fs .ship-details { display: block !important; grid-column: 1/-1; }
  .fs .nearby { display: none; }
  .fs .printout { height: 30vh; min-height: 160px; }
  .fs .toolbar { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; margin: 0; padding: 5px 8px; background: var(--paper); overflow-x: auto; flex-wrap: nowrap; }
  .fs .tool-group { flex-shrink: 0; }
  .fs .tool-group span { display: none; }
  .fs .briefing-card { padding: 18px 14px; }
  .fs .briefing-card h2 { font-size: 44px; }
  .fs .briefing-dedication { font-size: 23px; }
}
