/* THE BATTLE FOR BLOCKSPACE — dark CRT-war aesthetic.
   Committed single dark look (a war terminal). Palette per SPEC. All motion
   is gated behind .reduced-motion (set on <body> by main.js) so the shake/
   scanline/flash effects can be disabled for prefers-reduced-motion. */

:root {
  --bg: #0b0e14;
  --bg-2: #11151f;
  --bg-3: #171c28;
  --line: #263042;
  --orange: #ff6b35;
  --magenta: #ff3df5;
  --gold: #f7b32b;
  --steel: #9fb4c7;
  --ink: #e6edf3;
  --ink-dim: #8595a8;
  --green: #3ddc84;
  --red: #ff4d4d;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono",
    "Consolas", "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle CRT scanline wash over the whole page. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.14) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}
body.reduced-motion::after { display: none; }

a { color: var(--gold); }
a:hover { color: var(--orange); }

h1, h2, h3 { margin: 0; letter-spacing: 0.04em; }

/* ---------- header ---------- */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "titles controls" "status status";
  gap: 6px 16px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
}
.header-titles { grid-area: titles; min-width: 0; }
.site-title {
  font-size: clamp(20px, 3.6vw, 34px);
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 0 8px rgba(255, 107, 53, 0.55), 0 0 2px rgba(255, 61, 245, 0.4);
}
.subtitle {
  margin: 4px 0 0;
  color: var(--magenta);
  font-size: 13px;
  min-height: 1.4em;
}
.header-controls {
  grid-area: controls;
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-line {
  grid-area: status;
  margin: 0;
  color: var(--ink-dim);
  font-size: 12px;
}

.live-badge {
  font-weight: 700;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 3px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.live-badge.is-live { color: var(--green); }
.live-badge.is-live { animation: pulse 2s ease-in-out infinite; }
.live-badge.is-degraded { color: var(--gold); }
.live-badge.is-down { color: var(--red); }
body.reduced-motion .live-badge { animation: none !important; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- buttons ---------- */
.btn-ghost, .btn-link, .btn-close {
  font-family: var(--mono);
  cursor: pointer;
  background: transparent;
  color: var(--steel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 10px;
  font-size: 12px;
}
.btn-ghost:hover, .btn-close:hover { color: var(--ink); border-color: var(--steel); }
.btn-link {
  border: none;
  color: var(--gold);
  text-decoration: underline;
  padding: 0;
}
.btn-close { font-size: 15px; line-height: 1; padding: 4px 8px; }

/* ---------- doomsday clock ---------- */
.doomsday {
  padding: 10px 20px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
}
.doomsday-lines { display: flex; flex-direction: column; gap: 2px; }
.dc-primary {
  margin: 0;
  color: var(--orange);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
}
.dc-secondary { margin: 0; color: var(--ink-dim); font-size: 12px; }
.dc-signaling { margin: 2px 0 0; color: var(--steel); font-size: 12px; }
.doomsday-bar {
  margin-top: 8px;
  height: 6px;
  background: #0a0d13;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.doomsday-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  transition: width 0.6s ease;
}
body.reduced-motion .doomsday-bar-fill { transition: none; }

/* ---------- scoreboard ---------- */
.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px 20px;
}
.tile {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.tile-num {
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.tile-label { font-size: 11px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.03em; }
.tile-label em { color: var(--steel); font-style: normal; }
.tile-spam { border-left-color: var(--magenta); }
.tile-spam .tile-num { color: var(--magenta); }
.tile-infil { border-left-color: var(--steel); }
.tile-infil .tile-num { color: var(--steel); }
.tile-observed { border-left-color: var(--orange); }
.tile-observed .tile-num { color: var(--orange); }
.tile-pure { border-left-color: var(--gold); }
.tile-pure .tile-num { color: var(--gold); }
.tile-gag { border-left-color: var(--red); }
.tile-gag .tile-num { color: var(--red); }

/* Per-tile "?" help affordance: pure-CSS tooltip via attr(data-tip), no JS.
   Keyboard/tap accessible because it's a real <button>. */
.tile-help {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  cursor: help;
  opacity: 0.55;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tile-help:hover,
.tile-help:focus-visible {
  opacity: 1;
  color: var(--ink);
  border-color: var(--steel);
  outline: none;
}
.tile-help::before,
.tile-help::after {
  content: '';
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  pointer-events: none;
}
.tile-help::after {
  content: attr(data-tip);
  width: max-content;
  max-width: 260px;
  white-space: normal;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  z-index: 20;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.tile-help::before {
  top: calc(100% + 1px);
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--bg-3);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
  z-index: 21;
}
.tile-help:hover::before,
.tile-help:hover::after,
.tile-help:focus-visible::before,
.tile-help:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

/* ---------- stage: battlefield + kill feed ---------- */
.stage {
  display: flex;
  gap: 12px;
  padding: 0 20px 14px;
  align-items: stretch;
}
.battlefield-wrap {
  flex: 1 1 auto;
  min-width: 0;
  height: 55vh;
  background: #05070c;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
#battlefield { display: block; width: 100%; height: 100%; }

.killfeed-rail {
  flex: 0 0 320px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.rail-title {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--orange);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-3);
}
.kill-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1 1 auto;
}
.kill-empty { padding: 14px 12px; color: var(--ink-dim); font-size: 12px; }
.kill-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 12px;
}
.kill-row:hover { background: var(--bg-3); }
.kill-emoji { font-size: 18px; line-height: 1; }
.kill-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.kill-proto { color: var(--magenta); text-transform: uppercase; font-weight: 700; }
.kill-bytes { color: var(--ink); }
.kill-tag { color: var(--ink-dim); font-style: italic; }
.kill-txid { color: var(--gold); font-size: 11px; word-break: break-all; }

/* ---------- ticker ---------- */
.ticker-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 20px 14px;
  padding: 8px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  border-radius: 4px;
}
.ticker-tag {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--orange);
  text-transform: uppercase;
}
.ticker { margin: 0; color: var(--ink); font-size: 13px; min-width: 0; }
.ticker-flash { animation: tickerIn 0.4s ease; }
body.reduced-motion .ticker-flash { animation: none; }
@keyframes tickerIn { from { opacity: 0.15; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------- dossier ---------- */
.dossier {
  position: fixed;
  top: 0; right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  background: var(--bg-2);
  border-left: 2px solid var(--orange);
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.dossier.open { transform: translateX(0); }
.dossier[hidden] { display: flex; } /* keep transform transition; .open toggles */
body.reduced-motion .dossier { transition: none; }
.dossier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-3);
}
.dossier-title { font-size: 15px; color: var(--ink); word-break: break-word; }
.dossier-body { padding: 14px; overflow-y: auto; flex: 1 1 auto; font-size: 13px; }
.dossier-verdict {
  padding: 8px 10px;
  border-radius: 3px;
  font-weight: 700;
  margin: 0 0 12px;
}
.dossier-verdict.ok { background: rgba(61, 220, 132, 0.12); color: var(--green); border: 1px solid var(--green); }
.dossier-verdict.bad { background: rgba(255, 61, 245, 0.1); color: var(--magenta); border: 1px solid var(--magenta); }
.dossier-field {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dotted var(--line);
}
.dossier-field .k { color: var(--ink-dim); text-transform: uppercase; font-size: 11px; }
.dossier-field .v { color: var(--ink); text-align: right; word-break: break-word; }
.dossier-block { margin-top: 14px; }
.dossier-block h3 { font-size: 12px; color: var(--orange); text-transform: uppercase; margin-bottom: 6px; }
.rule-list { margin: 0; padding-left: 18px; }
.rule-list li { margin-bottom: 8px; }
.rule-text { display: block; color: var(--steel); font-size: 12px; margin: 2px 0; }
.rule-detail { display: block; color: var(--ink); font-size: 12px; }
.dossier-clean { color: var(--steel); font-style: italic; margin: 12px 0; }
.payload {
  background: #05070c;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px;
  overflow-x: auto;
  font-size: 11px;
  color: var(--green);
  white-space: pre-wrap;
  word-break: break-all;
}
.dossier-link { margin-top: 14px; }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 5, 9, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--bg-2);
  border: 1px solid var(--orange);
  border-radius: 6px;
  max-width: 720px;
  width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-3);
}
.modal-head h2 { font-size: 17px; color: var(--orange); }
.modal-body { padding: 18px; overflow-y: auto; font-size: 13.5px; }
.modal-body h3 { color: var(--gold); font-size: 14px; margin: 18px 0 6px; }
.modal-body ul { padding-left: 20px; }
.modal-body li { margin-bottom: 6px; }
.quotes {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--magenta);
  background: var(--bg-3);
  color: var(--steel);
}
.quotes p { margin: 6px 0; font-style: italic; }
.links { font-size: 12.5px; }
.disclaimer { margin-top: 16px; color: var(--ink-dim); font-size: 12px; border-top: 1px solid var(--line); padding-top: 12px; }

