/* ============================================================================
   CleaNZBot "Night Ops" theme (2026-09-25).

   Fonts are served from /fonts (SIL Open Font License, see THIRD_PARTY_NOTICES.md);
   the portal's content security policy loads nothing from other hosts.
   The original variable names (--gold, --panel …) are kept and point at the new
   palette, so every page restyles without code changes. Colour meaning:
     lime (--gold / --accent)  main actions and "changes the live game"
     money gold (--money)       cash and gold
     blue / orange / red        PvE / excursion / PvP, as on the in-game map
     green / grey / red status  works / untested / doesn't work
   ========================================================================= */
@font-face { font-family: 'Chakra Petch'; font-weight: 500; font-display: swap; src: url(/fonts/chakra-petch-500.woff2) format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-weight: 600; font-display: swap; src: url(/fonts/chakra-petch-600.woff2) format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-weight: 700; font-display: swap; src: url(/fonts/chakra-petch-700.woff2) format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-weight: 400 700; font-display: swap; src: url(/fonts/hanken-grotesk.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url(/fonts/jetbrains-mono-500.woff2) format('woff2'); }

:root {
  --bg: #090c0a;
  --panel: #0f1411;
  --panel-2: #151c17;
  --panel-3: #1b241d;
  --line: #243029;
  --line-2: #33443a;
  --text: #f0f5ec;
  --muted: #93a397;
  --faint: #5f6e63;
  --gold: #b5e550;
  --gold-2: #d2f58a;
  --accent: #b5e550;
  --accent-ink: #0d1405;
  --accent-soft: #16200f;
  --money: #ffc94d;
  --money-soft: #2e2610;
  --olive: #6b7a4a;
  --danger: #ff6b61;
  --danger-soft: #231110;
  --ok: #5fe08a;
  --ok-soft: #12301c;
  --warn: #ffc94d;
  --warn-soft: #1d180b;
  --pve: #4d9bff;
  --pve-soft: #17365f;
  --exc: #ff9a3c;
  --exc-soft: #3d2410;
  --pvp: #ff5f57;
  --pvp-soft: #3a1715;
  --radius: 14px;
  --font-body: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  color-scheme: dark;
  font: 15px/1.5 var(--font-body);
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 10px; padding: 9px 16px; min-height: 38px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
button:hover:not(:disabled) { filter: brightness(1.08); }
button.ghost, nav button, .secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.danger { background: var(--danger-soft); color: #ffb0a8; border: 1px solid #5e2622; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: .01em; }
code, .mono { font-family: var(--font-mono); font-size: 12px; }

.eyebrow { margin: 0; color: var(--gold); letter-spacing: .16em; font-size: 11px; }
.mark { color: var(--muted); text-align: center; font-size: 12px; }

#workspace { display: grid; grid-template-columns: 72px 236px 1fr; min-height: 100vh; }
#workspace.no-sections { grid-template-columns: 236px 1fr; }
#workspace.no-sections .sections { display: none; }
.sections { background: #060907; border-right: 1px solid #1a231d; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 0; margin: 0; overflow: visible; }
/* The CF mark (owner's logo, 2026-10-05), drawn in the theme's colours in logo.svg. */
.section-mark { width: 40px; height: 40px; border-radius: 10px; background: url(/logo.svg) center / contain no-repeat; margin-bottom: 10px; position: relative; flex: none; }
.sections .section-btn { width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 12px; border: 0; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.sections .section-btn:hover:not(:disabled) { background: #121a14; color: var(--text); }
.sections .section-btn[aria-current=page] { background: #1d2a14; color: var(--accent); box-shadow: none; }
.sections .section-last { margin-top: auto; }
.pins { margin: 0 0 14px; }
.pins-head { margin: 0 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.pin-list { display: flex; flex-direction: column; gap: 2px; }
.pin-btn { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; width: 100%; padding: 8px 12px; min-height: 36px; border-radius: 9px; background: transparent; border: 0; color: #c9d4cb; font-weight: 500; }
.pin-btn:hover:not(:disabled) { background: #121a14; filter: none; }
.pin-btn[aria-current=page] { background: #161f18; color: var(--text); }
.pin-tag { font-size: 11px; color: var(--faint); font-weight: 600; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 28px; border-bottom: 1px solid #1a231d; min-height: 64px; }
.topbar #identity { margin-left: auto; color: var(--muted); font-size: 13px; }
.search-open { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; max-width: 520px; min-height: 42px; padding: 0 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-weight: 500; text-align: left; }
.search-open::before { content: ''; width: 16px; height: 16px; flex: none; border: 2px solid var(--muted); border-radius: 50%; box-sizing: border-box; }
.search-label { flex: 1; }
kbd { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 6px; }
.search-dialog { width: min(560px, calc(100vw - 32px)); max-width: none; padding: 16px; }
.search-field { position: absolute; left: -9999px; }
.search-dialog input { margin: 0 0 10px; min-height: 48px; font-size: 16px; }
.search-results { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow: auto; }
.search-hit { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; background: transparent; border: 1px solid transparent; color: var(--text); font-weight: 600; }
.search-hit:hover:not(:disabled), .search-hit:focus-visible { background: var(--panel-2); border-color: var(--line-2); filter: none; }
.search-hint { color: var(--muted); font-size: 12px; font-weight: 500; font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.rail { background: #0b100d; border-right: 1px solid #1a231d; display: flex; flex-direction: column; padding: 18px 14px; }
.brand strong { display: block; font-family: var(--font-display); font-size: 20px; letter-spacing: .06em; text-transform: uppercase; }
.brand span { color: var(--muted); font-size: 12px; }
nav { display: flex; flex-direction: column; gap: 2px; margin: 18px 0; flex: 1; overflow: auto; }
nav button { text-align: left; width: 100%; padding: 8px 12px; min-height: 36px; border-radius: 9px; background: transparent; border-color: transparent; color: #c9d4cb; font-weight: 500; }
nav button:hover:not(:disabled) { background: #121a14; filter: none; }
nav button[aria-current=page] { background: #161f18; color: var(--text); border-color: transparent; box-shadow: inset 3px 0 0 var(--accent); font-weight: 700; }
.rail-foot { display: flex; flex-direction: column; gap: 8px; }
#roleBadge { color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .12em; }

.stage { min-width: 0; display: flex; flex-direction: column; }
.stage > header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; padding: 18px 28px; border-bottom: 1px solid #1a231d; }
.stage > header h1 { margin: 2px 0 0; font-size: 30px; font-weight: 700; }
.header-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
#content { flex: 1; padding: 22px 28px 8px; }
footer { padding: 16px 28px 24px; color: var(--faint); font-size: 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card, details.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card + .card, .cards + .card, .card + .cards { margin-top: 16px; }
.card h2, .card h3 { margin: 0 0 10px; font-size: 18px; font-weight: 600; }
.stat { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--text); }
.muted, .hint { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); }
.nw-ok { color: var(--ok); }
.sw-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sw-row:last-child { border-bottom: 0; }
.sw-text { display: flex; flex-direction: column; gap: 3px; }
.sw-caution { color: var(--warn, #f0b85a); font-size: .9rem; }
.sw-toggle { display: flex; align-items: center; gap: 6px; }
@media (max-width: 560px) { .sw-row { grid-template-columns: 1fr auto; } .sw-row .sw-toggle { grid-column: 1 / -1; } }
#notice { color: var(--ok); padding: 0 28px; min-height: 1.2em; }
#error { padding: 0 28px; min-height: 1.2em; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
/* Phones: long IDs, weapon codes and setting names wrap instead of widening the page, and grid
   children may shrink so a wide table scrolls inside its own box. */
#content { overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; }
.cards > *, .grid > *, .ssa-grid > *, .dash > *, .dash-main > * { min-width: 0; }

label { display: block; margin: 10px 0; color: var(--muted); font-size: 13px; font-weight: 500; }
input, select, textarea { width: 100%; margin-top: 4px; padding: 9px 12px; min-height: 40px; background: #0b100d; border: 1px solid var(--line-2); border-radius: 10px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(181,229,80,.15); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; margin: 0 8px 0 0; accent-color: var(--accent); }
input[type=range] { accent-color: var(--accent); padding: 0; min-height: 0; border: 0; background: transparent; }
textarea { min-height: 90px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.item-row { display: grid; grid-template-columns: 1fr 90px auto auto auto; gap: 6px; margin-bottom: 6px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.pager { display: flex; gap: 10px; align-items: center; margin: 14px 0; }

/* Status pills: solid, readable, and always carrying a word. */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .02em; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.badge.PENDING, .badge.FULFILLING, .badge.warn { color: var(--warn); background: var(--warn-soft); border-color: #5c4a16; }
.badge.DELIVERED, .badge.ENABLED, .badge.CONNECTED, .badge.VERIFIED, .badge.works { color: #8ff0ae; background: var(--ok-soft); border-color: #2c6a40; }
.badge.FAILED, .badge.REVIEW, .badge.NOT_WORKING, .badge.broken { color: #ffb0a8; background: var(--danger-soft); border-color: #5e2622; }
.badge.CANCELLED, .badge.REFUNDED, .badge.DISABLED, .badge.DISCONNECTED, .badge.UNKNOWN, .badge.UNVERIFIED, .badge.untested { color: #b8c2ba; background: #1c201d; border-color: #3f4a42; }
.badge.sellable, .badge.money { color: #ffd982; background: var(--money-soft); border-color: #5c4a16; }
.badge.pve { color: #cfe3ff; background: var(--pve-soft); border-color: var(--pve); }
.badge.exc { color: #ffd6ad; background: var(--exc-soft); border-color: var(--exc); }
.badge.pvp { color: #ffb0a8; background: var(--pvp-soft); border-color: #7a2c26; }
/* A button that changes the live game carries the bolt. */
.live-action::before { content: ''; display: inline-block; width: 12px; height: 14px; margin-right: 8px; vertical-align: -1px; background: currentColor; clip-path: polygon(58% 0, 8% 58%, 46% 58%, 38% 100%, 92% 38%, 54% 38%); }
.planned { border: 1px dashed var(--line-2); padding: 18px; border-radius: var(--radius); background: var(--panel); }
.planned h2 { margin-top: 0; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr); gap: 16px; }
.ssa-card { margin-bottom: 16px; }
.ssa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ssa-cell { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ssa-cell span { display: block; color: var(--muted); font-size: 12px; }
.ssa-cell strong { display: block; margin-top: 4px; font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.legend { display: grid; gap: 6px; margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.guide dt { color: var(--gold); margin-top: 8px; }
.guide dd { margin: 0 0 6px; color: var(--muted); }
.section-head h2 { margin: 0 0 4px; font-size: 22px; }
.section-head { margin-bottom: 14px; }
.ui-empty, .ui-loading { color: var(--muted); font-size: 14px; padding: 12px 0; }
.ui-feedback { font-weight: 600; }
.ui-success { color: var(--ok); } .ui-warning, .ui-loading { color: var(--warn); } .ui-refused, .ui-error { color: var(--danger); }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 22px; max-width: 460px; }
dialog::backdrop { background: rgba(3,5,4,.7); }
dialog .row, dialog > button { margin-top: 12px; }
dialog > button { margin-right: 8px; }
@media (max-width: 900px) {
  #workspace, #workspace.no-sections { grid-template-columns: 1fr; }
  .sections { flex-direction: row; justify-content: flex-start; padding: 10px 12px; border-right: 0; border-bottom: 1px solid #1a231d; overflow-x: auto; }
  .section-mark { margin: 0 8px 0 0; }
  .sections .section-last { margin-top: 0; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  nav { flex-direction: row; flex-wrap: wrap; }
  nav button { width: auto; }
  .split, .item-row { grid-template-columns: 1fr; }
  .stage > header { flex-direction: column; align-items: flex-start; }
}

/* Admin dashboard: quick actions, to-do, counts, and the live map (terrain + zones +
   online players, drawn as in game). */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 480px); gap: 20px; align-items: start; }
.dash-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-hello { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dash-hello h2 { margin: 0; font-size: 26px; font-weight: 700; }
.dash-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dash-act { display: flex; align-items: center; gap: 14px; padding: 14px; min-height: 72px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-align: left; font-weight: 500; }
.dash-act:hover:not(:disabled) { border-color: var(--line-2); background: var(--panel-2); filter: none; }
.dash-act-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.dash-act-spawn .dash-act-ico { background: var(--accent); color: var(--accent-ink); }
.dash-act-sell .dash-act-ico, .dash-act-rewards .dash-act-ico { background: var(--money-soft); color: var(--money); }
.dash-act-purge .dash-act-ico { background: #1c2a40; color: #7fb4ff; }
.dash-msg-row { display: grid; grid-template-columns: minmax(150px, auto) 1fr auto; gap: 10px; align-items: center; margin: 8px 0 4px; }
.dash-msg-row select, .dash-msg-row input { margin: 0; min-height: 44px; }
.dash-msg-recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dash-msg-recent li { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-radius: 10px; background: #0b100d; border: 1px solid var(--line); overflow-wrap: anywhere; }
@media (max-width: 560px) { .dash-msg-row { grid-template-columns: 1fr; } }
.dash-taxi-row { display: grid; grid-template-columns: minmax(150px, 1.5fr) repeat(2, minmax(90px, 1fr)) auto; gap: 10px; align-items: end; padding: 8px 10px; margin: 6px 0; border-radius: 10px; background: #0b100d; border: 1px solid var(--line); }
.dash-taxi-row label { margin: 0; }
.dash-taxi-row input[type=number] { margin: 0; min-height: 36px; }
.dash-taxi-row > .hint { grid-column: 1 / -1; }
@media (max-width: 560px) { .dash-taxi-row { grid-template-columns: 1fr 1fr; } .dash-taxi-row > label:first-child { grid-column: 1 / -1; } }
/* Hired guards page: field rows that wrap instead of squeezing, and cards that take the full width. */
.hg-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: end; padding: 10px 12px; margin: 8px 0; border-radius: 10px; background: #0b100d; border: 1px solid var(--line); }
.hg-row label { margin: 0; }
.hg-row input[type=number], .hg-row input[type=text], .hg-row select { margin: 0; min-height: 36px; width: 100%; }
.hg-row > .hg-row-title { grid-column: 1 / -1; }
.hg-row > button { align-self: end; }
.hg-wide { grid-column: 1 / -1; }
.hg-cards > .card { margin-top: 0; }
.hg-rules-wrap { overflow-x: auto; margin: 8px 0; }
.hg-rules { width: 100%; border-collapse: collapse; }
.hg-rules th, .hg-rules td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.hg-rules select { margin: 0; min-width: 170px; width: 100%; }
.dash-tp { border-color: rgba(255, 107, 97, .45); }
.dash-tp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dash-tp-acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 8px; }
.dash-tp-explain { margin: 0 0 10px; }
.dash-tp-go { background: #d7263d; color: #fff; border: 1px solid #ff5a6e; font-weight: 700; font-size: 1.05rem; padding: 12px 22px; border-radius: 12px; box-shadow: 0 0 0 3px rgba(215, 38, 61, .25); }
.dash-tp-go:hover:not(:disabled) { background: #ee2f48; }
.dash-tp-go:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.dash-tp-go:disabled { background: #5a2a31; border-color: #5a2a31; color: #d9b8bd; box-shadow: none; }
@media (max-width: 560px) { .dash-tp-row { grid-template-columns: 1fr; } .dash-tp-go { width: 100%; } }
.dash-act-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-act-text strong { font-size: 15px; }
.dash-act-text span { font-size: 13px; color: var(--muted); }
.dash-todo { display: flex; flex-direction: column; gap: 10px; }
.dash-todo h2 { margin: 0; }
.dash-todo-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #0b100d; }
.dash-todo-row.warn { background: var(--warn-soft); border-color: #5c4a16; }
.dash-todo-row.warn button { background: var(--warn); color: #231a02; border: 0; }
.dash-todo-row.bad { background: var(--danger-soft); border-color: #5e2622; }
.dash-todo-row.bad button { color: #ffb0a8; border-color: #5e2622; background: transparent; }
.dash-todo-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-todo-text strong { font-size: 14px; }
.dash-todo-text span { font-size: 13px; color: var(--muted); }
.dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dash-stats .stat { display: block; font-size: 26px; }
.dash-map { display: flex; flex-direction: column; gap: 12px; }
.dash-map-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dash-map-head h2 { margin: 0; }
.dash-live { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.dash-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: dash-live 1.6s ease-in-out infinite; }
.dash-live-dot.off { background: var(--danger); animation: none; }
@keyframes dash-live { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.dash-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-toggle { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.dash-toggle[aria-pressed=true] { border-color: var(--accent); color: var(--gold-2); background: var(--accent-soft); }
.dash-frame { position: relative; width: 100%; aspect-ratio: 1179 / 1170; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #0c110e; }
.dash-terrain { position: absolute; top: 0; left: 0; width: 100%; height: auto; filter: grayscale(.55) brightness(.62) contrast(1.15); }
.dash-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr)); }
.dash-cell { padding: 4px; font-family: var(--font-mono); font-size: 10px; color: #dfe7e0; text-shadow: 0 1px 2px #000; border: 1px solid rgba(240,245,236,.07); }
.dash-pve { background: rgba(77,155,255,.30); border-color: rgba(110,175,255,.85); }
.dash-exc { background: rgba(255,154,60,.14); border: 1px dashed var(--exc); animation: dash-exc 2.8s ease-in-out infinite; }
@keyframes dash-exc { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(255,154,60,0); } 50% { box-shadow: inset 0 0 18px 2px rgba(255,154,60,.45); } }
.dash-dots { position: absolute; inset: 0; pointer-events: none; }
.dash-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid #0b100d; background: var(--pvp); box-shadow: 0 0 0 4px rgba(255,95,87,.3); transform: scale(var(--dash-inv, 1)); }
.dash-dot.you { background: var(--accent); box-shadow: 0 0 0 4px rgba(181,229,80,.35); }
.dash-tag { position: absolute; margin: -28px 0 0 8px; padding: 2px 6px; border-radius: 5px; background: rgba(6,9,7,.85); font-size: 11px; font-weight: 700; white-space: nowrap; color: #ffb0a8; transform: scale(var(--dash-inv, 1)); transform-origin: -8px 28px; }
.dash-tag.you { color: var(--gold-2); }
.dash-death { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; display: grid; place-items: center; border-radius: 50%; background: rgba(6,9,7,.85); border: 2px solid var(--danger); color: var(--danger); font-size: 11px; font-weight: 900; line-height: 1; transform: scale(var(--dash-inv, 1)); }
.dash-tag.death { color: var(--danger); }
.dash-li-death { color: var(--danger); font-weight: 900; width: 9px; text-align: center; flex: none; }
.dash-frame.no-terrain .dash-terrain { display: none; }
.dash-frame.no-game-terrain .dash-terrain { display: none; }
/* Big grids (Rust): no name in every square; the list beside the map gives each player's square. */
.dash-grid.dense .dash-cell, .auth-map-grid.dense .auth-cell { font-size: 0; padding: 0; }
.dash-frame.no-game-terrain { background: var(--panel-2, #10151b); }
.dash-frame.no-zones .dash-cell { background: transparent; border: 1px solid rgba(240,245,236,.07); animation: none; }
.dash-frame.no-zones .zone-quads { display: none; }
.dash-frame.no-players .dash-dots { display: none; }
.dash-frame.no-names .dash-tag { display: none; }
/* Live map zoom: the stage scales; dots/tags counter-scale via --dash-inv so they keep their size. */
.dash-stage { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.dash-frame.zoomed { cursor: grab; touch-action: none; }
.dash-frame.dragging { cursor: grabbing; }
.dash-zoom { position: absolute; right: 8px; top: 8px; z-index: 2; display: flex; gap: 4px; }
.dash-zoom button { min-height: 30px; padding: 2px 10px; font-size: 13px; background: rgba(6,9,7,.85); }
/* Teleport: fast travel to saved points. */
.dash-travel { margin: 4px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.dash-travel-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.dash-travel-row > :first-child { flex: 1 1 220px; min-width: 0; }
.dash-travel-manage summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.dash-travel-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dash-travel-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-travel-list li button { margin-left: auto; min-height: 30px; padding: 2px 10px; }
.dash-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.dash-players li { display: flex; align-items: center; gap: 10px; }
.dash-players li strong { flex: 1; font-weight: 600; }
.dash-li-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pvp); flex: none; }
.dash-li-dot.you { background: var(--accent); }
@media (max-width: 1200px) { .dash { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .dash-acts, .dash-stats { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .dash-live-dot, .dash-exc { animation: none; } }

/* Spawn page: kind tabs, search, result cards, and the tray (who, what, checks, button). */
.spawn { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.spawn-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.spawn-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.spawn-tab { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 84px; padding: 14px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: #c9d4cb; font-weight: 600; }
.spawn-tab:hover:not(:disabled) { background: var(--panel-2); filter: none; }
.spawn-tab[aria-selected=true] { border-color: var(--accent); background: var(--accent-soft); color: #eaf7cf; }
.spawn-tab[aria-selected=true] svg { color: var(--accent); }
.spawn-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spawn-search-label { position: absolute; left: -9999px; }
.spawn-bar input { flex: 1 1 280px; margin: 0; min-height: 44px; }
.spawn-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.spawn-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; min-height: 120px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-align: left; font-weight: 500; }
.spawn-card:hover:not(:disabled) { border-color: var(--line-2); background: var(--panel-2); filter: none; }
.spawn-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.spawn-card strong { font-size: 15px; }
.spawn-card .mono { color: var(--faint); overflow-wrap: anywhere; }
.spawn-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; }
.spawn-card-kind { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.spawn-tray { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 16px; }
.spawn-tray h2 { margin: 0 0 4px; }
.spawn-tray-label { margin: 6px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--faint); }
.spawn-what { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px; border-radius: 12px; background: #0b100d; border: 1px solid var(--line); min-height: 56px; }
.spawn-stepper { display: flex; align-items: center; gap: 6px; }
.spawn-quick { display: flex; gap: 6px; margin-top: 6px; }
.spawn-quick .spawn-step { width: auto; padding: 0 10px; font-size: 14px; }
.spawn-tip { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--accent); background: var(--accent-soft); color: var(--text); font-size: 13px; line-height: 1.35; }
/* Spawn > Items browser: category boxes > group boxes > item cards. */
.spawn-crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.spawn-crumbs button { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.spawn-crumbs strong { color: var(--text); }
.spawn-crumb-sep { color: var(--faint); }
.cat-card { min-height: 132px; }
.cat-count { font-size: 13px; color: var(--muted); }
.cat-bar { display: flex; width: 100%; height: 6px; margin-top: auto; border-radius: 4px; overflow: hidden; background: #3a1d1b; }
.cat-bar .cat-ok { background: var(--ok); }
.cat-bar .cat-untested { background: #46524a; }
.spawn-more { align-self: center; }
.spawn-advanced summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.spawn-advanced-row { display: flex; gap: 8px; margin-top: 8px; }
.spawn-advanced-row input { flex: 1; min-width: 0; }
.spawn-quick .active { border-color: var(--accent); color: var(--accent); }
.spawn-step { min-height: 36px; width: 36px; padding: 0; font-size: 18px; }
.spawn-qty { width: 56px; margin: 0; text-align: center; min-height: 36px; }
.spawn-checks { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.spawn-checks li { display: flex; align-items: center; gap: 8px; }
.spawn-checks li::before { content: ''; width: 14px; height: 14px; flex: none; border-radius: 50%; }
.spawn-checks li.ok::before { background: var(--ok); clip-path: polygon(14% 52%, 38% 76%, 88% 22%, 100% 34%, 38% 96%, 0 62%); border-radius: 0; }
.spawn-checks li.no { color: var(--muted); }
.spawn-checks li.no::before { border: 2px solid var(--danger); box-sizing: border-box; }
.spawn-go { min-height: 56px; font-size: 17px; margin-top: 6px; }
.target-list { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.target-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 48px; padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-align: left; font-weight: 500; }
.target-pick:hover:not(:disabled) { background: var(--panel-2); filter: none; }
.target-pick[aria-checked=true] { border-color: var(--accent); background: var(--accent-soft); }
/* List-style picker: one or no players shows the plain list; two or more fold into a menu. */
.target-picker { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.target-picker:not(.collapsible) .target-toggle { display: none; }
.target-picker.collapsible .target-menu { display: none; }
.target-picker.collapsible.open .target-menu { display: flex; }
.target-menu { display: flex; flex-direction: column; gap: 6px; }
.target-picker.collapsible .target-menu { max-height: 290px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.target-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent); color: var(--text); text-align: left; font-weight: 500; }
.target-toggle:hover { filter: brightness(1.08); }
.target-toggle-face { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.target-toggle-face strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-caret { font-size: 14px; color: var(--accent); }
.target-search { width: 100%; box-sizing: border-box; min-height: 38px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.target-search[hidden] { display: none; }
@media (max-width: 1100px) { .spawn { grid-template-columns: 1fr; } .spawn-tray { position: static; } }
@media (max-width: 640px) { .spawn-tabs { grid-template-columns: 1fr 1fr; } }

/* The shared item picker and contents editor (listings, packages, free kits, pricing). */
.picker { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.picker-row { display: flex; gap: 8px; align-items: center; }
.picker-row input { margin: 0; flex: 1; min-height: 44px; }
.picker-results { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; }
.picker-hit { display: flex; width: 100%; text-align: left; min-height: 44px; padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-weight: 500; }
.picker-hit:hover:not(:disabled) { background: var(--panel-2); border-color: var(--line-2); filter: none; }
.picker-raw { align-self: flex-start; }
.picker-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.picker-item .mono { color: var(--faint); }
.contents-editor { display: flex; flex-direction: column; gap: 8px; }
.contents-lines { display: flex; flex-direction: column; gap: 6px; }
.contents-line { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #0b100d; border: 1px solid var(--line); }
.contents-line input { margin: 0; min-height: 36px; }
.listing-contents { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.listing-sells { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 4px; padding: 8px 12px 10px; border: 1px solid var(--line); border-radius: 10px; }
.listing-sells legend { padding: 0 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.listing-sells label { display: inline-flex; align-items: center; gap: 6px; margin: 0; min-height: 36px; }
.picker-hit[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 640px) { .contents-line { grid-template-columns: 1fr 70px; } }

/* Catalog: maintenance tucked away, friendly-name suggestions. */
details.maintenance > summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--muted); }
details.maintenance[open] > summary { margin-bottom: 14px; color: var(--text); }
.names-list { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; margin: 8px 0; }
.names-line { display: grid; grid-template-columns: auto minmax(0, 220px) minmax(0, 1fr); gap: 10px; align-items: center; margin: 0; color: var(--text); }
.names-line input[type=text], .names-line input:not([type]) { margin: 0; min-height: 36px; }
.names-line .mono { color: var(--faint); overflow-wrap: anywhere; }

/* Player home (phones first): money chips, free kit cards, quick links. */
.phome { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.phome-hello { display: flex; flex-direction: column; gap: 4px; }
.phome-hello h2 { margin: 0; font-size: 26px; }
.phome-money { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.phome-chip { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.phome-chip strong { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.phome-chip.gold { background: var(--money-soft); border-color: #5c4a16; }
.phome-chip.gold strong { color: var(--money); }
.phome-kit { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.phome-kit.ready { background: var(--accent-soft); border: 1px solid #3f5520; }
.phome-kit h3 { margin: 0; font-size: 20px; }
.phome-kit p { margin: 0; }
.phome-kit-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.phome-kit-tag { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.phome-claim { min-height: 48px; font-size: 16px; }
.phome-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.phome-link { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 72px; padding: 10px 4px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: #c9d4cb; font-size: 13px; font-weight: 600; }
.phome-link:hover:not(:disabled) { background: var(--panel-2); filter: none; }
.logout-top { display: none; }
@media (max-width: 900px) {
  /* Players on a phone: the menu becomes a bottom tab bar; sign out moves to the top bar. */
  #workspace.no-sections .rail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-bottom: 0; flex-direction: row; background: #0b100d; }
  #workspace.no-sections .rail .brand, #workspace.no-sections .rail .pins, #workspace.no-sections .rail .rail-foot { display: none; }
  #workspace.no-sections nav { margin: 0; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 4px; }
  #workspace.no-sections nav button { flex: none; min-height: 44px; }
  #workspace.no-sections .stage { padding-bottom: 76px; }
  #workspace.no-sections .logout-top { display: inline-flex; margin-left: 8px; }
  .phome-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Player store and My orders (phones first). */
.pstore { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.pstore-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pstore-list { display: flex; flex-direction: column; gap: 10px; }
.pstore-item, .porder { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.pstore-item-top { display: flex; align-items: center; gap: 12px; }
.pstore-ico { width: 48px; height: 48px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--panel-3); color: var(--gold-2); }
.pstore-text { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pstore-text strong { font-size: 15px; }
.pstore-meta { font-size: 12px; color: var(--faint); }
.pstore-price { flex: none; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--money-soft); color: var(--money); border: 1px solid #5c4a16; font-weight: 700; }
.pstore-checkout { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.pstore-qty { min-width: 28px; text-align: center; font-weight: 700; }
.pstore-pay { min-height: 44px; padding: 0 18px; }
.pstore-done { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; }
.porder .row { gap: 8px; }
@media (max-width: 480px) { .pstore-item-top { flex-wrap: wrap; } .pstore-price { width: 100%; } }

/* Reusable online-player target selector. Lime marks the chosen player; the green dot
   is a healthy roster. Shared by every player-targeted admin tool. */
.target-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.target-panel.has-target { border-left-color: var(--accent); }
.target-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.target-label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); font-weight: 700;
}
.target-dot { width: 8px; height: 8px; border-radius: 50%; background: #555b66; flex: none; }
.target-dot.online { background: var(--ok); box-shadow: 0 0 0 2px rgba(95,224,138,.18); }
.target-dot.offline { background: #7a5050; }
.target-state { font-size: 12px; color: var(--muted); }
.target-chosen { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-height: 20px; }
.target-name { font-size: 15px; color: var(--text); font-weight: 700; }
.target-steam { font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.target-none { font-size: 12px; color: var(--muted); font-style: italic; }
.target-row { display: flex; gap: 8px; align-items: stretch; }
.target-select {
  flex: 1 1 auto; min-width: 0; min-height: 40px;
  background: #0b100d; color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 10px; font-size: 14px;
}
.target-select:disabled { color: #6b717c; }
.target-refresh {
  flex: none; min-height: 40px; padding: 6px 14px;
  background: var(--panel-2); color: var(--gold-2);
  border: 1px solid var(--line-2); border-radius: 10px; font-size: 13px; cursor: pointer;
}
.target-refresh:hover:not(:disabled) { border-color: var(--accent); }
.target-refresh:disabled { opacity: .5; cursor: default; }
.target-refresh.compact { margin-left: auto; min-height: 28px; padding: 3px 12px; font-size: 12px; border-radius: 8px; }
@media (max-width: 480px) {
  .target-row { flex-direction: column; }
  .target-refresh { width: 100%; }
  .target-refresh.compact { width: auto; }
}

/* Events page */
.ev-slider { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.ev-slider-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.ev-slider-head strong { color: var(--gold-2); }
.ev-slider input[type=range] { width: 100%; }
.ev-check { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.ev-estimate, .ev-share { color: var(--gold-2); font-size: 13px; }
.ev-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 8px 0; }
/* Event builder: AI and prop lines, and the top-down layout preview. */
.ev-builder h3 { margin-top: 18px; }
.ev-lines { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.ev-line { display: grid; grid-template-columns: minmax(160px, 2fr) repeat(4, minmax(70px, 1fr)) auto; gap: 8px; align-items: end; padding: 8px 10px; border-radius: 10px; background: #0b100d; border: 1px solid var(--line); }
.ev-line label { margin: 0; }
.ev-line input, .ev-line select { margin: 0; min-height: 36px; }
.ev-preview-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 10px 0; }
.ev-preview { width: 260px; max-width: 100%; height: auto; background: #0b100d; border: 1px solid var(--line); border-radius: 10px; }
.ev-preview .ev-band-npc { fill: none; stroke: var(--gold); stroke-opacity: 0.28; }
.ev-preview .ev-band-zombie { fill: none; stroke: var(--danger); stroke-opacity: 0.28; }
.ev-preview .ev-centre { fill: var(--text); }
.ev-preview .ev-prop { fill: var(--muted); }
.ev-preview .ev-prop-chest { fill: var(--accent); }
.ev-preview .ev-scale { fill: var(--faint); font-size: 11px; }
@media (max-width: 760px) { .ev-line { grid-template-columns: 1fr 1fr; } .ev-line label:first-child { grid-column: 1 / -1; } }
.badge.ev-easy { color: #8ff0ae; } .badge.ev-medium { color: #ffd982; } .badge.ev-hard { color: #ffb0a8; }

/* Free rewards: compact kit rows and the contents editor */
.kit-row h3 { margin: 0; }
.kit-editor { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.kit-line { display: grid; grid-template-columns: 1fr 80px auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.kit-results { width: 100%; margin-top: 6px; }

/* Purge: permanent map grid laid out as the in-game map (D4 top left, Z0 bottom right) */
.purge-map { display: grid; grid-template-columns: 24px repeat(5, minmax(0, 1fr)); gap: 6px; max-width: 560px; margin: 8px 0; touch-action: none; user-select: none; }
.purge-map.purge-map-wide { max-width: min(100%, 980px); gap: 2px; }
.purge-map.purge-map-wide .purge-square-label { font-size: 10px; padding: 0; }
.purge-map.purge-map-wide .purge-sub { min-height: 12px; }
.purge-axis { color: var(--muted); font-family: var(--font-mono); font-size: 12px; align-self: center; text-align: center; }
.purge-cell { padding: 12px 2px; border-radius: 8px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); cursor: pointer; min-height: 44px; }
.purge-cell.PVE { background: var(--pve-soft); border-color: var(--pve); color: #e3efff; }
.purge-cell.EXCURSION { background: var(--exc-soft); border: 1px dashed var(--exc); color: #ffe2c4; animation: excpulse 2.8s ease-in-out infinite; }
.purge-cell.PVP { background: #1a1413; border-color: #3a2522; color: #d9b8b2; }
@keyframes excpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,154,60,0); } 50% { box-shadow: 0 0 14px 2px rgba(255,154,60,.45); } }
@media (prefers-reduced-motion: reduce) { .purge-cell.EXCURSION { animation: none; } }
.purge-paint { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.purge-pick { padding: 8px 14px; border-radius: 10px; font-weight: 700; border: 1px solid var(--line); cursor: pointer; }
.purge-pick.PVE { background: var(--pve-soft); color: #e3efff; }
.purge-pick.PVP { background: #1a1413; color: #d9b8b2; }
.purge-pick.EXCURSION { background: var(--exc-soft); color: #ffe2c4; }
.purge-pick[aria-pressed="true"] { outline: 3px solid #fff; outline-offset: 2px; }
.purge-square { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.purge-square-label { background: none; border: 0; color: var(--muted); font: 700 11px var(--font-mono); cursor: pointer; padding: 1px; text-align: center; }
.purge-square-label:hover { color: var(--text); }
.purge-subs { display: grid; gap: 2px; }
.purge-sub { aspect-ratio: 1 / 1; min-height: 22px; border-radius: 4px; border: 1px solid var(--line); cursor: crosshair; padding: 0; }
.purge-sub.PVE { background: var(--pve-soft); border-color: var(--pve); }
.purge-sub.EXCURSION { background: var(--exc-soft); border: 1px dashed var(--exc); }
.purge-sub.PVP { background: #1a1413; border-color: #3a2522; }
.purge-sub:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
/* Live map and sign-in map: a square whose cells differ shows them as quarters */
.zone-quads { position: absolute; inset: 0; display: grid; pointer-events: none; }
.zone-quads > span.PVE { background: rgba(48, 110, 255, .38); }
.zone-quads > span.EXCURSION { background: rgba(255, 154, 60, .38); }
.zone-quads > span.PVP { background: transparent; }
.dash-cell { position: relative; }
.spawn-what-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.spawn-clear { padding: 4px 10px; font-size: .85rem; }
.zone-subgrid { position: absolute; inset: 0; display: grid; pointer-events: none; }
.zone-subgrid > span { outline: 1px dashed rgba(240, 245, 236, 0.38); outline-offset: -0.5px; }
.purge-days { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.purge-line { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: end; margin-bottom: 6px; }

/* Backups & memory page: usage bars. */
.sys-meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 4px 0 14px; }
.sys-meter > span { display: block; height: 100%; background: var(--ok); }
.sys-meter.warn > span { background: var(--warn); }
.sys-meter.danger > span { background: var(--danger); }

/* "Sign in through Steam": a link styled as the main action button. */
a.steam-signin { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; padding: 9px 16px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; margin: 4px 8px 8px 0; }
a.steam-signin:hover { filter: brightness(1.08); }

/* The page between Discord's Link Steam Account button and Steam. */
.steam-link-page { max-width: 520px; margin: 12vh auto; padding: 0 16px; }
.steam-link-page button { width: 100%; min-height: 48px; font-size: 16px; margin-top: 8px; }

/* Bank page (bank-ui.js): the caller's own Discord bank, players and admins alike. */
.bank { display: flex; flex-direction: column; gap: 14px; }
.bank-balances .phome-money { margin: 6px 0 8px; }
.bank-ingame { margin: 0; font-weight: 600; }
.bank-pending { border-color: #5c4a16; background: var(--warn-soft); }
.bank-pending h2 { color: var(--warn); }
.bank-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.bank-tab { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.bank-tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.bank-form label { display: block; margin-bottom: 8px; }
.bank-form input, .bank-form select { width: 100%; max-width: 420px; }
.bank-preview { color: var(--money); font-weight: 600; min-height: 1.2em; }
.bank-rows { list-style: none; margin: 0; padding: 0; }
.bank-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.bank-row:first-child { border-top: 0; }
.bank-row > div { display: flex; flex-direction: column; min-width: 0; }
.bank-row .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank-amt { font-family: var(--font-mono); font-weight: 700; white-space: nowrap; }
.bank-amt.in { color: var(--ok); }
.bank-amt.out { color: var(--danger); }
.bank-amt.gold { color: var(--money); }
.bank-admin-head { margin: 22px 0 6px; font-family: var(--font-display); }
.bank-squad h3 { margin: 16px 0 4px; font-size: 15px; }
.bank-squad-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bank-squad-head h2 { margin: 0; }
.bank-inline { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.bank-inline input { flex: 1 1 200px; }
.squad-name { display: flex; align-items: center; gap: 8px; }
.squad-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.squad-dot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.bank-result { margin: 8px 0 0; font-weight: 600; }
.bank-result.ok { color: var(--ok); }
.dash-act-bank { grid-column: 1 / -1; }
.phome-bank { align-self: flex-start; }

/* ============================================================================
   Public sign-in surface.

   Every selector below is scoped under #login, so the authenticated portal is
   untouched. Shared classes (.eyebrow, .error, .card) are deliberately not
   restyled here — the login markup uses its own .auth-* names instead.
   Night Ops: the island map with its zones on the left (drawn as in game, D4 top
   left, Z0 bottom right; no player data, ever), the sign-in card on the right.
   ========================================================================= */
#login {
  --auth-ink: #f0f5ec;
  --auth-dim: #93a397;
  --auth-faint: #5f6e63;
  --auth-base: #090c0a;
  --auth-world: #0c110e;
  --auth-panel: #0f1411;
  --auth-edge: #243029;
  --auth-edge-2: #33443a;
  --auth-lime: #b5e550;
  --auth-lime-soft: #d2f58a;
  --auth-gold: #ffc94d;
  --auth-pve: #4d9bff;
  --auth-exc: #ff9a3c;
  --auth-pvp: #ff8f86;
  --auth-ok: #5fe08a;
  --auth-bad: #ff6b61;

  min-height: 100vh;
  min-height: 100dvh;
  color: var(--auth-ink);
  background: var(--auth-base);
  font-family: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;
  overflow-x: hidden;
}
.auth-split {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}
.auth-world {
  background: var(--auth-world);
  border-right: 1px solid var(--auth-edge);
  padding: clamp(24px, 4vw, 48px) clamp(20px, 4vw, 56px);
  padding-top: max(clamp(24px, 4vw, 48px), env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-mark {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: url(/logo.svg) center / contain no-repeat;
  position: relative;
}
.auth-wordmark {
  font-family: 'Chakra Petch', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.auth-world-body { display: flex; flex-direction: column; gap: 24px; }
.auth-motto {
  margin: 0;
  max-width: 540px;
  font-family: 'Chakra Petch', 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.35;
  color: #d6dfd8;
}
.auth-motto-gold { color: var(--auth-gold); font-weight: 600; }
.auth-map-row { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.auth-map {
  position: relative;
  width: min(360px, 100%);
  aspect-ratio: 1179 / 1170;
  flex: none;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--auth-edge-2);
  background: #0c110e;
}
/* The image carries a black strip below the island; the frame's ratio crops it. */
.auth-map-img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: auto;
  filter: grayscale(.55) brightness(.6) contrast(1.15);
}
.auth-map-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
}
.auth-cell {
  box-sizing: border-box;
  padding: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: #c9d4cb;
  text-shadow: 0 1px 2px #000;
  border: 1px solid rgba(240, 245, 236, .07);
}
.auth-cell-pve { background: rgba(77, 155, 255, .30); border-color: rgba(110, 175, 255, .85); color: #e3efff; }
.auth-cell-exc { background: rgba(255, 154, 60, .14); border: 1px dashed var(--auth-exc); color: #ffe2c4; animation: auth-exc 2.8s ease-in-out infinite; }
@keyframes auth-exc {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(255, 154, 60, 0); border-color: var(--auth-exc); }
  50% { box-shadow: inset 0 0 18px 2px rgba(255, 154, 60, .45); border-color: #ffc27e; }
}
.auth-map-side { flex: 1 1 220px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.auth-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 13px; color: var(--auth-dim); }
.auth-legend li { display: flex; align-items: center; gap: 8px; }
.auth-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.auth-swatch-pve { background: var(--auth-pve); }
.auth-swatch-exc { border: 1px dashed var(--auth-exc); box-shadow: 0 0 8px rgba(255, 154, 60, .5); }
.auth-swatch-pvp { border: 1px solid var(--auth-faint); }
.auth-rules {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px;
  border-radius: 14px;
  background: #111813;
  border: 1px solid var(--auth-edge);
}
.auth-rules p { margin: 0; font-size: 14px; line-height: 1.5; color: #c9d4cb; }
.auth-rules-title { font-family: 'Chakra Petch', 'Segoe UI', sans-serif; font-weight: 600; font-size: 17px; color: var(--auth-ink); }
.auth-pve { color: #7fb4ff; font-weight: 600; }
.auth-pvp { color: var(--auth-pvp); font-weight: 600; }
.auth-legal { display: flex; flex-direction: column; gap: 4px; }
.auth-footer { margin: 0; font-size: 12px; color: #7d8c81; }
.auth-footer-fine { margin: 0; font-size: 12px; color: var(--auth-faint); overflow-wrap: anywhere; }

.auth-card {
  align-self: center;
  justify-self: center;
  width: min(460px, 100%);
  box-sizing: border-box;
  padding: clamp(24px, 5vw, 48px);
  padding-bottom: max(clamp(24px, 5vw, 48px), env(safe-area-inset-bottom));
}
.auth-head { display: flex; flex-direction: column; gap: 6px; }
#login h1 {
  margin: 0;
  font-family: 'Chakra Petch', 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: clamp(26px, 6vw, 32px);
  line-height: 1.1;
  color: var(--auth-ink);
}
.auth-sub {
  margin: 0;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--auth-lime);
}
.auth-lede { margin: 18px 0 0; font-size: 15px; line-height: 1.55; color: var(--auth-dim); }
#login form { margin: 22px 0 0; display: flex; flex-direction: column; gap: 14px; }
/* margin:0 overrides the global `label` rule, which would otherwise add 10px inside
   the form's own gap and loosen the spacing. */
.auth-field { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.auth-label { font-size: 13px; font-weight: 600; color: #c9d4cb; }
#login textarea#code {
  width: 100%;
  box-sizing: border-box;
  min-height: 62px;
  resize: vertical;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--auth-edge-2);
  background: var(--auth-panel);
  color: var(--auth-ink);
  /* 16px keeps iOS from zooming the viewport on focus. */
  font-size: 16px;
  line-height: 1.45;
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  word-break: break-all;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#login textarea#code::placeholder { color: var(--auth-faint); }
#login textarea#code:focus { outline: none; border-color: var(--auth-lime); box-shadow: 0 0 0 3px rgba(181, 229, 80, .16); }
#login textarea#code:disabled { opacity: .55; }
.auth-submit {
  width: 100%;
  min-height: 50px;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--auth-lime);
  color: #0d1405;
  font-size: 17px;
  font-weight: 700;
  transition: filter .15s ease, opacity .15s ease;
}
.auth-submit:hover:not(:disabled) { filter: brightness(1.07); }
.auth-submit:disabled { opacity: .6; cursor: default; }
#login :focus-visible { outline: 2px solid var(--auth-lime-soft); outline-offset: 2px; }

/* Feedback. Green only for success, red only for a real failure. */
.auth-feedback {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--auth-edge);
  background: var(--auth-panel);
  font-size: 14px;
  line-height: 1.5;
  color: var(--auth-dim);
  overflow-wrap: anywhere;
}
.auth-feedback[data-kind='working'] { border-color: rgba(181, 229, 80, .4); color: var(--auth-lime-soft); }
.auth-feedback[data-kind='success'] { border-color: rgba(95, 224, 138, .45); color: var(--auth-ok); }
.auth-feedback[data-kind='error'] { border-color: rgba(255, 107, 97, .45); color: var(--auth-bad); }
.auth-feedback[data-kind='notice'] { border-color: rgba(255, 201, 77, .35); color: var(--auth-gold); }

.auth-help {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--auth-panel);
  border: 1px solid var(--auth-edge);
}
.auth-help p { margin: 0 0 6px; font-size: 13px; line-height: 1.5; color: var(--auth-dim); }
.auth-help p:last-child { margin-bottom: 0; }
.auth-kbd { font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--auth-ink); }
.auth-note { margin: 12px 0 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--auth-faint); }

/* Narrower screens: sign-in first, the map underneath. */
@media (max-width: 980px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-card { order: -1; padding-top: max(28px, env(safe-area-inset-top)); }
  .auth-world { border-right: 0; border-top: 1px solid var(--auth-edge); }
}
/* Short viewports: keep the whole card on screen. */
@media (max-height: 620px) {
  .auth-card { align-self: start; padding-top: 18px; padding-bottom: 18px; }
  .auth-lede, #login form, .auth-help { margin-top: 12px; }
}
/* Very narrow phones. */
@media (max-width: 360px) {
  .auth-card { padding: 18px; }
  .auth-world { padding: 18px; }
  .auth-mark { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  #login *, #login *::before { transition: none !important; animation: none !important; }
}
