/* Account, lobby and admin pages. Dark theme, Geist type. */
:root {
  --accent-h: 211;
  --bg: #060510;
  --panel: #12111a;
  --raised: #1c1b29;
  --line: #1e1d2b;
  --line-strong: #2a2938;
  --line-hover: #44435a;
  --text: hsl(calc(var(--accent-h) + 5) 13% 92%);
  --heading: #f1edf5;
  --muted: #9899a3;
  --faint: #6b6d78;
  --accent: hsl(var(--accent-h) 85% 69%);
  --accent-text: #12111a;
  --accent-soft: hsl(var(--accent-h) 85% 69% / 0.12);
  --danger: #ff7a4f;
  --danger-soft: #f1b7a5;
  --ok: #21c95e;
  --radius: 10px;
  --font: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font: 450 15px/1.5 var(--font); letter-spacing: -0.005em; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--accent-soft); }

/* Header */
.top { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: #060510f2; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.top-inner { max-width: 960px; height: 64px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--heading); font-size: 20px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; flex: 0 0 auto; padding: 3px; border-radius: 9px; background: radial-gradient(circle at 50% 40%, #3a3550, #1c1b29 70%); border: 1px solid var(--line-strong); }
.menu-btn { display: none; }
.scrim { display: none; }
#nav { display: flex; gap: 6px; align-items: center; font-size: 13px; }
#nav a { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
#nav a:hover { color: var(--text); background: var(--raised); text-decoration: none; }
#nav a.on { color: var(--text); background: var(--raised); }
#nav .who { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; margin-right: 4px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line-strong); color: var(--text); font-weight: 600; }
.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; }

/* Page */
main { max-width: 960px; margin: 0 auto; padding: 36px 24px 72px; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -0.03em; color: var(--heading); margin: 0 0 6px; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--heading); margin: 0 0 14px; }
.page-head { margin-bottom: 26px; }
.page-head p { margin: 0; font-size: 14px; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 16px; }
.card-sub { margin: -10px 0 16px; font-size: 13px; color: var(--muted); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.card-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; display: flex; flex-direction: column; }
.grid > .card .push { margin-top: auto; padding-top: 16px; }
.span-2 { grid-column: 1 / -1; }

