:root {
  --bg: #111318;
  --card: #1b1f27;
  --line: #2c323d;
  --text: #f4f6fa;
  --muted: #9aa3b2;
  --accent: #ff4d5e;
  --accent-dark: #d43a49;
  --ok: #3ddc84;
  --tap: 56px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px 96px;
}

.screen { display: block; }
[hidden] { display: none !important; }

/* ---------- typografie ---------- */
.logo {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 12px 0 28px;
  text-align: center;
}
.subtitle {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 28px 0 10px;
}
.label {
  display: block;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 0 0 8px;
}
.hint {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  word-break: break-all;
  margin: 10px 0;
}

/* Leesbaar vanaf een halve meter. */
.question {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  margin: 18px 0 24px;
}
.losers {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  margin: 6px 0 12px;
  color: var(--accent);
  word-break: break-word;
}
.straf {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 8px;
}
.code {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: 10px;
  text-align: center;
  margin: 4px 0 18px;
  font-variant-numeric: tabular-nums;
}

/* ---------- invoer ---------- */
.input {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 16px;
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
}
.input:focus { outline: none; border-color: var(--accent); }
.input-code {
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 8px;
  text-transform: uppercase;
}

/* ---------- knoppen ---------- */
.btn {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 14px 16px;
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.12s ease;
}
/* Touch heeft geen hover: feedback zit in :active en in .chosen. */
.btn:active { transform: scale(0.98); background: #232833; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-dark); }
.btn-primary[disabled] { background: var(--line); border-color: var(--line); color: var(--muted); }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 600; }
.btn-small { min-height: 44px; font-size: 15px; margin: 0; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn[disabled]:active { transform: none; }

.btn-vote { text-align: left; }
.btn-vote.chosen {
  border-color: var(--ok);
  background: rgba(61, 220, 132, 0.14);
  opacity: 1;
}
.options { margin: 8px 0 16px; }

.divider {
  position: relative;
  text-align: center;
  margin: 24px 0;
  color: var(--muted);
  font-size: 14px;
}
.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}
.divider span { position: relative; background: var(--bg); padding: 0 12px; }

/* ---------- lobby ---------- */
.qr {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  margin: 0 auto 8px;
  width: 210px;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr svg { width: 100%; height: 100%; display: block; }

.players, .votes { list-style: none; margin: 0 0 16px; padding: 0; }
.player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 17px;
  font-weight: 600;
}
.player.offline { opacity: 0.5; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.player.offline .dot { background: var(--muted); }
.tag {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}
.tag-off { margin-left: 6px; }

/* ---------- stemronde ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pill {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.timer {
  font-size: 34px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.timer.urgent { color: var(--accent); }
.timerbar {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.timerfill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s linear;
}
.status {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  min-height: 24px;
}
.hostbar { margin-top: 20px; }

/* ---------- reveal ---------- */
.vote {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  color: var(--muted);
}
.vote strong { color: var(--text); }
.arrow { color: var(--accent); font-weight: 700; }

/* ---------- banner + footer ---------- */
.banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-align: center;
}
.hostfoot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.hostfoot .btn { max-width: 600px; margin: 0 auto; }
