/* Kill Veldor. A dark page, the title, the fire, four words. */
@font-face {
  font-family: "KV Serif"; src: url("../assets/font/DejaVuSerif-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
:root {
  --ink: #05060c; --navy: #0f1730; --bone: #f7f1e0; --mist: #aab3cf; --ember: #f0a030; --ember-hot: #ffc04a;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--bone); font: 400 1rem/1.5 "KV Serif", "DejaVu Serif", Georgia, serif; }
h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }
img, canvas, svg, video { display: block; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ember-hot); outline-offset: 3px; }

/* pixel lettering: a mask filled with the text colour, one unit per pixel */
.px {
  display: block; flex: none; width: calc(var(--cols) * var(--u)); height: calc(var(--rows) * var(--u)); background: currentColor;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}

/* ---- the fire: fills the screen, and its edges sink into the page ---- */
.fire {
  position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%;
  image-rendering: pixelated; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.55) 0, #000 30%, #000 60%, rgba(0,0,0,.38) 78%, rgba(0,0,0,.2) 100%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,.55) 0, #000 30%, #000 60%, rgba(0,0,0,.38) 78%, rgba(0,0,0,.2) 100%);
}

/* ---- the screen ---- */
.screen {
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: clamp(28px, 9vh, 96px) 16px clamp(22px, 6vh, 64px);
}
.title { --u: 2px; }
@media (min-width: 560px) { .title { --u: 3px; } }
@media (min-width: 900px) { .title { --u: 4px; } }
@media (min-width: 1300px) { .title { --u: 5px; } }
@media (min-width: 1800px) { .title { --u: 6px; } }

.menu { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 2vh, 18px); }
.menu ul { display: flex; align-items: center; justify-content: center; }
.big { gap: clamp(18px, 6vw, 84px); }
.small { gap: clamp(10px, 3vw, 40px); }
.item {
  display: block; padding: 14px 12px; border: 0; background: none; cursor: pointer; color: var(--bone);
  -webkit-tap-highlight-color: transparent; --u: 3px;
}
.big .item { --u: 4px; }
.small .item { --u: 2px; color: var(--mist); }
.item:hover, .item:focus-visible { color: var(--ember-hot); }
.item:active { transform: translateY(var(--u)); }
.item:focus-visible { outline-offset: -2px; }
@media (min-width: 900px) { .big .item { --u: 5px; } }
@media (max-width: 480px) { .big .item { --u: 3px; padding: 14px 8px; } }

/* ---- small dialogs ---- */
dialog { border: 0; padding: 0; color: var(--bone); }
dialog::backdrop { background: rgba(3,4,8,.88); }
.note { width: min(440px, 100vw - 24px); padding: 26px 24px 22px; background: var(--ink); box-shadow: 0 0 0 2px var(--bone); }
.h { --u: 2px; color: var(--bone); }
.note .h { margin-bottom: 18px; }
.note-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.note-runs { width: min(520px, 100vw - 24px); }
.note-scroll { max-height: min(58vh, 520px); overflow-y: auto; padding-right: 8px; }
.btn {
  display: inline-block; padding: 9px 16px; border: 2px solid var(--bone); background: none; cursor: pointer;
  font: inherit; font-size: .95rem; color: var(--bone); text-decoration: none;
}
.btn:hover, .btn:focus-visible { background: var(--bone); color: var(--ink); }
.btn-ember { border-color: var(--ember); background: var(--ember); color: var(--ink); }
.btn-ember:hover, .btn-ember:focus-visible { border-color: var(--ember-hot); background: var(--ember-hot); }

/* fastest runs */
.runs { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.runs td { padding: 4px 0; vertical-align: baseline; white-space: nowrap; }
.runs .c-rank { min-width: 2.2em; padding-right: 6px; color: var(--ember); }
.runs .c-name { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; letter-spacing: .03em; }
.runs .c-time { padding-left: 12px; text-align: right; }
.runs .ms { color: var(--mist); font-size: .82em; }
.runs .c-date { padding-left: 14px; text-align: right; color: var(--mist); font-size: .86em; min-width: 4.6em; }
.runs tr.you td { color: var(--ember-hot); }
.you-tag { margin-left: 8px; font-size: .78em; }
.board-msg { color: var(--mist); }
.board[data-state="ready"] .board-msg { display: none; }
.board:not([data-state="ready"]) .note-scroll { display: none; }
.board-foot { display: flex; align-items: baseline; gap: 16px; font-size: .86rem; }
.board-flag { margin: 8px 0 0 auto; color: var(--mist); }
.link-btn { margin-top: 8px; padding: 6px 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--bone); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ember-hot); }
