/* theme.css — HELLHOUNDS tokens (ReplicatedStorage/Modules/UIKit.luau:29) as CSS custom properties.
   The Roblox fonts (PermanentMarker / SpecialElite / Oswald) are not installed on the web, so the
   stacks below approximate them locally: no webfont request, no layout shift, works offline. */

:root {
  /* game palette — identical RGB values to UIKit.Theme */
  --black: 8, 6, 6;
  --iron: 26, 22, 21;
  --iron-light: 46, 40, 37;
  --rust: 122, 64, 38;
  --steel: 118, 112, 108;
  --steel-dark: 64, 60, 58;
  --blood: 150, 14, 14;
  --blood-lit: 230, 36, 30;
  --bone: 226, 214, 190;
  --bone-dim: 150, 140, 122;
  --sickly: 176, 196, 90;
  --gold: 232, 178, 60;

  --bg: rgb(var(--black));
  --panel: rgb(var(--iron));
  --panel-2: rgb(var(--iron-light));
  --line: rgb(var(--steel-dark));
  --line-soft: rgba(var(--steel), 0.22);
  --text: rgb(var(--bone));
  --dim: rgb(var(--bone-dim));
  --accent: rgb(var(--blood-lit));
  --gold-c: rgb(var(--gold));

  --ok: #6ebe5a;
  --bad: #eb463c;
  --warn: #e8b23c;
  --idle: #8b8275;

  --font-display: "Special Elite", "Courier New", "Cascadia Mono", monospace;
  --font-ui: "Oswald", "Bahnschrift", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", ui-monospace, monospace;

  --sidebar: 216px;
  --topbar: 54px;
  --radius: 3px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  --tick: 120ms;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: rgb(var(--black));
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- backdrop */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3; /* above the panel, below the drawer / palette / gate */
  pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: screen;
}
body::before {
  /* rust haze + vignette over the particle field */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 78% -10%, rgba(var(--blood), 0.18), transparent 62%),
    radial-gradient(700px 420px at 4% 108%, rgba(var(--rust), 0.14), transparent 60%),
    radial-gradient(120% 90% at 50% 50%, transparent 38%, rgba(var(--black), 0.82) 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: repeating-linear-gradient(0deg, rgba(var(--bone), 0.6) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* ---------------------------------------------------------------- shell */
.app {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(var(--iron), 0.92), rgba(var(--black), 0.94));
  backdrop-filter: blur(2px);
}

.brand {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.brand b {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--text);
  text-shadow: 0 0 22px rgba(var(--blood-lit), 0.35);
}
.brand span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.42em;
  color: var(--gold-c);
  text-transform: uppercase;
}
.brand .chain {
  margin-top: 10px;
  height: 6px;
  background-image: radial-gradient(circle, rgba(var(--steel), 0.55) 1.2px, transparent 1.3px);
  background-size: 9px 6px;
  opacity: 0.55;
}

nav { padding: 10px 8px; overflow: auto; flex: 1; }
nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  margin: 1px 0;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: color var(--tick), background var(--tick), border-color var(--tick);
}
nav button .glyph { width: 14px; text-align: center; opacity: 0.8; font-size: 12px; }
nav button:hover { color: var(--text); background: rgba(var(--bone), 0.04); }
nav button[aria-current="page"] {
  color: var(--text);
  border-left-color: rgb(var(--blood-lit));
  background: linear-gradient(90deg, rgba(var(--blood), 0.22), transparent 80%);
}
nav button .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  opacity: 0.8;
}

.side-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: 0.06em;
}
.side-foot b { color: var(--text); font-weight: 500; }
.side-foot .row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.side-foot .row span:last-child { font-family: var(--font-mono); color: var(--bone); }

/* ---------------------------------------------------------------- main */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar);
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--iron), 0.72);
  backdrop-filter: blur(6px);
}
.server-select { display: flex; align-items: center; gap: 10px; min-width: 0; }
.server-select select {
  min-width: 210px;
  max-width: 42vw;
  height: 32px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(var(--iron-light)) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%23a89c88'/></svg>") no-repeat right 9px center;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  appearance: none;
  cursor: pointer;
}
.server-select select:focus-visible { outline: 1px solid var(--gold-c); outline-offset: 1px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--idle); box-shadow: 0 0 0 0 currentColor; }
.pill.live { color: var(--ok); border-color: rgba(110, 190, 90, 0.35); }
.pill.live .dot { background: var(--ok); animation: pulse 2s infinite; }
.pill.stale { color: var(--warn); border-color: rgba(232, 178, 60, 0.35); }
.pill.stale .dot { background: var(--warn); }
.pill.dead { color: var(--bad); }
.pill.dead .dot { background: var(--bad); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 190, 90, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(110, 190, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 190, 90, 0); }
}

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

