:root {
  --bg: #050608;
  --bg-2: #0b0e14;
  --panel: rgba(16, 18, 24, 0.92);
  --panel-solid: #12151d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(206, 17, 38, 0.45);
  --text: #f4f6fb;
  --muted: #9aa3b5;
  --red: #ce1126;
  --red-hot: #ff2d45;
  --blue: #0038a8;
  --blue-glow: #1a5cff;
  --gold: #fcd116;
  --ok: #3dd68c;
  --bad: #ff7a8a;
  --sidebar: 268px;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
  --display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: none; color: #ffe566; }
code, .key {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  background: rgba(255,255,255,.04);
  padding: 2px 6px;
  border-radius: 6px;
}

.ico { width: 18px; height: 18px; flex: 0 0 auto; }

/* ——— Login ——— */
.page-login {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 50% at 15% 20%, rgba(0, 56, 168, 0.35), transparent 55%),
    radial-gradient(ellipse 55% 45% at 85% 75%, rgba(206, 17, 38, 0.32), transparent 50%),
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(252, 209, 22, 0.08), transparent 60%),
    linear-gradient(180deg, #07090e 0%, #050608 100%);
}
.login-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px 40px;
  position: relative;
  overflow: hidden;
}
.login-aura {
  position: absolute;
  inset: -20%;
  background:
    conic-gradient(from 180deg at 50% 50%, transparent 0deg, rgba(206,17,38,.08) 80deg, transparent 140deg, rgba(0,56,168,.1) 220deg, transparent 300deg);
  animation: spin 28s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.login-brand { text-align: center; }
.login-logo {
  width: min(220px, 58vw);
  height: auto;
  background: transparent;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.45));
  margin-bottom: 6px;
  animation: floaty 5s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.login-kicker {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0.28em;
  font-size: 18px;
  color: var(--gold);
}
.login-title {
  margin: 2px 0 8px;
  font-family: var(--display);
  font-size: clamp(48px, 12vw, 72px);
  line-height: 0.9;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff 20%, #c8d0e0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-sub {
  margin: 0 auto;
  max-width: 320px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.login-card {
  width: 100%;
  background: linear-gradient(160deg, rgba(22,26,36,.95), rgba(10,12,18,.98));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 24px 22px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.05);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--gold), var(--red));
}
.login-card h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
}
.login-form { margin-top: 16px; }
.login-foot {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(154,163,181,.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ——— App shell / sidebar ——— */
.page-app {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(206,17,38,.12), transparent 50%),
    radial-gradient(ellipse 40% 35% at 0% 100%, rgba(0,56,168,.14), transparent 45%),
    var(--bg);
}
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
  max-width: calc(var(--sidebar) + 1280px);
  margin: 0 auto;
  background: rgba(5, 6, 8, 0.55);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), var(--shadow);
}
/* Must not occupy layout slots (breaks sidebar | main) */
.app-shell > .nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.app-shell > .nav-backdrop {
  display: none;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0c1018 0%, #080a10 100%);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  z-index: 40;
}
.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.sidebar-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: transparent;
  border: 0;
}
.sidebar-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.08em;
  line-height: 1;
}
.sidebar-brand span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.sidebar-nav {
  flex: 1;
  overflow: auto;
  padding: 4px 0;
}
.nav-group { margin-bottom: 16px; }
.nav-group-label {
  margin: 0 10px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(154,163,181,.65);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, color .15s, transform .15s;
}
.nav-link:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
  text-decoration: none;
}
.nav-link.active {
  background: linear-gradient(90deg, rgba(206,17,38,.22), rgba(0,56,168,.12));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--red);
}
.nav-link.soon {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.nav-link em {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(252,209,22,.1);
  border: 1px solid rgba(252,209,22,.25);
  padding: 2px 6px;
  border-radius: 999px;
}
.sidebar-foot {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.nav-link.logout { color: #ff9aa5; }
.nav-link.logout:hover { background: rgba(206,17,38,.12); color: #ffc0c6; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px 8px;
  width: 100%;
  box-sizing: border-box;
}
.topbar-title h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.topbar-title .muted { margin: 4px 0 0; }
.topbar-meta { margin-left: auto; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ok);
  background: rgba(61,214,140,.1);
  border: 1px solid rgba(61,214,140,.28);
}
.pill::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.menu-btn {
  display: none;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--text);
  cursor: pointer;
}
.content {
  flex: 1;
  padding: 8px 24px 28px;
  width: 100%;
  box-sizing: border-box;
}
.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px 20px;
  color: rgba(154,163,181,.55);
  font-size: 12px;
  border-top: 1px solid transparent;
  width: 100%;
  box-sizing: border-box;
}

