/* ================================================================
   Quiz Party — Game Show / Neo-Brutalist Stylesheet
   ================================================================ */

/* ── Reset & Base ─────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #F5F0E8;
  --ink: #1A1A1A;
  --yellow: #FFD100;
  --red: #FF3B30;
  --white: #FFFFFF;
  --border-thin: 2px solid #1A1A1A;
  --border: 3px solid #1A1A1A;
  --shadow: 4px 4px 0 #1A1A1A;
  --shadow-sm: 2px 2px 0 #1A1A1A;
  --font: "Zilla Slab", Georgia, serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --transition: 150ms linear;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: underline; }
a:hover { text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Utility ──────────────────────────────────────────────────── */

[hidden],
[data-state] { display: none !important; }
[data-state].active { display: block !important; }

.text-center { text-align: center; }
.text-muted  { color: #555; }
.text-success { color: var(--ink); }
.text-danger  { color: var(--red); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ── Layout ───────────────────────────────────────────────────── */

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app--host {
  max-width: 960px;
  padding: 2rem;
}

.app__header {
  text-align: center;
  padding: 1rem 0 1.5rem;
  border-bottom: var(--border);
  margin-bottom: 2rem;
}

.app__logo {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
}

.app__tagline {
  color: #555;
  font-size: 0.875rem;
  margin-top: 0.375rem;
  font-style: italic;
}

.app__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Card ─────────────────────────────────────────────────────── */

.card {
  background: var(--white);
  border: var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card--accent {
  background: var(--yellow);
}

.card__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card__title-icon { font-size: 1.25rem; }

.card__description {
  color: #555;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ── Form Elements ────────────────────────────────────────────── */

.form-group { margin-bottom: 1rem; }
.form-group:last-of-type { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--white);
  color: var(--ink);
  border: var(--border-thin);
  outline: none;
  transition: box-shadow var(--transition);
}

.form-input::placeholder { color: #888; }

.form-input:focus {
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.form-input--code {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  padding: 1rem;
}

/* ── Buttons ──────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: var(--border);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  min-height: 48px;
  box-shadow: var(--shadow);
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
}

.btn:active:not(:disabled) {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--yellow);
  color: var(--ink);
}

.btn--primary:hover:not(:disabled) { background: #f0c800; }

.btn--secondary {
  background: var(--ink);
  color: var(--white);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
}

.btn--large {
  padding: 1.125rem 2rem;
  font-size: 1.125rem;
}

/* ── Choices Grid (2x2) ──────────────────────────────────────── */

.choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.choice-btn {
  position: relative;
  display: flex;
  align-items: center;
  padding: 1rem 1rem 1rem 68px;
  min-height: 80px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--ink);
  border: var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  background: var(--white);
  text-align: left;
  word-break: break-word;
  line-height: 1.3;
}

/* Letter block via ::before */
.choice-btn::before {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  border-right: var(--border-thin);
}

.choice-btn--a::before { content: "A"; background: var(--yellow); color: var(--ink); }
.choice-btn--b::before { content: "B"; background: var(--ink); color: var(--white); }
.choice-btn--c::before { content: "C"; background: var(--yellow); color: var(--ink); }
.choice-btn--d::before { content: "D"; background: var(--ink); color: var(--white); }

.choice-btn:active:not(:disabled) {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.choice-btn.selected {
  background: var(--yellow);
}

.choice-btn.correct {
  background: var(--ink);
  color: var(--white);
}

.choice-btn.correct::before {
  background: var(--yellow);
  color: var(--ink);
}

.choice-btn.incorrect {
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 5px,
    rgba(0,0,0,0.10) 5px,
    rgba(0,0,0,0.10) 10px
  );
}

.choice-btn:disabled { cursor: not-allowed; }

/* Full-width for true/false */
.choices-grid--two {
  grid-template-columns: 1fr;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* Closest (numeric input) */
.closest-input-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.closest-input-group .form-input {
  flex: 1;
  font-size: 1.5rem;
  text-align: center;
  font-weight: 700;
  font-family: var(--font-mono);
}

.closest-input-group .btn {
  width: auto;
  padding: 0.875rem 1.5rem;
  flex-shrink: 0;
}

/* ── Timer ────────────────────────────────────────────────────── */

.timer {
  text-align: center;
  margin: 1rem 0;
}

.timer__value {
  font-size: 3rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--ink);
  line-height: 1;
}

.timer__value--warning { color: var(--ink); }

.timer__value--danger {
  color: var(--red);
  animation: blink 0.5s linear infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.timer__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
  color: #555;
}

/* Timer bar (host page) */
.timer-bar {
  width: 100%;
  height: 16px;
  background: var(--white);
  border: var(--border-thin);
  overflow: hidden;
  margin: 1rem 0;
  position: relative;
}

/* Tick marks */
.timer-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(10% - 1px),
    rgba(0,0,0,0.15) calc(10% - 1px),
    rgba(0,0,0,0.15) 10%
  );
  pointer-events: none;
}

.timer-bar__fill {
  height: 100%;
  background: var(--yellow);
  transition: width 1s linear;
  width: 100%;
}

.timer-bar__fill--warning { background: var(--yellow); }

.timer-bar__fill--danger {
  background: var(--red);
  animation: flash-bar 0.5s linear infinite;
}

@keyframes flash-bar {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Answer Counter ───────────────────────────────────────────── */

.answer-counter {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: var(--border-thin);
}

.answer-counter__bar {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--ink);
  overflow: hidden;
}

.answer-counter__fill {
  height: 100%;
  background: var(--yellow);
  transition: width 250ms linear;
  width: 0%;
}

.answer-counter__text {
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
  text-transform: uppercase;
}

/* ── Player List (Lobby) ──────────────────────────────────────── */

.player-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.player-list__item {
  display: flex;
  align-items: center;
  border: var(--border-thin);
  box-shadow: var(--shadow-sm);
  background: var(--white);
  overflow: hidden;
  animation: slam-in 0.15s linear;
}

@keyframes slam-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.player-list__avatar {
  width: 36px;
  height: 36px;
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ink);
  flex-shrink: 0;
  border-right: var(--border-thin);
}

.player-list__name {
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.player-count {
  font-size: 0.875rem;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  color: #555;
}

/* ── Scoreboard Table ─────────────────────────────────────────── */

.scoreboard {
  width: 100%;
  border-collapse: collapse;
}

.scoreboard th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.5rem 1rem;
  text-align: left;
  border-bottom: var(--border);
}

.scoreboard th:last-child { text-align: right; }

.scoreboard td {
  padding: 0.875rem 1rem;
  border-bottom: var(--border-thin);
  font-weight: 500;
}

.scoreboard td:first-child {
  font-weight: 700;
  text-align: center;
  width: 50px;
}

.scoreboard td:last-child {
  text-align: right;
  font-weight: 700;
  font-family: var(--font-mono);
}

.scoreboard tr.scoreboard__row--self td {
  background: var(--yellow);
  font-weight: 700;
}

.scoreboard__rank--1 { font-size: 1.25rem; }
.scoreboard__rank--2 { font-size: 1.125rem; }
.scoreboard__rank--3 { font-size: 1rem; }

/* ── Podium (Host final screen) ───────────────────────────────── */

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  margin: 2rem auto;
  max-width: 600px;
}

