/* Drankorgel look: a Dutch street organ (draaiorgel) gone rave.
   Gold organ trim, neon pipes, chunky keys you can feel pressing down. */

@font-face { font-family: "Bungee"; src: url("/fonts/bungee.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Bungee Shade"; src: url("/fonts/bungee-shade.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --ink: #0c0716;
  --ink-2: #1a1029;
  --ink-3: #2a1c3f;
  --fg: #fff7ea;
  --muted: #cbbfdc;
  --line: rgba(255, 247, 234, 0.16);
  --gold: #ffc93c;
  --gold-deep: #b07a00;
  --pink: #ff2e88;
  --cyan: #22d3ee;
  --red: #ff4d4d;
  --green: #4ade80;
  --key: #888;
  --display: "Bungee", "Arial Black", Impact, system-ui, sans-serif;
  --shade: "Bungee Shade", "Bungee", "Arial Black", Impact, sans-serif;
  --body: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--fg);
  font: 500 17px/1.45 var(--body);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}

/* Film grain over everything, so flat black feels like a dark club, not a void. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }

.screen {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

/* Club lights on the home and join screens: two coloured spots sweeping. */
.club::before,
.club::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 140vmax;
  height: 140vmax;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  pointer-events: none;
}
.club::before {
  background:
    radial-gradient(closest-side at 20% 15%, rgba(255, 46, 136, 0.35), transparent),
    radial-gradient(closest-side at 85% 30%, rgba(34, 211, 238, 0.28), transparent),
    radial-gradient(closest-side at 50% 95%, rgba(168, 85, 247, 0.35), transparent);
}
.club::after {
  background: conic-gradient(from 0deg at 50% 50%, transparent 0 40deg, rgba(255, 201, 60, 0.08) 48deg, transparent 58deg 160deg, rgba(255, 46, 136, 0.08) 170deg, transparent 182deg 290deg, rgba(34, 211, 238, 0.07) 300deg, transparent 312deg);
  animation: sweep 18s linear infinite;
}
@keyframes sweep { to { rotate: 360deg; } }

/* ---- Brand: organ pipes over a stacked wordmark ---------------------------- */

.brand { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.pipes {
  display: flex;
  align-items: flex-end;
  gap: clamp(4px, 1.6vw, 8px);
  height: clamp(64px, 20vw, 104px);
  margin-bottom: 6px;
}
.pipes i {
  --c: var(--gold);
  position: relative;
  width: clamp(16px, 5vw, 26px);
  height: calc(var(--h, 0.6) * 100%);
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 55%, #000), var(--c) 45%, color-mix(in srgb, var(--c) 70%, #fff) 60%, color-mix(in srgb, var(--c) 60%, #000));
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35) inset;
  opacity: 0.55;
  animation: pipe 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.3s);
}
/* The mouth of the pipe. */
.pipes i::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 14%;
  height: 7px;
  border-radius: 50% 50% 2px 2px;
  background: rgba(0, 0, 0, 0.55);
}
@keyframes pipe {
  0%, 30%, 100% { opacity: 0.45; filter: none; }
  10% { opacity: 1; filter: drop-shadow(0 0 14px var(--c)) brightness(1.15); }
}

h1, .wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: 0.01em;
  font-size: clamp(52px, 17vw, 100px);
  color: var(--gold);
  text-shadow: 0 0 28px rgba(255, 201, 60, 0.35);
}
.wordmark { display: flex; flex-direction: column; align-items: center; }
.wordmark .w1 { font-family: var(--shade); color: var(--gold); font-size: 0.86em; }
.wordmark .w2 {
  background: linear-gradient(90deg, var(--cyan), #a855f7 35%, var(--pink) 65%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 18px rgba(255, 46, 136, 0.45));
}

.sub, .tag { margin: 0; color: var(--muted); font-size: 17px; }
.tag b { color: var(--fg); }
.hint { max-width: 420px; color: var(--muted); font-size: 15px; margin: 0; }

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 360px);
  color: var(--muted);
  font-size: 14px;
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- Keys (buttons) and inputs ------------------------------------------------ */

button, input {
  font: inherit;
  border-radius: 16px;
  border: 2px solid var(--line);
  padding: 14px 18px;
  min-height: 52px;
  background: var(--ink-2);
  color: var(--fg);
}

button {
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 5px 0 #05030a;
  transition: transform 60ms ease-out, box-shadow 60ms ease-out;
}
button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #05030a; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

