/* DOORS Stats, styled after the DOORS lobby menus: dark brown panels with
   cream borders, the cream PLAY button, octagon achievement icons, toggles,
   dot sliders, coloured credit bars and the green/purple Visions screen. */

@font-face { font-family: "Oswald"; src: url("/static/fonts/oswald-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("/static/fonts/oswald-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("/static/fonts/oswald-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("/static/fonts/oswald-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Roboto Mono"; src: url("/static/fonts/roboto-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Roboto Mono"; src: url("/static/fonts/roboto-mono-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Anything marked hidden stays hidden, even when a class gives it display: grid or flex.
   Without this, the search boxes hid rows that stayed on screen. */
[hidden] { display: none !important; }

:root {
  --bg: #1b1211;
  --panel: rgba(41, 27, 25, .95);
  --panel-solid: #291b19;
  --bar: #4a3330;
  --row: rgba(74, 51, 48, .55);
  --cream: #fcdcc2;
  --cream-hi: #fde9d8;
  --text: #fce3cf;
  --muted: #c4a491;
  --faint: #8d7064;
  --ink: #3b231f;
  --knob-off: #7b5a51;
  --track: #3d2a27;
  --track-on: #8e6556;
  --green: #66e36d;
  --green-hi: #a6f7a0;
  --green-bg: rgba(14, 52, 20, .9);
  --lav: #ecbcff;
  --lav-bg: rgba(74, 44, 92, .55);
  --pink: #ff8b9b;
  --warn-bg: rgba(78, 20, 26, .92);
  --warn-yellow: #ffd341;
  --warn-salmon: #ff958a;
  --blue-bg: linear-gradient(90deg, #2a2f7e, #45499f);
  --blue-line: #b9bff7;
  --r: 10px;
  --ui: "Oswald", "Arial Narrow", Impact, sans-serif;
  --mono: "Roboto Mono", ui-monospace, Consolas, monospace;
  /* rims for the four quarters of the ranking, hardest first */
  --rim-1: #ef6a5e;
  --rim-2: #f0b45c;
  --rim-3: #77c6ef;
  --rim-4: #7fe08b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font: 400 1.15rem/1.4 var(--ui);
  color: var(--text);
  background: var(--bg) radial-gradient(ellipse 120% 70% at 50% 0%, #3a2724 0%, #1b1211 70%) no-repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--cream-hi); text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3 { font-weight: 400; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
h2 { font-size: 1.8rem; }
p { margin: 0 0 .6em; }
code { font-family: var(--mono); font-size: .8em; background: #120b0a; padding: .1em .35em; border-radius: 4px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 22px; padding-bottom: 56px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--cream); color: var(--ink); padding: 6px 10px; z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--cream-hi); outline-offset: 2px; }
.muted { color: var(--muted); }
.caps { text-transform: uppercase; letter-spacing: .02em; }
svg.i { width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -.12em; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 6px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 1.6rem/1 var(--ui); letter-spacing: .02em; text-transform: uppercase; }
.brand-door { width: 22px; height: 30px; border: 3px solid var(--cream); border-radius: 3px; position: relative; }
.brand-door::after { content: ""; position: absolute; right: 3px; top: 11px; width: 4px; height: 4px; border-radius: 50%; background: var(--cream); }
.brand span:last-child { color: var(--cream); font-weight: 400; }
.counters { display: flex; gap: 8px; flex-wrap: wrap; }
.counter { display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .45); border-radius: 999px; padding: 4px 12px 4px 8px; font: 500 1.05rem/1.2 var(--ui); color: var(--text); text-decoration: none; }
.counter svg.i { color: var(--cream); width: 1.15em; height: 1.15em; }

/* ---------- Lobby button row (main navigation) ---------- */
.lobby-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.lobby-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 18px;
  background: #1f1413; border: 3px solid var(--cream); border-radius: var(--r);
  color: var(--cream); text-decoration: none; font: 500 1.35rem/1 var(--ui); text-transform: uppercase;
}
.lobby-btn svg.i { width: 30px; height: 30px; }
.lobby-btn:hover { background: #33221f; color: var(--cream-hi); }
.lobby-btn[aria-current="page"] { background: var(--cream); color: var(--ink); }
.lobby-btn.admin { border-color: var(--blue-line); color: #dfe2ff; background: #23265e; }
.lobby-btn.admin[aria-current="page"] { background: var(--blue-line); color: #1b1d45; }

/* ---------- Panels (the Settings / Achievements windows) ---------- */
.panel { background: var(--panel); border: 3px solid var(--cream); border-radius: var(--r); padding: 22px 26px 26px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.panel + .panel, .stack > * + * { margin-top: 20px; }
.panel-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h1, .panel-head h2 { color: var(--cream-hi); }
.panel-head .grow { flex: 1; min-width: 220px; }
.panel-close { margin-left: auto; color: var(--cream); display: inline-flex; }
.panel-close svg.i { width: 48px; height: 48px; }
.section-bar { background: var(--bar); border-radius: 8px; padding: 8px 16px; font: 600 1.3rem/1.1 var(--ui); text-transform: uppercase; color: var(--text); margin: 18px 0 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.section-bar:first-child { margin-top: 0; }
.section-bar small { font-weight: 400; font-size: .9rem; color: var(--muted); white-space: nowrap; }
.crumbs { font: 400 .95rem/1 var(--ui); text-transform: uppercase; color: var(--faint); margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

/* Progress bar from the Achievements window */
.progress { position: relative; height: 50px; border-radius: 6px; background: #3f2b28; overflow: hidden; border: 2px solid #4f3733; }
.progress-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(180deg, #fde3cd, #f6caa7); }
.progress-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(59, 35, 31, .35) calc(10% - 2px) 10%); }
.progress-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; font: 500 1.6rem/1 var(--ui); text-transform: uppercase; color: var(--ink); mix-blend-mode: normal; }
.progress-label span:last-child { color: var(--ink); }

/* ---------- PLAY button ---------- */
.play {
  display: flex; align-items: center; gap: 20px; width: 100%;
  background: linear-gradient(100deg, #f8d9be 0 78%, #f3caa8 78%);
  color: var(--ink); border: 0; border-radius: 14px; padding: 16px 28px;
  font: 700 clamp(2rem, 6vw, 3.4rem)/1 var(--ui); text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.play svg.i { width: .8em; height: .8em; }
.play small { display: block; font: 500 1rem/1.2 var(--ui); text-transform: none; color: #6b4a40; margin-top: 4px; }
.play:hover { background: linear-gradient(100deg, #fde5d0 0 78%, #f7d4b8 78%); color: var(--ink); }

/* ---------- Buttons, inputs, toggles ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none;
  font: 500 1.15rem/1 var(--ui); text-transform: uppercase;
  color: var(--text); background: #4c3531; border: 0; border-radius: 8px; padding: 11px 20px;
}
.btn:hover { background: #5d413c; color: #fff; }
.btn.cream { background: var(--cream); color: var(--ink); }
.btn.cream:hover { background: var(--cream-hi); }
.btn.pink { background: var(--pink); color: #3a1218; }
.btn.danger { background: #6a2026; color: #ffc9c4; }
.btn.danger:hover { background: #82272e; }
.btn.small { padding: 7px 12px; font-size: .95rem; }
.inline { display: inline; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0 0; }
.form { display: grid; gap: 14px; }
.form label, .field { display: grid; gap: 6px; font: 500 1rem/1.2 var(--ui); text-transform: uppercase; color: var(--muted); }
.form.row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.form.row.compact { padding: 10px 0; border-bottom: 1px solid #3d2a27; gap: 10px; }
input, textarea, select {
  font: 400 1.1rem/1.3 var(--ui); color: var(--text); text-transform: none;
  background: #1a1110; border: 2px solid #5a403b; border-radius: 8px; padding: 9px 12px; width: 100%; max-width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus { border-color: var(--cream); outline: none; }
/* Checkboxes look like the lobby toggles */
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex: none; cursor: pointer; margin: 0; padding: 0;
  width: 64px; height: 32px; border-radius: 999px; border: 0; background: var(--track); position: relative;
}
input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%; background: var(--knob-off); transition: left .12s; }
input[type=checkbox]:checked { background: var(--track-on); }
input[type=checkbox]:checked::after { left: 34px; background: var(--cream-hi); }
label.check { display: flex; align-items: center; justify-content: space-between; gap: 14px; font: 400 1.3rem/1.2 var(--ui); text-transform: none; color: var(--text); }
.notice { background: var(--bar); border-left: 6px solid var(--cream); border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; }
.notice.error { border-left-color: var(--pink); }
.danger-zone { margin-top: 24px; padding-top: 18px; border-top: 2px dashed #4a3330; }
.tag { font: 500 .75rem/1 var(--ui); text-transform: uppercase; background: #4a3330; color: var(--muted); padding: 3px 7px; border-radius: 5px; vertical-align: middle; }
.muted-row { opacity: .5; }

/* ---------- Warning banner (the lobby's red notice) ---------- */
.warn { background: var(--warn-bg); border-radius: 18px; padding: 16px 26px; display: grid; gap: 4px; margin: 0 0 22px; }
.warn p { margin: 0; display: flex; align-items: center; gap: 16px; font: 600 clamp(1.15rem, 3vw, 1.7rem)/1.2 var(--ui); text-transform: uppercase; }
.warn svg.i { width: 1.3em; height: 1.3em; }
.warn .y { color: var(--warn-yellow); }
.warn .c { color: var(--cream-hi); }
.warn .s { color: var(--warn-salmon); }

/* ---------- Octagon achievement icons ---------- */
.oct {
  --rim: var(--cream);
  display: inline-grid; place-items: center; flex: none; padding: 4px;
  width: var(--sz, 72px); height: var(--sz, 72px);
  background: conic-gradient(from 20deg, var(--rim), color-mix(in srgb, var(--rim) 55%, #fff) 25%, var(--rim) 50%, color-mix(in srgb, var(--rim) 60%, #000) 75%, var(--rim));
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
}
.oct img, .oct .empty {
  width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; background: #120b0a;
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
  color: var(--faint); font: 600 1.2rem var(--ui);
}
.s40 { --sz: 44px; }
.s56 { --sz: 60px; }
.s80 { --sz: 84px; }
.q1 { --rim: var(--rim-1); }
.q2 { --rim: var(--rim-2); }
.q3 { --rim: var(--rim-3); }
.q4 { --rim: var(--rim-4); }

/* ---------- Achievement ranking rows (styled like the credits bars) ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 70px auto minmax(0, 1fr); gap: 16px; align-items: center; padding: 10px 16px 10px 12px; border-radius: 8px; background: var(--row); }
.rank-row.q1 { background: rgba(110, 38, 36, .55); }
.rank-row.q2 { background: rgba(107, 82, 32, .5); }
.rank-row.q3 { background: rgba(32, 72, 92, .5); }
.rank-row.q4 { background: rgba(50, 86, 44, .5); }
.rank-no { font: 600 1.9rem/1 var(--ui); text-align: center; color: var(--cream-hi); font-variant-numeric: tabular-nums; }
.rank-no small { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); text-transform: uppercase; }
.rank-row h2 { font-size: 1.7rem; color: var(--cream-hi); }
.rank-row.q1 h2 { color: #ffc2bb; }
.rank-row.q2 h2 { color: #ffe39a; }
.rank-row.q3 h2 { color: #bfe8ff; }
.rank-row.q4 h2 { color: #c9f5bd; }
.rank-row .desc { margin: 2px 0 0; color: var(--text); font-size: 1.1rem; }
.rank-row .note { margin: 4px 0 0; font-style: italic; color: var(--muted); }
.rank-row .credit { margin: 4px 0 0; font-size: .8rem; text-transform: uppercase; color: var(--faint); }
.rank-row .credit a { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 0; font: 400 .95rem/1 var(--ui); text-transform: uppercase; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; display: inline-block; clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%); background: var(--rim); }

/* ---------- Visions (daily run) ---------- */
.visions-title { text-align: center; font: 700 clamp(2rem, 6vw, 3.2rem)/1 var(--mono); color: var(--lav); letter-spacing: .04em; margin: 4px 0 6px; }
.visions-sub { text-align: center; font: 400 clamp(1rem, 2.6vw, 1.35rem)/1.25 var(--mono); color: var(--lav); text-transform: uppercase; margin: 0 0 22px; }
.vision-card { background: var(--green-bg); border: 3px solid var(--green); border-radius: var(--r); padding: 22px 24px 20px; text-align: center; }
.vision-card .kicker { font: 600 clamp(1.4rem, 4vw, 2.2rem)/1 var(--ui); color: var(--green-hi); text-transform: uppercase; }
.vision-card h1 { font: 700 clamp(2.6rem, 9vw, 5rem)/1 var(--ui); color: var(--green); text-transform: uppercase; margin: 6px 0 8px; background: rgba(0, 0, 0, .18); }
.vision-card .when { font-size: clamp(1.2rem, 3vw, 1.7rem); color: var(--text); margin: 0; }
.bonus { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--green-hi); color: #123a12; border-radius: 0 0 8px 8px; padding: 8px 18px; font: 600 1.4rem/1.1 var(--ui); text-transform: uppercase; margin: -3px 3px 0; }
.bonus b { font-weight: 700; }
.day-nav { display: flex; justify-content: space-between; gap: 10px; margin: 16px 0 0; flex-wrap: wrap; }
.past-title { text-align: center; font: 400 1.3rem/1 var(--mono); color: var(--lav); text-transform: uppercase; margin: 34px 0 12px; }
.past-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.past-list a { display: block; background: #4b3330; border: 3px solid var(--cream); border-radius: var(--r); padding: 12px 16px; text-decoration: none; color: var(--text); }
.past-list a:hover { background: #5b3e3a; }
.past-list b { display: block; font: 600 1.5rem/1.1 var(--ui); color: var(--cream-hi); text-transform: uppercase; }
.past-list span { color: var(--muted); font-size: 1rem; }

/* Event rows, like the modifiers list */
.mod-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mod-list li { display: flex; align-items: center; gap: 12px; background: var(--row); border-radius: 8px; padding: 8px 10px 8px 16px; }
.mod-list .name { font-size: 1.45rem; color: var(--text); }
.mod-list .sub { color: var(--muted); font-size: 1rem; }
.mod-list .badge { margin-left: auto; background: #6e4f48; color: var(--cream-hi); border-radius: 8px; padding: 4px 10px; font: 600 1.15rem/1 var(--ui); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mod-list .door { flex: none; min-width: 86px; text-align: center; background: var(--cream); color: var(--ink); border-radius: 6px; padding: 4px 8px; font: 600 1.05rem/1 var(--ui); font-variant-numeric: tabular-nums; }
.mod-list.mines .door { background: #c9d1ff; }

/* The dot slider from Settings, used as a door 0 to 100 strip */
.dots { position: relative; height: 40px; border-radius: 10px; background: var(--track); margin: 8px 0 4px; }
.dots::before { content: ""; position: absolute; left: 14px; right: 14px; top: 50%; height: 8px; margin-top: -4px; background: radial-gradient(circle, #8a6a60 3px, transparent 3.5px) 0 0 / 10% 8px repeat-x; }
/* A tap anywhere on the strip opens the closest marker (corridor.js), so
   markers for doors next to each other can still each be picked. */
.dots:has(.dot-mark) { cursor: pointer; }
.dot-mark { position: absolute; top: 5px; width: 14px; height: 30px; margin: 0 0 0 -7px; padding: 0; border: 0; border-radius: 6px; background: var(--cream-hi); box-shadow: 0 0 0 2px var(--track); cursor: pointer; }
.dot-mark.multi { background: linear-gradient(var(--cream-hi) 0 45%, var(--pink) 45% 55%, var(--cream-hi) 55%); }
.dot-mark.near, .dot-mark:focus-visible { background: #fff; transform: scaleY(1.1); z-index: 2; }
.dot-mark:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.dot-mark.picked { background: var(--green); box-shadow: 0 0 0 2px var(--track), 0 0 12px var(--green); z-index: 1; }
.dot-mark.picked.near, .dot-mark.picked:focus-visible { background: var(--green-hi); }
.dot-scale { display: flex; justify-content: space-between; font: 400 .9rem/1 var(--ui); color: var(--faint); padding: 0 8px; font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.notes { background: var(--bar); border-radius: 8px; padding: 12px 16px; white-space: pre-wrap; }

/* ---------- Stats (Settings-style rows with a dot meter) ---------- */
.meter-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(140px, 2fr) auto; gap: 16px; align-items: center; padding: 6px 4px 6px 14px; }
.meter-row .name { font-size: 1.5rem; }
.meter { position: relative; height: 34px; border-radius: 9px; background: var(--track); overflow: hidden; }
.meter-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: #5a3f3a; }
.meter::before { content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 8px; margin-top: -4px; background: radial-gradient(circle, #8a6a60 3px, transparent 3.5px) 0 0 / 10% 8px repeat-x; z-index: 1; }
.meter-knob { position: absolute; top: 2px; bottom: 2px; width: 14px; margin-left: -7px; border-radius: 6px; background: var(--cream-hi); z-index: 2; left: 0; }
.meter-row .val { font: 500 1.15rem/1.1 var(--ui); color: var(--muted); text-align: right; min-width: 92px; font-variant-numeric: tabular-nums; }
.meter-row .val b { color: var(--cream-hi); font-weight: 600; }

/* ---------- Home ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.mini-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mini-rank li a { display: grid; grid-template-columns: 44px auto 1fr; gap: 12px; align-items: center; background: var(--row); border-radius: 8px; padding: 6px 12px; text-decoration: none; color: var(--text); font-size: 1.3rem; }
.mini-rank li a:hover { background: #5a3e3a; }
.mini-rank .rank-no { font-size: 1.4rem; }

/* ---------- Tables (admin) ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.table th { text-align: left; font: 500 .95rem/1 var(--ui); text-transform: uppercase; color: var(--muted); padding: 4px 12px; }
.table td { background: var(--row); padding: 8px 12px; vertical-align: middle; }
.table td:first-child { border-radius: 8px 0 0 8px; }
.table td:last-child { border-radius: 0 8px 8px 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table.small td { font-size: 1rem; }
.scroll-x { overflow-x: auto; }

/* ---------- Dialog (404 and errors), like the lobby's small pop-ups ---------- */
.dialog { max-width: 560px; margin: 40px auto; text-align: center; }
.dialog h1 { font-size: clamp(2rem, 5vw, 2.8rem); color: var(--cream-hi); margin-bottom: 10px; }
.dialog p { color: var(--muted); font-size: 1.25rem; }
.dialog .actions { justify-content: center; }
.dialog .btn { min-width: 150px; justify-content: center; font-size: 1.3rem; }

/* ---------- Admin ("Admin Panel" blue) ---------- */
.admin-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--blue-bg); border: 3px solid var(--blue-line); border-radius: var(--r); padding: 10px 18px; margin: 14px 0 0; }
.admin-strip strong { font: 700 1.7rem/1 var(--ui); text-transform: uppercase; color: #f2f3ff; }
.admin-strip .sub { font: 500 1rem/1.1 var(--ui); text-transform: uppercase; color: #cdd1ff; }
.admin-strip nav { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.admin-strip nav a, .admin-strip .link-btn { font: 500 1rem/1 var(--ui); text-transform: uppercase; color: #e4e6ff; text-decoration: none; background: rgba(0, 0, 0, .25); border-radius: 7px; padding: 8px 11px; border: 0; cursor: pointer; }
.admin-strip nav a:hover, .admin-strip .link-btn:hover { background: rgba(0, 0, 0, .45); }
.admin-strip nav a[aria-current="page"] { background: #e4e6ff; color: #23265e; }
.panel.blue { border-color: var(--blue-line); background: rgba(33, 36, 92, .92); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.admin-grid .panel + .panel { margin-top: 0; }

/* Rank board */
.sticky-save { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #241817; border: 3px solid var(--cream); border-radius: var(--r); padding: 8px 10px 8px 16px; margin-bottom: 16px; font-size: 1.15rem; text-transform: uppercase; color: var(--muted); }
.rank-columns { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.rank-columns .panel + .panel { margin-top: 0; }
.sortable { list-style: none; margin: 0; padding: 0; min-height: 80px; display: grid; gap: 6px; }
#unranked { max-height: 75vh; overflow-y: auto; }
#pool-filter { margin-bottom: 12px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: var(--row); cursor: grab; }
.rank-item.dragging { opacity: .35; }
.rank-item .slot { min-width: 40px; text-align: center; font: 600 1.25rem/1 var(--ui); color: var(--cream-hi); }
#unranked .slot { display: none; }
.ri-text { flex: 1; min-width: 0; display: grid; }
.ri-text b { font-weight: 500; font-size: 1.2rem; }
.ri-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem; }
.ri-actions { display: flex; gap: 4px; }
.ri-actions button { background: #1f1413; color: var(--cream); border: 2px solid var(--cream); border-radius: 7px; padding: 4px 9px; cursor: pointer; font: 500 .95rem/1 var(--ui); text-transform: uppercase; }
.ri-actions button:hover { background: var(--cream); color: var(--ink); }
#unranked [data-act="up"], #unranked [data-act="down"], #unranked [data-act="goto"] { display: none; }

/* Daily run picker */
.event-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
fieldset.ev { border: 2px solid transparent; border-radius: 8px; padding: 8px 12px; margin: 0; background: var(--row); }
fieldset.ev.on { border-color: var(--pink); background: rgba(110, 40, 52, .45); }
fieldset.ev .ev-fields { display: none; grid-template-columns: 70px 1fr; gap: 6px 8px; margin-top: 8px; }
fieldset.ev.on .ev-fields, fieldset.ev:has(input[type=checkbox]:checked) .ev-fields { display: grid; }
.ev-fields label { font-size: .8rem; }
.ev-fields label:last-child { grid-column: 1 / -1; }
.ev-fields input { padding: 6px 8px; font-size: 1rem; }
.date-pick { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 4px 0 12px; }
.date-pick input { width: auto; }
.w-small { max-width: 110px; }
.current-img { display: flex; align-items: center; gap: 16px; }

/* ---------- Footer ---------- */
.site-footer { color: var(--faint); font-size: 1rem; padding: 18px 0 26px; border-top: 2px solid #2f201e; background: rgba(0, 0, 0, .25); }
.site-footer p { margin: 0 0 4px; max-width: 52rem; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; text-transform: uppercase; font-size: .95rem; }
.site-footer a { color: var(--muted); }
.prose { max-width: 44rem; }
.prose p, .prose li { font-size: 1.2rem; color: var(--text); }
.prose h2 { margin: 22px 0 8px; font-size: 1.6rem; color: var(--cream-hi); }

@media (max-width: 820px) {
  .home-grid, .two-col, .rank-columns { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 48px auto minmax(0, 1fr); gap: 12px; }
  .rank-row h2 { font-size: 1.35rem; }
  .rank-no { font-size: 1.5rem; }
  .s80 { --sz: 64px; }
  .admin-strip nav { margin-left: 0; }
  .meter-row { grid-template-columns: 1fr auto; }
  .meter-row .meter { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 560px) {
  .lobby-btn { min-height: 50px; padding: 0 12px; font-size: 1.1rem; }
  .lobby-btn svg.i { width: 24px; height: 24px; }
  .lobby-btn .lbl-long { display: none; }
  .panel { padding: 16px 14px 18px; }
  .rank-item .oct { display: none; }
  .warn { padding: 12px 16px; }
  .mod-list .name { font-size: 1.25rem; }
  .counters { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  input[type=checkbox]::after { transition: none; }
}
.mod-list.on-green { margin-top: 14px; text-align: left; }
.mod-list.on-green li { background: rgba(0, 0, 0, .3); }
.actions.center { justify-content: center; }
.home-grid { margin-top: 20px; }
.section-bar input[type=search] { width: 240px; max-width: 50vw; padding: 5px 10px; font-size: 1rem; background: #241817; border-color: #6a4c46; }
.two-col > *, .home-grid > *, .admin-grid > * { margin-top: 0 !important; }
.event-pick { align-items: start; }
@media (max-width: 560px) {
  .lobby-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lobby-nav .lobby-btn.admin { grid-column: 1 / -1; }
  .lobby-btn { justify-content: center; gap: 6px; padding: 0 6px; font-size: 1rem; }
  .lobby-btn svg.i { width: 20px; height: 20px; }
}
@media (max-width: 560px) {
  /* Thinner markers on a phone, so doors a few apart don't hide each other. */
  .dot-mark { width: 8px; margin-left: -4px; border-radius: 4px; }
}
@media (max-width: 430px) {
  .lobby-btn svg.i { display: none; }
  .lobby-btn { font-size: 1.05rem; }
}

/* Search boxes */
.search-empty { margin: 8px 0 0; color: var(--muted); font-style: italic; }
.table-filter { display: block; width: 100%; max-width: 360px; margin: 12px 0; }
.list-filter { display: block; width: 100%; margin: 0 0 10px; }

/* Clicked door on the daily run timeline */
.timeline .hint { margin: 0 0 4px; font-size: .95rem; }
.door-detail { margin: 12px 0 0; background: var(--row); border: 2px solid var(--green); border-radius: 8px; padding: 10px 14px; }
.door-detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; margin-bottom: 6px; }
.door-plate { white-space: nowrap; font: 700 1.3rem/1 var(--ui); text-transform: uppercase; color: var(--green-hi); letter-spacing: .02em; }
.door-detail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.door-detail .name { font: 600 1.2rem/1.2 var(--ui); color: var(--text); }
.door-detail .sub { color: var(--muted); font-size: .95rem; }
.door-detail .note { color: var(--muted); }
.mod-list li.picked { outline: 2px solid var(--green); outline-offset: -2px; border-radius: 6px; }

/* Doors and difficulty under the vision card */
.run-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
.fact { flex: 1 1 200px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 2px solid #4a3330; border-radius: 8px; padding: 10px 16px; }
.fact-label { font: 500 1rem/1 var(--ui); text-transform: uppercase; color: var(--muted); }
.fact-value { font: 700 1.8rem/1 var(--ui); color: var(--text); font-variant-numeric: tabular-nums; }
.fact-value small { font-size: 1rem; color: var(--muted); margin-left: 2px; }
.meter { display: inline-flex; gap: 3px; margin-left: auto; }
.meter i { width: 10px; height: 22px; border-radius: 3px; background: var(--track); }
.meter i.on { background: var(--green); }

/* Difficulty picker in the admin daily form */
.run-basics .field { max-width: 260px; }
.rating { border: 0; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rating legend { font: 500 1rem/1.2 var(--ui); text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 6px; width: 100%; }
.form .rating label { display: inline-flex; gap: 0; }
.rating input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating span { display: inline-block; min-width: 44px; text-align: center; padding: 10px 8px; border-radius: 8px; background: var(--row); color: var(--text); font: 600 1.1rem/1 var(--ui); cursor: pointer; text-transform: uppercase; }
.rating .rate-none span { min-width: 0; padding: 10px 12px; font-weight: 500; color: var(--muted); }
.rating input:checked + span { background: var(--cream); color: var(--ink); }
.rating input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 2px; }
.door-nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.door-close, .door-step { font: 500 .95rem/1 var(--ui); text-transform: uppercase; color: var(--text); background: rgba(0, 0, 0, .25); border: 0; border-radius: 7px; padding: 8px 11px; cursor: pointer; }
.door-close:hover, .door-step:hover:not(:disabled) { background: rgba(0, 0, 0, .45); }
.door-step:disabled { opacity: .35; cursor: default; }
.door-close:focus-visible, .door-step:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

/* Sign-in security page */
.steps { margin: 14px 0 10px; padding-left: 1.4em; display: grid; gap: 6px; }
.qr-box { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin: 6px 0 10px; }
.qr { width: 220px; height: 220px; flex: none; background: #fff; border-radius: 10px; padding: 6px; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr-box > div:last-child { flex: 1 1 240px; }
.setup-key code { display: inline-block; max-width: 100%; font: 700 1.15rem/1.4 "Roboto Mono", monospace; letter-spacing: .04em; background: #1a1110; padding: 6px 10px; border-radius: 6px; }
.code-input { font: 700 1.6rem/1 "Roboto Mono", monospace; letter-spacing: .25em; max-width: 220px; }
.code-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.code-form label { flex: 0 1 260px; }
.code-form .code-input { max-width: none; }
.code-form .btn { min-height: 52px; padding: 0 28px; }
.dialog .code-input { max-width: none; text-align: center; }
.on-tag { background: var(--green); color: #123a12; }
.small-print { font-size: .95rem; margin-top: 14px; }
