:root {
    --bg: #080b14;
    --panel: #101725;
    --card: #151d2e;
    --line: #243149;
    --text: #dbe3f0;
    --muted: #7d8ba5;
    --accent: #5aa9ff;

    /* The backgrounds of rails, overlays and highlights, apart from the map's space, so the empire-colour setting can
       recolour them alone. See GameArt.InterfaceFor. */
    --chrome: #080b14;
    --shade: #04060c;
    --tint: #5aa9ff;
    --ok: #57c98b;
    --warn: #e3b341;
    --error: #ff6b6b;

    --header: 2.6rem;
    --hud-top: 2.4rem;
    --rail: 13rem;

    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

/*
 * The page itself never scrolls. Everything is sized against the viewport and anything that
 * cannot fit gets its own contained scroll area — see .scroll below. Fixing this at the root
 * means a long list somewhere deep in the UI cannot push the whole layout around.
 */
html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;
    /* <b>The interface scales with the window</b>, 28 November 2026: 15px at 1920 by 1080, by whichever of width and height is
       shorter, from 11px to 18px — and times the Interface size setting (--ui-scale, kept per browser; see SettingsControls).
       Everything sized in rem follows it: the rails, bars, sheets and text. The galaxy map and the battle field are drawn at
       their own zoom and only take the room the rest leaves. Gerald: "lets try the hybrid scaling". */
    font-size: clamp(calc(11px * var(--ui-scale, 1)), calc(min(0.78125vw, 1.3889vh) * var(--ui-scale, 1)), calc(18px * var(--ui-scale, 1)));
    line-height: 1.45;
}

#app { height: 100%; }

h1, h2, h3 {
    margin: 0 0 0.3rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

h1 { font-size: 1.15rem; }
h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
h3 { font-size: 0.9rem; }

h1:focus { outline: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

hr { border: 0; border-top: 1px solid var(--line); margin: 0.7rem 0; }

/* ── Shell ───────────────────────────────────────────────────────────────── */

.shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
}

.brand { font-weight: 700; letter-spacing: 0.22em; color: var(--text); font-size: 0.85rem; }
.brand-sub { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.04em; }

/* The lobby draws its own masthead, since the shell no longer has one. */
.lobby-brand {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
}

/*
 * The body is the positioning context for the galaxy and everything stacked over it.
 * min-height: 0 is what lets a flex child actually shrink rather than overflow its parent.
 */
.shell-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* The one place scrolling is allowed: inside a panel that has been given a bounded height. */
.scroll {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* ── Galaxy, which is always the page underneath everything ──────────────── */

/*
 * The gradient fills the whole body, but the map is inset by the height of the two heads-up bars
 * so a star sitting at the edge of the galaxy does not end up with its name behind one of them.
 */
/*
 * Black, and not the blue it was. The gradient ran from #0d1425 to #05070f - a night sky with the
 * blue left in - and against it every faint thing on the map was competing with a colour rather
 * than sitting on nothing: the hex grid, the fog, and eight empire colours that are all lighter
 * blues and greens. Space is the one part of this screen that should be absent.
 *
 * A trace of a gradient is kept, and only a trace: enough that the middle of the galaxy is not the
 * same flat tone as the corners of a large monitor.
 */
.galaxy-layer {
    position: absolute;
    inset: 0;
    padding: var(--hud-top) var(--rail) 0.5rem var(--rail);
    background: radial-gradient(ellipse at 50% 45%, #060608 0%, #000000 78%);
}

.starmap {
    display: block;
    width: 100%;
    height: 100%;

    /* The sky does not drag, so a drag across it would otherwise sweep every star's name into a
       text selection. */
    user-select: none;
}

/*
 * Everything drawn on the star map is measured in map units, and the map is framed on a cluster
 * ten units across during the opening and on a galaxy three hundred units across afterwards. A
 * fixed stroke width would therefore be invisible at one scale and cover the screen at the other,
 * so every line and every letter below is expressed against --map-unit, which the component sets
 * from whatever the map is currently framed on.
 */
.starmap { --map-unit: 1; }

/* While the sky is being carried on the middle button. */
.starmap.grabbing { cursor: grabbing; }

/*
 * Decoration, not controls. Every one of these is drawn over or through a star, so without this
 * the plotted course ends up sitting on the very star it points at and swallowing the click meant
 * for it. Only the star's own hit disc and the fleet marker take pointer events.
 */
.corezone,
.course,
.plotline,
.inrange,
.reachzone,
.owned,
.maw,
.selectring,
.fleetmark {
    pointer-events: none;
}

.sys { cursor: pointer; }

.starlabel {
    text-anchor: middle;
    font-family: inherit;
    pointer-events: none;
    paint-order: stroke;
    stroke: #05070f;
    stroke-width: calc(var(--map-unit) * 1);
    stroke-linejoin: round;
}

/*
 * Stars out of sight are named but dim — you know where the light is, not what orbits it.
 *
 * And a name that is not dim is written in the colours flying over the star: --flag, which the
 * markup sets from the holder's seat, from red for a garrison, or not at all for a star nobody has
 * settled. The fallbacks are what a name was before there was an answer, so a galaxy with nothing
 * in it yet looks exactly as it did. See Game.razor's FlagOf.
 */
.starlabel.unknown { fill: #55627c; }
.starlabel.known { fill: var(--flag, var(--text)); }
.starlabel.mine { fill: var(--flag, var(--accent)); font-weight: 700; }

/* Out of sight: still named, and no longer news. Ahead of the hover rule so that pointing at one
   still lights it up. */
.sys.unwatched .starlabel { fill: #7b8aa6; }

/* Brightened while the pointer is over it, and nothing at all while its panel is open. A name now
   carries whose the star is, and a mark that repaints it is a mark that erases the answer — the
   ring around the star is what says which one you have open. */
.sys:hover .starlabel { filter: brightness(1.35); }

/* The hole itself: near-black, because it is the one thing on the map that is not a light. Ringed
   in violet so it reads as an object at the middle of its purple ground rather than as a gap where
   the sheet failed to draw. */
/* The Maw takes clicks across the whole of its face, which is the one place on this map where
   that has to be said out loud. Everything else is a star: a dot a few units across, drawn on top
   of a hit area of its own. This is drawn to the size of what it swallows — tens of units wide —
   and it was pointer-events: none like the rings around it, so the only part of it that answered a
   click was the small target underneath. Clicking the obvious middle of the drawing did nothing,
   which reads as a dead control rather than as a near miss. */
.mawbody {
    fill: #000;
    fill-opacity: 0.001;
    stroke: none;
    cursor: pointer;
}

/* <b>The Maw as a whirlpool</b> (see StarField): spiral arms of glowing gas turning in, the inner ones faster, around a
   ring of light at the edge of the dark. Gerald's pick, 7 November 2026. Widths are set on the markup as shares of the hole's
   reach, so it grows with the zoom as the hole does; each turning group turns about its own middle, which is the hole's. */
.mawwhirl { pointer-events: none; }
.mawwhirl .mawglow { fill: url(#mawglow); }
.mawwhirl .arm { fill: none; stroke-linecap: round; }
.mawwhirl .slow .arm { stroke-opacity: 0.55; }
.mawwhirl .mid .arm { stroke-opacity: 0.75; }
.mawwhirl .fast .arm { stroke-opacity: 0.9; }
.mawwhirl .arm.deep { stroke: #5b21b6; }
.mawwhirl .arm.dusk { stroke: #7c3aed; }
.mawwhirl .arm.violet { stroke: #8b5cf6; }
.mawwhirl .arm.magenta { stroke: #d946ef; }
.mawwhirl .arm.white { stroke: #fde7ff; }
.mawwhirl .arm.cyan { stroke: #22d3ee; }
.mawwhirl .mawcore { fill: #000; }
.mawwhirl .mawlip { fill: none; stroke: #fff2fb; animation: mawlip 6s steps(30) infinite; }
/* Turned in steps, about ten a second, rather than smoothly: a turning group inside the map's SVG repaints the whole map each
   time it moves, and sixty times a second that was a steady cost on the busiest screen in the game (it starved a headless
   browser of frames outright). At ten a second the arms still read as turning. */
.mawwhirl .whirl { transform-box: fill-box; transform-origin: center; animation: mawturn 26s steps(260) infinite; }
.mawwhirl .whirl.slow { animation-duration: 60s; animation-timing-function: steps(600); }
.mawwhirl .whirl.fast { animation-duration: 11s; animation-timing-function: steps(110); }
@keyframes mawturn { to { transform: rotate(360deg); } }
@keyframes mawlip { 0%, 100% { stroke-opacity: 0.55; } 50% { stroke-opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mawwhirl .whirl, .mawwhirl .mawlip { animation: none; } }

/* And the same for the Animations setting turned off (AccountSettings.Still). */
:root.still .mawwhirl .whirl, :root.still .mawwhirl .mawlip { animation: none; }

.maw { fill: none; stroke: #8b5cf6; stroke-width: calc(var(--map-unit) * 0.44); opacity: 0.85; }

/* A star work standing at a star: a small square off the shoulder, because a structure is a built
   thing and everything else near a star is round. Neutral rather than owned colours — whose it is
   is the star's own colouring's business. */
/*
 * ── The defences standing at a star ──────────────────────────────────────────────────────
 *
 * There was one grey square here meaning "star works are built at this star", which is the one
 * fact about a star that a player choosing where to send a fleet cannot act on: a shipyard and a
 * Star Fortress wore it alike. Gerald, 20 September 2026: "I dont think non defensive star works
 * should appear on the galaxy screen at all. Second, I think each defensive star work should have
 * its own icon."
 *
 * Two parts to every icon: a `plate`, which is the silhouette, and a `core`, which is whatever is
 * layered inside it. That split is what lets the four gun platforms be told apart at map size the
 * way they are told apart on the battle grid — same hexagon, more inside it — without a separate
 * rule for each. See StarField.DefenceIcon.
 */
.defencemark {
    pointer-events: none;
}

.defencemark .plate {
    fill: rgb(184 198 224 / 22%);
    stroke: #b8c6e0;
    stroke-width: calc(var(--map-unit) * 0.05);
    stroke-linejoin: round;
}

.defencemark .core {
    fill: none;
    stroke: #dce6f8;
    stroke-width: calc(var(--map-unit) * 0.05);
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* A few of them want a filled middle rather than an outlined one — the well's eye, and the gun
   bays dotted round a station's flats, which read as specks rather than as rings at this size. */
.defencemark .core.solid,
.defencemark circle.core,
.defencemark polygon.core:not(:first-of-type) {
    fill: #dce6f8;
}

/*
 * And the colours, which are the combat screen's own language carried onto the map: red for the
 * thing that destroys, white for the things that protect, purple for gravity. See --fx-offence and
 * friends, where that language is set out.
 */
.defencemark.is-cracker-platform .core,
.defencemark.is-missile-platform .core.solid {
    stroke: var(--fx-offence);
    fill: var(--fx-offence);
}

/* The Sentinel Grid carries the cracker's lance since 13 October 2026: the lance alone in red, the mesh
   in the white of the things that protect. */
.defencemark.is-sentinel-grid polygon.core {
    stroke: var(--fx-offence);
    fill: var(--fx-offence);
}

.defencemark.is-gravity-well-projector .plate,
.defencemark.is-gravity-well-projector .core {
    stroke: var(--fx-raider);
}

.defencemark.is-gravity-well-projector .core.solid {
    fill: var(--fx-raider);
}

/* The grid and the shield are defensive, so they keep the white the rest of them wear — what marks
   them out is the shape, which is the point of giving each one its own. */
.maw.faint { opacity: 0.35; stroke-dasharray: calc(var(--map-unit) * 0.8) calc(var(--map-unit) * 1.2); }

.owned { fill: none; stroke: var(--accent); stroke-width: calc(var(--map-unit) * 0.48); opacity: 0.85; }

/* Somebody else's star, while it can be seen to be. Broken rather than solid: what an empire has
   is a look at the place this turn, not a claim it can rely on next turn. */
.claimed {
    fill: none;
    stroke: var(--warn);
    stroke-width: calc(var(--map-unit) * 0.4);
    stroke-dasharray: calc(var(--map-unit) * 1.1) calc(var(--map-unit) * 1.1);
    opacity: 0.7;
    pointer-events: none;
}

/*
 * The scaffolding the galaxy stands on. Hairline and barely there: it is here so that distance can
 * be counted rather than estimated, and anything heavier competes with the stars it is under.
 * Width is against --map-unit like everything else on the map, so it stays a hairline at any zoom
 * rather than turning into a mesh of fat lines as you pull back.
 */
.hexgrid { pointer-events: none; }

/* Brighter than it was — 0.22 of a pale blue over a blue sky was a grid you had to look for. Over
   black there is nothing for it to compete with, so it can be a hairline that is actually there. */
.hexcell {
    fill: none;
    stroke: #93a9c9;
    stroke-width: calc(var(--map-unit) * 0.055);
    opacity: 0.34;
}

/*
 * The black hole's grasp: courses through this are refused. Filled as well as outlined now that it
 * is a hexagon of hexes rather than a ring — it is a piece of the map that is missing, and an
 * outline alone reads as a boundary you may cross rather than as somewhere that is not there.
 */
/* The hexes the black hole takes out of the map, drawn as themselves. Deep rather than faint, and
   solid rather than dashed: this is not a hint about a region, it is the statement that these hexes
   are gone. The thin stroke is each hex's own edge, so the count of them can be read off the map —
   which is the number that matters when judging whether a course clears it. */
.corezone {
    fill: #4c1d95;
    fill-opacity: 0.62;
    stroke: #7c3aed;
    stroke-width: calc(var(--map-unit) * 0.06);
    stroke-opacity: 0.5;
}

/*
 * Everywhere nothing of the empire's can see. Dark rather than opaque, and the stars are drawn over
 * the top of it: an empire knows where the stars are before it knows anything else, so the fog takes
 * the space between them and leaves the lights alone. Heavy enough that the hex grid underneath goes
 * quiet, which is what makes the edge of it readable without an outline.
 */
.fog {
    fill: #04060d;
    opacity: 0.62;
    pointer-events: none;
}

/*
 * The inner layer, over the top of the outer one. Everywhere the empire cannot read detail — which
 * includes everywhere it cannot see at all, so the two stack and the darkest sky is the sky nothing
 * is looking at. Light, because the band it marks alone is somewhere a player can still see stars,
 * count worlds and watch fleets arrive; it is a haze rather than a curtain.
 */
.haze {
    fill: #04060d;
    opacity: 0.3;
    pointer-events: none;
}

/*
 * <b>The two sheets as one, for an empire whose vision reaches as far as its sight.</b>
 *
 * There is no middle band for such an empire — seen-but-not-read is empty — so the haze sheet was
 * filling the whole galaxy a second time with exactly the geometry the fog sheet had just been
 * filled with, on every frame the browser drew. See the markup, where the two are compared.
 *
 * The number is the two stacked and not a taste: both fills are #04060d, so 0.62 over 0.3 comes to
 * 1 − (1 − 0.62)(1 − 0.3) = 0.734. Drawing one sheet at that is the same pixels for half the work.
 */
.fog.both { opacity: 0.734; }

/*
 * Whose watch a stretch of clear sky is. The fog itself is the dark and the dark belongs to nobody;
 * these are the empire's colour laid over the ground it is watching, faint enough to read the map
 * through and definite enough to say where the watch ends.
 *
 * Filled as well as outlined, at almost nothing: the outline alone drew every hex of the region
 * rather than its edge, since the path is a subpath per hex. A fill at 4% reads as one region and
 * the shared edges inside it disappear into it.
 */
.watchedge {
    fill: var(--fleet, var(--accent));
    fill-opacity: 0.04;
    stroke: var(--fleet, var(--accent));
    stroke-width: calc(var(--map-unit) * 0.06);
    opacity: 0.5;
    pointer-events: none;
}

/* The inner layer: smaller, dearer, and drawn like it. */
.watchedge.reads {
    fill-opacity: 0.07;
    stroke-width: calc(var(--map-unit) * 0.1);
    opacity: 0.75;
}

/* Somebody else's watch, over ground you can already see. Hollow and dashed: yours is a region you
   hold and theirs is a boundary you are working around, and the map underneath has to stay
   readable through both at once. */
.watchedge.theirs {
    fill: none;
    stroke-dasharray: calc(var(--map-unit) * 0.5) calc(var(--map-unit) * 0.7);
    opacity: 0.65;
}

.watchedge.theirs.reads {
    stroke-dasharray: none;
    opacity: 0.85;
}

.selectring { fill: none; stroke: var(--warn); stroke-width: calc(var(--map-unit) * 0.4); opacity: 0.9; }

/*
 * Everything a fleet is drawn with takes its colour from --fleet, which the markup sets per fleet
 * from the empire's seat — see Game.razor's ColourOf. The one colour no seat is ever dealt is red,
 * and that is what a guardian, a raider or a pirate flies.
 *
 * A galaxy where every empire is its own colour reads as everyone against everyone, which is what
 * it is. Two colours read as one player against a crowd, whoever is actually in the game.
 */
/* The raiders, their guardians and the pirates: the one white thing on a dark field.
   It was #ff6b6b, and red was argued for at the time — the fight was drawing the Maw lime while
   the map drew it red, and Gerald's association with red was the one that was right. What changed
   is what red costs: holding the warm quarter of the wheel empty for the Maw left the eight empires
   fighting over six usable hue regions. Gerald, 2 October 2026: "what if raiders are shown as
   white, making them even more visually distinct, then we have even more colors to work with."
   White is the furthest thing on this screen from any saturated colour, and a raider already has a
   barbed hull nothing a navy builds shares 2014 see CombatArt's Rogue branch. */
:root { --rogue: #eef3ff; }

/* The colour a warp pulses in. Blue because red on this map means the raiders — the Gateway ring
   and the Maw's marks have pulsed in it since there were any — and a fleet of your own crossing
   the galaxy must not borrow the one colour that already means danger. Gerald, 2 October 2026:
   "a pulsing blue glow (in contrast to the pulsing red glow that raider based map effects use)". */
:root { --warp: #74d7ff; }

/*
 * Drawn against --course-unit rather than --map-unit: the same width at the closest zoom, and the
 * same width on screen at every zoom after it, because the map gives a line back what pulling back
 * takes off it. See MapGeometry.Swell.
 *
 * A course is the one mark on the map that is most wanted at the zoom that treats it worst. The
 * whole journey only fits on screen once the map has pulled a long way back, and that is exactly
 * where a hairline scaled with everything else had disappeared — so the answer to "where is that
 * fleet going" was legible only in the views too close to contain it.
 */
.course {
    stroke: var(--fleet, var(--accent));
    stroke-width: calc(var(--course-unit, var(--map-unit)) * 0.4);
    stroke-dasharray: calc(var(--course-unit, var(--map-unit)) * 1.6) calc(var(--course-unit, var(--map-unit)) * 1.6);
    opacity: 0.55;
}

/* Somebody else's course, which is drawn because vision hides nothing — fainter, because it is
   information rather than an order of yours in progress. */
.plot.theirs .course { opacity: 0.38; }
.plot.theirs .plotlabel { opacity: 0.7; }

/*
 * A single hex of the grid, outlined in somebody's colours: where a fleet is bound when it is bound
 * for open sky, and the hex a station is standing in. Both are the same sentence — "this patch of
 * nothing is somebody's" — and open sky is the only place it needs saying, since a star says it by
 * being there.
 *
 * Against --course-unit rather than --map-unit, with the course line and for the course line's
 * reason: the hexes worth marking are far away, and a mark that thins to nothing at the zoom that
 * finally shows them is a mark drawn at the wrong moment.
 */
.hexmark {
    fill: none;
    stroke: var(--fleet, var(--accent));
    stroke-width: calc(var(--course-unit, var(--map-unit)) * 0.34);
    opacity: 0.75;
    pointer-events: none;
}

/* Where something is going, rather than where something is. Broken, like the course that ends in
   it: an order in progress is a claim on a hex and not yet a hold on one. */
.hexmark.bound {
    stroke-dasharray: calc(var(--course-unit, var(--map-unit)) * 1.2) calc(var(--course-unit, var(--map-unit)) * 1);
    opacity: 0.6;
}

/* The hex under the pointer while a course is being drawn: brighter than a course already given,
   since it is the thing being chosen — and in the plot's own accent rather than an owner's colour,
   because nobody owns it yet. */
.plot .hexmark.bound {
    stroke: var(--accent);
    fill: var(--accent);
    fill-opacity: 0.07;
    opacity: 0.9;
}

/* Out of reach, in the same red the line takes. */
.plot .hexmark.bound.blocked {
    stroke: var(--error);
    fill: var(--error);
    opacity: 0.7;
}

.fleetmark { fill: var(--fleet, var(--ok)); opacity: 0.95; }

/* Somebody else's, or something sitting on a guarded star. Drawn, and nothing more. */
.fleetmark.theirs { fill: var(--fleet, var(--error)); opacity: 0.95; }
.fleet.theirs { cursor: default; }

/*
 * A fleet drawn as its own flagship, which is what vision buys. The hull takes the empire's colour
 * and the two details keep their own, so a ship reads as a ship rather than as a coloured blob:
 * the spine is the dark of space and the bridge is a light on it.
 */
.fleetship > * { fill: var(--fleet, var(--ok)); stroke: none; }
.fleetship .spine { fill: #0d1524; }
.fleetship .bridge { fill: #e8eefb; }

/*
 * <b>Every ship on the map edged in the dark of space</b>, so a fleet stands apart from a star of its own colour when stars are
 * coloured by empire. Gerald, 30 October 2026: "ships should have a border to them that is the same color as the galaxy when
 * they are drawn in the galaxy, so a ship owned by player 1 over a star owned by player 1 is visually distinct from that star."
 * In screen pixels rather than map units, so it is the same edge at every zoom; painted under the fill, so it adds an outline
 * and takes nothing off the hull.
 */
.fleetship > *,
.fleetmark,
.warparrival .mark {
    stroke: #05070f;
    stroke-width: 1.5px;
    vector-effect: non-scaling-stroke;
    vector-effect: non-scaling-stroke;
    paint-order: stroke;
    stroke-linejoin: round;
}

/*
 * Hovering brightens rather than repaints, and selecting does neither — a fleet in hand is ringed,
 * not painted. Whose a ship is has to survive being looked at: the one fleet a player is working
 * with must not be the only thing on the map that has stopped saying which empire it belongs to.
 */
.fleet:hover .fleetship > * { filter: brightness(1.35); }
.fleet:hover .fleetship .spine { filter: none; }

/*
 * A spy station. Hollow rather than filled, and with a whisker showing which way it looks, so that
 * a structure standing in a hex never reads at a glance as a fleet holding one — the two are drawn
 * a few pixels apart and mean entirely different things about who can take what.
 *
 * No hover and no cursor: there are no orders to give a station. It is put down once, it watches,
 * and the only thing left to ask about it is what its title already says.
 */
.station { pointer-events: none; }

/*
 * An eye, drawn in its own units inside a scaled group — so every width here is a plain number
 * against the hull-sized shapes beside it, not a share of --map-unit, which the transform would
 * multiply a second time.
 *
 * The white of it is the dark of space rather than white: a filled shape reads at map size where an
 * outline does not, and space is what the eye is looking into.
 */
.stationmark { opacity: 0.95; }

.stationmark .sclera {
    fill: #05070f;
    stroke: var(--fleet, var(--ok));
    stroke-width: 0.42;
    stroke-linejoin: round;
}

.stationmark .pupil { fill: var(--fleet, var(--ok)); stroke: none; }

.stationlook {
    stroke: var(--fleet, var(--ok));
    stroke-width: calc(var(--map-unit) * 0.35);
    opacity: 0.5;
}

/* ── Heads-up bars floating over the galaxy ──────────────────────────────── */

.hud {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.9rem;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--chrome) 92%, transparent), color-mix(in srgb, var(--chrome) 55%, transparent));
    z-index: 2;
}

.hud.top {
    top: 0;
    height: var(--hud-top);
    border-bottom: 1px solid var(--line);
}

/*
 * Rails, not bars. Everything that used to sit along the bottom is stacked down the sides now,
 * which gives the galaxy the full height of the window rather than the height left over.
 */
.rail {
    position: absolute;
    top: var(--hud-top);
    bottom: 0;
    width: var(--rail);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem;
    background: linear-gradient(to right, color-mix(in srgb, var(--chrome) 94%, transparent), color-mix(in srgb, var(--chrome) 72%, transparent));
    z-index: 2;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: left;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.rail::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.rail.left { left: 0; border-right: 1px solid var(--line); }

.rail.right {
    right: 0;
    /* Explicit, because the .right utility would otherwise right-align the whole rail. */
    text-align: left;
    border-left: 1px solid var(--line);
    background: linear-gradient(to left, color-mix(in srgb, var(--chrome) 94%, transparent), color-mix(in srgb, var(--chrome) 72%, transparent));
}

.rail .spacer { flex: 1 1 auto; min-height: 0.25rem; }

/*
 * Where you are looking, against everything there is. Sits at the foot of the colony rail, since
 * that rail is otherwise mostly empty during an opening with one colony in it.
 */
/* Sits directly on the minimap, reading as its caption rather than as another rail entry. */
.rail .small.home {
    flex: 0 0 auto;
    margin: 0 0 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.minimap {
    flex: 0 0 auto;
    aspect-ratio: 1;
    padding: 0.3rem;
    background: #05070f;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.minimap svg { display: block; width: 100%; height: 100%; }
.minimap, .minimap * { user-select: none; }

.minimap .dot { fill: #3c4761; }
.minimap .dot.known { fill: #8fa0bd; }
.minimap .dot.mine { fill: var(--accent); }

/* <b>A Transdimensional Gateway on the minimap</b>: a violet core and a ring that swells and fades from it, so the one thing
   that ends a game is found at a glance. Since 3 December 2026. Gentler while it is still being built. */
.minimap .minigateway .core { fill: #c4b5fd; stroke: #7c3aed; stroke-width: 1px; vector-effect: non-scaling-stroke; }

.minimap .minigateway .pulse {
    fill: none;
    stroke: #a78bfa;
    stroke-width: 1.5px;
    vector-effect: non-scaling-stroke;
    transform-box: fill-box;
    transform-origin: center;
    animation: minigateway-pulse 1.8s ease-out infinite;
}

.minimap .minigateway.building .pulse { animation-duration: 2.6s; stroke-dasharray: 3 2; }

@keyframes minigateway-pulse {
    from { transform: scale(0.6); opacity: 0.95; }
    to { transform: scale(3.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .minimap .minigateway .pulse { animation: none; opacity: 0.6; }
}

.minimap .viewbox {
    fill: color-mix(in srgb, var(--accent) 10%, transparent);
    stroke: var(--accent);
    vector-effect: non-scaling-stroke;
}

/* Zoom, from your own cluster out to the whole galaxy. */
.zoom { display: flex; align-items: center; gap: 0.4rem; }

.zoom input[type="range"] {
    width: 9rem;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    accent-color: var(--accent);
    cursor: pointer;
}

.rail h2 {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    margin: 0.2rem 0 0.1rem;
}

/* A rail entry: a button that also reports numbers, as the original's side panel did. */
.gauge {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
    width: 100%;
    padding: 0.4rem 0.5rem;
    text-align: left;
    background: var(--card);
    white-space: normal;
    line-height: 1.25;
}

.gauge:hover:not(:disabled) { border-color: var(--accent); }
.gauge .title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.gauge .value { font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.gauge .note { font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.gauge.alert { border-color: var(--warn); }

/*
 * <b>What the star is pointed at, in the colour the rail already uses for it.</b>
 *
 * FocusClass has been putting for-food, for-production and for-research on this line since the
 * mid-game rail was written, and nothing anywhere styled any of the three — so every star's line
 * was the same grey whatever it was doing, and the rail a player scans to read their empire at a
 * glance said the same thing about all sixty of them. Gerald: "the left side colony rail does not
 * properly show (with color) what the star is focusing on in mid game."
 *
 * The three colours are not new: they are the ones the early game's own colony rows carry — see
 * .crow.growth, .crow.production and .crow.research — so a player who learned them settling their
 * first cluster reads the late-game rail with the same eyes. Gold grows, green builds, blue thinks.
 *
 * On the row's edge as well as in the line, because an edge is what the eye picks up running down a
 * list of sixty and a word is what it reads once it has stopped.
 */
.gauge .note.for-food { color: #d8a657; }
.gauge .note.for-production { color: var(--ok); }
.gauge .note.for-research { color: var(--accent); }

/*
 * The edge is an inset shadow rather than a left border, which is how this row has always drawn one
 * — see .gauge.open, whose mark this borrows. A border would work and would also shift every row's
 * text by three pixels the moment a focus was known, which on a rail of sixty reads as the list
 * jittering rather than as the stars being labelled.
 */
/*
 * A star being taken, on the rail rather than only in its own panel. Loud on purpose: it outranks
 * everything else the row says, because in three turns there will be no row.
 */
.gauge .note.siegenote { color: var(--error); font-weight: 600; }
.gauge .note.siegenote b { font-variant-numeric: tabular-nums; }

.gauge.for-food { box-shadow: inset 3px 0 0 0 #d8a657; }
.gauge.for-production { box-shadow: inset 3px 0 0 0 var(--ok); }
.gauge.for-research { box-shadow: inset 3px 0 0 0 var(--accent); }

/*
 * <b>The one whose panel is open.</b> A late-game rail is sixty stars long and every row looks like
 * every other, so the star being given orders was unfindable the moment the player looked away from
 * it. Gerald: "I cant even find it in the long list."
 *
 * Marked on three counts rather than one, because a border alone is what `alert` already uses and a
 * rail that is doing two things with one signal is a rail saying neither: the ground lifts, the
 * accent runs down the near edge, and the star's own name stops being muted. Listed after `alert` so
 * an open star that is also starving reads as open — it is the one the player is looking at.
 */
.gauge.open {
    background: color-mix(in srgb, var(--tint) 12%, var(--card));
    border-color: var(--accent);
    box-shadow: inset 3px 0 0 0 var(--accent);
}

.gauge.open .title { color: var(--text); }

/*
 * What a star on the rail is making, under its rates. Three rows: the thing and its clock, the bar
 * it has filled, and the figures with the buy button on the end. The rail is read down a column, so
 * the name is left and the clock is right and both stay on one line whatever they are called.
 */
.gauge .make {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-top: 0.15rem;
    font-size: 0.7rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.gauge .make .what {
    color: var(--text);
    min-width: 0;
    overflow-wrap: anywhere;
}

.gauge .make .turns { margin-left: auto; white-space: nowrap; }

/* The figures and the Buy on the job's own line, since 12 October 2026 — the rates line goes for a yard, so the
   line says what is building, how far, how long and what finishing it costs. */
.gauge .make .pp { white-space: nowrap; }
.gauge .make .buy { padding: 0 0.35rem; font-size: 0.66rem; white-space: nowrap; }

/* And the name on a line of its own under the figures, since 16 October 2026, so a long hull name is not
   squeezed out by them. */
.gauge .make.named { margin-top: 0.05rem; }

/* The queue's head, under a yard that is already busy. Quieter than the slip above it, because it
   is the answer to "and then?" rather than to "what is it doing?" — and the word sits on the right
   where the slip's turn count does, so the two lines read as one thing following another. */
.gauge .make.then { opacity: 0.72; }
.gauge .make.then .what { color: var(--muted); }
.gauge .make.then .turns { font-style: italic; }

.gauge .bar {
    position: relative;
    display: flex;
    height: 0.3rem;
    margin-top: 0.15rem;
    overflow: hidden;
    background: var(--line);
    border-radius: 999px;
}

.gauge .bar > span { background: var(--warn); }
.gauge .bar > .paid { background: var(--accent); opacity: 0.55; }

.gauge .meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
    font-size: 0.68rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.gauge .meta button { margin-left: auto; }

/* ── The empire rail ─────────────────────────────────────────────────────
 *
 * Ported from the design pass, which argued the shape: five identical cards for five things that
 * are not alike. Research is the only one with a clock running — a project is something an empire
 * is part way through, where a treasury, a fleet count and a tally of technologies simply are — so
 * it gets the stripe, the tint and the top, and the other four are a list under it.
 */

/* What is in the laboratories. The accent stripe and the wash of accent are the whole of what makes
   it read as the one live thing on the rail. */
.research {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    width: 100%;
    padding: 0.55rem;
    text-align: left;
    white-space: normal;
    line-height: 1.3;
    background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 9%, transparent), transparent 70%), var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.research:hover { border-color: var(--accent); }
.research.alert { border-color: var(--warn); border-left-color: var(--warn); }

.research .k {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: var(--muted);
}

.research .nm { font-size: 0.92rem; font-weight: 600; letter-spacing: -0.005em; }

.research .meta {
    display: flex;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.research .meta .turns { margin-left: auto; color: var(--text); }

/*
 * One entry of the list: a name, the figure it is about, and a line of what that figure is doing.
 * The stripe down the left is the state, in the same vocabulary the colonies rail uses — so "wants
 * an answer" looks the same wherever it appears on either side of the screen.
 */
.rail .row {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.15rem 0.5rem;
    width: 100%;
    padding: 0.45rem 0.55rem 0.45rem 0.7rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid transparent;
    border-radius: 6px;
    text-align: left;
    white-space: normal;
    color: var(--text);
    font: inherit;
    line-height: 1.3;
    cursor: pointer;
}

.rail .row:hover { border-color: var(--accent); }

.rail .row.good { border-left-color: var(--ok); }
.rail .row.idle { border-left-color: var(--accent); }
.rail .row.hurt { border-left-color: var(--warn); }
.rail .row.bad { border-left-color: var(--error); }

.rail .row .nm { font-size: 0.86rem; font-weight: 600; letter-spacing: -0.005em; }

.rail .row .pop {
    font-size: 0.86rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.rail .row .pop small { color: var(--muted); font-weight: 400; }

.rail .row .yield {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.05rem 0.6rem;
    font-size: 0.7rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.rail .row .yield .pos { color: var(--ok); }
.rail .row .yield .neg { color: var(--error); }

/* The treasury row carries two lines the others do not, whenever anything is marked to buy: what
 * the purchases come to and what they leave. The room is reserved rather than grown into, so that
 * pressing Buy does not shove the rows beneath it down the rail — Gerald asked for the section to
 * be taller "regardless of if something is being bought", and a row that does not move is the
 * reason to do it that way round. See the treasury row in Game.razor. */
.rail .row.tall .yield { min-height: 2.7rem; align-content: flex-start; }

/* ── The colonies rail ───────────────────────────────────────────────────
 *
 * A list to be scanned rather than four cards to be read. The tally is one line at the top, the
 * running totals are one block at the foot, and each colony is its name, its people and the one
 * line of work it has in hand.
 */

.tally-line {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    width: 100%;
    padding: 0.15rem 0.15rem 0.4rem;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    color: var(--muted);
    font: inherit;
    font-size: 0.74rem;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.tally-line b { color: var(--text); font-weight: 600; }
.tally-line .r { margin-left: auto; }
.tally-line:hover:not(:disabled) { border-color: var(--line); color: var(--text); }

/*
 * The stripe carries what the world is *for* — where most of its people are — and never whether it
 * is in trouble. Trouble is a chip in the title, which is where it is read. A colour that means
 * focus can be scanned down the column: four greens and a blue is an empire pointed at industry
 * with one laboratory world. See Game.razor's LeaningOf, which is the rule.
 */
.crow {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.05rem 0.5rem;
    width: 100%;
    padding: 0.4rem 0.5rem 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: 5px;
    text-align: left;
    color: var(--text);
    font: inherit;
    line-height: 1.3;
    overflow: hidden;
}

.crow:hover:not(:disabled) { border-color: var(--accent); }
.crow.growth { border-left-color: #d8a657; }
.crow.production { border-left-color: var(--ok); }
.crow.research { border-left-color: var(--accent); }
.crow.spread { border-left-color: var(--text); }
.crow:hover:not(:disabled).growth { border-left-color: #d8a657; }
.crow:hover:not(:disabled).production { border-left-color: var(--ok); }
.crow:hover:not(:disabled).research { border-left-color: var(--accent); }
.crow:hover:not(:disabled).spread { border-left-color: var(--text); }

/* Wraps rather than pushing the population off the row: a long name with a chip beside it is wider than the column. Gerald,
   18 November 2026: "I belive the starving text is causing other text to be cut off." */
.crow .nm { font-size: 0.84rem; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.crow .pop { font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.crow .pop small { color: var(--muted); font-weight: 400; }

.crow .make {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding-bottom: 0.35rem;
    font-size: 0.72rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* Wrapped rather than cut. Gerald, 30 October 2026: "Colony buildings in the early game have text that can get cut off
   instead of wrapping when there is plenty of room for it to wrap without issue." */
.crow .make .what { color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.crow .make .turns { margin-left: auto; white-space: nowrap; }

/* A world with nothing going into its yard. Worth a colour: "never" among a column of turn counts
   is easy to read past, and it is the one entry that wants doing something about. */
.crow .make .turns.never { color: var(--warn); font-weight: 600; }

/*
 * What the world is worth, on the world's own row. One line where it fits and two where it does
 * not — five figures against a fifteen-rem column is genuinely tight at three digits, and wrapping
 * is better than a row that clips or a rail that has to be wider than the map can spare.
 */
.crow .tot {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.05rem 0.5rem;
    padding-bottom: 0.35rem;
    font-size: 0.69rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.crow .tot b { color: var(--text); font-weight: 600; }
.crow .tot .up { color: var(--ok); }
.crow .tot .down { color: var(--error); }

/* The progress hairline is the card's own bottom edge, so "how far along" costs no line. */
.crow .edge { grid-column: 1 / -1; height: 2px; margin: 0 -0.5rem; background: #0b1120; }
.crow .edge > span { display: block; height: 100%; background: var(--accent); opacity: 0.85; }

/* An exception beside the name. Nothing wears one when nothing is wrong. */
.chip {
    display: inline-block;
    padding: 0 0.32rem;
    border-radius: 3px;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.5;
    vertical-align: 0.1em;
}

.chip.starving { background: rgba(255, 107, 107, 0.16); color: var(--error); }
.chip.orders { background: rgba(227, 179, 65, 0.18); color: var(--warn); }

/* Held at the height of its fullest state so the rail below it never shifts. */
.gauge.research { min-height: 5.6rem; }
.gauge.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.bar {
    height: 4px;
    margin-top: 0.2rem;
    background: #0b1120;
    border-radius: 2px;
    overflow: hidden;
}

/*
 * Two stripes rather than one, because a slip can be part built and part bought.
 *
 * A row, so the paid stretch sits after the produced one instead of under it, and neither of them
 * shrinks to fit — the two widths are the figures they stand for and the sum of them is the whole
 * bar. Gerald: "something that is bought shows the rest of the progress bar as filled in (with
 * maybe a slightly different color fill to tell the difference between the bought portion compared
 * to the produced portion)."
 *
 * Amber against the accent, which is the pairing the rest of the screen already uses when money is
 * standing in for industry — the buy button on this very line goes amber when the treasury is short.
 */
.bar { display: flex; }

.bar > span {
    display: block;
    flex: 0 0 auto;
    height: 100%;
    background: var(--accent);
}

.bar > span.paid {
    background: var(--warn);
    opacity: 0.7;
}

.rail .primary { font-size: 0.8rem; padding: 0.5rem; }

.hud .spacer { flex: 1 1 auto; }
.hud .stat { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* A treasury under nothing, and what it is costing. Red rather than the amber .bad wears
   elsewhere: this is not a warning that something might go wrong, it is a rule already taking
   production off every colony the empire holds. See Colonies.Debt. */
.hud .stat.bad { color: var(--error); font-weight: 600; }

/* ── Overlays: opened over the galaxy, closed back to it ─────────────────── */

.overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--hud-top) + 0.5rem) 1rem 0.75rem;
    background: color-mix(in srgb, var(--shade) 86%, transparent);
}

/*
 * Sheets are a fixed size, not a content-sized box. A panel that grows and shrinks as its
 * contents change makes every button under it move, so the frame stays put and the body scrolls
 * inside it instead.
 */
.sheet {
    display: flex;
    flex-direction: column;
    width: min(1100px, 100%);
    height: 100%;
    min-height: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.sheet.narrow { width: min(520px, 100%); }

/*
 * A menu is not a workspace, so it is the height of what is in it.
 *
 * The fixed-size rule above is right for a sheet whose contents change while it is open — the
 * colony sheet, the drawing board — because a frame that grows and shrinks moves every button
 * under the player's cursor. A menu is opened, read once and clicked once: nothing in it changes,
 * and there is nothing to hold still for. Full height for a list of two screens has the opposite
 * problem, which is what a player found: choosing a drive raised a page-tall panel to show one
 * line at the top of it.
 *
 * max-height rather than none, so the long ones — every weapon an empire has researched — still
 * cap and scroll inside the frame instead of running off the screen.
 */
.sheet.menu {
    height: auto;
    max-height: min(88vh, 100%);
    width: min(560px, 96vw);
}

/* The three endings of a siege, stacked: a button and what pressing it is worth, so the prizes can
   be read down the column against each other rather than against a paragraph. */
.siegeoptions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0.6rem 0;
}

.siegeoption {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    align-items: start;
    gap: 0.6rem;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.siegeoption button { width: 100%; }
.siegeoption p { margin: 0; }
.siegeoption:hover { border-color: var(--accent); }

@media (max-width: 30rem) {
    .siegeoption { grid-template-columns: minmax(0, 1fr); }
}

/* Research sizes itself, and sizes the same whether or not a choice has been made — width used
   to follow closability, so picking something doubled the sheet under the player's cursor. */
.sheet.researchsheet {
    width: min(640px, 94vw);
    height: auto;
    max-height: 88vh;
}

.sheet-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--line);
}

.sheet-head .spacer { flex: 1 1 auto; }

.sheet-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.9rem;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.sheet-body::-webkit-scrollbar { width: 8px; }
.sheet-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.close {
    padding: 0.2rem 0.55rem;
    line-height: 1;
    font-size: 1rem;
}

/* ── Generic bits ────────────────────────────────────────────────────────── */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.75rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.8rem;
}

/*
 * A line of text that comes and goes still occupies its line. Reserving the space keeps
 * everything below a toggle from jumping when the toggle is used.
 */
.reserved {
    display: block;
    min-height: 2.4em;
}

.row { display: flex; gap: 0.6rem; align-items: flex-end; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 12rem; }
.right { text-align: right; }
.sep { margin: 0 0.35rem; color: var(--line); }

label {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

input, select {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.4rem 0.5rem;
    background: #0b1120;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    text-transform: none;
    letter-spacing: normal;
}

input:focus, select:focus { outline: none; border-color: var(--accent); }

/* <b>A checkbox and the words that say what it does, side by side.</b> Every input above is a full-width block, which put the box at
   one edge of the panel and its words at the other: Gerald, 2 December 2026, "the checkbox for auto combat is placed far off from the
   text describing it". */
label.checkline { display: flex; align-items: center; gap: 0.5rem; text-transform: none; letter-spacing: normal; font-size: 0.85rem; color: var(--text); }
label.checkline input { display: inline-block; width: auto; margin: 0; flex: none; }

button {
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
}

button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: default; }

button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #04101f;
    font-weight: 600;
}

button.small { padding: 0.2rem 0.45rem; font-size: 0.75rem; margin-top: 0.25rem; }

table { width: 100%; border-collapse: collapse; margin-top: 0.6rem; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); }

th {
    color: var(--muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

dl { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.8rem; margin: 0; }
dt { color: var(--muted); font-size: 0.8rem; }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

ul.plain { list-style: none; margin: 0; padding: 0; }

ul.plain li {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--line);
}

ul.plain li:last-child { border-bottom: 0; }

/* The summing row at the foot of a breakdown — the treasury.s fleet upkeep, where the rows above
 * are the ships and this is what they come to. Ruled off above rather than below, so it reads as a
 * total of the list rather than another entry in it. */
ul.plain li.total {
    border-top: 1px solid var(--line);
    border-bottom: 0;
    margin-top: 0.15rem;
    padding-top: 0.35rem;
    font-weight: 600;
}

.tag {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    margin-right: 0.4rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
}

.ok-tag { color: var(--ok); border-color: var(--ok); }
.warn-tag { color: var(--warn); border-color: var(--warn); }

/* <b>The connection tag is a button now, and has to go on looking like a tag.</b>
 *
 * It is the one thing on screen that knows the server has gone, so it is where a player goes
 * looking for a way back — see Game.ReconnectAsync, and Gerald asking for it: "can we add one
 * through a click on the diconnected button?" A button brings a background, a font and a cursor of
 * its own, and every one of those would make it read as a control that had always been there.
 */
button.tag {
    background: none;
    font: inherit;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    cursor: pointer;
}

button.tag:hover:not(:disabled) { border-color: currentColor; filter: brightness(1.25); }

button.tag:disabled { cursor: progress; opacity: 0.7; }

/* Something the world is getting rather than something it wants. The Gaia bonus wears this: it is
   news, and good news, and the warning colour would have read as a problem. */
.good-tag { color: var(--ok); border-color: var(--ok); }

/* One line saying what an empire-wide effect is doing to the work in front of it — today the
   Dictatorship's yards, which double the industry a hull receives. Its own class rather than
   .muted because it is not an aside: it explains why the bar fills faster than the figure above it.
   See ColonyView.ProductionTowardBuild. */
.effectline {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: .35rem 0 0;
    font-size: .78rem;
    color: var(--muted);
}

.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }

.error { color: var(--error); }
.flash { color: var(--accent); }
.back { font-size: 0.8rem; }

/* ── Planets ─────────────────────────────────────────────────────────────── */

.planet-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }

.planet {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    width: 9.5rem;
    padding: 0.5rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
}

.planet.mine { border-color: var(--accent); }
.planet .tag { margin: 0.15rem 0 0; }

/* ── Colony and research panels ──────────────────────────────────────────── */

.jobs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.jobs label { margin-bottom: 0.3rem; }

/*
 * Name, then status, then what it does — stacked, because a row puts three columns of unequal
 * length beside each other and the middle one ends up hyphenated down the card.
 */
.tech {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    width: 100%;
    margin-top: 0.25rem;
    text-align: left;
    white-space: normal;
}

.tech.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* ── Lobby ───────────────────────────────────────────────────────────────── */

.lobby {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 1rem;

    /* The lobby scrolls as a whole now. It used to fit a screen, and the sandbox card grew a
       research picker over eight blocks — Gerald: "the page needs a scroll bar now." The games
       table keeps its own bounded scroll inside this one. */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

/* The two pickers on the sandbox card — every technology, and the new fleet — are long lists, so
   each scrolls inside itself rather than pushing the card off the page. */
.lobby details.composer {
    max-height: 55vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.lobby .panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
}

.lobby.narrow { max-width: 30rem; margin: 0 auto; }

/* ── Blazor's own chrome ─────────────────────────────────────────────────── */

#blazor-error-ui {
    background: #2a1414;
    color: #ffd9d9;
    border-top: 1px solid var(--error);
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.5rem 1rem 0.6rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.4rem; }

.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred."; }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--line);
    stroke-width: 0.4rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 600;
    color: var(--muted);
    inset: calc(20vh + 3.25rem) 0 auto 0;
}

.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

/* ── Map selection ───────────────────────────────────────────────────────── */

.fleet { cursor: pointer; }

/* Transparent rather than none: a fill of none would not receive the click. */
/* An invisible disc that takes the pointer. The shapes these groups are made of are outlines and
   strokes, so a click between them lands on nothing — a thing you can see and cannot press. A
   transparent fill still receives pointer events where fill:none does not, which is the whole trick.

   The station was left out of this list and was therefore unclickable, which is the outpost sheet
   not working at all. */
.fleet .hit, .sys .hit { fill: transparent; }

/* ── A star while a fleet is in hand ──────────────────────────────────────────────────────
   "plotting" is on the map whenever the next click is a destination — see the svg tag on
   Game.razor. A star is drawn with rings out to 2.6 radii and a gateway's out to 4.6, and that
   whole spread sat in the group carrying the star's click: aiming at the hex beside a star hit
   the star. It got worse zooming out, because a star's drawn radius grows as the map pulls back.
   Gerald: "when a fleet is selected the selection of a star is smaller on all zoom levels, so you
   are less likely to accidently click a star instead of a hex right next to a star."

   And worst with a fleet in hand, which is the one moment it matters: the reach ring drawn round
   a star you can get to is part of the target too. Measured at 1.45 hexes while plotting against
   0.95 at rest, so picking up a fleet made every reachable star swallow the whole of the hex
   beside it, past that hex's own centre. See AStarsClickTargetShrinksToItsOwnHexWhileAFleetIsPlotted,
   which measures both.

   So while a course is being plotted, everything a star is made of stops taking the pointer and
   one circle takes it back: the hex-sized one, which reaches into no neighbour at any zoom. The
   star is still perfectly clickable — you have to mean it.

   Since 10 October 2026 that circle reaches the neighbouring hexes' centres. Outposts may not stand beside
   a star any more, so the hex next to one is rarely a place anybody means, and Gerald: "I want clicks to
   more reliably go to stars instead of to the hex next to them." See StarField's hit.close. */
.starmap.plotting .sys > * { pointer-events: none; }
.starmap.plotting .sys .hit.close { pointer-events: auto; }

/* The same bargain the ship shape strikes: brightened while the pointer is over it, ringed while
   it is in hand, and never repainted — the mark's colour is whose it is. */
.fleet:hover .fleetmark { filter: brightness(1.35); }
.fleetmark.moving { opacity: 0.55; }

/* Movement targeting: the line that follows the cursor, and what it may land on. Against the
   course's unit for the course's reason — it is the same line before it has been agreed to, and
   the orders drawn at the widest zooms are the long ones, which are the ones worth seeing. */
.plotline {
    stroke: var(--accent);
    stroke-width: calc(var(--course-unit, var(--map-unit)) * 0.56);
    stroke-dasharray: calc(var(--course-unit, var(--map-unit)) * 2) calc(var(--course-unit, var(--map-unit)) * 1.6);
    opacity: 0.9;
}

.plotline.blocked { stroke: var(--error); opacity: 0.7; }
.inrange { fill: none; stroke: var(--accent); stroke-width: calc(var(--map-unit) * 0.32); opacity: 0.45; }

/*
 * Everywhere the fleet being plotted could go. A hexagon, because reach is a count of hexes and the
 * set of them within a count is six-sided — drawing a circle here would be drawing a rule the game
 * does not have. Faintly filled as well as outlined: the sky inside it is now somewhere a fleet can
 * be sent, so it is a region rather than a boundary.
 */
/*
 * Everywhere a fleet could go, as one region.
 *
 * The opacity is on the group and the fill on the cells inside it, and that split is the whole
 * point: SVG composites a group with `opacity` as a single image before fading it, so two hexagons
 * covering the same sky come out the same strength as one. Put the opacity on the shapes instead —
 * which is where it used to be — and every overlap is a brighter patch with the edges of both
 * shapes drawn through it, which is what made the reach read as a pile of hexagons rather than a
 * boundary.
 *
 * In the aiming colour rather than the accent, because that is already the map's word for "this is
 * the ground a thing you are placing would cover", and reach is the same question about a ship.
 */
/*
 * Where reach stops, as a line around it.
 *
 * Filled hexes said the same thing six hundred times and painted over the map to do it; the only
 * part a player reads is the boundary. The path is every hex edge with nothing reachable on the far
 * side, so a self-contained reach is one outline, two areas cut off from each other are two, and a
 * hole inside one is drawn as a hole — all of it falling out of the same rule with no tracing.
 *
 * The width is in map units, so it grows as the map is pulled back and the outline stays a line
 * rather than thinning away to nothing at the zoom where a player most needs to see how far they
 * can get.
 *
 * No fill, and not as a preference: the path is a heap of separate two-point segments, and a
 * segment encloses no area, so anything asked of fill here would paint nothing however it were
 * declared. Saying `fill: none` is the honest version of what was already happening.
 */
.reachzone {
    fill: none;
    stroke: var(--warn);
    stroke-width: calc(var(--map-unit) * 0.5);
    stroke-opacity: 0.85;
    stroke-linejoin: round;
    stroke-linecap: round;
    pointer-events: none;
}

/* A jump's throw, which is a different promise from a travel range and has to read as one. The
   reach ring says "your ships can get here"; this says "this ship can be thrown here", and it
   deliberately covers sky no supply reaches. Dashed and in the accent so the two are never confused
   when both are on the map. */
.reachzone.jumpzone {
    stroke: var(--accent);
    stroke-dasharray: calc(var(--map-unit) * 1.6) calc(var(--map-unit) * 1.1);
    stroke-opacity: 0.95;
}

.plotlabel { fill: var(--accent); text-anchor: middle; pointer-events: none; }

/* The reason under the number: present enough to be read when the number surprises you, quiet
   enough that a map of courses is still a map rather than a page of footnotes. */
.plotwhy { opacity: 0.68; }

/*
 * Aiming a spy station: the arc it would watch, and the veil that makes every hex on the map an
 * answer to that question while it is up.
 *
 * Two weights for the two reaches. The long one is everywhere it would notice anything at all and
 * is barely filled; the short one is everywhere it could read what that thing is, and is what the
 * player is really choosing between - so it is drawn brighter and over the top.
 */
.aimzone {
    fill: var(--warn);
    fill-opacity: 0.06;
    stroke: var(--warn);
    stroke-width: calc(var(--course-unit, var(--map-unit)) * 0.34);
    stroke-dasharray: calc(var(--course-unit, var(--map-unit)) * 1.4) calc(var(--course-unit, var(--map-unit)) * 1.8);
    opacity: 0.55;
    pointer-events: none;
}

.aimzone.reads {
    fill-opacity: 0.1;
    stroke-dasharray: none;
    opacity: 0.85;
}

/* The hex the aim is resting on. Filled rather than outlined: it is a place the player put
   something down and has to be able to find again, and an outline on a grid of outlines is not
   findable at a glance. */
.aimheld {
    fill: var(--warn);
    fill-opacity: 0.3;
    stroke: var(--warn);
    stroke-width: calc(var(--course-unit, var(--map-unit)) * 0.4);
    opacity: 0.95;
    pointer-events: none;
}

/* Transparent rather than none, because a fill of none takes no pointer events - and taking them
   is the whole job. Crosshair, because every hex under it now means one thing. */
.aimveil { fill: transparent; cursor: crosshair; }

/*
 * A star system as the original drew it: the star in the middle, everything else on an elliptical
 * ring around it. Flat, because the original's is flat — a shaded disc reads as round without any
 * of what real perspective would cost.
 *
 * The sheet holding it is sized to the picture and no larger, and it is black rather than panel
 * grey — a system is a thing seen against space, and the galaxy behind it should stay visible.
 */
/* A lighter scrim and no blur behind a star, so the galaxy it sits in stays legible. */

/*
 * A waiting screen that leaves the right rail alone. The two of them — a battle somebody else is
 * fighting, and a star somebody else is deciding what to do with — stop this empire's clock without
 * asking it anything, and Gerald asked that they stop taking the panel with them: "they should not
 * stop players from accessing the right side panel and anything within it (including chat)." So the
 * sheet still owns the map, and the rail beside it stays live. Only the right edge moves; the rest
 * comes from .overlay above.
 */
.overlay.aside {
    right: var(--rail);
}
.overlay.chart {
    background: color-mix(in srgb, var(--shade) 35%, transparent);
    backdrop-filter: none;
}

/*
 * A floating panel rather than an overlay: no backdrop, nothing dimmed, and everything behind it
 * still takes clicks. It sits over the map between the two rails, so the rails, the top bar and
 * the submit button are all reachable while it is up.
 */
.panel {
    position: absolute;
    top: calc(var(--hud-top) + 0.6rem);
    left: calc(var(--rail) + 0.8rem);
    z-index: 3;
    display: flex;
    flex-direction: column;
    max-height: calc(100% - var(--hud-top) - 1.2rem);
    min-height: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--line);
}

.panel-head { cursor: grab; user-select: none; }
.panel.dragging .panel-head { cursor: grabbing; }
.panel-head .close { cursor: pointer; }

.panel-head .spacer { flex: 1 1 auto; }

/*
 * Live only while a panel is being dragged. The pointer outruns a small panel easily, so the
 * whole window has to keep hearing about it — and it must sit above everything, including the
 * panel, or the first fast movement drops the drag.
 */
.dragsurface {
    position: fixed;
    inset: 0;
    z-index: 40;
    cursor: grabbing;
}

/* The minimap is grabbed and moved about, so it gets the hand. The sky itself does not move. */
.minimap { cursor: grab; }
.minimap.grabbing { cursor: grabbing; }

.panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;

    /*
     * Keep the scrollbar's lane whether or not there is a scrollbar in it. Without this the bar
     * appearing and disappearing changes how wide the body is, and everything inside shuffles
     * sideways to match — which on the star panel means the whole system visibly jumps every time
     * a re-render changes the content's height by a pixel. The gutter costs a few pixels of width
     * permanently and buys a panel that never moves on its own.
     */
    scrollbar-gutter: stable;
    padding: 0.9rem;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.panel-body::-webkit-scrollbar { width: 8px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* Sized to the picture. A star screen is a picture, so every pixel of chrome around it is a
   pixel of galaxy the player cannot see. */
.panel.chart {
    width: min(410px, 88vw);
    background: #000000;
}

.panel.chart .panel-head {
    background: #000000;
    padding: 0.3rem 0.4rem 0.3rem 0.7rem;
}

.panel.chart .panel-head h1 { font-size: 0.9rem; }
.panel.chart .close { padding: 0.1rem 0.4rem; font-size: 0.85rem; }
.panel.chart .panel-body { padding: 0; }

/* The star's orders, under the picture of the star. The chart itself is padded to nothing so
   that it fills the panel, so this puts its own back and rules a line off the picture above it.

   Stuck to the bottom of the panel body, which is what makes it reachable rather than merely
   present: the body scrolls, a tall system fills it, and the control was landing below the fold
   of a panel nobody had any reason to think scrolled. */
.panel.chart .control {
    position: sticky;
    bottom: 0;
    background: #000000;
    padding: 0.6rem 0.7rem 0.7rem;
    border-top: 1px solid var(--line);
}

/* And the picture gives way before the orders do. A system with many worlds draws tall, and the
   thing you came to the panel to do should never be the thing pushed off it. */
/*
 * The picture gives way before the orders do — a system with many worlds draws tall, and the thing
 * you opened the panel to do should never be pushed off the end of it.
 *
 * Width is fixed to the body rather than left to follow the height, which is how this came to
 * oscillate: a chart sized from its own height changes width when a scrollbar appears, which
 * changes its height, which takes the scrollbar away again. The svg fits itself inside whatever box
 * it is given (preserveAspectRatio), so clamping the height letterboxes it rather than overflowing.
 */
.panel.chart .orbits { max-height: 52vh; }
.panel.chart .orbits svg { max-height: 52vh; width: 100%; height: auto; }

.panel.chart .control .row.focus { margin-bottom: 0.45rem; }
.panel.chart .control p { margin: 0.35rem 0 0; }

/* A world's own screen: a short list, so it is sized to that rather than to the window. */
.sheet.compact {
    width: min(26rem, 92vw);
    height: auto;
    max-height: 88vh;
}

/*
 * Half a page, and fixed at it. For a sheet that holds a known, small amount — the treasury is a
 * balance, an income and a short list of what is about to be spent — where the full-height sheet
 * drew a page-tall panel around a dozen lines and left most of it empty. Compact is too narrow:
 * these are figures in columns and they want the width.
 *
 * Fixed rather than auto so the panel does not resize as the numbers under it change from turn to
 * turn; a box that grows a row and shrinks it again is a box that moves its own close button.
 */
.sheet.half {
    width: min(44rem, 94vw);
    height: min(30rem, 62vh);
}

/*
 * Choosing a world — to settle, to put a base on, or to fire at. The one screen in the game where
 * a picture *is* the decision, and it was being drawn inside compact's 26rem: a postcard of a solar
 * system with a sheet of empty panel around it, on the question a player spends eighty production
 * and a journey to be asked.
 *
 * Wide, and tall enough for the chart to have room under it for the sentence that explains it.
 * Sized in rem against a viewport cap so it is generous on a laptop and not absurd on a monitor.
 */
.sheet.choosing {
    width: min(62rem, 94vw);
    height: auto;
    max-height: 92vh;
}

/* The chart takes the room the sheet just gained, rather than staying its old width in the middle
   of it. Capped so that on a very wide window it does not become a stretched ellipse. */
.sheet.choosing .orbits.picking { max-width: min(46rem, 100%); }

.orbits {
    display: flex;
    justify-content: center;
}

/* The shape comes from the system itself, set inline — see SystemChart.Frame. */
.orbits svg {
    width: 100%;
    display: block;
}

.orbitring {
    fill: none;
    stroke: #4a5a7a;
    stroke-width: 0.25;
    opacity: 0.85;
}

.orbiting { cursor: pointer; }
.orbiting .hit { fill: transparent; }
.orbiting.feature { cursor: default; }

.ownedworld { fill: none; stroke: var(--accent); stroke-width: 0.4; opacity: 0.9; }

/* Somebody else's world, ringed in their own colour. Dashed rather than solid so the two rings are
   told apart without reading the colour — the accent ring is yours, and a dashed one is a claim
   somebody else has made. Gerald: "my own planets have a [PLAYER COLOR] ring drawn around them to
   signify that I have a colony on that planet, but enemy planets do not have the same thing?" */
.heldworld {
    fill: none;
    stroke-width: 0.35;
    stroke-dasharray: 1.1 0.7;
    opacity: 0.85;
}

.orbiting:hover .heldworld { opacity: 1; }

/* What the Planet Cracker leaves: a dark disc where the world was, with its rubble drawn round it.
   No terraform fill, because there is no climate any more — see GameEngine.Cracked, which holds the
   world's maximum population at nothing for the rest of the game. */
.crackedhalo {
    fill: #0d0f16;
    stroke: var(--line);
    stroke-width: 0.15;
    opacity: 0.85;
}

.crackedrock { fill: #6b6459; opacity: 0.85; }
.orbiting:hover .ownedworld { opacity: 1; }

.orbiting.selected .ownedworld { stroke: var(--warn); }

.giant { fill: #6b7a99; }
.giantring { fill: none; stroke: #8fa2c4; stroke-width: 0.35; opacity: 0.7; }
.belt { fill: #8b93a5; opacity: 0.8; }

/* One line under the chart for whatever can be done. What a world is reads off its tooltip. */
.worldactions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

/* The tooltip, drawn inside the chart so it follows the body it describes. */
.tip { pointer-events: none; }

.tip rect {
    fill: #0b1020;
    stroke: var(--line);
    stroke-width: 0.15;
    opacity: 0.97;
}

.tipname { fill: var(--text); font-size: 2.6px; font-weight: 600; }
.tipline { fill: var(--muted); font-size: 2.4px; }

.planet.clickable { cursor: pointer; }
.planet.clickable:hover { border-color: var(--accent); background: #18223a; }

button.warn-btn {
    border-color: var(--warn);
    color: var(--warn);
    font-weight: 600;
}

/* <b>And a prompt long enough to be a sentence wraps instead of spilling.</b>

   `button` sets white-space: nowrap, which is right for the controls it was written for — a button
   whose label rewraps as the rail narrows is a button that moves under the cursor. It is wrong for
   these, because these are not labels: "Answer the government question" is a sentence, it is two
   hundred and thirty-eight pixels wide, and the rail it stands in is a hundred and seventy-nine.
   So it was drawn straight through the side of its own border.

   Found by MomentTests.AndNothingSpillsOutOfTheBoxItWasDrawnIn, which is what that test is for.

   Not the small ones: `small warn-btn` is a figure in a table cell — see the buy column on the
   colony sheet — and a figure that wraps is the fault this rule is avoiding elsewhere. */
button.warn-btn:not(.small) { white-space: normal; }

/* Colony focus: two mutually exclusive choices, not a set of dials. */
.row.focus { gap: 0.4rem; margin-bottom: 0.6rem; }
.row.focus button { flex: 1 1 0; }

/*
 * Job allocation, on a grid rather than a flex row. Fixed columns keep the whole line on one
 * line at any width, and keep the count in a tabular cell of its own so that going from 9 to 10
 * does not shove the buttons sideways — a control that moves under the cursor is a control you
 * cannot hold down.
 */
.row.jobs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 1.6rem 2.1rem 1.6rem;
    gap: 0.35rem;
    align-items: center;
    margin-bottom: 0.3rem;
}

.row.jobs button {
    padding: 0.15rem 0;
    text-align: center;
}

.row.jobs .grow { flex: none; }

.row.jobs .value {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/*
 * One colony, sized to what it holds rather than to the window — the same reasoning as the star
 * screen. The list of every colony stays roomy; it is a list.
 */
.sheet.colonysheet {
    width: min(30rem, 92vw);
    height: auto;
    max-height: 88vh;
}

/* The close button sits over the corner rather than on a bar of its own — a title bar with no
   title in it is a row of nothing. Unless the queue is running, in which case there is something
   to put in it and it goes back to being a bar. */
.sheet.colonysheet { position: relative; }

.sheet.colonysheet.queued .sheet-head {
    position: static;
    padding: 0.4rem 0.5rem 0.4rem 0.7rem;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.sheet.colonysheet .sheet-head {
    position: absolute;
    top: 0.25rem;
    right: 0.35rem;
    padding: 0;
    border-bottom: none;
    background: none;
    z-index: 1;
}

.sheet.colonysheet .sheet-head h1,
.sheet.colonysheet .sheet-head .spacer { display: none; }
.sheet.colonysheet .close { padding: 0.1rem 0.4rem; font-size: 0.85rem; }
.sheet.colonysheet .sheet-body { padding: 0.6rem; }
.sheet.colonysheet .card.colony { border: none; background: none; padding: 0; }

.grid.colonies { grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr)); }

/* What the world is, in one line. */
.worldline {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.6rem;
}

/*
 * A job: its name, the people standing in it, and what they are worth — on one line, so a focus
 * and what it did are one glance rather than two. Nothing here is pressed or dragged: the row is
 * the answer to the choice above it, and the pointer is offered nothing it could change.
 */
.jobrow {
    display: grid;

    /*
     * <b>The people keep their line, and the sentence beside them wraps instead.</b>
     *
     * This was `3.2rem 1fr auto`, and the third column is the trouble: `auto` sizes to max-content,
     * while a `1fr` track's own minimum is min-content -- which for a wrapping flex row of icons is
     * one icon. So the widest value wins the whole row and the people collapse into a single
     * column, stacked vertically.
     *
     * Only ever the Farms row, because only its value is a sentence: "12 grown / 14 eaten /
     * starving -- 2 short". Works and Labs say "4 PP" and never squeezed anybody, which is why it
     * read as random. A new colony is the worst case rather than a special one -- it cannot feed
     * itself yet, and "starving" and "the star is short" are the longest strings the row has.
     *
     * So the people get a floor of seven icons before anything may take from them, and the value
     * gets a floor of nothing, which lets it wrap onto a second line when the card is narrow. The
     * row still reads as one glance; it just gives way in the other direction.
     */
    grid-template-columns: 3.2rem minmax(7rem, 1fr) minmax(0, auto);
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid transparent;
    border-radius: 6px;
}

.joblabel {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

/* min-width so the grid lets it wrap rather than holding the row open at its longest line. */
.jobvalue { font-variant-numeric: tabular-nums; font-size: 0.8rem; min-width: 0; }

.people {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    min-height: 1.1rem;
}

/*
 * One colonist. A head and shoulders rather than a dot, so a row of them reads as people — the
 * original used a different figure per race and we have one, which is enough to count with.
 */
.person {
    width: 0.7rem;
    height: 1rem;
    background: var(--muted);
    -webkit-mask: radial-gradient(circle at 50% 26%, #000 0 26%, transparent 27%),
        radial-gradient(ellipse 60% 45% at 50% 100%, #000 0 99%, transparent 100%);
    mask: radial-gradient(circle at 50% 26%, #000 0 26%, transparent 27%),
        radial-gradient(ellipse 60% 45% at 50% 100%, #000 0 99%, transparent 100%);
}

.row.build { gap: 0.4rem; align-items: center; margin: 0.2rem 0 0.4rem; }
.row.build select { margin: 0; }

/* A purchase queued but not yet sent. It stays down so the player can see they have done it. */
button.small.pressed {
    background: var(--accent);
    border-color: var(--accent);
    color: #04101f;
    font-weight: 600;
}

/* Which ships of a fleet are going, one row each. */
.grid.picks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3rem;
    margin: 0.5rem 0;
}

.pick {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.5rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.pick .grow { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; text-align: left; }
.pick button { margin: 0; min-width: 2rem; }

/* A ship is picked by clicking its name, and inspected by the button beside it. */
.pick > button.grow {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    padding: 0.1rem 0.2rem;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
}

.pick > button.grow:hover strong { color: var(--accent); }
.pick > button.grow:disabled { cursor: default; }
.pick.going { border-color: var(--ok); }

/* Worlds a finished colony base could go to, one button each. */
.grid.targets {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    margin: 0.6rem 0;
}

.target {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.5rem 0.6rem;
    text-align: left;
}

.target:hover { border-color: var(--accent); }

/* What stands in the colony. Wraps as far as it needs to; each one says what it does. */
.built {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

/*
 * Naming a star, written where the star's name goes. It lives inside the map's SVG at a fixed
 * size and is scaled onto the map by a transform, so everything here is ordinary pixels — laying
 * it out in map units means a fractional-pixel font, which the browser refuses to honour.
 */
/* One row: the name, and the button that submits it. */
.nameplate {
    box-sizing: border-box;
    width: 240px;
    height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 7px;
    border: 1px solid var(--accent);
    border-radius: 7px;
    background: color-mix(in srgb, var(--chrome) 94%, transparent);
    font: 500 13px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* The box takes what is left; the button is only as wide as its word. */
.nameplate input {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 4px 6px;
    border-radius: 4px;
    font: inherit;
}

.nameplate-row { display: flex; gap: 5px; align-items: stretch; }

.nameplate button {
    flex: 0 0 auto;
    margin: 0;
    padding: 4px 8px;
    border-radius: 4px;
    font: inherit;
    font-size: 12px;
    white-space: nowrap;
}

.nameplate button[data-testid="rename-star"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #04101f;
}

/* A researched technology is history, not an option — dim it and stop it looking clickable. */
button.tech.known { opacity: 0.45; }
button.tech:disabled { cursor: default; }

/*
 * Research, laid out as the original did it: names in columns, and one panel underneath that
 * fills in when you click one. The panel is a fixed height whatever it holds, so reading about
 * one technology after another never moves the list out from under the cursor.
 */
.techblocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.techblock h2 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin: 0 0 0.4rem;
}

/* What the block is asking of you, above the names it is asking it about: which tier is open,
   what it costs and how much of it the cost buys. Laid out as a row that wraps, so a narrow
   column drops the sentence under the price rather than clipping it. */
/* The block's own header, and a way into its ladder. A button rather than a heading because it
   does something: it opens every tier of this block, which is what a player choosing the first
   rung of a five-rung road actually needs to see. */
button.tieroffer {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
    width: 100%;
    margin: 0 0 0.45rem;
    padding: 0.3rem 0.45rem;
    background: transparent;
    border: 1px solid transparent;
    border-bottom-color: var(--line);
    border-radius: 5px 5px 0 0;
    font-size: 0.75rem;
    text-align: left;
    cursor: pointer;
}

button.tieroffer:hover,
button.tieroffer:focus-visible {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--tint) 8%, transparent);
}

/* The block's name, which is the thing being pressed. */
.tieroffer .tiername {
    flex-basis: 100%;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.72rem;
}

.tieroffer .tiertier {
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* The one figure on this screen a player is comparing between blocks, so it is the one thing
   here that is allowed to be the accent colour. Tabular, because they are read in a column. */
.tieroffer .tiercost {
    color: var(--accent);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

button.techname {
    display: block;
    width: 100%;
    text-align: left;
    margin-bottom: 0.3rem;
    padding: 0.35rem 0.55rem;
}

button.techname.selected {
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

/* What two-of-three cost you. Not a button, because there is nothing left to press: the tier
   moved on and took these with it. Struck through and dimmed rather than removed, so the road
   not taken stays readable for the rest of the game. */
/* The count of what a block has given up, which is now a button into the ladder rather than the
   heading of a list. Styled as text rather than as a control on purpose: it is a fact about the
   block that happens to be clickable, and a button drawn like a button here would compete with the
   technologies underneath it, which are what the page is actually for. */
.forfeited-head {
    display: block;
    width: 100%;
    margin: 0.7rem 0 0.25rem;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    opacity: 0.75;
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 0.2em;
    font: inherit;
    color: inherit;
}

.forfeited-head:hover,
.forfeited-head:focus-visible {
    opacity: 1;
}

/* Above the names now, and a fixed height whatever it holds — reading about one technology
   after another must not shift the list out from under the cursor. */
/*
 * The panel keeps one height whatever is selected, so asking about a second technology fills it in
 * rather than moving the list underneath. It was 8.5rem, which fitted every description when every
 * description was a line — a fitting writes its own out of its fields now and the longest of them
 * runs to three, so a plate and a factory sat at different heights and the names below them jumped.
 * Sized to the longest there is: a Class X screen's percentage, pool, room, price and regeneration.
 */
.techdetail {
    min-height: 11rem;
    margin-bottom: 0.9rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.8rem;
}

.techdetail h3 { margin: 0 0 0.2rem; }
.techdetail p { margin: 0.3rem 0 0; }

/* ── The tree screen ──────────────────────────────────────────────────────── */

/*
 * One block's ladder at a time, read top to bottom. Everything here is built out of the pieces
 * already on the research screen — the card, the tag, the dashed strike-through that says a
 * decision cannot be taken back — because this is the same subject read at a different distance
 * and a second visual language for it would make it look like a different game.
 *
 * The sheet is the wide one and it scrolls: fifteen rungs of a block is more than a window, and
 * the alternative was shrinking a technology's description until nobody could weigh it, which is
 * the one thing this screen exists to make possible.
 */
.sheet.treesheet { width: min(1100px, 96vw); }

.treetabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.4rem;
    margin: 0.6rem 0 0.9rem;
}

/* The six are done and one block is left. It stands in the middle of the space the six held rather
   than at the left end of an empty row, because a tab sitting alone where six used to be reads as
   five tabs that failed to draw. Gerald: "center the miniaturization block in the center of where
   the 6 blocks used to stand." */
.treetabs.alone {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.treetabs.alone .treetab {
    flex: 0 1 16rem;
    align-items: center;
    text-align: center;
}

/* And the six themselves, kept reachable and no longer the row you are choosing from. */
.treetabs.walkedout {
    margin-top: 0;
    opacity: 0.6;
}

.treetabs.walkedout .treetab { padding: 0.25rem 0.45rem; }

.treetabs.walkedout .treetab.selected { opacity: 1; }

.treetab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.4rem 0.55rem;
    text-align: left;
    white-space: normal;
}

.treetab .title { font-size: 0.76rem; font-weight: 600; }
.treetab .note { font-size: 0.68rem; color: var(--muted); }
.treetab.selected { border-color: var(--accent); color: var(--accent); }
.treetab.selected .title { color: var(--accent); }

.treeladder { display: flex; flex-direction: column; gap: 0.6rem; }

/*
 * A rung, with the tier's own terms across the top. The left border is the ladder: it is the one
 * mark that reads at a glance as "here is where you are", and it is on the rung rather than on
 * every card in it because the tier is what the rule is written about.
 */
.treerung {
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
}

.treerung.closed { border-left-color: var(--ok); }
.treerung.open { border-left-color: var(--warn); background: var(--card); }
.treerung.ahead { border-left-color: var(--line); }

.rung-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.rung-head .spacer { flex: 1 1 auto; }
.rung-head .tier { font-weight: 600; font-size: 0.85rem; }

.rung-techs {
    display: grid;

    /* min() so a narrow rail falls back to one full-width column instead of insisting on 15rem it
     * has not got — the same reason the cards above may shrink. */
    grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
    gap: 0.5rem;
}

/* <b>A grid item that may shrink, which is the whole of the overflow fix.</b> A grid track sized
 * 1fr still refuses to go narrower than its content, because a grid item.s min-width is auto — so a
 * long technology name or an unbroken word pushed this card wider than its column and the column
 * wider than the ladder, and the block ran off the side of the screen. Gerald: "the UI for the
 * miniturization block of research overflows the display."
 *
 * It bit hardest there because that block lists every raider technology still to come, so it holds
 * more cards than any other rung and carries the longest names in the game — and it got worse the
 * moment those cards started showing full descriptions instead of the catalogue.s shorthand. */
.treetech {
    min-width: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    overflow-wrap: break-word;
}

.treetech p { margin: 0.2rem 0 0; }

.treetech-head { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.treetech-head .spacer { flex: 1 1 auto; }
.treetech-head .tag { margin-right: 0; }

.treetech.known { border-color: var(--ok); }
.treetech.open { border-color: var(--warn); }

/*
 * The two that must never be mistaken for one another. Forfeited is struck through behind a dashed
 * edge — the same treatment the research screen already gives it — and ahead is simply quieter than
 * the rest. One is a loss and the other is a wait, and reading them in the same ink would hide the
 * only thing this screen was built to show.
 */
.treetech.forfeited {
    border-style: dashed;
    border-color: var(--muted);
    opacity: 0.6;
}

.treetech.forfeited .treetech-head strong { text-decoration: line-through; }
.treetech.ahead { opacity: 0.82; }

/* An open rung is pressable from the ladder — see the note in TreeBody. It has to look pressable
   before it is pressed, because the three standings beside it are not, and a page where some cards
   respond and some do not is worse than one where none do unless the difference is visible. */
.treetech.pickable { cursor: pointer; }
.treetech.pickable:hover { border-color: var(--accent); background: var(--card-hover, var(--card)); }

/* And the one chosen, marked the way the block list marks it — the same decision seen from the
   other page, so the two agree at a glance. */
.treetech.pickable.selected {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.tag.known { color: var(--ok); border-color: var(--ok); }
.tag.open { color: var(--warn); border-color: var(--warn); }
.tag.forfeited { color: var(--error); border-color: var(--error); }

/*
 * The nine empty tiers, as nine marks rather than nine rows. They are identical to one another and
 * the only thing that varies is how far up them this empire has climbed, so a row of pips says
 * everything nine headings would have said and leaves the six tiers that hold technology as the
 * shape of the screen.
 */
.treerung.refinements { border-left-color: var(--accent); }
.treerung.refinements p { margin: 0.35rem 0 0; }

.pips { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.pip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.pip.closed { border-color: var(--ok); color: var(--ok); }
.pip.open { border-color: var(--warn); color: var(--warn); font-weight: 700; }

/* ── The battle screen ────────────────────────────────────────────────────── */

/*
 * A fight takes the whole page. There is no galaxy behind it and nothing floating over it: the
 * grid is the screen, with what the acting ship can do along the bottom. Underneath rather than
 * beside it: a hex field is as wide as it is tall, and a column down one side was taken out of
 * the only dimension the field could not spare.
 */
.battle {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #05070f;
}

/*
 * <b>The conquered star, inside the sheet that asks what to do with it.</b>
 *
 * Bounded and scrolling rather than given its head: the three choices underneath are the whole
 * point of the sheet, and a system with six worlds in it would push them off the bottom of the
 * screen on the turn they matter most. See SystemBodyFor.
 */
.fallenstar {
    max-height: 42vh;
    overflow-y: auto;
    margin-bottom: 0.7rem;
    padding-right: 0.3rem;
    border-bottom: 1px solid var(--line);
}

/*
 * <b>The standings sheet: one card per empire, yours at the top.</b>
 *
 * Read down rather than across. A table would put every empire's colonies in one column and invite
 * the eye to rank them, which is the wrong reading — what a player wants is one rival at a time and
 * how they sit against you, and the mark beside each figure is that answer already worked out.
 */
.standings { display: flex; flex-direction: column; gap: 0.6rem; }

/*
 * <b>A tab an empire, in their own colour.</b> The swatch is the whole reason the row exists: a
 * name in a list and a ship on the map are only the same empire if something says so, and the
 * something is the colour the map already draws them in.
 */
.standings .etabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--line);
}

.standings .etab {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    background: #0c1220;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--muted);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.standings .etab:hover { border-color: var(--accent); color: var(--text); }
.standings .etab.on { border-color: var(--accent); color: var(--text); background: #101a2c; }

/* A tab whose figures are a memory rather than a sighting. */
.standings .etab.stale { opacity: 0.7; font-style: italic; }

.standings .swatch {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 2px;
    display: inline-block;
    flex: 0 0 auto;
}

.standings .swatch.big { width: 0.9rem; height: 0.9rem; }

.standings .epage h3 {
    margin: 0.8rem 0 0.35rem;
    font-size: 0.9rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.standings .chips { display: flex; flex-wrap: wrap; gap: 0.25rem; }

.standings .tagchip {
    padding: 0.15rem 0.4rem;
    background: #0c1220;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
}

.standings .tagchip.press { cursor: pointer; }
.standings .tagchip.press:hover { border-color: var(--accent); color: var(--text); }

/* What they hold and you do not, which is the half of a technology list worth reading. */
.standings .tagchip.ahead { color: var(--warn); border-color: #4a3a18; }

/* The shelf scrolls rather than the sheet: a hundred technologies is a page of its own. */
.standings .techs {
    max-height: 16rem;
    overflow-y: auto;
    padding-right: 0.3rem;
}

.standings .techblock { margin-bottom: 0.45rem; }
.standings .techblock .bname { display: block; margin-bottom: 0.2rem; }

/*
 * <b>The comparison: one chart a figure, one bar an empire.</b> Lengths rather than a column of
 * numbers, because "who is ahead and by how much" is a question about size and the eye answers it
 * faster than arithmetic does.
 */
.standings .chart { margin-bottom: 0.7rem; }

.standings .chart .clabel {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.standings .cbar {
    display: grid;
    grid-template-columns: 11rem 1fr 4rem;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
}

.standings .cbar .cname {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.standings .cbar.you .cname { color: var(--text); font-weight: 600; }
.standings .cbar.stale { opacity: 0.62; }

.standings .ctrack {
    height: 0.65rem;
    background: #0c1220;
    border: 1px solid var(--line);
    border-radius: 2px;
    overflow: hidden;
}

.standings .cfill { display: block; height: 100%; }
.standings .cbar .cfig { text-align: right; font-variant-numeric: tabular-nums; }

.standings .empirecard {
    padding: 0.55rem 0.7rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
}

/* Yours is the measure the others are read against, so it is marked as the top of the page. */
.standings .empirecard.you { border-color: var(--accent); }

/* A memory rather than a sighting: dimmed, because the figures are true of a turn that has gone. */
.standings .empirecard.stale { opacity: 0.72; }

.standings .ehead {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.standings .ehead .nm { font-weight: 600; }

.standings .efigs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-bottom: 0.35rem;
}

.standings .efig { display: flex; align-items: baseline; gap: 0.3rem; }
.standings .efig b { font-size: 1.05rem; }
.standings .efig .warn { color: var(--warn); }
.standings .efig .ok { color: var(--ok); }
.standings .empirecard p { margin: 0.2rem 0 0; }

/*
 * A button that reads as a line of text rather than as a control: for a door that is worth having
 * but is not what the sheet is for — see the trait sheet's way through to the raiders' armoury.
 */
.linky {
    padding: 0;
    background: none;
    border: 0;
    color: var(--accent);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.linky:hover { color: var(--text); }

/*
 * <b>The strip that says the server is gone, not the fight.</b>
 *
 * A battle takes over the whole page, so a player who loses the socket mid-round sees a screen that
 * ignores every click — indistinguishable from a hang, and the natural response is a refresh, which
 * is the worst available move. This sits across the top of the field, takes no space from the board
 * when it is absent, and is written to be read at a glance rather than studied.
 */
.battle-offline {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.35rem 0.7rem;
    background: #3a1c0c;
    border-bottom: 1px solid var(--warn);
    color: var(--warn);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-align: center;
}

/* And the quiet one in the bar, which is always there to be found. */
.battlebar .bb-link {
    margin: 0 0 0.35rem;
    text-align: center;
    font-size: 0.75rem;
}

/* It is a button here too, and for the same reason — see button.tag. This one was a paragraph, so
   it carries no border and wants none: what it keeps is the line of text it always was. */
button.bb-link {
    background: none;
    border: none;
    font: inherit;
    font-size: 0.75rem;
    width: 100%;
    cursor: pointer;
}

button.bb-link:hover:not(:disabled) { filter: brightness(1.25); }

button.bb-link:disabled { cursor: progress; opacity: 0.7; }

.battle-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 0 0 auto;
    padding: 0.5rem 0.9rem;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.battle-head .spacer { flex: 1 1 auto; }

.battle-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    position: relative;
}

/* The star's queue drags like a colony's. The grip is the same mark for the same reason: a row
   that can be picked up should look like one. */
.chart ol li[draggable="true"] { cursor: grab; }
.chart ol li[draggable="true"]:active { cursor: grabbing; }

.chart ol li .grip {
    color: var(--muted);
    opacity: 0.55;
    letter-spacing: -0.12em;
    padding-right: 0.15rem;
}

/* The star panel's figures, a line apiece and in a fixed order: what a player checks every turn
   wants to be in the same place every turn. Spread rather than run together, so each reads as its
   own fact instead of as a sentence. */
.statline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.4rem;
    align-items: baseline;
    margin: 0.15rem 0;
}

.statline b {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.statline .alert b { color: var(--bad, #ff7a6b); }

/* <b>What is standing on a battlefield without fighting on it:</b> the star it is being fought
   over, and an outpost in the hex it is in. Ground rather than combatants — it covers hexes no ship
   may be moved onto, and nothing else in the fight can see it.

   No pointer events anywhere in the layer, which is the whole of "untargetable" on a screen: it
   cannot be aimed at, and it cannot swallow a click meant for the ship standing in front of it. */
.layer.scenery {
    pointer-events: none;
}

.layer.scenery .onfield {
    opacity: 0.55;
}

/* The ground it claims, drawn the way a hull's berth is so that "this is taken" reads the same for
   both. Fainter than a hull's, because a ship is a thing you are about to be shot by and this is
   scenery. */
.layer.scenery .footing {
    fill: color-mix(in srgb, var(--muted) 14%, transparent);
    stroke: color-mix(in srgb, var(--muted) 30%, transparent);
    stroke-width: 0.04;
}

/* The star itself. Big and plainly a star — Gerald: "stars being much larger and more obvious (both
   on the minimap and the combat grid)" — so it is a filled disc with a glow rather than a mark. */
.layer.scenery .star .body {
    fill: color-mix(in srgb, #ffd97a 70%, transparent);
    stroke: #ffd97a;
    stroke-width: 0.08;
    filter: drop-shadow(0 0 0.5rem color-mix(in srgb, #ffd97a 60%, transparent));
}

/* The black hole behind the raiders beyond the Gateway: a dark core in the raiders' red rim. */
.layer.scenery .blackhole .body {
    fill: #05020c;
    stroke: color-mix(in srgb, var(--fx-raider) 70%, transparent);
    stroke-width: 0.08;
}

.layer.scenery .blackhole .rim {
    fill: none;
    stroke: var(--fx-raider);
    stroke-width: 0.12;
    opacity: 0.55;
    filter: drop-shadow(0 0 0.6rem color-mix(in srgb, var(--fx-raider) 70%, transparent));
}

.minimap .mapblackhole {
    fill: #05020c;
    stroke: var(--fx-raider);
    stroke-width: 0.6;
}

.layer.scenery .station .hull {
    fill: var(--muted);
    opacity: 0.8;
}

.layer.scenery .tag {
    fill: var(--text);
    font-size: 0.62px;
    text-anchor: middle;
    paint-order: stroke;
    stroke: var(--panel);
    stroke-width: 0.14;
    stroke-linejoin: round;
}

/* And the same two on the small map, drawn to the size of the thing rather than to a dot: it is
   what a player reads to find their way about a field ninety-six hexes across. */
.minimap .mapstar {
    fill: color-mix(in srgb, #ffd97a 45%, transparent);
    stroke: #ffd97a;
    stroke-width: 0.2;
}

.minimap .mapstation {
    fill: color-mix(in srgb, var(--muted) 45%, transparent);
    stroke: var(--muted);
    stroke-width: 0.15;
}

.layer.scenery .tag.people {
    fill: var(--muted);
    font-size: 0.52px;
}

.battle-body .grid {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    height: 100%;
    user-select: none;
}

/* Everything you read while fighting, along the bottom. Fixed columns for the parts that are
   always there, so a weapon appearing or a ship being asked about does not shuffle the rest. */
.battle-foot {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 13rem 13rem;
    gap: 0.9rem;
    align-items: start;
    max-height: 30vh;
    padding: 0.55rem 0.9rem 0.7rem;
    border-top: 1px solid var(--line);
    background: linear-gradient(to top, color-mix(in srgb, var(--chrome) 97%, transparent), color-mix(in srgb, var(--chrome) 78%, transparent));
    overflow-y: auto;
}

.battle-foot .foot { min-width: 0; }
.battle-foot h2 {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin: 0 0 0.3rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.battle-foot h2 .close { margin-left: auto; padding: 0 0.3rem; font-size: 0.75rem; }
.battle-foot p { margin: 0.25rem 0 0; }
.battle-foot .sheet-block { border-left: 1px solid var(--line); padding-left: 0.8rem; }

/* A name with no spaces in it has nowhere to wrap, and a column this narrow is where that shows:
   twenty-five unbroken characters spilled out of the box and over the button beside it. Broken
   anywhere rather than clipped, because this is the one place on the screen whose whole job is
   telling you which ship you are reading. */
.battle-foot .sheet-block p { overflow-wrap: anywhere; }
.battle-foot .sheet-block.enemy { border-left-color: var(--error); }
.battle-foot .shipstats,
.battle-foot dl { margin: 0; }

/* A weapon is a name. What it does is a right-click away, which is where it stops competing
   with the field for the player's attention. */
/*
 * The first screen of a new game: as wide as it can be and as tall as what is in it.
 *
 * Wide, because twelve options wrapping onto three lines apiece is a wall of text pretending to be
 * a choice - the room buys single lines. Content-height, because the fixed-size rule the other
 * sheets follow is for panels whose contents change while they are open, and nothing changes here:
 * a page-tall frame around four rows of buttons is empty screen the eye has to cross.
 */
.sheet.beginningsheet {
    width: min(1180px, 96vw);
    height: auto;
    max-height: min(92vh, 100%);
}

/*
 * Three blocks side by side because they are weighed against each other, each a column of three
 * options; the government goes underneath and wide, being the one that is not a technology.
 *
 * The columns stretch and the options inside them share the height evenly, so the three blocks line
 * up row for row however long a description runs. Without that the first option of one block sits
 * against the second of another, and the eye has to work out which three it is choosing between.
 */
.beginnings {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.7rem;
    margin-top: 0.6rem;
}

.beginnings.wide { grid-template-columns: minmax(0, 1fr); }

.beginblock {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.beginblock h2 {
    margin: 0 0 0.4rem;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

/* The three options of a block, sharing the column evenly. */
.beginblock > .beginopt { flex: 1 1 0; }

/* The government's three, side by side inside their one wide block. */
.beginrow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.5rem;
}

/*
 * An option: its name and what it gives, and nothing else. No "chosen" label - a highlighted
 * button already says so, and twelve of them said it twelve times. What a right-click asks for
 * opens in a window of its own; growing this pushed the rest of the column about.
 */
.beginopt {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 100%;
    margin-bottom: 0.4rem;
    padding: 0.5rem 0.6rem;
    text-align: left;
    white-space: normal;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

.beginrow .beginopt { margin-bottom: 0; }

/*
 * An option standing directly in the grid rather than inside a block's column — the racial nine,
 * and Heritage Engineering's three. The grid already has a gap; the column margin below is what
 * spaced options inside a .beginblock, and carrying it here doubles the space under every row.
 */
.beginnings > .beginopt { margin-bottom: 0; }

.beginopt:hover:not(:disabled) { border-color: var(--accent); }
.beginopt:disabled { cursor: default; opacity: 0.9; }

.beginopt.selected {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--tint) 12%, transparent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.beginopt .nm { font-weight: 600; }
.beginopt.open { border-color: var(--warn); }

/*
 * The opening's four governments, side by side and large — Gerald, 18 November 2026: "a much larger text area/button". The
 * description first, then what it gains and gives up under a rule, then the reminder that a right-click shows its levels.
 */
.beginrow.governments { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.beginopt.government {
    gap: 0.45rem;
    min-height: 15rem;
    padding: 0.8rem 0.9rem;
}

.beginopt.government .nm { font-size: 1.15rem; }
.beginopt.government .govdesc { font-size: 0.86rem; line-height: 1.4; }

.beginopt.government .govgives {
    margin-top: auto;
    padding-top: 0.45rem;
    border-top: 1px solid var(--line);
}

.beginopt.government .govhint { opacity: 0.7; }

.govladder .says { display: block; }

@media (max-width: 900px) {
    .beginrow.governments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Racial traits ───────────────────────────────────────────────────────────────────────
 *
 * The same cards the opening is drawn with, because it is the same act of reading ten short things
 * side by side — see .beginopt. What differs is that a trait card is not itself a choice: it is a
 * ladder with a purchase on it, so the card is a box and the button inside it is the press. That is
 * why the cursor goes back to the default here; a whole card that looks clickable and is not is the
 * one thing this shape gets wrong if left alone.
 */

/* Ten of them rather than three columns of three: a grid that fits as many as the width allows, so
 * a wide sheet shows two rows of five and a narrow one folds without ever cutting a card in half. */
.beginnings.traits { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }

.beginopt.trait {
    cursor: default;
    gap: 0.28rem;
    background: var(--card);
}

.beginopt.trait:hover { border-color: var(--line); }

/* Held, at any depth. Green rather than the accent blue a selected beginning takes, because this is
 * a thing owned rather than a thing picked — and the two are on screen together often enough that
 * one colour for both would read as one state. */
.beginopt.trait.held {
    border-color: var(--ok);
    background: linear-gradient(180deg, rgba(76, 175, 122, 0.10), transparent 60%), var(--card);
}

.beginopt .traithead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

/* Five pips: filled for the rungs held, hollow for the rest. Letter-spaced so the run of five reads
 * as a row of lights rather than as a word. */
.beginopt .rungs {
    flex: 0 0 auto;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--muted);
    opacity: 0.55;
}

.beginopt.trait.held .rungs { color: var(--ok); opacity: 1; }

.beginopt .says { font-size: 0.78rem; color: var(--muted); white-space: pre-line; }

/* What the rung above would replace the line above with. Set off by a rule rather than by a colour,
 * because the two sentences are the same kind of thing a step apart and colouring one of them says
 * they are different kinds of thing. */
.beginopt .next {
    margin-top: 0.15rem;
    padding-top: 0.28rem;
    border-top: 1px dashed var(--line);
    font-size: 0.74rem;
    color: var(--text);
    opacity: 0.72;
}

.beginopt .next.done { color: var(--ok); opacity: 0.9; font-style: italic; }

/* Pushed to the foot of the card so the ten buttons line up across the grid whatever length the
 * sentences above them came out. */
.beginopt .buy {
    margin-top: auto;
    align-self: stretch;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.78rem;
}

.beginopt .buy:disabled { opacity: 0.45; cursor: not-allowed; }

/*
 * The window a right-click opens: as small as what is in it, which is a sentence and two numbers.
 * Every other sheet is a workspace and takes the height of the screen; this one is a footnote, and
 * a page-tall panel around two lines reads as something having gone wrong.
 */
.sheet.begindetail {
    width: min(420px, 92vw);
    height: auto;
    max-height: 70vh;
}

.sheet.begindetail .sheet-body { padding-bottom: 0.8rem; }
.sheet.begindetail p { margin: 0 0 0.5rem; }
.sheet.begindetail p:last-child { margin-bottom: 0; }


/* The five rungs of one trait, in the window a right-click opens. A road read top to bottom: what
 * is already held is dimmed and ticked, the one above it is the only live line, and the rest are
 * what the climb is for. */
ol.ladder.rungs {
    list-style: none;
    margin: 0.2rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

ol.ladder.rungs > li {
    display: grid;
    grid-template-columns: 1.9rem minmax(0, 1fr);
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.34rem 0;
    border-top: 1px solid var(--line);
}

ol.ladder.rungs > li:first-child { border-top: 0; }

ol.ladder.rungs .no {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-align: right;
}

ol.ladder.rungs .says { font-size: 0.82rem; }

ol.ladder.rungs > li.held .no { color: var(--ok); }
ol.ladder.rungs > li.held .says { color: var(--muted); }

ol.ladder.rungs > li.next {
    background: color-mix(in srgb, var(--tint) 8%, transparent);
    border-radius: 4px;
    border-top-color: var(--accent);
}

ol.ladder.rungs > li.next .no { color: var(--accent); font-weight: 600; }
/* The two prices, in the window a right-click opens. */
.prices { color: var(--warn); }

/* ── What a right-click on a technology raises ───────────────────────────────────────────
 *
 * Wider than the choice window because it carries a road rather than a sentence: a technology deep
 * in a block lists every tier between here and it, and a column narrow enough for two lines of
 * prose would wrap every row of that road onto two.
 */
.sheet.techsheet {
    width: min(520px, 94vw);
    height: auto;
    max-height: 80vh;
}

.sheet.techsheet .sheet-body { padding-bottom: 0.9rem; }
.sheet.techsheet p { margin: 0 0 0.6rem; }

.sheet.techsheet h2 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0.9rem 0 0.4rem;
}

/* What the fitting is, in the numbers it is chosen by. A list rather than a sentence because these
   are read by comparison — two beams held side by side — and a paragraph cannot be scanned. */
.techfacts {
    list-style: none;
    margin: 0 0 0.6rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.techfacts li {
    font-size: 0.82rem;
    background: var(--panel2, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 0.15rem 0.4rem;
}

/* The road: one row a tier, the payments it still wants, and what they come to. Aligned right so
   the totals form a column a player can add up by eye. */
.techroad {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.techroad li {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.2rem 0;
    border-bottom: 1px dotted var(--line);
}

.techroad li:last-child { border-bottom: 0; }
.techroad strong { font-variant-numeric: tabular-nums; }

/* Gone for good reads as a warning rather than as a price, because it is not one. */
.prices.forfeited { color: var(--bad, #d2696f); }

/* The last thing on the screen and the last thing to do: under everything, in the middle, with
   room above so it does not read as part of the government block. */
.beginfoot {
    display: flex;
    justify-content: center;
    margin-top: 1.4rem;
    padding-bottom: 0.3rem;
}

.beginfoot .primary { padding: 0.5rem 2.2rem; font-size: 1rem; }

/* A setting that is not a choice: shown where the control was, so the lobby says what the galaxy is
   rather than going quiet about it. */
.fixedsetting {
    display: inline-block;
    padding: 0.3rem 0.5rem;
    border: 1px dashed var(--line);
    border-radius: 6px;
    color: var(--muted);
    white-space: nowrap;
}

.pills { display: flex; flex-wrap: wrap; gap: 0.3rem; }

/*
 * An empire's colour, picked rather than dealt. Gerald, 1 October 2026: "each empire name and each
 * color must be unique in that game, so the first player to join/create the game gets their pick."
 *
 * A swatch is the colour and nothing else — no label inside it, because the thing being chosen is
 * what a fleet will look like on the map and a word over it would be the one part that is not. The
 * name is on the title and the aria-label, where a reader who is not reading colour will find it.
 */
.colourpicks { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }

.colourpick {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    background: var(--swatch, var(--line));
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.colourpick:hover:not(:disabled) { border-color: var(--text); }

.colourpick.pressed { border-color: var(--text); transform: scale(1.12); }

/* Already flown by somebody in that galaxy. Dimmed rather than hidden: which colours are
   gone is as much a part of choosing as which are left, and a row that reflows as people join is a
   row whose buttons move under the pointer. */
.colourpick.gone { opacity: 0.25; cursor: not-allowed; }


/* One game sitting open, waiting for the people who will play it. */
.openrow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
}

.openwho { display: grid; gap: 0.15rem; min-width: 0; }

.seats { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.15rem; }

/* An empire already in it, worn in its own colour — which is how it will read on the map, so the
   list and the galaxy say the same thing about the same empire. */
.seat {
    padding: 0.1rem 0.45rem;
    font-size: 0.72rem;
    border-radius: 999px;
    border: 1px solid var(--swatch, var(--line));
    color: var(--swatch, var(--text));
}

.seat.you { background: var(--swatch, transparent); color: #0a0f1a; font-weight: 600; }

/* The join form, under the row it belongs to rather than over the page: it asks for a name and a
   colour that have to be unique in that game, and a dialog would cover the list that says which. */
.joinform {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: end;
    padding: 0.5rem 0 0.7rem;
    border-bottom: 1px solid var(--line);
}

/* What to do with a finished opening: one block per answer, so the choice reads as a choice rather
   than as a paragraph with buttons in it. */
.opening-choice {
    margin-top: 0.9rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.opening-choice h2 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.opening-choice p { margin: 0 0 0.6rem; }
.opening-choice .pills { margin-bottom: 0.6rem; }

/* The create screen's two turn settings: wide enough for a three-figure turn and no wider. */
.turninput {
    width: 5em;
    margin-left: 0.35rem;
}

.pill {
    padding: 0.22rem 0.55rem;
    font-size: 0.78rem;
    line-height: 1.2;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.pill:hover:not(:disabled) { border-color: var(--accent); }

/*
 * A pill that is a menu entry wraps. Every button in the game is nowrap — which is right for a
 * pill that says "Replace it" and wrong for one carrying a rung's name, its price and the sentence
 * describing what it does. Choosing a drive showed those three cut off at the panel's edge rather
 * than running on to a second line.
 *
 * Scoped to a menu so the ordinary pill, which is a word or two on one line, keeps the nowrap that
 * stops it breaking in the middle.
 */
.sheet.menu .pill {
    display: block;
    width: 100%;
    text-align: left;
    white-space: normal;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
}

/* A battery reads as two lines: what it is, and what has been bolted to it. The pill grows to fit
   rather than the mods being hidden behind a click, because which upgrade is on which battery is
   what a player is choosing between when they pick one to fire. */
.pill .wname { display: block; }

.pill .wmods {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.68rem;
    color: var(--muted);
}

.pill .wmod { margin-right: 0.3rem; cursor: help; }
.pill .wmod:last-child { margin-right: 0; }

.sheet.menu .pill > .small { display: block; margin-top: 0.1rem; }
/* <b>The weapon's name carries its state, not a ring round the pill.</b> Gerald: the border was
   "very very difficult to read" — a one-pixel edge in a dim colour on a dark pill is a distinction
   you have to go looking for, and the name is the thing already being read. Green is armed, yellow
   is held back on purpose, red is cannot fire at all, grey is fired for this round. */
.pill.armed { color: var(--ok); }
/* Fired, and — for a special — written into this round, which is the same fact: it has been spent
   and the plan says what it will do. Struck through as well as greyed, because a special sits beside
   guns that are merely dim for other reasons and Gerald asked for the difference to be obvious:
   "used specials should change color on the bottom bar buttons to make it clear that it has already
   been used." */
.pill.fired { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.pill.held { color: var(--warn); border-style: dashed; }
/* <b>A special written into this round reads as on, not as gone</b>, since 26 October 2026: struck through and grey, an
   activated Inertial Nullifier looked like one that could not be used, and the line saying what it will do was struck
   through with it. Gerald: "we should build a system that makes it clear when a non stackable special has been
   activated, and if it has a target make it clear what that target is." Lit in the accent, with what it does and at what
   under its name (see SpentSays). And a gun a written special has boosted wears the same colour on its chips. */
.pill.activated {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
    text-decoration: none;
}
.pill .wmod.boosted { color: var(--accent); font-weight: 600; cursor: default; }
.pill.boosted { box-shadow: inset 0 0 0 1px var(--accent); }
.pill.spent { opacity: 0.45; }
.pill.disabled, .pill.spent { color: var(--error); }
.pill.disabled { text-decoration: line-through; }
/* The turn report when the turn cost something. See Game.ReportsALoss. */
.pill.lost { color: var(--error); border-color: var(--error); }
/* <b>Pressed has to be unmistakable, because it changes what the next click means.</b> A special
   that is armed is a player having said "the next thing I click is for this" — and a warm border on
   a dark pill was not enough to say so. Gerald: "there is no obvious UI to tell that a special is
   selected. The UI for specials doesn.t even seem clickable." */
.pill.pressed {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--tint) 22%, transparent);
    color: var(--text);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--accent);
}

/* And a pill that can be pressed says so on the way past. */
.pill:not(:disabled) { cursor: pointer; }
.pill:disabled { cursor: default; }

/* A choice that is shut rather than merely unchosen: dimmed, and carrying the reason in its title.
   Not the error red of .disabled, which means "this went wrong" — a star with every world settled
   and full has simply run out of anything to grow, and pointing it at its fields is a door that is
   closed rather than a mistake being made. */
.pill.shut { opacity: 0.4; }

/*
 * The battery a click would spend, while fire is being split. Filled rather than merely outlined,
 * because every other pill on the rail is already outlined in something and a ninth border colour
 * would be one more thing to learn — this one says "this is the next thing to go off", which is a
 * different kind of claim from "this is armed" or "this will not reach".
 */
.pill.next { border-color: var(--accent); background: rgba(120, 190, 255, 0.18); }

/* Armed, but with nothing inside its reach — the commonest reason a shot does not happen. */
.pill.unreached { border-style: dotted; opacity: 0.75; }

/*
 * Red, and only while the pointer is over one of theirs: this gun will not fire at that ship.
 * From the playtest — the reason a click does nothing should be visible before the click, not
 * inferred from nothing happening. Beaten out of .unreached deliberately, because "nothing at all
 * is in reach" and "not that one" are different sentences and the second is the one being asked.
 */
.pill.outofrange {
    border-color: #ff6b6b;
    border-style: solid;
    color: #ff9a9a;
    opacity: 1;
}

/*
 * The end-of-turn button, moved out of the top right in August 2026. It sat beside the round
 * counter, where "End turn" read as ending the round for everybody; it now sits at the end of the
 * bar it belongs to and names the ship it is finished with.
 */
/*
 * Never wider than the column it is in. An auto margin makes a grid item size to fit its contents
 * rather than to its track, and "fit" has a floor of the min-content width — which for a label that
 * may not wrap is the whole label. So the item grew to the length of a ship's name and took the
 * grid with it. The cap is what makes the clipping below possible at all: something in the chain
 * has to be told it may be narrower than what it holds.
 */
.done-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 0;
    max-width: 100%;
    margin-left: auto;
}

/*
 * One line, whatever it is asked to say. The name of a ship is the only part of this button that
 * varies, and it used to be allowed to wrap: a long one made the button two or three lines tall,
 * which made this column the tallest in the bottom bar, which pushed the bar past its 30vh and put
 * a scroll bar along the bottom of a battle. So the label is nowrap and the name is the piece that
 * gives — clipped with an ellipsis, with the whole of it on the button's title.
 */
.done-block .wide {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.35ch;
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0.9rem;
    white-space: nowrap;
    overflow: hidden;
}

.done-block .wide .who {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.battle-foot .detail {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-top: 0.35rem;
    padding: 0.3rem 0.45rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: color-mix(in srgb, var(--tint) 8%, transparent);
}

.battle-foot .detail .close { margin-left: auto; padding: 0 0.3rem; }

/* The grid itself. Everything is in hex units, so nothing here is in pixels. */
/* The ground is a picture and nothing else: every click and hover on the field is taken by the
   one .surface rect beneath it, which works out the hex by arithmetic. Leaving these hit-testable
   would put the cost back — the browser walking thousands of polygons on every pointer sample is
   what made a tripled field take thirty seconds to load. */
.hex {
    fill: #0a1020;
    stroke: #1d2740;
    stroke-width: 0.03;
    pointer-events: none;
}

/* Invisible, and the whole field's worth of input. Under every other layer, so a ship's own
   handlers win where a hull is standing. */
/* The grid itself: one tile, repeated by the browser. Stroke only — the ground colour is the
   surface rect's own fill underneath the pattern. */
.hexline {
    fill: none;
    stroke: #1d2740;
    stroke-width: 0.03;
}

/* The ground of one pattern tile. The colour is here rather than on .surface because a CSS fill
   beats a fill presentation attribute in SVG — a rule on .surface paints over url(#hexgrid) and
   the grid vanishes, which is exactly what happened the first time. */
.hexground {
    fill: #0a1020;
}

/* The whole field's worth of input, and the pattern it is filled with. Under every other layer, so
   a ship's own handlers win where a hull is standing.

   Deliberately no fill rule here. See .hexground. */
.surface {
    cursor: crosshair;
}

.hex.steppable { fill: #12203a; stroke: var(--accent); stroke-width: 0.05; cursor: pointer; }
.hex.steppable:hover { fill: #1b2f52; }

/* While a weapon aimed at places is being pointed somewhere, every hex is a target. */
.hex.inreach {
    fill: color-mix(in srgb, var(--accent) 10%, transparent);
    stroke: color-mix(in srgb, var(--accent) 45%, transparent);
}

.hex.aimable { fill: #2a1420; stroke: var(--warn); stroke-width: 0.05; cursor: crosshair; }
.hex.aimable:hover { fill: #43202f; }

/* Ships and shots slide between hexes rather than blinking from one to the next. Both are drawn
   at the origin and put in place by a transform, and both keep their element across renders, so
   the browser has two positions to tween between. */
/* How long a hull or a shot takes to slide, in the CSS that actually moves it. The duration is set
   per element from the distance it has to cover — see --travel, which the field writes as it draws
   each one — so a slug crossing ten hexes takes longer than a missile crossing one instead of both
   taking the same 0.45s and the fast one reading as a jump. Gerald: "do missiles and mass driver
   slugs currently jump to targets, or do they slide as if they were moving (they should slide)."
   They always slid; what they did not do is take a believable amount of time about it. */
.combatant, .shot {
    transition: transform calc((0.22s + (var(--travel, 1) * 0.11s)) * var(--flow, 1)) cubic-bezier(0.33, 0.9, 0.4, 1);

    /* Promoted to its own layer, so the browser tweens it without repainting the four hundred
       hexes underneath it every frame. Without this the slide competes with the render. */
    will-change: transform;
}

/*
 * A hull comes round before it goes, and before it fires. The turn is quick and the move waits for
 * it - which is the whole of "it turns, then it moves" in two declarations: the rotation runs at
 * once and the slide underneath it starts when the turn is over.
 */
.combatant .hull { transition: transform 0.22s ease-out; }
/* A tenth rather than 0.22s: the pause before every slide was a fifth of a second of nothing at
   the head of every single beat, which multiplied into most of what read as stop-motion. */
.combatant { transition-delay: 0.1s; }
.shot { transition-delay: 0s; }

/* The hexes the hull stands on, under it. What can be hit and what blocks a move is the
   footprint, so the footprint is drawn — faintly, because the ship over it is the thing to look
   at. */
.berth { fill: rgba(255, 255, 255, 0.05); stroke: rgba(255, 255, 255, 0.12); stroke-width: 0.02; }

/* <b>Every hull wears its own empire's colour, including yours.</b>

   Yours used to be green whoever you were and theirs was drawn off --side, which meant a fight
   against the empire holding the green seat was a field of one colour. Gerald: "In combat all ships
   are rendering as the same color instead of rendering as player colors. I see raider ships as red,
   but my ships show up as green (despite me being blue), and enemy player's ships are also green."

   The hue is already on every combatant and has been right all along — see SideHue, which reads the
   seat the map draws by and keeps red for the Maw. Nothing was wrong with the number; the rule
   simply did not ask for it on your own side. One rule for both now, so "whose ship is that" is
   answered the same way on the field as it is on the map.

   What tells your ships from theirs is not colour any more and did not need to be: an enemy hull is
   the one that takes a crosshair and a dashed outline when you have a ship selected — see
   .combatant.targetable, a few lines down. */
.combatant .berth {
    fill: color-mix(in srgb, var(--side, var(--accent)) 9%, transparent);
    stroke: color-mix(in srgb, var(--side, var(--accent)) 28%, transparent);
}

.combatant .hull > * { stroke-width: 0.07; stroke-linejoin: round; }
/* <b>The body is the empire's own colour taken down into the dark, not a second colour.</b>
   Both of these were built out of a hue — fill hsl(h 46% 33%), stroke hsl(h 100% 71%) — so a fight
   had one axis to tell nine empires apart on, and the map and the field disagreed about what each
   empire looked like: lime was #c9d84a on one and #f0ff6b on the other. --side now carries the
   colour itself and the body is mixed from it, so there is one palette and the fight reads it. */
.combatant .hull > * {
    fill: color-mix(in srgb, var(--side, var(--accent)) 45%, var(--bg));
    stroke: var(--side, var(--accent));
}
.combatant .hull .spine { fill: #0d1524; }
.combatant .hull .bridge { fill: #e8eefb; stroke: none; }
.combatant.acting .hull > * { stroke: var(--warn); stroke-width: 0.1; }
.combatant.acting .hull .bridge { stroke: none; }
.combatant.targetable { cursor: crosshair; }
.combatant.targetable .hull > * { stroke-dasharray: 0.12 0.08; }

.leaving { fill: none; stroke: var(--muted); stroke-width: 0.05; stroke-dasharray: 0.1 0.1; }

/*
 * A hull going. It is drawn for as long as the shot that killed it takes to be drawn, and then it
 * goes - which is the whole fix: a ship that vanished the instant its state arrived took the beam
 * that killed it with it, so the one thing the player was watching for never appeared.
 */
/* The strip at the foot of a battle that says what the pointer is over. Reserved rather than
   raised: it holds its height whether it is saying anything or not, so nothing on the field ever
   shifts to make room for it. */
.foot.reading { min-height: 4.4rem; }
.foot.reading h2 { margin: 0 0 0.15rem; }
.foot.reading .readline { margin: 0 0 0.15rem; font-size: 0.78rem; font-variant-numeric: tabular-nums; }

/* <b>A ship going up, rather than a ship ceasing to be drawn.</b> It faded out over 0.42s and, since
   the whole exchange was animated in one frame, was routinely gone before the hit that killed it had
   been seen. Gerald: "when a ship is destroyed it just vanishes... It needs something more visual to
   represent that it was destroyed." It flares, swells, spins off its heading and goes — and the
   shockwave beneath it is drawn separately, because a ring that scaled with the hull would vanish
   with it.

   <b>Three exits, three animations, since 6 September 2026.</b> This one served every way off the
   field: "Currently all 3 leaving paths use the animation of a ship retreating. We need a ship
   destroyed animation as well as a ship overloading its warp drive to self destruct animation."
   Which a hull gets is read off the fight — see Leaving in Game.razor. Destroyed keeps the flare
   below; a withdrawal streaks out with no flare at all; an overload is the long white one. */
.combatant.dying { transform-origin: center; }

/* <b>The hull does not move — it stops existing.</b> Any transform on it — the swell, the spin,
   the shrink — read as a ship flying off under power however fast it ran. Gerald, 6 September
   2026: "the ship still appears to fly off as if it was warping... Lets try having the ship
   vanish at the same time as the shards fly out (instead of having the ship warp/stretch/move at
   all)." So the hull flashes for a frame and is simply gone; the debris is the animation. The
   group holds opaque while the shards fly and fades only at the tail, taking the name and the
   health bar with it. */
.combatant.dying.destroyed { animation: goingup calc(2s * var(--flow, 1)) ease-out forwards; }

@keyframes goingup {
    0% { opacity: 1; filter: brightness(1); }
    5% { opacity: 1; filter: brightness(3.5) saturate(0.5); }
    12% { opacity: 1; filter: brightness(1); }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

.combatant.dying.destroyed .hull { animation: hullgone calc(2s * var(--flow, 1)) linear forwards; }

@keyframes hullgone {
    0% { opacity: 1; }
    4% { opacity: 1; }
    6% { opacity: 0; }
    100% { opacity: 0; }
}

/* <b>The explosion is made of parts, not of a filter.</b> A hull that flares, shrinks and fades
   reads as a ship warping away however bright the flare — Gerald, 6 September 2026: "I am still
   seeing all ships being destroyed as the warping away animation. If there actually are
   different animations they are far too similar." So a destruction throws things: shards flung
   outward on their own headings, a fireball, and the shockwave ring — none of which a withdrawal
   gets. */
.boom .fireball {
    fill: #ffb35c;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: fireball calc(1.8s * var(--flow, 1)) ease-out forwards;
}

.boom.big .fireball { fill: #fff3dd; animation-duration: calc(2s * var(--flow, 1)); }

@keyframes fireball {
    0% { opacity: 1; transform: scale(0.25); }
    35% { opacity: 0.95; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(1.7); }
}

.boom .shard {
    fill: #ffd9a8;
    opacity: 0;
    animation: shardfly calc(2s * var(--flow, 1)) ease-out forwards;
}

.boom.big .shard { animation-duration: calc(2s * var(--flow, 1)); }

@keyframes shardfly {
    0% { opacity: 1; transform: rotate(var(--ang)) translateX(0.1px) scale(1); }
    100% { opacity: 0; transform: rotate(var(--ang)) translateX(var(--fling)) scale(0.4); }
}

/* Breaking off: no flare, no debris — a ship leaving is not a ship ending. It gathers itself,
   stretches thin along its own heading and is gone, which is the warp streak everyone reads at a
   glance. */
.combatant.dying.retreating { animation: runningoff calc(0.62s * var(--flow, 1)) ease-in forwards; }

@keyframes runningoff {
    0% { opacity: 1; }
    55% { opacity: 0.9; }
    100% { opacity: 0; }
}

.combatant.dying.retreating .hull {
    animation: intowarp calc(0.62s * var(--flow, 1)) ease-in forwards;
    transform-origin: center;
}

@keyframes intowarp {
    0% { transform: scale(1, 1); }
    55% { transform: scale(0.95, 0.8); }
    100% { transform: scale(2.4, 0.25); }
}

/* The core let go on purpose: a longer, whiter flare and a bigger swell than any hit could buy,
   over the warp-core blast ring the same beat draws where it stood. */
/* The core let go on purpose: the same vanish — no motion, see above — under a longer, whiter
   flash, over the warp-core blast ring the same beat draws where it stood. */
.combatant.dying.overloaded { animation: corelit calc(2s * var(--flow, 1)) ease-out forwards; }

@keyframes corelit {
    0% { opacity: 1; filter: brightness(1); }
    6% { opacity: 1; filter: brightness(7) saturate(0.1); }
    20% { opacity: 1; filter: brightness(2.5); }
    70% { opacity: 1; filter: brightness(1); }
    100% { opacity: 0; }
}

.combatant.dying.overloaded .hull { animation: hullgone calc(2s * var(--flow, 1)) linear forwards; }

/* The blast that says how big the thing was. Its own element under the hull, sized by the hull. */
.deathwave {
    fill: none;
    stroke: #ffd9a0;
    stroke-width: 0.16;
    opacity: 0;

    /* fill-box, or "center" means the middle of the whole viewBox and the scaling ring streaks
       across the field toward the top-left corner. Gerald, 6 September 2026: "I am seeing a ring
       fly off to the top left of the screen when a ship dies, looks like an error." It was. */
    transform-box: fill-box;
    transform-origin: center;
    animation: deathwave calc(1.6s * var(--flow, 1)) ease-out forwards;
    pointer-events: none;
}

@keyframes deathwave {
    0% { opacity: 0.95; transform: scale(0.2); stroke-width: 0.3; }
    100% { opacity: 0; transform: scale(2.6); stroke-width: 0.02; }
}

/* What is left where it died, for the rest of the fight. A field that forgets its casualties reads
   as a field where nothing has happened. */
.wreck { pointer-events: none; }
.wreck circle { fill: rgba(255, 190, 130, 0.05); stroke: rgba(255, 190, 130, 0.22); stroke-width: 0.04; }
.wreck line { stroke: rgba(255, 190, 130, 0.3); stroke-width: 0.06; stroke-linecap: round; }

/* The gun going off, on the hull that fired. Short, because it is punctuation rather than an event. */
.muzzle {
    fill: #fff3d0;
    opacity: 0;
    transform-origin: center;
    animation: muzzle 0.34s ease-out forwards;
    pointer-events: none;
}

@keyframes muzzle {
    0% { opacity: 0.95; transform: scale(0.35); }
    100% { opacity: 0; transform: scale(1.5); }
}

/*
 * Something arriving: a missile into a hull, a slug landing, a round that found an empty hex. A
 * ring that opens where it landed and the number it took off. Short, because it is punctuation
 * rather than an event - the field behind it is what is being read.
 */
.hitmark { pointer-events: none; }

/* <b>A round is born at its ship.</b> The keyframe's from overrides the drawn position for its
   first beats, so a new dart glides out of the hull that fired it to where the engine already has
   it — Gerald: "missiles fired from any ship should appear at that ship and then move forward,
   not appear already having moved." */
/* The CSS translate property, not transform — it composes with the group's transform attribute
   instead of overriding it, so both ends of the glide are stated outright: from the muzzle-to-ship
   delta, to nothing. A keyframe with only a from, leaning on the SVG attribute as its implicit
   end, is what quietly never played for enemy darts. */
.shot.born { animation: shotborn calc(0.34s * var(--flow, 1)) ease-out; }

@keyframes shotborn {
    from { translate: var(--dx) var(--dy); }
    to { translate: 0 0; }
}

/* <b>The last leg.</b> A round that has just landed, flown once from where it was last drawn into
   the hex it went into — Gerald: "A missile hitting its target should show the missile flying all
   the way to the target and then some sort of animation and a damage number to show that it hit."
   It fades out on arrival, under the ring that opens over it. */
.battle .arrival {
    animation: lastleg calc(0.3s * var(--flow, 1)) ease-in forwards;
    pointer-events: none;
}

.battle .arrival polygon { fill: #ffd9a8; }
.battle .arrival.slug polygon { fill: #cfe4ff; }

@keyframes lastleg {
    0% { transform: translate(var(--fx), var(--fy)); opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)); opacity: 0; }
}

/* And a flown hit's ring, core and number wait for the round to get there. Hidden by the base
   opacity during the delay — fill-mode backwards would show the keyframes' opening frame, which
   is a ring already open before anything has arrived. */
.hitmark.flown .hitring,
.hitmark.flown .hitcore,
.hitmark.flown .hitsaid {
    opacity: 0;
    animation-delay: calc(0.28s * var(--flow, 1));
}

.hitring {
    fill: none;
    stroke: var(--warn);
    stroke-width: 0.12;
    transform-origin: center;
    animation: landed calc(0.55s * var(--flow, 1)) ease-out forwards;
}

.hitmark.warhead .hitring { stroke: #ff9d5c; }

.hitcore {
    fill: #ffe9c2;
    animation: landedcore calc(0.5s * var(--flow, 1)) ease-out forwards;
}

.hitsaid {
    fill: var(--warn);
    font-size: 0.62px;
    font-weight: 700;
    text-anchor: middle;
    paint-order: stroke;
    stroke: #05070f;
    stroke-width: 0.14;
    stroke-linejoin: round;
    animation: landedsaid calc(0.9s * var(--flow, 1)) ease-out forwards;
}

/* A missile burned out of the air: the dart drawn one last time where it died, flaring and
   breaking up as the bolt arrives — Gerald: "I need any beam weapon fired (via any means
   including point defense) at a missile to be animated. Currently the missile just vanishes."
   Delayed to roughly when the bolt reaches it. */
.beamline .burnout polygon {
    fill: #ffd9a8;
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
    animation: burnup calc(0.5s * var(--flow, 1)) ease-out calc(0.25s * var(--flow, 1)) forwards;
}

.beamline .burnout .burnring {
    fill: none;
    stroke: #ff9d5c;
    stroke-width: 0.09;
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
    animation: burnring calc(0.5s * var(--flow, 1)) ease-out calc(0.25s * var(--flow, 1)) forwards;
}

@keyframes burnup {
    0% { opacity: 1; transform: scale(1); }
    35% { opacity: 1; transform: scale(1.45) rotate(20deg); }
    100% { opacity: 0; transform: scale(0.15) rotate(80deg); }
}

@keyframes burnring {
    0% { opacity: 0.9; transform: scale(0.3); }
    100% { opacity: 0; transform: scale(1.7); }
}

@keyframes landed {
    0% { opacity: 0.95; stroke-width: 0.2; r: 0.2; }
    100% { opacity: 0; stroke-width: 0.04; }
}

@keyframes landedcore {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes landedsaid {
    0% { opacity: 0; transform: translateY(0.3px); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-0.5px); }
}

/* Not .bar: that is a colony's build progress, and its CSS height beats an SVG one. */
.healthbar.back { fill: #1d2740; }
.healthbar.life { fill: var(--ok); }
.combatant .healthbar.life { fill: var(--side, var(--accent)); }

.shipname {
    fill: var(--muted);
    font-size: 0.34px;
    text-anchor: middle;
    font-family: inherit;
    pointer-events: none;
}

/* Everything in the air. Drawn over the ships, so a shot about to land overlaps its target. */
.layer.flight { pointer-events: none; }
.layer.beams { pointer-events: none; }

/* A missile is a dart with a flame behind it and a slug is a bolt with a streak: both have to
   read at a glance as "something is on its way", because both can now be shot at. */
.shot polygon { stroke-width: 0.06; }
.shot.missile polygon { fill: var(--warn); stroke: #2a1a05; }
.shot.missile .plume { fill: #ffd08a; stroke: none; opacity: 0.9; animation: plume 0.35s ease-in-out infinite alternate; }
.shot.slug polygon { fill: #e8eefb; stroke: #2b3244; }
.shot.slug .streak { stroke: #9fd2ff; stroke-width: 0.18; stroke-linecap: round; opacity: 0.8; }

/*
 * Where a slug is going. A gauss round is fired at a place rather than at a ship, so without this
 * the field says something is in the air and nothing about what it will hit — which is the one
 * thing worth knowing while there is still a round in which to move.
 */
.slugline {
    stroke: #9fd2ff;
    stroke-width: 0.07;
    stroke-dasharray: 0.3 0.24;
    opacity: 0.4;
}

/*
 * What a missile is chasing, drawn only while the pointer is on that missile.
 *
 * Brighter and solider than the slug's line, and deliberately: a slug's line is ambient — it is on
 * the field the whole time a round is in the air, so it has to stay out of the way — where this one
 * is an answer to a question the player just asked by pointing. It is on screen for as long as the
 * pointer is and no longer, so it can afford to be read at a glance.
 */
.missileline {
    stroke: var(--warn);
    stroke-width: 0.09;
    stroke-dasharray: 0.45 0.2;
    opacity: 0.85;
    pointer-events: none;
}
.shot.theirs.missile polygon { fill: #ff8f6b; stroke: #3a1408; }

@keyframes plume {
    from { opacity: 0.35; transform: scaleX(0.6); }
    to { opacity: 0.95; transform: scaleX(1.15); }
}

/* ── The round families ────────────────────────────────────────────────────────────────────────
   The beams' treatment for the other two classes: the body says the weapon, and — because the
   body no longer says the side — the exhaust does instead: pale for yours, red for theirs. A shot
   with no family (an old log's) keeps the classic look above, untouched. See ShotFamily and
   ShotMarks in Game.razor. */

.shot.nuclear, .shot.merculite, .shot.zeon, .shot.antimatter, .shot.pulson,
.shot.driver, .shot.gauss, .shot.singularity, .shot.neutronium {
    --shotbody: #e8eefb;
    --shotedge: #2b3244;
    --shotexhaust: #bfe3ff;
}

/* Three classes deep so an enemy round keeps its family colour — the classic
   .shot.theirs.missile rule above would otherwise win the fill back. */
.shot.missile.nuclear polygon, .shot.missile.merculite polygon, .shot.missile.zeon polygon,
.shot.missile.antimatter polygon, .shot.missile.pulson polygon,
.shot.slug.driver polygon, .shot.slug.gauss polygon, .shot.slug.singularity polygon,
.shot.slug.neutronium polygon {
    fill: var(--shotbody);
    stroke: var(--shotedge);
}

.shot.nuclear .plume, .shot.merculite .plume, .shot.zeon .plume, .shot.antimatter .plume,
.shot.pulson .plume {
    fill: var(--shotexhaust);
}

.shot.driver .streak, .shot.gauss .streak, .shot.singularity .streak, .shot.neutronium .streak {
    stroke: var(--shotexhaust);
}

.shot.theirs.nuclear, .shot.theirs.merculite, .shot.theirs.zeon, .shot.theirs.antimatter,
.shot.theirs.pulson, .shot.theirs.driver, .shot.theirs.gauss, .shot.theirs.singularity,
.shot.theirs.neutronium {
    --shotexhaust: #ff6b6b;
}

/* Missiles, up the ladder: the classic amber dart, then hotter and stranger. */
.shot.nuclear { --shotbody: #ffb64d; --shotedge: #2a1a05; }
.shot.merculite { --shotbody: #ff7847; --shotedge: #33130a; }
.shot.zeon { --shotbody: #7fe3ff; --shotedge: #0a2a33; }
.shot.antimatter { --shotbody: #e08bff; --shotedge: #26103a; }

.shot.antimatter polygon:not(.plume) {
    animation: annihilate 0.6s ease-in-out infinite alternate;
}

/* The guardians' Pulson: the deep blue nothing of yours flies. */
.shot.pulson { --shotbody: #6f9dff; --shotedge: #101c3a; }

/* Slugs: the classic pale bolt, then brighter, then the one that is not light at all. */
.shot.driver { --shotbody: #e8eefb; }
.shot.gauss { --shotbody: #b8dcff; }
.shot.gauss .streak { stroke-width: 0.24; }

/* A Singularity round is a dark thing with a violet edge — the streak is what glows, not it. */
.shot.singularity { --shotbody: #221a38; --shotedge: #a78bfa; }
.shot.singularity polygon:not(.plume) { stroke-width: 0.1; }
.shot.singularity .streak { stroke: #a78bfa; stroke-width: 0.22; }

.shot.neutronium { --shotbody: #7fb2d9; --shotedge: #142433; }

/* ── The marks the damage upgrades wear ──
   Read off the effects the round itself carries, so they compose with any family — and with each
   other, on the round somebody paid three mounts of room for. */

/* Shield Breaker Rounds: a cyan edge — the round is tuned against screens and says so. */
.shot.breaker polygon:not(.plume) { stroke: #4dd7e8; stroke-width: 0.1; }

/* Breaching Warheads: a red-hot edge — what this is for is the hull behind the plate. */
.shot.breaching polygon:not(.plume) { stroke: #ff4438; stroke-width: 0.1; }

/* Explosive Ammunition: the round pulses — it is going to go off, and a thing about to go off
   should not sit quietly on the field. */
.shot.bursting polygon:not(.plume) {
    animation: burstpulse 0.45s ease-in-out infinite alternate;
}

@keyframes annihilate {
    from { fill-opacity: 0.65; }
    to { fill-opacity: 1; }
}

@keyframes burstpulse {
    from { fill-opacity: 0.55; stroke-opacity: 0.55; }
    to { fill-opacity: 1; stroke-opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .shot.antimatter polygon:not(.plume),
    .shot.bursting polygon:not(.plume) {
        animation: none;
    }
}
/* And the same for the Animations setting turned off (AccountSettings.Still). */
:root.still .shot.antimatter polygon:not(.plume), :root.still .shot.bursting polygon:not(.plume) {
        animation: none;
    }

/* The whole flight layer ignores the mouse, so anything the pointer should reach in it has to
   opt back in. Everything drawn is readable — hover, right-click, scan — and the ones something of
   yours could actually stop say so with the cursor instead. Order matters: same specificity, so
   targetable has to come second to win the cursor. */
/* <b>A round's tier and upgrades, drawn</b> (see ShotArt): the silhouette is the weapon's tier, each upgrade one feature.
   Gerald, 5 November 2026: missiles and slugs "distinguished from each other based on the tier of the weapon and the
   upgrades of the weapons, hopefully without slowing the UI down too much". The body polygons keep the family colours
   above; these are the parts added to them, styled more specifically than ".shot.missile polygon" so they keep their own
   colour. Motion is transform and opacity only. */
.shot .shotart .streak.thin { stroke-width: 0.08; opacity: 0.55; }
.shot .shotart .warpring { fill: none; stroke: #b46cff; stroke-width: 0.05; opacity: 0.75; }
.shot .shotart .warpring.far { opacity: 0.45; }
.shot .shotart .orb { fill: var(--shotbody, #221a38); stroke: var(--shotedge, #a78bfa); stroke-width: 0.08; }
.shot .shotart .halo, .shot .shotart .corering {
    fill: none; stroke: var(--shotedge, #a78bfa); stroke-width: 0.05;
    transform-box: fill-box; transform-origin: center; animation: shothalo 1.2s ease-in-out infinite alternate;
}
.shot .shotart .corering { stroke: #ffffff; animation-duration: 0.8s; }
.shot .shotart .core { fill: #ffffff; stroke: none; }
.shot .shotart .coil { fill: none; stroke: var(--shotbody, #b8dcff); stroke-width: 0.05; }
.shot .shotart .band { stroke: var(--shotedge, #2a1a05); stroke-width: 0.05; }
.shot .shotart .pod { fill: var(--shotbody, var(--warn)); stroke: var(--shotedge, #2a1a05); stroke-width: 0.04; }
.shot .shotart polygon.drill { fill: #ff5b3b; stroke: none; }
.shot .shotart .seeker { fill: none; stroke: #ffffff; stroke-width: 0.04; }
.shot .shotart .choke { fill: none; stroke: #ffffff; stroke-width: 0.035; opacity: 0.85; }
.shot .shotart .sheath { fill: none; stroke: #22d3ee; stroke-width: 0.05; stroke-linejoin: round; }
.shot .shotart .chevron { fill: none; stroke: var(--shotbody, #e8eefb); stroke-width: 0.05; opacity: 0.8; }
.shot .shotart .burstring {
    fill: none; stroke: #ff5b5b; stroke-width: 0.05;
    transform-box: fill-box; transform-origin: center; animation: shotburst 0.9s ease-out infinite;
}
/* The raiders' own rounds: a small four-dimensional figure turning, in the hidden-axis colours their ships wear. */
.shot .shotart .hyperround rect, .shot .shotart .hyperround line, .shot .shotart .hyperround polygon { fill: none; stroke-width: 0.05; stroke: #8b5cf6; }
.shot .shotart .hyperround .near { stroke: #d946ef; }
.shot .shotart .hyperround .far { stroke: #22d3ee; }
.shot .shotart .hyperround .spin { transform-box: fill-box; transform-origin: center; animation: shotspin 2.4s linear infinite; }
@keyframes shothalo { from { transform: scale(0.92); opacity: 0.5; } to { transform: scale(1.08); opacity: 0.95; } }
@keyframes shotburst { from { transform: scale(0.8); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }
@keyframes shotspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .shot .shotart .halo, .shot .shotart .corering, .shot .shotart .burstring, .shot .shotart .hyperround .spin { animation: none; }
}
/* And the same for the Animations setting turned off (AccountSettings.Still). */
:root.still .shot .shotart .halo, :root.still .shot .shotart .corering, :root.still .shot .shotart .burstring, :root.still .shot .shotart .hyperround .spin { animation: none; }

.shot.readable { pointer-events: auto; cursor: help; }
/* Discs to click under a round and under a raider figure (13 November 2026): wireframes only take the pointer on their lines. */
.shot .shothit, .hyperhit { fill: transparent; stroke: none; pointer-events: all; }
/* <b>And never painted in a fight</b>, 21 November 2026: the hull's own colouring (.combatant .hull > *, and the prisoner's grey) is
   more particular than .hyperhit and filled the disc. Gerald: "raiders in combat are still showing a non transparent circle behind
   them (needed to be able to click on them, but I shouldnt be seeing it)." */
.combatant .hull > .hyperhit, .combatant.acting .hull > .hyperhit, .combatant.imprisoned .hull .hyperhit {
    fill: transparent !important;
    stroke: none !important;
}
/* On the galaxy map too (13 November 2026): the fleet's own hit circle is a star's size and a raider's figure is a ship's, so a click on
   the figure outside the circle had only its lines to land on. Not while a board is read back, which takes no orders. */
svg.starmap.reading .hyperhit { pointer-events: none; }
/* The galaxy map's raider figures (13 November 2026): an invisible place on the map for raiders.js, and the canvas it draws on,
   laid over the map by the script and never taking the pointer. */
.hypercanvas { fill: none; stroke: none; pointer-events: none; }
.raidercanvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.shot.targetable { pointer-events: auto; cursor: crosshair; }

.lock {
    fill: none;
    stroke: var(--accent);
    stroke-width: 0.07;
    stroke-dasharray: 0.14 0.1;
    animation: spin 3s linear infinite;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/*
 * A beam has already arrived by the time it is drawn, so it is shown arriving — but it also has
 * to still be there afterwards. The trail is the shot, solid and left standing until the next
 * action; the bolt is the travelling segment over it.
 *
 * The first version was the bolt alone, and it animated to a dash offset that put the whole
 * pattern off the end of the line: visible for half a second, then holding a state that drew
 * nothing at all. Which is exactly how it looked — like beams did not work.
 */
/* Every family sets these two and inherits the machinery: the trail is the beam's colour, the
   bolt its bright core. The bare .beamline keeps the classic crimson, which is what a flash from
   a log with no gun on it draws as. */
.beamline {
    --beamcolor: #ff6b6b;
    --beamcore: #fff1f1;
    --beamwidth: 0.16;
    --boltwidth: 0.34;

    /* <b>One battery at a time.</b> Every beam of an activation flashed on the same frame.
       Gerald, 6 September 2026: "a ship that fires multiple beam weapons should fire them
       sequencially not all at the same time." Each beamline carries --salvo — its place in the
       volley times 0.28s, set where it is drawn — and hides until its turn; the children's
       delays below start their animations at the same moment it appears. */
    opacity: 0;
    animation: salvoup 1ms linear forwards;
    animation-delay: calc(var(--salvo, 0s) * var(--flow, 1));
}

@keyframes salvoup {
    to { opacity: 1; }
}

/* The same wait for everything inside — the trail keeps its 0.35s head start on the withdraw,
   and a flicker (the third animation, where a family has one) waits with the rest. */
.beamline .beamtrail {
    animation-delay: calc(var(--salvo, 0s) * var(--flow, 1)), calc((var(--salvo, 0s) + 0.35s) * var(--flow, 1)), calc(var(--salvo, 0s) * var(--flow, 1));
}

.beamline .beam,
.beamline .beamimpact,
.beamline .beamhit {
    animation-delay: calc(var(--salvo, 0s) * var(--flow, 1));
}

.beamline .burnout polygon,
.beamline .burnout .burnring {
    animation-delay: calc((var(--salvo, 0s) + 0.25s) * var(--flow, 1));
}

.beamtrail {
    stroke: var(--beamcolor);
    stroke-width: calc(var(--beamwidth) * var(--mount, 1));
    stroke-linecap: round;
    opacity: 0.55;
    animation: beamsettle calc(0.5s * var(--flow, 1)) ease-out, beamwithdraw calc(1.6s * var(--flow, 1)) calc(0.35s * var(--flow, 1)) ease-in forwards;
}

@keyframes beamsettle {
    from { stroke-width: calc(var(--beamwidth) * var(--mount, 1) * 3); opacity: 1; }
    to { stroke-width: calc(var(--beamwidth) * var(--mount, 1)); opacity: 0.55; }
}

/*
 * The trail is then pulled in from the firing end. A line that simply sits between two ships
 * reads as a rod joining them; one that lets go of the ship that fired and retreats into the one
 * it hit reads as light that went one way. The dash pattern is the full run, so shifting the
 * offset backwards eats the line from its start — which is where the gun is.
 */
@keyframes beamwithdraw {
    from { stroke-dashoffset: 0; opacity: 0.55; }
    to { stroke-dashoffset: calc(var(--run) * -1px); opacity: 0.15; }
}

.beam {
    stroke: var(--beamcore);
    stroke-width: calc(var(--boltwidth) * var(--mount, 1));
    stroke-linecap: round;
    animation: beamtravel calc(0.3s * var(--flow, 1)) ease-in forwards;
}

@keyframes beamtravel {
    from { stroke-dashoffset: calc(var(--run) * 0.3); opacity: 1; }
    to { stroke-dashoffset: calc(var(--run) * -1); opacity: 0; }
}

/* Where it landed, thrown out once. */
.beamimpact {
    fill: none;
    stroke: var(--beamcore, #ffd9d9);
    stroke-width: 0.18;
    animation: beamimpact calc(0.42s * var(--flow, 1)) ease-out forwards;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes beamimpact {
    0% { transform: scale(0.2); opacity: 0; }
    40% { transform: scale(0.2); opacity: 0; }
    55% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* ── The three mount thicknesses ────────────────────────────────────────────────────────────────
   The width every family's beam multiplies by, so the mount reads apart from the gun: a heavy
   mount draws half again as fat, a point-defence beam half as thin, an ordinary beam at one.
   Gerald, 6 September 2026: "make regular beams have some width to them, heavy mounted have twice
   (or maybe 1.5x) the width, and point defense have half the width." Orthogonal to colour — a
   heavy graviton and a heavy laser are both fat, in their own colours. */
.beamline.heavymount { --mount: 1.6; }
.beamline.thin { --mount: 0.5; }

/* ── The beam families ─────────────────────────────────────────────────────────────────────────
   One colour and one habit apiece, so a player can read what is being fired at them off the light
   alone. The ladder brightens and widens as it climbs: a laser is a thin line, a Stellar Lance is
   an event. See BeamFamily in Game.razor, which maps the guns. */

/* Laser Cannon: the classic thin crimson — the line every beam used to be. */
.beamline.laser { --beamcolor: #ff6b6b; --beamcore: #fff1f1; }

/* Fusion Cannon: sunfire. A warmer, slightly heavier line. */
.beamline.fusion { --beamcolor: #ffa94d; --beamcore: #fff3e0; --beamwidth: 0.19; --boltwidth: 0.38; }

/* Neutron Blaster: cold cyan, and it flickers — a stream of particles rather than a light. */
.beamline.neutron { --beamcolor: #4dd7e8; --beamcore: #eaffff; --beamwidth: 0.19; --boltwidth: 0.38; }

.beamline.neutron .beamtrail {
    animation: beamsettle 0.5s ease-out, beamwithdraw 1.6s 0.35s ease-in forwards,
        beamflicker 0.14s steps(2, jump-none) 6;
}

/* Graviton Cannon: violet, wide and soft — space bending rather than light crossing it. */
.beamline.graviton { --beamcolor: #a78bfa; --beamcore: #efe9ff; --beamwidth: 0.26; --boltwidth: 0.42; }

.beamline.graviton .beamtrail { opacity: 0.45; }

.beamline.graviton .beamimpact { animation-duration: 0.6s; }

/* Disrupter: acid green and unstable — it crackles the whole time it stands. */
.beamline.disrupter { --beamcolor: #7ce87c; --beamcore: #f0fff0; --beamwidth: 0.2; --boltwidth: 0.4; }

.beamline.disrupter .beamtrail {
    animation: beamsettle 0.5s ease-out, beamwithdraw 1.6s 0.35s ease-in forwards,
        beamflicker 0.09s steps(2, jump-none) 12;
}

/* Stellar Lance: blue-white and wide, and it lingers — the top of the line is an event, not a
   shot. The withdraw runs slower so the lance hangs on the field a beat longer than anything. */
.beamline.lance { --beamcolor: #9db9ff; --beamcore: #ffffff; --beamwidth: 0.34; --boltwidth: 0.55; }

.beamline.lance .beamtrail {
    animation: beamsettle 0.6s ease-out, beamwithdraw 2.4s 0.5s ease-in forwards;
}

.beamline.lance .beamimpact { stroke-width: 0.26; animation-duration: 0.66s; }

/* The guardians' Ion Cannon: deep sea-blue, so what nobody can research reads as not yours. */
.beamline.ion { --beamcolor: #5c8dff; --beamcore: #e8efff; --beamwidth: 0.22; --boltwidth: 0.4; }

/* Point Defence Turrets: pale thin zaps — machinery doing its job, not a battery firing. */
.beamline.pd { --beamcolor: #d9e2f2; --beamcore: #ffffff; --beamwidth: 0.09; --boltwidth: 0.2; }

.beamline.pd .beamtrail { animation: beamsettle 0.3s ease-out, beamwithdraw 0.8s 0.2s ease-in forwards; }

/* The raiders' own beams: magenta, the Maw's light. */
.beamline.raiderbeam { --beamcolor: #f06bd8; --beamcore: #ffe9fb; --beamwidth: 0.22; --boltwidth: 0.42; }

/*
 * A Reflection Field's answer. Not a gun, so not any gun's colour: a cold white-blue running back
 * down the line the shot arrived on, with the trail withdrawn from the struck ship's end so it
 * reads as the beam being thrown rather than fired. Quick, because it is an answer and not a shot
 * — it should land while the beam that caused it is still on the screen.
 */
.beamline.reflected { --beamcolor: #9ad9ff; --beamcore: #ffffff; --beamwidth: 0.16; --boltwidth: 0.3; }

.beamline.reflected .beamtrail {
    opacity: 0.5;
    animation: beamsettle 0.3s ease-out, beamwithdraw 1s 0.2s ease-in forwards;
}

.beamline.reflected .beam {
    animation-duration: 0.45s;
    filter: drop-shadow(0 0 0.14px var(--beamcolor));
}

/* The number on it, said as a return rather than as a hit: it is written at the ship that fired,
   which is where the damage actually went. */
.beamline.reflected .beamhit { fill: var(--beamcolor); font-style: italic; }

/* The salvo wait again, for every family that declares its own trail animation list — their
   two-class selectors outweigh the general rule above, and a trail that missed its delay would
   run hidden and appear mid-withdraw when its turn came. */
.beamline.neutron .beamtrail,
.beamline.disrupter .beamtrail,
.beamline.lance .beamtrail,
.beamline.pd .beamtrail,
.beamline.reflected .beamtrail {
    animation-delay: calc(var(--salvo, 0s) * var(--flow, 1)), calc((var(--salvo, 0s) + 0.35s) * var(--flow, 1)), calc(var(--salvo, 0s) * var(--flow, 1));
}

.beamline.reflected .beam { animation-delay: calc(var(--salvo, 0s) * var(--flow, 1)); }

/* The field's facets flaring at the hull that threw a beam back: a ring and six chevrons, out and gone. See the beams
   layer in Game.razor. */
.beamline.reflected .reflectburst {
    opacity: 0;
    animation: reflectflare calc(0.9s * var(--flow, 1)) calc(var(--salvo, 0s) * var(--flow, 1)) ease-out forwards;
}
.beamline.reflected .reflectring { fill: rgb(154 217 255 / 18%); stroke: var(--beamcolor); stroke-width: 0.08; }
.beamline.reflected .reflectfacet { fill: none; stroke: var(--beamcore); stroke-width: 0.1; stroke-linecap: round; stroke-linejoin: round; }
.beamline.reflected .beamhit { font-weight: 700; }
@keyframes reflectflare {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}

.specialsfeed .reflectedhead { color: #9ad9ff; margin-top: 0.3rem; }
.specialsfeed .reflectedhead:first-child { margin-top: 0; }
.specialsfeed .reflectedfeed { color: #d9f0ff; }

/* The Planet Cracker: gold-white and enormous, held on the field longest of all. A weapon that
   ends a ship in one hit should not look like a laser that tried hard. */
.beamline.cracker { --beamcolor: #ffd75e; --beamcore: #fffbe8; --beamwidth: 0.7; --boltwidth: 1; }

.beamline.cracker .beamtrail {
    opacity: 0.75;
    animation: beamsettle 0.8s ease-out, beamwithdraw 3.2s 0.9s ease-in forwards;
}

.beamline.cracker .beam { animation-duration: 0.5s; }

.beamline.cracker .beamimpact {
    stroke-width: 0.4;
    animation: crackerimpact 1.6s ease-out forwards;
}

@keyframes crackerimpact {
    0% { transform: scale(0.2); opacity: 0; }
    30% { transform: scale(0.2); opacity: 0; }
    45% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(4.5); opacity: 0; }
}

@keyframes beamflicker {
    from { opacity: 0.3; }
    to { opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
    .beamline.neutron .beamtrail,
    .beamline.disrupter .beamtrail {
        animation: beamsettle 0.5s ease-out, beamwithdraw 1.6s 0.35s ease-in forwards;
    }
}
/* And the same for the Animations setting turned off (AccountSettings.Still). */
:root.still .beamline.neutron .beamtrail, :root.still .beamline.disrupter .beamtrail {
        animation: beamsettle 0.5s ease-out, beamwithdraw 1.6s 0.35s ease-in forwards;
    }

.beamhit { animation: beamhit calc(0.9s * var(--flow, 1)) ease-out forwards; }

@keyframes beamhit {
    0% { opacity: 0; }
    45% { opacity: 0; }
    60% { opacity: 1; }
    100% { opacity: 0.85; }
}

/* A warp core going up: a ring thrown out to the edge of what it catches. */
.blast {
    fill: none;
    stroke: #ffd27f;
    stroke-width: 0.2;
    animation: blast calc(0.8s * var(--flow, 1)) ease-out forwards;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes blast {
    from { transform: scale(0.1); opacity: 1; stroke-width: 0.4; }
    to { transform: scale(1); opacity: 0; stroke-width: 0.1; }
}

/* A gravity well, which is standing ground rather than a thing that happened. Drawn as two rings
   because it does two different things — held inside the inner one, halved inside the outer — and a
   single circle would make a player guess where the difference is. It does not animate away: it is
   still there next round, and something that faded would read as spent. */
.well {
    fill: none;
    stroke: #9b7fd4;
    pointer-events: none;
}

.well.outer {
    stroke-width: 0.12;
    stroke-dasharray: 0.6 0.5;
    opacity: 0.55;
}

.well.inner {
    stroke-width: 0.22;
    opacity: 0.8;
}

.beamhit {
    fill: #ffbdbd;
    font-size: 0.6px;
    text-anchor: middle;
    font-family: inherit;
    font-weight: 600;
}

.shiphealth {
    fill: #9fb0cc;
    font-size: 0.36px;
    text-anchor: middle;
    font-family: inherit;
    pointer-events: none;
}

/* Whichever ship the pointer is over, in numbers rather than in a bar. */
.shipstats + h2, .built + h2, .explains + h2 { margin-top: 0.7rem; }

/* The drawing board. A list of everything that can be fitted, with what it does beside it and a
   pair of buttons to fit more of it — the running total lives above, where the space runs out. */
.fittings li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--line);
}

.fittings li.fitted { background: rgba(72, 199, 128, 0.06); }
.fittings .what { display: flex; flex-direction: column; gap: 0.1rem; flex: 1 1 auto; min-width: 0; }
.fittings .count { display: flex; align-items: center; gap: 0.3rem; flex: 0 0 auto; }
.fittings .count .tally { min-width: 1.4rem; text-align: center; font-variant-numeric: tabular-nums; }

/*
 * A stepper is a row — minus, the number, plus — and it stays a row however narrow the thing
 * beside it gets.
 *
 * It was not, anywhere except in .fittings, and the reason is worth writing down because it is
 * the kind of thing that comes back. The three buttons are inline-level, so they laid themselves
 * out horizontally when there was room and *wrapped into a column* when there was not — and there
 * usually was not, because every one of these sits in the "auto" track of a two-column grid whose
 * other track is a sentence. The drawing board's weapon slots and core lines both did this, which
 * turned a one-line control into a tall vertical block and made the row above it look as though
 * the count and the chooser were fighting for space. They were.
 *
 * flex: 0 0 auto and nowrap is what makes the grid give it its width instead of squeezing it, and
 * the margin reset undoes button.small's top margin, which only makes sense on a button that
 * follows a paragraph.
 */
.stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex: 0 0 auto;
    white-space: nowrap;
}

.stepper > button.small { margin-top: 0; }
.stepper .tally { min-width: 1.4rem; text-align: center; font-variant-numeric: tabular-nums; }

/* A count big enough to be worth typing says so by being one you can put a cursor on. The box it
   turns into is the same width as the number it replaces, so the row does not jump. */
.stepper .tally.typeable { cursor: context-menu; }

.stepper input.tally {
    width: 3.4rem;
    padding: 0.1rem 0.2rem;
    border: 1px solid var(--accent);
    border-radius: 3px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-variant-numeric: tabular-nums;
}

/* Buying a beam unlimited range. On a line of its own under the row, because it is a question
   about the weapon rather than about how many of it — and because when it cannot be bought yet,
   what it is waiting for has to fit. */
.fittings .longrange { flex: 0 0 100%; }

.fittings .longrange label {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    cursor: pointer;
}

.fittings .longrange input { margin: 0; flex: 0 0 auto; align-self: center; }

/*
 * Picking a world off the star itself. The chart is the same one the system panel draws — what
 * changes is that some of the worlds can be taken, and those are ringed and take the pointer.
 */
/*
 * The chart a world is chosen on. It fills the sheet it is in rather than sitting in a 22rem
 * column of it: this is the whole of the decision — which rock a colony goes on — and it was being
 * made through a picture the size of a postcard while the panel around it stood empty.
 */
.orbits.picking { width: 100%; max-width: none; margin: 0.5rem auto; }
.orbits.picking .orbiting.settleable { cursor: pointer; }

/*
 * A world already held, inside the picker. Its own colour, because in here the accent means "you
 * may take this" and a held world is the one thing that is not on offer — see the note in the
 * markup about the two rings that used to be indistinguishable.
 */
.orbits.picking .ownedworld { stroke: var(--ok); stroke-width: 0.3; opacity: 0.9; }

.settlering {
    fill: none;
    stroke: var(--accent);
    stroke-width: 0.5;
    opacity: 0.75;
}

.orbits.picking .orbiting.settleable:hover .settlering {
    opacity: 1;
    stroke: var(--warn);
    stroke-width: 0.8;
}

/*
 * The same chart, picking a world to fire on. A ring in the colour of what is about to happen to
 * it — settling is the accent, bombing is the warning, and cracking is the error, which is the
 * palette's own strongest thing and is exactly what a world being destroyed for good deserves.
 * Two rings rather than one because the fleet either bombs or cracks and never chooses between
 * them here: what the ring says is which of the two this is.
 */
.bombring,
.crackring {
    fill: none;
    stroke-width: 0.5;
    opacity: 0.85;
}

.bombring { stroke: var(--warn); }
.crackring { stroke: var(--error); stroke-dasharray: 1.2 0.8; }

.orbits.picking .orbiting.settleable:hover .bombring,
.orbits.picking .orbiting.settleable:hover .crackring {
    opacity: 1;
    stroke-width: 0.9;
}

/* The choices on the add-a-fitting screen: what it is, what it does, and what it costs. */
.choices li {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--line);

    /* A flex child refuses to shrink below its content unless told, so a weapon's one-line stats
       set the row's floor and pushed the button past the sheet's edge — "part of the button is off
       the dialog". Zero lets the row shrink and the lines inside wrap instead. */
    min-width: 0;
}

.choices .pick {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.choices .pick .grow { min-width: 0; }

/* Every line of a choice wraps, name included.
   Buttons are nowrap across the whole app — see the button rule — which is right for a control
   with a word on it and wrong for one carrying three lines of prose. Gerald: "the text of the
   specials in the add page go off of their buttons, instead of wrapping (same for weapons)."
   overflow-wrap alone could not fix it: nowrap forbids the break that overflow-wrap would take. */
.choices .pick,
.choices .pick * {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* The add screen is a table of figures now, and seven columns do not fit in a menu's width.
   As wide as the page allows, because the rule below is that a weapon is one line and never two:
   Gerald, "expand the size of the dialog and each row so that each item takes exactly 1 line in 1
   row, never 2."

   And a fixed height rather than one that follows the tab you are on: "lets also give it a fixed
   height that fits everything except specials without needing a scroll bar, and then just add a
   vertical scroll bar to any page that doesnt fit." Tall enough for the longest gun shelf and its
   upgrades; the specials, which are cards rather than rows, scroll inside it. Fixed also means the
   tabs stay under the cursor when you move between shelves.

   <b>Named for the fittings and not "picker", which was already taken.</b> The build picker and the
   star picker both open as .sheet.picker — see the rule further down this file — and that rule sets
   a 46rem width and an automatic height, which is exactly right for a grid of cards and exactly
   wrong here. Being the later rule, it won: the dialog came out narrow enough to need a horizontal
   scrollbar and short enough to resize under the cursor as tabs changed, which is what Gerald saw
   twice. Two screens sharing a class name is two screens sharing a size. */
.sheet.fittings {
    width: 98vw;
    height: min(780px, 92vh);
}

/* The body holds two things and neither of them scrolls: the tabs, and the pane under them. */
.sheet.fittings .sheet-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* <b>The pane is the same size on every tab.</b> Gerald: "I want... the entire dialog to not
   rescale based on which tab is open, and to act like actual tabs, that simply change what is
   displayed in them (while keeping the dialog as a whole the same size)." So the box is fixed and
   its contents change; a shelf too long for it scrolls inside it rather than growing the dialog.

   No horizontal scrollbar: the dialog is as wide as the window allows and the widest shelf fits
   inside that, which is what was asked for — "lets remove the horizontal scroll from the add weapon
   dialog, and just make the dialog wider so that the scroll isnt needed." Auto rather than hidden
   all the same, because a window narrow enough to defeat that should cut nothing off. */
.sheet.fittings .tabpane {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.sheet.fittings .tabpane::-webkit-scrollbar { width: 8px; height: 8px; }
.sheet.fittings .tabpane::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* One weapon a row, one figure a column, so a shelf can be read down.
   Gerald: "We want to show them exact numbers that they can use to compare 1 weapon to another of
   the same type." Which is what a table is for and what a list of paragraphs cannot do. */
.picks {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

/* One weapon, one line. A figure that wrapped would put the same weapon on two rows and the eye
   would have to find the join; the headings carry the units so the cells stay short enough for it. */
.picks td,
.picks tbody th {
    padding: 0.35rem 0.45rem;
    text-align: left;
    white-space: nowrap;
    vertical-align: baseline;
}

/* The headings are allowed the second line the rows are not: they are read once. */
.picks thead th {
    padding: 0.3rem 0.45rem;
    text-align: left;
    vertical-align: bottom;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.picks tbody th {
    font-weight: 600;
    color: var(--text);
}

.picks tbody tr {
    border-top: 1px solid var(--line);
    cursor: pointer;
}

.picks tbody tr:hover,
.picks tbody tr:focus-visible {
    background: var(--card);
    outline: none;
}

.picks tbody tr:hover th,
.picks tbody tr:focus-visible th { color: var(--accent); }

/* The one clause the table allows itself, in the same cell as the name it is about. */
.picks tbody th .small { font-weight: 400; }

/* What can be bolted to a shelf's weapons, stated once above them. Facts rather than buttons:
   an upgrade is bought on the drawing board, after the gun is on the ship. */
.mods {
    margin-bottom: 0.7rem;
    padding: 0.5rem 0.6rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.mods h3 {
    margin: 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.mods p { margin: 0.15rem 0 0.4rem; }

.mod {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.3rem 0;
    border-top: 1px solid var(--line);
}

.mod .modname {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Where it was researched, pushed to the right so the column of blocks and tiers lines up. */
.mod .modname .spacer { flex: 1 1 auto; }

/* A special is a card, not a row. Gerald: "for specials the most important part of them is the text
   description, as they dont all do a simple thing like a weapon does, each does something unique."
   Three sections: what it does in the largest type on the screen, how it is used, what it costs. */
.cards {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cards .card.fitting {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
}

.cards .card.fitting .pick {
    width: 100%;
    background: none;
    border: none;
    padding: 0.5rem 0.6rem;
    text-align: left;
    cursor: pointer;
}

.cards .card.fitting .pick:disabled { cursor: default; }

.cards .card.fitting .grow {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.cards .cardhead {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
}

/* The description, which is the whole of what a special is. Bigger than anything else on the
   screen, and the one place in the picker where prose is the point. */
.cards .blurb {
    font-size: 0.98rem;
    line-height: 1.35;
    color: var(--text);
    white-space: normal;
    overflow-wrap: anywhere;
}

.cards .costs { opacity: 0.85; }

/* Everything a player has not researched yet: faded, below what they have, and not clickable.
   Gerald: "so that a player with very little research can see what they can eventually unlock." */
.locked { opacity: 0.5; }

.pickrow.locked { cursor: default; }
.pickrow.locked:hover { background: none; }
.pickrow.locked:hover th { color: var(--text); }

.tag {
    padding: 0.05rem 0.3rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* <b>The figures on a fitting, as chips: label and figure side by side, packed left.</b>
   On the specials in both pickers, and on everything already bolted to a design. A chip carries its
   own unit — there is no heading over it to do that, which is what tells these apart from the
   .picks table.

   <b>Named .figs and not .facts, which was already taken.</b> The battle screen's .fact is a full
   width grid row with justify-content: space-between, and being the later rule it won: the label
   sat against the left edge of the dialog and its figure against the right, with a hand's width of
   nothing between them. Gerald: "you read what the line is on 1 side of the screen, and what the
   answer is on the other side of the screen." Two screens sharing a class name is two screens
   sharing a layout. */
.figs {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.1rem 0.9rem;
    margin: 0.1rem 0;
}

.figs .fig {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    white-space: nowrap;
}

.figs .fig .small { font-variant-numeric: tabular-nums; }

/* Empty for a fitting with nothing to say — a plate is aimed at nobody — and an empty flex row
   would still take its margin. */
.figs:empty { display: none; }

/* The shelves of the add screen: missiles, mass drivers, beams, specials — and defensive,
   offensive, movement, support next door. A tab with nothing behind it is shown disabled rather
   than dropped, so the row reads the same every time the screen is opened. */
.shelves {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.shelves .shelf {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
    background: var(--card);
}

.shelves .shelf.pressed {
    border-color: var(--accent);
    color: var(--accent);
}

.shelves .shelf.pressed .small { color: var(--accent); }

.choices .modification {
    flex: 0 0 100%;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding-left: 0.6rem;
}

/* The core of a design: reported rather than offered, so no controls and no hover. */
.fittings.core li { opacity: 0.85; }

.problems { margin-top: 0.6rem; }
.problems li { padding: 0.1rem 0; }

/* What a colony turns to next. Rows are dragged onto the place they should take, so each one has
   to read as something you can pick up — hence the grip and the move cursor on the whole row. */
.buildqueue { margin: 0.35rem 0 0; }
.buildqueue .row { align-items: baseline; }
.queued { margin: 0.2rem 0; }

.queued li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.2rem 0.3rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    margin-bottom: 0.2rem;
    background: rgba(255, 255, 255, 0.02);
    cursor: move;

    /* Pressed and released rather than dragged — see the colony queue's markup — so a press that
       travels must not paint a text selection across the rows on its way. */
    user-select: none;
    -webkit-user-select: none;
}

/* The row being carried. Faded rather than removed, so the list does not jump under the cursor
   while it is being rearranged. */
.queued li.dragging { opacity: 0.4; border-style: dashed; }
.queued li:hover { border-color: var(--accent); }
.queued .grip { color: var(--muted); font-size: 0.8rem; letter-spacing: -0.1em; }

.designs li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--line);
}

/* Off the board but still answering for what was built from it. */
.designs li.retired { opacity: 0.55; }

/*
 * The fleets dialog's two grids, since 18 November 2026: every fleet as the hull it is built around and how
 * many it holds, and every design that can be built as its art with Edit and Retire under it. Cards in the
 * build picker's idiom (.opt.ship), smaller, so a navy of twenty fleets is a screen rather than a scroll.
 */
.fleetcards,
.designcards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.45rem;
    margin: 0.35rem 0 0.6rem;
}

.fleetcard,
.designcard {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    color: inherit;
    text-align: left;
    padding: 0;
    display: grid;
    grid-template-rows: auto auto;
    overflow: hidden;
}

.fleetcard { cursor: pointer; }
.fleetcard:hover { border-color: var(--accent); background: color-mix(in srgb, var(--card) 88%, var(--accent)); }

.fleetcard .art,
.designcard .art {
    position: relative;
    display: grid;
    place-items: center;
    height: 3.6rem;
    padding: 0.3rem;
    background: #0b1120;
    border: 0;
    border-bottom: 1px solid var(--line);
    width: 100%;
}

.designcard .art { cursor: pointer; }
.designcard .art:hover { background: #0c1830; }

.fleetcard .art svg,
.designcard .art svg { display: block; width: 100%; height: 100%; }

/* How many hulls, over the art's corner where the eye lands after the shape. */
/* A fleet defending its post: the map marker's shield, over the art's other top corner. See HoldPost. */
.fleetcard .holding {
    position: absolute;
    left: 0.3rem;
    top: 0.2rem;
    --atticon-size: 1rem;
}

.fleetcard .holding .atticon { color: #dce6f8; }

/* The art's own rule sizes every svg in it to the whole card; the shield keeps its own size. */
.fleetcard .art .holding svg { width: 1rem; height: 1rem; }

/* A fleet told to give battle this turn: the map marker's crossed blades, below where the shield would sit. See GivingBattle. */
.fleetcard .giving {
    position: absolute;
    left: 0.3rem;
    bottom: 0.2rem;
    --atticon-size: 1rem;
}

.fleetcard .giving .atticon { color: #ff8a7a; }

.fleetcard .art .giving svg { width: 1rem; height: 1rem; }

.fleetbar-head .holdingtag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    font-size: 0.8rem;
    color: #dce6f8;
    --atticon-size: 1rem;
}

.fleetbar-head .holdingtag .atticon { color: #dce6f8; }

.fleetcard .count {
    position: absolute;
    right: 0.35rem;
    bottom: 0.2rem;
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    text-shadow: 0 1px 2px var(--shade);
}

.fleetcard .meta,
.designcard .meta { padding: 0.3rem 0.45rem 0.1rem; display: grid; gap: 0.05rem; min-width: 0; }

.fleetcard .meta { padding-bottom: 0.35rem; }

.fleetcard .nm,
.designcard .nm { font-weight: 600; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fleetcard .hull,
.designcard .hull { color: var(--muted); font-size: 0.66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.designcard .acts { display: flex; gap: 0.3rem; padding: 0.3rem 0.45rem 0.4rem; }
.designcard .acts button { flex: 1; }

/* Drawn ahead of the research: it holds a slot and nothing can lay it down yet. */
.designcard.ahead .art { opacity: 0.5; }

.designcard.new {
    border-style: dashed;
    background: none;
    align-content: center;
    min-height: 7rem;
}

.designcard.new .nm { padding: 0.4rem 0.45rem 0; text-align: center; }

.designcard.new .add {
    height: 100%;
    background: none;
    border: 0;
    color: var(--accent);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.designcard.new:hover { border-color: var(--accent); }

/* The racial traits sheet: this turn's choices, and the way back from them. */
.traitturn {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0 0 0.6rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--accent);
    border-left-width: 2px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--tint) 8%, transparent);
}

.traitturn > span.small { flex: 1; }

.beginopt .rungs .staged { color: var(--accent); }

.beginopt .undo {
    margin-top: auto;
    align-self: stretch;
    padding: 0.25rem 0.5rem;
    font-size: 0.74rem;
    background: none;
    border: 1px dashed var(--accent);
    border-radius: 4px;
    color: var(--accent);
    cursor: pointer;
}

.beginopt .undo:hover { background: color-mix(in srgb, var(--tint) 10%, transparent); }
.beginopt .undo ~ .buy { margin-top: 0.25rem; }

/* A count beside a section heading, in the sentence's own case rather than the heading's capitals. */
.sheet h2 .h2count { margin-left: 0.5rem; text-transform: none; letter-spacing: normal; font-weight: 400; }

/* The library's slots: Edit, Copy and retire beside each, and the retired ones below with Restore. */
.pane .slot .slotacts { display: flex; align-items: center; gap: 0.25rem; }

/* Wider than the ten-slot column it was, now each slot carries Edit and Copy beside its retire. */
.sheet.library .panes { grid-template-columns: minmax(0, 1fr) minmax(22rem, 28rem); }
.pane .slot.retired { opacity: 0.8; border-style: dashed; }
.pane .retiredhead {
    margin: 0.4rem 0.7rem 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
}

button.tag { cursor: pointer; font: inherit; }
button.tag:hover { border-color: var(--accent); }

.explains {
    margin: 0.4rem 0 0;
    padding: 0.4rem 0.55rem;
    border-left: 2px solid var(--accent);
    background: color-mix(in srgb, var(--tint) 7%, transparent);
    font-size: 0.82rem;
}
.shipstats { margin-bottom: 0.5rem; }
.shipstats p { margin: 0 0 0.2rem; }

.shipstats dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.05rem 0.5rem;
    margin: 0.3rem 0;
}

.shipstats dt { color: var(--muted); font-size: 0.72rem; }
.shipstats dd { margin: 0; font-size: 0.78rem; }

/* A star with something sitting on it. Known before it is surveyed — flying in is a decision. */
.guardring {
    fill: none;
    stroke: var(--error);
    stroke-width: calc(var(--map-unit) * 0.45);
    stroke-dasharray: calc(var(--map-unit) * 1.1) calc(var(--map-unit) * 0.9);
    opacity: 0.9;
    pointer-events: none;
}

/*
 * A siege: somebody keeping station at a star with nothing left to stop them, at the end of which
 * every colony there is destroyed. Three turns, counted down on the star itself, because the count
 * is the one number on the map a player has to act on — it is the difference between sending a
 * relief fleet and not bothering. Gerald: "there was no 3 turn countdown visible anywhere to show
 * that the enemy's star was under siege."
 *
 * Warn rather than error, and solid rather than dashed, so it is told apart at a glance from a
 * guarded star's broken red ring. Yours is drawn in the accent: a siege you are running is a clock
 * in your favour and should not read as an alarm.
 */
/* <b>And in the besieger's colour where it can be named</b>, since 30 October 2026 — see SiegeView.ByColour. Gerald: "in an 8
   player game with a star under seige its clear who is doing that seige, and who will take the star if the seige works." The warn
   yellow and the accent are what is left for a besieger the projection cannot name. */
.siegering {
    fill: none;
    stroke: var(--siege, var(--warn));
    stroke-width: calc(var(--map-unit) * 0.4);
    opacity: 0.95;
    pointer-events: none;
}

.siegemark.mine .siegering { stroke: var(--siege, var(--accent)); }

.siegeclock {
    fill: var(--siege, var(--warn));
    font-weight: 700;
    font-variant-numeric: tabular-nums;

    /* The size and the halo are attributes on the element, scaled off the star — a font-size in
       map units drew a digit the height of the galaxy. See StarField. */
    paint-order: stroke;
    stroke: var(--bg);
    pointer-events: none;
}

.siegemark.mine .siegeclock { fill: var(--siege, var(--accent)); }

/* <b>A Transdimensional Gateway rising, in the raiders' own red.</b>
 *
 * The one mark on this map that is shown to everybody wherever it is, because the thing it marks
 * ends the game for everybody — see GameView.GatewaysRising. Two rings rather than one, pulsing
 * outward a beat apart, so it reads as something happening rather than as another badge on a star:
 * Gerald asked for "some sort of giant pulsing ring on the star (maybe even in raider's red color)
 * to signify that this is important and to pay attention to this star."
 *
 * It sits behind the hit circle in the markup, so it is loud and still not in the way of a click.
 */
.gatewayring {
    fill: none;
    stroke: var(--error);
    stroke-width: calc(var(--map-unit) * 0.5);
    opacity: 0.85;
    pointer-events: none;
    transform-box: fill-box;
    transform-origin: center;
    animation: gatewaypulse 2.4s ease-out infinite;
}

.gatewayring.far { animation-delay: 1.2s; }

.gatewayclock {
    fill: var(--error);
    font-weight: 700;
    font-variant-numeric: tabular-nums;

    /* Sized and haloed by attributes on the element, off the star — see .siegeclock, which is the
       same bargain for the same reason. */
    paint-order: stroke;
    stroke: var(--bg);
    pointer-events: none;
}

/* What a star still wants flown to it, beside it on the map while the colony-targets marks are on. Gerald, 16
   October 2026. Smaller than a clock, since it is a reminder rather than an alarm. */
.needclock {
    fill: var(--accent);
    font-weight: 600;
    paint-order: stroke;
    stroke: var(--bg);
    pointer-events: none;
}


@keyframes gatewaypulse {
    0% { transform: scale(0.55); opacity: 0.9; }
    70% { transform: scale(1); opacity: 0.25; }
    100% { transform: scale(1.12); opacity: 0; }
}

/* ── A warp in flight, at both of its ends ──────────────────────────────────────────────
 *
 * Sat next to the Gateway's pulse above on purpose: the two are the pair a player tells apart at a
 * glance, red for the thing out of the black hole and blue for a drive somebody built.
 *
 * The same shape run in opposite directions. The end being left collapses inward and the end being
 * arrived at opens outward, so one journey reads as one journey rather than as two unrelated
 * flickers at opposite corners of the galaxy. Gerald: "maybe with the pulse moving in opposite
 * directions to show leaving here, and arriving there."
 */
.warpring {
    fill: none;
    stroke: var(--warp);
    stroke-width: calc(var(--map-unit) * 0.4);
    pointer-events: none;
    transform-box: fill-box;
    transform-origin: center;
}

.warpring.out { animation: warpleaving 1.8s ease-in infinite; }

.warpring.in { animation: warparriving 1.8s ease-out infinite; }

@keyframes warpleaving {
    0% { transform: scale(1.3); opacity: 0; }
    35% { transform: scale(1); opacity: 0.85; }
    100% { transform: scale(0.25); opacity: 0; }
}

@keyframes warparriving {
    0% { transform: scale(0.25); opacity: 0; }
    35% { transform: scale(0.8); opacity: 0.85; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* <b>Faded at both ends, because it is wholly at neither.</b> Two turns of transit means a turn on
   which the fleet is drawn twice, and a solid marker at either end would be a lie about where it
   is. The ring is left alone — it is the thing saying what is happening. */
.fleet.warping .fleetship,
.fleet.warping .fleetmark { opacity: 0.4; }

.warparrivals { pointer-events: none; }

/* The far end is the fleet, in its owner's colour, exactly as the near end is — the ring is what
   says a warp is happening, and the colour says whose. Falls back to the warp blue for an owner
   the projection could not name. */
.warparrival .mark { fill: var(--fleet, var(--warp)); opacity: 0.45; }

/* The ship itself takes the click and nothing else of the layer does, so the star under the ring keeps its own. */
.warparrival .mark { pointer-events: auto; cursor: pointer; }

/* <b>Except while a course or a jump is being aimed</b>, when the hex under it is what is being pointed at. Since 6 November
   2026 — Gerald: "it can be difficult to click on hexes that an enemy player is teleporting to." The ship marker sat over the
   middle of its landing hex and took the click that was meant to send a fleet there. */
.starmap.plotting .warparrival .mark { pointer-events: none; cursor: inherit; }

/* <b>Star Gates and Gateways on the hex they were set down on</b>, drawn inside the same scaled
 * group a station's beacon is — so the strokes are in beacon units, not map units. A gate is a ring
 * in its owner's colour; a Gateway keeps the raiders' red pulse it has always had. One still going
 * up is drawn faint and dashed with its turns left over it, because a build site is not yet the
 * thing and should not read as one. See Game.razor, beside the OutpostField. */
.hexwork { pointer-events: none; }
.hexwork .gatering { fill: none; stroke: var(--fleet, var(--ok)); stroke-width: 0.45; opacity: 0.9; }
.hexwork .gatecore { fill: var(--fleet, var(--ok)); opacity: 0.8; }
.hexwork .gatewayring { stroke-width: 0.4; }
.hexwork.building .gatering { stroke-dasharray: 0.9 0.6; opacity: 0.6; }
.hexwork.building .gatecore { opacity: 0.35; }

/* A structure on an outpost that is still going up, which only ever means a Star Gate — the one
   structure with a clock on it. Faded the way an unfinished hex work above is, and for the same
   reason: a gate drawn as ready promises a hop the turn will not fly. */
.structureicon.building { opacity: 0.45; }
.structureicon.building .backing { stroke-dasharray: 0.9 0.6; }
.hexworkclock {
    fill: var(--fleet, var(--text));
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    paint-order: stroke;
    stroke: var(--bg);
    stroke-width: 0.5;
}
.hexwork.gateway .hexworkclock { fill: var(--error); }

/* A belt or giant being built into a world, on the star's own view. */
.constructing {
    fill: none;
    stroke: var(--accent);
    stroke-width: 0.35;
    stroke-dasharray: 0.9 0.6;
    pointer-events: none;
}
.constructingclock {
    fill: var(--accent);
    font-weight: 700;
    paint-order: stroke;
    stroke: var(--bg);
    stroke-width: 0.5;
    pointer-events: none;
}

/* Still and plain where the viewer has asked for less movement. The ring has to stay visible —
   what it says is not decoration — so what goes is the beat and not the mark. */
@media (prefers-reduced-motion: reduce) {
    .gatewayring { animation: none; opacity: 0.7; }
    .gatewayover .gatewayring { animation: none; }
}
/* And the same for the Animations setting turned off (AccountSettings.Still). */
:root.still .gatewayring { animation: none; opacity: 0.7; }
:root.still .gatewayover .gatewayring { animation: none; }

/* What a finished battle came to, read over the field it happened on. The backdrop barely dims —
   the wrecks standing where they died are the point of the design — and the rail keeps to the
   right so the field stays visible. */
.overlay.battleover {
    z-index: 8;
    align-items: stretch;
    justify-content: flex-end;
    background: color-mix(in srgb, var(--shade) 35%, transparent);
}

.battlerail {
    width: min(24rem, 92vw);
    max-height: calc(100vh - var(--hud-top) - 1.5rem);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(10, 14, 26, 0.94);
}

.battlerail .battle-head { display: flex; align-items: baseline; gap: 0.6rem; }
.battlerail .railside h3 { margin: 0 0 0.3rem; font-size: 0.8rem; }
/* And the rail that lists the sides is the field's legend, so it wears the same colours. It said
   green for you and red for everybody else, which named the raiders' colour over an empire's and
   drew seven rivals identically. */
.battlerail .railside h3 { color: var(--side, var(--accent)); }

.railship {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.1rem 0.6rem;
    padding: 0.3rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.railship:hover, .railship.hot { background: rgba(139, 92, 246, 0.14); }
.railship .fate { color: var(--muted); font-size: 0.75rem; align-self: center; }
.railship.lost .nm { color: var(--muted); text-decoration: line-through; }
.railship.lost .fate { color: #ff6b6b; }
.railship.gone .fate { font-style: italic; }

.railship .railbar {
    grid-column: 1 / -1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.railship .railbar i { display: block; height: 100%; border-radius: 2px; background: var(--ok); }
.railside .railbar i { background: var(--side, var(--accent)); }

/* A wreck of yours reads in your colour's shadow, so the two sides' dead stay tellable apart. */
.fallen .wreck.minewreck line { stroke: rgba(72, 199, 128, 0.75); }

.fallen .hotring {
    fill: none;
    stroke: #8b5cf6;
    stroke-width: 0.09;
    stroke-dasharray: 0.35 0.25;
    pointer-events: none;
}

/*
 * A question asked *about* the sheet that raised it stands over that sheet.
 *
 * Standing a yard down is the only place in the game where a production figure a player has been
 * watching disappears on purpose, so it asks first — and it is asked from the colony sheet, which is
 * itself an overlay. Both being .overlay, both sat at the same z-index and DOM order decided: the
 * colony sheet is written later in the page, so it painted on top and the question was invisible
 * behind it. Gerald: "the dialog to cancel a building that has progress ... displays behind the
 * colony screen."
 *
 * Raised above every other overlay rather than reordered in the markup, because the fix has to hold
 * wherever the question is asked from. Ordering would work today and break the next time a sheet
 * that can raise this one is moved.
 *
 * Selected on what it contains, so the rule reads as what it is: an overlay holding a question, not
 * an overlay that happens to be called something.
 */
.overlay:has(> .askcard) { z-index: 9; }

.overlay.battleover > .panel {
    position: relative;
    width: min(52rem, 94vw);
    max-height: 88vh;
    overflow: auto;
}

.overlay.battleover .battle { position: static; inset: auto; background: none; }
.overlay.battleover .battle-body { display: block; }

.rewards { margin-top: 0.9rem; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.rewards h3 { margin: 0 0 0.2rem; font-size: 0.8rem; }

/*
 * What a finished battle cost both sides, side by side.
 *
 * <b>Named .battle-tally rather than .tally, and the rename is the bug.</b> Five other places in
 * the game put a "tally" between a minus and a plus — the number of a thing fitted, queued or
 * aboard — and this rule landed on every one of them: a grid whose columns are minmax(15rem, 1fr)
 * with 0.9rem of padding, applied to a span containing the character "0". Each became 252px wide
 * and squeezed the text beside it to 64px, so the attachment list on the drawing board wrapped its
 * descriptions one word to a line and ran off the bottom of the card.
 *
 * The same lesson as .rail, .bay and .track before it, and it is not learning itself: a stylesheet
 * this size has no room for a generic class name. The battle screen's own things are prefixed now.
 */
.battle-tally {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.7rem;
    align-content: start;
    padding: 0.9rem;
    overflow-y: auto;
}

.battle-tally table { margin-top: 0.4rem; }
.battle-tally td { padding: 0.25rem 0.4rem; }
.battle-tally tr.lost td { color: var(--error); text-decoration: line-through; }
.battle-tally tr.gone td { color: var(--muted); font-style: italic; }

/*
 * The fleet you have picked up, along the bottom of the galaxy. Not a sheet over it: choosing
 * which ships go and choosing where they go are one thought, and the map has to stay clickable
 * for the second half of it.
 */
.fleetbar {
    position: absolute;
    left: var(--rail);
    right: var(--rail);
    bottom: 0;
    z-index: 3;
    max-height: 40%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to top, color-mix(in srgb, var(--chrome) 97%, transparent), color-mix(in srgb, var(--chrome) 88%, transparent));
    border-top: 1px solid var(--line);
}

.fleetbar-head {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.45rem 0.7rem;
    border-bottom: 1px solid var(--line);
}

.fleetbar-head .spacer { flex: 1 1 auto; }

/*
 * A wrapper that exists only to carry a tooltip a disabled button cannot be asked for. It has to
 * lay out as though it were not there, so the row goes on being the row of buttons it was.
 */
.offered { display: inline-flex; align-items: baseline; }

.offered > button[disabled] { cursor: not-allowed; }

/*
 * The six directions, up only while something is waiting to be pointed somewhere. Its own row
 * rather than more buttons in the head: the head is a summary with actions on the end of it, and
 * this is a question that has to be answered before anything else on the bar means anything.
 */
.fleetbar-aim {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--tint) 6%, transparent);
}

.fleetbar-ships {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.55rem 0.7rem;
    overflow-y: auto;
}

.fleetbar-ships .pick { width: auto; min-width: 12rem; flex: 0 1 auto; }
.fleetbar-ships .pick:disabled { cursor: default; opacity: 0.85; }

/*
 * The account's shelf, on the drawing board. A kept design outlives the game it was drawn in, so
 * these sit apart from the fittings rather than among them: what is on this hull is one question
 * and what is in your library is another.
 */
.shelf-row { margin-top: 0.5rem; }

.shelf {
    display: grid;
    gap: 0.3rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--card);
    max-height: 12rem;
    overflow-y: auto;
}

.shelf-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.shelf-item .pill { flex: 1 1 auto; text-align: left; }

/* Replacing something kept throws away what was there, so the question is asked plainly and the
   two answers are equally easy to reach — no default, no primary. */
.confirm {
    margin-top: 0.6rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--warn);
    border-left-width: 2px;
    border-radius: 4px;
    background: rgba(227, 179, 65, 0.08);
}

.confirm p { margin: 0 0 0.45rem; font-size: 0.82rem; }

/* ── The drawing board ───────────────────────────────────────────────────────
 *
 * The one sheet that takes the whole window. A design is read across rather than down: what the
 * hull is, what it comes to, and the three lists of things that go on it, all in view while the
 * space runs out. Scrolling it was the old shape's real cost — a player could not see the space
 * meter and the thing they were about to fit at the same time.
 */
.overlay.full { padding: 0.5rem; }

.sheet.full {
    width: 100%;
    height: 100%;
    max-height: none;
}

.sheet.full > .sheet-body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.55rem;
    padding: 0.55rem;
    overflow: hidden;          /* Each column scrolls on its own; the board never does. */
}

/* The bay: what it is | what it looks like | what it is made of. */
/*
 * Facts, the ship, and what it is made of.
 *
 * The middle used to take every spare pixel — minmax(0, 1fr) against two capped columns — so on a
 * wide screen the drawing grew without limit while the chassis stayed at its 25rem ceiling and its
 * rows ran out of room: a player reported the minus button sitting underneath the chooser it
 * belongs beside. The picture is the least information-dense thing on the board and was being
 * handed the most space.
 *
 * So the drawing is capped and the chassis gets the slack. A hull is drawn to scale against the
 * Titan and reads perfectly well at thirty rem; the column that has a label, a chooser, a sentence
 * and a stepper on every row is the one that actually wants the width.
 */
.bay {
    display: grid;
    grid-template-columns: minmax(14rem, 19rem) minmax(0, 30rem) minmax(21rem, 1fr);
    gap: 0.7rem;
    align-items: stretch;
}

.facts { display: grid; gap: 0.28rem; align-content: start; }

.fact {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.22rem 0.55rem;
}

.fact .k { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
.fact .v { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.88rem; }
.fact .v small { color: var(--muted); font-weight: 400; }

.track {
    height: 5px;
    border-radius: 3px;
    background: #0d1422;
    border: 1px solid var(--line);
    overflow: hidden;
    margin-top: 0.25rem;
}

.track > .fill { height: 100%; background: var(--accent); }
.track > .fill.tight { background: var(--warn); }
.track > .fill.over { background: var(--error); }

/*
 * The frame stretches to the panels; the drawing does not. An <svg> sized by percentage needs a
 * container whose height is already known, and without the cap the ship is sized by whichever
 * panel happens to be tallest — so one more stat line would silently grow the Titan.
 */
.hero {
    background: #0b1120;
    border: 1px solid var(--line);
    border-radius: 5px;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
}

.hero .art {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.5rem;
    min-height: 0;
}

.hero .art > .mark { min-height: 0; display: grid; place-items: center; }
.hero svg { display: block; width: 100%; height: 100%; max-height: 7rem; min-height: 0; }

.hero .cap {
    text-align: center;
    padding: 0.3rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.72rem;
}

.hero .cap strong { color: var(--text); font-weight: 600; }

/* Inert until a hull has more than one look. Dimmed rather than hidden, so the frame is already
   the right shape when they are turned on. */
.look {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.5rem 0.45rem;
}

.look[disabled] { opacity: 0.4; cursor: default; }

.hulls { display: flex; gap: 0.3rem; align-items: flex-end; flex-wrap: wrap; margin-top: 0.15rem; }

.hulls .hull {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--muted);
    padding: 0.25rem 0.2rem 0.2rem;
    display: grid;
    justify-items: center;
    gap: 0.05rem;
    flex: 1 1 3.3rem;
    min-width: 3.3rem;
}

.hulls .hull svg { width: 100%; height: 2rem; }
.hulls .hull .nm { font-size: 0.62rem; font-weight: 600; line-height: 1.15; }
.hulls .hull .cap { font-size: 0.6rem; color: var(--muted); }
.hulls .hull:hover:not([disabled]) { border-color: var(--accent); color: var(--text); }
.hulls .hull.pressed { background: var(--card); border-color: var(--accent); color: var(--text); }
.hulls .hull.pressed .cap { color: var(--accent); }

/* Combat's own livery, so the board shows the ship that will be on the field. */
.shipmark > * { stroke-width: 0.07; stroke-linejoin: round; fill: #2f7d52; stroke: var(--ok); }
.shipmark .spine { fill: #0d1524; }
.shipmark .bridge { fill: #e8eefb; stroke: none; }
/* Never the click disc or the canvas placeholder under a raider (13 November 2026): the rule above painted the disc green on a raider's card. */
.shipmark > .hyperhit, .shipmark > .hypercanvas { fill: transparent; stroke: none; }

/* The core slots, one line each. The whole row opens the chooser. */
.chassis { display: grid; grid-auto-rows: min-content; gap: 0.35rem; align-content: start; }

.line {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.05rem 0.6rem;
}

.linemain {
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    padding: 0;
    display: grid;
    gap: 0.05rem;
}

.linemain .lbl {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.linemain .pick {
    color: var(--text);
    font-weight: 600;
    font-size: 0.86rem;
    border-bottom: 1px dashed var(--line);
    justify-self: start;
}

.linemain .pick::after { content: " \25BE"; color: var(--muted); font-size: 0.7rem; }
.linemain:hover .pick { color: var(--accent); border-bottom-color: var(--accent); }
.line .gives { color: var(--muted); font-size: 0.71rem; }
.line.empty .pick { color: var(--muted); }

/* The three lists. Each scrolls inside itself so the board holds still. */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; min-height: 0; }

.col {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
}

.col > header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--line);
}

.col > header h2 { margin: 0; }
.col > header .rule { color: var(--muted); font-size: 0.68rem; }

.col > .list {
    overflow-y: auto;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.col > .list::-webkit-scrollbar { width: 8px; }
.col > .list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.slot {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.4rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
}

.slot.off { border-left-color: var(--line); }

.slot .body { display: grid; gap: 0.1rem; }
.slot .body .n { font-weight: 600; font-size: 0.84rem; }
.slot .body .stat { font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.slot .body .does { color: var(--muted); font-size: 0.71rem; }
.slot .ix { font-size: 0.64rem; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 0.25rem; }

.addslot {
    background: none;
    border: 1px dashed var(--line);
    border-radius: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    padding: 0.5rem;
    width: 100%;
}

.addslot:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }

.board-foot { display: flex; align-items: center; gap: 0.7rem; }
.board-foot .spacer { flex: 1; }

/*
 * The board is the containing block for its own chooser, so the ladder sits over the design
 * rather than over the whole game — and, more to the point, is not clipped away by the
 * sheet-body's overflow.
 */
.sheet.full { position: relative; }
.sheet.full > .sheet-body > .overlay { position: absolute; }

/* A question asked over the board or the library is the height of what it says, not of the window. */
.sheet.full > .sheet-body > .overlay > .sheet.narrow { height: auto; max-height: 100%; }

/* The footer's problems are a row of sentences rather than a list of rows. */
.board-foot .problems { margin-top: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }

.confirm-inline { display: flex; align-items: center; gap: 0.45rem; }

.statlines { display: grid; gap: 0.28rem; }

/* ── The ship library ────────────────────────────────────────────────────────
 *
 * Two panes, because the question this screen answers is "what do I swap for what" and one
 * column cannot ask it: the shelf on the left, the ten this game is carrying on the right.
 */
.panes {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem);
    gap: 0.55rem;
    min-height: 0;
}

.pane {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
}

.pane > header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.4rem 0.7rem;
    border-bottom: 1px solid var(--line);
}

.pane > header h2 { margin: 0; }
.pane > header .count { color: var(--muted); font-size: 0.7rem; }
.pane > header .count.bad { color: var(--warn); }
.pane > header .spacer { flex: 1; }

.pane > .scroll {
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.pane > .scroll::-webkit-scrollbar { width: 8px; }
.pane > .scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.pane .grid {
    padding: 0.6rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 0.6rem;
    align-content: start;
}

/* A square, because the shelf reads as a fleet when every ship gets the same frame. */
.pane .ship {
    aspect-ratio: 1;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
    position: relative;
    text-align: left;
    color: inherit;
    font: inherit;
}

.pane .ship:hover { border-color: var(--line-hi); background: var(--card-hi); }
.pane .ship.picked { border-color: var(--accent); background: var(--card-hi); }
.pane .ship.picked .art { background: #0c1830; }

.pane .ship .art {
    background: #0b1120;
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 0.4rem;
    border-bottom: 1px solid var(--line);
}

.pane .ship .art svg { display: block; width: 100%; height: 100%; max-height: 5.4rem; }

.pane .ship .meta { padding: 0.35rem 0.45rem 0.4rem; display: grid; gap: 0.1rem; }
.pane .ship .nm { font-weight: 600; font-size: 0.82rem; line-height: 1.2; }
.pane .ship .hull { color: var(--muted); font-size: 0.67rem; }

.pane .ship .stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.05rem 0.5rem;
    font-variant-numeric: tabular-nums;
    font-size: 0.66rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

.pane .ship .stats b { color: var(--text); font-weight: 600; }

/* The order they will land in, which is the thing a plain tick cannot say. */
.pin {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #06101f;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid #0b1120;
}

.flag {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    font-size: 0.62rem;
    color: var(--muted);
    background: color-mix(in srgb, var(--chrome) 75%, transparent);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 0 0.25rem;
}

/* The ten, one row each: a name, the turn it was drawn on, and a way off the board. */
.pane .slots { padding: 0.45rem; display: grid; gap: 0.3rem; align-content: start; }

.pane .slot {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.3rem 0.4rem;
}

.pane .slot.empty { border-style: dashed; background: none; }
.pane .slot.doomed { border-color: var(--error); background: rgba(255, 107, 107, 0.09); }
.pane .slot.filling { border-color: var(--accent); background: color-mix(in srgb, var(--tint) 8%, transparent); }

.pane .slot .ix { font-size: 0.64rem; color: var(--muted); text-align: center; }
.pane .slot .berth { display: grid; place-items: center; }
.pane .slot .berth svg { width: 2.2rem; height: 1.5rem; }

.pane .slot .who { display: grid; min-width: 0; }
.pane .slot .who .nm { font-weight: 600; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane .slot .who .sub { color: var(--muted); font-size: 0.66rem; }
.pane .slot .who .sub b { color: var(--text); font-weight: 600; }
.pane .slot.empty .who .nm { color: var(--muted); font-weight: 400; font-size: 0.74rem; }

.drop {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1;
    padding: 0.2rem 0.35rem;
}

.drop:hover:not([disabled]) { border-color: var(--error); color: var(--error); }

.board-foot .lede { display: grid; gap: 0.05rem; }
.board-foot .lede .k { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
.board-foot .lede .v { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.9rem; }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, 18rem); gap: 0.8rem; }

.detail .frame {
    background: #0b1120;
    border: 1px solid var(--line);
    border-radius: 5px;
    height: 9rem;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.detail .frame svg { display: block; width: 100%; height: 100%; max-height: 7.5rem; }
.detail .rows { display: grid; gap: 0.25rem; align-content: start; }

.detail .row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.22rem 0.55rem;
}

.detail .row .k { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
.detail .row .v { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.85rem; }

.fits { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }

.fits .tag {
    font-size: 0.68rem;
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    background: #0d1422;
    border: 1px solid var(--line);
    color: var(--muted);
}

.note {
    margin: 0.6rem 0 0;
    color: var(--muted);
    font-size: 0.76rem;
    border-left: 2px solid var(--warn);
    padding-left: 0.5rem;
}

.primary.danger { background: var(--error); border-color: var(--error); color: #1a0708; }

/* A long sentence in a fixed track has to wrap rather than run off the side of the board. */
.chassis, .line, .linemain { min-width: 0; }
.line .gives, .linemain .pick { overflow-wrap: anywhere; }

/* The library is two rows, not the board's three: the panes take what is left and the footer
   sits under them. Without this it inherits the board's shape and the panes stop at their
   content while the footer stretches into the gap. */
.sheet.library > .sheet-body { grid-template-rows: minmax(0, 1fr) auto; }

/* <b>Finding a kept design, since 28 October 2026</b>: size buttons and a finder above the grid, so the library pane is
   three rows rather than two. The finder's suggestions hang under it, over the grid. See LibraryBody. */
.pane:has(> .libfind) { grid-template-rows: auto auto minmax(0, 1fr); }

.libfind {
    display: grid;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    border-bottom: 1px solid var(--line);
}

.libfind .pills { display: flex; flex-wrap: wrap; gap: 0.25rem; }

.libsearch { position: relative; display: flex; align-items: center; gap: 0.3rem; }
.libsearch input { flex: 1; min-width: 0; }

.libsuggest {
    position: absolute;
    top: calc(100% + 0.2rem);
    left: 0;
    right: 0;
    z-index: 5;
    display: grid;
    background: var(--panel);
    border: 1px solid var(--line-hi);
    border-radius: 6px;
    box-shadow: 0 0.5rem 1.2rem rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.libsuggest button {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 0;
    background: none;
    text-align: left;
}

.libsuggest button:hover, .libsuggest button:first-child { background: var(--card-hi); }

/* What a kept design carries, as the fleet bar's row shows a hull. */
.pane .ship .aboard { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.15rem 0; }

.pill.danger:not([disabled]) { border-color: var(--error); color: var(--error); }

/* ── The build picker ────────────────────────────────────────────────────────
 *
 * A grid rather than a select. A dropdown could give a name and a price and nothing else, so
 * choosing between a laboratory and a factory meant already knowing what each one did; a card
 * has room to say it, and room for what the cost is in turns at this colony's rate.
 *
 * Its own size: bigger than the colony sheet it opens over, and nowhere near the whole window,
 * because the galaxy behind is what the colony is being read against.
 */
.sheet.picker { width: min(46rem, 94vw); height: auto; max-height: 86vh; }
.sheet.picker > .sheet-body { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 0; padding: 0; }

.openbuild {
    flex: 1 1 12rem;
    background: var(--card);
    border: 1px dashed var(--line-hi);
    border-radius: 5px;
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.openbuild:hover { border-color: var(--accent); color: var(--accent); }
.openbuild .plus { font-size: 1rem; line-height: 1; }
.openbuild .spacer { flex: 1; }

.tools {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.tools label { color: var(--muted); font-size: 0.74rem; display: flex; align-items: center; gap: 0.35rem; }
.tools select { margin: 0; font-size: 0.8rem; padding: 0.2rem 0.35rem; }
.tools .spacer { flex: 1; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }

.seg button {
    background: var(--card);
    border: 0;
    color: var(--muted);
    font: inherit;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
}

.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--card-hi); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.seg .n { color: var(--muted); font-size: 0.72rem; margin-left: 0.3rem; }

/* The late game's one empire dialog: its tabs sit above whichever body is open. */
.empiretabs { align-self: flex-start; margin-bottom: 0.8rem; }

.pickgrid {
    padding: 0.6rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    grid-auto-rows: minmax(11.5rem, auto);
    gap: 0.55rem;
    align-content: start;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.pickgrid::-webkit-scrollbar { width: 8px; }
.pickgrid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.pickgrid .empty { grid-column: 1 / -1; padding: 1rem; }

/* A floor rather than a fixed height. It was fixed, so that one long sentence could not make a card
   taller than the one beside it — but the descriptions say what a thing does in figures now and some
   of them are three lines longer than they were, and what a card cannot grow into it simply cut off.
   A build menu that hides the second half of what it is selling is worse than a ragged row. */
.opt {
    height: 100%;

    /* Not min-height: 0 any more — that let the card be squeezed below what is in it, which is the
       other half of why the text was cut. The row has a floor of its own; this may grow past it. */
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    color: inherit;
    text-align: left;
    padding: 0;
    display: grid;
    overflow: hidden;
    position: relative;
}

.opt:hover:not([disabled]) { border-color: var(--accent); background: var(--card-hi); }
.opt[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Three rows that each take what they need: the name, the sentence, the price. The middle one was
   minmax(0, 1fr), which is a row allowed to be shorter than its own contents. */
.opt.build { grid-template-rows: auto auto auto; padding: 0.55rem 0.6rem 0.5rem; gap: 0.25rem; }
.opt.build .nm { font-weight: 600; font-size: 0.86rem; line-height: 1.2; }
.opt.build:has(.flag) .nm { padding-right: 5.5rem; }

/* Wrapped in full. It used to be clamped to four lines with the rest hidden, which is exactly the
   thing being complained about: the sentence a player is deciding on was cut mid-word. */
.opt.build .does {
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.opt .price {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.4rem;
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
}

.opt .price b { font-weight: 600; }
.opt .price .turns { color: var(--muted); }

.opt.ship { grid-template-rows: minmax(0, 1fr) auto; }

.opt.ship .art {
    background: #0b1120;
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 0.4rem;
    border-bottom: 1px solid var(--line);
}

.opt.ship .art svg { display: block; width: 100%; height: 100%; max-height: 4.2rem; }
.opt.ship .meta { padding: 0.4rem 0.55rem 0.45rem; display: grid; gap: 0.12rem; }
.opt.ship .nm { font-weight: 600; font-size: 0.84rem; }
.opt.ship .hull { color: var(--muted); font-size: 0.68rem; overflow-wrap: anywhere; }

/* Trade goods is an instruction rather than a thing, so it does not look like one. */
.opt.trade { border-style: dashed; }
.opt.trade .nm { color: var(--warn); }

/* Already asked for. Still live — pressing it again is the same click undone. */
.opt.inqueue { border-color: var(--accent); background: var(--card-hi); }
.opt.inqueue:hover:not([disabled]) { border-color: var(--error); }
.opt.inqueue:hover:not([disabled]) .flag.queued { border-color: var(--error); color: var(--error); }
.flag.queued { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

/* The refit tab asks which ship before it asks what it becomes, so it has a header saying which
   ship is being talked about and the two ways out of it: back to the list, or a copy of this
   ship's own drawing to change. */
.refithead {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .55rem;
    border-bottom: 1px solid var(--line);
    font-size: .82rem;
}

.refithead .grow { flex: 1; }

/* Now that a click on the card queues *another* one, the way back out has to be its own target.
   A span rather than a button because it lives inside one, and nested buttons render as neither. */
.flag.queued .drop {
    display: inline-block;
    margin-left: 0.3rem;
    padding: 0 0.15rem;
    color: var(--muted);
    cursor: pointer;
}

.flag.queued .drop:hover { color: var(--error); }

/* ── The star panel's head and its works ─────────────────────────────────────
 *
 * What the star is, in the bar that names it. Everything here moves when the focus moves, so the
 * focus is named beside them — and given a fixed width, because a figure that shifts sideways
 * when you press something else reads as having changed when it has not.
 */
.panel-head .headfact { color: var(--muted); font-size: 0.74rem; white-space: nowrap; }
.panel-head .headfact b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.panel-head .dot { color: var(--line-hi); }

.panel-head .focustag {
    display: inline-block;
    min-width: 5.6rem;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    border-radius: 3px;
    padding: 0.02rem 0.35rem;
}

/* What stands here, beside the picture rather than buried in the numbers under it. */
.starworks { display: grid; gap: 0.2rem; margin: 0.4rem 0; }

.starworks h2 {
    margin: 0 0 0.1rem;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.workrow {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--ok);
    border-radius: 4px;
    color: var(--text);
    font: inherit;
    font-size: 0.76rem;
    padding: 0.18rem 0.4rem;
    text-align: left;
    width: 100%;
}

.workrow:hover { border-color: var(--accent); border-left-color: var(--accent); background: var(--card-hi); }
.workrow .grow { flex: 1; }

/* A card that is a choice rather than a stepper gets one transparent button over the whole of
   it, so the click target is the square and not a word in the middle of it. */
.opt .cover {
    position: absolute;
    inset: 0;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.opt .cover[disabled] { cursor: not-allowed; }
.opt .step { display: inline-flex; align-items: center; gap: 0.25rem; position: relative; z-index: 1; }
.opt .step .tally { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 1rem; text-align: center; }
.opt .turns.small { font-size: 0.66rem; }


/* ── What an empire's upgrades look like in a fight ───────────────────────────────────────
   Three marks rather than one badge with three meanings. A player watching an unfamiliar ship
   should be able to read why it hits like that, why it will not stay dead, and why it is already
   across the field — without opening anything. */

.mark { pointer-events: none; }

/* Aggressive: a spur, forward. Half again the damage dealt and a quarter more taken, so the mark
   is a weapon rather than armour. */
.mark.aggressive { fill: var(--warn); opacity: 0.85; }

/* Cybernetic: a working ring, dashed and turning slowly. It mends a quarter of each round, and a
   solid ring would have read as a shield — which is the one thing it is not. */
.mark.cybernetic {
    fill: none;
    stroke: var(--ok);
    stroke-width: calc(var(--map-unit) * 0.16);
    stroke-dasharray: calc(var(--map-unit) * 0.5) calc(var(--map-unit) * 0.45);
    opacity: 0.8;

    /* fill-box, or the rotation spins around the SVG's own origin rather than the ring's — which
       sent every repair ring sweeping the whole battlefield in a giant green orbit. Gerald:
       "there are 2 giant green rings moving in a circle." The ring turns in place now, which is
       the working-machinery effect the dashes were for. */
    transform-box: fill-box;
    transform-origin: center;
    animation: mending 5s linear infinite;
}

@keyframes mending {
    to { transform: rotate(360deg); }
}

/* Speedy: streaks behind. The only one of the three that says something about movement rather than
   about a fight, which is why it is a line and not a shape. */
.mark.quickened {
    stroke: var(--accent);
    stroke-width: calc(var(--map-unit) * 0.13);
    stroke-linecap: round;
    opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
    .mark.cybernetic { animation: none; }
}
/* And the same for the Animations setting turned off (AccountSettings.Still). */
:root.still .mark.cybernetic { animation: none; }


/* ── The lobby's two ways to start ───────────────────────────────────────────
 *
 * Two buttons rather than a dropdown, because they are not two values of one setting: they are two
 * different things to do, and which one is pressed changes the whole of what is asked next.
 */
.modes {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
}

.modes .mode {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    flex: 1 1 12rem;
    padding: 0.6rem 0.8rem;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    cursor: pointer;
}

.modes .mode.pressed {
    border-color: var(--accent);
    background: var(--panel);
}

.modes .mode:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Folded away, for the settings that decide what is being tested rather than what is being played. */
.advanced { margin-top: 0.6rem; }
.advanced > summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
.advanced > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.advanced .row { margin-top: 0.5rem; }

/* A game that is over is a record, and reads as one rather than as a seat gone quiet. */
tr.over td { opacity: 0.75; }
.tag.done { border-color: var(--ok, #4c9c6b); color: var(--ok, #4c9c6b); }


/* ── Where a colony's numbers come from ──────────────────────────────────────
 *
 * A column of steps ending on the figure the row beside it shows. The running total is the thing
 * being followed, so it is the one column that is aligned and tabular; everything else is a label.
 */
.sheet.wheresheet {
    width: min(560px, 94vw);
    height: auto;
    max-height: 80vh;
}

table.wherefrom {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

table.wherefrom td {
    padding: 0.3rem 0.4rem;
    border-bottom: 1px dotted var(--line);
    vertical-align: baseline;
}

table.wherefrom tr:last-child td { border-bottom: 0; }
table.wherefrom td.group { width: 1%; white-space: nowrap; }
table.wherefrom td.what { color: var(--text); }
table.wherefrom td.does { color: var(--muted); }

table.wherefrom td.running {
    width: 1%;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

/* The two lines that are not additions read differently, because they are not additions. */
table.wherefrom tr.from-people td.what,
table.wherefrom tr.from-government td.what,
table.wherefrom tr.from-morale td.what { font-style: italic; }

.wheretotal {
    margin: 0.8rem 0 0;
    padding-top: 0.6rem;
    border-top: 1px solid var(--line);
    text-align: right;
}

.wheretotal strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }


/* ── Losing the mid game ─────────────────────────────────────────────────────
 *
 * The one screen that says an empire has been beaten. It goes up in front of the opening's own
 * choice sheet, because the alternative — which is what shipped first — is a game that appears to
 * have restarted itself for no stated reason.
 */
.raidlost p { margin: 0 0 .7rem; line-height: 1.5; }

.raidlost .row { margin-top: 1rem; }

/* ── Aiming a mass driver ────────────────────────────────────────────────────
 *
 * A driver is fired at a place rather than at a ship, so the decision is the whole line rather than
 * the hex under the pointer. Drawn under the ships, so nothing it crosses is hidden by it.
 */
.layer.aimpath { pointer-events: none; }

.aimpath .aimline {
    stroke: var(--warn);
    stroke-width: 0.07;
    stroke-dasharray: 0.3 0.2;
    opacity: 0.85;
}

.aimpath .aimstep {
    fill: var(--warn);
    fill-opacity: 0.12;
    stroke: var(--warn);
    stroke-opacity: 0.3;
    stroke-width: 0.03;
}

/* Spread Shot's cone: everything the round opens onto between the muzzle and the twenty hexes it
   carries. Fainter than the line, because the line is still where the round is pointed and this is
   the ground it takes with it — a cone painted at one weight would read as twenty hexes of certain
   damage rather than as a spread that thins as it goes. */
.aimpath .aimstep.cone {
    fill-opacity: 0.05;
    stroke-opacity: 0.15;
    stroke-dasharray: 0.12 0.1;
}
/* The cone in flight had rules of its own here and no longer needs them: a slug is one round
   carrying the whole stack, and what it can still reach is drawn by the slug swath when the round
   is read. See CombatRules.ShotSwath and CombatRules.Sweep. */


/* Point blank: something is standing in the muzzle, so the round is settled as it is fired rather
   than put in the air. One hex, painted as a hit rather than as a path, because "the line stops
   here" and "this lands now" are different promises. */
.aimpath.pointblank .aimstep {
    fill: var(--error);
    fill-opacity: 0.3;
    stroke: var(--error);
    stroke-opacity: 0.9;
    stroke-width: 0.06;
}

.aimpath.pointblank .aimmuzzle { fill: var(--error); }

/* The muzzle, because a round leaving from a hex the player cannot see is the whole of the bug this
   was drawn for. */
.aimpath .aimmuzzle {
    fill: var(--warn);
    stroke: none;
    opacity: 0.95;
}

/* Paying for a colony's work from the rail, without opening the world. Sits under the progress
   edge as a strip the full width of the card, so it reads as an action belonging to that colony
   rather than as another figure about it. */
.railbuy {
    display: block;
    margin-top: 0.35rem;
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 0.68rem;
    text-align: center;
    color: var(--muted);
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.railbuy:hover,
.railbuy:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}

/* Already marked. Filled rather than outlined, because "this is spent" is a state and not an
   invitation — and the press that takes it back is the same press. */
.railbuy.bought {
    border-color: var(--good, var(--accent));
    color: var(--good, var(--accent));
    font-weight: 600;
}

/* More than the treasury holds. Still pressable — the engine carries a marked purchase to the
   turn it can be paid for — so it is dimmed rather than disabled, which would hide the price. */
.railbuy.poor {
    opacity: 0.5;
}

/*
 * ── The raider salvage window ────────────────────────────────────────────────────────────────
 *
 * Two systems that used to share one column and one scrollbar: the raiders' own tree, and buying
 * back what the ordinary tree passed over. The counter is the longer of the two and it started
 * below the whole of the first one's history, so the section a player opens the window for on most
 * turns was the one they scrolled past their own past to reach. Gerald: "currently its a small
 * dialog with a long scroll bar (as it was designed for one system and then a second one was
 * attached on top of it)... I want 2 clear separate sections."
 *
 * So: a wider frame, the purse in it rather than in the scroll, and a tab apiece. Both tabs are
 * drawn as the same ladder, which is not a saving — both trees are climbed a rung at a time, and
 * drawing them alike turns a rule a player used to meet as a refusal into a shape they can read.
 */
.sheet.salvagesheet {
    width: min(64rem, 96vw);
    height: min(44rem, 88vh);
}

.salvage {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 0;
}

/* The purse. Both tabs spend it, so it sits above both rather than at the top of one of them. */
.purse {
    display: flex;
    gap: 1.15rem;
    align-items: baseline;
    flex-wrap: wrap;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.purse .fig { display: flex; align-items: baseline; gap: 0.35rem; }

.purse .fig b {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--raiderink);
    font-variant-numeric: tabular-nums;
}

.purse .fig.quiet b { color: var(--muted); font-size: 0.95rem; font-weight: 500; }

.purse .fig span {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* The raiders' own colour, which is not invented: it is what the game already draws a raider's
   beam in. One accent for both counters, so everything priced in salvage reads as one currency. */
.salvage, .sheet.salvagesheet { --raiderink: #f06bd8; }

.gatebox {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 2px solid var(--raiderink);
    border-radius: 6px;
    padding: 0.85rem;
}

.gatebox p { margin: 0; }

.salvagetabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); }

.salvagetabs .tab {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 0.92rem;
    cursor: pointer;
}

.salvagetabs .tab:hover { color: var(--text); }
.salvagetabs .tab.selected { color: var(--text); font-weight: 600; border-bottom-color: var(--raiderink); }

.salvagetabs .tab .cnt {
    font-size: 0.7rem;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 0.4rem;
    font-variant-numeric: tabular-nums;
}

.salvagetabs .tab.selected .cnt { color: var(--raiderink); border-color: var(--raiderink); }

/* ── The ladder, which both tabs are built on ──────────────────────────────────────────────── */

.salvage .ladder {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.salvage .rung, .salvage .trow {
    display: grid;
    grid-template-columns: 1.6rem minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: start;
    border-top: 1px solid var(--line);
}

.salvage .trow { grid-template-columns: 1.6rem minmax(0, 1fr); padding: 0.45rem 0; }

.salvage .ladder > li:first-child { border-top: 0; }

.salvage .rungno {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: right;
    padding-top: 0.45rem;
    font-variant-numeric: tabular-nums;
}

.salvage .rungcost {
    font-size: 0.76rem;
    color: var(--muted);
    padding-top: 0.45rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.salvage .rungbody { min-width: 0; }

/* A rung already climbed is a disclosure: one line until it is asked about, which is what keeps a
   nine-tier history from being most of the window. Gerald: "previous tiers in the raider's tech
   tree should be clickable to see details on what the tech that was chosen is and what was not
   chosen." */
.rungtoggle {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    padding: 0.38rem 0.3rem 0.38rem 0;
    cursor: pointer;
    border-radius: 4px;
    min-width: 0;
}

.rungtoggle:hover { background: var(--card); }
.rung.open .rungtoggle { background: var(--card); }

.rungtoggle .caret { font-size: 0.65rem; color: var(--muted); flex: 0 0 auto; }
.rungtoggle .took { display: flex; align-items: baseline; gap: 0.3rem; flex: 0 0 auto; }
.rungtoggle .took .tick { color: var(--ok); font-size: 0.8rem; }
.rungtoggle .took .nm { font-size: 0.9rem; }

/* What it cost, struck through on the same line as what it bought — the two used to be in separate
   lists, so nothing on the screen said which forfeit paid for which purchase. */
.rungtoggle .gonesum {
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-color: var(--line);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.rungdetail { padding: 0 0 0.6rem; }

.rungdetail .tierline {
    margin: 0.15rem 0 0.4rem;
    font-size: 0.74rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

/* The rung being stood on, opened where it sits rather than in a box at the top of the window —
   which is what makes the tree read as a road with a position on it. */
.salvage .rung.standing {
    background: linear-gradient(90deg, rgba(240, 107, 216, 0.09), transparent 75%);
    border-top-color: var(--raiderink);
    margin: 0.25rem 0;
    padding: 0.5rem 0 0.7rem;
}

.salvage .rung.standing .rungno,
.salvage .rung.standing .rungcost { color: var(--raiderink); font-weight: 600; padding-top: 0.1rem; }

.openhead { display: flex; align-items: baseline; gap: 0.45rem; margin-bottom: 0.45rem; flex-wrap: wrap; }

.openhead .here {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--raiderink);
}

.openhead .sub { font-size: 0.78rem; color: var(--muted); }
.openhead .short { font-size: 0.78rem; color: var(--warn); }

.salvage .rung.next .peek { margin: 0; padding: 0.4rem 0; font-size: 0.82rem; color: var(--muted); }

.salvage .rung.next .peeklbl {
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 0.4rem;
}

.salvage .rung.sealed { opacity: 0.6; }
.salvage .rung.sealed .sealedtxt { font-size: 0.82rem; color: var(--muted); font-style: italic; padding: 0.4rem 0; }

/* ── Technology cards ─────────────────────────────────────────────────────────────────────── */

.salvage .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.4rem;
}

.tcard {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    align-items: flex-start;
    text-align: left;
    white-space: normal;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 2px solid var(--line);
    border-radius: 5px;
    padding: 0.45rem 0.6rem;
    color: var(--text);
    font: inherit;
    min-width: 0;
}

.tcard .nm { font-size: 0.88rem; font-weight: 600; }
/* <b>Newlines the way they were written.</b> Gerald writes these descriptions with line breaks in
   them — "make sure that new lines (as exist in the descriptions that I wrote in the artifact)
   correctly appear in the descriptions of technology (they currently appear in the right click
   description but not on the main page display)". HTML collapses a newline to a space, so the main
   page ran every line together while the right-click sheet, which sets this already, did not. */
.tcard .gv { font-size: 0.76rem; color: var(--muted); white-space: pre-line; }

button.tcard.offer { border-left-color: var(--raiderink); cursor: pointer; }
button.tcard.offer:hover:not(:disabled) { background: var(--card-hover, var(--panel)); border-color: var(--accent); }
button.tcard.offer:disabled { opacity: 0.5; cursor: not-allowed; }

.tcard.mine { border-left-color: var(--ok); }
.tcard.lost { background: transparent; }
.tcard.lost .nm { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }

/* Shown and refused: a Unification looking at morale. The reason is written on the card rather than
   hidden in a tooltip, because a player deciding what to spend on should be able to see what their
   government costs them without hovering to find out. */
.tcard.barred { background: transparent; border-left-color: var(--warn); }
.tcard.barred .nm { color: var(--muted); }
.tcard.barred .why { font-size: 0.72rem; color: var(--warn); margin-top: 0.15rem; }

/*
 * <b>Where the ordinary tree still sells it, and what that rung costs.</b>
 *
 * The one fact this window asks for and never gave. It is on the cards being offered as well as the
 * ones already lost, and that is the whole improvement: on a lost card it explains a decision, on an
 * offered one it makes one. Point Defence Turrets is one tier past Missiles' depth and the
 * Reflection Field is four past Beams', so they are nothing like the same thing to give up.
 */
.home {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px dashed var(--line);
    font-size: 0.7rem;
    width: 100%;
}

.home .hk { text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.home .hw { color: var(--accent); }
.home .hc { color: var(--warn); font-variant-numeric: tabular-nums; }
.home.none .hw { color: var(--muted); font-style: italic; }

/* ── The salvage counter ──────────────────────────────────────────────────────────────────── */

.salvage .blocks { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.blockchip {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font: inherit;
    font-size: 0.8rem;
    color: var(--muted);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
}

.blockchip:hover { color: var(--text); }

.blockchip .n { font-size: 0.72rem; color: var(--raiderink); font-variant-numeric: tabular-nums; }

.blockchip[aria-selected="true"] { color: var(--text); border-color: var(--raiderink); }
.blockchip[aria-selected="true"] .n { font-weight: 600; }
.blockchip.spent .n { color: var(--muted); }

/* The price and the multiplier belong to the tier, not to the row: buying one leftover doubles what
   the other costs, and the going-ahead penalty is a fact about how far the laboratories have got in
   this block. Both were being printed on every button in the tier. */
.salvage .tmeta { display: flex; align-items: baseline; gap: 0.55rem; flex-wrap: wrap; margin-bottom: 0.3rem; }

.tprice { font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tprice b { color: var(--raiderink); font-weight: 600; }

.salvage .badge {
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    padding: 0.02rem 0.35rem;
    border-radius: 3px;
    border: 1px solid var(--line);
    color: var(--muted);
}

.salvage .badge.mult { color: var(--warn); border-color: var(--warn); }

.salvage .locked { display: flex; align-items: baseline; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); padding: 0.15rem 0 0.3rem; }
.salvage .locked .lk { color: var(--line); }

.salvage .cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.32rem; }

.salvage .cell {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    align-items: flex-start;
    text-align: left;
    white-space: normal;
    font: inherit;
    font-size: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.32rem 0.5rem;
    background: transparent;
    color: var(--muted);
    min-width: 0;
}

.salvage .cell .cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.salvage .cell .cs { font-size: 0.68rem; letter-spacing: 0.03em; }

.salvage .cell.known { border-style: dashed; }
.salvage .cell.known .cs { color: var(--ok); }

.salvage .cell.bought { border-color: var(--raiderink); }
.salvage .cell.bought .cn { color: var(--text); }
.salvage .cell.bought .cs { color: var(--raiderink); }

.salvage .cell.shut { opacity: 0.55; }

button.salvage-buy, .salvage .cell.buy { cursor: pointer; background: var(--card); }
.salvage .cell.buy .cn { color: var(--text); font-weight: 600; }
.salvage .cell.buy .cs { color: var(--raiderink); font-weight: 600; }
.salvage .cell.buy:hover:not(:disabled) { border-color: var(--raiderink); }
.salvage .cell.buy:disabled { opacity: 0.45; cursor: not-allowed; }

.salvage .shopfoot { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }

/* Where the opening's two outposts may go. Lit rather than outlined, and drawn as the hexes
   themselves — a hex is either somewhere an outpost may stand or it is not, and a smooth shape
   round them would put the boundary somewhere between hexes, which is the one place the rule never
   puts it. The same argument the Maw's own drawing makes. */
.plantable {
    fill: var(--accent);
    fill-opacity: 0.12;
    stroke: var(--accent);
    stroke-opacity: 0.35;
    stroke-width: calc(var(--map-unit) * 0.2);
    cursor: pointer;
}

.plantable:hover {
    fill-opacity: 0.28;
    stroke-opacity: 0.8;
}

/* Chosen. Filled rather than ringed, because two of these are the whole answer and a player wants
   to see at a glance how many they have left to give. */
.plantable.picked {
    fill-opacity: 0.55;
    stroke-opacity: 1;
    stroke-width: calc(var(--map-unit) * 0.35);
}

/* ─────────────────────────────────────────────────────────────────────────────
 * The combat bar
 *
 * <b>One strip under the field, with four places in it that are always the same
 * four places.</b> There is no top bar at all now: the field takes the screen,
 * and everything a player reads or presses is down here. That is the Master of
 * Orion II arrangement and it works for one reason — a player learns where a
 * thing is once, rather than looking for it every round.
 *
 * Left to right: the acting ship and its guns, the round and what you can do,
 * whatever the cursor is over, and the whole field small. The widths say what
 * each is worth: the ship takes the most because that is what a decision is
 * made with; the target panel is narrowest because it answers one question
 * about one thing; the minimap is a fixed block, which is the whole reason to
 * have one — it stays the same size whatever the grid grows to.
 * ───────────────────────────────────────────────────────────────────────────── */

/*
 * <b>Two fixed blocks and three that share what is left.</b> The buttons and the minimap are the
 * same size whatever the screen is — one is a fixed set of controls and the other is a fixed
 * picture, and letting either stretch buys nothing. Everything else divides the remainder, with a
 * floor under each so a narrow window makes the bar scroll rather than crushing a column until its
 * contents wrap into a column of single words.
 *
 * The floors were the whole of the first layout's trouble: at minmax(0, …) the guns column came out
 * at 337px against 567px of content, so every pill wrapped its text and — being a 999px-radius
 * button — each became a tall rounded slab. The instruction paragraph beneath went one word to a
 * line. It looked like a rendering fault and was arithmetic.
 */
.battlebar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns:
        minmax(11rem, 0.9fr)    /* the acting ship */
        minmax(16.5rem, 1.55fr) /* everything with a press in it — wide enough that a gun's full
                                   name and count fit its half of the bay on one line, which is what
                                   let ShortName come off the weapon stacks. Widened again when the
                                   fire-mode rail moved in, and the width came from the detail bay:
                                   Gerald: "take space from the details panel the right of the
                                   weapons panel instead of taking it from the weapons panel
                                   itself." */
        minmax(9.5rem, 0.75fr)  /* what the armed thing is and does */
        minmax(15rem, 1.3fr)    /* whatever is under the cursor, and what it is carrying */
        15rem;                  /* the field, small, and the four presses, fixed */

    /* Half again the 11rem it was. Gerald, 5 September 2026: "making the entire bottom bar 50%
       taller and increasing the text size of everything so that it all still fits in the space
       available (but there is now more space for everything)." The heights, gaps and paddings
       below scale with it; the text a shade less — the bar's width did not grow, and a line that
       kept pace with the height would outrun its column. */
    height: 16.5rem;

    /* One weapon slot. Three rows of it and the two gaps between them are what the weapons bay is
       sized to show, so changing this changes the bay and the scroll threshold together. Tall,
       because a slot holds a gun's name and up to five upgrade chips wrapped under it now — Gerald:
       "make each button have more space to it so that a missile or mass driver with every possible
       weapon [upgrade] can actually be read." Chosen to fill the bay: 16.5rem less the padding is
       about fifteen, and three of these plus the gaps come to fourteen and a half. */
    --gun-slot: 4.7rem;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

/*
 * <b>No bay ever scrolls.</b> They used to, one at a time, on the grounds that a weapon list is as
 * long as the hull is armed and no height fits every ship. Gerald: "nothing on the bottom bar should
 * ever have a scroll bar, if it does we are not displaying information properly." Quite right — a
 * scroll bar in a bay is the layout admitting it has more to say than it has room for, and what it

 * hides is a gun somebody then does not fire. Everything here is now sized to fit or written shorter
 * until it does.
 *
 * <b>With exactly one exception, added 5 September 2026, and it is the weapons bay.</b> Gerald:
 * "If more than 8 different weapons need to be shown, that is where a scroll bar is allowed (in that
 * section specifically, no where else on the bottom bar)." The bar-wide rule stands everywhere else;
 * see .battlebar .bb-guns .pills, where the trade it buys is argued.
 */
.battlebar .bb-bay {
    min-width: 0;
    min-height: 0;
    padding: 0.65rem 0.9rem;
    border-right: 1px solid var(--line);
    overflow: hidden;
}

.battlebar .bb-bay:last-child { border-right: 0; }

.battlebar h2 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

/* ── 1: the acting ship ───────────────────────────────────────────────── */

.battlebar .bb-whose { margin-bottom: 0.7rem; }
.battlebar .bb-whose .nm { display: block; font-weight: 600; font-size: 1.25rem; }
.battlebar .bb-whose .sub { display: block; color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; }

/* A length rather than a number, because what a player takes off this at a
   glance is "how much of that is gone". The figure rides on it for whoever
   wants it, in tabular figures so it does not jitter as damage lands. */
.battlebar .bb-track { margin-bottom: 0.45rem; }

.battlebar .bb-trackhead {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.15rem;
}

.battlebar .bb-trackhead b {
    color: var(--text);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.battlebar .bb-meter {
    height: 9px;
    background: #0a0f1a;
    border: 1px solid var(--line);
    border-radius: 2px;
    overflow: hidden;
}

.battlebar .bb-meter span { display: block; height: 100%; }
.battlebar .bb-meter.shield span { background: var(--accent); }
.battlebar .bb-meter.armour span { background: #8fa3c4; }
.battlebar .bb-meter.structure span { background: var(--ok); }

/* A quarter left is the point at which the next thing to land is likely to be
   the last one, which is worth saying in colour rather than in arithmetic. */
.battlebar .bb-meter.low span { background: var(--error); }

/*
 * The two that end the ship, in the corner of the bay that is about that ship. Gerald: "the buttons
 * for overloading / retreating a ship should go on the bottom bar of the screen where the current
 * ship is shown with its health. There is room in the top right corner for all of that
 * information."
 *
 * They used to sit in a column with Done, which is pressed every round of every fight — and a hand
 * reaching for that should not be able to scuttle a cruiser by being half an inch out. Small, quiet
 * and red only on the way to being pressed, because neither has an afterwards.
 */
.battlebar .bb-ship { position: relative; }

.battlebar .bb-ends {
    position: absolute;
    top: 0.45rem;
    right: 0.7rem;
    display: flex;
    gap: 0.35rem;
}

.battlebar .bb-ends button {
    padding: 0.15rem 0.5rem;
    background: #0c1220;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--muted);
    font: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.battlebar .bb-ends button:hover:not(:disabled) { border-color: var(--error); color: var(--error); }
.battlebar .bb-ends button:disabled { opacity: 0.4; cursor: not-allowed; }

/*
 * <b>And the one in that row that does not end the ship.</b> Move stands beside Retreat and
 * Overload because that is where a player's hand already is, but it is not a thing to be warned
 * about — so it takes the accent rather than the error colour, and it holds that colour while it
 * is on, since a mode that looks the same pressed as unpressed is a mode nobody trusts.
 */
.battlebar .bb-ends button.go:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.battlebar .bb-ends button.go.on {
    border-color: var(--accent);
    color: var(--accent);
    background: #101a2c;
}

/* ── 2: the four presses, under the map ───────────────────────────────── */

/*
 * <b>Everything a fight is pressed with, in the space under the minimap.</b>
 *
 * They had a column of the bar to themselves — a round counter, a pair of mode buttons, and
 * whatever else ended something — and the map bay had an inch of nothing under it. Gerald: "below
 * the minimap there is currently dead space, let's move the buttons to that space, the only buttons
 * we should need are next ship, commit, replay, and speed controls. Everything else is controlled
 * with right and left mouse clicks."
 *
 * Two to a row, so four of them fit the width of the map without any of them being tall.
 */
.battlebar .bb-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.battlebar .bb-buttons button {
    padding: 0.3rem 0.5rem;
    background: #0c1220;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    text-align: center;
    cursor: pointer;
}

.battlebar .bb-buttons button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.battlebar .bb-buttons button:disabled { opacity: 0.45; cursor: not-allowed; }

.battlebar .bb-buttons .primary {
    border-color: color-mix(in srgb, var(--ok) 55%, var(--line));
    color: var(--ok);
    font-weight: 600;
}

.battlebar .bb-buttons .wide { grid-column: 1 / -1; }

/* The waiting line, on a row of its own at the foot of the bar and always there — blank until the
   round is in — so committing moves nothing. It used to replace the Commit and Plan buttons. */
.battlebar .bb-buttons p { grid-column: 1 / -1; margin: 0; font-size: 0.9rem; }
.battlebar .bb-buttons .bb-status { min-height: 1.35em; }

/*
 * <b>The round, on the seam between the field and the bar.</b>
 *
 * Gerald: "the round number can be a small pill that sticks up a bit over the center of the bottom
 * bar (half in the hex grid, half in the bottom bar, centered)." Half of it stands on the field, so
 * it is scenery — a click that lands on it is a click meant for a hex.
 */
.roundpill {
    position: absolute;
    left: 50%;
    bottom: calc(16.5rem - 0.9rem);
    transform: translateX(-50%);
    z-index: 4;
    padding: 0.08rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* The word, so a bare number is not left to explain itself. */
.roundpill::before {
    content: "Round ";
    color: var(--muted);
    font-weight: 400;
    letter-spacing: 0.08em;
}

/* ── 3: whatever the cursor is over ───────────────────────────────────── */

.battlebar .bb-target .bb-reading { min-width: 0; }
.battlebar .bb-target .nm { font-weight: 600; font-size: 1.1rem; overflow-wrap: anywhere; }

/* The readout carries newlines — what a hull is carrying, then what it has already spent, then its
   specials. Three short lines read at a glance where one long one does not. Trimmed to two, because
   what it is carrying is now a list of its own beside this. */
.battlebar .bb-target .readline {
    margin: 0.08rem 0 0.3rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.battlebar .bb-target .readnote { white-space: pre-line; font-size: 0.85rem; }

/*
 * <b>The weapon list runs down the bay, in columns as narrow as the longest name.</b>
 *
 * They were flex-wrap pills once, which is right for a row of modes and wrong for a list of things
 * that each mean one battery: a name that ran long pushed the next pill onto a row of its own, and
 * holding a gun or losing one to a hit shuffled everything after it. A column keeps a battery in the
 * same place for the whole fight, which is what makes it findable without reading.
 *
 * <b>And the columns are a fixed width now rather than a share of the bay.</b> They were 1fr, so
 * three guns made three wide slabs and eight made eight narrower ones — the size of a button said
 * something about how many buttons there were, which is nothing anybody needs to know. Gerald:
 * "right now they read as these giant things that scale based on the number of them there are. Lets
 * make them smaller, just big enough to fit the longest named thing." So: a column is 8.6rem, which
 * fits "6 × Merculite Missile" at this size, and as many columns as the bay holds. The names that
 * would not fit are shortened rather than the column widened — see ShortName.
 */
/*
 * <b>Eight slots, every one the same size, and the grid is how they are fitted rather than
 * something to read.</b>
 *
 * Gerald, 5 September 2026: "Currently each button sizes itself and it ends up looking like a mess.
 * I would instead have each button be the same size, and the space set aside 8 slots for weapons
 * (this is different from what a ship can currently equip, but that is an intentional choice)...
 * The table should be how the buttons are fit, not a visibly read table of buttons."
 *
 * So the bay is a fixed two-by-four. It was `auto-fill minmax(8.6rem, 1fr)` with a twoup/threeup
 * class on top, which is three rules deciding one thing: the column count changed with the width,
 * the class changed it again with the count, and a gun's own row then shared its width with
 * whatever chips happened to be on it. Three guns could be three different sizes on one screen,
 * which is the mess — a button whose size means nothing still reads as though it means something.
 *
 * A fixed count is set aside whatever the ship carries — six tall slots in two columns now, see
 * --gun-slot — so the bay does not resize as weapons are knocked out or as ships are selected.
 * That is the point of a fixed count rather than a consequence of it.
 */
.battlebar .bb-guns .pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    /* Three rows of a fixed height. Every cell is this tall whatever is in it, which is the whole
       of "each button the same size" — a row that sized to its content would put a five-chip gun
       beside a bare one and undo it. */
    grid-auto-rows: var(--gun-slot);
    align-content: start;
    gap: 0.35rem;
}

/* Filling its cell, so the column reads as a column: ragged right edges on stacked pills look like
   a wrap that went wrong rather than a list. Centred throughout — it was the name centred and the
   upgrades under it left-aligned, which reads as a mistake either way round. Gerald: "only some
   text on them is centered, all of it should be or none of it should be." */
.battlebar .bb-guns .pills > .pill,
.battlebar .bb-guns .gunrow > .pill {
    /* Filling the cell in both directions, which is what makes the slots identical: the grid decides
       the size and nothing inside a button argues with it. A name too long for two lines is clipped
       rather than allowed to grow the row — the whole of it is on the hover and in the window a
       right-click opens. */
    width: 100%;
    height: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.24rem 0.5rem;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.15;
    border-radius: 0.5rem;
}

/* One line and cut short rather than wrapped, because the slot is a fixed height with the upgrade
   line under it: a name that wrapped would push the upgrades out of the cell, and a gun's mods are
   worth more than its last syllable. The bay is sized so the full label fits in practice — see the
   battlebar's columns — and the whole of a name that still does not is on the hover. */
.battlebar .bb-guns .pill .wname {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The guns and, beside them, how much of a stack one click spends. One flex row so the rail takes
   its strip and the grid keeps the rest. */
.battlebar .bb-guns .gunsplit { display: flex; gap: 0.45rem; min-width: 0; }
.battlebar .bb-guns .gunsplit > .pills { flex: 1 1 auto; min-width: 0; }

/*
 * ── The fire modes ────────────────────────────────────────────────────
 *
 * Gerald, 5 September 2026: "Lets make a small new section directly next to weapons table that has
 * 3 toggles" — the whole stack (default), the estimated number needed to destroy the target, and a
 * single shot. Quieter than the pills on purpose: these qualify the click, they are not the click.
 */
.battlebar .bb-guns .firemodes {
    flex: 0 0 auto;

    /* Half what it opened at. Gerald: "the buttons are far too wide, and are taking space away
       from the weapons grid." The words wrap down the narrow button instead — the slots are tall
       enough for three short lines — and the width the rail does need comes out of the detail bay
       next door rather than out of the grid: see the battlebar's columns. */
    width: 3.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;

    /* The pills' own height, so the rail's three share the bay the way the slots do. */
    max-height: calc((3 * var(--gun-slot)) + (2 * 0.35rem));
}

.battlebar .bb-guns .firemodes .fmode {
    flex: 1 1 0;
    min-height: 0;
    padding: 0.2rem 0.25rem;
    background: rgb(255 255 255 / 3%);
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    color: var(--muted);
    font: inherit;
    font-size: 0.8rem;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    white-space: normal;
    overflow: hidden;
}

.battlebar .bb-guns .firemodes .fmode:hover { color: var(--text); background: rgb(255 255 255 / 8%); }

/* Pressed is the mode in force — the same voice the gunrow chips use for the same job. */
.battlebar .bb-guns .firemodes .fmode.pressed {
    border-color: var(--warn);
    color: var(--warn);
    background: rgb(227 179 65 / 12%);
}

/* Wrapped rather than cut. They were one nowrap line ending in an ellipsis, which on a mount
   carrying the whole shop hid most of what it carried — Gerald: "a missile or mass driver with
   every possible weapon [upgrade] can actually be read (right now it is cut off with ... as it is
   too long for a single line)." The slot is tall enough for three chip lines now — see --gun-slot —
   and anything past the slot is clipped by the pill's own overflow, with the right-click window
   carrying the whole list. */
.battlebar .bb-guns .pill .wmods {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.25;

    /* Set back by hand because it inherits nowrap from .battlebar .pill — without this the chips
       refuse to wrap however tall the slot is. */
    white-space: normal;
    max-width: 100%;
    overflow: hidden;
}

/*
 * A gun and the chips that qualify it, on one line.
 *
 * The two mode buttons — aim at a hex, spend one battery — were full-width pills of their own,
 * sitting under the guns and coming and going with the state of the fight. Two problems in one:
 * they were as loud as a weapon while being a qualifier on one, and every appearance or
 * disappearance moved a grid cell and shuffled the whole list. Gerald: "I would change the buttons
 * to appear next to the weapon that they effect, and make the buttons for those weapons smaller
 * (they dont need to fill the row that they are in, and them appearing / disappearing changes the
 * entire flow of the list of weapons)."
 *
 * So the row is the grid cell, the gun takes what room is left, and a chip takes what it needs.
 * A chip going away now widens its own gun and touches nothing else.
 */
.battlebar .bb-guns .gunrow {
    display: flex;
    align-items: stretch;
    gap: 0.3rem;
    min-width: 0;
}

.battlebar .bb-guns .gunrow > .pill {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.battlebar .bb-guns .chip {
    flex: 0 0 auto;
    padding: 0 0.55rem;
    font-size: 0.95rem;
    line-height: 1;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    background: rgb(255 255 255 / 3%);
    color: var(--muted);
    cursor: pointer;
}

.battlebar .bb-guns .chip:hover { color: var(--text); background: rgb(255 255 255 / 9%); }

/* Pressed says which one is doing something, which is the whole point of putting it on the gun. */
.battlebar .bb-guns .chip.pressed {
    border-color: var(--warn);
    color: var(--warn);
    background: rgb(227 179 65 / 12%);
}


/*
 * <b>The one bay on the bar that may scroll, and only past its eighth slot.</b>
 *
 * <b>This reverses a rule, so the old one is written down rather than deleted.</b> It was absolute:
 * "the weapon section should have no scroll, ever" — a scroll bar hides a gun, and a gun you cannot
 * see is one you do not fire. The answer then was to multiply columns, four to a column, a second at
 * five, a third at nine, so everything was always visible at some size or other. That is exactly
 * what produced buttons of three different sizes on one screen.
 *
 * Gerald, 5 September 2026, choosing the other trade: "If more than 8 different weapons need to be
 * shown, that is where a scroll bar is allowed (in that section specifically, no where else on the
 * bottom bar)." So slots are set aside at one size, and the first weapon past them scrolls rather
 * than shrinking the rest.
 *
 * <b>Six of them now rather than eight</b>, from later the same day: the upgrades grew chips that
 * wrap under the gun's name, a slot tall enough to read five of them holds fewer rows, and "lets
 * change the weapons to be able to fit 6 heavily upgraded weapons before it needs to scroll." The
 * height is six slots exactly — three rows and the two gaps between them — so the bar never
 * changes height and the scroll appears only when there is a seventh thing to reach.
 */
.battlebar .bb-guns { overflow: hidden; }

.battlebar .bb-guns .pills {
    /* Three rows, two gaps. Written as the sum rather than a measured height so that changing the
       slot size changes the bay with it.

       Both bounds, and the min is not redundant: the set-aside slots mean a hull with three guns
       leaves the other three empty rather than drawing a shorter bay. A bay that shrank to its
       contents would move everything under it every time a ship was selected, which is the same
       shuffling the fixed grid above exists to stop — one size up. */
    min-height: calc((3 * var(--gun-slot)) + (2 * 0.35rem));
    max-height: calc((3 * var(--gun-slot)) + (2 * 0.35rem));
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.battlebar .bb-guns .pills::-webkit-scrollbar { width: 6px; }
.battlebar .bb-guns .pills::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/*
 * <b>What the armed thing is, and what it will do.</b>
 *
 * This bay listed the fittings a hull merely carries. Gerald: "the area that currently lists the
 * specials on the currently selected ship can be re-purposed to show details on the currently
 * selected weapon (such as upgrades, damage it will deal, what it can hit, or if its a special any
 * other information about what it does)."
 *
 * Sized to fit rather than to scroll: the first few facts, and the window a right-click opens has
 * the rest. See ArmedSheet.
 */
/* <b>The line that matters, and it is bigger than the name above it used to be.</b> Gerald: "the
   information on how many damage a weapon does, or its description for a special is far more
   important than any other information, so that needs to be at the top and in a bigger font so that
   it is more readable." So the bay reads: what it does, what it is, then the qualifiers. */
.battlebar .bb-detail .headline {
    margin: 0 0 0.15rem;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
    overflow-wrap: anywhere;
}

.battlebar .bb-detail .nm {
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.battlebar .bb-detail .standing { margin: 0 0 0.35rem; font-size: 0.9rem; }
.battlebar .bb-detail .standing.held { color: var(--ok); }
.battlebar .bb-detail .standing.gone { color: var(--error); }

/* Label above figure would cost twice the height; side by side, the labels are a narrow column and
   the figures line up down the bay. */
.battlebar .bb-detail .facts {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.55rem;
    row-gap: 0.08rem;
    align-content: start;
}

.battlebar .bb-detail .facts dt {
    font-size: 0.78rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.battlebar .bb-detail .facts dd {
    margin: 0;
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* What it does, in the catalogue's own words — the whole of the answer for a special, where a gun
   is its numbers. Clipped rather than scrolled: the bay may not scroll, and the window a right-click
   opens carries the full text. */
.battlebar .bb-detail .does {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    line-height: 1.25;
    color: var(--muted);
    overflow: hidden;
}

.battlebar .bb-detail .bolted {
    margin: 0.35rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.battlebar .bb-detail .bolted span {
    padding: 0 0.35rem;
    border: 1px solid var(--line);
    border-radius: 0.3rem;
    font-size: 0.8rem;
    color: var(--muted);
    cursor: help;
}

/*
 * <b>What the hull under the cursor is carrying.</b>
 *
 * Gerald: "next to that should be a list of weapon and activatable specials that it has in the same
 * list format that our weapons/specials are shown in, but a bit smaller, as this is a list of
 * weapons not a list of buttons. In addition, any weapons that have been disabled by any means
 * should be crossed out so we see accurate current info."
 *
 * Beside the health rather than under it, which is what buys the room: the bay is two columns, the
 * pools on the left and what it shoots with on the right.
 */
.battlebar .bb-target {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 0.7rem;
    align-content: start;
}

.battlebar .bb-target .idle { grid-column: 1 / -1; font-style: italic; }

.battlebar .bb-target .theirkit {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    align-content: start;
    gap: 0.1rem;

    /* The one list in this bay allowed a scroll bar, and only the list. Gerald, 5 September 2026:
       "if there are enough different weapons this area can also have a scroll bar, but only the
       weapon/specail list not the entire clicked ship that we are looking at." Sized to the bay:
       the bar is 16.5rem and the bay's padding takes 1.3. */
    max-height: 15.2rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

/* One weapon a line, whole: the name, and its upgrades as chips after it. Cut with an ellipsis
   rather than wrapped, so a heavily upgraded gun stays one line — the whole of it is on the
   hover. */
.battlebar .bb-target .theirkit li {
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--text);
    cursor: help;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The chip both lists share: after a weapon's name in the kit list, and on a clicked round's own
   reading. */
.battlebar .bb-target .kitmod {
    margin-left: 0.3rem;
    padding: 0 0.3rem;
    border: 1px solid var(--line);
    border-radius: 0.3rem;
    font-size: 0.75rem;
    color: var(--muted);
    cursor: help;
}

/* A clicked round's upgrades, as a row of chips under its damage line. */
.battlebar .bb-target .shotmods {
    margin: 0.2rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.battlebar .bb-target .shotmods .kitmod { margin-left: 0; }

/* ── The always-on specials, under the tracks ─────────────────────────── */

.battlebar .bb-target .passivekit {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
    display: grid;
    align-content: start;
    gap: 0.1rem;
}

.battlebar .bb-target .passivekit li {
    font-size: 0.85rem;
    line-height: 1.25;
    color: var(--muted);
    cursor: help;
    overflow-wrap: anywhere;
}

.battlebar .bb-target .passivekit li.gone {
    text-decoration: line-through;
    opacity: 0.6;
}

/* The specials it can set off, told apart from the guns without a heading to say so. */
.battlebar .bb-target .theirkit li.fires { color: var(--accent); }
.battlebar .bb-target .theirkit li.muted { color: var(--muted); font-style: italic; }

/* Crossed out means it cannot fire: knocked out, or out of shots. Half the point of the list. */
.battlebar .bb-target .theirkit li.gone {
    text-decoration: line-through;
    color: var(--muted);
    opacity: 0.6;
}

/*
 * ── The round you have written, and where it is now written ──────────────────────────────
 *
 * There was a panel here — three columns for the three phases of a round, a drag handle, a line per
 * written step, a lit state for the line under the pointer and the matching glow on the hull and
 * ring on the hex it named. Roughly a hundred lines of stylesheet, all of it in service of reading
 * a plan in words because the field could not show one: a planned move was a faded outline standing
 * beside a hull that had not moved.
 *
 * The field shows it now. The hull stands where its orders leave it and a written shot stands at
 * its muzzle in the shape it will fly in, so there is nothing left for a sentence to add. Gerald:
 * "I think the entire dialog that shows what each ship is planning on doing in each phase can go
 * away as well." See .preview, which is the whole of what is left, and .shot.planned in it.
 */

/*
 * <b>What an armed special is waiting for, over the field.</b>
 *
 * It has claimed to be over the field since the pills moved in beside the guns, and it was not: laid
 * out in the ordinary flow it fell through to the bottom of the page, under the bar. Gerald: "when
 * using a special (such as gravity spike) the instructions for what to do are at the bottom of the
 * screen, below the bottom bar." What the line says is what the *next click on the field* will mean,
 * so it belongs where that click is going.
 *
 * Above the refusal rather than beside it, so that the standing sentence keeps its place when a
 * transient one appears under it — see .battlesaid, which sits on the bar itself. Scenery, both of
 * them: a note about what to click must never eat the click.
 */
.battlemode {
    position: absolute;
    left: 50%;

    /* The same 2.7rem above the refusal's shelf that it has always kept, moved up with the bar —
       see .battlesaid, whose comment carries the arithmetic. */
    bottom: 19.7rem;
    transform: translateX(-50%);
    z-index: 3;
    margin: 0;
    padding: 0.2rem 0.7rem;
    width: fit-content;
    max-width: min(34rem, 90%);
    border: 1px solid var(--warn);
    border-radius: 999px;
    background: color-mix(in srgb, var(--chrome) 94%, transparent);
    box-shadow: 0 0.4rem 1.2rem rgb(0 0 0 / 45%);
    color: var(--warn);
    text-align: center;
    pointer-events: none;
}

/* ── The sheet a fitting opens ─────────────────────────────────────────────────────────── */

.sheet.fittingsheet { width: min(440px, 100%); }

/* Whether the thing is still bolted on, first and loudest: a player reading what a cloak does needs
   to know before anything else whether they still have a cloak. */
/* The headline first and largest in the window too, so the bar and the window read the same way
   round. See FittingSheet.Fitting.Headline. */
.fittingsheet .fitheadline {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
}

.fittingsheet .fitstanding {
    margin: 0 0 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.fittingsheet .fitstanding.held { color: var(--ok); }
.fittingsheet .fitstanding.gone { color: var(--error); }

.fittingsheet .fitfacts {
    margin: 0.6rem 0 0;
    display: grid;
    gap: 0.25rem;
}

.fittingsheet .fitfact {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 0.5rem;
    align-items: baseline;
}

.fittingsheet .fitfact dt {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
}

.fittingsheet .fitfact dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.85rem;
}

.fittingsheet .fitmods { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.fittingsheet .fitmods li { margin-bottom: 0.3rem; font-size: 0.8rem; }

/* ── 4: the field, small ──────────────────────────────────────────────── */

.battlebar .bb-map { display: flex; flex-direction: column; align-items: center; }

.battlebar .minimap {
    width: 13rem;
    height: 5.4rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: #05070d;
}

/* The dots are the ships, so they are coloured the way the ships are. Both selectors kept rather
   than collapsed to one: .us and .them still say which is which to anything else reading them. */
.battlebar .minimap .us,
.battlebar .minimap .them { fill: var(--side, var(--accent)); }
.battlebar .minimap .shot { fill: var(--warn); }
.battlebar .minimap .acting { stroke: var(--ok); stroke-width: 0.25; }

/* Said where it happened, over the field rather than in a bar that no longer
   exists. The fight goes on being playable, so this is the only trace left of a
   fault that used to end the game silently. */
.battlebroke {
    position: absolute;
    left: 0.9rem;
    top: 0.6rem;
    margin: 0;
    padding: 0.3rem 0.55rem;
    background: color-mix(in srgb, var(--chrome) 92%, transparent);
    border: 1px solid var(--error);
    border-radius: 4px;
}


/*
 * ── Why the last click did nothing, said on the field ─────────────────────────────────────
 *
 * Gerald: "messages that the game has for say a move you cannot make, should show text on the
 * screen for exactly where that illegal move is (so not at the bottom, but on the combat grid
 * somewhere, maybe right above the bottom bar)." It was under the bar, which is a place a hand
 * on the field is not looking — a refusal read half a second after the click that caused it is
 * indistinguishable from a broken button.
 *
 * So: over the grid, centred, resting on the bar. The bar is a fixed sixteen and a half rems —
 * see .battlebar's height — which is what this offset stands on; anything taller and this would be
 * underneath it, which is exactly where it went when the bar grew half again and this stayed at
 * eleven. Gerald: "the message that something cant happen for some reason, is now over the bottom
 * bar."
 */
.battlesaid {
    position: absolute;
    left: 50%;
    bottom: 17rem;
    transform: translateX(-50%);
    z-index: 3;
    margin: 0;
    max-width: 34rem;
    padding: 0.35rem 0.7rem;
    text-align: center;
    background: color-mix(in srgb, var(--chrome) 94%, transparent);
    border: 1px solid var(--warn);
    border-radius: 4px;
    box-shadow: 0 0.4rem 1.2rem rgb(0 0 0 / 45%);

    /* It hears the pointer now, which reverses a ruling: it was scenery — "a refusal must never
       eat the click that would have fixed it" — and a message that can be dismissed has to hear
       the press. Gerald, 5 September 2026: "it should have some way to be dismissed, maybe a
       right click on the message closes it." Either button dismisses it, so the one click it can
       eat is the one that buys the field back. */
    cursor: pointer;
}

/* ── The scan sheet ───────────────────────────────────────────────────── */

.battle .veil {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    background: color-mix(in srgb, var(--shade) 72%, transparent);
    z-index: 5;
}

/*
 * <b>Nothing in this game scrolls sideways.</b>
 *
 * This was `overflow: auto`, which is both bars, and the card is 34rem holding a five-column table
 * whose longest cells are sentences — so a hull with a long fitting name pushed the table wider than
 * the card and the player got a horizontal scroll bar under it. Gerald: "This window needs to be big
 * enough to see details about it, but not so big that it takes up the entire screen. A vertical
 * scroll bar here is fine, but horizontal on anything is not."
 *
 * So the rule is taken generally and both halves of it are answered: the card is a little wider and
 * capped in height rather than allowed to fill the screen, sideways overflow is refused outright,
 * and the table below is told it may wrap — because hiding the overflow without letting the content
 * wrap would trade a scroll bar for a clipped word, which is worse.
 */
.scancard,
.askcard {
    /* Twice what it was. Gerald, 5 September 2026: "the ship details UI dialog could be twice as
       wide as it currently is. I would rather the details are easier to read even if they obstruct
       the rest of the screen." The name column keeps a floor besides — see td:nth-child(2) below —
       which at the old width pushed the "now" figures off the card's right edge. */
    width: min(76rem, 96%);
    max-height: min(100%, 42rem);
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0.85rem 1rem 1rem;
}

.scancard.enemy { border-color: color-mix(in srgb, var(--error) 45%, var(--line)); }

.askcard { width: min(26rem, 100%); }
.askcard h2 { margin: 0 0 0.4rem; font-size: 1rem; }
.askcard p { margin: 0 0 0.5rem; font-size: 0.85rem; }
.askcard .row { display: flex; gap: 0.4rem; margin-top: 0.7rem; }
.askcard .grow { flex: 1; }

/* The settings menu, on either page. Fixed to the window rather than absolute over the galaxy like
   .overlay, because the lobby has no galaxy to sit over, and above everything — a player opening it
   mid-dialog wants it in front. See SettingsMenu.razor. */
.settingsveil {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: color-mix(in srgb, var(--shade) 86%, transparent);
}

.settingscard { width: min(28rem, 100%); }
.settingrow { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin: 0.55rem 0; flex-wrap: wrap; }
.settinglabel { font-size: 0.85rem; }

.scanhead { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.7rem; }
.scanhead h2 { margin: 0; font-size: 1rem; letter-spacing: 0.02em; }
.scanhead .spacer { flex: 1; }
.scanhead .scanart { width: 2.6rem; height: 2.6rem; flex: none; }
.scanhead .close { background: transparent; border: 0; color: var(--muted); cursor: pointer; }

.scanhead .acted {
    font-size: 0.64rem;
    padding: 0.05rem 0.35rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--muted);
}

.scanhead .acted.yet { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }

/*
 * <b>A hull read as a table, not as a row of buttons.</b>
 *
 * The card used to be six figures and a button per fitting, every one of which had to be pressed to
 * find out what it named. Gerald: "the current design is just a bunch of buttons and I have to click
 * each one to get any information." So every line is here at once, in the order he laid out — what
 * holds it together, what moves it, what it shoots with, what it can set off — and the toggle at the
 * top adds a line of explanation under each rather than replacing anything.
 *
 * Columns rather than a grid, because the rows genuinely are a table: a label, a name, a count and
 * two figures. The figures are tabular so they line up down the card.
 */
.scancard .scantable {
    width: 100%;

    /* Left on automatic layout deliberately. Fixed layout would also stop the table growing, by
       sharing the card's width out equally, but it would re-proportion every column at the same
       time — and the label column is two words where the name column is a sentence. Letting the
       cells wrap solves the overflow without touching the proportions. */
    border-collapse: collapse;
    font-size: 0.82rem;
}

.scancard .scantable th,
.scancard .scantable td {
    padding: 0.16rem 0.4rem 0.16rem 0;
    text-align: left;
    vertical-align: baseline;
    border-bottom: 1px solid rgb(255 255 255 / 5%);

    /* And a word longer than its column wraps instead of pushing it. "anywhere" rather than
       "break-word" because these are component ids and numbers as often as they are prose. */
    overflow-wrap: anywhere;
}

.scancard .scantable th {
    font-weight: 600;
    white-space: nowrap;
}

/* <b>The name column holds words, not letters.</b> Every cell may wrap anywhere — see above —
   and on this one column that licence met the table's auto layout and lost: the label column is
   nowrap, the figures are nowrap, so when a long explanation row or an upgrade list wanted width,
   the one column allowed to shrink to a single character did — "Nutronium Armor" drew as three
   stacked fragments and an upgrade list as a word a line. A floor and word-only wrapping give it
   a fair share back; a name longer than the share wraps at its spaces like prose. */
.scancard .scantable td:nth-child(2) {
    overflow-wrap: normal;
    min-width: 12rem;
}

.scancard .scantable .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--muted);
}

/* A heading inside the table: what the rows under it are. */
.scancard .scantable .band th {
    padding-top: 0.5rem;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

/* Crossed out means it cannot fire — knocked out, or out of shots. The same rule the bar uses. */
.scancard .scantable tr.gone th,
.scancard .scantable tr.gone td {
    text-decoration: line-through;
    color: var(--muted);
    opacity: 0.65;
}

/*
 * The long form: what the fitting does and which rung sells it, under the line it is about. Gerald:
 * "a toggle to show more details and that brings up text below each line of data with more details."
 */
.scancard .scantable tr.why td {
    padding: 0 0 0.35rem;
    font-size: 0.74rem;
    line-height: 1.35;
    color: var(--muted);
    border-bottom: 1px solid rgb(255 255 255 / 5%);
}

.scancard .scantable tr.why .modsays {
    display: block;
    margin-top: 0.15rem;
    padding-left: 0.6rem;
    border-left: 2px solid var(--line);
}

.scancard .scantable tr.why .modsays b { color: var(--text); font-weight: 600; }

.scancard .scantable .muted { color: var(--muted); font-style: italic; }


/* A pill wraps the row, never its own words. At 999px of corner radius a pill whose text wraps is
   not a pill, it is a slab — and in a narrow column every one of them became one. */
.battlebar .pill { white-space: nowrap; }

/* The name of the ship acting, which is a player's own and can be anything they typed. Broken
   anywhere rather than allowed to set the column's width, because one long name should not push
   the guns out of the bar. */
.battlebar .bb-whose .nm { overflow-wrap: anywhere; }

/* A stacking build row is clickable across the whole card now, so it has to look it. The
   non-stacking rows get this from the .cover button sitting over them; the stacking ones carry the
   handler on the card itself and would otherwise hover like a button and point like text. */
.opt.ship { cursor: pointer; }
.opt.ship .step button { cursor: pointer; }

/*
 * The government breakpoint's answer cards.
 *
 * A card that is also a button, which is the whole of the bug: `button` is nowrap globally — a
 * sensible default for a control whose label is two words — and this one carries three paragraphs.
 * The name, what the government gives and why anybody would want it all ran straight out of the
 * card's right edge instead of wrapping inside it. `.beginopt` next door already resets the same
 * inheritance for the same reason; this card was simply never given a rule of its own, having been
 * built out of `.card` and the `.beginnings` grid and nothing else.
 *
 * The grid's columns are minmax(0, 1fr), so min-width here is what actually lets a column be
 * narrower than its longest word rather than pushing the grid wide.
 */
.card.beginning {
    display: flex;
    flex-direction: column;
    min-width: 0;
    white-space: normal;
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.card.beginning > p { margin: 0 0 0.4rem; }
.card.beginning > p:last-child { margin-bottom: 0; }

/* Pressed, and it has to read as pressed: this is a choice that is confirmed by a second button. */
.card.beginning.chosen {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--tint) 12%, transparent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

/* The heading over one star's worlds on the colonies sheet. A rule rather than a card, because it
   is a divider between groups rather than a thing in its own right — the cards below it are what
   the page is about. */
.starband {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin: 0.9rem 0 0.1rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--line);
}

.starband:first-child { margin-top: 0; }
.starband h2 { margin: 0; font-size: 0.95rem; }

/* What a hull is carrying, on the fleet bar's own row for it. Wraps rather than pushing the row
   wide: a battleship with three different attachments is a real ship and the bar is a fixed
   column. */
.pick .aboard {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.pick .aboard .tag { font-size: 0.64rem; }

/*
 * An outpost on the map: a lit centre inside a ring inside a halo, in its owner's colour.
 *
 * The star's own vocabulary at a smaller radius — because an outpost is a place a fleet navigates
 * by and has to survive being zoomed out, the way a star does and a ship deliberately does not.
 * The hard ring is the one thing no star has, and is what says somebody put this here.
 */
.station .postglow { fill: var(--fleet); opacity: 0.16; }
.station .postring { fill: none; stroke: var(--fleet); stroke-width: 0.34; opacity: 0.85; }
.station .postcore { fill: var(--fleet); opacity: 0.95; }

/* Somebody else's reads the same way and quieter, as their fleets and their hexes already do. */
.station.theirs .postglow { opacity: 0.1; }
.station.theirs .postcore { opacity: 0.7; }

/*
 * The left rail is a head, a list and a foot — and only the list scrolls.
 *
 * The rail itself used to be the scrolling box, which meant the way into the colonies screen and
 * the minimap scrolled away with the stars. They are the two things on the rail that are not part
 * of the list, and both are wanted at any moment, so both are pinned and the list takes whatever
 * height is left over.
 */
.rail.left { overflow: hidden; }

.railscroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    scrollbar-width: thin;
}

.railscroll::-webkit-scrollbar { width: 6px; }
.railscroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/*
 * Nothing in the rail gives up its height to make room for the next one.
 *
 * A flex item shrinks before its container scrolls, and every card here is a grid — so a rail with
 * eight colonies in it squeezed all eight instead of overflowing, and what got squeezed out was the
 * bottom of each card: the production bar, and the Buy button under it. The scrollbar never
 * appeared because, as far as the browser was concerned, everything fitted. Gerald, playing with
 * eight and then nine: "the buy button has vanished from the left side rail. There is also no
 * scroll bar there, and it feels like there should be... each colony's button is shrinking so that
 * they all fit, instead of adding a scroll bar."
 *
 * With the shrink refused the cards keep the size they have at two colonies and the rail scrolls
 * once they stop fitting, which is what he asked for: they "stay as they are today with few
 * colonies and naturally expand if you have a lot of colonies."
 */
.railscroll > * { flex: 0 0 auto; }

/*
 * <b>And the same refusal one level up, which is where it was missing.</b>
 *
 * The rule above protects the list's own cards. The rail's other children were never covered: a flex
 * item shrinks before its container scrolls, so with a long enough list the parts that are meant to
 * stay — the sort switch, the empire focus — were squeezed down towards nothing while the list took
 * the room. Gerald: "The 2 buttons below to sort stars by oldest or by population are currently cut
 * off on my screen (they weren't always). I think this has to do with how many different stars I
 * currently own."
 *
 * Which is exactly it, and it is the same fault as the buy button that vanished at nine colonies,
 * one level out. The rail's shape has always been head, scrolling list, foot; this is what makes the
 * head and the foot mean it. The list is put back to flexing afterwards, by a more specific
 * selector, because it is the one child that should give up room.
 */
.rail > * { flex: 0 0 auto; }

.rail > .railscroll { flex: 1 1 auto; min-height: 0; }

/* The all-colonies line: two figures and the words that name them, and no taller than it has to be.

   <b>It wraps, because at eleven colonies it did not fit.</b> The line is a flex row and every word
   and figure in it is a flex item with a gap either side — "All Colonies (11 colonies | 340
   people)" is six items and five gaps — so it measured up to two hundred and ten pixels inside a
   hundred and eighty-one and the tail was drawn outside the rail. Gerald had it on his own list
   before the test found it: "the top of the colony rail text can overflow."

   Wrapping rather than truncating because every figure on this line is the point of it; an
   ellipsis here would hide the population count, which is half of what the button says. The gap is
   tightened at the same time so the common case stays on one line and only a crowded empire takes
   two. See MomentTests.AndNothingSpillsOutOfTheBoxItWasDrawnIn. */
.tally-line.tight {
    flex: 0 0 auto;
    flex-wrap: wrap;
    column-gap: 0.25rem;
    row-gap: 0;
    padding: 0.3rem 0.5rem;
    font-size: 0.74rem;
    line-height: 1.25;
}

/*
 * Feedback for the click just made, floated over the map and gone by itself.
 *
 * The HUD bar used to carry this as an inline span, which meant the game's chrome kept turning into
 * prose. A toast is conversation: it appears where the eye already is, says its one sentence, and
 * fades without needing to be dismissed. pointer-events off so a message never blocks the sky
 * behind it, and the fade leaves opacity at zero rather than removing the element - the element
 * goes when the next view replaces the text.
 */
.toast {
    position: fixed;
    top: 2.6rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    padding: 0.35rem 0.9rem;
    background: color-mix(in srgb, var(--panel, #0b1120) 88%, transparent);
    border: 1px solid var(--line, #1e293b);
    border-radius: 999px;
    pointer-events: none;
    animation: toastfade 5s ease-in forwards;
}

@keyframes toastfade {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

/* The turn report: one line per thing that happened, each line a door. */
.report .line {
    display: block;
    width: 100%;
    /* Wrapped, however long. Gerald, 30 October 2026: "The text in the turn report dialog can also overflow and get cut
       off on espeically long messages." */
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
    padding: 0.4rem 0.55rem;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line, #1e293b);
    color: inherit;
    cursor: pointer;
}

.report .line:hover { background: color-mix(in srgb, var(--tint) 10%, transparent); }

/* A departing detachment: a real ship marker pulled out of its fleet, seated toward where it was
   told to go. Clicking it recalls the order, and the hover says it is a thing that takes a click. */
.splitaway { cursor: pointer; }

.splitaway:hover .fleetship { filter: brightness(1.35); }

.splitaway:hover .mark { filter: brightness(1.35); }

/* The siege clock in the star panel's title bar. Warn when it is being done to you and accent when
   you are the one doing it — a clock in your favour should not read as an alarm. */
.headfact.siegefact { color: var(--warn); }
.headfact.siegefact b { color: var(--warn); }
.headfact.siegefact.mine, .headfact.siegefact.mine b { color: var(--accent); }
.headfact.siegeparts { color: var(--muted); font-size: 0.85em; }

/*
 * What an outpost is, asked by clicking it. An outpost carries nothing of its own, so everything
 * here is a technology its owner holds — see StationReach.Upgrades. The figures borrow the battle
 * scan's shape because they answer the same kind of question: four numbers about one object.
 */
.outpostfigs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
    gap: 0.35rem;
    margin: 0.6rem 0 0.8rem;
}

.outpostfigs .fig {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
}

.outpostfigs .fig span {
    display: block;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.outpostfigs .fig b { font-size: 0.92rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.outpostfigs .fig b.warnfig { color: var(--warn); }

.outpostkit { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.outpostkit li { margin-bottom: 0.15rem; }

/* What is on an outpost, as the research dialog draws a technology: a turning wireframe over its name.
   See TechArtTile. */
.outpostsheet h3 { margin: 0.8rem 0 0.4rem; font-size: 0.85rem; }
.outposttechs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 0.4rem;
}
.outposttechs > span { display: contents; }

.techtile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.35rem 0.3rem 0.45rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    text-align: center;
    cursor: pointer;
}
.techtile:hover:not(:disabled) { border-color: var(--accent); }
.techtile:disabled { cursor: default; opacity: 1; }
.techtile-art { display: block; width: 4.5rem; aspect-ratio: 1; color: var(--accent); }
/* The technology sheet's own wireframe at its head (22 November 2026). See TechnologySheet. */
.techsheet-art { display: block; width: min(9rem, 40%); aspect-ratio: 1; margin: 0 auto 0.4rem; color: var(--accent); }
.techtile-label { font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
/* A tile is a button, and button sets white-space: nowrap, so a long name ran on into the tiles beside it -- Gerald, 22 November
   2026, of an outpost carrying every sight technology. Wrapped inside its own tile instead. */
.techtile { min-width: 0; white-space: normal; }
.techtile-name { font-size: 0.8rem; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; hyphens: auto; }

/*
 * A raider's actual route: the hexes it will walk, rather than the line to what it is aimed at. It
 * is turned aside by every star and stationary warfleet it passes near and the decision is remade at
 * every hex, so the two are different questions — the faint line says what it is ultimately aimed at
 * and the solid walk says where it is going next. Gerald: "they are supposed to travel towards
 * stationary fleets and stars that their path happens to cross. This should be easily visible
 * instead of just a plain line with where they are trying to go."
 */
.course.walked {
    fill: none;
    stroke-dasharray: none;
    stroke-width: calc(var(--map-unit) * 0.55);
    opacity: 0.95;
}

.course.faint { opacity: 0.28; }

/* Where the walk changes direction, which is the whole of what the route says that a line does not.
   A turn of one hex across a galaxy-sized map is not something anybody sees unmarked. */
.courseturn {
    fill: var(--fleet, var(--accent));
    stroke: var(--bg);
    stroke-width: calc(var(--map-unit) * 0.18);
    opacity: 0.95;
    pointer-events: none;
}

/*
 * A station's own hex takes the pointer, so clicking the diamond opens the outpost rather than
 * falling through to the map behind it. The mark itself is an outline with pointer-events off —
 * right for a course's destination hex, which is a label — and wrong for a station, which is a thing
 * standing in that hex and the thing a player is trying to click.
 */
.station .hexmark { fill: transparent; pointer-events: auto; cursor: pointer; }
.station { cursor: pointer; }

/* The technology sheet's description, which is Gerald's own prose and comes with its own line
   breaks — a ladder of terraform levels, the three lines a shield is described in. pre-line keeps
   them and still wraps long lines, which is the only combination that reads right. */
.techsummary {
    white-space: pre-line;
}

/* What the grid is showing, drawn on the battle minimap while the wheel is in. Outline only —
   it sits over the ships and the shots, and a fill would hide the half of the field it marks. */
.minimap .looking {
    fill: none;
    stroke: var(--ink, #cfe3ff);
    stroke-width: 0.35;
    stroke-dasharray: 1.2 0.8;
    opacity: 0.75;
    vector-effect: non-scaling-stroke;
}

/* The field while it is being dragged, the same feedback the sky gives. The cursor has to beat
   the per-shot and per-hex ones underneath it, so it is set on the surface and made important —
   a drag that shows a crosshair because it passed over a missile reads as a misfire. */
.grid.grabbing, .grid.grabbing * { cursor: grabbing !important; }

/* The one press that takes the whole fleet or none of it, over the list it acts on. */
.fleetbar-pickall {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0 6px;
}

/* ── The government ladder ───────────────────────────────────────────────────────────────
   Every government at every tier, on the sheet the right-hand bar opens. Gerald asked for the
   whole table at all times — "show the future government levels for the player to see at all
   stages of the game" — so the thing it has to do is stay readable at five rows by four columns
   inside a side sheet, which is why the cells carry figures and nothing else.

   Five columns: the tier and its turn, then one per government, in the order Governments.All
   lists them. Fixed rather than auto, so the columns line up down the whole table and a row can
   be read across. */
.govladder {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
}

.govrow {
    display: grid;
    grid-template-columns: 4.5rem repeat(4, minmax(0, 1fr));
    gap: 2px;
    align-items: stretch;
}

.govrow.govhead .govform {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
    padding: 2px 6px;
}

.govtier {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 6px;
}

.govcell {
    padding: 4px 6px;
    font-size: 0.78rem;
    line-height: 1.25;
    border-radius: 4px;
    background: rgb(255 255 255 / 3%);
}

/* The one cell the empire is actually standing in. Marked rather than merely coloured, because
   the whole table is read relative to it. */
.govcell.yours {
    background: rgb(255 255 255 / 10%);
    outline: 1px solid var(--good, #6c9);
    font-weight: 600;
}

/* A tier whose turn has not come round yet. Dimmed rather than hidden: what it is worth is the
   reason to leave a step on the table now. */
.govrow.later { opacity: 0.55; }

/* ── The gravity distortion field ────────────────────────────────────────────────────────
   Six hexes in which half of every round in the air is torn apart before anything moves. It was
   the strongest defensive thing in the game and completely invisible — rounds stopped arriving and
   the only witness was a line in the log. Gerald: "Raiders are not using their gravity distortion
   field (that I can't see anyways)."

   A ring, not a fill: what matters is where the edge is, and a wash over a sixth of the field would
   sit under every ship on it. */
.layer.distortion { pointer-events: none; }

.distortion circle {
    fill: none;
    stroke-width: 0.09;
    stroke-dasharray: 0.5 0.35;
    opacity: 0.5;
    animation: distortionturn 14s linear infinite;
    transform-box: fill-box;
    transform-origin: center;
}

/* <b>Purple on both sides, because the colour says what it is rather than whose it is.</b> It was
   green for yours and amber for theirs, which is how every other ownership mark on the field reads
   — but Gerald's language for effects sorts them by what they do: "black is disabled in some way,
   white is defensive in some way, red is offensive / destructive, and purple is raider related (and
   gravity is considered raider related)." Whose it is, is said by the hull in the middle of it. */
.distortion circle.mine,
.distortion circle.theirs { stroke: var(--fx-raider); }

@keyframes distortionturn {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: 20; }
}

/* The ring that falls inward, which is what the field does rather than where it ends. Solid rather
   than dashed so it is plainly a different thing from the boundary it starts on, and it fades as it
   closes so the hull is never wearing a tight bright ring of its own. */
.distortion circle.pulling {
    fill: none;
    stroke: var(--fx-raider);
    stroke-width: 0.12;
    stroke-dasharray: none;
    animation: fxpull 3.2s cubic-bezier(0.4, 0, 0.7, 1) infinite;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes fxpull {
    0% { transform: scale(1); opacity: 0.55; }
    85% { transform: scale(0.12); opacity: 0; }
    100% { transform: scale(0.12); opacity: 0; }
}

/*
 * ── What an effect looks like, and why it looks like that ───────────────────────────────
 *
 * Gerald, 19 September 2026: "what does a ship that has used a specific special, or has a specific
 * passive or effect actually look like in game. Each one needs to be distinct so that it can be
 * read by looking at the ship itself, not by reading what specials the ship has equipped, or
 * looking at text output of combat."
 *
 * And the whole of the scheme, in his words: "the intention of these effects is to give each type
 * of effect a color that matches what it does. Black is disabled in some way, white is defensive in
 * some way, red is offensive / destructive, and purple is raider related (and gravity is considered
 * raider related)."
 *
 * So the four are named here and nothing below picks a colour of its own. A new special gets its
 * colour by saying which kind of thing it is, which is the only way a scheme like this survives
 * being added to.
 */
:root {
    --fx-disabled: #07060b;
    --fx-defence: #f2f6ff;
    --fx-offence: #f85149;
    --fx-raider: #9b7fd4;
}

/* Everything drawn on a hull for an effect: never a click target, and never in the way of reading
   which ship it is. */
.fx { pointer-events: none; }

/* ── Reflection Field: a small white curve on each of the six sides ──────────────────────
   "A small white curve on all 6 sides of the ship." A field that turns a beam back rather than
   soaking it, so it is drawn as six facets rather than as a bubble — the bubble is the projector's
   shape, and the two must not read alike. */
.fx.reflective {
    fill: none;
    stroke: var(--fx-defence);
    stroke-width: 0.07;
    opacity: 0.6;
    stroke-linecap: round;
}

/* ── Shield Projector: the bubble, on everything it shelters ─────────────────────────────
   "A bubble shape drawn around the ship in white, with a circle in white showing the range of the
   effect." The bubble is here; the range circle is .projectorring below, drawn on the field around
   the hull that threw it. */
.fx.bubble {
    fill: rgb(242 246 255 / 7%);
    stroke: var(--fx-defence);
    stroke-width: 0.06;
    opacity: 0.7;
    animation: fxbubble 2.6s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes fxbubble {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.8; }
}

/* ── Focusing Array: a partially curved lens in front of the hull that raised it ─────────
   "A partially curved lens drawn in front of the ship that activates the effect as well as a ring
   showing the actual area of effect. Both the lens and the ring need their own color, maybe faded
   red?" Two strokes rather than one, so the lens reads as a lens: an outer arc and an inner one
   nested inside it, the inner brighter. Red because what it does is make guns hurt more. */
.fx.lens,
.fx.lensinner {
    fill: none;
    stroke: var(--fx-offence);
    stroke-linecap: round;
}

.fx.lens { stroke-width: 0.1; opacity: 0.45; }

.fx.lensinner { stroke-width: 0.06; opacity: 0.7; }

/* ── Automated Repair Unit: a faded pulsing white cross ──────────────────────────────────
   "A faded pulsing white repair icon over the ship." The cross is the shape everything uses for
   mending and needs no legend. Under the hull, so a ship that is repairing is still a ship. */
.fx.mending rect {
    fill: var(--fx-defence);
    animation: fxmend 2.2s ease-in-out infinite;
}

@keyframes fxmend {
    0%, 100% { opacity: 0.18; }
    50% { opacity: 0.5; }
}

/* ── Lensing Veil, and a phasing cloak's first round: a white overlay ────────────────────
   "A white overlay covers the ship." Both are the same fact — for this moment the ship cannot be
   touched at all — so both wear it, and the phasing cloak's own fade underneath says which is
   which. See .combatant.phased, where the two are made to pulse against each other. */
/* A lighter wash than it had, and a much heavier rim. Drawn to the whole footprint now, so the
   fill covers a lot of ground and a heavy one would hide the ship it is about; the edge is what
   carries it, and an edge reads at any size. */
.fx.veil {
    fill: rgb(242 246 255 / 20%);
    stroke: var(--fx-defence);
    stroke-width: 0.16;
    opacity: 0.9;
}

/* ── Entropy Pulse: a black X, as dark as the share of the guns it holds shut ────────────
   "A faded black X over an affected ship, with the fade increasing the more copies of this weapon
   used on a specific ship." Four pulses is every gun aboard, so the share shut is the count — and
   --shut is that share, written on the group by BattleShips. From a quarter opaque at one pulse to
   near solid at four, which is the fade he asked for expressed as the thing it measures. */
.fx.entropied line {
    stroke: var(--fx-disabled);
    stroke-width: 0.12;
    stroke-linecap: round;
    opacity: calc(0.22 + (var(--shut, 0) * 0.68));
}

/* Since 5 November 2026 an X on each gun held shut, one to four by the share, with a grey edge so black reads on the dark
   field. The fade by share is kept. */
.fx.entropied line { stroke-width: 0.14; filter: none; }
.fx.entropied { paint-order: stroke; }

/* ── The places of their own (see BattleShips): rings off the rim, the bow and the stern ───────────────────────────────
   Gerald, 5 November 2026: effects combined on one ship "need to stay visually distinct but also stack on top of
   themselves". Motion is transform and opacity only. */
.fx.nullstreak { stroke: var(--fx-defence); stroke-width: 0.06; stroke-linecap: round; opacity: 0.55; }

.fx.shieldsdown {
    fill: none;
    stroke: #8a90a0;
    stroke-width: 0.08;
    stroke-dasharray: 0.3 0.24;
    opacity: 0.85;
}

.fx.crack .shard { fill: none; stroke: var(--fx-disabled); stroke-width: 0.22; stroke-linecap: round; }
.fx.crack line { stroke: #8a90a0; stroke-width: 0.05; stroke-linecap: round; }
.fx.crack .edge { fill: none; stroke: #8a90a0; stroke-width: 0.06; stroke-linecap: round; }

.fx.ripple {
    fill: rgb(242 246 255 / 5%);
    stroke: var(--fx-defence);
    stroke-width: 0.07;
    opacity: 0.75;
    animation: fxripple 9s linear infinite;
}

@keyframes fxripple { to { transform: rotate(360deg); } }

.fx.stasis {
    fill: rgb(242 246 255 / 5%);
    stroke: var(--fx-defence);
    stroke-width: 0.07;
    opacity: 0.8;
    animation: fxripple 24s linear infinite;
}

/* The Cloaking Device's outline: the hull's own art again, a little larger, its body emptied and its edge dashed. */
.fx.cloakline * {
    fill: none !important;
    stroke: var(--fx-defence) !important;
    stroke-width: 0.045 !important;
    stroke-dasharray: 0.16 0.12;
    opacity: 0.8;
}

.fx.phasering circle { fill: var(--fx-defence); opacity: 0.75; }
.fx.phasering { animation: fxripple 14s linear infinite; }

.fx.cage polygon { fill: rgb(7 6 11 / 22%); stroke: #8a90a0; stroke-width: 0.1; stroke-linejoin: round; }
.fx.cage .inner polygon { fill: none; stroke-width: 0.07; }
.fx.cage .outer { animation: fxripple 16s linear infinite; }
.fx.cage .inner { animation: fxripple 11s linear infinite reverse; }

/* Every turning mark turns about its own middle, which is the hull's: each is drawn centred on it. */
.fx.ripple, .fx.stasis, .fx.phasering, .fx.cage .outer, .fx.cage .inner { transform-box: fill-box; transform-origin: center; }

/* The status pips: one glyph a live effect, coloured by its kind through currentColor. See PipDefs. */
.pips { pointer-events: none; }
.pip { color: var(--fx-defence); }
.pip.red { color: var(--fx-offence); }
.pip.black { color: #8a90a0; }
.pip.purple { color: #b46cff; }
.pip .pipbox { fill: #0b0f16; stroke: currentColor; stroke-width: 0.06; opacity: 0.92; }
.pip .pipleft { font-size: 0.5px; fill: currentColor; text-anchor: end; font-family: var(--mono, monospace); }

@media (prefers-reduced-motion: reduce) {
    .fx.crackle line, .fx.ripple, .fx.stasis, .fx.phasering, .fx.cage .outer, .fx.cage .inner { animation: none; }
}
/* And the same for the Animations setting turned off (AccountSettings.Still). */
:root.still .fx.crackle line, :root.still .fx.ripple, :root.still .fx.stasis, :root.still .fx.phasering, :root.still .fx.cage .outer, :root.still .fx.cage .inner { animation: none; }

/* ── Manifold Prison: the hull itself, in black ──────────────────────────────────────────
   "A black rendering of the ship is drawn instead of the regular ship, using the color black
   instead of a player color." Not an overlay — the art itself, which is why this reaches into the
   hull rather than drawing something over it. A ship phased out of the dimension is not a ship with
   something on it. */
.combatant.imprisoned .hull * {
    fill: var(--fx-disabled) !important;
    stroke: #2a2434 !important;
}

.combatant.imprisoned .berth { fill: rgb(7 6 11 / 45%); }

/* ── Overclocked Warp Drive: a faint red glow on the outer edges, pulsing ────────────────
   "A faint red glow on the outer edges of the ship that seems to pulse a bit to show that the ship
   will explode when it dies." A drop-shadow rather than a shape, because what is meant is the edge
   of whatever the hull happens to be — and every hull is a different outline. */
/* Since 5 November 2026 a crackle at the stern rather than a glow: the drive is what will go up, so it is drawn at the drive,
   in a place of its own — and a drop-shadow filter on every overclocked hull was the dearest thing on the field. Each
   spark flickers on its own beat (--i). */
.fx.crackle line {
    stroke: var(--fx-offence);
    stroke-width: 0.06;
    stroke-linecap: round;
    animation: fxcrackle 0.9s steps(2, jump-none) infinite;
    animation-delay: calc(var(--i, 0) * -0.17s);
}

@keyframes fxcrackle {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 0.25; }
}

/* ── Cloaking Device and Phasing Cloak: the ship fading in and out ───────────────────────
   "Fade the ship out (transparency) by about 25%, and have it be a slow pulsing effect from 0-25%
   faded out", and for the phasing cloak the same at 50%. Two depths of the same idea, so one
   keyframe each rather than one shared one at two strengths — a browser interpolating opacity is
   cheap and the two numbers are the whole of the difference between the fittings.

   On the group rather than the art, so the name, the health bar and the marks fade with it: a hull
   you can half see should be half seen entire. */
.combatant.cloaked { animation: fxcloak 3.4s ease-in-out infinite; }

@keyframes fxcloak {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.combatant.phasing { animation: fxphase 3.4s ease-in-out infinite; }

@keyframes fxphase {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* And the first round, where it cannot be targeted at all: "add a white overlay that fades in and
   out opposite of the transparency." Opposite is the word that matters — the overlay is brightest
   at the moment the hull is faintest, so the ship reads as being somewhere else rather than as
   merely dim. Same duration, offset half a cycle. */
.combatant.phased .fx.veil { animation: fxphasedveil 3.4s ease-in-out infinite; }

@keyframes fxphasedveil {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.95; }
}

/* ── The two raised fields, as far as they actually reach ────────────────────────────────
   The array's ring and the projector's, around the hull that raised each — see the layer in
   Game.razor, where drawing them from the raiser rather than from everything covered is argued.
   Each takes its own colour from what it does: the array arms guns, the projector shelters. */
.layer.raised { pointer-events: none; }

.raised .arrayring {
    fill: rgb(248 81 73 / 4%);
    stroke: var(--fx-offence);
    stroke-width: 0.08;
    stroke-dasharray: 0.45 0.4;
    opacity: 0.45;
}

.raised .projectorring {
    fill: rgb(242 246 255 / 4%);
    stroke: var(--fx-defence);
    stroke-width: 0.08;
    stroke-dasharray: 0.7 0.3;
    opacity: 0.5;
}

/* ── Gravity Spike: the spike itself, in the hex it was thrown at ────────────────────────
   "A purple spike in the hex that is targeted with 2 purple rings that pulse." The rings are .well
   above and have been drawn all along; what was missing was the thing at the middle of them. */
.spikemark { pointer-events: none; }

.spikemark polygon {
    fill: var(--fx-raider);
    stroke: #2a1f44;
    stroke-width: 0.05;
    opacity: 0.85;
}

/* And the pulse he asked for, on both rings, so a spike reads as something still happening rather
   than a mark somebody left. Staggered, so the two are not one thick ring breathing. */
/* An armed overload's blast under the pointer, before it is aimed; red where the rules would refuse it. */
.aimarea { pointer-events: none; }

.aimblast {
    fill: rgba(255, 150, 80, 0.12);
    stroke: #ff9a50;
    stroke-width: 0.15;
    stroke-dasharray: 0.5 0.35;
}

.aimarea.refused .aimblast { fill: rgba(255, 80, 80, 0.08); stroke: #ff5a5a; }

/* A distortion field's pushes, previewed: from each hull to where it would stand. */
.pushline { stroke: #b49cf0; stroke-width: 0.18; marker-end: none; opacity: 0.85; }

.pushto { fill: none; stroke: #b49cf0; stroke-width: 0.12; stroke-dasharray: 0.3 0.25; }

/* A chasing overload's half and three-quarter rings inside its quarter ring. */
.aimblast.inner { fill: rgba(255, 150, 80, 0.12); }

.aimblast.core { fill: rgba(255, 150, 80, 0.18); stroke-dasharray: none; }

.aimareasaid {
    fill: #ffd2b0;
    font-size: 0.7px;
    font-weight: 700;
    text-anchor: middle;
    paint-order: stroke;
    stroke: #05070f;
    stroke-width: 0.14;
    stroke-linejoin: round;
}

/* A spike still flying: its road, the spike where it is on it, and faint dashed rings where it lands. */
.spikeflight { pointer-events: none; }

.spikeroad {
    stroke: var(--fx-raider);
    stroke-width: 0.12;
    stroke-dasharray: 0.5 0.4;
    opacity: 0.6;
}

.well.coming { opacity: 0.3; stroke-dasharray: 0.4 0.4; }

.spikemark.coming polygon { opacity: 0.6; }

.spikesaid {
    fill: #c9b6f0;
    font-size: 0.7px;
    font-weight: 700;
    text-anchor: middle;
    paint-order: stroke;
    stroke: #05070f;
    stroke-width: 0.14;
    stroke-linejoin: round;
}

.well.outer { animation: fxwell 2.8s ease-in-out infinite; }

.well.inner { animation: fxwell 2.8s ease-in-out infinite 1.4s; }

@keyframes fxwell {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.85; }
}

/* ── Dimensional Rift: a miniature of the galaxy's own maw ───────────────────────────────
   "A miniature black hole is drawn similar to how the maw in the center of the galaxy is drawn,
   with ships that appear from it." The ships are real — a rift pours a raider every third round,
   see CombatRules — so what is drawn here is the hole they come out of, in the shape a player has
   already learned on the galaxy map. See .mawbody and .maw, which these mirror at battle scale. */
.riftmark { pointer-events: none; }

.riftbody {
    fill: #0b0416;
    stroke: var(--fx-raider);
    stroke-width: 0.1;
    opacity: 0.97;
}

.riftring {
    fill: none;
    stroke: var(--fx-raider);
    stroke-width: 0.09;
    opacity: 0.85;
    animation: fxrift 4.5s linear infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.riftring.faint {
    opacity: 0.35;
    stroke-dasharray: 0.16 0.24;
}

@keyframes fxrift {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── The Tier 6 raider's abilities ───────────────────────────────────────────────────────
   Gerald wants the boss's specials to change how the fight plays, so each is drawn where it is and
   with the round it comes due: the arc Destabilize Reality has marked, the ground it has taken off
   the field, a black hole's well and core, and the raiders Reinforce has just called up. */
.voidarc {
    fill: #030108;
    stroke: #3b2a5c;
    stroke-width: 0.25;
    opacity: 0.96;
    pointer-events: none;
}

.bossarc { pointer-events: none; }

.markedarc {
    fill: #ff7a3c;
    stroke: #ffb27f;
    stroke-width: 0.3;
    stroke-dasharray: 1.2 0.8;
    opacity: 0.16;
    animation: fxarc 1.8s ease-in-out infinite;
}

@keyframes fxarc {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.26; }
}

.arccount {
    fill: #ffd2b0;
    font-size: 3px;
    font-weight: 600;
    text-anchor: middle;
    font-family: inherit;
    paint-order: stroke;
    stroke: #120818;
    stroke-width: 0.35;
    pointer-events: none;
}

.singularity { pointer-events: none; }

.holewell {
    fill: #9b7fd4;
    fill-opacity: 0.05;
    stroke: var(--fx-raider);
    stroke-width: 0.25;
    stroke-dasharray: 1 0.7;
    animation: fxwell 2.8s ease-in-out infinite;
}

.holecore {
    fill: #1a0b2e;
    fill-opacity: 0.35;
    stroke: #c9a8ff;
    stroke-width: 0.35;
}

.holebody {
    fill: #050109;
    stroke: var(--fx-raider);
    stroke-width: 0.2;
}

.bossportal { pointer-events: none; }

.bossportal .riftbody { opacity: 0.35; }

.bossfeed {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    max-width: 26rem;
    padding: 0.45rem 0.6rem;
    background: rgba(12, 6, 22, 0.82);
    border: 1px solid #3b2a5c;
    border-radius: 6px;
    font-size: 0.78rem;
    pointer-events: none;
}

.bossfeed .bossready {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.3rem;
}

.bossfeed .pill { opacity: 0.6; }

.bossfeed .pill.ready { opacity: 1; }

.bossfeed ol {
    margin: 0;
    padding-left: 1.1rem;
}

/* ── Where a region stops ────────────────────────────────────────────────────────────────
   Reach, movement and a special's targets are drawn as their border, not as their hexes. A field
   is three and a half thousand cells for two sides and fourteen thousand for eight, and filling a
   region meant computing and diffing a class on every one of them — on every pointer event, since
   any pointer event re-renders the screen. Gerald: "maybe just highlight the border in a similar
   way to how max movement range is calculated on the galaxy screen."

   Widths are in the grid's own units, where a hex is 1 and the grid's own lines are 0.03. This
   asked for non-scaling-stroke once, which reads those same numbers as device pixels instead — so
   the border was drawn nine hundredths of a pixel wide, which is to say not drawn, and all that was
   left of a region was its fill. A reach that covers most of the field is then a wash over most of
   the field with the grid showing through it, which is exactly what it was meant to replace.
   Gerald, on a build that already had the border: "the client is still extremely slow when my beam
   weapon range is being displayed (all of the hexes highlighted)."

   So: no vector-effect, and the widest region carries no fill at all. The nonzero rule leaves a
   hole in a region unfilled, so a ring still reads as a ring. See BattlePaths.Outline. */
/* ── The round you have written and not yet committed ─────────────────────────────────────
 *
 * Gerald: "I would use outlines/faded ship drawings to show where ships move to, and faded versions
 * of the missiles and slugs (as they will be fired, but havent been yet)."
 *
 * <b>Faded is the whole of the language.</b> Everything in here is a statement about what has not
 * happened, and the one thing a player must never do is mistake one of these for a hull that is
 * actually there — so nothing in this layer is solid, nothing in it is filled the way a real ship
 * is, and none of it takes a click.
 */
.layer.preview { pointer-events: none; }

/* The road a hull will take, and — for a jump — the gap it will cross. Dashed, because a dashed line
   is the game's own word for "intended" everywhere else on both screens. */
.preview .ghostroad {
    stroke: var(--accent, #5aa9ff);
    stroke-width: 0.07;
    stroke-dasharray: 0.3 0.25;
    opacity: 0.55;
}

/* The hull itself at the far end: the drawing, outlined rather than filled. An outline reads as a
   plan; a filled one reads as a second ship, and a player counting hulls would count it. */
.preview .ghost .shipart,
.preview .ghost polygon,
.preview .ghost path {
    fill: none;
    stroke: var(--accent, #5aa9ff);
    stroke-width: 0.06;
    opacity: 0.6;
}

/* A beam, from where the hull will be standing when it fires — which is the mark that costs the
   most to get wrong and looks identical when it is. See BattlePreview. */
.preview .ghostbeam {
    stroke: var(--warn, #e3b341);
    stroke-width: 0.09;
    stroke-dasharray: 0.5 0.28;
    opacity: 0.6;
}

/* A round still at the muzzle: the dart, pointed where it is going and not yet thrown.
 *
 * <b>And drawn as the round, which is the one thing in this layer that is not faded.</b> It used to
 * be a small translucent arrow in the middle of the hull, which said that a missile and a slug look
 * alike and that either of them sits inside the ship that fired it. Gerald: "show all of them as
 * they actually will be when fired". So it wears the flight layer's classes and takes the flight
 * layer's colours — see .shot.missile and .shot.slug above, which style it — and all this rule does
 * is stop it sliding in from wherever the last aim put it, because a plan being redrawn is not a
 * round travelling. It is still in the preview layer, so it still takes no clicks. */
.preview .shot.planned {
    transition: none;
    will-change: auto;
}

/* The ground a driver's round will cross, as the border of it. A slug is fired down a line and
   carries on past the mark, and with several ships written at once the crossing of those lines is
   the whole tactic — so it is drawn, not left to be imagined. */
/* Every hex a driver round can touch — the corridor rather than the thread. Drawn while aiming
   and while a flying round is being read. Gerald, 5 September 2026: "mass driver slugs hit in a
   1 hex area (except for raider mass drivers which hit in a 3 radius hex area)." */
.battle .slugswath {
    fill: rgb(227 179 65 / 6%);
    stroke: var(--warn, #e3b341);
    stroke-width: 0.05;
    stroke-dasharray: 0.3 0.24;
    stroke-linejoin: round;
    pointer-events: none;
}

.preview .ghostlane {
    fill: rgb(227 179 65 / 6%);
    stroke: var(--warn, #e3b341);
    stroke-width: 0.06;
    stroke-dasharray: 0.3 0.24;
    opacity: 0.5;
}

/* Which hull a warhead is going after. A missile chases and a slug does not, so only the chase gets
   a line to a ship. */
.preview .ghosttrack {
    stroke: var(--warn, #e3b341);
    stroke-width: 0.05;
    stroke-dasharray: 0.16 0.24;
    opacity: 0.45;
}

/* And the cracker, which is not a beam and should not read as one: one heavy stroke to the hull. */
.preview .ghostcracker {
    stroke: var(--error, #f85149);
    stroke-width: 0.22;
    stroke-linecap: round;
    opacity: 0.5;
}

/* And a special, named where it goes off.
 *
 * Gerald, on this one: "for specials I would make it all very clear where the ship was when which
 * special was fired (wont be easy to do with the animations / graphics that currently exist for
 * specials)." He is right, and this does not pretend otherwise: every special's own graphic is built
 * for the instant it happens and none of them can say "here, later". A ring at the hex with the
 * fitting's name over it is plain rather than pretty, and it is at least unambiguous. */
.preview .ghostspecial > circle {
    fill: none;
    stroke: var(--ok, #3fb950);
    stroke-width: 0.07;
    stroke-dasharray: 0.35 0.3;
    opacity: 0.7;
}

.preview .ghostspecial > text {
    fill: var(--ok, #3fb950);
    font-size: 0.7px;
    text-anchor: middle;
    opacity: 0.85;
}

.layer.zones { pointer-events: none; }

/* <b>Outlined at a width the screen keeps</b>, not a width the field does. A tenth of a hex was
   six tenths of a pixel once the field tripled and was framed whole -- a border nobody could see,
   which TheRaidOpensItsBattleWithoutTakingTheComponentDown measured and said so. In screen pixels,
   through non-scaling-stroke, the outline is the same line at every zoom. */
.zone {
    fill-rule: nonzero;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
    stroke-linejoin: round;
}

/* Somewhere a ship may move to. Small enough to fill: a step's worth of hexes around one hull. */
.zone.steppable {
    fill: rgb(90 169 255 / 7%);
    stroke: var(--accent, #5aa9ff);
}

/* Somewhere a gun the player asked about can reach. A Stellar Lance reaches most of the field, so
   this is the one region that is border and nothing else — a wash this wide is not information. */
.zone.inreach {
    fill: none;
    stroke: rgb(90 169 255 / 70%);
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
}

/* <b>The same gun from where the plan leaves the hull: next round's reach</b>, in green and long-dashed so it is never
   read as this round's blue. Guns fire before anything moves, so the blue ring is where this round's shots can land and
   this one is where the next round's will. See NextReachRing. */
.zone.inreach.next {
    stroke: rgb(87 201 139 / 85%);
    stroke-width: 2;
    stroke-dasharray: 12 5;
}

/* <b>How far a hull of theirs under the pointer could hit next round</b>: its move plus its longest gun, in the error red.
   See ThreatRing. */
.zone.threat {
    fill: rgb(255 107 107 / 4%);
    stroke: rgb(255 107 107 / 75%);
    stroke-width: 1.5;
    stroke-dasharray: 3 3;
}

/* What the rings are, in a key at the field's top left: a swatch drawn as the ring is. See Game's ringkey. */
.ringkey {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    max-width: 24rem;
    padding: 0.4rem 0.6rem;
    background: rgb(10 14 22 / 82%);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.76rem;
    line-height: 1.5;
    pointer-events: none;
}
.ringkey .ringswatch {
    display: inline-block;
    width: 1.6rem;
    margin-right: 0.45rem;
    vertical-align: middle;
    border-top: 2px dashed;
}
.ringkey .ringswatch.now { border-color: rgb(90 169 255 / 85%); border-top-style: dashed; }
.ringkey .ringswatch.next { border-color: rgb(87 201 139 / 90%); border-top-width: 3px; }
.ringkey .ringswatch.threat { border-color: rgb(255 107 107 / 85%); border-top-style: dotted; }

/* Somewhere an armed special may be aimed. */
.zone.aimable {
    fill: rgb(227 179 65 / 8%);
    stroke: var(--warn, #e3b341);
}

/* And aiming a weapon fired at places, where the whole field is a legal target: one wash over the
   field rather than a class on every cell in it. */
.zones .aimingall {
    fill: rgb(227 179 65 / 4%);
    stroke: none;
}

/* What the whole empire is working on, at the top of the colony rail in the late game. One answer
   above a list of stars that each go on saying what they are doing — see GamePhase.Late. */
.empirefocus {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.empirefocus .pills { display: flex; flex-wrap: wrap; gap: 0.25rem; }

/* The late game's own panel at the top of the rail: the ten representatives across six jobs, and
   the two ordered lists and one queue that say what the production jobs are to produce. See
   docs/lategame.md, and PopulationPlan. */
.lategame {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.lategame .jobrow {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.1rem 0;
}

/* The name takes the slack, so the counters and buttons line up down the column however long the
   job is called. */
.lategame .jobname {
    flex: 1 1 auto;
    min-width: 0;

    /* On one line, cut rather than wrapped. A wrapped name pushes its own row to twice the height
       and stacks the two buttons beside it, so one job of the six reads as a different control. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* On one line always. The general .pills wraps, which stacked the two buttons of the one job whose
   name is longest and made that row read as a different control from the other five. */
.lategame .pills { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.2rem; }

/* A job with people on it and nowhere to work. Said rather than quietly spent elsewhere — the
   player moves them, so the row has to catch the eye. See JobAtWork.Idle. */
.lategame .jobrow.poor .jobname { color: var(--warn, #c88); }

.lategame .lateorders { margin-top: 0.25rem; }

/*
 * The building order, opened from the rail. Two columns — what is named, in order, and what else is
 * researched — so a row can be carried from one to the other. Fixed in size like any sheet whose
 * contents move while it is open: dragging a row must not resize the frame under the cursor. Each
 * column scrolls on its own, so the long one does not push the short one's end out of reach.
 */
.sheet.buildorder {
    width: min(60rem, 94vw);
    height: min(40rem, 84vh);
}

.sheet.buildorder > .sheet-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.buildorder-lede { margin: 0 0 0.6rem; }

/*
 * The stars dialog: every star the empire holds, biggest first, picked by size band or by row, and one
 * bar of orders under the list for whatever is picked. The list scrolls; the bar stays put.
 */
.sheet.starssheet > .sheet-body { overflow-y: auto; }

.stargroups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
    gap: 0.6rem;
    align-items: start;
    margin-bottom: 0.8rem;
}

.stargroup {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card);
    padding: 0.5rem 0.6rem;
}

.stargroup .row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.3rem 0; }
.stargroup .row .grow { flex: 1 1 auto; }
.stargroup input.people { width: 5rem; }
.stargroup select { flex: 1 1 9rem; min-width: 0; max-width: 100%; }
.stargroup .stepper { display: inline-flex; align-items: center; gap: 0.3rem; }
.stargroup-members { margin: 0.2rem 0; overflow-wrap: anywhere; }
.stargroup-ships { margin: 0.2rem 0; }
.stargroup-ships li { display: flex; align-items: center; gap: 0.4rem; padding: 0.1rem 0; }
.stargroup-ships .grow { flex: 1 1 auto; min-width: 0; }

.sheet.starssheet .starstable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.starstable th {
    position: sticky;
    top: 0;
    background: var(--panel);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-align: left;
    padding: 0.25rem 0.5rem;
}

.starstable td { padding: 0.25rem 0.5rem; border-top: 1px solid var(--line); vertical-align: top; }
.starstable td button { margin-left: 0.3rem; }


.buildorder-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 0.9rem;
    flex: 1 1 auto;
    min-height: 0;
}

.buildorder-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.buildorder-col h2 {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.buildorder-col .queued li { align-items: center; }

/* The column's title and the switch between what is in hand and what is still to come, on one line
   while there is room for both. */
.buildorder-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.3rem 0.6rem;
    margin-bottom: 0.35rem;
}

.buildorder-head h2 { margin: 0; }

/* Not researched yet: faded, and still something to pick up. Brought back to full while it is under
   the cursor, so what is about to be dragged or added can be read. */
.buildorder-col .queued li.unresearched { opacity: 0.55; }
.buildorder-col .queued li.unresearched:hover { opacity: 1; }
.buildorder-col .queued li.dragging { opacity: 0.35; }
.buildorder-col .queued button.small { margin-top: 0; }
.buildorder-col .place { min-width: 1.2rem; text-align: right; font-variant-numeric: tabular-nums; }

/* The name over what it gives, so a long effect wraps under its own name rather than squeezing the
   price and the buttons out of line. */
.buildorder-what { display: flex; flex-direction: column; min-width: 0; }
.buildorder-what small { line-height: 1.25; }

/* A name is a question about the building, so it reads as a link rather than a second button. */
.buildorder-what .bname {
    align-self: flex-start;
    padding: 0;
    background: none;
    border: 0;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.buildorder-what .bname:hover,
.buildorder-what .bname:focus-visible { color: var(--accent); text-decoration: underline; }

/* The place past the last row. Quiet until something is being carried, and the whole column's
   message while nothing is named. */
.buildorder-end {
    min-height: 2rem;
    padding: 0.4rem 0.5rem;
    border: 1px dashed transparent;
    border-radius: 3px;
    color: var(--muted);
    font-size: 0.8rem;
}

.buildorder-end.empty,
.buildorder-end.carrying { border-color: var(--line); }

.buildorder-end.carrying:hover { border-color: var(--accent); color: var(--text); }

.lategame .lateorders > summary {
    cursor: pointer;
    padding: 0.15rem 0;
    font-size: 0.85em;
    opacity: 0.85;
}

.lategame .picker {
    width: 100%;
    margin-top: 0.2rem;
    font-size: 0.85em;
}

/* And the same line inside a star's own panel, where the row of three used to be. */
.control .row.focus.empirefocus {
    display: block;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}


/* ── The empires dialog's charts ──────────────────────────────────────────────────────────
   One chart at a time taking most of the sheet, with the stats as buttons under it. The
   readings sit beside the plot as ordinary text rather than inside the SVG: Razor keeps
   <text> for itself, so an SVG label in a component will not compile. */
.chartpage {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chartwrap {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    min-height: 18rem;
}

.chartwrap .yaxis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.75rem;
    opacity: 0.7;
    flex: 0 0 auto;
    min-width: 3rem;
}

.chartpage .chart {
    flex: 1 1 auto;
    width: 100%;
    height: 18rem;
    overflow: visible;
}

.chartpage .xaxis {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    opacity: 0.7;
    padding-left: 3.5rem;
}

.chartpage .grid {
    stroke: currentColor;
    stroke-width: 1;
    opacity: 0.15;
    vector-effect: non-scaling-stroke;
}

.chartpage .track {
    fill: none;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    stroke-linejoin: round;
    stroke-linecap: round;
    opacity: 0.85;
}

.chartpage .track.you {
    stroke-width: 3.5;
    opacity: 1;
}

/* Past the last turn this empire was actually read, the line is a memory. */
.chartpage .track.remembered {
    stroke-dasharray: 5 4;
    opacity: 0.55;
}

.chartkey {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.9rem;
    font-size: 0.8rem;
}

.chartkey .keyed {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.chartkey .keyed.you {
    font-weight: 600;
}

.chartpick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    border-top: 1px solid rgba(128, 128, 128, 0.25);
    padding-top: 0.5rem;
}

/* The number box in the playback bar. Narrow: a turn is at most four digits. */

/* Reading a turn off the chart: a column an turn catches the pointer, a rule marks where it
   landed, and a dot per empire sits on the line at that turn. */





/* Each empire's reading on the last turn drawn, beside its name in the key. */
.chartkey .keyed b {
    font-variant-numeric: tabular-nums;
}

.chartkey .keyed em {
    opacity: 0.7;
    font-style: normal;
}

/* The "seen by" picker sits with the turn controls and needs room for an empire name. */


/* ── The fight map ────────────────────────────────────────────────────────────────────────
   A ring on the star where a battle was fought, wider for one that cost more hulls. Over the
   stars so a mark is never buried under what it marks, under the fleets because a live ship
   matters more than an old battle. */
.fightcore {
    fill: #ff3b3b;
    stroke: #ffd7d7;
    stroke-width: calc(var(--map-unit) * 0.35);
    cursor: pointer;
    pointer-events: auto;
    filter: drop-shadow(0 0 calc(var(--map-unit) * 2) rgba(255, 59, 59, 0.9));
}

.fightcore:hover {
    fill: #fff;
}

.fightmark {
    fill: none;
    stroke: #ff5a5a;
    stroke-width: calc(var(--map-unit) * 0.7);
    cursor: pointer;
    pointer-events: auto;
    transform-box: fill-box;
    transform-origin: center;

    /* The gateway ring, borrowed. A battle mark sat still on a star was lost against the star
       itself -- Gerald: "Battle indication is not obvious enough when they are on stars, maybe
       re-use the gateway animation there." Movement is what the eye finds on a crowded map. */
    animation: gatewaypulse 2.4s ease-out infinite;
}

/* Staggered by how costly the fight was, so a cluster of marks does not beat as one drum. */
.fightmark.heavy { animation-delay: 0.8s; }

.fightmark:hover {
    fill: rgba(224, 80, 80, 0.45);
    animation-play-state: paused;
    opacity: 1;
}

/* What went into a fight, a side at a time. */
.fightside {
    margin-block: 0.75rem;
}

.fightside h2 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1rem;
    margin: 0 0 0.25rem;
}

.fightside h2 .small {
    margin-left: auto;
    opacity: 0.75;
    font-weight: 400;
}

.fightside.you h2 {
    font-weight: 700;
}

table.fightships {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

table.fightships th,
table.fightships td {
    padding: 0.15rem 0.4rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
    text-align: left;
}

table.fightships .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* A design that lost every hull it brought. */
table.fightships tr.gone td {
    opacity: 0.6;
    text-decoration: line-through;
}

.viewerbar button.on {
    outline: 1px solid var(--warn, #c8a24a);
}

/* A board being looked back at takes no orders — see OnFleetClick. The fleets stop offering a
   click they would refuse; the battle marks keep theirs, since reading one is not an order. */
.starmap.reading .fleet,
.starmap.reading .fleet .hit,
.starmap.reading .fleetship {
    cursor: default;
}

.starmap.reading .fleet .hit {
    pointer-events: none;
}

/* ── The turn viewer's panel ──────────────────────────────────────────────────────────────
   Stacked rows, each the rail's width. It was a line of controls, and the rail is a narrow
   column: seven of them side by side wrapped where they liked and ran off the edge. Nothing
   in here is laid out by accident, and nothing may exceed its row. */
.viewerbar {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
    padding: 0.5rem;
    border: 1px solid rgba(200, 162, 74, 0.35);
    border-radius: 4px;
    background: rgba(200, 162, 74, 0.06);
    box-sizing: border-box;
}

.viewerhead {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.viewerhead .small {
    opacity: 0.75;
}

.viewerrow {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
}

/* The step arrows keep their size; the number takes what is left. */
.viewerrow .step {
    flex: 0 0 auto;
    min-width: 0;
    width: 1.6rem;
    padding-inline: 0.25rem;
}

.viewerrow .turnpick {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.viewerrow button.wide {
    flex: 1 1 auto;
    width: 100%;
}

.viewerseen {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.viewerseen .small {
    opacity: 0.75;
}

/* One chip an empire, in the map's own colours — a select cannot carry a swatch every browser
   will draw, and seven seats called ai-…-1 through ai-…-7 are seven identical words. */
.eyechips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-width: 0;
}

.eyechip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
    min-width: 0;
    padding: 0.15rem 0.4rem;
    font-size: 0.78rem;
    line-height: 1.4;
}

.eyechip .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* A swatch was only ever sized inside the standings sheet, so every one drawn anywhere else
   -- these chips, the fight sheet -- was an empty span. Sized here for all of them. */
.swatch {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 2px;
    display: inline-block;
    flex: 0 0 auto;
}

.eyechip .swatch {
    flex: 0 0 auto;
}

.eyechip.on {
    outline: 1px solid var(--warn, #c8a24a);
    font-weight: 600;
}

.viewerbar button.on {
    outline: 1px solid var(--warn, #c8a24a);
}

/* A standing work and the button that pulls it down, on one line. */
.workline {
    display: flex;
    align-items: stretch;
    gap: 0.25rem;
    min-width: 0;
}

.workline .workrow {
    flex: 1 1 auto;
    min-width: 0;
}

.workline button.warn {
    flex: 0 0 auto;
}

/*
 * ── Chat ────────────────────────────────────────────────────────────────────────────────
 *
 * Gerald, 21 September 2026: "the game should have a dedicated chat system that lives in a dialog
 * with a button for it on the bottom of the right side panel... so that when this is on a server a
 * player can be in a game against AIs while waiting for other players to come online."
 *
 * The room reads oldest at the top and newest at the bottom, like every chat anybody has used, and
 * scrolls in its own box so the sheet does not grow with the conversation.
 */
.chatroom {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 18rem;
}

.chatlog {
    list-style: none;
    margin: 0;
    padding: 0.4rem 0.2rem;
    max-height: 26rem;
    overflow-y: auto;
    scrollbar-width: thin;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.chatlog li {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.2rem 0.35rem;
    border-radius: 0.3rem;
}

/* Your own lines, marked without being shouted: the eye wants to find the other person's. */
.chatlog li.mine { background: rgb(255 255 255 / 4%); }

.chatlog .who { font-weight: 600; color: var(--accent, #5aa9ff); }

.chatlog li.mine .who { color: var(--muted); }

.chatlog .when { color: var(--muted); font-size: 0.85em; font-variant-numeric: tabular-nums; }

/* The words themselves wrap; everything else on the row does not. */
.chatlog .what { white-space: pre-wrap; overflow-wrap: anywhere; }

.chatsay { display: flex; gap: 0.5rem; }

.chatsay input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 0.3rem;
    background: rgb(0 0 0 / 25%);
    color: inherit;
}

/* ── The people sheet ────────────────────────────────────────────────────────────────────
   Six jobs holding ten counters between them, moved by picking a handful up and dropping it
   on another job. Gerald, 22 September 2026: "click a population unit (or several) and move
   my mouse into a different focus and let go and that much of the focus is moved to that
   focus." See PeopleBody. */
.peoplejobs {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

/* <b>One line a job, and every line the same height.</b> The figures used to stack under the name,
   so the six rows were six heights and the sheet outgrew the screen. Gerald, 23 September 2026:
   "Each row should be the same height, with extra information shown inside of the row, now on its
   own line." */
.peoplejob {
    display: grid;
    grid-template-columns: 7.5rem minmax(9rem, auto) 3rem 1fr;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--line, #2a3340);
    border-radius: 0.5rem;
    background: var(--panel, #131a22);
    min-height: 2.6rem;
}

/* Somewhere to aim for while something is in hand. */
.peoplejob.target {
    border-color: var(--accent, #6cf);
    box-shadow: inset 0 0 0 1px var(--accent, #6cf);
}

.peoplejob.poor .jobname { color: var(--warn, #c88); }

.peoplejob .jobname { font-weight: 600; }

.peoplejob .jobshare { text-align: right; font-variant-numeric: tabular-nums; }

/* The tenths themselves. A fixed row so a job holding ten and a job holding one line up. */
.peoplejob .counters {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 1.1rem;
}

/* The same person the colony screen stands in its fields — see .person. */
.peoplejob .person {
    cursor: grab;
    touch-action: none;
    background: var(--accent, #6cf);
}

/* The ones that would travel if the pointer were let go here. */
.peoplejob .person.lifted {
    background: var(--warn, #fc6);
    transform: translateY(-0.2rem);
}

/* What the row is worth, along the rest of the line. */
.peoplejob .jobfigures {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.9rem;
    font-size: 0.85rem;
    min-width: 0;
}

.peoplejob .jobfigures .warn { color: var(--warn, #c88); }

/* <b>As tall as the screen, so nothing needs scrolling to.</b> Gerald: "the dialog has more data
   than can be shown on the page (and I would prefer no scroll bar) so lets first try just making
   the page as tall as the screen is (with the same width currently used)." */
.sheet.buildorder .peoplejobs { flex: 1 1 auto; }

@media (max-width: 40rem) {
    .peoplejob {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .peoplejob .jobshare { text-align: left; }
}

/* <b>As tall as the screen allows, and no taller.</b> The six rows plus what each says about itself
   outgrew the eighty-four per cent the building order is happy with, and a scroll bar on a sheet
   that is meant to be read at a glance is a sheet that failed. Gerald, 23 September 2026: "the
   dialog has more data than can be shown on the page (and I would prefer no scroll bar) so lets
   first try just making the page as tall as the screen is (with the same width currently used)."
   The width is the building order's, untouched. */
.sheet.buildorder.peoplesheet { height: 96vh; }

/* The late game's one empire dialog holds the tallest of its tabs' height on every tab, so it does not jump as tabs change. */
.sheet.buildorder.empiresheet { height: 96vh; }

/* <b>A drag across the rows is a drag, not a text selection.</b> Pressing a figure and pulling
   across the sheet highlighted every label it crossed, which looks like the page misunderstanding
   the gesture — and on a touch screen it opens a selection handle instead. Gerald, 23 September
   2026: "when clicking and dragging it is selecting text on the page instead of just doing a click
   and drag, and that looks wrong." */
.peoplejobs,
.peoplejobs * {
    -webkit-user-select: none;
    user-select: none;
}

/* <b>How many are in hand, following the pointer.</b> Positioned by galacticCarrying and by nothing
   in .NET — see the comment there. Out of the way of hit-testing, so the row being aimed at is the
   row that receives the release. */
#galactic-carrying {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9000;
    pointer-events: none;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid var(--accent, #6cf);
    background: var(--panel, #131a22);
    color: var(--text, #dfe7ef);
    font-size: 0.8rem;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgb(0 0 0 / 45%);
}

#galactic-carrying[hidden] { display: none; }

/* ── Dimensional Rifts ────────────────────────────────────────────────────────────────────
   A tear in the sky the raiders come out of: a dark core in a slowly turning ring of the
   raiders' own red. Over the stations, under the fleets — a fleet standing on one is what a
   player needs to find. The gateway pulse is borrowed for the ring, because a rift is the one
   thing on the map that is going to do something on its own. */
.riftmark {
    pointer-events: auto;
}

.riftring {
    fill: none;
    stroke: #ff3b3b;
    stroke-width: calc(var(--map-unit) * 0.5);
    stroke-dasharray: calc(var(--map-unit) * 1.2) calc(var(--map-unit) * 0.6);
    transform-box: fill-box;
    transform-origin: center;
    animation: gatewaypulse 3.2s ease-out infinite;
}

.riftcore {
    fill: #1a0006;
    stroke: #ff8a8a;
    stroke-width: calc(var(--map-unit) * 0.25);
    filter: drop-shadow(0 0 calc(var(--map-unit) * 1.5) rgba(255, 59, 59, 0.8));
}

.riftmark.mine .riftcore {
    stroke: #ffd7d7;
}

/* A rift of ours, and how far its next raiders hunt: the rift's red, faint, under everything that moves. Dashed for one
   staged this turn, as a structure about to be placed is. See RiftReaches. */
.riftreach {
    fill: color-mix(in srgb, #ff3b3b 6%, transparent);
    stroke: #ff5a5a;
    stroke-width: calc(var(--map-unit, 1) * 0.2);
    stroke-opacity: 0.9;
    pointer-events: none;
}

.riftreach.preview {
    stroke-dasharray: calc(var(--map-unit, 1) * 0.6) calc(var(--map-unit, 1) * 0.4);
}

/* ── Structures on outposts ─────────────────────────────────────────────────────────────
   Their seven-hex reach, outlined in the owner's colour whenever one stands (and dashed where one is
   about to be placed), and an icon beside the outpost's beacon: a defender as the station it fights
   as, a yard as a gantry, a slipway as two rails. Gerald, 29 September 2026: so outposts that carry
   something are "clearly more important targets to attack/defend". */
.structurereach {
    fill: color-mix(in srgb, var(--fleet, #8fd3ff) 7%, transparent);
    stroke: var(--fleet, #8fd3ff);
    stroke-width: calc(var(--map-unit, 1) * 0.12);
    stroke-opacity: 0.7;
    pointer-events: none;
}

.structurereach.preview {
    fill: color-mix(in srgb, #8fd3ff 10%, transparent);
    stroke: #8fd3ff;
    stroke-dasharray: calc(var(--map-unit, 1) * 0.6) calc(var(--map-unit, 1) * 0.4);
}

.structureicon {
    pointer-events: none;
}

.structureicon .backing {
    fill: color-mix(in srgb, #05070d 80%, transparent);
    stroke: var(--fleet, #8fd3ff);
    stroke-width: 0.18;
}

/* The plate is the body, dimmed, and the core is what stands on it, bright: filled the same, a
   Star Base's inner hexagon, an Orbital Battery's gun and a Sentinel Grid's mesh all vanished into
   one solid hexagon at map size, and those are three different things to be fighting. */
.structureicon .plate {
    fill: color-mix(in srgb, var(--fleet, #8fd3ff) 30%, #05070d);
    stroke: var(--fleet, #8fd3ff);
    stroke-width: 0.16;
}

.structureicon .core {
    fill: var(--fleet, #8fd3ff);
    stroke: #05070d;
    stroke-width: 0.08;
}

/* Lines and curves have no inside to fill: they are drawn as strokes, bright on the dim plate. */
.structureicon line,
.structureicon line.core,
.structureicon path.plate,
.structureicon path.core,
.structureicon .glyph {
    fill: none;
    stroke: var(--fleet, #8fd3ff);
    stroke-width: 0.25;
    stroke-linecap: round;
}

.structureicon .glyphfill {
    fill: var(--fleet, #8fd3ff);
}

/* ── Many fleets at once ──────────────────────────────────────────────────
   A left-drag on empty sky draws the box; the fleets it picks wear a ring until a right-click lets
   them go. Dashed in the accent, so neither reads as the single open fleet's solid ring. See
   Game.razor's many-fleets-at-once section. */
.boxselect {
    fill: color-mix(in srgb, var(--accent) 10%, transparent);
    stroke: var(--accent);
    stroke-width: calc(var(--map-unit) * 0.35);
    stroke-dasharray: calc(var(--map-unit) * 1.2) calc(var(--map-unit) * 0.8);
    pointer-events: none;
}

.pickring {
    fill: none;
    stroke: var(--accent);
    stroke-width: calc(var(--map-unit) * 0.4);
    stroke-dasharray: calc(var(--map-unit) * 1.1) calc(var(--map-unit) * 0.7);
    pointer-events: none;
}

/* <b>The zoom reaches the fleet markers through the stylesheet, not through the markup.</b> Each
   marker is a group translated to anchor + offset × --map-unit, with its circles, hull and triangle
   drawn around the origin; --map-unit, --ship-swell and --open-ring are set on the map once a redraw.
   So a zoom notch changes one attribute and the fleet layer is not rendered at all. See FleetDraw and
   FleetMarks; Gerald, 3 October 2026: "redrawing anything other than the map when the map is zoomed
   in or out seems like a mistake." */
.fleetlayer .fleet {
    transform: translate(calc((var(--ax) + (var(--ox) * var(--map-unit))) * 1px), calc((var(--ay) + (var(--oy) * var(--map-unit))) * 1px));
}

.fleetlayer .fleet > .hit,
.fleetlayer .fleet > .warpring { r: calc(var(--hr) * var(--map-unit) * 1px); }

.fleetlayer .fleet > .pickring { r: calc(var(--hr) * var(--map-unit) * 1.3px); }

.fleetlayer .fleet > .selectring { r: calc(var(--open-ring) * 1px); }

/* <b>A fleet defending its post</b> wears a small shield at its upper right, in the white the map's other defences are
   drawn in (see .defencemark). Placed by the hit radius and scaled with the zoom, as the polygon beside it is. */
.fleetlayer .fleet > .holdmark {
    transform: translate(calc(var(--hr) * var(--map-unit) * 0.8px), calc(var(--hr) * var(--map-unit) * -0.8px)) scale(calc(var(--map-unit) * 1.6));
    pointer-events: none;
}

.fleetlayer .holdmark .plate {
    fill: rgb(184 198 224 / 55%);
    stroke: #dce6f8;
    stroke-width: 0.22px;
    stroke-linejoin: round;
}

.fleetlayer .holdmark .core {
    fill: none;
    stroke: #05070d;
    stroke-width: 0.28px;
    stroke-linecap: round;
}

/* <b>A fleet told to give battle</b> wears crossed blades at its upper left, the shield's corner mirrored, in the red of a
   fight. Since 3 December 2026. See FleetDraw.GivingBattle. */
.fleetlayer .fleet > .attackmark {
    transform: translate(calc(var(--hr) * var(--map-unit) * -0.8px), calc(var(--hr) * var(--map-unit) * -0.8px)) scale(calc(var(--map-unit) * 1.6));
    pointer-events: none;
}

.fleetlayer .attackmark .plate {
    fill: rgb(150 30 24 / 70%);
    stroke: #ff8a7a;
    stroke-width: 0.2px;
}

.fleetlayer .attackmark .blade {
    fill: none;
    stroke: #ffe2dc;
    stroke-width: 0.26px;
    stroke-linecap: round;
}

.fleetlayer .attackmark .hilt {
    fill: none;
    stroke: #ffe2dc;
    stroke-width: 0.2px;
    stroke-linecap: round;
}

.fleetlayer .fleet > .fleetship {
    transform: rotate(calc(var(--h) * 1deg)) scale(calc(var(--s) * var(--map-unit) * var(--ship-swell)));
}

.fleetlayer .fleet > polygon { transform: scale(var(--map-unit)); }

/* <b>And the stars, the same way.</b> Each star's drawn radius at a zoom of one is --r on its group;
   the rings around it are calc() of that and --map-unit, the label sits a radius plus --label-size
   below, and the defence marks and clocks are placed by the same arithmetic. See StarField. */
.starlayer .sys > .halo { r: calc(var(--r) * var(--map-unit) * 2.6px); }
.starlayer .sys > .halo.painted { r: calc(var(--r) * var(--map-unit) * 2.2px); }
.starlayer .sys > .body { r: calc(var(--r) * var(--map-unit) * 1px); }
.starcaps .cap { r: calc(var(--r) * var(--map-unit) * 1px); pointer-events: none; }
.starlayer .sys > .owned,
.starlayer .sys > .claimed { r: calc(var(--r) * var(--map-unit) * 1.5px); }
.starlayer .sys > .guardring { r: calc(var(--r) * var(--map-unit) * 1.7px); }
.starlayer .sys .siegering { r: calc(var(--r) * var(--map-unit) * 2px); }
.starlayer .sys .gatewayring { r: calc(var(--r) * var(--map-unit) * 3.2px); }
.starlayer .sys .gatewayring.far { r: calc(var(--r) * var(--map-unit) * 4.6px); }
.starlayer .sys > .selectring { r: calc(var(--r) * var(--map-unit) * 2.2px); }
.starlayer .sys > .hit.wide { r: calc(var(--r) * var(--map-unit) * 1.8px); }
.starlayer .sys > .inrange { r: calc(var(--r) * var(--map-unit) * 2.4px); }

.starlayer .sys .defencemark {
    transform: translate(calc((var(--cx) + (var(--dx) * var(--map-unit))) * 1px), calc((var(--cy) + (var(--dy) * var(--map-unit))) * 1px)) scale(var(--map-unit));
}

/* The marks are scaled with the zoom by the rule above, so their strokes are set at a zoom of one. */
.starlayer .defencemark .plate,
.starlayer .defencemark .core { stroke-width: 0.05px; }

.starlayer .sys .clockat {
    transform: translate(calc(var(--r) * var(--map-unit) * var(--kx) * 1px), calc(var(--r) * var(--map-unit) * var(--ky) * 1px));
}

.starlayer .sys .clockat text {
    font-size: calc(var(--r) * var(--map-unit) * 1.7px);
    stroke-width: calc(var(--r) * var(--map-unit) * 0.5px);
}

.starlayer .sys .labelat { transform: translate(0, calc(((var(--r) * var(--map-unit)) + var(--label-size)) * 1px)); }

.starlayer .sys .labelat text { font-size: calc(var(--label-size) * 1px); }

/* One line below the star's label, the label's size; on the label's own line where the star has none. */
.starlayer .sys .needat { transform: translate(0, calc(((var(--r) * var(--map-unit)) + (var(--label-size) * 2.15)) * 1px)); }
.starlayer .sys .needat.alone { transform: translate(0, calc(((var(--r) * var(--map-unit)) + var(--label-size)) * 1px)); }
.starlayer .sys .needat text { font-size: calc(var(--label-size) * 0.95px); stroke-width: calc(var(--map-unit) * 1px); }

/* <b>A structure stands in for its outpost.</b> See OutpostField and StructureGlyph. The glyph fills
   the hex, in the owner's colour; a gate is the warp's blue, since it is a place to go rather than a
   thing standing guard; one still building is dashed and faint, with its turns left written in it. */
.structureicon .backing { stroke-width: 0.22; }

.structureicon .glyph { stroke-width: 0.32; }

.structureicon.is-star-gate .glyph { stroke: var(--warp, #8fd3ff); }

.structureicon.is-star-gate .glyphfill { fill: var(--warp, #8fd3ff); }

.structureicon.is-star-gate .portal { opacity: 0.35; }

.structureicon.building { opacity: 0.6; }

/* The well's rings are rings: filled, the middle one buried the dot it falls toward. */
.structureicon.is-gravity-well-projector .core:not(.solid) {
    fill: none;
    stroke: var(--fleet, #8fd3ff);
    stroke-width: 0.25;
}

.structureicon.building .glyph,
.structureicon.building polygon,
.structureicon.building path,
.structureicon.building circle:not(.backing):not(.clockbadge) { stroke-dasharray: 0.5 0.35; }

/* The turns left sit in a badge on the ring's shoulder rather than across the glyph: written over
   the middle, the number hid which structure was going up. */
.structureicon .turnsleftat { transform: translate(1.95px, 1.95px); }

.structureicon .clockbadge {
    fill: #05070d;
    stroke: var(--fleet, #8fd3ff);
    stroke-width: 0.14;
}

.structureicon .turnsleft {
    fill: #e8eefb;
    font-size: 1.3px;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: central;
    paint-order: stroke;
    stroke: #05070d;
    stroke-width: 0.5px;
    stroke-dasharray: none;
}

/* ── The fleet in the colony rail ─────────────────────────────────────────
   A fleet open takes the left rail: its controls at the top, its ships as cards three abreast in
   the middle, the minimap still at the foot. The rail widens over the map rather than the map
   narrowing under it. See Game.razor's left rail and FleetBody. */
.rail.left.fleetrail { background: color-mix(in srgb, var(--chrome) 97%, transparent); }

/* Wide for a fleet of yours or a selection only; somebody else's keeps the colony rail's width, its
   cards one to a row. Gerald, 5 October 2026. See RailWide. */
.rail.left.fleetrail.wide { width: 27rem; }
.rail.left.fleetrail:not(.wide) .railfleet .fleetbar-ships { grid-template-columns: minmax(0, 1fr); }

.railfleet {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 0.35rem;
}

.railfleet .fleetbar-head {
    flex-wrap: wrap;
    padding: 0.2rem 0.1rem 0.4rem;
    row-gap: 0.3rem;
}

.railfleet .fleetbar-ships {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 0.35rem;
    padding: 0.1rem 0.15rem 0.3rem 0;
}

.railfleet .fleetbar-ships .pick {
    position: relative;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.3rem;
}

.railfleet .pick > button.grow,
.railfleet .fleetbar-ships button.pick {
    align-items: center;
    text-align: center;
    width: 100%;
}

.railfleet .shipart {
    display: block;
    width: 100%;
    height: 4.4rem;
}

.railfleet .shipname {
    font-size: 0.74rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

/* Going or holding, as a chip in the card's corner rather than a line of its own. */
.railfleet .fleetbar-ships .pick > .tag {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    font-size: 0.56rem;
    padding: 0 0.25rem;
}

.railfleet .fleetbar-ships .pick:not(.going) { opacity: 0.8; }

.railfleet .pick .aboard { justify-content: center; margin-top: 0.15rem; }

/* <b>An attachment as a picture.</b> See AttachmentIcon. */
.atticon {
    display: inline-flex;
    align-items: center;
    gap: 0.05rem;
    color: var(--accent);
}

.atticon svg { width: var(--atticon-size, 1.35rem); height: var(--atticon-size, 1.35rem); overflow: visible; }

.atticon .fill { fill: currentColor; }
.atticon .line { fill: none; stroke: currentColor; stroke-width: 0.3; stroke-linecap: round; }
.atticon .cut { fill: var(--card, #0d1524); }
.atticon .pip { fill: var(--warn); }
.atticon .warp { stroke: var(--warp, #8fd3ff); }

.atticon .structure .plate {
    fill: color-mix(in srgb, currentColor 30%, #05070d);
    stroke: currentColor;
    stroke-width: 0.16;
}

.atticon .structure .core { fill: currentColor; stroke: #05070d; stroke-width: 0.08; }

.atticon .structure line,
.atticon .structure path.plate,
.atticon .structure path.core,
.atticon .structure .glyph { fill: none; stroke: currentColor; stroke-width: 0.3; stroke-linecap: round; }

.atticon .structure .glyphfill { fill: currentColor; }
.atticon .structure.is-star-gate .glyph { stroke: var(--warp, #8fd3ff); }
.atticon .structure.is-star-gate .glyphfill { fill: var(--warp, #8fd3ff); }
.atticon .structure.is-star-gate .portal { opacity: 0.35; }

.atticon-count { font-size: 0.68rem; font-weight: 700; color: var(--text); }

/* The star panel stands clear of the rail whichever width it is, and the minimap keeps the size it
   has on the narrow rail: square, it grew with the rail and took the ships' room. */
body:has(.rail.left.fleetrail.wide) .panel { left: calc(27rem + 0.8rem); }

.rail.left.fleetrail .minimap,
.rail.left.fleetrail .small.home { width: calc(13rem - 0.9rem); align-self: center; }

/* ── The fleet rail's controls ───────────────────────────────────────────
   Fixed sizes all the way down, so nothing under them moves when another fleet is picked: a status
   of two lines, a line for the travel time, and seven controls two to a row. See FleetSlots. */
.railfleet .fleetstatus {
    flex: 0 0 auto;
    height: 2.75rem;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    gap: 0.25rem 0.4rem;
    font-size: 0.8rem;
    line-height: 1.3;
}

.railfleet .fleetstatus .fleetbar-aim { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; padding: 0; border: none; }

.railfleet .fleeteta {
    flex: 0 0 auto;
    height: 1.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fleetactions {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 2.5rem;
    gap: 0.25rem;
}

.fleetactions.theirs { height: auto; display: flex; flex-direction: column; gap: 0.15rem; padding: 0.3rem 0; }
.fleetactions.hidden { display: none; }

.fleetslot { position: relative; display: block; min-width: 0; }

.fleetslot > .slotbutton {
    --atticon-size: 1.3rem;
    width: 100%;
    height: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.3rem;
    text-align: left;
    font-size: 0.72rem;
    line-height: 1.1;
}

.fleetslot > .slotbutton .atticon { flex: 0 0 auto; }
.fleetslot > .slotbutton:disabled { opacity: 0.32; cursor: default; }
.fleetslot > .slotbutton.pressed { border-color: var(--accent); background: color-mix(in srgb, var(--tint) 18%, var(--card)); }
.fleetslot > .slotbutton.warn:not(:disabled) { border-color: var(--warn); }

.slotwords { display: flex; flex-direction: column; min-width: 0; }
.slotlabel { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slotsub { font-size: 0.62rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The question a place asks, laid over the grid rather than pushing it down. */
.slotpick {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    z-index: 6;
    min-width: 100%;
    width: max-content;
    max-width: 18rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.3rem;
    background: var(--panel, #0d1524);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.fleetslot:nth-child(2n) .slotpick { left: auto; right: 0; }
.slotpick .pill { display: flex; align-items: center; gap: 0.3rem; --atticon-size: 1.1rem; }

.railfleet .fleetbar-pickall { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }

/* ── Battle groups ────────────────────────────────────────────────────────
   A fleet of more hulls than one fight seats: its groups as rows to pick, first to last, and the
   dialog that arranges them. The pick-all row's idiom — small buttons, muted words — so the bar reads
   as one thing. See Game.razor's BattleGroupsSection and GroupsDialog. */
.battlegroups { flex: 0 0 auto; display: flex; flex-direction: column; gap: 0.3rem; padding: 0.3rem 0 0.4rem; border-top: 1px solid var(--line); }
.battlegroups-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.battlegroups-head .spacer { flex: 1; }
.battlegroups .grouplist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.2rem; max-height: 16rem; overflow-y: auto; }
.battlegroups .grouprow { width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; text-align: left; padding: 0.2rem 0.4rem; }
.battlegroups .grouprow.first { border-left: 3px solid var(--ok); }
.battlegroups .grouprow.picked { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.battlegroups .groupname { font-weight: 600; }
.battlegroups .groupcount { font-variant-numeric: tabular-nums; }
.battlegroups .groupmix { min-width: 0; overflow-wrap: anywhere; }
.groupsheet { min-width: min(56rem, 94vw); max-width: 94vw; }
.groupsheet .groupstools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.4rem 0; }
.groupsheet .groupstools .spacer { flex: 1; }
.groupsheet .groupcount-in { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.85rem; }
.groupsheet input.count { width: 3.4rem; }
.groupsheet .groupgrid-wrap { max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 4px; }
.groupsheet .groupgrid { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.groupsheet .groupgrid th, .groupsheet .groupgrid td { padding: 0.15rem 0.35rem; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.groupsheet .groupgrid thead th { position: sticky; top: 0; background: var(--panel, #10182a); z-index: 1; }
.groupsheet .groupgrid tr.first td:first-child { border-left: 3px solid var(--ok); }
.groupsheet .groupgrid tr.unassigned td { position: sticky; bottom: 0; background: var(--panel, #10182a); font-weight: 600; }
.groupsheet .grouprowbuttons { display: inline-flex; gap: 0.2rem; }

/* ── The ship card ────────────────────────────────────────────────────────
   One card on the galaxy and in a fight: the hull, what it can do, what is always true of it. Values
   sit beside the words they belong to. See Game.razor's ShipCardBody. */
.shipcard { display: flex; flex-direction: column; gap: 0.7rem; min-width: min(46rem, 92vw); }

.shipcard section + section { border-top: 1px solid var(--line); padding-top: 0.6rem; }

.sc-hull { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.8rem; align-items: start; }

.sc-look { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; text-align: center; }
.sc-look .scanart { width: 7.5rem; height: 7.5rem; }
.sc-name { font-size: 0.95rem; line-height: 1.15; overflow-wrap: anywhere; }

.sc-figures {
    display: grid;
    grid-template-columns: max-content max-content max-content;
    justify-content: start;
    column-gap: 0.8rem;
    row-gap: 0.25rem;
    margin: 0;
    font-size: 0.86rem;
    align-items: baseline;
}

.sc-figures dt { color: var(--muted); font-weight: 600; }
.sc-figures dd { margin: 0; }
.sc-figures dd.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-count { color: var(--muted); margin-right: 0.2rem; font-variant-numeric: tabular-nums; }

.sc-does {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
    gap: 0.45rem;
}

.sc-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    font-size: 0.82rem;
}

.sc-item.gone { opacity: 0.5; }
.sc-itemhead { font-weight: 600; margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.25rem; --atticon-size: 1.1rem; }

.sc-itemfigs {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 0.6rem;
    row-gap: 0.1rem;
    margin: 0;
}

.sc-itemfigs dt { color: var(--muted); }
.sc-itemfigs dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.sc-mods { list-style: none; margin: 0.3rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; font-size: 0.76rem; }
.sc-mods li::before { content: "▸ "; color: var(--muted); }

.sc-always { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.84rem; }
.sc-passives { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; }
.sc-passive.gone { opacity: 0.5; }
.sc-trait { display: grid; grid-template-columns: 11rem 1fr; gap: 0.6rem; align-items: baseline; }

.shipcard .linky { padding: 0; font: inherit; color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
.shipcard .linky:hover { color: var(--accent); }

/* The ship window is as wide as the card it holds: the compact sheet it used to borrow clipped a
   three-column card down its right side. */
.sheet.shipcardsheet { width: min(52rem, 94vw); max-width: 94vw; }
.sheet.shipcardsheet .shipcard { min-width: 0; }
.sc-figures dd.sc-what { text-align: left; }
.sheet.shipcardsheet { height: auto; max-height: 92vh; }

/* A Gateway going up, over the fleets: rings that pass the pointer through, and a badge with the
   turns left. See Game.razor's gatewayover. */
.gatewayover { pointer-events: none; }
.gatewayover .gatewayring {
    stroke-width: max(0.18px, calc(var(--course-unit) * 0.7px));
    animation-name: gatewayoverpulse;
}

/* Five hexes across at its smallest: the rings are 3.4 and 4.6 hexes out, and 0.75 of 3.4 is 2.55. */
@keyframes gatewayoverpulse {
    0% { transform: scale(0.75); opacity: 0.95; }
    70% { transform: scale(1); opacity: 0.35; }
    100% { transform: scale(1.1); opacity: 0; }
}

.gatewayover .gatewayhex {
    fill: rgb(255 80 80 / 22%);
    stroke: var(--error);
    stroke-width: max(0.06px, calc(var(--course-unit) * 0.35px));
}
.gatewayover .gatewaybadge { fill: rgb(5 7 13 / 85%); stroke: var(--error); stroke-width: 0.25; }
.gatewayover .gatewayturns { fill: #ffd6d6; font-size: 2.6px; font-weight: 700; dominant-baseline: central; }

/* ── Several fleets picked: their ships, under where each is ──────────────
   One scrolling column for all of them, each fleet's cards a grid of their own. See PickedBody. */
.railfleet .pickedfleets { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.25rem; }
.railfleet .pickedfleets .fleetbar-ships { flex: none; }
.railfleet .pickedwhere { margin: 0.2rem 0 0; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.railfleet .pickedwhere button { padding: 0.05rem 0.45rem; }

/* A defeated empire, in the empires dialog: its tab and its chip in the error colour, so it reads as
   gone at a glance. See StandingsBody and EmpirePage. */
.etab.fallen { border-color: color-mix(in srgb, var(--error) 55%, var(--line)); }
.chip.fallen { color: var(--error); border-color: var(--error); font-weight: 600; }

/* <b>This turn's orders, in the fleets dialog.</b> One row an order: what it does, which finds it on
   the map, and the way back. Gerald, 6 October 2026 -- see Game.razor's TurnOrders. */
.turnorders li { display: flex; gap: 0.4rem; align-items: center; margin: 0.2rem 0; }
.turnorders li .grow { flex: 1; text-align: left; }

/* An attachment the hull's design fits and this hull has spent: still listed, as 0/x, and faded.
   Gerald, 6 October 2026 -- see PendingView.CarriedBy. */
.atticon.spent { opacity: 0.45; }

/* A hull breaking off, captioned over its name every round it is turning -- see BattleShips. */
.shipretreat {
    font-size: 0.32px;
    fill: var(--warn);
    text-anchor: middle;
    paint-order: stroke;
    stroke: var(--bg);
    stroke-width: 0.06px;
    pointer-events: none;
}

/* The late game's ship queue and star works dialogs: one wide list of what each star is doing,
   with progress, time and a Buy on every row. See ShipQueueBody and WorkOrderBody. */
.buildorder-cols > .buildorder-wide { min-width: 0; }
.buildorder-col.buildorder-wide .jobrow { flex-wrap: wrap; gap: 0.25rem 0.6rem; }
section.buildorder-wide[data-testid="work-stars"] { margin-bottom: 0.75rem; max-height: 45vh; }
.workstar { flex-direction: column; align-items: flex-start; }
.workstanding { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; width: 100%; }
.workstanding .workline { display: inline-flex; align-items: center; gap: 0.35rem; }
.linkish {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font: inherit;
    text-decoration: underline dotted;
    cursor: pointer;
}

/* <b>The lobby's tabs, since 10 October 2026</b> — one row, each section a tab. Gerald: "lets change it so that each
   section is a tab on the screen, not a section." Underlined rather than boxed, and the panel held at one width so it
   does not change size from tab to tab. See Home. */
.lobby .panel.lobbypanel {
    width: min(60rem, 100%);
    margin: 0 auto;
    align-self: center;
}

/* <b>A long list scrolls inside its tab, and the tabs stay</b>, since 16 October 2026. The game's floating .panel is
   absolute and clips what overflows it, and in a flex column the tab row was what gave way: a long Replays or Your
   games list squeezed the tabs to nothing and ran off the bottom with no scrollbar. Gerald: "both screens need
   scrollbars and a button to return to the lobby, both of which are missing." So the head and the tabs keep their
   height, the open card takes what is left, and its .scroll list scrolls; a card with no list scrolls whole. */
.lobby .panel.lobbypanel { position: relative; top: auto; left: auto; box-shadow: none; }
.lobbypanel > .panel-head, .lobbypanel > .lobbytabs, .lobbypanel > .error { flex-shrink: 0; }
.lobbypanel > .card { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; overflow-y: auto; }
.lobbypanel > .card > .scroll { flex: 1 1 auto; min-height: 0; }
.lobbypanel > .card > .panel-head { flex-shrink: 0; }

/* <b>The create-a-game screen, since 28 October 2026</b>: the same reset as the lobby's panel, so it sits in the page and the
   page scrolls (the game's floating .panel clipped it with no scrollbar), and wider, with the mid game in two columns —
   your own game on the left, the AIs on the right. Gerald: "it can overfill the screen and there is no scroll bar for it
   ... Maybe move the entire AI section to the right of the screen." One column below 90rem, where two leave both cramped. See Create. */
.lobby .panel.createpanel {
    position: relative;
    top: auto;
    left: auto;
    box-shadow: none;
    overflow: visible;
    max-height: none;
    width: min(120rem, 100%);
    margin: 0 auto;
    align-self: center;
    flex-shrink: 0;
}

.createcols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 1.5rem;
    align-items: start;
}

.createside {
    border-left: 1px solid var(--line);
    padding-left: 1.5rem;
}

.createside > h3:first-child { margin-top: 0; }

@media (max-width: 90rem) {
    .createcols { grid-template-columns: minmax(0, 1fr); }
    .createside { border-left: none; padding-left: 0; }
}

.lobbytabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: thin;
}

.lobbytabs .lobbytab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}

.lobbytabs .lobbytab:hover { color: var(--text); }

.lobbytabs .lobbytab.pressed {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.lobbytabs .lobbytab .count {
    font-size: 0.75rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg, #000);
}

.lobbytabs .lobbytab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ── Colony focus, 13 October 2026 ────────────────────────────────────────────────────
   The star panel's paid switch, its free one and the first choice, and the two sheets that answer
   them in bulk. Kept to a line each: Gerald dislikes wasted vertical space on the rail and the panel. */
.control .focusnote { margin: 0 0 0.25rem; }
.row.focus.switching, .row.focus.switchask { align-items: center; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.35rem; }
.row.focus.switching button, .row.focus.switchask button { flex: 0 0 auto; }
.row.focus.switchask span { flex: 1 1 100%; }
.row.focus button.asking { outline: 1px dashed currentColor; }
.focuslist, .spreadlist { margin: 0.4rem 0; padding: 0; }
.focusline, .spreadline { display: flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0; }
.focusline .grow, .spreadline .grow { flex: 1 1 auto; min-width: 0; }
.spreadshare { min-width: 3.2rem; text-align: center; }
.tally-line.alert { color: var(--alert, #e0a040); }

/* The opening picker: one drop-down, and the chosen opening described under it. Gerald, 15 October 2026. */
.startpicker select { margin-top: 0; }
.startpicker .startdetails { margin-top: 0.6rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 6px; display: grid; gap: 0.35rem; }
.startpicker .startdelete { margin-top: 0.25rem; }
/* The full-shelf choice at the end of an opening, in the rail. Gerald, 16 October 2026. */[data-testid="opening-shelf-full"] { display: grid; gap: 0.4rem; padding: 0.6rem 0.75rem; border: 1px solid var(--warn, var(--line)); border-radius: 6px; }[data-testid="opening-shelf-full"] .startdetails { margin-top: 0; }
.openingdone { display: grid; gap: 0.75rem; }.openingdone p { margin: 0; }.openingdone .openingname { display: grid; gap: 0.3rem; }
.bb-whose .boostnote { color: var(--accent); font-weight: 600; }

/* The results dialog: the fight whose details are open. See Game.razor BattleResultsBody. */
[data-testid="battle-results"] tr.picked td { background: var(--card); color: var(--accent); }
[data-testid="battle-results"] tbody tr:hover td { background: var(--card); }

/* The results dialog takes the screen it needs: the list, then the open fight or the totals below it, all in one sheet. */
.sheet.narrow.battlesheet { width: min(1400px, 100%); }
.battledetail { margin: 0.75rem 0; padding: 0.75rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.battledetail table.plain { min-width: 16rem; }

/* The sandbox line's racial traits: one tier box per trait, in as many columns as the sheet is wide. */
.sandbox-traits {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11em, 1fr));
    gap: 0.25em 1em;
    margin-bottom: 0.5em;
}

/* The proposal's turning four-dimensional raiders: wireframes, so the path is drawn and never filled. See HyperArt. */
.combatant .hull > .hyper, .hyper {
    fill: none;
    stroke-linecap: round;
}

/* ── Specials, shown as they go off (2 November 2026) ─────────────────────────────────────────
   Gerald: "Specials are also given their own space in the animation display for enemies (as well as when you click them for your
   own ships to clearly show that a special was used". A burst where it goes off, a star for "used", and the list of the enemy's in
   the round just played. */
.ghostspecial .usedstar { fill: var(--warn, #ffd166); stroke: none; opacity: 0.85; }

.specialburst { pointer-events: none; }
.specialburst .burstring {
    fill: none;
    stroke: #ffd166;
    stroke-width: 0.18;
    animation: specialburst calc(0.9s * var(--flow, 1)) ease-out forwards;
}
.specialburst .burstring.late { animation-delay: calc(0.18s * var(--flow, 1)); opacity: 0; }
.specialburst.theirs .burstring { stroke: #ff8fb1; }
.specialburst .usedstar {
    fill: #ffd166;
    animation: specialstar calc(0.9s * var(--flow, 1)) ease-out forwards;
}
.specialburst.theirs .usedstar { fill: #ff8fb1; }
.specialburst .burstname {
    fill: #fff3d6;
    font-size: 1.3px;
    font-weight: 600;
    text-anchor: middle;
    paint-order: stroke;
    stroke: #0b0f1a;
    stroke-width: 0.25;
    animation: specialname calc(1.2s * var(--flow, 1)) ease-out forwards;
}
.specialburst .burstline { stroke: #ff8fb1; stroke-width: 0.12; stroke-dasharray: 0.4 0.3; opacity: 0.8; }

@keyframes specialburst {
    from { transform: scale(0.2); opacity: 1; }
    to { transform: scale(1.6); opacity: 0; }
}
@keyframes specialstar {
    0% { transform: scale(0.2) rotate(0deg); opacity: 0; }
    35% { transform: scale(1.2) rotate(20deg); opacity: 1; }
    100% { transform: scale(1) rotate(45deg); opacity: 0.9; }
}
@keyframes specialname {
    0% { opacity: 0; transform: translateY(0.6px); }
    20% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; }
    100% { opacity: 0.85; }
}

.specialsfeed {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    max-width: 20rem;
    padding: 0.45rem 0.6rem;
    background: rgba(22, 8, 14, 0.82);
    border: 1px solid #5c2a3e;
    border-radius: 6px;
    font-size: 0.78rem;
    pointer-events: none;
}
.specialsfeed .specialsfeedhead { font-weight: 600; margin-bottom: 0.2rem; color: #ffb3c8; }
.specialsfeed ol { margin: 0; padding-left: 1.1rem; }
.specialsfeed li .muted { margin-left: 0.3rem; }

@media (prefers-reduced-motion: reduce) {
    .specialburst .burstring, .specialburst .usedstar, .specialburst .burstname { animation: none; }
}
/* And the same for the Animations setting turned off (AccountSettings.Still). */
:root.still .specialburst .burstring, :root.still .specialburst .usedstar, :root.still .specialburst .burstname { animation: none; }

/* The step just written fades out on its own and is left in place until the next one replaces it — see Game's _planFlash. */
.planflash .specialburst .usedstar,
.planflash .specialburst .burstname { animation: specialname calc(1.2s * var(--flow, 1)) ease-out forwards, planflashout calc(0.5s * var(--flow, 1)) calc(1.2s * var(--flow, 1)) ease-in forwards; }
@keyframes planflashout { to { opacity: 0; } }

/* ── One hull's fight, read back (2 November 2026) — see ShipHistorySheet ───────────────────── */
.sheet.shiphistory { max-width: 40rem; width: min(40rem, 94vw); height: auto; max-height: 88vh; }
.shiphistory .sheet-head { display: flex; align-items: center; gap: 0.6rem; }
.shiphistory .sh-title h1 { margin: 0; }
.shiphistory .sh-icon { flex: none; vertical-align: middle; }
.shiphistory .sh-fate { font-weight: 600; }
.shiphistory .sh-fate.lost { color: #ff8f8f; }
.shiphistory .sh-fate.stood { color: #8fe3a8; }
.shiphistory .sh-attackers { list-style: none; padding: 0; margin: 0 0 0.8rem; display: grid; gap: 0.2rem; }
.shiphistory .sh-attackers li, .shiphistory .sh-hit {
    display: grid;
    grid-template-columns: 1.4rem 1fr auto auto;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}
.shiphistory .sh-attackers li { grid-template-columns: 1.6rem 1fr auto; }
.shiphistory .sh-hit { grid-template-columns: 1.4rem minmax(6rem, 1fr) minmax(6rem, 1.2fr) auto auto; }
.shiphistory .sh-dmg { font-variant-numeric: tabular-nums; color: #ffb3b3; text-align: right; }
.shiphistory .sh-with { color: var(--muted); }
.shiphistory .sh-rounds { max-height: 50vh; overflow-y: auto; display: grid; gap: 0.5rem; }
.shiphistory .sh-roundhead { font-weight: 600; margin-bottom: 0.15rem; }
.shiphistory .sh-hit.killing { background: rgba(255, 90, 90, 0.12); border-radius: 4px; }
.shiphistory .sh-kill { color: #ff8f8f; font-size: 0.75rem; font-weight: 600; }
/* Over the end of combat screen it is opened from, which is itself an overlay at 8. */
.overlay.overlay-shiphistory { z-index: 9; }
.shiphistory .sh-attackers > li { display: block; }
.shiphistory .sh-design { display: flex; align-items: center; gap: 0.5rem; }
.shiphistory .sh-design .sh-dmg { margin-left: auto; }
.shiphistory .sh-weapons { list-style: none; margin: 0.15rem 0 0.4rem 1.9rem; padding: 0; }
.shiphistory .sh-weapons li { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.9em; }
.shiphistory .sh-weapons .sh-dmg { margin-left: auto; }

/* The fallen stars, a tab each. See the siege sheet in Game.razor. */
.siegetabs { display: flex; gap: 0.35rem; align-items: stretch; padding: 0.4rem 0.9rem; border-bottom: 1px solid var(--line); }
/* Wrapped into rows, and scrolled down past a few of them, rather than one row scrolled sideways: Gerald, 30 November 2026, "change
   the horizontal scrolling of the stars that sieges have ended at to a vertical scrolling, or even just show far more stars before
   requiring any scrolling." */
.siegetabstrip { display: flex; flex-wrap: wrap; gap: 0.35rem; flex: 1 1 auto; min-width: 0; max-height: 11rem; overflow-y: auto; align-content: flex-start; }
.siegeconfirm { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.6rem; }
.siegeconfirm .spacer { flex: 1 1 auto; }
.siegetab { display: flex; flex-direction: column; align-items: flex-start; gap: 0.05rem; padding: 0.2rem 0.5rem; text-align: left; white-space: nowrap; line-height: 1.15; }
.siegetab.pressed { border-color: var(--accent); }
.siegetab.answered .small { color: var(--ok, #7fd88f); }

/* Sign in with Google, to Google's branding rules for the button (4 November 2026): their four-colour G at 20px, Roboto Medium
   14px, 40px tall, 12px either side and 10px between the G and the words, and one of their two themes. Dark by default, to sit
   on this page; light where the browser asks for light. Gerald: "goole prefers anyone who uses it for sign in follows their own
   styling and offer both a light and dark option." */
button.gsi-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 12px;
    border-radius: 4px;
    font-family: "Roboto", Arial, sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.25px;
    background: #131314;
    border: 1px solid #8e918f;
    color: #e3e3e3;
    transition: background-color 0.218s, box-shadow 0.218s;
}

button.gsi-button:hover:not(:disabled) {
    border-color: #8e918f;
    background: #1d1d1f;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

button.gsi-button:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 2px; }

button.gsi-button .gsi-logo { display: inline-flex; width: 20px; height: 20px; }
button.gsi-button .gsi-logo svg { width: 20px; height: 20px; display: block; }

@media (prefers-color-scheme: light) {
    button.gsi-button {
        background: #ffffff;
        border-color: #747775;
        color: #1f1f1f;
    }

    button.gsi-button:hover:not(:disabled) { border-color: #747775; background: #f7f8f8; }

    button.gsi-button:focus-visible { outline-color: #0b57d0; }
}


/* The lobby's Players tab: everybody on the server, with a dot lit for whoever is online now. See PlayerList. */
.playerlist h2 { margin-top: 0.8rem; }
.playerlist h2:first-of-type { margin-top: 0; }
.playerlist .scroll { max-height: 22rem; overflow-y: auto; }
.presencedot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 0.45rem;
    border-radius: 50%;
    background: var(--line);
    vertical-align: middle;
}
.presencedot.on { background: var(--ok); }

/* ── The research dialog's lore panel, since 4 November 2026 ─────────────────────── */
/* The selected technology's art turning above its story, on the left of the research sheet — a trial of
   Gerald's idea before any of the art or the words are made. The sheet widens by the panel's width so the
   blocks keep the room they had. Under each other on a narrow screen. See TechLorePanel. */
.sheet.researchsheet { width: min(920px, 96vw); }

.researchlayout {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}

.researchmain { flex: 1 1 auto; min-width: 0; }

.techlore {
    flex: 0 0 15.5rem;
    position: sticky;
    top: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.8rem;
}

.techlore-art {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    color: var(--accent);
}

.techlore h3 { margin: 0.6rem 0 0.3rem; }
.techlore-text { margin: 0; font-style: italic; line-height: 1.5; color: var(--muted); }

@media (max-width: 40rem) {
    .researchlayout { flex-direction: column; align-items: stretch; }
    .techlore { position: static; flex-basis: auto; }
    .techlore-art { width: min(12rem, 60%); margin: 0 auto; }
}



/* An empire's line among overlords and vassals. See AllegianceBody in Game.razor. */
.allegianceline { margin: 0.4rem 0 0.8rem 1.2rem; padding: 0; }
.allegianceline li { margin: 0.15rem 0; }
.allegianceline li.you strong { color: var(--accent); }
.allegiancerules { margin: 0.4rem 0 0.8rem 1.1rem; padding: 0; }
.allegiancerules li { margin: 0.3rem 0; font-size: 0.9em; }
.surrenderoffer { margin: 0.5rem 0; }

/* The turn timer's countdown. See measure.js. */
.note.turntimer { font-variant-numeric: tabular-nums; }
.note.turntimer.urgent { color: var(--error, #ff8f8f); font-weight: 600; }

/* A racial trait rung by its own name, ahead of what it gives (since 5 November 2026). See RacialTraits.Titles. */
.rungname { color: var(--text); font-weight: 600; }


/* <b>No backdrop blurs anywhere, since 5 November 2026.</b> A blur behind something see-through is redone every frame that
   anything behind it or inside it moves, and the turning wireframes and the raiders' art move all the time. Measured in the
   headless browser: the research dialog with its turning art, 20 frames a second blurred and 59 not; the settings dialog
   open over four turning raiders on the map, 15 and 59. The bars, rails, fleet bar and every dialog veil blurred the map
   behind them; the veils are a little darker instead (86% where they were 72%). Do not add one back without measuring it
   with something moving behind it. */

/* Frames a second and the ping, top right over everything, when the account asks (see PerfReadout). Written by js/perf.js;
   amber when slow. Just under the game bar, so it hides none of the bar; hover a number for what it means. */
.perfreadout {
    position: fixed; top: calc(var(--hud-top) + 0.25rem); right: 0.5rem; z-index: 10000;
    display: flex; gap: 0.6rem; padding: 0.1rem 0.45rem; border-radius: 4px;
    background: rgba(0, 0, 0, 0.72); font-size: 0.75rem; line-height: 1.4;
}
.perf { color: #c9d4e5; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 3.4em; text-align: right; }
.perf.slow { color: #ffc24a; }

/* ── The empires dialog's comparisons (6 November 2026). See TechCompare and TraitCompare. ─────────── */

/* The chart's key is the switch for each line, so it is drawn as buttons that keep the key's look. */
.chartkey button.keyed {
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.chartkey button.keyed:hover { border-color: var(--line); }
.chartkey button.keyed.off { opacity: 0.4; text-decoration: line-through; }

.chartrange {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.8rem;
    font-size: 0.8rem;
}
.chartrange input { width: 5rem; margin-left: 0.3rem; }

.tcmp { display: flex; flex-direction: column; gap: 0.4rem; }

.tcmp-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; font-size: 0.8rem; }
.tcmp-key { display: inline-flex; align-items: center; gap: 0.3rem; }

.tcmp-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    flex: none;
}

.tcmp-star { color: var(--warn); font-size: 0.8rem; line-height: 1; }

/* The empire being looked at, in the legend: the same fill its technologies are lit with. */
.tcmp-lit {
    display: inline-block;
    width: 0.8rem;
    height: 0.55rem;
    border-radius: 2px;
    background: color-mix(in srgb, var(--accent) 35%, transparent);
    border: 1px solid var(--accent);
}

/* Wide trees scroll inside the sheet rather than widening it. */
.tcmp-scroll { overflow-x: auto; }

.tcmp-grid { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 0.7rem; }
.tcmp-grid col.tcmp-blockcol { width: 8.5rem; }
.tcmp-grid th { color: var(--muted); font-weight: 500; text-align: left; padding: 0.15rem 0.3rem; white-space: nowrap; }
.tcmp-grid td { vertical-align: top; padding: 0.15rem; border-top: 1px solid var(--line); }
.tcmp-grid td > .tcmp-tech + .tcmp-tech { margin-top: 0.15rem; }

.tcmp-block { border-top: 1px solid var(--line); vertical-align: top; white-space: normal; }
.tcmp-block .nm { display: block; color: var(--text); }
.tcmp-reach { display: flex; flex-wrap: wrap; gap: 0 0.35rem; font-variant-numeric: tabular-nums; }
.tcmp-reach .you { color: var(--warn); }

.tcmp-tech {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
    width: 100%;
    padding: 0.15rem 0.3rem;
    background: #0c1220;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--muted);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.tcmp-tech:hover { border-color: var(--accent); color: var(--text); }
.tcmp-tech .nm { flex: 1; min-width: 0; overflow-wrap: break-word; line-height: 1.15; }
.tcmp-tech .marks { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem; }

/* What the empire being looked at holds. */
.tcmp-tech.lit {
    background: color-mix(in srgb, var(--accent) 22%, #0c1220);
    border-color: var(--accent);
    color: var(--text);
}

/* Held by nobody in the comparison: there, but quiet. */
.tcmp-tech.none { opacity: 0.45; }

.tcmp-else { display: flex; flex-direction: column; gap: 0.25rem; }
.tcmp-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.tcmp-chips .tcmp-tech { width: auto; }

.tcmp-rung { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; }
.tcmp-rung .rungs { letter-spacing: 0.05rem; }
/* Buttons and table heads elsewhere keep to one line; these wrap, so a long name never spills into the next cell. */
.tcmp-grid th.tcmp-block { white-space: normal; }
.tcmp-grid .tcmp-tech { white-space: normal; overflow: hidden; align-items: flex-start; }
.tcmp-grid .tcmp-tech .marks { padding-top: 0.1rem; }

/* What a fight decides beyond its hulls, on the results screen and the Battles tab (6 November 2026). See Game.Stakes. */
.stakes { margin: 0.35rem 0; font-size: 0.8rem; }
/* A fight finished by hand: its result and the combat brain's, one above the other (22 November 2026). */
/* A fight on the results list picked to play by hand (22 November 2026). */
tr.byhand td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.byhandmark { font-size: 0.75rem; color: var(--accent); margin-right: 0.4rem; }
.resultpair { display: grid; gap: 0.5rem; margin: 0.5rem 0; }
.resultside { padding: 0.5rem 0.7rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.resultside h3 { margin: 0 0 0.3rem; }
.resultside [data-testid="battle-totals"] { gap: 0.4rem 1rem !important; font-size: 0.8rem; }
.stakes li { padding: 0.1rem 0; }
.stakesmark { margin-left: 0.4rem; font-size: 0.75rem; white-space: nowrap; }

/* What is being done to a hull this round, on the ship card in a fight. See ShipStatus. */
.sc-status h4 { margin: 0 0 .25rem; }
.sc-status ul { margin: 0; padding-left: 1.1rem; }
.sc-status li { margin: .1rem 0; }
.sc-bad { color: var(--bad, #ff7a6b); }
.sc-good { color: var(--good, #6c9); }

/* ── A special's own moment (see SpecialMoment), 6 November 2026 ─────────────────────────────────────────────────────────
   Each special a silhouette of its own in its kind's colour, about a second long, in place of the shared burst. Gerald:
   make it "more clear to all players what is going on without having to look closely at each ship". Motion is transform,
   opacity and stroke-dashoffset only; every shape turns and scales about its own middle. */
.moment { --mc: var(--fx-defence); pointer-events: none; }
.moment.red { --mc: var(--fx-offence); }
.moment.black { --mc: #8a90a0; }
.moment.purple { --mc: #b46cff; }
.moment .burstname { fill: var(--mc); }
.moment circle, .moment polygon, .moment path, .moment ellipse, .moment g { transform-box: fill-box; transform-origin: center; }
.moment .m-ring { fill: none; stroke: var(--mc); stroke-width: 0.08; }
.moment .m-faint { opacity: 0.25; }
.moment .m-out { animation: mout calc(0.9s * var(--flow, 1)) ease-out both; }
.moment .m-settle { animation: msettle calc(0.9s * var(--flow, 1)) ease-out both; }
.moment .m-ripple { fill: var(--mc); fill-opacity: 0.08; stroke: var(--mc); stroke-width: 0.08; }
.moment .m-fill {
    fill: none; stroke: var(--mc); stroke-width: 0.12;
    stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
    animation: mfill calc(0.9s * var(--flow, 1)) ease-out both;
}
.moment .m-mote { fill: var(--mc); animation: mmote calc(0.9s * var(--flow, 1)) ease-in both; }
.moment .m-streak { stroke: var(--mc); stroke-width: 0.07; stroke-linecap: round; animation: mout calc(0.9s * var(--flow, 1)) ease-out both; }
.moment .m-shell { fill: rgb(242 246 255 / 6%); stroke: var(--mc); stroke-width: 0.08; }
.moment .m-pulse rect { fill: var(--mc); }
.moment .m-pulse { animation: mpulse calc(0.9s * var(--flow, 1)) ease-in-out both; }
.moment .m-path { stroke: var(--mc); stroke-width: 0.05; stroke-dasharray: 0.25 0.2; opacity: 0.6; }
.moment .m-fold { animation: mfold calc(0.9s * var(--flow, 1)) ease-in both; }
.moment .m-unfold { animation: munfold calc(0.9s * var(--flow, 1)) ease-out both; }
.moment .m-reach { stroke-dasharray: 0.4 0.3; animation: munfold calc(0.9s * var(--flow, 1)) ease-out both; }
.moment .m-lens { fill: none; stroke: var(--mc); stroke-width: 0.1; }
.moment .m-shieldgone { fill: none; stroke: var(--fx-defence); stroke-width: 0.08; animation: mgone calc(0.9s * var(--flow, 1)) ease-in both; }
.moment .m-shard { stroke: var(--fx-defence); stroke-width: 0.08; stroke-linecap: round; animation: mshard calc(0.9s * var(--flow, 1)) ease-out both; }
.moment .m-blast { fill: rgb(248 81 73 / 22%); stroke: var(--mc); stroke-width: 0.16; animation: mblast calc(0.9s * var(--flow, 1)) ease-out both; }
.moment .m-draw {
    stroke: #07060b; stroke-width: 0.22; stroke-linecap: round;
    stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
    animation: mfill calc(0.45s * var(--flow, 1)) ease-in both;
}
.moment .m-close line { stroke: #07060b; stroke-width: 0.2; stroke-linecap: round; }
.moment .m-close line.edge { stroke: #8a90a0; stroke-width: 0.05; }
.moment .m-close { animation: mclose calc(0.9s * var(--flow, 1)) ease-out both; animation-delay: calc(0.3s * var(--flow, 1)); }
.moment .m-cage polygon { fill: rgb(7 6 11 / 30%); stroke: var(--mc); stroke-width: 0.1; stroke-linejoin: round; }
.moment .m-cage { animation: mcage calc(0.9s * var(--flow, 1)) ease-out both; }
.moment .m-sink { fill: none; stroke: var(--mc); stroke-width: 0.08; animation: msink calc(0.9s * var(--flow, 1)) ease-in both; animation-delay: calc(var(--k) * 0.18s * var(--flow, 1)); }
.moment .m-spike { fill: var(--mc); animation: msettle calc(0.9s * var(--flow, 1)) ease-out both; }
.moment .m-shock { fill: none; stroke: var(--mc); stroke-width: 0.1; animation: mshock calc(0.9s * var(--flow, 1)) ease-out both; animation-delay: calc(var(--k) * 0.16s * var(--flow, 1)); }
.moment .m-core { fill: var(--mc); }
.moment .m-gate { fill: none; stroke: var(--mc); stroke-width: 0.1; }

@keyframes mout { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@keyframes msettle { from { transform: scale(1.6); opacity: 0; } 60% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
@keyframes mfill { to { stroke-dashoffset: 0; } }
@keyframes mmote { from { transform: translate(var(--dx), var(--dy)); opacity: 0; } 30% { opacity: 1; } to { transform: translate(0, 0); opacity: 0.2; } }
@keyframes mpulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes mfold { from { transform: scale(1); opacity: 1; } to { transform: scale(0); opacity: 0; } }
@keyframes munfold { from { transform: scale(0); opacity: 0; } 40% { opacity: 1; } to { transform: scale(1); opacity: 0.9; } }
@keyframes mgone { 0%, 30% { opacity: 1; } to { opacity: 0; } }
@keyframes mshard { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
@keyframes mblast { from { transform: scale(0.1); opacity: 1; } to { transform: scale(1); opacity: 0; } }
@keyframes mclose { from { transform: scale(2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes mcage { from { transform: scale(2) rotate(-60deg); opacity: 0; } to { transform: scale(1) rotate(0deg); opacity: 1; } }
@keyframes msink { from { transform: scale(1); opacity: 0; } 30% { opacity: 1; } to { transform: scale(0.12); opacity: 0; } }
@keyframes mshock { from { transform: scale(0.1); opacity: 1; } to { transform: scale(1); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .moment * { animation-duration: 1ms !important; animation-delay: 0s !important; }
}
/* And the same for the Animations setting turned off (AccountSettings.Still). */
:root.still .moment * { animation-duration: 1ms !important; animation-delay: 0s !important; }

/* The art page loops the moments a fight plays once. */
.artloop .moment * { animation-iteration-count: infinite !important; animation-duration: 2.4s !important; }

/* ── Not happened yet (see SpecialMoment's pending) ───────────────────────────────────────────────────────────────────────
   Gerald, 5 November 2026: planned and travelling effects must be "clear that they haven't happened yet", showing "what is
   expected to happen without knowing what an enemy will do". Still, dashed and hollow, the landing area hatched, a dial of
   the rounds left; the same shape the moment will have when it happens, so the plan reads as a promise of that moment. */
.moment.pending { opacity: 0.8; }
.moment.pending * { animation: none !important; }
.moment.pending circle, .moment.pending polygon, .moment.pending path, .moment.pending ellipse, .moment.pending line {
    stroke-dasharray: 0.22 0.16;
    fill-opacity: 0;
}
.moment.pending .m-fill, .moment.pending .m-draw { stroke-dashoffset: 0; }
.moment.pending .m-out, .moment.pending .m-mote, .moment.pending .m-streak { opacity: 0.35; }
.pendingarea { stroke-width: 0.06; stroke-dasharray: 0.3 0.22; fill-opacity: 1; pointer-events: none; }
.pendingarea.white { stroke: var(--fx-defence); } .pendingarea.red { stroke: var(--fx-offence); }
.pendingarea.black { stroke: #8a90a0; } .pendingarea.purple { stroke: #b46cff; }
.pendingdial { pointer-events: none; }
.pendingdial .face { fill: #0b0f16; stroke-width: 0.06; }
.pendingdial .count { font-size: 0.55px; text-anchor: middle; font-family: var(--mono, monospace); font-weight: 600; }
.pendingdial.white .face { stroke: var(--fx-defence); } .pendingdial.white .count { fill: var(--fx-defence); }
.pendingdial.red .face { stroke: var(--fx-offence); } .pendingdial.red .count { fill: var(--fx-offence); }
.pendingdial.black .face { stroke: #8a90a0; } .pendingdial.black .count { fill: #8a90a0; }
.pendingdial.purple .face { stroke: #b46cff; } .pendingdial.purple .count { fill: #b46cff; }

/* A round's expected place next round, while planning: a faint copy of it and a dashed line there. Expected, not promised —
   the turn decides, and a round shot down first never gets there. */
.shot .nextline { stroke: #e8eefb; stroke-width: 0.05; stroke-dasharray: 0.2 0.18; opacity: 0.4; pointer-events: none; }
.shot .nextghost { opacity: 0.32; pointer-events: none; }
.shot .nexthit { fill: none; stroke: #e8eefb; stroke-width: 0.05; stroke-dasharray: 0.16 0.14; opacity: 0.55; pointer-events: none; }

/* A countdown as dots: lit for each round still to go. */
.countdots { pointer-events: none; }
.countdots circle { fill: none; stroke: #b46cff; stroke-width: 0.06; opacity: 0.7; }
.countdots circle.lit { fill: #b46cff; opacity: 1; }


/* <b>The Animations setting turned off</b> (AccountSettings.Still, 7 November 2026): every animation that loops forever, which is
   to say everything that moves for its own sake, held at its resting look. One-off moments are shortened to their end by the
   reduced-motion rules mirrored above; hulls and rounds moving between places are transitions and keep moving. Gathered from
   this sheet, so a new looping animation belongs on this list. */
:root.still .mawwhirl .mawlip,
:root.still .mawwhirl .whirl,
:root.still .shot.missile .plume,
:root.still .shot.antimatter polygon:not(.plume),
:root.still .shot.bursting polygon:not(.plume),
:root.still .shot .shotart .halo,
:root.still .shot .shotart .corering,
:root.still .shot .shotart .burstring,
:root.still .shot .shotart .hyperround .spin,
:root.still .lock,
:root.still .gatewayring,
:root.still .warpring.out,
:root.still .warpring.in,
:root.still .mark.cybernetic,
:root.still .distortion circle,
:root.still .distortion circle.pulling,
:root.still .fx.bubble,
:root.still .fx.mending rect,
:root.still .fx.ripple,
:root.still .fx.stasis,
:root.still .fx.phasering,
:root.still .fx.cage .outer,
:root.still .fx.cage .inner,
:root.still .fx.crackle line,
:root.still .combatant.cloaked,
:root.still .combatant.phasing,
:root.still .combatant.phased .fx.veil,
:root.still .well.outer,
:root.still .well.inner,
:root.still .riftring,
:root.still .markedarc,
:root.still .holewell,
:root.still .fightmark {
    animation: none !important;
}

/* ── Outposts on the map, since 9 November 2026 ───────────────────────────────────────────
   The outpost's own hex holds its defence, drawn as it fights, in the owner's colour, or nothing but its border when undefended. A passive
   structure is a halo in the six hexes round it, each in a colour of its own, so what an outpost carries is read without a
   right-click. Everything here is drawn in hex units — a hex's corner radius is one — so these widths are fractions of a hex.
   See OutpostField, StationForms and OutpostHalos. */
.postcentre { pointer-events: none; }
.postcentre .body { fill: color-mix(in srgb, var(--fleet) 45%, #070a12); stroke: var(--fleet); stroke-width: 0.045; stroke-linejoin: round; }
.postcentre .spine { fill: #0d1524; }
.postcentre .bridge { fill: #eef3fc; }
.postcentre .spar { fill: none; stroke: var(--fleet); stroke-width: 0.04; }
.postcentre .clockbadge { fill: #05070d; stroke: var(--fleet); stroke-width: 0.05; }
.postcentre .turnsleft { fill: #e8eefb; font-size: 0.42px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }

.posthalo { pointer-events: none; --h: var(--fleet); }
.posthalo.is-spy-station { --h: #e9eef8; }
.posthalo.is-gravity-well-projector { --h: #b98cff; }
.posthalo.is-colonial-exchange { --h: #f2c75c; }
.posthalo.is-holo-simulator { --h: #6fe6e0; }
.posthalo.is-star-gate { --h: var(--warp, #74d7ff); }
.posthalo.is-star-slipway { --h: #7ee081; }
.posthalo .ln { fill: none; stroke: var(--h); stroke-width: 0.07; stroke-linecap: round; stroke-linejoin: round; }
.posthalo .ln.heavy { stroke-width: 0.16; }
.posthalo .thin { fill: none; stroke: var(--h); stroke-width: 0.04; stroke-opacity: 0.7; }
.posthalo .thin.dashed { stroke-dasharray: 0.15 0.12; }
.posthalo .thin.faint { stroke-opacity: 0.3; }
.posthalo .thin.half { stroke-opacity: 0.6; }
.posthalo .fl { fill: var(--h); }
.posthalo .wash { fill: var(--h); fill-opacity: 0.1; }
.posthalo .wash.strong { fill-opacity: 0.28; }
.posthalo .ghost { fill: none; stroke: var(--h); stroke-width: 0.045; stroke-opacity: 0.6; stroke-dasharray: 0.12 0.08; }
.posthalo .scan { stroke: var(--h); stroke-width: 0.03; stroke-opacity: 0.35; }
.posthalo .box { fill: none; stroke: none; }
.posthalo.building { opacity: 0.5; }
.posthalo.building .ln, .posthalo.building .thin { stroke-dasharray: 0.16 0.12; }

/* The passive halos move, the defences never do: Gerald, "I would limit it to the passive effects ... rotation as the animation
   will work well on most of them, with only the gravity well and star gate needing something different." In steps of a tenth of
   a second, the Maw's beat, because anything moving inside the map's SVG repaints the whole map each time it moves; see
   .mawwhirl. Each halo reads the same standing still. */
.posthalo .moving.turn { transform-box: fill-box; transform-origin: center; animation: haloturn 36s steps(360) infinite; }
.posthalo .moving.turn.slow { animation-duration: 60s; animation-timing-function: steps(600); }
.posthalo .moving.fall { transform-box: fill-box; transform-origin: center; animation: halofall 3s steps(30) infinite; }
.posthalo .moving.shimmer { animation: haloshimmer 4s steps(40) infinite; }
@keyframes haloturn { to { transform: rotate(360deg); } }
@keyframes halofall { 0% { transform: scale(1.12); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(0.82); opacity: 0.2; } }
@keyframes haloshimmer { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .posthalo .moving { animation: none; } }
:root.still .posthalo .moving { animation: none !important; }

/* ── The Gateway and the Dimensional Rift on the map, since 11 November 2026 ─────────────────────────
   Gerald's picks from a sheet of four: the Ring gate for the Gateway and the Maw eye for the rift. Drawn in hex units (a hex's
   corner radius is one), so these widths are fractions of a hex. The turning parts step at the Maw's beat and stand still with
   animations off; see MapWorkArt. */
.workart { pointer-events: none; }
.workart .box { fill: none; stroke: none; }
.workart .turn { transform-box: fill-box; transform-origin: center; animation: workturn 24s steps(240) infinite; }
.workart .turn.back { animation-direction: reverse; animation-duration: 36s; animation-timing-function: steps(360); }
.workart .turn.fast { animation-duration: 9s; animation-timing-function: steps(90); }
@keyframes workturn { to { transform: rotate(360deg); } }
.gatewayart .glow { fill: var(--error); opacity: 0.3; }
.gatewayart .dial { fill: none; stroke: var(--fleet); stroke-width: 0.12; stroke-dasharray: 0.5 0.12; }
.gatewayart .rim { fill: none; stroke: var(--fleet); stroke-width: 0.06; }
.gatewayart .horizonrim { fill: none; stroke: var(--error); stroke-width: 0.06; stroke-dasharray: 0.22 0.1; }
.gatewayart .pylon { fill: var(--fleet); }
.gatewayart .horizon { fill: #1a0005; stroke: var(--error); stroke-width: 0.06; animation: workbreathe 3s steps(30) infinite; }
@keyframes workbreathe { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
.gatewayart.building .dial, .gatewayart.building .rim, .gatewayart.building .horizonrim { stroke-dasharray: 0.18 0.14; opacity: 0.55; }
.gatewayart.building .glow, .gatewayart.building .horizon { opacity: 0.25; animation: none; }
.riftart .glow { fill: #8b5cf6; opacity: 0.18; }
.riftart .arm { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.riftart .arm.red { stroke: var(--error); stroke-width: 0.07; opacity: 0.9; }
.riftart .arm.violet { stroke: #8b5cf6; stroke-width: 0.05; opacity: 0.85; }
.riftart .collar { fill: none; stroke: var(--error); stroke-width: 0.12; }
.riftart .stud { fill: var(--error); }
.riftart .heart { fill: #000; }
.riftmark.mine .riftart .collar, .riftmark.mine .riftart .stud { stroke: #e9d5ff; fill: #e9d5ff; }
.riftmark.mine .riftart .collar { fill: none; }
@media (prefers-reduced-motion: reduce) { .workart .turn, .gatewayart .horizon { animation: none; } }
:root.still .workart .turn, :root.still .gatewayart .horizon { animation: none !important; }

/* <b>The tutorial's and the hints' card</b>, since 17 November 2026 — see HintCard.razor. A note over the screen rather than a sheet:
   no veil, nothing under it stops working, and js/hints.js puts it beside what it is about (it starts hidden so it never flashes in
   the wrong place). Above the sheets and the battle screen, below the settings dialog, which a player may open from it. */
.hintcard {
    position: fixed;
    left: 0;
    top: 0;
    visibility: hidden;
    z-index: 25;
    width: min(22rem, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--accent);
    border-radius: 7px;
    padding: 0.7rem 0.85rem 0.75rem;
    box-shadow: 0 6px 28px color-mix(in srgb, var(--shade) 80%, transparent);
}

.hintcard.concept { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.hintcard .hinthead { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
.hintcard .hintfold { margin: 0 0 0.2rem; padding: 0 0.45rem; line-height: 1.3; }
/* The card folded away: a small tab in the lower left that opens it again. See HintCard. */
.hinttab {
    position: fixed;
    left: 0.6rem;
    bottom: 0.6rem;
    z-index: 25;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 3px 12px color-mix(in srgb, var(--shade) 70%, transparent);
}
.hintcard .hintkind { display: block; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.66rem; margin-bottom: 0.2rem; }
.hintcard h3 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.hintcard .hintbody p { margin: 0 0 0.45rem; font-size: 0.83rem; }
.hintcard .row { align-items: center; margin-top: 0.5rem; gap: 0.4rem; }
.hintcard .row .small { margin-top: 0; }
.hintcard .spacer { flex: 1 1 auto; }

/* The ring round what the card is pointing at. Drawn by js/hints.js on the page itself, and never in the way of a click. */
.hintring {
    position: fixed;
    z-index: 24;
    pointer-events: none;
    border: 2px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* ── Heritage Engineering's line on the research dialog ─────────────────────
 * Gerald, 19 November 2026: the rail row went, and the research dialog says what was chosen
 * ("choose one of 3, chosen: x"). A quiet card line when settled, the warn colour while owed. */
.heritageline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.45rem;
    width: 100%;
    margin: 0 0 0.6rem;
    padding: 0.4rem 0.7rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--ok);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.heritageline:hover { border-color: var(--accent); }
.heritageline .nm { font-weight: 600; }
.heritageline.owed { border-left-color: var(--warn); color: var(--warn); }

/* ── The right rail: rows that scroll, a foot that stays ────────────────────
 * Gerald, 19 November 2026: "Players should never have to scroll to see the end turn button... If
 * there is ever a need to scroll, have the right panel buttons be what scrolls." The rail stops being
 * the scrolling box; its rows are a .railscroll like the left rail's list, and the foot under them
 * holds the turn. Inside the foot the notes (and the replay's bar) scroll in their own box before the
 * submit button and Save orders above it give up any room. */
.rail.right { overflow: hidden; }

.rail.right > .railscroll { min-height: 4rem; }

.railfoot {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 0;
    max-height: 70%;
}

.rail > .railfoot { flex: 0 1 auto; }

.railfoot > * { flex: 0 0 auto; }

.railfoot > .railnotes,
.railfoot > .turnnotes {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    scrollbar-width: thin;
}

.railnotes:not(:has(*)), .turnnotes:not(:has(*)) { display: none; }

.railnotes > *, .turnnotes > * { flex: 0 0 auto; }

/* The charts' own head: what turn the figures run to, and the button that asks for them again. */
.charthead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem 0.6rem;
    margin: 0 0 0.4rem;
}

.charthead .pill[disabled] { opacity: 0.5; cursor: progress; }

/* ── The top bar's news and chat pills ──────────────────────────────────────
 * Gerald, 19 November 2026: chat "moved to the top panel, and use a color system when there is a new
 * message from outside the game, a new message from inside the game, a new message from one of your
 * vassals, or a new message from your overlord (similar to how the turn report has 2 colors)". The
 * pill takes the colour of the most important unread room and carries a dot for each. */
.hud .pill { white-space: nowrap; flex: 0 0 auto; }

.chatpill { display: inline-flex; align-items: center; gap: 0.25rem; }
.chatpill.new.outside { color: var(--accent); border-color: var(--accent); }
.chatpill.new.game { color: var(--warn); border-color: var(--warn); }
.chatpill.new.vassal { color: var(--ok); border-color: var(--ok); }
.chatpill.new.overlord { color: #c39bff; border-color: #c39bff; }

.chatdot { width: 0.5rem; height: 0.5rem; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.chatdot.outside { background: var(--accent); }
.chatdot.game { background: var(--warn); }
.chatdot.vassal { background: var(--ok); }
.chatdot.overlord { background: #c39bff; }

.newspill.new { color: var(--warn); border-color: var(--warn); }

.newslist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.newslist li {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    overflow-wrap: anywhere;
}
.newslist li .when { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.newslist li.fell, .newslist li.ending { border-left-color: var(--error); }
.newslist li.gateway { border-left-color: #8b5cf6; }
.newslist li.raid { border-left-color: var(--warn); }

/* ── The top bar on a narrow window ─────────────────────────────────────────
 * Found by PeekOverflow, 19 November 2026: at 900px the connection tag and the way back to the games
 * were drawn past the window's right edge, and "late game from turn N" wrapped to three lines over the
 * map. What gives way first is what is said elsewhere: the late-game line is the turn's own tooltip, the
 * zoom's two words are what the slider already shows, and the dots between items are spacing. */
.hud.top [data-testid=late-opens] { white-space: nowrap; }
.hud.top > * { flex-shrink: 0; }
.hud.top > .spacer { flex-shrink: 1; min-width: 0; }

@media (max-width: 1200px) {
    .hud.top { gap: 0.45rem; }
    .hud.top [data-testid=late-opens],
    .hud.top .zoom > .muted { display: none; }
    .hud.top .zoom input[type="range"] { width: 6rem; }
}

@media (max-width: 1000px) {
    .hud.top .sep { display: none; }
    .hud.top { padding-left: 0.6rem; padding-right: 0.6rem; }
}

/* ── Text that ran out of its box, found by PeekOverflow (19 November 2026) ─────────────────
 * Every button is nowrap (see button above), which is right for "Buy" and wrong for a sentence. */

/* Your seat: "Play it myself, with the AI's turn to look at" was 293px of text in a 111px button. */
.seatways .siegeoption { grid-template-columns: 11rem minmax(0, 1fr); }
.seatways .siegeoption button { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }

@media (max-width: 30rem) {
    .seatways .siegeoption { grid-template-columns: minmax(0, 1fr); }
}

/* The research screen's block headers: "SHIELDS AND DEFENSIVE SPECIALS" ran 13px past the column. */
.tieroffer .tiername { white-space: normal; overflow-wrap: anywhere; min-width: 0; }

/* A technology's name in a narrow block column wraps rather than running under its neighbour. */
button.techname { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }

/* The rail's government row: the chip beside the name stays one piece and the name gives way. */
.rail .row .nm .chip { white-space: nowrap; }
.rail .row .pop { overflow-wrap: anywhere; min-width: 0; }
.newslist li.surrender { border-left-color: var(--ok); }
.newslist li.contact { border-left-color: var(--muted); }
.newslist li.unread .what { font-weight: 600; }
.newslist li.boss { border-left-color: #8b5cf6; }

/* ── A galaxy event announced to every player (22 November 2026) ──────────────
 * A surrender or the mothership beaten: a compact sheet over every other sheet, the overlord's own surrender dialog
 * included, so it is what is read first. Edged in the news list's colour for the same kind. See AnnouncementCard. */
.overlay.announceover { z-index: 7; }
.sheet.announcesheet { border-top: 3px solid var(--ok); }
.sheet.announcesheet.boss { border-top-color: #8b5cf6; }
.announcesheet .announcement + .announcement { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.announcesheet .announcement h2 { font-size: 1rem; margin: 0 0 0.2rem; }
.announcesheet .announcewhen { margin: 0 0 0.3rem; }
.announcesheet .announcefigs { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.announcesheet .row { display: flex; align-items: center; margin-top: 0.9rem; }
.announcesheet .row .spacer { flex: 1 1 auto; }

/* Whether an empire-page figure is live or remembered, when the page mixes the two. */
.efig .figstamp { font-size: 0.68rem; font-style: normal; color: var(--muted); margin-left: 0.15rem; }
.efig .figstamp.live { color: var(--ok); }

/* ── The research dialog keeps its size, whatever it describes ──────────────
 * Gerald, 20 November 2026: the descriptions should "not cause it to change sizes". The detail
 * panel above the blocks and the lore beside them are fixed boxes that scroll inside themselves
 * rather than growing with a long description or story. */
.sheet.researchsheet .techdetail { height: 12rem; min-height: 0; overflow-y: auto; }
/* <b>The scrollbar's room kept whether or not it is there</b>, 21 November 2026. Gerald: "the research dialog animation and
 * lore panel is vibrating up and down rapidly." A story a line past the box brought the scrollbar in, which narrowed the square
 * art, which pulled the story back inside, which took the scrollbar away, and round again every frame. */
.sheet.researchsheet .techlore { height: min(32rem, 70vh); overflow-y: auto; scrollbar-gutter: stable; }
.techlore.empty .techlore-art { visibility: hidden; }

@media (max-width: 40rem) {
    .sheet.researchsheet .techlore { height: auto; max-height: 22rem; }
}

/* A hull that cannot be hurt this round: greyed, and not a target (its tooltip says why). See CombatRules.WhyUntouchable. */
.combatant.theirs.untargetable { filter: grayscale(1) brightness(0.75); cursor: not-allowed; }

/* A turn-report line about the whole galaxy rather than a place: read, not pressed. See GoToNotice. */
.report .line.still { display: block; cursor: default; }
.report .line.still:hover { background: transparent; }

/* ── Your line on the map: vassals, your overlord, fellow vassals ────────────
 * Gerald, 20 November 2026: "an empire that is a vassal to me needs to be clearly marked somehow on the
 * galaxy map as not being a current enemy of mine." A dashed green ring where an enemy's star wears the
 * claimed ring, the same ring round an ally's fleet, and their fleets and stations a little softer. */
.starlayer .sys > .claimed.allyring {
    stroke: var(--ok);
    stroke-dasharray: calc(var(--map-unit) * 0.9) calc(var(--map-unit) * 0.6);
    opacity: 0.95;
}
.fleet.ally .allyring {
    fill: none;
    stroke: var(--ok);
    stroke-width: calc(var(--map-unit) * 0.3);
    stroke-dasharray: calc(var(--map-unit) * 0.8) calc(var(--map-unit) * 0.5);
    pointer-events: none;
}
.fleet.ally { opacity: 0.8; }
.station.ally { opacity: 0.8; }

/* The map's key: who is who, and who is still to be beaten. */
.mapkey {
    position: absolute;
    top: calc(var(--hud-top) + 0.5rem);
    right: calc(var(--rail) + 0.6rem);
    z-index: 3;
    width: 15rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem 0.6rem;
    background: color-mix(in srgb, var(--chrome) 94%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.8rem;
}
.mapkey h3 { margin: 0 0 0.35rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mapkey ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.mapkey li { display: grid; grid-template-columns: 0.8rem minmax(0, 1fr) auto; align-items: center; gap: 0.45rem; }
.mapkey .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapkey .rel { font-size: 0.72rem; color: var(--error); }
.mapkey .rel.ally { color: var(--ok); }
.mapkey .rel.you, .mapkey .rel.gone { color: var(--muted); }

/* <b>The Maw for the empire that killed the mothership</b> (22 November 2026): still the mark of the galaxy's middle, faded, still,
   and taking no clicks, so the fleets it lets into the core are seen and picked over it. See Game's star list, BeyondTheMaw. */
.maw-beyond { pointer-events: none; }
.maw-beyond .mawwhirl { opacity: 0.22; }
.maw-beyond .mawwhirl, .maw-beyond .mawwhirl * { animation: none !important; }

/*
 * The AI's plan, on the screen as the player's own orders: a note above the turn's buttons saying so, with the way back.
 */
.plannedbar {
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: color-mix(in srgb, var(--accent) 10%, var(--panel));
    padding: 0.4rem 0.5rem;
    margin-bottom: 0.4rem;
}

.plannedbar p { margin: 0 0 0.3rem; }
.plannedbar button { width: 100%; }

.plangoals { margin: 0 0 0.35rem; }
.plangoals li {
    display: block;
    margin: 0.1rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.plannedbar { max-height: 40vh; overflow-y: auto; }
.goalchips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; margin: 0.3rem 0; }
.goalchips select { max-width: 100%; }
.plannedwhy { margin: 0.1rem 0 0.25rem; color: var(--accent); overflow-wrap: anywhere; }

/*
 * The AI rail and its areas — docs/plans/ai-guided-turn.md. The same marks in the rail and on the map: a colour and a symbol for
 * each kind of area, solid for the person's, dashed and faded for the AI's own.
 */
.rail.right .aihead { display: flex; align-items: center; justify-content: space-between; }
.airail { display: flex; flex-direction: column; gap: 0.5rem; padding: 0 0.1rem; }
.aisect h3 { margin: 0 0 0.25rem; font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.aichips { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.aichips .pill { white-space: nowrap; }
.pill.suggested { border-style: dashed; border-color: var(--accent); }
.aiverdict { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.3rem; font-size: 0.9rem; }
.aiverdict.agrees > span { color: var(--ok); }
.aiverdict.warns > span { color: var(--warn); }
.aiselected { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin: 0.35rem 0; padding: 0.3rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.aiselected.faded { opacity: 0.75; border-style: dashed; }
.aiselected input[type=range] { flex: 1 1 5rem; min-width: 0; }
.aiareas li { display: flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.25rem; border-radius: 4px; cursor: pointer; font-size: 0.8rem; }
.aiareas li .grow { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aiareas li.faded { opacity: 0.6; }
.aiareas li.selected { background: color-mix(in srgb, var(--accent) 18%, transparent); opacity: 1; }
.aiareas li.threat .grow { color: var(--warn); }
.glyph { display: inline-block; width: 1.1em; text-align: center; }

.glyph.explore, .area.explore { --area: #7fdbff; }
.glyph.attack, .area.attack { --area: #ff6b6b; }
.glyph.defend, .area.defend { --area: #5aa9ff; }
.glyph.improve, .area.improve { --area: #e3b341; }
.glyph.road, .area.road { --area: #b48cff; }
.glyph.expand, .area.expand { --area: #57c98b; }
.glyph { color: var(--area, var(--text)); }

.arealayer .area { cursor: pointer; pointer-events: none; }
.arealayer .area .ring { pointer-events: visibleStroke; }
.arealayer .area .markhit { fill: transparent; pointer-events: all; }
.arealayer .area .ring {
    fill: color-mix(in srgb, var(--area) 9%, transparent);
    stroke: var(--area);
    stroke-width: 2px;
    vector-effect: non-scaling-stroke;
}
.arealayer .area.suggested { opacity: 0.5; }
.arealayer .area.suggested .ring { stroke-dasharray: 6 5; }
.arealayer .area.picked { opacity: 1; }
.arealayer .area.picked .ring { stroke-width: 3.5px; fill: color-mix(in srgb, var(--area) 16%, transparent); }
.arealayer .area.threat .ring { stroke: var(--warn); }
.arealayer .area .mark { fill: var(--area); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.arealayer .areafleet { fill: none; stroke: var(--accent); stroke-width: 2px; vector-effect: non-scaling-stroke; pointer-events: none; }

/* The Stars dialog beside a star opened from its list: to the right, no backdrop, the map and the star's panel usable. */
.overlay.beside { background: transparent; pointer-events: none; justify-content: flex-end; }
.overlay.beside > .sheet { pointer-events: auto; width: min(44rem, 52vw); margin-right: calc(var(--rail) + 0.6rem); }
button.linkish { background: none; border: none; padding: 0; color: var(--text); cursor: pointer; text-align: left; }
button.linkish:hover { color: var(--accent); text-decoration: underline; }
/* And the whole height of the screen, whether or not a star stands beside it: Gerald, "the stars dialog should also probably take up
   the entire screen vertically (even if it doesnt horizontally, to leave room for a specific star's dialog)". */
.sheet.starssheet { height: calc(100vh - var(--header) - 1.2rem); max-height: none; }

/* The allegiance sheet's ledger: each empire across the line with its colour, government and the tribute between you. */
.lineledger td, .lineledger th { padding: 0.25rem 0.5rem; }
.lineledger .num { text-align: right; font-variant-numeric: tabular-nums; }
.lineledger tfoot td { border-top: 1px solid var(--line); }
.empiredot { display: inline-block; width: 0.7em; height: 0.7em; border-radius: 50%; background: var(--fleet, var(--accent)); margin-right: 0.4em; vertical-align: baseline; }

/* <b>Chat from anywhere</b> — a button in the corner of every page but a game's, opening the rooms the player is in. Gerald,
   2 December 2026: "regardless of what screen you are on, you should be able to access chat." See ChatDock. No backdrop blur, which
   costs frames (5 November 2026). */
.chatdock { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; }
.chatdock-button { box-shadow: 0 4px 14px rgb(0 0 0 / 45%); }
.chatdock-panel {
    width: min(28rem, calc(100vw - 2rem));
    max-height: min(36rem, calc(100vh - 2rem));
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 8px 28px rgb(0 0 0 / 55%);
}
.chatdock-panel .chatrooms { flex-wrap: wrap; }
.chatdock-panel .chatlog { flex: 1 1 auto; min-height: 8rem; overflow-y: auto; }
