/* ─────────────────────────────────────────────────────────────────────────────
   Components & layout — Zehnly-themed quiz
   3D = chunky solid-edge surfaces (no heavy blur). Shadows kept few & soft.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  padding-top: max(18px, env(safe-area-inset-top));
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}
.wrap { width: 100%; max-width: 760px; margin: 0 auto; }
.wrap-sm { max-width: 460px; }
.center-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; }
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.32s ease both; }
.pop-in { animation: popIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
.slide-up { animation: slideUp 0.38s cubic-bezier(0.2, 0.8, 0.3, 1) both; }

/* ── Brand mark / Zehnly logo ───────────────────────────────────────────────── */
.brand-mark { display: inline-flex; align-items: center; gap: 10px; font-weight: var(--fw-title); font-size: 22px; letter-spacing: -0.4px; }
.brand-accent { color: var(--brand-2); }

/* App-icon badge (real Zehnly logo) */
.zlogo { width: 88px; height: 88px; border-radius: 22px; display: block; object-fit: cover; box-shadow: 0 var(--edge) 0 0 #46199e, 0 10px 22px -8px rgba(116, 44, 255, 0.5); }
.zlogo.sm { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 3px 0 0 #46199e; }

/* Gold wordmark for dark headers */
.zword { height: 26px; width: auto; display: block; }
.zword.lg { height: 44px; }
.quiz-chip { font-weight: var(--fw-title); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); border: 1.5px solid var(--card-border); border-radius: var(--radius-pill); padding: 4px 11px; }

/* Sparkle mark (CSS-tintable via color) */
.zmark { display: inline-block; width: 1em; height: 1em; background: currentColor; -webkit-mask: url("/assets/zehnly-sparkle.svg") center / contain no-repeat; mask: url("/assets/zehnly-sparkle.svg") center / contain no-repeat; }
.gold { color: var(--gold); }
/* Purple tile holding a sparkle — replaces emoji on quiz cards */
.zmark-tile { width: 56px; height: 56px; border-radius: var(--radius); background: var(--brand-grad); display: grid; place-items: center; color: #fff; box-shadow: 0 var(--edge) 0 0 var(--edge-brand), var(--hi); flex: none; }
.zmark-tile .zmark { width: 28px; height: 28px; }
.zmark-tile.gold-mark { color: var(--gold); }

/* ── Buttons — 3D chunky (Zehnly), restrained ──────────────────────────────── */
.btn {
  appearance: none; position: relative;
  border: 1.5px solid transparent; border-radius: var(--radius);
  font-family: var(--font); font-weight: var(--fw-bold); font-size: 18px; line-height: 1;
  padding: 16px 22px; cursor: pointer; color: var(--text); background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  user-select: none; touch-action: manipulation; text-decoration: none; /* <a> buttons: no underline */
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.15s ease,
    background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn:active, .btn.is-pressed { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { padding: 19px 26px; font-size: 20px; }

/* 3D variants: solid colored lip + one soft contact shadow; press sinks the lip */
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 var(--edge) 0 0 var(--edge-brand), 0 6px 12px -6px rgba(92, 36, 201, 0.6), var(--hi); }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 var(--edge) 0 0 #0c8a63, 0 6px 12px -6px rgba(16, 185, 129, 0.55), var(--hi); }
.btn-danger  { background: var(--error);  color: #fff; box-shadow: 0 var(--edge) 0 0 #c43d3d, 0 6px 12px -6px rgba(239, 68, 68, 0.5), var(--hi); }
.btn-primary:hover:not(:disabled),
.btn-success:hover:not(:disabled),
.btn-danger:hover:not(:disabled) { filter: brightness(1.06); }
.btn-primary:active:not(:disabled), .btn-primary.is-pressed:not(:disabled),
.btn-success:active:not(:disabled), .btn-success.is-pressed:not(:disabled),
.btn-danger:active:not(:disabled),  .btn-danger.is-pressed:not(:disabled) { transform: translateY(var(--edge)); box-shadow: 0 0 0 0 transparent, var(--hi); }

/* Ghost button tinted as a low-key destructive action (e.g. end the game) */
.end-game-btn { color: var(--error); border-color: rgba(239, 68, 68, 0.4); }
.end-game-btn:hover:not(:disabled) { background: rgba(239, 68, 68, 0.1); border-color: var(--error); }

/* Flat variants (no 3D — keeps depth meaningful) */
.btn-secondary { background: var(--card); border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; border-color: var(--card-border-2); color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); }

.icon-btn {
  width: 44px; height: 44px; border-radius: var(--radius); display: grid; place-items: center;
  background: var(--card); border: 1.5px solid var(--card-border); color: var(--text-2);
  cursor: pointer; font-size: 20px; touch-action: manipulation;
}
.icon-btn:hover { background: var(--card-2); }
.icon-btn:active, .icon-btn.is-pressed { transform: scale(0.92); }

/* ── App funnel: "open in app" banner (mobile) ──────────────────────────────── */
.app-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  padding-top: calc(9px + env(safe-area-inset-top)); /* under the iOS notch */
  background: var(--card); border-bottom: 1.5px solid var(--card-border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  animation: bannerDrop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.app-banner-icon { width: 40px; height: 40px; border-radius: 11px; flex: none; }
.app-banner-text { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.app-banner-text b { font-size: 15px; }
.app-banner-text span { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-banner-cta { padding: 9px 16px; font-size: 14px; flex: none; }
.app-banner-x { background: none; border: none; color: var(--text-dim); font-size: 17px; padding: 4px 6px; cursor: pointer; flex: none; line-height: 1; }
/* Push the page down only while the banner is up, so it never covers content. */
.has-app-banner { padding-top: 64px; }
@keyframes bannerDrop { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* Connection-lost banner (flaky networks) */
.conn-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 9px 14px; padding-top: calc(9px + env(safe-area-inset-top));
  background: #b45309; color: #fff; font-weight: var(--fw-bold); font-size: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.conn-spinner { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: connspin 0.8s linear infinite; }
@keyframes connspin { to { transform: rotate(360deg); } }

/* App funnel: invite card on the game-over screen */
.app-cta-card { border: 1.5px solid var(--brand-2); background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--brand) 10%, var(--card))); }
.app-cta-row { display: flex; align-items: center; gap: 12px; width: 100%; }
.app-cta-icon { width: 46px; height: 46px; border-radius: 12px; flex: none; box-shadow: var(--hi); }

/* ── Inputs ─────────────────────────────────────────────────────────────────── */
.field {
  width: 100%; background: var(--card); border: 1.5px solid var(--card-border-2);
  border-radius: var(--radius); color: var(--text); font-family: var(--font);
  font-size: 18px; font-weight: var(--fw-medium); padding: 18px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field::placeholder { color: var(--text-muted); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field-pin { text-align: center; font-size: 34px; font-weight: var(--fw-title); letter-spacing: 10px; padding: 18px 14px; }
.label { font-size: 14px; font-weight: var(--fw-semibold); color: var(--text-dim); margin-bottom: 8px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; font-weight: var(--fw-bold); }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--card-border); }

/* ── Card ───────────────────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.card-pad-lg { padding: 26px; }

/* ── Home choices (3D lift on hover) ────────────────────────────────────────── */
.choice-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.choice {
  position: relative; border: 1.5px solid var(--card-border); background: var(--card);
  border-radius: var(--radius-lg); padding: 24px 22px; text-align: left; cursor: pointer;
  box-shadow: 0 var(--edge) 0 0 #14161a; overflow: hidden;
  color: var(--text); font-family: var(--font);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.15s;
}
.choice:hover { transform: translateY(-3px); border-color: var(--brand-2); box-shadow: 0 calc(var(--edge) + 3px) 0 0 #14161a; }
.choice:active, .choice.is-pressed { transform: translateY(0); box-shadow: 0 1px 0 0 #14161a; }
.choice .emoji { font-size: 40px; }
.choice h3 { margin: 12px 0 6px; font-weight: var(--fw-title); font-size: 22px; }
.choice p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 20px; }

/* ── Top bar (✕ · progress · score) ─────────────────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.progress { flex: 1; height: 14px; border-radius: var(--radius-pill); background: var(--card-border-2); overflow: hidden; }
.progress-fill { height: 100%; width: 100%; border-radius: var(--radius-pill); background: var(--progress-grad); transform: scaleX(1); transform-origin: left center; will-change: transform; }
.pill { display: inline-flex; align-items: center; gap: 7px; background: var(--card); border: 1.5px solid var(--card-border); padding: 7px 14px; border-radius: var(--radius-pill); font-weight: var(--fw-bold); font-size: 15px; }
.pill .dot { color: var(--text-dim); font-weight: 600; }

/* Countdown ring */
.timer { position: relative; width: 64px; height: 64px; flex: none; display: grid; place-items: center; }
.timer svg { transform: rotate(-90deg); }
.timer .track { stroke: var(--card-border-2); }
.timer .bar { stroke: var(--warning-2); stroke-linecap: round; transition: stroke 0.3s; will-change: stroke-dashoffset; }
.timer .num { position: absolute; font-weight: var(--fw-title); font-size: 22px; }

/* ── Question ───────────────────────────────────────────────────────────────── */
.q-counter { color: var(--text-dim); font-weight: var(--fw-bold); font-size: 15px; letter-spacing: 0.4px; }
.q-text { font-weight: var(--fw-title); font-size: clamp(22px, 4.6vw, 38px); line-height: 1.22; letter-spacing: -0.4px; margin: 10px 0 22px; }
/* "shart" (premise) — visually separated from the bold question via a brand accent bar */
.q-context { color: var(--text-2); font-weight: var(--fw-medium); font-size: 15px; line-height: 1.45; margin: 8px 0 0; padding: 4px 0 4px 12px; border-left: 3px solid var(--brand-2); }
.host-big .q-context { font-size: 18px; line-height: 1.5; }
/* player question card — makes the question/shart stand out from the answer tiles */
.q-card { background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.q-card .q-counter { margin-bottom: 2px; }
.q-card .q-text { font-size: clamp(18px, 4.8vw, 26px); margin: 4px 0 0; }

/* ── Answer grid ────────────────────────────────────────────────────────────── */
.answers { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.answer {
  --c: var(--ans-0); --edge-a: 5px;
  position: relative; border: none; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 86%, #fff 14%), color-mix(in srgb, var(--c) 94%, #000 6%));
  color: #fff; font-family: var(--font); font-weight: var(--fw-bold); font-size: 19px; line-height: 1.25;
  padding: 22px 20px; min-height: 88px; display: flex; align-items: center; gap: 14px; text-align: left;
  cursor: pointer; touch-action: manipulation;
  box-shadow: 0 var(--edge-a) 0 0 color-mix(in srgb, var(--c) 58%, #000 42%), 0 9px 14px -9px rgba(0, 0, 0, 0.55);
  transition: transform 0.09s ease, box-shadow 0.09s ease, filter 0.15s, opacity 0.25s;
}
.answer:hover:not(:disabled) { filter: brightness(1.06); }
.answer:active:not(:disabled), .answer.is-pressed:not(:disabled) { transform: translateY(var(--edge-a)); box-shadow: 0 0 0 0 transparent, 0 4px 8px -6px rgba(0, 0, 0, 0.5); }
.answer:disabled, .answer.locked { cursor: default; }
.answer.locked { pointer-events: none; } /* tiles are <label>s (no [disabled]) — lock taps via CSS */
.answer[data-c="0"] { --c: var(--ans-0); }
.answer[data-c="1"] { --c: var(--ans-1); }
.answer[data-c="2"] { --c: var(--ans-2); }
.answer[data-c="3"] { --c: var(--ans-3); }
.answer .shape { width: 34px; height: 34px; flex: none; display: grid; place-items: center; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3)); }
.answer .shape svg { width: 100%; height: 100%; }
.answer .a-text { flex: 1; }
.answer .a-count { font-weight: var(--fw-title); font-size: 16px; background: rgba(0, 0, 0, 0.22); padding: 4px 10px; border-radius: var(--radius-pill); }

/* reveal states (tight rings, minimal blur) */
.answer.is-correct { box-shadow: 0 0 0 3px var(--success-2), 0 6px 16px -8px rgba(34, 197, 94, 0.6); filter: none; animation: correctPulse 0.55s ease; }
.answer.is-wrong-pick { box-shadow: 0 0 0 3px var(--error); opacity: 0.7; }
.answer.dimmed { opacity: 0.3; filter: saturate(0.55); box-shadow: none; transform: translateY(var(--edge-a)); }
/* chosen tile: sink it (3D press) + bright white ring while the answer registers */
.answer.picked { transform: translateY(var(--edge-a)); opacity: 1; filter: brightness(1.05); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.95), 0 3px 8px -5px rgba(0, 0, 0, 0.6); }
.answer .mark { margin-left: auto; font-size: 22px; }

/* Player phone: shapes fill the screen as a true 2×N grid */
.answers.phone { height: 100%; grid-auto-rows: 1fr; gap: 12px; }
.answers.phone .answer { flex-direction: column; justify-content: center; text-align: center; min-height: 0; padding: 14px; }
.answers.phone .answer .shape { width: 42px; height: 42px; }
.answers.phone .answer .a-text { flex: none; font-size: 16px; }

/* ── Lobby (host) ───────────────────────────────────────────────────────────── */
.lobby-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.player-chip { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius); padding: 12px 14px; font-weight: var(--fw-bold); font-size: 15px; animation: popIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 15px; color: #fff; font-weight: var(--fw-title); box-shadow: var(--hi); }

/* Character avatar (static SVG via <img>) */
.av { border-radius: 50%; overflow: hidden; flex: none; background: var(--card-2); box-shadow: var(--hi); }
.av img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Avatar picker on the join screen */
.avatar-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.avatar-opt { padding: 0; border: none; background: none; cursor: pointer; border-radius: 50%; aspect-ratio: 1; transition: transform 0.1s ease; -webkit-tap-highlight-color: transparent; }
.avatar-opt .av { width: 100%; height: 100%; opacity: 0.55; transition: opacity 0.15s ease, box-shadow 0.15s ease; }
.avatar-opt:hover .av { opacity: 0.85; }
.avatar-opt.sel { transform: scale(1.05); }
.avatar-opt.sel .av { opacity: 1; box-shadow: 0 0 0 3px var(--brand-2); }
.avatar-opt:active, .avatar-opt.is-pressed { transform: scale(0.92); }

/* PIN + QR join panel */
.join-panel { display: grid; gap: 22px; grid-template-columns: 1.1fr 0.9fr; align-items: center; }
.pin-display { text-align: center; }
.pin-display .pin-label { color: var(--text-dim); font-weight: var(--fw-bold); letter-spacing: 1px; text-transform: uppercase; font-size: 13px; }
.pin-code { font-weight: var(--fw-title); font-size: clamp(44px, 9vw, 84px); letter-spacing: 8px; line-height: 1.05; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin: 6px 0; }
.qr-box { background: #fff; padding: 14px; border-radius: var(--radius-lg); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.qr-box img { width: 100%; max-width: 240px; display: block; border-radius: 6px; }
.join-url { color: var(--text-dim); font-size: 14px; word-break: break-all; }

/* ── Leaderboard ────────────────────────────────────────────────────────────── */
.leaderboard { display: flex; flex-direction: column; gap: 10px; }
.lb-row { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius); padding: 14px 16px; animation: slideUp 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.lb-rank { width: 28px; font-weight: var(--fw-title); font-size: 18px; color: var(--text-dim); text-align: center; }
.lb-name { flex: 1; font-weight: var(--fw-bold); font-size: 17px; }
.lb-score { font-weight: var(--fw-title); font-size: 18px; }
.lb-row.me { border-color: var(--brand-2); background: var(--brand-soft); }

/* ── Podium ─────────────────────────────────────────────────────────────────── */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin: 24px 0; }
.podium-col { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 30%; max-width: 180px; }
.podium-av { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: var(--fw-title); color: #fff; box-shadow: var(--shadow); }
.podium-name { font-weight: var(--fw-bold); font-size: 16px; text-align: center; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.podium-score { font-weight: var(--fw-title); color: var(--text-dim); font-size: 14px; white-space: nowrap; margin-bottom: 4px; }
.podium-stand { width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; display: grid; place-items: start center; padding-top: 12px; font-weight: var(--fw-title); font-size: 38px; box-shadow: var(--hi); animation: riseUp 0.55s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.stand-1 { height: 150px; background: linear-gradient(180deg, #ffd34d, #f5a623); color: #5a3d00; }
.stand-2 { height: 112px; background: linear-gradient(180deg, #d7dde3, #aab4bf); color: #2b3138; }
.stand-3 { height: 86px;  background: linear-gradient(180deg, #e8a06a, #c1763f); color: #3a1f08; }

/* ── Result (player) ────────────────────────────────────────────────────────── */
.result-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; text-align: center; }
.result-screen.correct { background: radial-gradient(60% 45% at 50% 32%, var(--success-soft), transparent 70%); }
.result-screen.wrong { background: radial-gradient(60% 45% at 50% 32%, var(--error-soft), transparent 70%); }
.result-emoji { font-size: 84px; animation: popIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) both; }
.result-title { font-weight: var(--fw-title); font-size: 34px; }
.result-title.correct { color: var(--success-2); }
.result-title.wrong { color: var(--error-2); }
.points-badge { font-weight: var(--fw-title); font-size: 22px; background: var(--card); border: 1.5px solid var(--card-border); padding: 12px 22px; border-radius: var(--radius-pill); }
.big-score { font-weight: var(--fw-title); font-size: 60px; line-height: 1; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ── Waiting dots ───────────────────────────────────────────────────────────── */
.waiting { display: inline-flex; gap: 8px; }
.waiting i { width: 12px; height: 12px; border-radius: 50%; background: var(--brand-2); animation: bounce 1.2s infinite ease-in-out; }
.waiting i:nth-child(2) { animation-delay: 0.15s; }
.waiting i:nth-child(3) { animation-delay: 0.3s; }

/* ── QR Scanner overlay ─────────────────────────────────────────────────────── */
.scanner { position: fixed; inset: 0; z-index: 200; background: #000; display: none; }
.scanner.open { display: block; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scan-mask { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
/* the single big spread "shadow" is the dark mask around the cutout (one layer, intentional) */
.scan-box { width: min(68vw, 300px); aspect-ratio: 1; border-radius: 26px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.58); outline: 3px solid rgba(255, 255, 255, 0.92); outline-offset: -3px; }
.scan-corners { position: absolute; width: min(68vw, 300px); aspect-ratio: 1; }
.scanner-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: max(16px, env(safe-area-inset-top)) 18px 18px; }
.scanner-top .icon-btn { background: rgba(0, 0, 0, 0.4); border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.scanner-status { position: absolute; left: 0; right: 0; bottom: 12%; text-align: center; color: #fff; font-weight: var(--fw-bold); font-size: 16px; padding: 0 24px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }
.scanner-hint { position: absolute; left: 0; right: 0; top: calc(50% + min(34vw, 160px) + 18px); text-align: center; color: rgba(255, 255, 255, 0.85); font-size: 14px; font-weight: var(--fw-semibold); }

/* ── Toast ──────────────────────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--card-2); border: 1.5px solid var(--card-border-2); color: var(--text); padding: 14px 20px; border-radius: var(--radius); font-weight: var(--fw-bold); font-size: 15px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 300; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--error); color: var(--error-2); }

/* ── Confetti ───────────────────────────────────────────────────────────────── */
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; z-index: 50; pointer-events: none; border-radius: 2px; animation: confettiFall linear forwards; }

/* ── Animations ─────────────────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); } }
@keyframes riseUp { from { transform: scaleY(0.15); transform-origin: bottom; opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-10px); opacity: 1; } }
@keyframes correctPulse { 0% { transform: scale(1); } 50% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes confettiFall { to { transform: translateY(105dvh) rotate(720deg); opacity: 0.9; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .screen { padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .choice-grid { grid-template-columns: 1fr; }
  .join-panel { grid-template-columns: 1fr; }
  .q-text { margin: 8px 0 14px; }
  .answer { font-size: 17px; }
}
@media (min-width: 980px) {
  .host-big .wrap { max-width: 1000px; }
  .host-big .q-text { font-size: clamp(30px, 4vw, 46px); }
  .host-big .answer { min-height: 120px; font-size: 24px; }
}