.podium__place {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.podium__bar {
  width: 100%;
  border: var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1.5rem 0.75rem;
  min-width: 100px;
  position: relative;
  overflow: hidden;
}

/* Hatching pattern */
.podium__bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(0,0,0,0.06) 8px,
    rgba(0,0,0,0.06) 16px
  );
  pointer-events: none;
}

.podium__place--1 .podium__bar { background: var(--yellow); height: 180px; }
.podium__place--2 .podium__bar { background: var(--white); height: 130px; }
.podium__place--3 .podium__bar { background: var(--white); height: 90px; }

.podium__rank {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ink);
  position: relative;
  z-index: 1;
}

.podium__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 0.25rem;
  word-break: break-word;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.podium__points {
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  position: relative;
  z-index: 1;
}

/* ── Game Code Display ────────────────────────────────────────── */

.game-code {
  text-align: center;
  padding: 1.5rem;
  border: var(--border);
  background: var(--white);
  box-shadow: var(--shadow);
}

.game-code__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
  margin-bottom: 0.5rem;
  color: #555;
}

.game-code__value {
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--ink);
  line-height: 1;
  text-shadow: 4px 4px 0 var(--yellow);
}

.app--host .game-code__value { font-size: 7rem; }

/* ── Join Block (Host Lobby — QR + Code side by side) ────────── */

.join-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem 2rem;
  margin-inline: auto;
  width: fit-content;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
}

.join-block__qr {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
}

.join-block__qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.join-block__info {
  flex: 1;
  min-width: 0;
}

.join-block__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
  margin-bottom: 0.5rem;
  color: #555;
}

.join-block__code {
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--ink);
  line-height: 1;
  text-shadow: 4px 4px 0 var(--yellow);
}