/* ——— Surfaces ——— */
.hero {
  margin-bottom: 8px;
}
.hero h1 { display: none; } /* title lives in topbar */
.muted { color: var(--muted); font-size: 14px; line-height: 1.45; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.card h1, .card h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 8px 0 18px;
}
.stat {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(24,28,40,.95), rgba(12,14,20,.98));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px;
}
.stat::after {
  content: "";
  position: absolute;
  right: -20px; top: -20px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(206,17,38,.25), transparent 70%);
}
.stat:nth-child(2)::after { background: radial-gradient(circle, rgba(0,56,168,.3), transparent 70%); }
.stat:nth-child(3)::after { background: radial-gradient(circle, rgba(252,209,22,.22), transparent 70%); }
.stat strong {
  display: block;
  position: relative;
  font-family: var(--display);
  font-size: 40px;
  letter-spacing: 0.04em;
  line-height: 1;
}
.stat span {
  position: relative;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.form { display: flex; flex-direction: column; gap: 12px; }
.form.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form.grid2 .full { grid-column: 1 / -1; }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
input, select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(5,7,12,.85);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  border-color: rgba(26,92,255,.55);
  box-shadow: 0 0 0 3px rgba(26,92,255,.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, var(--red-hot), var(--red) 45%, #8a0c1a);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(206,17,38,.28);
  transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); text-decoration: none; color: #fff; }
.btn:disabled,
.btn[disabled] {
  opacity: 0.38;
  filter: grayscale(0.55);
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
  pointer-events: none;
}
.btn:disabled:hover,
.btn[disabled]:hover {
  filter: grayscale(0.55);
  transform: none;
}
.btn.btn-block { width: 100%; padding: 13px 18px; }
.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: none;
  color: var(--text);
}
.btn.danger { background: #4a1016; box-shadow: none; }
.btn.tiny { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: top;
}
.table th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.table tbody tr:hover td { background: rgba(255,255,255,.02); }

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity .35s ease, transform .35s ease, max-height .35s ease, margin .35s ease, padding .35s ease;
  max-height: 120px;
  overflow: hidden;
}
.flash.ok { background: rgba(61,214,140,.1); border: 1px solid rgba(61,214,140,.3); color: #b8f5d3; }
.flash.err { background: rgba(206,17,38,.14); border: 1px solid rgba(206,17,38,.4); color: #ffc2c8; }
.flash.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  pointer-events: none;
}
.ok { color: var(--ok); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions-cell { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.actions-cell .btn.tiny {
  padding: 5px 8px;
  font-size: 11px;
  border-radius: 7px;
  letter-spacing: 0.02em;
  font-weight: 700;
  box-shadow: none;
}

.pill.ok-pill {
  background: rgba(61,214,140,.14);
  border: 1px solid rgba(61,214,140,.35);
  color: #b8f5d3;
}
.pill.warn-pill {
  background: rgba(255, 176, 32, .12);
  border: 1px solid rgba(255, 176, 32, .4);
  color: #ffd89a;
}

.escrow-ready-card h2 { font-size: 1.05rem; }
.escrow-ready-note { margin: 6px 0 0; font-size: 13px; }

.resources-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.resources-filters {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: flex-end;
  margin: 0;
}
.resources-filters label {
  margin: 0;
  min-width: 0;
}
.resources-filters label:first-child { width: 180px; }
.resources-filters label:nth-child(2) { width: 200px; }
.resources-toolbar-actions { gap: 6px; }

.res-table {
  table-layout: fixed;
  width: 100%;
}
.res-table .res-col-name { width: 34%; }
.res-table .res-col-state { width: 90px; }
.res-table .res-col-actions { width: auto; }
.res-table th,
.res-table td {
  padding: 7px 8px;
  vertical-align: middle;
}
.res-table .res-name code {
  font-size: 12px;
  word-break: break-all;
}
.res-table .res-state {
  white-space: nowrap;
  width: 90px;
}
.res-table .actions-cell {
  gap: 4px;
  justify-content: flex-start;
}
.res-table .actions-cell .btn.escrow-locked,
.btn.escrow-locked:disabled {
  opacity: 0.34;
  filter: grayscale(0.7);
  box-shadow: none !important;
  background: #2a2e36 !important;
  color: #8b93a3 !important;
  border: 1px solid rgba(255,255,255,.08);
  cursor: not-allowed;
  pointer-events: none;
}

/* Servers page — compact rows */
.servers-page .servers-add-form {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(160px, 240px);
  gap: 10px 12px;
  max-width: 520px;
  align-items: end;
}
.servers-page .servers-add-form .full { grid-column: 1 / -1; }
.servers-page .servers-add-form label { margin: 0; }
.server-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  max-width: 820px;
}
.server-row {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(140px, 1fr) minmax(160px, 1.2fr) auto auto;
  gap: 10px 12px;
  align-items: end;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(5, 7, 12, 0.45);
}
.server-row label { margin: 0; }
.server-row-slug input[readonly] {
  width: 100%;
  cursor: default;
  color: #d7deea;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  background: rgba(5,7,12,.85);
  opacity: 1;
}
.server-row-slug input[readonly]:focus {
  border-color: rgba(255,255,255,.1);
  box-shadow: none;
}
.server-row-active {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.server-row-active input { width: auto; margin: 0; }
.server-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-bottom: 2px;
}
@media (max-width: 900px) {
  .server-row {
    grid-template-columns: 1fr 1fr;
  }
  .server-row-slug,
  .server-row-actions { grid-column: 1 / -1; }
  .server-row-active { padding-bottom: 0; }
  .servers-page .servers-add-form { grid-template-columns: 1fr; max-width: none; }
}

.escrow-checks {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-width: 920px;
}
.escrow-checks li {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(5,7,12,.45);
  min-width: 0;
}
.escrow-checks li code {
  font-size: 11px;
  line-height: 1.35;
  word-break: break-word;
}
.escrow-checks .check-mark {
  flex: 0 0 auto;
  min-width: 24px;
  height: 20px;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}
@media (max-width: 820px) {
  .escrow-checks { grid-template-columns: 1fr; }
  .resources-filters label:first-child,
  .resources-filters label:nth-child(2) { width: 100%; }
  .res-table { table-layout: auto; }
  .res-table .res-col-name,
  .res-table .res-col-state,
  .res-table .res-col-actions { width: auto; }
}
.check-ok .check-mark {
  background: rgba(61,214,140,.18);
  color: #8ef0bc;
}
.check-bad {
  border-color: rgba(255, 176, 32, .35);
  background: rgba(255, 176, 32, .06);
}
.check-bad .check-mark {
  background: rgba(255, 176, 32, .2);
  color: #ffd089;
}
.check-ok code { color: #cfe9db; }
.check-bad code { color: #ffe0a8; }

.job-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(4, 6, 10, .72);
  backdrop-filter: blur(6px);
  padding: 20px;
}
.job-overlay[hidden] { display: none !important; }
.job-panel {
  width: min(420px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, rgba(22,26,34,.98), rgba(10,12,18,.98));
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  padding: 22px 22px 18px;
  text-align: center;
}
.job-panel h3 {
  margin: 12px 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
}
.job-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.12);
  border-top-color: #6ea8ff;
  animation: job-spin .8s linear infinite;
}
.job-overlay.is-done .job-spinner,
.job-overlay.is-error .job-spinner { display: none; }
.job-bar {
  margin: 16px 0 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.job-bar-fill {
  height: 100%;
  width: 15%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3d7dff, #6ea8ff);
  transition: width .45s ease;
}
.job-overlay.is-done .job-bar-fill {
  background: linear-gradient(90deg, #1f9d5c, #3dd68c);
}
.job-overlay.is-error .job-bar-fill {
  background: linear-gradient(90deg, #a01828, #ce1126);
}
.job-result {
  margin: 8px 0 12px;
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
}
@keyframes job-spin {
  to { transform: rotate(360deg); }
}

.spectate-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(4, 6, 10, .78);
  backdrop-filter: blur(6px);
  padding: 20px;
}
.spectate-overlay[hidden] { display: none !important; }
.spectate-panel {
  width: min(960px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, rgba(22,26,34,.98), rgba(10,12,18,.98));
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  padding: 16px 16px 14px;
}
.spectate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.spectate-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.spectate-meta {
  margin: 4px 0 0;
  font-size: 13px;
}
.spectate-stage {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #0a0c10;
  border: 1px solid rgba(255,255,255,.08);
  aspect-ratio: 16 / 9;
}
.spectate-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0c10;
  opacity: 0;
}
.spectate-stage img.is-ready { opacity: 1; }
.spectate-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0c10;
  opacity: 0;
}
.spectate-stage video.is-ready { opacity: 1; }
.spectate-waiting {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: rgba(255,255,255,.55);
  font-size: 14px;
  pointer-events: none;
}
.spectate-waiting[hidden] { display: none !important; }

.account-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-width: 900px;
}
.account-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(160px, 1.4fr) auto;
  gap: 10px 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(5, 7, 12, 0.45);
}
.account-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.account-row-perms {
  font-size: 12px;
  line-height: 1.35;
}
.account-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.accounts-form {
  max-width: 720px;
  gap: 10px;
}
.accounts-form label { margin: 0; }
.accounts-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}
.accounts-check input { width: auto; margin: 0; }
.perm-grid {
  margin: 4px 0 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  max-width: 720px;
}
.perm-grid legend {
  padding: 0 6px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.perm-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}