button.btn, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(var(--iron-light));
  color: var(--text);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--tick), border-color var(--tick), color var(--tick), transform 60ms;
  white-space: nowrap;
}
button.btn:hover { background: rgb(var(--steel-dark)); border-color: rgb(var(--steel)); }
button.btn:active { transform: translateY(1px); }
button.btn:disabled { opacity: 0.4; cursor: not-allowed; }
button.btn.primary { border-color: rgb(var(--rust)); background: linear-gradient(180deg, rgb(var(--rust)), #5d2f1a); color: #f3e6cf; }
button.btn.primary:hover { border-color: rgb(var(--blood-lit)); }
button.btn.danger { border-color: rgba(var(--blood-lit), 0.5); color: #ffb9b2; background: rgba(var(--blood), 0.18); }
button.btn.danger:hover { background: rgba(var(--blood), 0.34); }
button.btn.ghost { background: transparent; }
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 2px;
  background: rgba(var(--black), 0.5);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
}

.view { flex: 1; min-height: 0; overflow: auto; padding: 20px 22px 28px; scrollbar-gutter: stable; }
.view > .view-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; }
.view h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.view .sub { color: var(--dim); font-size: 11.5px; letter-spacing: 0.08em; }
.view .sub b { color: var(--gold-c); font-weight: 500; }

/* ---------------------------------------------------------------- tiles + cards */
.grid { display: grid; gap: 12px; }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1080px) { .grid.two { grid-template-columns: 1fr; } }

.tile {
  position: relative;
  padding: 13px 14px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(var(--bone), 0.035), transparent 42%),
    rgba(var(--iron), 0.93);
  overflow: hidden;
}
.tile::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--gold-c);
  opacity: 0.55;
}
.tile.k-blood::after { background: rgb(var(--blood-lit)); }
.tile.k-sickly::after { background: rgb(var(--gold)); }
.tile.k-gold::after { background: rgb(var(--gold)); box-shadow: 0 0 14px rgba(var(--gold), 0.45); }
.tile .k { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.tile .v {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 24px;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.tile .v small { font-size: 12px; color: var(--dim); margin-left: 4px; }
.tile .f { margin-top: 3px; font-size: 10.5px; color: var(--dim); }

.card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(var(--iron), 0.93);
  overflow: hidden;
}
.card > header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(var(--black), 0.25);
}
.card > header h2 {
  margin: 0;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}
.card > header .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card .body { padding: 12px 14px; }
.card .body.tight { padding: 0; }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgb(var(--iron));
  color: var(--dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}