button.big {
  width: min(100%, 360px);
  min-height: 64px;
  padding: 16px 20px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(17px, 5vw, 21px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffe08a, var(--gold) 40%, #ffb300);
  color: var(--ink);
  border: 0;
  box-shadow: 0 6px 0 var(--gold-deep), 0 10px 30px rgba(255, 201, 60, 0.35);
}
button.big:active:not(:disabled) { box-shadow: 0 2px 0 var(--gold-deep), 0 4px 14px rgba(255, 201, 60, 0.3); }

input {
  width: min(100%, 360px);
  min-height: 60px;
  text-align: center;
  font-size: 22px;
  background: rgba(12, 7, 22, 0.7);
  -webkit-user-select: text;
  user-select: text;
}
input::placeholder { color: rgba(203, 191, 220, 0.6); }

.row { display: flex; gap: 10px; width: min(100%, 360px); }
.row input { flex: 1; min-width: 0; font-family: var(--display); letter-spacing: 0.22em; text-transform: uppercase; }
.row button { font-family: var(--display); font-weight: 400; background: var(--pink); border-color: transparent; color: #fff; box-shadow: 0 5px 0 #8a0f47; }
.row button:active { box-shadow: 0 1px 0 #8a0f47; }

/* ---- Wristband / ticket: room code ------------------------------------------- */

.ticket {
  --notch: 12px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  color: var(--ink);
  border-radius: 14px;
  text-align: left;
}
.ticket::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff3d6, #ffe3a3);
  -webkit-mask: radial-gradient(circle at 0 50%, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
  mask: radial-gradient(circle at 0 50%, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
  box-shadow: 0 0 40px rgba(255, 201, 60, 0.25);
}
.ticket { isolation: isolate; }
.ticketLabel { display: block; font-family: var(--display); font-size: 12px; letter-spacing: 0.18em; color: #7a4b00; }
.ticketCode { display: block; font-family: var(--display); font-size: clamp(34px, 11vw, 44px); line-height: 1; letter-spacing: 0.12em; }
.ticketSmall { display: block; margin-top: 6px; font-size: 13px; color: #5a3d16; word-break: break-all; }

/* Two quick things to check before you join: a plain line, no fuss. */
.checks { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: var(--muted); }
.checks b { font-weight: 400; margin-right: 6px; }

/* ---- The organ key: dim own colour at rest, full blast when lit. ---------- */

.key {
  position: relative;
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--key) 28%, transparent), transparent 70%),
    color-mix(in srgb, var(--key) 12%, var(--ink));
  transition: background 60ms linear;
  overflow: hidden;
}
.key.lit {
  background: var(--key);
  transition: none;
  box-shadow: inset 0 0 140px rgba(255, 255, 255, 0.6);
}
.keyName { display: flex; flex-direction: column; font-family: var(--display); font-size: 28px; }
.keyName small { font-family: var(--body); font-size: 14px; color: rgba(255, 255, 255, 0.75); }

.feedback {
  min-height: 1.2em;
  font-size: clamp(40px, 14vw, 88px);
  font-weight: 800;
  opacity: 0;
  transition: opacity 400ms ease-out;
}
.feedback.show { opacity: 1; transition: none; }

.status {
  position: absolute;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 12px;
  right: 12px;
  font-size: 13px;
  color: var(--fg);
  text-shadow: 0 1px 2px #000;
}

/* ---- Test page panel (techniektest) ------------------------------------------- */

.panelBtn {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  min-height: 44px;
  padding: 10px 16px;
  background: rgba(12, 7, 22, 0.6);
  backdrop-filter: blur(6px);
}

.panel {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  background: var(--ink);
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-user-select: text;
  user-select: text;
}
.panelHead { display: flex; justify-content: space-between; align-items: center; }
.label { font-family: var(--display); font-size: 12px; color: var(--muted); letter-spacing: 0.12em; }
.code { font-family: var(--display); font-size: 36px; letter-spacing: 0.15em; }

.joinBox { display: flex; gap: 16px; align-items: center; }
.qr { background: #fff; border-radius: 12px; padding: 6px; line-height: 0; flex: none; }
.qr svg { width: 132px; height: 132px; }
.joinText { color: var(--muted); font-size: 14px; word-break: break-all; }

.roster { width: 100%; border-collapse: collapse; font-size: 13px; }
.roster th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.roster td { padding: 8px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.roster td.name { white-space: normal; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }
.ok { color: var(--green); }
.bad { color: #ff8a8a; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .big { width: 100%; }

.toast {
  position: fixed;
  z-index: 60;
  left: 16px;
  right: 16px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  padding: 14px 16px;
  border-radius: 16px;
  background: #b4123f;
  border: 2px solid #ff6b95;
  box-shadow: 0 6px 0 #5c0820;
  font-weight: 700;
  text-align: center;
}

.warn { margin: 0; padding: 12px 14px; border-radius: 14px; background: #3d2600; border: 1px solid #a26b00; color: #ffe3a3; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .club::after, .pipes i { animation: none; }
  .pipes i { opacity: 0.9; }
}
