@font-face {
  font-family: Anton;
  src: url(fonts/anton-latin-400-normal.woff2) format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  font-weight: 400;
  src: url(fonts/space-mono-latin-400-normal.woff2) format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  font-weight: 700;
  src: url(fonts/space-mono-latin-700-normal.woff2) format('woff2');
  font-display: swap;
}

:root {
  --ink: #17130f;
  --paper: #f8f3e7;
  --paper-line: #d9d0bc;
  --red: #e22d1b;
  --heavy: Anton, Impact, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--paper);
  font: 400 16px/1.5 var(--mono);
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.receipt {
  position: relative;
  width: min(100% - 32px, 440px);
  margin: 28px auto 48px;
  padding: 28px 24px 30px;
  background: var(--paper);
  color: var(--ink);
}
.receipt::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 10px;
  background:
    linear-gradient(135deg, var(--paper) 50%, transparent 50%) 0 0 / 20px 20px,
    linear-gradient(-135deg, var(--paper) 50%, transparent 50%) 0 0 / 20px 20px;
}

h1 {
  margin: 0;
  font: 400 clamp(46px, 14.2vw, 62px) / 1.05 var(--heavy);
  text-align: center;
  text-transform: uppercase;
}

.tagline {
  margin: 12px 0 18px;
  padding-bottom: 16px;
  border-bottom: 2px dashed var(--ink);
  text-align: center;
}

#guests {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  overflow-wrap: anywhere;
}
#guests:empty { display: none; }
#guests li {
  display: flex;
  align-items: center;
  border-bottom: 1px dotted var(--paper-line);
  font-weight: 700;
}
#guests i {
  min-width: 3ch;
  margin-right: 1ch;
  font-style: normal;
  font-weight: 400;
}
#guests span { flex: 1; min-width: 0; text-transform: uppercase; }
#guests button {
  width: 44px;
  height: 40px;
  border: 0;
  background: none;
  font-size: 22px;
}

#add { display: flex; gap: 8px; }
#name {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fff;
  font-size: 18px;
}
#add-btn {
  height: 50px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}
#add-btn:disabled, #name:disabled { opacity: .45; cursor: not-allowed; }

#hint { margin: 8px 0 14px; font-size: 14px; }

.primary, .secondary {
  display: block;
  width: 100%;
  min-height: 60px;
  border: 0;
  font: 400 26px/1.1 var(--heavy);
  letter-spacing: .03em;
  text-transform: uppercase;
}
.primary { background: var(--red); color: var(--paper); }
.primary:disabled { background: var(--paper-line); color: #6e6655; cursor: not-allowed; }
.secondary { background: var(--paper); color: var(--ink); }

.link {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 0;
  background: none;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#replay-names { font-weight: 700; text-align: center; text-transform: uppercase; overflow-wrap: anywhere; }

#race {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
}
.stage-box {
  position: relative;
  width: min(100vw, calc(100dvh * 9 / 16));
  height: 100dvh;
}
#stage { display: block; width: 100%; height: 100%; }
#mute {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 19, 15, .55);
  color: var(--paper);
  font-size: 20px;
  line-height: 1;
}
#mute[aria-pressed='true'] { text-decoration: line-through; opacity: .6; }

#result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 100dvh;
  padding: 14px 16px 22px;
}
#receipt {
  display: block;
  max-width: min(100%, 460px);
  max-height: 62dvh;
  object-fit: contain;
}
.actions { display: grid; gap: 10px; width: min(100%, 440px); }
.actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .link { margin: 0; color: var(--paper); }

#info, .page {
  width: min(100% - 32px, 620px);
  margin: 0 auto;
  padding-bottom: 40px;
}
#info h2, .page h2 { margin: 28px 0 4px; font: 400 26px/1.2 var(--heavy); letter-spacing: .02em; text-transform: uppercase; }
#info p, .page p { margin: 0 0 12px; }
#info nav { display: flex; gap: 20px; margin-top: 28px; }
.page { padding-top: 32px; }
.page h1 { color: var(--paper); text-align: left; }
.page nav { margin-top: 28px; }
