/* Layout for the board and phone pages. Colours, font, panels and buttons come from
   /skin/skin.css (generated by theme/export_web.py). */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scrollbar-gutter: stable; }  /* the board sizes its map from the client width; keep it steady */
body { background: var(--page); color: var(--text); font: var(--font-body) var(--font); -webkit-text-size-adjust: 100%; }
button, input { font: inherit; }
/* iOS zooms in on a quick second tap (tapping Upgrade a few times): taps are just taps here. Pinching
   still zooms, and the board's map handles its own gestures (touch-action: none). */
html, button, .px-btn { touch-action: manipulation; }
[hidden] { display: none !important; }

.dim { color: var(--text-dim); }
.accent { color: var(--text-accent); }
.warn { color: var(--text-warning); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.px-panel { min-width: 0; }
.px-panel p { margin: 0 0 4px; }
.px-btn { line-height: 1.1; }
a.px-btn { display: inline-block; text-decoration: none; align-self: flex-start; }

.chip { display: inline-block; padding: 0 6px; border: 2px solid #000; color: #000; line-height: 1.1; }
.big { font-size: var(--font-header); }

/* Sector map: tiles, robots, ships and animations are absolutely positioned (renderMap in
   common.js). Map labels use a plain bold sans-serif, which reads far better at tile size. */
.map { position: relative; flex: none; overflow: hidden; background: #000; font-family: Arial, Helvetica, sans-serif; font-weight: bold; }
.tile { position: absolute; width: var(--cell); height: var(--cell); display: flex; align-items: center;
        justify-content: center; font-size: calc(var(--cell) * 0.3); line-height: 1; user-select: none; overflow: hidden; }
/* Fog: dotted (3 x 3 dots a tile), over a grey that is a heatmap of the asteroids it hides (game.py
   fog_heat). The dots are lighter than whatever grey is under them, so even the lightest fog never
   looks discovered, and big enough to show on the tablet. */
.tile.fog { background-image: radial-gradient(rgba(255, 255, 255, 0.2) 1.5px, transparent 2.1px);
            background-size: calc(var(--cell) / 3) calc(var(--cell) / 3); }
.tile.target { cursor: pointer; box-shadow: inset 0 0 0 3px var(--hl); }
.tile.target::after { content: ""; position: absolute; inset: 0; background: var(--hl); opacity: 0.4; }
.tile.selected { box-shadow: inset 0 0 0 4px #fff; }
.robot { position: absolute; z-index: 3; width: calc(var(--cell) * 0.3); height: calc(var(--cell) * 0.3);
         margin: calc(var(--cell) * 0.7 - 3px) 0 0 calc(var(--cell) * 0.7 - 3px);
         border: 2px solid #000; box-sizing: border-box; pointer-events: none; }
.ship-token { position: absolute; z-index: 4; width: calc(var(--cell) * 0.78); height: calc(var(--cell) * 0.78);
              margin: calc(var(--cell) * 0.11) 0 0 calc(var(--cell) * 0.11); display: flex; align-items: center;
              justify-content: center; color: #000; font-size: calc(var(--cell) * 0.36); border: 2px solid #000;
              box-sizing: border-box; pointer-events: none; }
.ship-token.shared { width: calc(var(--cell) * 0.5); height: calc(var(--cell) * 0.5); margin: 0; font-size: calc(var(--cell) * 0.24); }
.ship-token.corner-1 { margin-left: calc(var(--cell) * 0.5); }
.ship-token.corner-2 { margin-top: calc(var(--cell) * 0.5); }
.ship-token.corner-3 { margin: calc(var(--cell) * 0.5) 0 0 calc(var(--cell) * 0.5); }
.ship-token.beside { width: calc(var(--cell) * 0.4); height: calc(var(--cell) * 0.4); margin: 0; font-size: calc(var(--cell) * 0.19);
                     border-width: 2px; }
.ship-token.beside.corner-1 { margin-left: calc(var(--cell) * 0.6); }
.ship-token.beside.corner-2 { margin-top: calc(var(--cell) * 0.6); }
.ship-token.beside.corner-3 { margin: calc(var(--cell) * 0.6) 0 0 calc(var(--cell) * 0.6); }
.tile.has-module { align-items: flex-start; font-size: calc(var(--cell) * 0.2); text-shadow: 0 0 2px #000, 0 0 2px #000; }
.ship-token.teamed { border-width: calc(var(--cell) * 0.08 + 1px); }
.ship-token.active { animation: active-ship 1.4s ease-in-out infinite; }
@keyframes active-ship { 0%, 100% { box-shadow: 0 0 0 2px #fff; } 50% { box-shadow: 0 0 0 3px #fff, 0 0 12px 4px rgba(255, 255, 255, 0.55); } }
.zones { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; overflow: visible; }
.zone { fill-opacity: 0.08; stroke-width: 2; stroke-opacity: 0.85; }
.zone.carried { stroke-dasharray: 6 4; fill-opacity: 0.04; stroke-opacity: 0.6; }
.zone.comms { stroke: #22B14C; fill: #22B14C; }
.zone.turret { stroke: #ED1C24; fill: #ED1C24; }
.zone.jammer { stroke: #C38FFF; fill: #A349A4; }
.dropped { position: absolute; z-index: 2; width: calc(var(--cell) * 0.72); height: calc(var(--cell) * 0.72);
           margin: calc(var(--cell) * 0.14) 0 0 calc(var(--cell) * 0.14); border: 3px solid; box-sizing: border-box;
           background: #fff; image-rendering: pixelated; pointer-events: none; }
.flying-module { position: absolute; z-index: 7; image-rendering: pixelated; border: 2px solid #000; background: #fff;
                 box-sizing: border-box; pointer-events: none; }
.coin { position: absolute; z-index: 7; border-radius: 50%; background: #FFC90E; border: 2px solid #000; color: #000;
        display: flex; align-items: center; justify-content: center; font-family: Arial, sans-serif; font-weight: bold;
        box-sizing: border-box; pointer-events: none; }
.laser-beam.turret { background: #FFF200; box-shadow: 0 0 5px 2px #FF7F27; }
.drone { position: absolute; z-index: 5; border: 2px solid #000; box-sizing: border-box; pointer-events: none; }
.laser-beam { position: absolute; z-index: 6; transform-origin: 0 50%; background: #ED1C24;
              box-shadow: 0 0 6px 2px #FF7F27; pointer-events: none; }
.impact { position: absolute; z-index: 6; pointer-events: none;
          background: radial-gradient(circle, #FFFFFF 0%, #FFF200 20%, #FF7F27 40%, rgba(237, 28, 36, 0.7) 58%, transparent 70%); }

.timer { font-size: var(--font-display); line-height: 1; text-align: center; min-width: 3ch; }
.timer.paused, .timer.frozen { color: var(--text-dim); }
.timer.low { color: #FF5A5F; animation: timer-low 1s ease-in-out infinite; }
@keyframes timer-low { 50% { opacity: 0.55; } }
.log { overflow-y: auto; white-space: pre-wrap; }
/* Log lines coloured like the buttons that caused them (see the legend) */
.log .log-info { color: #C3C3C3; }
.log .log-turn { color: var(--text-dim); }
.log .log-game { color: var(--text); }
.log .log-primary { color: #3FD16A; }
.log .log-instant { color: #3DBFF5; }
.log .log-money { color: #FFF200; }
.log .log-danger { color: #FF5A5F; }
.readout { margin: 0; font: inherit; white-space: pre; }
.ship { position: relative; background-size: 100% 100%; flex: none; image-rendering: pixelated; }
.ship img { position: absolute; image-rendering: pixelated; }

.legend-row { gap: 6px 22px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.swatch { pointer-events: none; margin: 0; }

.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); display: flex; align-items: center;
           justify-content: center; padding: 12px; z-index: 10; }
.overlay > .px-panel { width: min(640px, 100%); }
.modal-body { max-height: 70vh; overflow-y: auto; white-space: pre-wrap; margin-bottom: 8px; }
.modal-buttons { justify-content: flex-end; }
.toast { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 20; width: min(520px, 94vw); }
/* The tutorial's coach (tutorial games): a card at the bottom, above the aiming bar, and a pulsing
   frame round whatever it talks about. The page leaves room for the card (--coach-h: its height). */
.tutorial-card { position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 15;
                 width: min(540px, 96vw); }
.tutorial-card p { margin: 6px 0; }
.tutorial-card .px-panel { margin: 0; }
.coach-plan { margin: 4px 0 6px; }
.tutorial-pill { position: fixed; right: 8px; bottom: 8px; z-index: 15; margin: 0; }
body.coached .play-page { padding-bottom: calc(var(--coach-h, 230px) + 30px); }
body.coached .aim-bar { bottom: calc(var(--coach-h, 220px) + 8px); }
body.coached .overlay { padding-bottom: calc(var(--coach-h, 220px) + 16px); }
body.coached .overlay .modal-body { max-height: calc(100vh - var(--coach-h, 220px) - 140px); }
.tut-point { outline: 5px solid #FFD25A; outline-offset: 3px; box-shadow: 0 0 18px 6px rgba(255, 210, 90, 0.7);
             animation: tut-pulse 1.1s ease-in-out infinite; }
.tile.tut-point { z-index: 4; outline-offset: -2px; }
@keyframes tut-pulse { 50% { outline-color: rgba(255, 210, 90, 0.35); box-shadow: 0 0 6px 2px rgba(255, 210, 90, 0.3); } }
/* Its introduction: a few pages when the game starts. */
.overlay.intro-overlay { z-index: 16; }
.intro-overlay .modal-body { white-space: normal; }
.intro-head { justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.intro p { margin: 8px 0; }
.intro-list { margin: 0; padding-left: 20px; }
.intro-list li { margin: 8px 0; }
.intro .sample { display: inline-block; pointer-events: none; margin: 0 2px; padding: 0 6px; }
.intro-rock { align-items: center; flex-wrap: nowrap; gap: 8px; margin: 4px 0; }
.intro-swatch { display: inline-block; width: 20px; height: 20px; border: 2px solid #000; flex: none; }
.intro-module img { width: 48px; height: 48px; }
.intro-module { grid-template-columns: 48px 1fr; }
.shop-category { margin: 12px 0 4px; color: var(--text-accent); letter-spacing: 1px; text-transform: uppercase; }
.connection { position: fixed; top: 0; left: 0; right: 0; background: #ED1C24; color: #fff; text-align: center; z-index: 30; }

table.crew { border-collapse: collapse; width: 100%; }
table.crew th { color: var(--text-dim); font-weight: normal; text-align: left; padding: 0 6px; }
table.crew td { padding: 2px 6px; }
table.crew tr.active td { background: var(--screen-alt); }
.num { text-align: right; }

select.field { background: var(--screen-alt); color: var(--text); border: 2px solid #3A3A3A; padding: 2px 4px; }
input.field { background: var(--screen-alt); color: var(--text); border: 2px solid #3A3A3A; padding: 2px 6px; }
input.field:focus { outline: none; border-color: var(--text-accent); }
input.number { width: 7ch; text-align: right; }

/* Cards in the phone's module and shop lists */
.card { display: grid; grid-template-columns: 64px 1fr; gap: 4px 10px; padding: 6px; background: var(--screen-alt); margin-bottom: 6px; }
.card img { width: 64px; height: 64px; image-rendering: pixelated; grid-row: span 2; }
.card .small { font-size: var(--font-small); }
.card.planned { outline: 2px dashed #FFF200; outline-offset: -2px; }  /* bought by the upgrade plan */

/* ---------------------------------------------------------------- board (tablet) */
.board-page { display: grid; grid-template-rows: auto 1fr auto; gap: 10px; padding: 10px; }
.board-play { display: grid; gap: 8px; padding: 8px; }
.board-play.landscape { grid-template-columns: auto minmax(0, 1fr); height: 100vh; }
.map-box { display: flex; align-items: center; justify-content: center; }
.board-info { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; }
.landscape .board-info .log-panel { flex: 1 1 120px; display: flex; flex-direction: column; min-height: 120px; }
.landscape .board-info .log { flex: 1; min-height: 0; }
.portrait .board-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.portrait .map-box { justify-self: center; }
.portrait .board-info .log { max-height: 30vh; }
.span-all { grid-column: 1 / -1; }
.crew-row { padding: 2px 4px; }
.crew-row.active { background: var(--screen-alt); }
.crew-main { display: flex; align-items: center; gap: 8px; }
.crew-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-money { font-size: var(--font-header); }
.small { font-size: var(--font-small); }
.timer-box { display: flex; align-items: center; gap: 12px; }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 10px; align-items: start; }
.setup-field { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 0; }
.lobby { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.join-column { max-width: max(320px, 46vw); }  /* long notes wrap instead of widening the column */
.qr img { display: block; width: min(46vh, 70vw); height: auto; image-rendering: pixelated; }
.qr-small img { width: min(30vh, 40vw); }  /* two QR codes in the lobby: the Wi-Fi's and the game's */
.join-url { font-size: var(--font-header); word-break: break-all; }

/* ---------------------------------------------------------------- player (phone) */
.play-page { display: flex; flex-direction: column; gap: 8px; padding: 8px; max-width: 560px; margin: 0 auto; }
.play-header { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.play-header .timer { font-size: var(--font-header); }
/* The phone's header (name, money, timer) stays at the top while scrolling, and pulses red in
   the last seconds of your turn. */
.play-top { position: sticky; top: 0; z-index: 8; }
.play-top.hurry { animation: hurry 1s ease-in-out infinite; }
@keyframes hurry { 0%, 100% { box-shadow: 0 0 0 0 rgba(237, 28, 36, 0); }
                   50% { box-shadow: 0 0 14px 5px rgba(237, 28, 36, 0.85); } }
.cash { font-size: var(--font-header); }  /* not "money": that's the yellow button class */
/* While choosing a tile, Confirm / Cancel stay pinned to the bottom of the screen (like the header
   at the top); the page gets room at the bottom so nothing hides behind them. */
.aim-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(560px, 100%);
           padding: 0 8px 8px; box-sizing: border-box; z-index: 9; }
.play-page.aiming { padding-bottom: 150px; }
.ship-panel-body { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.join-form .setup-field input { width: 12ch; text-align: left; }
.your-turn { color: var(--text-accent); font-size: var(--font-header); }
.pan { margin-top: 8px; }
.pan .px-btn { min-width: 3ch; }
.lens-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.lens-grid .px-btn { margin: 0; }
.board-info .legend .swatch { padding: 0 6px; font-size: 10px; }
.board-info .legend-row { gap: 4px 16px; }

/* ---------------------------------------------------------------- teams and stats */
.team-block { margin-bottom: 6px; }
.team-head { display: flex; align-items: center; gap: 8px; padding: 0 6px; border: 2px solid #000; }
.team-score { font-size: var(--font-header); white-space: nowrap; }
.overlay.wide > .px-panel { width: min(960px, 100%); }
table.stats { white-space: nowrap; }
table.stats tr:nth-child(even) td { background: var(--screen-alt); }
.team-pick { display: grid; gap: 6px; }
.team-pick .px-btn { margin: 0; text-align: left; }

/* ---------------------------------------------------------------- help (rules) */
.header-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.header-row .px-btn { margin: 0; }
.overlay.rules .modal-body { white-space: normal; max-height: 76vh; }
.rules-section { border-bottom: 2px solid #2A2A2A; padding: 4px 0; }
.rules-section summary { cursor: pointer; color: var(--text-accent); font-size: var(--font-header); }
.rules-section[open] summary { margin-bottom: 4px; }
.rules-list { margin: 0 0 6px; padding-left: 20px; }
.rules-list li { margin-bottom: 4px; }
.table-wrap { overflow-x: auto; margin-bottom: 6px; }
.rules-table { font-size: var(--font-small); }
.rules-table td { vertical-align: top; }
.rules-table tr:nth-child(even) td { background: var(--screen-alt); }
.card .span-card { grid-column: 1 / -1; }
.zone-legend { margin-top: 4px; }
.zone-legend .comms { color: #22B14C; }
.zone-legend .turret { color: #ED1C24; }
.zone-legend .jammer { color: #C38FFF; }
.tile-info { margin-top: 8px; padding: 4px 8px; background: var(--screen-alt); }
.tile-info-head { justify-content: space-between; }
.tile-info-head .px-btn { margin: 0; }

/* ---------------------------------------------------------------- upgrade planning */
.plan-box { border: 2px solid #FFF200; padding: 6px 8px; margin-bottom: 8px; }
.plan-head { justify-content: space-between; }
.plan-step { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 2px 0; }
.plan-step .px-btn { margin: 0; padding: 0 8px; }
.plan-total { justify-content: space-between; margin-top: 4px; }

/* ---------------------------------------------------------------- computer players */
.bot-tag { font-size: var(--font-small); color: var(--text-dim); border: 1px solid #3A3A3A; padding: 0 4px; white-space: nowrap; }
.crew-line .px-btn { margin: 0 0 0 6px; padding: 0 8px; }

/* ---------------------------------------------------------------- board tile panel */
.board-info .tile-panel { flex: none; }
.tile-panel .row { margin-top: 4px; }
.tile-panel .px-btn { margin: 0; padding: 0 8px; }

.setup-note { margin-top: 10px; }
.setup-guide { border-collapse: collapse; margin: 2px 0 4px; }
.setup-guide td { padding: 0 16px 0 0; }

/* ---------------------------------------------------------------- playtest 2026-10-06 */
.tile.void { background: #050505; background-image: none; }
.zone.owned { stroke: var(--zone, #ED1C24); fill: var(--zone, #ED1C24); }
.ship img.tappable { cursor: pointer; }
.ship img.picked { outline: 3px solid #fff; outline-offset: 1px; }
.loadout { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.loadout + .loadout { border-top: 1px solid #333; padding-top: 6px; }
/* The board's map: pinch / wheel to zoom, drag to pan (board.js), with +, - and Fit buttons. */
.map-box.zoomable { position: relative; overflow: hidden; display: block; touch-action: none; }
.map-box.zoomable > .map { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.map-box.dragging { cursor: grabbing; }
.zoom-controls { position: fixed; left: 8px; bottom: 8px; z-index: 12; display: flex; gap: 4px; }
.zoom-controls .px-btn { margin: 0; min-width: 2.4em; padding: 2px 8px; opacity: 0.9; }
.tile.giant { z-index: 0; }
.giant-label { position: absolute; z-index: 2; pointer-events: none; display: flex; align-items: center;
               justify-content: center; font-size: calc(var(--cell) * 0.42); }
.board-play.landscape { grid-template-columns: auto minmax(0, 1fr); }

/* ---------------------------------------------------------------- Jammer hack (play.js openHack, board status) */
.overlay.hack > .px-panel { max-height: calc(100vh - 24px); display: flex; flex-direction: column; gap: 6px; }
.hack-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hack-clock { font-size: var(--font-header); min-width: 0; }
.hack-clock.low { color: #FF5A5F; animation: timer-low 1s ease-in-out infinite; }
canvas.signal { display: block; align-self: center; max-width: 100%; border: 2px solid #2A2A2A; }
.hack-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; }
.hack-match { margin-left: auto; font-size: var(--font-header); color: var(--text-warning); }
.hack-match.ok { color: var(--text-accent); }
.hack-waves { flex: 1 1 auto; min-height: 96px; overflow-y: auto; }
.hack-wave { background: var(--screen-alt); padding: 2px 8px 4px; margin-bottom: 6px; }
.hack-control { display: grid; grid-template-columns: 4ch 1fr 3ch; gap: 8px; align-items: center; }
.hack-slider { width: 100%; height: 32px; margin: 0; accent-color: #C38FFF; cursor: pointer; }
.hack-value { text-align: right; }
.board-info .hack-status canvas.signal { margin-top: 4px; }

/* ---------------------------------------------------------------- playtest 2026-10-12 */
/* While someone aims, a frame in their colour runs around the board's whole screen (board.js
   syncAimFrame): hands off the board, a tap would pick their target. It lets taps through. */
.aim-frame { position: fixed; inset: 0; z-index: 25; pointer-events: none; border: 8px solid var(--frame);
             animation: aim-frame 1.6s ease-in-out infinite; }
@keyframes aim-frame { 0%, 100% { box-shadow: inset 0 0 6px 2px var(--frame); }
                       50% { box-shadow: inset 0 0 26px 8px var(--frame); } }
.aim-frame-tag { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px);
                 background: var(--frame); color: #000; padding: 0 12px 2px; white-space: nowrap; overflow: hidden;
                 text-overflow: ellipsis; font-size: var(--font-header); }
/* A player tapped in the crew list or Leaderboard: their ship is outlined and pinged by a ring. */
.pickable { cursor: pointer; }
.crew-row.spotlit, table.crew tr.spotlit td { outline: 2px solid #fff; outline-offset: -2px; }
.ship-token.spotlight { z-index: 5; outline: 3px solid #fff; outline-offset: 2px; }
.ship-token.spotlight::after { content: ""; position: absolute; left: 50%; top: 50%; width: calc(var(--cell) * 2.6);
                               height: calc(var(--cell) * 2.6); margin: calc(var(--cell) * -1.3) 0 0 calc(var(--cell) * -1.3);
                               border: 3px solid #fff; border-radius: 50%; box-sizing: border-box;
                               box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5); animation: spotlight 1.4s ease-out infinite; }
@keyframes spotlight { 0% { transform: scale(0.25); opacity: 1; } 65% { opacity: 0.9; } 100% { transform: scale(1); opacity: 0; } }
/* Warp Drive jumps (common.js animateWarp) and robots despawning on a dead asteroid (animateDespawn). */
.warp-ghost { z-index: 5; }
.warp-burst { position: absolute; z-index: 6; pointer-events: none; border-radius: 50%; opacity: 0;
              background: radial-gradient(circle, #FFFFFF 0 12%, var(--warp) 30%, rgba(61, 191, 245, 0.45) 48%, transparent 68%); }
.warp-spark { position: absolute; z-index: 6; pointer-events: none; border-radius: 50%; background: #FFFFFF; opacity: 0;
              box-shadow: 0 0 6px 2px var(--warp); }
.robot.despawning { z-index: 3; }

/* ---------------------------------------------------------------- playtest 2026-10-15 */
/* The phone's ship picture: modules and free slots are buttons (play.js showModuleDialog, Construct). */
.ship .empty-slot { position: absolute; padding: 0; margin: 0; background: transparent; cursor: pointer;
                    border: 2px dashed rgba(255, 255, 255, 0.45); box-sizing: border-box; }
.ship .empty-slot:hover, .ship .empty-slot:focus-visible { background: rgba(255, 255, 255, 0.15); }
.module-dialog { display: grid; grid-template-columns: 64px 1fr; gap: 4px 10px; white-space: normal; }
.module-dialog img { width: 64px; height: 64px; image-rendering: pixelated; }
.legend-options { margin-top: 8px; }
.legend-options .px-btn { margin: 0; }
/* The phone's border glows in the player's colour when their turn starts (play.js flashTurnFrame). */
.turn-frame { z-index: 26; }

/* ---------------------------------------------------------------- ship sprites (common.js shipSprite) */
/* A ship alone on its tile: its sprite filling the tile, under robot markers, with its alias tag in
   the top-left corner. The two frames of the sheet take turns, flickering the engines. */
.ship-token.sprite { width: var(--cell); height: var(--cell); margin: 0; z-index: 3; background: none;
                     border: 0; animation: none; overflow: visible; }
.robot { z-index: 4; }
.ship-sprite { position: absolute; inset: 0; }
.ship-frame { position: absolute; inset: 0; background-size: 400% 500%; background-repeat: no-repeat;
              image-rendering: pixelated; }
.ship-frame:first-child { animation: ship-engine-a 0.5s steps(1, end) infinite; }
.ship-frame:last-child { animation: ship-engine-b 0.5s steps(1, end) infinite; }
@keyframes ship-engine-a { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes ship-engine-b { 0% { opacity: 0; } 50% { opacity: 1; } }
.ship-tag { position: absolute; left: 0; top: 0; z-index: 1; padding: 0 2px; color: #000; border: 1px solid #000;
            font-size: calc(var(--cell) * 0.22); line-height: 1.05; }
.ship-tag.teamed { border-width: calc(var(--cell) * 0.05 + 1px); }
.ship-token.sprite.active .ship-sprite { animation: active-sprite 1.4s ease-in-out infinite; }
@keyframes active-sprite { 0%, 100% { filter: drop-shadow(0 0 1px #fff); }
                           50% { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 6px rgba(255, 255, 255, 0.6)); } }
.ship-token.sprite.active .ship-tag { outline: 2px solid #fff; }

/* ---------------------------------------------------------------- playtest 2026-10-15, evening */
/* The board's fog dots, finer than the phone's: the tablet shows them bigger. */
.map-box.zoomable .tile.fog { background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.5px); }
/* Fusion Hop (common.js animateHop): blue engine flames behind the ship, and puffs on its path. */
.hop-flame { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none;
             background: radial-gradient(circle, #FFFFFF 0 14%, #9BE8FF 32%, #3DBFF5 52%, rgba(61, 191, 245, 0) 72%); }
.hop-puff { position: absolute; z-index: 2; border-radius: 50%; pointer-events: none; opacity: 0;
            background: radial-gradient(circle, rgba(155, 232, 255, 0.9) 0 20%, rgba(61, 191, 245, 0.5) 45%, rgba(61, 191, 245, 0) 70%); }