.join-block__url {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #555;
  margin-top: 0.75rem;
  word-break: break-all;
}

@media (min-width: 960px) {
  .join-block__qr { width: 180px; height: 180px; }
  .join-block__code { font-size: 7rem; }
}

/* ── Question Display ─────────────────────────────────────────── */

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.question-number {
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.question-type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.25rem 0.75rem;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-mono);
}

.question-text {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

/* Newspaper headline on host */
.app--host .question-text {
  font-size: 3rem;
  text-align: center;
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  border-top: var(--border);
  border-bottom: var(--border);
  padding: 1rem 0;
  margin: 1rem 0;
}

/* ── Status Messages ──────────────────────────────────────────── */

.status {
  text-align: center;
  padding: 2rem 1rem;
}

.status__icon { font-size: 3rem; margin-bottom: 0.75rem; }

.status__title {
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.status__subtitle { color: #555; font-size: 0.9375rem; }

/* ── Countdown ────────────────────────────────────────────────── */

.countdown { text-align: center; padding: 3rem 1rem; }

.countdown__number {
  font-size: 10rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  font-family: var(--font-mono);
  animation: slam 0.15s linear;
}

@keyframes slam {
  from { transform: scale(1.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.countdown__text {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

/* ── Result Feedback ──────────────────────────────────────────── */

.result-feedback { text-align: center; padding: 2rem 1rem; }
.result-feedback__icon { font-size: 5rem; margin-bottom: 0.5rem; line-height: 1; }

.result-feedback__text {
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.result-feedback--correct .result-feedback__text {
  color: var(--ink);
  background: var(--yellow);
  padding: 0.25rem 1rem;
  display: inline-block;
  box-shadow: var(--shadow);
}

.result-feedback--incorrect .result-feedback__text {
  color: var(--red);
  text-decoration: line-through;
}

.result-feedback__points {
  font-size: 1.25rem;
  font-family: var(--font-mono);
  font-weight: 700;
  margin-top: 0.75rem;
}


/* ── Error Banner ─────────────────────────────────────────────── */

.error-banner {
  padding: 0.875rem 1rem;
  background: var(--white);
  border: var(--border-thin);
  border-left: 4px solid var(--red);
  color: var(--red);
  font-weight: 700;
  font-size: 0.875rem;
  text-align: center;
  animation: slam-in 0.15s linear;
}

/* ── Spinner ──────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--ink);
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Media ────────────────────────────────────────────────────── */

.question-media { margin: 1rem 0; text-align: center; border: var(--border-thin); }
.question-media img { max-height: 200px; margin: 0 auto; }
.question-media audio { width: 100%; max-width: 400px; }

/* ── Avatar Grid ──────────────────────────────────────────────── */

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.avatar-btn {
  font-size: 1.75rem;
  padding: 0.5rem;
  border: var(--border);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  text-align: center;
  line-height: 1;
}

.avatar-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.avatar-btn--selected {
  background: var(--yellow);
  box-shadow: none;
  transform: translate(2px, 2px);
}

/* ── Answer Submission Animations ─────────────────────────────── */

@keyframes answer-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.choice-btn.selected {
  animation: answer-pulse 300ms linear;
}

.choice-btn.disabled-choice {
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(0, 0, 0, 0.08) 4px,
    rgba(0, 0, 0, 0.08) 8px
  );
  pointer-events: none;
}

/* ── Avatar Stamp (host question screen) ──────────────────────── */

.avatar-stamp-container {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  z-index: 10;
}

@keyframes stamp-in {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes stamp-out {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

.avatar-stamp {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0.375rem 0.75rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 700;
  animation: stamp-in 150ms linear;
  white-space: nowrap;
}

.avatar-stamp--leaving {
  animation: stamp-out 150ms linear forwards;
}

.avatar-stamp__emoji {
  font-size: 1.25rem;
  line-height: 1;
}

/* ── Counter Bar Flash ────────────────────────────────────────── */

@keyframes counter-flash {
  0% { background-color: var(--white); }
  100% { background-color: transparent; }
}

.answer-counter__text--flash {
  animation: counter-flash 300ms linear;
}

/* ── All Answered Banner ──────────────────────────────────────── */

.all-answered-banner {
  text-align: center;
  font-family: var(--font);
  font-weight: 900;
  font-size: 1.25rem;
  text-transform: uppercase;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 0.75rem 1.5rem;
  animation: slam 150ms linear;
}

/* ── Enriched Results ─────────────────────────────────── */

.results-progress {
  background: var(--ink);
  color: var(--yellow);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: var(--border);
  border-bottom: none;
}

.results-progress__muted {
  font-size: 0.75rem;
  color: #999;
}

.results-question {
  padding: 1rem 1.25rem;
  border: var(--border);
  border-bottom: none;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 0.02em;
  font-family: var(--font);
}

.results-banner {
  background: var(--yellow);
  border: var(--border);
  padding: 0.5rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.05em;
}

/* Enriched choice card — correct */
.choice-card--correct {
  border: var(--border);
  background: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: var(--white);
}

/* Enriched choice card — incorrect */
.choice-card--incorrect {
  border: var(--border);
  background: var(--white);
  overflow: hidden;
  position: relative;
}

.choice-card--incorrect::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(0,0,0,0.06) 6px,
    rgba(0,0,0,0.06) 12px
  );
  pointer-events: none;
}

.choice-card--empty {
  opacity: 0.45;
}

/* Choice card header row */
.choice-card__header {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
}

.choice-card__letter {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 0.75rem;
  min-width: 42px;
  text-align: center;
}

.choice-card__letter--a,
.choice-card__letter--c {
  background: var(--yellow);
  color: var(--ink);
}

.choice-card__letter--b,
.choice-card__letter--d {
  background: var(--ink);
  color: var(--white);
}

/* Override letter colors on correct card */
.choice-card--correct .choice-card__letter {
  background: var(--yellow);
  color: var(--ink);
}

.choice-card__label {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 0.75rem;
  text-transform: uppercase;
  flex: 1;
  position: relative;
  z-index: 2;
}

.choice-card__check {
  color: var(--yellow);
  font-size: 0.95rem;
  padding-right: 0.75rem;
  font-weight: 700;
  position: relative;
  z-index: 2;
}

/* Distribution bar inside card */
.choice-card__bar-track {
  height: 8px;
  position: relative;
  z-index: 2;
}

.choice-card--correct .choice-card__bar-track {
  background: #333;
}

.choice-card--incorrect .choice-card__bar-track {
  background: #eee;
}

.choice-card__bar {
  height: 100%;
  width: 0%;
  transition: width 400ms linear;
}

.choice-card--correct .choice-card__bar {
  background: var(--yellow);
}

.choice-card--incorrect .choice-card__bar {
  background: var(--ink);
}

/* Player tags container */
.choice-card__players {
  display: flex;
  gap: 0.35rem;
  padding: 0.5rem 0.6rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
  min-height: 1.75rem;
}

.choice-card--correct .choice-card__players {
  background: #222;
}

/* Player tag */
.player-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  opacity: 0;
  transform: translateX(16px);
}

.player-tag--visible {
  animation: slam-in 150ms linear forwards;
}

.player-tag--correct {
  background: var(--yellow);
  color: var(--ink);
}

.player-tag--incorrect {
  background: var(--bg);
  color: var(--ink);
}

.player-tag--overflow {
  background: transparent;
  border-style: dashed;
  color: #999;
}

.choice-card__empty-label {
  font-size: 0.75rem;
  color: #999;
  font-weight: 700;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
  padding: 0.5rem 0.6rem;
}

/* Proximity table (closest questions) */
.proximity-row--closest {
  background: var(--yellow);
}

.proximity-row--closest td {
  font-weight: 700;
}

.proximity__exact {
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.65rem;
  padding: 0.1rem 0.3rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  margin-left: 0.5rem;
}

/* Reveal helpers */
.reveal-hidden {
  opacity: 0;
}

.reveal-visible {
  opacity: 1;
  transition: opacity 200ms linear;
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (min-width: 640px) {
  .app { padding: 2rem 1.5rem; }
  .choice-btn { min-height: 100px; font-size: 1.125rem; }
  .question-text { font-size: 1.75rem; }
}

@media (min-width: 960px) {
  .app--host { max-width: 1400px; padding: 2.5rem 3rem; }
  .app--host .choice-btn { min-height: 120px; font-size: 1.5rem; }
  .app--host .choice-btn::before { width: 64px; font-size: 1.25rem; }
  .app--host .choice-btn { padding-left: 80px; }
  .app--host .timer__value { font-size: 5rem; }
  .app--host .scoreboard td { font-size: 1.25rem; padding: 1rem 1.5rem; }
  .app--host .scoreboard th { font-size: 0.875rem; padding: 0.75rem 1.5rem; }
  .app--host .player-list__avatar { width: 44px; height: 44px; font-size: 1rem; }
  .podium__bar { min-width: 160px; }
  .podium__place--1 .podium__bar { height: 240px; }
  .podium__place--2 .podium__bar { height: 170px; }
  .podium__place--3 .podium__bar { height: 120px; }
  .podium__rank { font-size: 3.5rem; }
  .podium__name { font-size: 1.25rem; }
  .app--host .results-question { font-size: 2rem; }
  .app--host .results-banner { font-size: 1.125rem; }
  .app--host .choice-card__label { font-size: 1.125rem; }
  .app--host .choice-card__letter { font-size: 1.125rem; padding: 0.75rem 0.875rem; min-width: 52px; }
  .app--host .player-tag { font-size: 0.8rem; }
}

/* ── Animations ───────────────────────────────────────────────── */

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Joker Config Panel (lobby) ───────────────────────────────── */

.joker-config {
  max-width: 680px;
  margin: 2rem auto 0;
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  background: var(--white);
}

.joker-config h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  color: var(--ink);
}

.joker-toggle-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem 0.75rem;
}

.joker-config-group {
  display: contents;
}

.joker-config-group h4 {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.75rem;
  padding-bottom: 0.25rem;
}

.joker-card {
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
}

.joker-card--off {
  background: var(--white) !important;
  border: 3px dashed #ccc;
  box-shadow: none;
  color: #ccc;
}

/* ── Joker Feed (overlay) ─────────────────────────────────────── */

.joker-feed {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  pointer-events: none;
  z-index: 10;
}

.joker-feed-entry {
  background: var(--white);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  border: var(--border);
  box-shadow: var(--shadow);
  border-left: 6px solid #fff;
  animation: slam-in 150ms linear;
}

/* ── Host Preview State ───────────────────────────────────────── */

.host-preview {
  text-align: center;
  padding: 3rem 2rem;
  position: relative;
}

.host-preview h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.preview-info {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.preview-category,
.preview-difficulty {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border: var(--border-thin);
  font-size: 0.875rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--white);
}

.host-preview .joker-feed {
  position: static;
  width: 100%;
  max-width: 480px;
  margin: 1.5rem auto 0;
  pointer-events: none;
}

.fade-in { animation: fade-in 0.2s linear; }

/* ── Player Joker Bar ─────────────────────────────────────────── */

.joker-bar {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  gap: 0.5rem;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.joker-bar:empty { display: none; }

.joker-bar::-webkit-scrollbar { display: none; }

.joker-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.75rem;
  border: var(--border);
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-height: 36px;
  touch-action: manipulation;
  user-select: none;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.joker-btn:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.joker-btn.used {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(1);
}

/* ── Player Preview Section ───────────────────────────────────── */

.preview-container {
  text-align: center;
  padding: 2rem 1rem;
}

.preview-container h2 {
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.preview-timer {
  font-size: 3rem;
  font-weight: 700;
  font-family: var(--font-mono);
  margin: 1rem 0;
  color: var(--ink);
}

.preview-container .joker-bar {
  justify-content: center;
  margin-top: 0.5rem;
}

/* ── Modals ───────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-content {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-content h3 {
  background: var(--ink);
  color: var(--yellow);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: -1.5rem -1.5rem 1rem -1.5rem;
  padding: 0.6rem 1rem;
}

.target-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.target-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  text-transform: uppercase;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.target-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.modal-confirm {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  text-transform: uppercase;
  background: var(--yellow);
  border: var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.modal-confirm:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.modal-cancel {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--font);
  text-transform: uppercase;
  background: var(--bg);
  border: var(--border-thin);
  cursor: pointer;
  color: var(--ink);
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.modal-cancel:active { background: var(--white); }

.encheres-amount {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-align: center;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--ink);
}

/* ── Joker Toast Notifications ───────────────────────────────── */

.joker-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  color: var(--ink);
  padding: 0;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  border: var(--border);
  box-shadow: var(--shadow);
  white-space: nowrap;
  z-index: 200;
  animation: slam-in 150ms linear;
  pointer-events: none;
  display: flex;
  align-items: stretch;
}

.joker-toast__stripe {
  width: 6px;
  flex-shrink: 0;
  background: var(--ink);
}

.joker-toast__text {
  padding: 0.5rem 0.75rem;
}

.joker-toast.error {
  border-color: var(--red);
  box-shadow: 4px 4px 0 var(--red);
  color: var(--red);
}

.joker-toast.error .joker-toast__stripe {
  background: var(--red);
}

/* ── btn--small ──────────────────────────────────────────────── */

.btn--small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  min-height: 36px;
}
