@font-face {
  font-family: RadioPixel;
  src: url('/assets/quake/radio-pixel.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: Space;
  src: url('/assets/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: Plex;
  src: url('/assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #171b17;
  --panel: #222820;
  --line: #414a3d;
  --cream: #f1edce;
  --muted: #b5b9a7;
  --gold: #ffcf76;
  --mono: Plex, ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--cream); font: 1rem/1.5 Space, system-ui, sans-serif; }
.frame { width: min(1120px, 90%); margin-inline: auto; }
.site-bar { border-bottom: 1px solid var(--line); }
.site-bar .frame, .site-bar nav, .panel-head, .form-actions { display: flex; align-items: center; }
.site-bar .frame { justify-content: space-between; min-height: 62px; gap: 12px; }
.site-bar nav { gap: clamp(12px, 3vw, 32px); }
.site-bar a { display: inline-flex; align-items: center; min-height: 44px; }
a { color: var(--muted); text-decoration: none; }
a:hover { color: var(--gold); text-decoration: underline; }
.site-name, .site-bar nav, .panel-head span, th, label, dt {
  font: 0.77rem/1.5 var(--mono);
}
.site-name, .panel-head span, th, dt { text-transform: uppercase; letter-spacing: .08em; }
.site-name { color: var(--cream); }
.play-link { color: var(--gold); gap: .45em; }
.mast { padding: clamp(36px, 7vw, 80px) 0 clamp(24px, 4vw, 44px); }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 {
  color: var(--gold); font: normal clamp(36px, 8.5vw, 104px)/1.15 RadioPixel, var(--mono);
  text-transform: uppercase; text-shadow: 0 .061em #775333;
}
.mast p { margin-top: 14px; color: var(--muted); }
.discoveries {
  margin-bottom: clamp(16px, 3vw, 28px); padding: 0; border: 1px solid var(--line);
  background: var(--panel);
}
.discoveries > summary {
  width: auto; display: flex; align-items: center; gap: 14px; min-height: 56px;
  padding: 12px clamp(16px, 2.4vw, 28px); list-style: none; font-weight: 600;
}
.discoveries > summary::-webkit-details-marker { display: none; }
.discoveries > summary::after { content: ''; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.discoveries[open] > summary::after { transform: rotate(225deg); }
#discovery-count { margin-left: auto; color: var(--gold); font: .8rem var(--mono); }
.discovery-body { padding: 0 clamp(16px, 2.4vw, 28px) 12px; }
.discovery-body p { color: var(--muted); font-size: .93rem; }
#discovery-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0 28px; margin: 14px 0 0; padding: 0; }
#discovery-list li { display: flex; gap: 9px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.discovery-mark { flex: none; width: 1em; font: 1rem var(--mono); color: var(--muted); }
li[data-earned] .discovery-mark, li[data-earned] .discovery-points { color: var(--gold); }
.discovery-points { margin-inline-start: auto; white-space: nowrap; color: var(--muted); font: .8rem var(--mono); }
.discovery-body .secret-toggle { display: flex; gap: 9px; align-items: center; width: fit-content; min-height: 44px; margin: 2px 0 0; cursor: pointer; color: var(--cream); }
.secret-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--gold); }
.discovery-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.layout { display: grid; grid-template-columns: minmax(0, 1.78fr) minmax(260px, 1fr); gap: clamp(16px, 3vw, 36px); align-items: start; padding-bottom: 60px; }
.board, .card { border: 1px solid var(--line); min-width: 0; background: var(--panel); }
.board { border-top: 3px solid var(--gold); }
.card { border-top: 3px solid #79836b; }
.panel-head { justify-content: space-between; padding: 18px clamp(16px, 2.4vw, 28px); border-bottom: 1px solid var(--line); }
.panel-head span, th, dt, .board-status, #profile-status, .passkeys p { color: var(--muted); }
h2 { font: 550 clamp(1.2rem, 2.3vw, 1.45rem)/1.2 Space, system-ui, sans-serif; letter-spacing: -.035em; }
table { width: 100%; table-layout: fixed; border-spacing: 0; font-variant-numeric: tabular-nums; }
.place-col { width: clamp(58px, 13%, 86px); }
.points-col { width: clamp(85px, 22%, 152px); }
th, td { padding: 12px 6px; text-align: start; border-bottom: 1px solid var(--line); }
th { background: #1d221d; font-size: .7rem; }
th:first-child, td:first-child { padding-inline-start: clamp(14px, 2.4vw, 28px); }
th:last-child, td:last-child { text-align: end; padding-inline-end: clamp(14px, 2.4vw, 28px); }
td:first-child { color: var(--muted); font: .9rem var(--mono); }
td:last-child { font: .95rem var(--mono); }
td:nth-child(2), .player-name { overflow-wrap: anywhere; }
tr[data-mine] { background: #32382a; box-shadow: inset 3px 0 var(--gold); }
tr[data-mine] td:first-child, tr[data-mine] td:last-child { color: var(--gold); }
.you { margin-inline-start: 7px; display: inline-block; font: .68rem var(--mono); color: var(--gold); text-transform: uppercase; }
.board-status { padding: 28px clamp(16px, 2.4vw, 28px); }
.board > .retry { margin: 0 clamp(16px, 2.4vw, 28px) 20px; }
details { padding: 0 clamp(16px, 2.4vw, 28px); background: #1d221d; }
summary { cursor: pointer; width: fit-content; padding: 14px 0; }
#rules { padding-bottom: 12px; }
#rules > div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 7px 0; }
#rules dt { font: inherit; letter-spacing: normal; text-transform: none; }
#rules dd { color: var(--gold); font-family: var(--mono); }
.card-inner { padding: 20px clamp(16px, 2.4vw, 28px) 24px; }
.player-name { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 600; line-height: 1.2; }
button, input { font: inherit; }
button {
  border: 1px solid #75816a; color: var(--cream); background: #2d352a;
  min-height: 43px; padding: 8px 13px; cursor: pointer; border-radius: 2px;
}
button:hover:enabled { border-color: var(--gold); }
button.primary { color: #252216; background: var(--gold); border-color: var(--gold); font-weight: 650; }
button.primary:hover:enabled { background: #ffe3a8; }
button:disabled { opacity: .55; cursor: default; }
:where(button, a, input, summary):focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.text-button { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; padding: 5px 0; background: transparent; border: 0; }
#name-form { padding: 13px 0 4px; }
label, input { display: block; }
label { color: var(--muted); margin-bottom: 5px; }
input { width: 100%; padding: 9px 12px; border: 1px solid #86927a; border-radius: 2px; color: var(--cream); background: var(--bg); }
.form-actions { margin-top: 9px; gap: 7px; flex-wrap: wrap; }
.personal-totals { display: grid; grid-template-columns: 1fr 1fr; padding-block: 17px; border-block: 1px solid var(--line); margin-top: 8px; }
.personal-totals dd { margin-top: 3px; color: var(--gold); font: 1.4rem/1.3 var(--mono); }
.passkeys { margin-top: 20px; }
.passkeys h3 { font-size: 1.1rem; }
.passkeys p { font-size: .95rem; margin: 5px 0 14px; }
.passkeys button { width: 100%; display: block; margin-top: 8px; }
.feedback:empty { display: none; }
.feedback, #profile-retry { margin-top: 14px; }
.feedback { color: var(--gold); }
[data-error] { color: #ffb9a3; }
@media (max-width: 680px) {
  .frame { width: min(92%, 550px); }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .site-bar nav { gap: 12px; }
  .site-bar a { font-size: .71rem; }
}
