/* BlockOps admin: hangar steel and hazard amber. Dense, quiet tables; the hazard stripe marks only what isn't live. */
:root {
  --bg: #161d27;        /* hangar floor at night */
  --panel: #1f2835;     /* steel plate */
  --raised: #283344;
  --line: #354257;
  --text: #e4e9f0;
  --muted: #8d9aae;
  --amber: #f2b33d;     /* the game's hazard paint */
  --amber-ink: #241a05;
  --red: #e5533d;
  --green: #5fcf86;
  --blue: #6ea8ff;
  --r-common: #b0b8c4; --r-uncommon: #5fcf86; --r-rare: #4f8cff; --r-epic: #b05cff; --r-legendary: #ff9a2e; --r-mythic: #ff4d6a;
  --radius-s: 3px; --radius-m: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--blue); }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 4px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 28px 0 10px; font-weight: 650; }
h3 { font-size: 15px; margin: 18px 0 8px; font-weight: 650; }
p { margin: 0 0 10px; max-width: 72ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.id { font-family: var(--mono); font-size: 13px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---- controls */
button, .btn { font: inherit; font-size: 14px; padding: 7px 14px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--raised); color: var(--text); cursor: pointer; }
button:hover { border-color: var(--muted); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); font-weight: 650; }
button.danger { background: transparent; color: var(--red); border-color: var(--red); }
button.link { background: none; border: none; color: var(--blue); padding: 0; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 8px; min-width: 0; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--amber); }
input:disabled, select:disabled { color: var(--muted); }
input.changed, select.changed { border-color: var(--amber); }
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label.field > span { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: grid; gap: 12px; }

/* ---- sign-in screens */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-box { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 28px; }
.gate-box h1 { margin-bottom: 6px; }
.gate-box form { display: grid; gap: 14px; margin-top: 18px; }
.mark { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.mark svg { width: 26px; height: 26px; }
.qr { background: #fff; padding: 10px; border-radius: var(--radius-s); width: 220px; margin: 6px 0; }
.qr svg { display: block; width: 200px; height: 200px; }
.secret { font-family: var(--mono); word-break: break-all; background: var(--bg); padding: 8px; border-radius: var(--radius-s); border: 1px solid var(--line); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font-family: var(--mono); font-size: 16px; background: var(--bg); padding: 12px; border-radius: var(--radius-s); border: 1px solid var(--line); }
.error { color: var(--red); font-size: 14px; min-height: 1.5em; }

/* ---- shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
nav.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
nav.side .mark { padding: 0 8px; color: var(--text); font-weight: 650; font-size: 15px; }
nav.side .group { color: var(--muted); font-size: 13px; padding: 14px 8px 4px; }
nav.side a { display: block; padding: 6px 8px; border-radius: var(--radius-s); color: var(--text); text-decoration: none; }
nav.side a:hover { background: var(--raised); }
nav.side a[aria-current=page] { background: var(--raised); box-shadow: inset 3px 0 0 var(--amber); }
nav.side .who { margin-top: 24px; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
nav.side .who b { color: var(--text); font-weight: 600; display: block; }
main { padding: 26px 32px 120px; min-width: 0; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 0; }

/* ---- the draft bar: hazard stripes only while the draft isn't what's live */
.draftbar { position: fixed; left: 220px; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 32px; background: var(--panel); border-top: 1px solid var(--line); }
.draftbar.pending { border-top: 0; padding-top: 18px; }
.draftbar.pending::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(-45deg, var(--amber) 0 10px, #1a1a1a 10px 20px); }
.draftbar .what { flex: 1; min-width: 200px; }
.draftbar .what b { font-weight: 650; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
.pill.bad { color: var(--red); border-color: var(--red); }
.pill.warn { color: var(--amber); border-color: var(--amber); }
.pill.ok { color: var(--green); border-color: var(--green); }

/* ---- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 13px; background: var(--raised); position: sticky; top: 0; z-index: 1; }
tr:last-child td { border-bottom: 0; }
tr.edited td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--raised); }
td.right, th.right { text-align: right; }
.price { display: inline-flex; gap: 4px; }
.price input { width: 96px; text-align: right; }
.price select { width: 84px; }

/* ---- panels and stats */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; margin: 16px 0; }
.panel > h2:first-child { margin-top: 0; }
.panel.stack > * { margin-top: 0; margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.stats > div { padding: 14px 16px; border-right: 1px solid var(--line); }
.stats b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; font-weight: 650; }
.stats span { color: var(--muted); font-size: 13px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.issues li { margin: 4px 0; }
.issues .path { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-right: 6px; }
ul.changes { margin: 0; padding-left: 18px; font-size: 14px; }
ul.changes li { margin: 2px 0; }

/* ---- crates */
.crates { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.crate-list button { display: block; width: 100%; text-align: left; margin-bottom: 6px; padding: 10px 12px; background: var(--panel); }
.crate-list button[aria-pressed=true] { border-color: var(--amber); }
.crate-list small { display: block; color: var(--muted); }
.odds { display: grid; gap: 6px; }
.odds .r { display: grid; grid-template-columns: 110px 90px 1fr 70px; gap: 10px; align-items: center; }
.odds .r > span:first-child { white-space: nowrap; }
.odds input { width: 90px; text-align: right; }
.bar { height: 10px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; }
.total { font-variant-numeric: tabular-nums; font-weight: 650; }
.total.bad { color: var(--red); }
.rar { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

/* ---- modal and toasts */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 24px; width: min(440px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(5, 8, 12, .7); }
dialog form { display: grid; gap: 14px; }
#toasts { position: fixed; right: 18px; top: 18px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--raised); border: 1px solid var(--line); border-left: 3px solid var(--green); padding: 10px 14px; border-radius: var(--radius-s); max-width: 380px; }
.toast.bad { border-left-color: var(--red); }
pre.detail { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; font-size: 12px; overflow-x: auto; max-height: 340px; margin: 6px 0 0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  nav.side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 2px; padding: 10px; }
  nav.side .group, nav.side .who { display: none; }
  nav.side .mark { width: 100%; margin-bottom: 6px; }
  main { padding: 18px 16px 150px; }
  .draftbar { left: 0; padding: 12px 16px; }
  .cols, .crates { grid-template-columns: 1fr; }
  .odds .r { grid-template-columns: 96px 76px 1fr; }
  .odds .r > span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
button.link.danger { color: var(--red); border: 0; background: none; }
input.setting { width: 7.5em; text-align: right; }
table.compact td { padding-top: 4px; padding-bottom: 4px; }
details > summary { cursor: pointer; margin: 12px 0 6px; font-weight: 600; }
section.panel { margin-bottom: 18px; }
label.field.grow { min-width: min(100%, 260px); }

/* "new in the build" on the Publish pages */
.buildnews.has-new { border-color: var(--amber); }
.buildnews fieldset.picks { border: 1px solid var(--line); border-radius: var(--radius-s); margin: 10px 0; padding: 8px 12px 10px; }
.buildnews fieldset.picks legend { color: var(--muted); font-size: 13px; padding: 0 4px; }
.buildnews fieldset.picks label { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; font-size: 14px; overflow-wrap: anywhere; }
.buildnews fieldset.picks input { flex: none; margin-top: 3px; }
.buildnews details { margin: 10px 0; }
a.pill { text-decoration: none; }

/* Block Bucks and ads page */
input.w-7 { width: 7em; } input.w-8 { width: 8em; } input.w-10 { width: 10em; } input.w-14 { width: 14em; }
.nowrap { white-space: nowrap; }
p.warn, span.warn { color: var(--amber); }
td select.rarity { min-width: 8em; }