tbody td {
  padding: 7px 12px;
  border-bottom: 1px solid rgba(var(--steel-dark), 0.45);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
tbody tr { cursor: default; }
tbody tr.click { cursor: pointer; }
tbody tr:hover { background: rgba(var(--bone), 0.035); }
tbody tr.selected { background: linear-gradient(90deg, rgba(var(--blood), 0.2), transparent 70%); }
td.num, th.num { text-align: right; font-family: var(--font-mono); }
td.who { color: var(--text); }
td.clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps { margin: 0; padding-left: 18px; color: var(--dim); font-size: 12px; line-height: 1.7; }
.steps li { padding-left: 4px; }
.steps b { color: var(--text); font-weight: 500; }
.steps code { font-family: var(--font-mono); color: var(--gold-c); font-size: 11px; }
td .uid { color: var(--dim); font-family: var(--font-mono); font-size: 10.5px; margin-left: 6px; }
.empty { padding: 26px 14px; text-align: center; color: var(--dim); font-size: 12px; }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.badge.ok { color: var(--ok); border-color: rgba(110, 190, 90, 0.4); }
.badge.err { color: var(--bad); border-color: rgba(235, 70, 60, 0.4); }
.badge.warn { color: var(--warn); border-color: rgba(232, 178, 60, 0.4); }
.badge.pending { color: #a89c88; }
.badge.rank-VIP { color: var(--gold-c); }
.badge.rank-Moderator { color: var(--ok); }
.badge.rank-Admin { color: var(--accent); }
.badge.rank-Owner { color: #ffc850; }
.badge.rank-Tester { color: #50c8e6; }

/* ---------------------------------------------------------------- action cards */
.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.act {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(var(--bone), 0.025), transparent 50%), rgb(var(--iron));
  transition: border-color var(--tick), transform 80ms;
}
.act:hover { border-color: rgba(var(--steel), 0.55); }
.act.destructive { border-left: 2px solid rgba(var(--blood-lit), 0.7); }
.act.disabled { opacity: 0.45; }
.act .head { display: flex; align-items: baseline; gap: 8px; }
.act .name { font-size: 13px; letter-spacing: 0.06em; }
.act .sig { font-family: var(--font-mono); font-size: 10px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.act .desc { font-size: 11px; color: var(--dim); line-height: 1.4; min-height: 15px; }
.act .why { font-size: 10.5px; color: var(--warn); }
.act .fields { display: flex; flex-wrap: wrap; gap: 6px; }
.act .foot { display: flex; align-items: center; gap: 6px; }
.act .foot .spacer { margin-left: auto; }

.field {
  height: 28px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(var(--black), 0.55);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}
.field:focus { outline: 1px solid rgb(var(--rust)); outline-offset: 0; border-color: rgb(var(--rust)); }
.field.num { width: 84px; font-family: var(--font-mono); }
.field.player { min-width: 128px; max-width: 170px; }
.field.wide { flex: 1 1 140px; }
select.field { appearance: none; padding-right: 20px; cursor: pointer; }
input[type="checkbox"].field { width: 30px; height: 16px; padding: 0; accent-color: rgb(var(--blood-lit)); }

/* ---------------------------------------------------------------- drawer */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 20;
  width: 380px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(var(--iron)), rgb(var(--black)));
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 180ms ease;
}
.drawer[data-open="true"] { transform: translateX(0); }
.drawer header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.drawer header .who { min-width: 0; }
.drawer header b { display: block; font-size: 15px; font-weight: 500; letter-spacing: 0.04em; }
.drawer header small { color: var(--dim); font-family: var(--font-mono); font-size: 10.5px; }
.drawer .close { margin-left: auto; }
.drawer .body { padding: 14px 16px 24px; overflow: auto; }
.drawer .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.drawer h3 { margin: 16px 0 7px; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.drawer .act { margin-bottom: 8px; }

/* ---------------------------------------------------------------- feed + toasts */
.feed {
  border-top: 1px solid var(--line);
  background: rgba(var(--iron), 0.86);
  backdrop-filter: blur(6px);
  max-height: 168px;
  display: flex;
  flex-direction: column;
}
.feed header { display: flex; align-items: center; gap: 10px; padding: 6px 16px; border-bottom: 1px solid var(--line-soft); }
.feed header h2 { margin: 0; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.feed header .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.feed ul { list-style: none; margin: 0; padding: 4px 10px 8px; overflow: auto; }
.feed li {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 3px 6px;
  border-bottom: 1px solid rgba(var(--steel-dark), 0.3);
  font-size: 11.5px;
}
.feed li .t { color: var(--dim); font-family: var(--font-mono); font-size: 10px; }
.feed li .m { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed li .m b { font-weight: 500; color: var(--text); }
.feed li .s { font-family: var(--font-mono); font-size: 10px; }
.feed li .s.ok { color: var(--ok); }
.feed li .s.err { color: var(--bad); }
.feed li .s.warn { color: var(--warn); }
.feed li .s.pending { color: #a89c88; }
.feed li .line2 { grid-column: 2 / -1; color: var(--dim); font-size: 10.5px; margin-top: -2px; white-space: normal; }

#toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 340px;
  max-width: 88vw;
}
.toast {
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(var(--iron));
  box-shadow: var(--shadow);
  animation: rise 160ms ease-out;
}
.toast .bar { border-radius: 2px; background: var(--idle); }
.toast.ok .bar { background: var(--ok); }
.toast.err .bar { background: var(--bad); }
.toast.warn .bar { background: var(--warn); }
.toast .tt { font-size: 12px; letter-spacing: 0.05em; }
.toast .tb { color: var(--dim); font-size: 11px; margin-top: 2px; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- palette */
.palette {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 11vh;
  background: rgba(var(--black), 0.62);
  backdrop-filter: blur(3px);
}
.palette[hidden] { display: none; }
.palette .box {
  width: 680px;
  max-width: 94vw;
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  background: rgb(var(--iron));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.palette .input-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.palette .input-row .prompt { font-family: var(--font-mono); color: var(--gold-c); font-size: 16px; }
.palette input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  outline: none;
}
.palette input::placeholder { color: rgba(var(--bone-dim), 0.55); }
.palette .hint { padding: 6px 14px; border-bottom: 1px solid var(--line-soft); color: var(--dim); font-size: 10.5px; letter-spacing: 0.06em; }
.palette ul { list-style: none; margin: 0; padding: 4px; max-height: 46vh; overflow: auto; }
.palette li {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 2px;
  cursor: pointer;
}
.palette li .n { font-family: var(--font-mono); font-size: 12px; color: var(--text); }
.palette li .n .args { color: var(--dim); }
.palette li .d { color: var(--dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette li .d b { color: var(--bone); font-weight: 500; }
.palette li[aria-selected="true"] { background: linear-gradient(90deg, rgba(var(--blood), 0.35), rgba(var(--blood), 0.08)); }
.palette li[aria-selected="true"] .n { color: #fff3e2; }
.palette li.no { cursor: default; color: var(--dim); display: block; padding: 14px 12px; }
.palette .status { padding: 7px 14px; border-top: 1px solid var(--line-soft); color: var(--dim); font-size: 10.5px; display: flex; gap: 14px; }
.palette .status b { color: var(--bone); font-weight: 500; }

/* ---------------------------------------------------------------- gate */
/* signed out: the panel is not merely blurred, it is not painted at all */
body.locked .app,
body.locked .drawer,
body.locked #toasts { visibility: hidden; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 620px at 50% 32%, rgba(var(--rust), 0.16), transparent 62%),
    radial-gradient(1100px 800px at 85% 110%, rgba(var(--blood), 0.10), transparent 60%),
    rgb(var(--black));
}
.gate .box {
  position: relative;
  width: 430px;
  max-width: 92vw;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(var(--bone), 0.05), transparent 30%),
    rgb(var(--iron));
  box-shadow: var(--shadow), 0 0 0 1px rgba(var(--blood), 0.18), 0 0 90px rgba(var(--blood), 0.12);
}
.gate .box.login { width: 396px; padding: 28px 26px 20px; }
.gate .sigil { position: relative; width: 62px; height: 62px; margin: 0 auto 14px; }
.gate .sigil .ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(var(--gold), 0.4);
  border-radius: 50%;
  animation: spin 11s linear infinite;
}
.gate .sigil .ring::before {
  content: "";
  position: absolute;
  top: -2px; left: 50%;
  width: 5px; height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: rgb(var(--gold));
  box-shadow: 0 0 8px rgba(var(--gold), 0.8);
}
.gate .sigil .ring.r2 { inset: 10px; border-color: rgba(var(--blood-lit), 0.5); animation-duration: 7s; animation-direction: reverse; }
.gate .sigil .core {
  position: absolute;
  inset: 23px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--blood-lit), 0.95), rgba(var(--blood-lit), 0) 72%);
  box-shadow: 0 0 26px rgba(var(--blood-lit), 0.5);
  animation: breathe 2.8s ease-in-out infinite;
}
.gate h1 {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 25px;
  letter-spacing: 0.2em;
  text-shadow: 0 0 26px rgba(var(--blood-lit), 0.4);
}
.gate .kicker {
  margin: 4px 0 18px;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-c);
}
.gate p { margin: 0 0 16px; color: var(--dim); font-size: 11.5px; line-height: 1.5; }
.gate code { font-family: var(--font-mono); color: var(--gold-c); }
.gate input { width: 100%; height: 36px; }
.gate .field-label {
  display: block;
  margin: 12px 0 5px;
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--dim);
}
.gate .err { color: var(--bad); font-size: 11.5px; min-height: 16px; margin: 10px 0 0; }
.gate .fine { margin: 12px 0 0; text-align: center; font-size: 9px; letter-spacing: 0.12em; color: rgba(var(--bone-dim), 0.55); }
.gate .row { display: flex; gap: 8px; align-items: center; }
.gate .linkish {
  display: block;
  margin: 12px auto 0;
  padding: 2px;
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 10.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.gate .linkish:hover { color: var(--bone); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: 0.5; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.08); } }

/* ---------------------------------------------------------------- misc */
.mono { font-family: var(--font-mono); }
.dim { color: var(--dim); }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.spacer { margin-left: auto; }
.hr { height: 1px; background: var(--line-soft); margin: 14px 0; }
.scroll-x { overflow-x: auto; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: rgba(var(--black), 0.4); }
*::-webkit-scrollbar-thumb { background: rgb(var(--steel-dark)); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: rgb(var(--steel)); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  #bg { opacity: 0.5; }
}
@media (max-width: 860px) {
  :root { --sidebar: 62px; }
  .brand b { font-size: 11px; letter-spacing: 0.04em; }
  .brand span, .brand .chain { display: none; }
  nav button { justify-content: center; padding: 10px 4px; }
  nav button .label, nav button .count { display: none; }
  .side-foot { display: none; }
  .grid.two { grid-template-columns: 1fr; }
}