/* ---------- footer ---------- */
.site-footer {
  padding: 16px 20px 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 12px;
}
.site-footer p { margin: 4px 0; }

/* ---------- responsive: rails collapse under 900px ---------- */
@media (max-width: 900px) {
  .stage { flex-direction: column; }
  .battlefield-wrap { height: 55vh; }
  .killfeed-rail {
    flex: 0 0 auto;
    max-width: none;
    max-height: 200px;
  }
  /* Kill feed becomes a horizontal scrolling strip on mobile. */
  .kill-feed {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .kill-row {
    flex: 0 0 220px;
    border-bottom: none;
    border-right: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .site-header { grid-template-columns: 1fr; grid-template-areas: "titles" "controls" "status"; }
  .header-controls { justify-content: flex-start; }
  .battlefield-wrap { height: 48vh; }
  .dossier { width: 100vw; }
}

/* =========================================================================
   TRENCH CHAT (Nostr) — appended by the chat builder.
   Right-rail panel under the kill feed on desktop; floating bottom sheet
   under 900px. All motion gated behind body.reduced-motion.
   ========================================================================= */

/* Rail now stacks the kill feed (top) and the chat panel (bottom). It stretches
   to the battlefield height via .stage's align-items:stretch. */
.rail {
  flex: 0 0 320px;
  max-width: 320px;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Rail children split the vertical space by flex-grow (basis 0) so neither the
   kill feed's nor the chat's natural content forces the rail wider than 55vh on
   tall screens. Their min-heights un-tie the rail from 55vh: on short (laptop)
   heights the min-heights win and the rail grows past the battlefield rather
   than crushing the chat's fixed chrome. Chat gets the larger grow share. */
.rail .killfeed-rail {
  flex: 2 1 0;
  max-width: none;
  min-width: 0;
  min-height: 140px;
}

/* Chat panel shell (matches tile/rail patterns). min-height covers the full
   fixed chrome (head that wraps to 2 lines at 320px + status + identity +
   composer + channel-id footer, ~200px) plus a usable message list, so the
   composer and SPEC-required channel-id footer are never clipped. */
.trench-chat {
  flex: 3 1 0;
  min-width: 0;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
/* Disabled / not-yet-built chat leaves the section empty: hide it entirely so
   the kill feed reclaims the rail. */
.trench-chat:empty { display: none; }

.tc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-3);
}
.tc-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--orange);
  text-transform: uppercase;
}
.tc-chip { font-size: 11px; color: var(--magenta); letter-spacing: 0.04em; }
.tc-presence {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.tc-presence b { color: var(--green); font-variant-numeric: tabular-nums; }
.tc-close {
  display: none; /* shown only in the mobile sheet */
  font-family: var(--mono);
  cursor: pointer;
  background: transparent;
  color: var(--steel);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 14px;
  line-height: 1;
  padding: 2px 7px;
}
.tc-close:hover { color: var(--ink); border-color: var(--steel); }

.tc-status {
  padding: 5px 12px;
  font-size: 11px;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}
.tc-status.jammed { color: var(--red); }

.tc-messages {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
}
.tc-empty { color: var(--ink-dim); font-style: italic; padding: 8px 2px; }

.tc-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 2px 4px;
  border-radius: 3px;
}
.tc-row.mine { background: rgba(255, 107, 53, 0.08); }
.tc-nick {
  flex: 0 0 auto;
  font-weight: 700;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-nick::after { content: ":"; color: var(--ink-dim); font-weight: 400; }
.tc-text {
  min-width: 0;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.tc-row.state-pending { opacity: 0.72; }
.tc-row.state-failed .tc-text { color: var(--ink-dim); }
.tc-badge { flex: 0 0 auto; color: var(--red); font-size: 12px; cursor: help; }

.tc-hint {
  padding: 5px 12px;
  font-size: 11.5px;
  color: var(--steel);
  border-top: 1px solid var(--line);
}
.tc-hint.warn { color: var(--gold); }
.tc-hint.err { color: var(--red); }
.tc-hint.ok { color: var(--green); }

.tc-identity {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11.5px;
  color: var(--ink-dim);
  border-top: 1px solid var(--line);
}
.tc-you { font-weight: 700; }
.tc-edit, .tc-nick-save, .tc-nick-cancel {
  font-family: var(--mono);
  cursor: pointer;
  background: transparent;
  color: var(--steel);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 11px;
  line-height: 1;
  padding: 2px 6px;
}
.tc-edit:hover, .tc-nick-save:hover, .tc-nick-cancel:hover { color: var(--ink); border-color: var(--steel); }
.tc-nick-save:hover { color: var(--green); border-color: var(--green); }
.tc-nick-input {
  font-family: var(--mono);
  background: #05070c;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 16px; /* ≥16px: iOS Safari auto-zooms on focus of sub-16px inputs */
  min-width: 0;
  flex: 1 1 auto;
}
.tc-nick-input:focus { outline: none; border-color: var(--orange); }

.tc-composer {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  background: var(--bg-3);
}
.tc-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  background: #05070c;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 7px 9px;
  font-size: 16px; /* ≥16px: iOS Safari auto-zooms on focus of sub-16px inputs */
}
.tc-input::placeholder { color: var(--ink-dim); }
.tc-input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 1px rgba(255, 107, 53, 0.4); }
.tc-input.shake { animation: tcShake 0.32s ease; }
body.reduced-motion .tc-input.shake { animation: none; }
@keyframes tcShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.tc-send {
  flex: 0 0 auto;
  font-family: var(--mono);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--bg);
  background: var(--orange);
  border: 1px solid var(--orange);
  border-radius: 3px;
  padding: 0 12px;
  font-size: 12px;
  min-width: 68px;
}
.tc-send:hover:not(:disabled) { background: var(--gold); border-color: var(--gold); }
.tc-send:disabled { cursor: default; opacity: 0.55; background: var(--bg-2); color: var(--ink-dim); border-color: var(--line); }