/* Sign in / sign up */
.auth { max-width: 400px; margin: 48px auto 0; }
.auth .card { padding: 30px 28px 26px; border-radius: 16px; box-shadow: 0 24px 80px -24px #000c; }
.auth-mark { display: block; width: 56px; height: 56px; padding: 5px; margin: 0 0 18px; border-radius: 14px; background: radial-gradient(circle at 50% 40%, #3a3550, #1c1b29 70%); border: 1px solid var(--line-strong); }
.auth h1 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 6px; }
.lead { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 22px; }
.fine { font-size: 13px; color: var(--muted); text-align: center; margin: 18px 0 0; }
.narrow { max-width: 440px; }

/* Fields */
label { display: block; font-size: 12px; font-weight: 500; color: #a3a4ad; margin: 0 0 6px; }
form > label, .field + label, input + label, select + label { margin-top: 14px; }
.hint { display: block; font-size: 11px; color: var(--faint); margin: 6px 0 0; }
input, select { display: block; width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: 450 14px var(--font); transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--faint); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239899a3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
select option { background: var(--panel); color: var(--text); }
input:hover, select:hover { border-color: var(--line-strong); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input.code-input { font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }

/* Buttons */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent; background: var(--accent); color: var(--accent-text); font: 650 13px var(--font); letter-spacing: -0.005em; cursor: pointer; white-space: nowrap; transition: filter .15s, border-color .15s, background .15s, color .15s; }
.button:hover { text-decoration: none; }
button:hover:not(:disabled), .button:hover { filter: brightness(1.07); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button.secondary, .button.secondary { background: var(--raised); border-color: var(--line-strong); color: var(--text); }
button.secondary:hover:not(:disabled), .button.secondary:hover { filter: none; border-color: var(--line-hover); }
button.danger { background: transparent; border-color: #ff7a4f55; color: var(--danger); }
button.danger:hover:not(:disabled) { filter: none; background: #ff7a4f14; border-color: var(--danger); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.small, .button.small { height: 30px; padding: 0 11px; font-size: 12px; font-weight: 600; border-radius: 7px; }
.block { width: 100%; }

/* Layout helpers */
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 130px; }
.row > button, .row > .button { flex: 0 0 auto; }
.actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; align-items: center; }
.auth .actions button { width: 100%; }
.muted { color: var(--muted); }
.small-text { font-size: 13px; }
.error { color: var(--danger-soft); font-size: 13px; min-height: 0; margin: 12px 0 0; }
.error:empty, .notice:empty { display: none; }
.error:not(:empty) { padding: 9px 12px; border-radius: 8px; background: #ff7a4f12; border: 1px solid #ff7a4f33; }
.notice { color: var(--ok); font-size: 13px; margin: 12px 0 0; word-break: break-all; }
.note { font-size: 13px; color: var(--muted); margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Tables and lists */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
tr:last-child td { border-bottom: 0; }
td:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; }
td.right, th.right { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; margin: 0 -2px; }
code, .code { font-family: var(--mono); font-size: 13px; }
.big-code { font-family: var(--mono); font-size: 32px; font-weight: 600; letter-spacing: 0.14em; color: var(--heading); line-height: 1.2; }
.dot { display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #3a3948; margin-right: 10px; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px #21c95e22; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 14px; min-width: 0; }
ul.plain li:first-child { padding-top: 0; }
ul.plain li:last-child { border-bottom: 0; padding-bottom: 0; }
ul.plain li > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; }
ul.plain li.muted, li.empty { color: var(--muted); font-size: 13px; }
.chars { display: flex; gap: 8px; flex-wrap: wrap; }
.chars button { background: var(--raised); color: var(--text); border-color: var(--line-strong); font-weight: 550; }
.chars button:hover:not(:disabled) { filter: none; border-color: var(--line-hover); }
.chars button.picked { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.tag { display: inline-flex; align-items: center; height: 20px; font-size: 11px; font-weight: 550; padding: 0 8px; border-radius: 99px; background: var(--raised); border: 1px solid var(--line-strong); color: var(--muted); margin-left: 8px; }
.tag.ready { border-color: #21c95e44; background: #21c95e14; color: var(--ok); }

/* Room */
.room-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.room-head .label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.room-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; color: var(--muted); text-align: right; }
.room-meta button { margin-top: 6px; }
.status:empty { display: none; }
.status { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.section-label { font-size: 12px; font-weight: 500; color: #a3a4ad; margin: 22px 0 8px; }

/* Server facts on the admin page */
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--muted); padding: 2px 2px 0; }
.facts b { color: var(--text); font-weight: 550; }

@media (max-width: 720px) {
  .top-inner { height: 56px; padding: 0 16px; gap: 10px; }
  /* Phones: the links live in a drawer opened from the top corner. A backdrop filter would
     make the header the drawer's containing block, so phones get a solid header. */
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .menu-btn:not([hidden]) { display: inline-flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 5px; width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--raised); cursor: pointer; }
  .menu-btn span { display: block; height: 2px; border-radius: 1px; background: var(--text); transition: transform 0.2s, opacity 0.2s; }
  .menu-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-btn span:nth-child(2) { opacity: 0; }
  .menu-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  #nav { position: fixed; top: 56px; right: 0; bottom: 0; width: min(300px, 84vw); flex-direction: column; align-items: stretch; gap: 4px; padding: 16px; font-size: 15px;
    background: var(--bg, #07060f); border-left: 1px solid var(--line); transform: translateX(100%); visibility: hidden; transition: transform 0.22s ease, visibility 0.22s; overflow-y: auto; z-index: 11; }
  .menu-open #nav { transform: none; visibility: visible; }
  #nav a { height: 46px; padding: 0 14px; border-radius: 10px; }
  #nav .who { height: 52px; margin: 0 0 8px; padding: 0 14px 0 8px; }
  #nav a:last-child { margin-top: auto; color: var(--muted); }
  .scrim:not([hidden]) { display: block; position: fixed; inset: 56px 0 0 0; background: #0009; z-index: 9; }
  .menu-open { overflow: hidden; }
  main { padding: 24px 16px 56px; }
  h1 { font-size: 22px; }
  .card { padding: 18px 16px; border-radius: 12px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
  .auth { margin-top: 12px; }
  .auth .card { padding: 24px 20px 22px; }
  .row > * { min-width: 100%; }
  .row > button, .row > .button { width: 100%; }
  .room-meta { align-items: flex-start; text-align: left; }
  .big-code { font-size: 28px; }
  ul.plain li { flex-wrap: wrap; }
  .brand img { width: 34px; height: 34px; }
  /* Tables become stacked rows, each cell labelled from its column header. */
  .table-wrap { overflow: visible; margin: 0; }
  table, tbody, tr, td { display: block; }
  tr:has(th) { display: none; }
  tr { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  tr:last-child { border-bottom: 0; padding-bottom: 0; }
  tr:nth-child(2) { padding-top: 0; }
  td { padding: 0 !important; border: 0; font-size: 13px; }
  td:first-child { flex: 1 0 100%; font-size: 14px; font-weight: 550; color: var(--heading); }
  td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
  td:empty { display: none; }
  td.right { flex: 1 0 100%; text-align: left; margin-top: 4px; }
}

/* Speedrun leaderboard */
.tag.verified { border-color: #21c95e44; background: #21c95e14; color: var(--ok); }
.tag.rejected { border-color: #ff7a4f44; background: #ff7a4f12; color: var(--danger-soft); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.seg button { background: var(--raised); color: var(--text); border-color: var(--line-strong); font-weight: 550; }
.seg button.picked { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.seg-label { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.time { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--heading); }
.rules { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 10px; }
.splits { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
