/* Pod Pulse — direction C "war room": dark sea, clear colour states, slow
   transitions (>= 300 ms), no hairlines (areas are separated by background and
   spacing, not by 1 px borders). No external fonts or libraries. */

:root {
  --sea: #0b2740;
  --fog: #16324d;
  --hit: #c0392b;
  --miss: #1d4e78;
  --sunk: #3a1d1d;
  --ok: #16a085;
  --start: #f1c40f;
  --red: #7a1f1f;
  --blue: #1f4e7a;

  --abyss: #061622;
  --water: #123a5c;
  --ship: #5b7083;
  --feed: #081b2c;
  --text: #cfe3f5;
  --muted: #9fc3e6;
  --white: #ffffff;
  --leak: #e67e22;
  --repair: #5dade2;
  --warn: #ff8a80;
  --cell: clamp(30px, 3.3vw, 54px);
  --slow: 300ms;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--abyss);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3, h4 { margin: 0; color: var(--white); font-weight: 650; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
p { margin: 0 0 .6em; }
a { color: var(--repair); }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* ---------- header ---------- */
.hdr {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  background: var(--sea); padding: 10px 18px;
}
.brand { font-size: 1.15rem; font-weight: 700; color: var(--white); letter-spacing: .02em; }
.brand a { color: inherit; text-decoration: none; }
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 12px; background: var(--water);
  font-weight: 600; color: var(--white);
}
.chip.phase-battle { background: var(--ok); }
.chip.phase-paused, .chip.phase-launching { background: var(--start); color: #2b2300; }
.chip.phase-debrief { background: var(--miss); }
.chip.red, .pill.red, .team-red { background: var(--red); }
.chip.blue, .pill.blue, .team-blue { background: var(--blue); }
.timer { font-variant-numeric: tabular-nums; font-size: 1.25rem; font-weight: 700; color: var(--white); }
.timer.low { color: var(--warn); }
.spacer { flex: 1; }
.scorebar { display: flex; gap: 10px; align-items: center; }
.pill { padding: 4px 12px; border-radius: 14px; font-weight: 650; color: var(--white); font-variant-numeric: tabular-nums; }
.pill small { opacity: .8; font-weight: 500; margin-left: 4px; }
.conn { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); transition: background var(--slow); }
.conn.down { background: var(--hit); }
.me { color: var(--muted); }
.me b { color: var(--white); }

/* ---------- layout ---------- */
main { padding: 16px 18px 40px; max-width: 1700px; margin: 0 auto; }
.panel { background: var(--sea); border-radius: 10px; padding: 14px; }
.panel + .panel { margin-top: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.col { flex: 1 1 320px; min-width: 0; }
.stack > * + * { margin-top: 12px; }

.battle-player { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(240px, .8fr); gap: 14px; align-items: start; }
.battle-spec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(260px, .7fr); gap: 14px; align-items: start; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 1100px) {
  .battle-player, .battle-spec { grid-template-columns: 1fr; }
}

.banner {
  background: var(--fog); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; color: var(--white);
}
.banner.warn { background: var(--sunk); color: var(--warn); }
.banner.info { background: var(--miss); }
.center { text-align: center; padding: 60px 16px; }
.center h2 { font-size: 1.6rem; margin-bottom: 8px; }

