/* Unbounded is the display typeface (Google Fonts, variable 400-900).
   Anton stays reserved for the meme captions themselves — that lettering is the
   Impact meme convention, not the app's own look. */
@font-face {
  font-family: 'Unbounded';
  src: url('/fonts/unbounded.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  src: url('/fonts/unbounded-ext.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'MemeImpact';
  src: url('/fonts/anton.woff2') format('woff2');
  font-weight: 400;
  font-display: block;
}

:root {
  /* neonpalet — het hele spel is donker met gloeiende buislijnen */
  --bz-black: #000000;
  --bz-white: #ffffff;
  --bz-blue: #35c8ff;
  --bz-blue-dark: #2e8bff;
  --bz-orange: #ff7a1a;
  --bz-purple: #a45dff;
  --bz-pink: #ff3ec9;
  --neon-green: #3aff8b;

  /* app tokens. De kleurkiezer van de quizmaster overschrijft deze als
     inline properties op <html> (ui.js applyColor) — alles wat kleurt moet
     dus via deze variabelen lopen, nooit hardcoded. */
  --bg: #0a081f;
  --bg-top: #171243;
  --panel: #141034;
  --panel-2: #1b1545;
  --line: #322a6e;
  --ink: #ffffff;
  --muted: #8f93c9;
  --accent: var(--bz-orange);
  --good: var(--neon-green);
  --word-g1: #9fe4ff;
  --word-g2: #cf8cf0;
  --word-g3: #ff3ec9;
  --word-glow: #ff3ec9;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Unbounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  /* Unbounded runs wide; pulling the tracking in keeps Dutch sentences compact.
     Ligatures off because uppercase Dutch "ij" otherwise turns into the Ĳ
     ligature, which reads as a U on screen ("WIE BEN JU?"). */
  letter-spacing: -0.015em;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* The flowing neon lines behind everything. `.brand-bg` marks the room-facing
   screens (lobby, verzamelen, eindstand) where they may shine at full power;
   while a meme is on screen they dim so the picture wins. */
.waves {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('/img/neon-party.svg');
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  pointer-events: none;
}
/* Once ui.js has inlined the SVG the animations run; drop the static copy. */
.waves.live {
  background-image: none;
}
.waves svg {
  display: block;
  width: 100%;
  height: 100%;
}
body.brand-bg {
  background: radial-gradient(ellipse at 50% 0%, var(--bg-top) 0%, var(--bg) 70%);
}
body.brand-bg .waves {
  opacity: 1;
}
/* Buiten de publieksschermen staat het feest niet alleen gedimd maar ook
   stil: alle rekenkracht gaat naar typen, tekst slepen en de meme-canvas.
   Dit was het verschil tussen stotteren en soepel op telefoons. */
body:not(.brand-bg) .waves svg * {
  animation-play-state: paused !important;
}

/* Every now and then a neon rim glints, like a tube catching its breath.
   Brightness only — safe on anything that glows via box-shadow. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes neon-glint {
    0%, 86%, 100% { filter: brightness(1); }
    90% { filter: brightness(1.5); }
    93% { filter: brightness(0.95); }
    96% { filter: brightness(1.35); }
  }
  .btn-primary {
    animation: neon-glint 7s linear infinite;
    animation-delay: -3s;
  }
}

/* chrome/neon headline: gradient in the letters, glow around them */
.neon-word {
  background: linear-gradient(180deg, var(--word-g1) 0%, var(--word-g2) 55%, var(--word-g3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--word-glow) 45%, transparent))
    drop-shadow(0 0 3px color-mix(in srgb, var(--word-g1) 60%, transparent))
    drop-shadow(0 2px 3px rgba(0, 0, 0, 0.85));
}

/* meme lettering only */
.meme-font {
  font-family: 'MemeImpact', Impact, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

/* headline: Unbounded at its heaviest, with a lean */
.bz-head {
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.bz-slant {
  transform: skewX(-8deg);
}

/* ---------------------------------------------------------- meme stage --- */

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 16 / 9);
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Fit the meme inside its box whatever the picture's shape — landscape stills
   and vertical phone screenshots both end up as large as they can be. */
.fitbox {
  flex: 1;
  min-height: 0;
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fitbox > .stage {
  width: min(100cqw, 100cqh * var(--arn, 1.7778));
  height: auto;
}

/* -------------------------------------------------------------- shared --- */

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  transition: transform 0.08s ease, filter 0.15s ease, background 0.15s ease;
}
button:active {
  transform: scale(0.97);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Neon tube buttons: dark glass with a glowing coloured rim.
   .btn = oranje (terug/gewoon), .btn-primary = groen (verder), .btn-ghost = paars. */
.btn {
  background: rgba(10, 8, 31, 0.65);
  color: var(--ink);
  border: 2px solid var(--bz-orange);
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 800;
  box-shadow: 0 0 16px color-mix(in srgb, var(--bz-orange) 35%, transparent),
    inset 0 0 12px color-mix(in srgb, var(--bz-orange) 10%, transparent);
}
.btn:hover:not(:disabled) {
  box-shadow: 0 0 24px color-mix(in srgb, var(--bz-orange) 55%, transparent),
    inset 0 0 14px color-mix(in srgb, var(--bz-orange) 18%, transparent);
}

.btn-primary {
  background: color-mix(in srgb, var(--neon-green) 8%, transparent);
  color: #fff;
  border: 2px solid var(--neon-green);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 0 18px color-mix(in srgb, var(--neon-green) 40%, transparent),
    inset 0 0 14px color-mix(in srgb, var(--neon-green) 10%, transparent);
  text-shadow: 0 0 10px color-mix(in srgb, var(--neon-green) 60%, transparent);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 28px color-mix(in srgb, var(--neon-green) 60%, transparent),
    inset 0 0 16px color-mix(in srgb, var(--neon-green) 18%, transparent);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 2px solid var(--bz-purple);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--bz-purple) 30%, transparent);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(10, 8, 31, 0.65);
  border: 1.5px solid var(--bz-blue);
  box-shadow: 0 0 12px color-mix(in srgb, var(--bz-blue) 30%, transparent);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.hidden {
  display: none !important;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bz-pink);
}
.dot.on {
  background: var(--good);
}

/* --------------------------------------------------------------- heads --- */

/* Floating head disc. --c is the player's signature colour. */
.head {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, var(--c, var(--bz-blue)) 0%, color-mix(in srgb, var(--c, #35c8ff) 70%, #000) 100%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c, #35c8ff) 55%, transparent);
  overflow: hidden;
}
/* Profile photos are square centre-crops from the phone: fill the disc. */
.head img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.head .ini {
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  font-size: 44%;
  color: #fff;
  line-height: 1;
}
.head.off {
  filter: grayscale(1) brightness(0.55);
}