.perm-item input { width: auto; margin: 0; }
@media (max-width: 820px) {
  .account-row { grid-template-columns: 1fr; }
  .account-row-actions { justify-content: flex-start; }
  .perm-grid { grid-template-columns: 1fr; }
}

.codeblock {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(5, 7, 12, 0.9);
  border: 1px solid rgba(255,255,255,.08);
  overflow: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: #d7deea;
  white-space: pre-wrap;
}

/* Resource category accordion — [zxc] style */
.res-cat {
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(8, 10, 14, 0.65);
}
.res-cat-head {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
  background: #1a1d24;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f0f2f6;
}
.res-cat-head::-webkit-details-marker { display: none; }
.res-cat-title { flex: 0 0 auto; }
.res-cat-meta {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--font);
  letter-spacing: 0.06em;
}
.res-cat-chevron {
  margin-left: auto;
  width: 10px;
  height: 10px;
  border-right: 2px solid #c8ceda;
  border-bottom: 2px solid #c8ceda;
  transform: rotate(-135deg);
  transition: transform .18s ease;
  opacity: 0.85;
}
.res-cat:not([open]) .res-cat-chevron {
  transform: rotate(45deg);
}
.res-cat:not([open]) .res-cat-head {
  border-bottom: 0;
}
.res-cat-body { padding: 4px 8px 8px; }
.res-cat-body .table { margin: 0; }
.res-cat-head:hover { background: #22262f; }

@media (max-width: 920px) {
  .page-app { display: block; }
  .app-shell {
    display: block;
    max-width: none;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    width: min(var(--sidebar), 88vw);
    flex: none;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
  }
  .nav-toggle:checked ~ .sidebar { transform: translateX(0); }
  .app-shell > .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    z-index: 30;
  }
  .nav-toggle:checked ~ .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .menu-btn { display: grid; }
  .stats, .form.grid2 { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-logo, .login-aura { animation: none; }
}
