/* Fonts ship with the site so a school network can't block them */
@font-face { font-family: 'Barlow Condensed'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-style: normal; font-display: swap; src: url('../fonts/barlow-condensed-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/barlow-latin-600-normal.woff2') format('woff2'); }

/* ROLL CALL — broadcast-booth look: warm black stage, VTN gold, condensed slate type.
   Deliberately one dark theme: it reads best on a projector in a dim room. */
:root {
  --ink: #100f0d;
  --panel: #1a1815;
  --panel-2: #23201b;
  --line: #3a342b;
  --text: #f3ede1;
  --muted: #a89e8c;
  --gold: #dcae45;
  --gold-deep: #a97c22;
  --gold-ink: #1b1508;
  --rec: #e5484d;
  --ok: #4cbb78;
  --pending: #8fa3c9;
  --display: 'Barlow Condensed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Barlow', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font: 400 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tabnum { font-variant-numeric: tabular-nums; }

/* ---------- type ---------- */
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font: 600 13px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::after { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--gold) 45%, transparent); }
.eyebrow.bare::after { display: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; text-wrap: balance; letter-spacing: .01em; }
.muted { color: var(--muted); }
.wordmark { font: 800 22px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 10px; }
.wordmark .pip { width: 14px; height: 14px; border-radius: 3px; background: var(--gold); box-shadow: inset 0 0 0 3px var(--gold-ink), 0 0 0 1px var(--gold); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); cursor: pointer;
  font: 600 16px/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { background: #e8bd57; }
.btn.big { min-height: 60px; padding: 0 30px; font-size: 22px; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: color-mix(in srgb, var(--rec) 60%, var(--line)); color: #ffb3b5; }
.btn.ok { border-color: color-mix(in srgb, var(--ok) 60%, var(--line)); color: #a6efc2; }
.btn.icon { padding: 0 12px; min-width: 44px; }
.kbd { font: 600 11px/1 var(--body); border: 1px solid currentColor; border-radius: 4px; padding: 3px 5px; opacity: .6; letter-spacing: 0; }

label.field { display: grid; gap: 6px; }
label.field > span { font: 600 13px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
input[type=text], input[type=url], input[type=password], input[type=tel], textarea, select {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 8px;
  background: var(--ink); border: 1px solid var(--line); color: var(--text);
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer;
  font: 600 15px/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
}
.chip[aria-pressed=true], .chip.on { background: color-mix(in srgb, var(--gold) 18%, var(--panel)); border-color: var(--gold); color: var(--gold); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 700 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; }
.pill.pending { background: color-mix(in srgb, var(--pending) 18%, transparent); color: var(--pending); }
.pill.approved { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.rejected { background: color-mix(in srgb, var(--rec) 18%, transparent); color: #ff9a9d; }

.tally { display: inline-flex; align-items: center; gap: 8px; font: 700 15px/1 var(--display); letter-spacing: .2em; color: var(--rec); }
.tally::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 12px var(--rec); animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: .25; } }

#toasts { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--gold); padding: 12px 14px; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.5); transition: opacity .4s, transform .4s; }
.toast-error { border-left-color: var(--rec); }
.toast-ok { border-left-color: var(--ok); }
.toast.out { opacity: 0; transform: translateY(8px); }

.demo-flag { font: 700 11px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-ink); background: var(--gold); padding: 5px 8px; border-radius: 4px; }

/* ---------- 3D die ---------- */
.die-scene { --die: 260px; width: var(--die); height: var(--die); perspective: 1400px; position: relative; }
.die-scene > .die-bounce { position: absolute; inset: 0; }
.die-bounce { width: 100%; height: 100%; transform-style: preserve-3d; }
.die {
  position: absolute; inset: 0; transform-style: preserve-3d;
}
.die .face, .die .core {
  position: absolute; inset: 0; backface-visibility: hidden;
}
.die .core { background: var(--gold-deep); }
.die .face {
  border-radius: 13%;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.35), transparent 55%),
    linear-gradient(150deg, #ecc35c, #c99a33 60%, #b4852a);
  box-shadow: inset 0 0 0 2px rgba(255,248,225,.35), inset 0 -14px 28px rgba(80,50,0,.35);
  display: grid; place-items: center; padding: 12%;
  color: var(--gold-ink); text-align: center;
  font-family: var(--display); font-weight: 800; text-transform: uppercase; line-height: .98; letter-spacing: .01em;
  overflow-wrap: anywhere;
}
.die .face span { display: block; }
.die .f1 { transform: rotateY(0deg) translateZ(calc(var(--die) / 2)); }
.die .f2 { transform: rotateY(180deg) translateZ(calc(var(--die) / 2)); }
.die .f3 { transform: rotateY(90deg) translateZ(calc(var(--die) / 2)); }
.die .f4 { transform: rotateY(-90deg) translateZ(calc(var(--die) / 2)); }
.die .f5 { transform: rotateX(90deg) translateZ(calc(var(--die) / 2)); }
.die .f6 { transform: rotateX(-90deg) translateZ(calc(var(--die) / 2)); }
.die .c1 { transform: rotateY(0deg) translateZ(calc(var(--die) / 2 - 4px)); }
.die .c2 { transform: rotateY(180deg) translateZ(calc(var(--die) / 2 - 4px)); }
.die .c3 { transform: rotateY(90deg) translateZ(calc(var(--die) / 2 - 4px)); }
.die .c4 { transform: rotateY(-90deg) translateZ(calc(var(--die) / 2 - 4px)); }
.die .c5 { transform: rotateX(90deg) translateZ(calc(var(--die) / 2 - 4px)); }
.die .c6 { transform: rotateX(-90deg) translateZ(calc(var(--die) / 2 - 4px)); }
.die-shadow {
  position: absolute; left: 10%; right: 10%; bottom: -16%; height: 14%;
  background: radial-gradient(closest-side, rgba(0,0,0,.65), transparent); filter: blur(4px);
}
.die-scene.idle .die-bounce { animation: hover 3.6s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-10px); } }
@keyframes bounce {
  0% { transform: translateY(0) }
  12% { transform: translateY(-38%) }
  34% { transform: translateY(0) }
  48% { transform: translateY(-14%) }
  64% { transform: translateY(0) }
  74% { transform: translateY(-4%) }
  84%, 100% { transform: translateY(0) }
}
.die-scene.rolling .die-bounce { animation: bounce var(--roll-ms, 2600ms) cubic-bezier(.3,.1,.3,1) both; }
@media (prefers-reduced-motion: reduce) {
  .die-scene.idle .die-bounce, .die-scene.rolling .die-bounce { animation: none; }
  .tally::before { animation: none; }
}
