/* Culture War: dark lab-glass panels over a glowing petri dish. --gold is the accent (a fluorescent lime).
   Culture names and the title are set in italic serif, as the dish labels its binomials (render/overlay.js);
   everything else is a plain sans with tabular figures. Pictures over words: the glyphs (.g) are drawn the way
   the dish draws the things they stand for, and detail lives in title attributes. */
:root {
  --ink: #e6efe4;
  --dim: #93a6a0;
  --gold: #c4ef5e;
  --amber: #f0be5a;
  --panel: rgba(9, 17, 18, 0.84);
  --line: rgba(255, 255, 255, 0.09);
  --good: #7fd69b;
  --bad: #ff7b6b;
  --war: #ff5a45;
  --serif: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #070c0d; color: var(--ink); font: 13px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif; user-select: none; }
#map, #overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#map { cursor: grab; touch-action: none; }
#map:active { cursor: grabbing; }
#overlay { pointer-events: none; }
/* The interface size (prefs.js): #ui is laid out on a screen 1/scale as big, then scaled up to fill the real one. */
#ui { position: fixed; top: 0; left: 0; width: calc(100% / var(--ui-scale, 1)); height: calc(100% / var(--ui-scale, 1)); transform: scale(var(--ui-scale, 1)); transform-origin: 0 0; pointer-events: none; container-type: size; }
#ui > * { pointer-events: auto; }
button, select, input { font: inherit; color: inherit; }
button { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); }
button:disabled { opacity: 0.4; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button.on { background: var(--gold); color: #17130a; border-color: transparent; font-weight: 700; }
button.primary { background: var(--gold); color: #17130a; border-color: transparent; font-weight: 700; padding: 8px 18px; }
button.primary:hover { background: #d8f88f !important; }
[hidden] { display: none !important; }
h3 { display: flex; align-items: baseline; gap: 6px; margin: 12px 0 6px; font-size: 11.5px; font-weight: 600; color: var(--dim); }
h3:first-child { margin-top: 0; }
.hint { color: var(--dim); font-size: 12px; font-weight: 400; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }
.panel { position: absolute; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; backdrop-filter: blur(8px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); }
/* Culture names: binomials, in italics. */
.nation, .topbar .title, .powers .name, .card .title, .save b, .winner b { font-family: var(--serif); font-style: italic; }

/* glyphs (ui/glyphs.js) */
.g { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; }
.g.cell { width: 14px; height: 14px; vertical-align: -2px; background: radial-gradient(circle, #f4ffe8 0 20%, rgba(196, 239, 94, 0.75) 36%, rgba(196, 239, 94, 0) 72%); }
.g.killer { width: 9px; height: 9px; margin: 0 2px; vertical-align: 0; background: var(--war); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 0 6px rgba(255, 90, 69, 0.55); }
.g.nutrient { width: 10px; height: 10px; margin: 0 2px; vertical-align: 0; background: var(--amber); border-radius: 0 50% 50% 50%; transform: rotate(45deg); box-shadow: 0 0 6px rgba(240, 190, 90, 0.45); }
.g.nucleus { width: 18px; height: 18px; color: #fff; background: radial-gradient(circle, #0a0e0c 0 30%, currentColor 33%); box-shadow: 0 0 0 2.5px rgba(0, 0, 0, 0.75), 0 0 0 4px rgba(255, 255, 255, 0.16); }
.g.pie { width: 15px; height: 15px; vertical-align: -2px; background: conic-gradient(var(--c, var(--gold)) calc(var(--p, 0) * 1turn), rgba(255, 255, 255, 0.12) 0); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.g.vir { display: inline-flex; align-items: flex-end; gap: 2px; width: auto; height: 16px; border-radius: 0; }
.g.vir b { width: 4px; border-radius: 1px; background: rgba(255, 255, 255, 0.18); }
.g.vir b:nth-child(1) { height: 5px; }
.g.vir b:nth-child(2) { height: 8px; }
.g.vir b:nth-child(3) { height: 12px; }
.g.vir b:nth-child(4) { height: 16px; }
.g.vir b.on { background: var(--war); }
.keys { display: inline-flex; gap: 3px; }
kbd { display: inline-block; min-width: 20px; padding: 3px 6px 2px; border-radius: 5px; text-align: center; font: 600 11px/1.2 system-ui, -apple-system, sans-serif; color: var(--ink); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); border-bottom-width: 2px; }

/* top bar */
.topbar { position: absolute; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 22px; padding: 0 12px; background: linear-gradient(rgba(6, 12, 13, 0.92), rgba(6, 12, 13, 0.7)); border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.topbar .me { display: flex; align-items: center; gap: 10px; min-width: 190px; cursor: pointer; white-space: nowrap; }
.topbar .me .swatch { width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 255, 255, 0.15); }
.topbar .title { font-weight: 700; font-size: 16px; margin-right: 8px; }
.topbar .age { color: var(--gold); font-size: 12px; }
.agebar { height: 4px; width: 180px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.agebar i { display: block; height: 100%; background: var(--gold); transition: width 0.3s; }
.stat { display: flex; align-items: center; gap: 6px; white-space: nowrap; cursor: default; }
.stat .value { font-size: 17px; font-weight: 700; }
.stat .sub { font-size: 11.5px; color: var(--dim); }
.stat .sub.bad { color: var(--bad); }
.spacer { flex: 1; }
.perf { color: #5f6b78; font-size: 11px; white-space: nowrap; }
.time { display: flex; align-items: center; gap: 4px; }
.clock { font-size: 18px; font-weight: 700; min-width: 54px; text-align: right; margin-right: 6px; font-variant-numeric: tabular-nums; }
.time button { padding: 4px 8px; min-width: 32px; }
.burger { padding: 4px 10px; font-size: 16px; }
.stat.click { cursor: pointer; }
.stat.click:hover .value { color: var(--gold); }
body.watching .topbar .stat, body.watching .dock, body.watching .mutations { display: none; }
body.attract .topbar, body.attract .panel, body.attract .corner, body.attract .mutations, body.attract .decisions, body.attract .alerts { display: none; }

/* your mutations: icon badges under the top bar, like relics (detail on hover) */
.mutations { position: absolute; top: 60px; left: 12px; display: flex; flex-wrap: wrap; gap: 5px; max-width: 50%; }
.mutations:empty { display: none; }
.mut { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; font-size: 17px; line-height: 1; cursor: help;
  background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.12), rgba(9, 17, 18, 0.9) 70%); border: 1.5px solid var(--line); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45); animation: rise 0.35s ease-out; }
.mut:hover { transform: scale(1.12); }
.mut.growth { border-color: rgba(127, 214, 155, 0.6); }
.mut.wealth { border-color: rgba(240, 190, 90, 0.65); }
.mut.war { border-color: rgba(255, 90, 69, 0.6); }
.mut.defence { border-color: rgba(120, 170, 255, 0.6); }

/* bottom-left corner: the log (two lines, or the history panel) over the dock */
.corner { position: absolute; left: 12px; bottom: 12px; width: 300px; display: flex; flex-direction: column; gap: 8px; pointer-events: none !important; }
.corner > * { pointer-events: auto; }
.corner > .log { pointer-events: none; }
.corner.reading .log { display: none; }
.dock { position: static; padding: 8px 10px 9px; }
.dock h3 { margin: 0 0 6px; }
.dock h3 .income { margin-left: auto; color: var(--amber); font-weight: 700; font-variant-numeric: tabular-nums; cursor: default; }
.dock h3 .income.bad { color: var(--bad); }
.dock h3 .count { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; cursor: default; }
.dock .segmented { margin-bottom: 0; }
.trade { margin-top: 5px; font-size: 11.5px; color: var(--dim); line-height: 1.35; }
.trade b { color: var(--ink); }
.trade.lv2 b { color: #f6b17a; }
.trade.lv3 b { color: #ff8a78; }
.trade:empty { display: none; }
.trade.bad { color: var(--bad); }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-bottom: 8px; }
.segmented button { border-radius: 0; padding: 7px 0; font-size: 12px; border-right-width: 0; }
.segmented button:first-child { border-radius: 6px 0 0 6px; }
.segmented button:last-child { border-radius: 0 6px 6px 0; border-right-width: 1px; }
.segmented button.on:nth-child(3) { background: #f09a55; }
.segmented button.on:nth-child(4) { background: var(--war); color: #fff; }
.dock .tired:empty { display: none; }
/* Frenzy exhaustion, under the virulence buttons */
.exhaust { height: 3px; margin-top: 3px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; }
.exhaust i { display: block; height: 100%; width: 0; background: var(--war); transition: width 0.3s; }
.dock .hint { margin-top: 4px; }
/* where the army is: a bar split by place; on your panel a full bar is the killers your virulence calls for */
.armybar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.armybar i { display: block; height: 100%; transition: width 0.4s; }
.armybar .front { background: var(--war); }
.armybar .marching { background: #f09a55; }
.armybar .garrison { background: #6f8fb8; }
.armybar .abroad { background: var(--gold); }
.armyline { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 5px; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.armyline span { cursor: default; }
.armyline .front b { color: #ff8a78; }
.armyline .marching b { color: #f6b17a; }
.armyline .garrison b { color: #9db6d6; }
.armyline .abroad b { color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { background: rgba(196, 239, 94, 0.1); border: 1px solid rgba(196, 239, 94, 0.3); border-radius: 12px; padding: 1px 8px; font-size: 12px; cursor: default; }
.tools { display: flex; gap: 6px; margin-top: 8px; }
.dock .strike { flex: 1; display: flex; align-items: center; gap: 7px; text-align: left; padding: 5px 10px; }
.dock .strike .cost { margin-left: auto; color: var(--dim); font-weight: 700; font-variant-numeric: tabular-nums; }
.dock .strike .cost.bad { color: var(--bad); }
.dock .strike.on { background: #9ff5df; color: #062; }
.dock .strike.on .cost { color: #062; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); font-size: 12px; font-weight: 700; cursor: default; }
.rows .row, .powers .row { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 5px; cursor: pointer; position: relative; }
.rows .row:hover, .powers .row:hover { background: rgba(255, 255, 255, 0.07); }
.row .note { margin-left: auto; color: var(--dim); font-size: 12px; }
.row.war .icon { color: var(--war); }
.nation { font-weight: 700; }
.trend.gaining { color: var(--good); }
.trend.losing { color: var(--bad); }

/* powers */
.powers { top: 64px; right: 12px; width: 280px; font-variant-numeric: tabular-nums; }
.powers h3 .goal { margin-left: auto; color: var(--gold); cursor: default; }
.powers h3 .hint { font-size: 10.5px; }
.powers .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.powers .row.me .name { font-weight: 700; color: #fff; }
.powers .row.me .swatch { border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.powers .row.sel { background: rgba(255, 255, 255, 0.1); }
.powers .icon { color: var(--war); font-size: 12px; min-width: 16px; text-align: right; }
.powers .age { color: var(--gold); font-size: 11px; min-width: 20px; text-align: center; }
.powers .share { min-width: 36px; text-align: right; font-weight: 700; }
.powers .bar { position: absolute; left: 4px; bottom: 0; height: 2px; border-radius: 1px; opacity: 0.9; max-width: calc(100% - 8px); }

/* nation card */
.card { right: 12px; bottom: 12px; width: 300px; display: none; }
.card.on { display: block; }
.card .head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.card .head .swatch { width: 28px; height: 28px; border-radius: 50%; }
.card .head > div { flex: 1; }
.card .title { display: block; font-size: 18px; font-weight: 700; line-height: 1.2; }
.card .kind { font-size: 12px; color: var(--dim); }
.card .kind.war { color: var(--war); }
.card .kind.ally { color: var(--good); }
.card .x { border: 0; background: none; font-size: 20px; padding: 0 6px; color: var(--dim); }
.card table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.card th { text-align: left; font-weight: 400; color: var(--dim); font-size: 12px; padding: 2px 0; }
.card td { text-align: right; font-weight: 700; }
.card tr:first-child th { text-align: right; font-size: 11px; }
/* strength as a tug of war, your colour against theirs, with a tick at even */
.tug { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; cursor: default; }
.tug .bar { position: relative; flex: 1; display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.tug .bar i { display: block; height: 100%; transition: width 0.4s; }
.tug .mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(5, 10, 11, 0.9); }
.card .army { margin-top: 10px; }
.card .army h3 { margin: 0 0 5px; }
.card .front { margin-top: 4px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: default; }
.card .front:empty { display: none; }
.ties { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; font-size: 12px; }
.ties:empty { display: none; }
.ties .icon { margin-right: 5px; }
.card .actions { display: none; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.card.foreign .actions { display: flex; }
.card .actions button { flex: 1; white-space: nowrap; padding: 7px 8px; }
.card button.war { background: rgba(255, 90, 69, 0.2); border-color: rgba(255, 90, 69, 0.5); }
.card button.war:hover:not(:disabled) { background: var(--war); color: #fff; }
.card .actions + .hint { margin-top: 6px; min-height: 18px; }

/* decisions */
.decisions { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(640px, calc(100% - 660px)); min-width: 420px; pointer-events: none !important; }
.decisions > * { pointer-events: auto; }
.edicts:empty, .offers:empty { display: none; }
.edicts { background: var(--panel); border: 1px solid rgba(196, 239, 94, 0.55); border-radius: 12px; padding: 10px 12px 12px; backdrop-filter: blur(8px); box-shadow: 0 0 0 3px rgba(196, 239, 94, 0.12), 0 10px 40px rgba(0, 0, 0, 0.5); animation: rise 0.35s ease-out; width: 100%; }
.banner { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-bottom: 10px; color: var(--dim); cursor: default; }
.banner b { color: var(--gold); font: italic 700 19px var(--serif); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.edict { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px; text-align: center; border-radius: 9px; transition: transform 0.12s; }
.edict .icon { font-size: 26px; line-height: 1; margin-bottom: 2px; }
.edict b { font-size: 13.5px; }
.edict .fx { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.edict:hover { border-color: var(--gold) !important; transform: translateY(-2px); }
.edict.war { border-color: rgba(255, 90, 69, 0.35); }
.edict.war .fx { color: #ff8a78; }
.edict.growth { border-color: rgba(127, 214, 155, 0.35); }
.edict.growth .fx { color: var(--good); }
.edict.wealth { border-color: rgba(240, 190, 90, 0.4); }
.edict.wealth .fx { color: var(--amber); }
.edict.defence { border-color: rgba(120, 170, 255, 0.35); }
.edict.defence .fx { color: #9db6d6; }
.offers { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.offer { position: relative; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; overflow: hidden; animation: rise 0.3s ease-out; backdrop-filter: blur(8px); }
.offer > div { flex: 1; }
.offer > .icon { font-size: 18px; }
.offer .yes { background: rgba(127, 214, 155, 0.25); border-color: rgba(127, 214, 155, 0.5); }
.offer .terms { font-size: 11.5px; color: var(--dim); }
.offer .terms .free { color: var(--good); }
.decisions .more { pointer-events: none; text-shadow: 0 1px 3px #000; }
.offer .timer { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--gold); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* log, alerts, tooltip */
.log { display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 3px #000, 0 0 8px #000; }
.log .line { transition: opacity 3s; animation: rise 0.3s ease-out; }
.log .line.prev { opacity: 0.4; animation: none; }
.log .line.old { opacity: 0.55; }
.log .when, .history .when { color: var(--dim); font-variant-numeric: tabular-nums; font-size: 11px; }
/* Enter: the whole log of the match, and a line to type in */
.history { position: static; display: flex; flex-direction: column; padding: 8px 10px; max-height: min(420px, 55cqh); user-select: text; }
.history h3 { margin: 0 0 6px; }
.history h3 .x { margin-left: auto; border: 0; background: none; padding: 0 4px; font-size: 16px; line-height: 1; color: var(--dim); }
.history .lines { flex: 1; min-height: 60px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.history .say { margin-top: 8px; width: 100%; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.alerts { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.alert { padding: 7px 16px; border-radius: 20px; font-weight: 700; cursor: pointer; animation: rise 0.3s ease-out; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); white-space: nowrap; }
.alert.war { background: var(--war); color: #fff; }
.alert.good { background: var(--good); color: #062; }
.alert.lab { background: #f0c25e; color: #2a1d05; }
.alert.phage { background: #9a5cc8; color: #fff; }
body.targeting #map { cursor: crosshair; }
.tip { position: absolute; top: 0; left: 0; display: flex; align-items: center; gap: 10px; background: rgba(6, 12, 13, 0.92); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; white-space: nowrap; opacity: 0; pointer-events: none !important; font-variant-numeric: tabular-nums; }
.tip.on { opacity: 1; }
.tip span { display: inline-flex; align-items: center; gap: 4px; color: var(--dim); }

/* menus */
.menu { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(5, 10, 11, 0.5), rgba(5, 10, 11, 0.88)); }
.menu.on { display: flex; }
.sheet { width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; background: rgba(8, 16, 17, 0.9); border: 1px solid var(--line); border-radius: 14px; padding: 28px 32px; box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6); backdrop-filter: blur(10px); }
.sheet h1 { margin: 0; font: italic 700 44px/1.05 var(--serif); }
.sheet h2 { margin: 0 0 14px; font: italic 700 28px/1.1 var(--serif); }
.sheet p.bad { margin: 0 0 12px; }
.tag { color: var(--gold); margin: 6px 0 20px; font-size: 15px; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; margin: 6px 0 12px; }

/* The title: no box. A column on the left, the live dish breathing on the right. */
.menu.for-title { justify-content: flex-start; background: linear-gradient(90deg, rgba(5, 10, 11, 0.94) 0, rgba(5, 10, 11, 0.8) 520px, rgba(5, 10, 11, 0.15) 900px, rgba(5, 10, 11, 0)); }
.sheet.title { width: min(500px, calc(100% - 48px)); max-height: calc(100% - 48px); margin-left: clamp(24px, 7cqw, 120px); padding: 4px 8px 4px 0; background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; }
.brand { display: flex; align-items: center; gap: 18px; }
.sheet.title h1 { white-space: nowrap; font-size: 64px; letter-spacing: -0.01em; color: #f1ffe6; text-shadow: 0 0 22px rgba(196, 239, 94, 0.4), 0 0 2px rgba(196, 239, 94, 0.7); }
.sheet.title .tag { margin: 10px 0 26px; color: var(--dim); font-size: 15px; }
/* The emblem: a petri dish with three cultures in it. */
.dish { flex: none; width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(220, 240, 245, 0.55);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.06), inset -6px -8px 14px rgba(0, 0, 0, 0.45), 0 0 16px rgba(196, 239, 94, 0.25);
  background:
    radial-gradient(circle at 33% 38%, #ff6f5e 0 15%, rgba(255, 111, 94, 0.35) 17%, transparent 27%),
    radial-gradient(circle at 66% 34%, #6fc3ff 0 12%, rgba(111, 195, 255, 0.35) 14%, transparent 23%),
    radial-gradient(circle at 52% 70%, #c4ef5e 0 16%, rgba(196, 239, 94, 0.35) 18%, transparent 28%),
    radial-gradient(circle at 35% 30%, #4a3a1f, #2a2112 70%); }
.resume:empty { display: none; }
.resume { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; padding: 10px 14px 10px 10px; border: 1px solid rgba(196, 239, 94, 0.4); border-radius: 12px; background: rgba(196, 239, 94, 0.06); }
.resume .primary { padding: 10px 20px; }
.save { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.save b { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save > span { color: var(--dim); font-size: 12px; }
.save .clock { font-size: 12px; color: var(--ink); margin: 0; }
.setup { display: grid; grid-template-columns: 52px 1fr; gap: 12px 12px; align-items: center; margin: 0 0 8px; }
.field { display: contents; }
.lbl { color: var(--dim); font-size: 12px; }
.sizes { display: flex; gap: 6px; }
button.size { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px 0 9px; font-variant-numeric: tabular-nums; }
.plate { flex: none; width: var(--d); height: var(--d); border-radius: 50%; border: 1.5px solid rgba(220, 240, 245, 0.55); background: radial-gradient(circle at 38% 36%, rgba(196, 239, 94, 0.35), rgba(196, 239, 94, 0.04) 70%); }
button.size.on .plate { border-color: rgba(23, 19, 10, 0.75); background: radial-gradient(circle at 38% 36%, rgba(23, 19, 10, 0.35), rgba(23, 19, 10, 0.05) 70%); }
.colours { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.colours button.colour { width: 24px; height: 24px; padding: 0; border-radius: 50%; font-size: 12px; line-height: 1; border: 2px solid transparent; background: var(--s, rgba(255, 255, 255, 0.07)); }
.colours button.colour:hover:not(:disabled) { background: var(--s, rgba(255, 255, 255, 0.15)); }
.colours button.colour.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6), 0 0 10px var(--s, transparent); color: #17130a; }
.colours button.colour:first-child.on { background: rgba(255, 255, 255, 0.25); color: var(--ink); }
.setup input { width: 120px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-variant-numeric: tabular-nums; }
.setup .buttons { grid-column: 1 / -1; margin: 10px 0 0; }
.setup .go { padding: 12px 44px; font-size: 17px; }
.setup .buttons { align-items: center; }
.setup .more { margin-left: auto; }
.sheet.title .brand { margin-bottom: 26px; }
/* The field guide: six glyphs, a word and a few more each (detail on hover). */
.guide { display: grid; grid-template-columns: 1fr; gap: 12px; }
.entry { display: grid; grid-template-columns: 28px auto 1fr; column-gap: 8px; align-items: baseline; }
.entry .pic { grid-row: span 2; align-self: start; display: flex; align-items: center; justify-content: center; height: 28px; font-size: 20px; }
.entry .line { color: var(--gold); font-size: 11.5px; }
.entry .detail { grid-column: 2 / -1; margin: 2px 0 0; color: #c9c5b8; font-size: 12px; line-height: 1.4; }
.entry .pic .g.pie { width: 22px; height: 22px; }
.entry .pic .g.nucleus { width: 20px; height: 20px; }
.entry b { font-size: 13px; line-height: 1.2; }
.entry kbd { padding: 1px 4px 0; font-size: 10px; min-width: 0; }
.foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
button.tab { padding: 4px 10px; font-size: 12px; }
.version { margin-left: auto; color: #5f6b78; font-size: 11px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.stepper button { padding: 2px 0; width: 26px; }
.stepper .val { min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; }
.stepper .lbl { margin-right: 2px; }
button.toggle { padding: 4px 10px; font-size: 12px; }
.drawer:empty { display: none; }
.drawer { margin-top: 12px; padding: 14px; background: rgba(8, 16, 17, 0.9); border: 1px solid var(--line); border-radius: 10px; max-height: 42cqh; overflow: auto; }
.controls { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.controls h3 { margin: 0 0 8px; font-size: 15px; }
.keygrid { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: 12px; }
.keygrid i { color: var(--dim); font-style: normal; font-size: 11px; }
.changelog ul { margin: 0 0 8px; padding-left: 18px; color: #c9c5b8; }
.changelog h3 { margin-top: 12px; }

/* pause and end screens */
.sheet.victory h1 { color: var(--gold); }
.sheet.defeat h1 { color: var(--bad); }
.sheet.end .tag .clock { font-size: 22px; color: var(--ink); text-align: left; }
.stats { display: flex; flex-wrap: wrap; gap: 14px 26px; margin: 0 0 18px; }
.stats div { display: flex; flex-direction: column; line-height: 1.2; }
.stats b { font-size: 26px; color: var(--gold); font-variant-numeric: tabular-nums; }
.stats span { color: var(--dim); font-size: 12px; }
.winner { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--dim); }
.winner b { color: var(--ink); }
.fatal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }

/* Container queries on #ui, not media queries: they see the layout's width at the chosen interface size. */
@container (max-width: 1320px) {
  .perf, .stat .sub { display: none; }
}
@container (max-width: 1100px) {
  .corner { width: 260px; }
  .powers { width: 210px; }
  .decisions { width: calc(100% - 24px); min-width: 0; bottom: 60px; }
}
@container (max-width: 640px) {
  .sheet.title h1 { font-size: 46px; }
  .controls { grid-template-columns: 1fr; }
}

/* controller pointer */
.padcursor { position: fixed; top: -11px; left: -11px; width: 22px; height: 22px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 255, 255, 0.5); pointer-events: none; z-index: 10; display: none; }
.padcursor.on { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* The host body (sim/src/immune.rs): where the match is set, and the immune system in the dock. */
button.place { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px 0 10px; }
button.place .emoji { font-size: 18px; }
.dock .immune { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
.dock .immune .nodes { color: #e6dcff; letter-spacing: 1px; font-size: 11px; cursor: default; }
.immuneline { font-size: 12px; color: var(--dim); }
.immuneline.notice { margin-top: 2px; cursor: default; }
.immuneline b.bad { color: var(--bad); }
.immuneline b { color: #e6dcff; font-variant-numeric: tabular-nums; }
.immuneline .bad { color: var(--bad); }
.antibody { height: 3px; margin-top: 5px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; }
.antibody i { display: block; height: 100%; width: 0; background: #b48cff; transition: width 0.3s; }

/* Hover text (src/ui/tooltip.js): instant, follows live numbers. */
.hovertip { position: fixed; top: 0; left: 0; z-index: 50; max-width: 340px; padding: 6px 9px; border-radius: 6px; background: rgba(6, 12, 13, 0.95); border: 1px solid var(--line); color: var(--ink); font-size: 12px; line-height: 1.4; white-space: pre-line; pointer-events: none; opacity: 0; transition: opacity 0.08s; }
.hovertip.on { opacity: 1; }
/* Frenzy's button fills with exhaustion. */
.dock .segmented button.tired { background-image: linear-gradient(to top, rgba(255, 100, 80, 0.35) calc(var(--ex, 0) * 100%), transparent 0); }