.tc-footer {
  padding: 7px 12px 9px;
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
}
.tc-micro { margin: 0; font-size: 10.5px; font-style: italic; line-height: 1.35; }
.tc-channel { margin: 3px 0 0; font-size: 10.5px; }
.tc-channel-id {
  font-family: var(--mono);
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--gold);
  text-decoration: underline dotted;
  padding: 0;
  font-size: 10.5px;
}
.tc-channel-id:hover { color: var(--orange); }

/* Floating mobile toggle — hidden on desktop, shown under 900px. */
.tc-fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--orange);
  background: radial-gradient(circle at 30% 30%, var(--magenta), var(--orange));
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 150;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}
.tc-fab.has-unread::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
}

/* ---------- mobile: chat becomes a bottom sheet ---------- */
@media (max-width: 900px) {
  .rail { flex: 0 0 auto; max-width: none; }
  .rail .killfeed-rail { flex: 0 0 auto; max-height: 200px; }

  .tc-fab { display: inline-flex; }
  .tc-close { display: inline-flex; }

  .trench-chat {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: min(72vh, 560px);
    max-width: none;
    border-radius: 12px 12px 0 0;
    border: 1px solid var(--orange);
    border-bottom: none;
    box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.55);
    transform: translateY(102%);
    transition: transform 0.28s ease;
    z-index: 160;
  }
  body.chat-sheet-open .trench-chat { transform: translateY(0); }
  body.reduced-motion .trench-chat { transition: none; }
}

/* =========================================================================
   WAR DRUMS toggle — ghost button in the header controls. OFF reads like any
   other ghost button; ON lights the gold accent (matches the pure-gold tiles).
   ========================================================================= */
.music-toggle { white-space: nowrap; letter-spacing: 0.02em; }
.music-toggle.is-on {
  color: var(--gold);
  border-color: var(--gold);
  text-shadow: 0 0 6px rgba(247, 179, 43, 0.5);
}
.music-toggle.is-on:hover { color: var(--gold); border-color: var(--gold); }