/* ---------- buttons ---------- */
.btn {
  background: var(--miss); color: var(--white); border: 0; border-radius: 8px; padding: 7px 14px;
  cursor: pointer; font-weight: 600; transition: background var(--slow), opacity var(--slow);
}
.btn:hover:not(:disabled) { background: #2a669c; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--ok); }
.btn.primary:hover:not(:disabled) { background: #1abc9c; }
.btn.danger { background: var(--hit); }
.btn.danger:hover:not(:disabled) { background: #e04b3a; }
.btn.ghost { background: var(--water); }
.btn.tiny { padding: 2px 8px; font-size: .8rem; }
:focus-visible { outline: 2px solid var(--start); outline-offset: 2px; }

/* ---------- host bar ---------- */
.hostbar { background: var(--fog); padding: 10px 18px; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.hostbar .label { font-weight: 700; color: var(--start); text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; }
.hostbar input[type=text] {
  background: var(--abyss); border: 0; border-radius: 6px; padding: 6px 10px; min-width: 260px; color: var(--white);
}
.code { font: 700 1.3rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .18em; color: var(--white); background: var(--abyss); padding: 2px 10px; border-radius: 6px; }
.crew { flex-basis: 100%; }
.crew summary { cursor: pointer; color: var(--muted); }
.crew .plist { margin-top: 8px; }

/* ---------- lobby ---------- */
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .teams { grid-template-columns: 1fr; } }
.team { border-radius: 10px; padding: 14px; min-height: 160px; }
.team h3 { margin-bottom: 10px; }
.plist { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.plist li { background: rgba(0, 0, 0, .28); border-radius: 14px; padding: 4px 12px; color: var(--white); display: flex; gap: 8px; align-items: center; }
.plist li.mine { background: var(--white); color: #0b2740; font-weight: 700; }

/* ---------- shipyard ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.card {
  text-align: left; background: var(--water); border: 0; border-radius: 12px; padding: 14px; color: var(--text);
  display: flex; flex-direction: column; gap: 6px; transition: background var(--slow), box-shadow var(--slow);
}
button.card { cursor: pointer; }
button.card:hover:not(:disabled) { background: #1a4c77; }
button.card:disabled { cursor: default; }
.card .emoji { font-size: 2.2rem; line-height: 1; }
.card .name { font-weight: 700; color: var(--white); font-size: 1.05rem; }
.card .state { margin-top: auto; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card.on { background: #0f6b5c; box-shadow: inset 0 0 0 3px var(--ok); }
.card.on .state { color: var(--white); }
.budget { display: flex; align-items: center; gap: 12px; }
.pips { display: flex; gap: 6px; }
.pip { width: 26px; height: 12px; border-radius: 6px; background: var(--water); transition: background var(--slow); }
.pip.used { background: var(--ok); }
.pip.over { background: var(--hit); }

/* ---------- grids ---------- */
.gridwrap { display: inline-block; }
.grid { display: grid; gap: 3px; }
.grid .ax { color: var(--muted); font-size: .75rem; display: flex; align-items: center; justify-content: center; min-height: 18px; }
.c {
  width: var(--cell); height: var(--cell); background: var(--water); border: 0; padding: 0; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; font-size: calc(var(--cell) * .42); color: var(--text);
  transition: background var(--slow); position: relative;
}
.c.fog { background: var(--fog); }
.c.miss { background: var(--miss); color: #7fb2dd; font-size: calc(var(--cell) * .7); line-height: 1; }
.c.hit { background: var(--hit); color: var(--white); }
.c.sunk { background: var(--sunk); color: var(--warn); }
.c.noeffect { background: #5a3a2a; color: #ffd9a8; }
.c.ship { background: var(--ship); }
.c.ship-hit { background: var(--hit); color: var(--white); }
button.c { cursor: crosshair; }
.grid:not(.cooling) button.c:hover:not(:disabled) { background: #2a6aa0; }
.grid:not(.cooling) button.c.hit:hover:not(:disabled), .grid:not(.cooling) button.c.sunk:hover:not(:disabled) { filter: brightness(1.15); }
button.c:disabled { cursor: not-allowed; }
/* reloading: clicks do not fire (a toast says why), the grid is dimmed a little; the pointer still reaches the
   cells so the shot-history tooltips work while reloading */
.grid { transition: opacity var(--slow); }
.grid.cooling { opacity: .62; cursor: not-allowed; }
.grid.cooling button.c { cursor: not-allowed; }
/* shot history on the enemy grid: count badge, shield timer, ready again, last target */
.c .cnt {
  position: absolute; top: 2px; right: 2px; padding: 0 3px; border-radius: 3px; pointer-events: none;
  background: rgba(6, 22, 34, .72); color: var(--white); font-size: calc(var(--cell) * .22); font-weight: 700; line-height: 1.3;
}
.c .shield { display: flex; flex-direction: column; align-items: center; line-height: 1.05; font-size: calc(var(--cell) * .3); pointer-events: none; }
.c .shield b { font-size: calc(var(--cell) * .24); font-weight: 700; font-variant-numeric: tabular-nums; }
.c.shielded { background: #8e3a30; }
.c.strike { animation: strike 2.4s ease-in-out infinite alternate; } /* slow, subtle */
@keyframes strike { from { box-shadow: inset 0 0 0 0 rgba(22, 160, 133, 0); } to { box-shadow: inset 0 0 0 4px rgba(22, 160, 133, .9); } }
@media (prefers-reduced-motion: reduce) { .c.strike { animation: none; box-shadow: inset 0 0 0 4px rgba(22, 160, 133, .9); } }
.c.last { outline: 3px dashed var(--start); outline-offset: 1px; z-index: 1; }
.legend i.lg-strike { background: var(--hit); box-shadow: inset 0 0 0 3px var(--ok); }
.legend i.lg-last { background: var(--fog); outline: 2px dashed var(--start); outline-offset: 1px; }
.quickfire { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.quickfire .refire { font-weight: 650; }
kbd { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--water); color: var(--white); font: 600 .8rem/1.4 ui-monospace, monospace; }
.gridtitle { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }

/* ---------- weapons ---------- */
.weapons { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
.weapon {
  background: var(--water); border: 0; border-radius: 10px; padding: 8px 10px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; transition: background var(--slow), box-shadow var(--slow), opacity var(--slow);
}
.weapon:hover:not(:disabled) { background: #1a4c77; }
.weapon.sel { background: #1a4c77; box-shadow: inset 0 0 0 3px var(--start); }
.weapon:disabled { opacity: .45; cursor: not-allowed; }
.weapon .wi { font-size: 1.5rem; line-height: 1; }
.weapon .wn { font-weight: 700; color: var(--white); }
.weapon .wd { font-size: .78rem; color: var(--muted); }
.weapon .cd { font-weight: 700; color: var(--start); font-variant-numeric: tabular-nums; min-height: 1.2em; }

/* ---------- reload bars ---------- */
.reloads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-bottom: 10px; }
@media (max-width: 560px) { .reloads { grid-template-columns: 1fr; } }
.reload {
  display: grid; grid-template-columns: auto 1fr 4.2em; gap: 8px; align-items: center;
  background: rgba(0, 0, 0, .22); border-radius: 8px; padding: 6px 10px; transition: background var(--slow);
}
.rl-name { font-weight: 650; color: var(--white); white-space: nowrap; }
.rl-bar { display: block; height: 10px; background: var(--water); border-radius: 5px; overflow: hidden; }
.rl-fill { display: block; height: 100%; background: var(--start); } /* moved by script, linear, no transition */
.rl-txt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--start); }
.reload.ready { background: rgba(22, 160, 133, .25); }
.reload.ready .rl-fill { background: var(--ok); }
.reload.ready .rl-txt { color: var(--ok); letter-spacing: .06em; }
.reload.off { opacity: .45; }
.reload.off .rl-txt { color: var(--muted); font-weight: 500; font-size: .8rem; }

/* ---------- defences ---------- */
.deflist { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.def {
  display: grid; grid-template-columns: 2em minmax(0, 1fr) auto; gap: 10px; align-items: center;
  background: rgba(0, 0, 0, .22); border-radius: 8px; padding: 6px 10px; opacity: .55;
}
.def.on { background: #0f6b5c; box-shadow: inset 0 0 0 2px var(--ok); opacity: 1; }
.def-icon { font-size: 1.4rem; line-height: 1; text-align: center; }
.def-body { display: flex; flex-direction: column; min-width: 0; }
.def-name { font-weight: 700; color: var(--white); }
.def-name code { font: 600 .75rem ui-monospace, Menlo, Consolas, monospace; color: var(--muted); background: rgba(0, 0, 0, .3); padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.def.on .def-name code { color: var(--white); }
.def-desc { font-size: .8rem; color: var(--muted); }
.def.on .def-desc { color: var(--text); }
.def-state { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.def.on .def-state { color: var(--white); }
.teams > .panel + .panel { margin-top: 0; }

/* ---------- fleet rows ---------- */
.ships { display: flex; flex-direction: column; gap: 6px; }
.ship-row {
  display: grid; grid-template-columns: 14px minmax(70px, 1.1fr) minmax(70px, .9fr) minmax(90px, 1fr) 46px; gap: 8px; align-items: center;
  background: rgba(0, 0, 0, .22); border-radius: 8px; padding: 6px 10px;
}
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ship); transition: background var(--slow); }
.st-sailing .dot { background: var(--ok); }
.st-starting .dot { background: var(--start); }
.st-damaged .dot { background: var(--hit); }
.st-leaking .dot { background: var(--leak); }
.st-repairing .dot { background: var(--repair); }
.st-sunk .dot { background: var(--sunk); box-shadow: inset 0 0 0 2px var(--warn); }
.st-sunk { opacity: .7; }
.ship-name { font-weight: 650; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ship-name small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; }
.st-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.st-sailing .st-label { color: var(--ok); }
.st-starting .st-label { color: var(--start); }
.st-damaged .st-label { color: #ff7b6b; }
.st-leaking .st-label { color: var(--leak); }
.st-repairing .st-label { color: var(--repair); }
.st-sunk .st-label { color: var(--warn); }
.bar { height: 8px; background: var(--water); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ok); transition: width 500ms, background var(--slow); }
.bar > i.warm { background: var(--start); }
.bar > i.hot { background: var(--hit); }
.membar small { color: var(--muted); font-size: .7rem; display: block; }
.cargo { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; color: var(--white); }
@media (max-width: 560px) { .ship-row { grid-template-columns: 14px 1fr 1fr 40px; } .ship-row .membar { grid-column: 2 / -1; } }

/* ---------- ship's log ---------- */
.feed { background: var(--feed); border-radius: 8px; padding: 10px 12px; max-height: 520px; overflow-y: auto; font-size: .85rem; line-height: 1.55; }
.feed .e { padding: 1px 0; }
.feed .t { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.feed .k8s { color: #8fd0c4; }
.feed .game { color: var(--start); }
.feed .shot.red { color: #ff9d94; }
.feed .shot.blue { color: #8cc4f5; }
.feed .note { display: block; margin-left: 4.2em; color: var(--muted); font-size: .78rem; }

/* ---------- timeline / debrief ---------- */
.timeline svg { width: 100%; height: auto; display: block; }
.timeline .tl-cap { fill: var(--muted); font-size: 11px; }
.timeline .mark { font-size: 12px; }
.timeline .tl-ok { fill: var(--ok); }
.timeline .tl-lost { fill: var(--hit); }
.timeline h4 { margin: 10px 0 4px; }
.winner { font-size: 1.8rem; font-weight: 750; color: var(--white); padding: 18px; border-radius: 12px; text-align: center; margin-bottom: 14px; }
.winner.draw { background: var(--miss); }
.sunk-banner {
  text-align: center; font-size: 2.3rem; font-weight: 800; color: var(--white); padding: 22px 16px; border-radius: 12px;
  margin-bottom: 14px; background: var(--sea); box-shadow: inset 0 0 0 3px var(--start);
}
.sunk-banner span { display: inline-block; padding: 4px 18px; border-radius: 10px; margin: 4px; }
.sunk-banner .sb-red { background: var(--red); }
.sunk-banner .sb-blue { background: var(--blue); }
.sunk-banner small { display: block; font-size: 1rem; font-weight: 500; color: var(--muted); margin-top: 8px; }
.big { font-size: 1.7rem; font-weight: 750; color: var(--white); font-variant-numeric: tabular-nums; }
.kv { display: flex; gap: 22px; margin: 8px 0 12px; }
.kv div span { display: block; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
table.t { width: 100%; border-collapse: collapse; margin: 8px 0; }
table.t th, table.t td { text-align: left; padding: 5px 8px; font-variant-numeric: tabular-nums; }
table.t th { color: var(--muted); font-weight: 600; font-size: .8rem; }
table.t tr:nth-child(even) td { background: rgba(0, 0, 0, .18); }
ul.notes { margin: 6px 0 0; padding-left: 20px; }
ul.notes li { margin-bottom: 4px; }
.headline { text-align: center; font-size: 1.3rem; font-weight: 700; color: var(--white); margin: -4px 0 14px; }
.panel.actions { margin-bottom: 14px; }
.panel.actions + .teams { margin-top: 0; }

/* ---------- rules, fleet status, action counts ---------- */
.rules { background: var(--fog); border-radius: 8px; padding: 8px 14px; margin: 0 0 14px; }
.panel + .rules { margin-top: 14px; }
.rules h4 { margin-bottom: 2px; }
.rules p { margin: 0; color: var(--text); }
.alerts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.alert { flex: 1 1 320px; border-radius: 8px; padding: 10px 14px; font-weight: 750; font-size: 1.15rem; color: var(--white); font-variant-numeric: tabular-nums; }
.alert.down { background: var(--hit); box-shadow: inset 0 0 0 3px var(--start); }
.alert.down.alert-red { background: var(--red); }
.alert.down.alert-blue { background: var(--blue); }
.alert.armed { background: var(--sea); color: var(--start); font-size: 1rem; }
.fleethead { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.inaction { font-weight: 700; color: var(--ok); font-variant-numeric: tabular-nums; }
.inaction.none { color: var(--warn); }
.mystats { margin: -2px 0 10px; font-weight: 650; color: var(--white); font-variant-numeric: tabular-nums; }
.pill small.acts { margin-left: 10px; }
.coords { color: var(--start); font-weight: 700; }
.hint { margin: 6px 0 0; }
.ship-row[data-cells] { cursor: default; }
.ship-row.hl { box-shadow: inset 0 0 0 2px var(--start); }
.c.hl { box-shadow: inset 0 0 0 3px var(--start); }

/* ---------- join + login ---------- */
.joinbox { max-width: 420px; margin: 12vh auto 0; background: var(--sea); border-radius: 14px; padding: 26px; }
.joinbox h1 { margin-bottom: 10px; }
.joinbox label { display: block; margin: 14px 0 6px; color: var(--muted); }
.joinbox input[type=text], .joinbox input[type=password] {
  width: 100%; border: 0; border-radius: 8px; padding: 10px 12px; background: var(--abyss); color: var(--white); font-size: 1.05rem;
}
.joinbox .btn { margin-top: 16px; width: 100%; padding: 10px; font-size: 1.05rem; }
.err { color: var(--warn); min-height: 1.4em; margin-top: 10px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--white); color: #0b2740;
  padding: 9px 18px; border-radius: 22px; font-weight: 650; opacity: 0; pointer-events: none; transition: opacity var(--slow);
  max-width: 90vw; z-index: 10;
}
.toast.show { opacity: 1; }
.toast.bad { background: var(--hit); color: var(--white); }

/* ---------- guide button (header of every page) ---------- */
.guide-btn {
  display: inline-block; padding: 3px 12px; border-radius: 12px; background: var(--water); color: var(--white);
  font-weight: 650; font-size: .9rem; text-decoration: none; transition: background var(--slow);
}
.guide-btn:hover { background: #2a669c; }

/* ---------- guide page ---------- */
/* Colour groups: control plane blue, traffic path green, ships sea, protections amber, weapons red,
   observability grey. --gb = box background, --ga = accent (left stripe, Kubernetes name). */
.g-control { --gb: #1b4670; --ga: #7cc0f0; }
.g-traffic { --gb: #0f5e52; --ga: #4be0b8; }
.g-ship { --gb: #31506a; --ga: #b9d4ea; }
.g-protection { --gb: #5a4810; --ga: #f1c40f; }
.g-weapon { --gb: #6a2222; --ga: #ff8a80; }
.g-observe { --gb: #3a444e; --ga: #c7d1da; }
.g-game { --gb: #3b2a5c; --ga: #c9a7ff; }
.g-sim { --gb: #4a2140; --ga: #ff8fdc; }
/* Kinds of entries: Kubernetes = solid stripe, game rule = dashed violet border, simulated = dotted pink border. */
.n-k8s { --nc: #7cc0f0; }
.n-game { --nc: #c9a7ff; }
.n-sim { --nc: #ff8fdc; }

main.guide { max-width: 1400px; }
.guide h2 { margin-bottom: 10px; }
.steps { margin: 0; padding-left: 1.4em; }
.steps > li { margin-bottom: 8px; padding-left: 4px; }
.steps .rules { margin: 6px 0; }
.steps .rules p + p { margin-top: 4px; }

.dg {
  position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 46px; row-gap: 44px;
  padding: 36px 30px 6px 0; margin-top: 8px;
  grid-template-areas:
    "gate    warroom  command  orders   legend"
    "faults  dispatch torpedo  builders storm"
    "faults  hmaster  .        .        light"
    "fence   harbour  harbour  harbour  light"
    "rules   rules    rules    rules    rules"
    "sims    sims     sims     sims     sims";
}
.dg-cell { min-width: 0; position: relative; z-index: 1; }
.dg-gate { grid-area: gate; display: flex; flex-direction: column; gap: 26px; }
.dg-warroom { grid-area: warroom; }
.dg-command { grid-area: command; }
.dg-orders { grid-area: orders; }
.dg-legend { grid-area: legend; }
.dg-faults { grid-area: faults; }
.dg-dispatch { grid-area: dispatch; }
.dg-torpedo { grid-area: torpedo; }
.dg-builders { grid-area: builders; }
.dg-storm { grid-area: storm; }
.dg-hmaster { grid-area: hmaster; }
.dg-light { grid-area: light; align-self: center; }
.dg-fence { grid-area: fence; align-self: center; }
.dg-harbour { grid-area: harbour; }
.dg-rules { grid-area: rules; }
.dg-sims { grid-area: sims; margin-top: -26px; }

.gbox {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 9px 13px; border-radius: 10px;
  background: var(--gb, var(--water)); box-shadow: inset 4px 0 0 var(--ga, var(--muted));
  color: var(--text); text-decoration: none; transition: filter var(--slow);
}
.gbox:hover { filter: brightness(1.15); }
.gbox.n-game { box-shadow: none; border: 2px dashed var(--nc); }
.gbox.n-sim { box-shadow: none; border: 2px dotted var(--nc); }
.nbadge {
  display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .03em; line-height: 1.3; white-space: nowrap;
  padding: 0 6px; border-radius: 7px; color: var(--nc); background: rgba(0, 0, 0, .3);
}
.gbox .nbadge { align-self: flex-end; margin: -2px -3px 0 0; }
.nlegend { list-style: none; margin: 8px 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .85rem; }
.nlegend li { display: flex; align-items: center; gap: 8px; }
.nswatch { flex: none; width: 30px; height: 18px; border-radius: 5px; background: var(--water); }
.nlegend .n-k8s .nswatch { box-shadow: inset 4px 0 0 var(--nc); }
.nlegend .n-game .nswatch { border: 2px dashed var(--nc); }
.nlegend .n-sim .nswatch { border: 2px dotted var(--nc); }
.dg-minis { display: flex; flex-direction: column; gap: 8px; }
.dg-minis .gbox { padding: 5px 8px 6px 10px; }
.dg-minis .gb-term { font-size: .85rem; }
.dg-minis .gb-does { font-size: .75rem; }
.dg-band { border-radius: 14px; padding: 10px 12px 12px; background: rgba(59, 42, 92, .4); }
.dg-band .dg-cap { color: #c9a7ff; }
.dg-band.sim { background: rgba(74, 33, 64, .45); }
.dg-band.sim .dg-cap { color: #ff8fdc; }
.dg-minis.dg-rulegrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.gb-term { color: var(--white); font-size: .98rem; }
.gb-k8s { font: 600 .78rem ui-monospace, Menlo, Consolas, monospace; font-style: normal; color: var(--ga, var(--muted)); }
.gb-does { font-size: .82rem; line-height: 1.35; }
.dg-browser {
  align-self: center; padding: 5px 14px; border-radius: 16px; background: var(--fog); color: var(--white); font-weight: 650;
}
.dg-cap { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.dg-group { border-radius: 12px; padding: 8px; background: rgba(106, 34, 34, .35); display: flex; flex-direction: column; gap: 10px; }
.dg-group .dg-cap { margin-bottom: 0; color: #ffb3ab; }
.dg-sea { border-radius: 14px; padding: 10px 12px 12px; background: #0d3150; box-shadow: inset 0 0 0 3px #1d4e78; }
.dg-sea-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 54px; row-gap: 30px;
  grid-template-areas: "ship insp hold" "dock prot prot";
}
.dg-ship { grid-area: ship; }
.dg-insp { grid-area: insp; }
.dg-hold { grid-area: hold; }
.dg-dock { grid-area: dock; align-self: start; }
.dg-prot { grid-area: prot; }
.dg-prot .dg-cap { color: var(--start); }
.dg-badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dg-badges .gbox { padding: 6px 8px 7px 11px; }
.dg-badges .gb-term { font-size: .88rem; }
.dg-badges .gb-does { font-size: .76rem; }
.dg-key { list-style: none; margin: 0; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .22); display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; font-size: .74rem; line-height: 1.2; }
.dg-key li { display: flex; align-items: center; gap: 8px; }
.dg-key li::before { content: ""; width: 14px; height: 14px; border-radius: 4px; background: var(--gb); box-shadow: inset 3px 0 0 var(--ga); }

.dg-svg { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; overflow: visible; }
.fl { fill: none; stroke-width: 2.5; }
.fl.k-traffic { stroke: #4be0b8; }
.fl.k-control { stroke: #7cc0f0; }
.fl.k-ship { stroke: #b9d4ea; }
.fl.k-weapon { stroke: #ff8a80; stroke-dasharray: 7 5; }
.fl.k-observe { stroke: #c7d1da; stroke-dasharray: 2 5; stroke-linecap: round; }
.ah.k-traffic { fill: #4be0b8; }
.ah.k-control { fill: #7cc0f0; }
.ah.k-ship { fill: #b9d4ea; }
.ah.k-weapon { fill: #ff8a80; }
.ah.k-observe { fill: #c7d1da; }
.dg-lbl {
  position: absolute; z-index: 3; font-size: .72rem; font-weight: 700; line-height: 1.2; white-space: nowrap;
  background: var(--sea); padding: 1px 5px; border-radius: 5px; pointer-events: none;
}
.dg-lbl.at-above { transform: translate(-50%, calc(-100% - 3px)); white-space: normal; max-width: 52px; text-align: center; }
.dg-lbl.at-below { transform: translate(-50%, 3px); }
.dg-lbl.at-right { transform: translate(5px, -50%); }
.dg-lbl.at-center { transform: translate(-50%, -50%); }
.dg-lbl.k-traffic { color: #4be0b8; }
.dg-lbl.k-control { color: #7cc0f0; }
.dg-lbl.k-ship { color: #b9d4ea; }
.dg-lbl.k-weapon { color: #ff8a80; }
.dg-lbl.k-observe { color: #c7d1da; }
@media (max-width: 1060px) {
  .dg, .dg-sea-grid { grid-template-columns: 1fr; grid-template-areas: none; padding: 0; gap: 12px; }
  .dg-cell, .dg-sea-grid > * { grid-area: auto; }
  .dg-badges, .dg-minis.dg-rulegrid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

table.gloss td { vertical-align: top; }
table.gloss tr.gsec th {
  padding-top: 14px; color: var(--ga); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; background: none;
}
table.gloss tbody tr:not(.gsec) td:first-child { box-shadow: inset 4px 0 0 var(--ga); padding-left: 12px; }
table.gloss tr.n-game td:first-child { box-shadow: none; border-left: 4px dashed var(--nc); }
table.gloss tr.n-sim td:first-child { box-shadow: none; border-left: 4px dotted var(--nc); }
table.gloss td.gl-term .nbadge { margin-left: 4px; vertical-align: 1px; }
table.gloss tbody tr:not(.gsec) td { background: rgba(0, 0, 0, .18); }
table.gloss tbody tr:not(.gsec):nth-child(odd) td { background: rgba(0, 0, 0, .3); }
table.gloss code { font: 600 .8rem ui-monospace, Menlo, Consolas, monospace; color: var(--ga); }
table.gloss .gl-try { color: var(--muted); }
table.gloss tr[id] { scroll-margin-top: 80px; }
table.gloss tr:target td { background: #4a3d10; color: var(--white); }

/* the "?" on the shipyard cards opens the protection's glossary row */
.cardwrap { position: relative; display: flex; }
.cardwrap > .card { flex: 1; }
.card-help {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; background: rgba(0, 0, 0, .35); color: var(--white); font-weight: 800;
  text-decoration: none; transition: background var(--slow);
}
.card-help:hover { background: var(--miss); }
