:root {
  --bg: #08080a;
  --surface: #111115;
  --surface-2: #18181e;
  --surface-3: #22222a;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.28);
  --text: #fafafa;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --white: #ffffff;
  --black: #09090b;
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.16);
  --crimson: #f43f5e;
  --crimson-soft: rgba(244, 63, 94, 0.16);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --radius: 14px;
  --radius-sm: 10px;
}

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

html, body {
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.4;
  overflow-x: hidden;
}

/* Subtle monochrome playing-card dot/grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  z-index: 0;
}

.app-root {
  position: relative;
  z-index: 1;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
}

.display {
  font-family: var(--font-display);
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

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

.btn-primary {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: #e5e7eb;
  border-color: #e5e7eb;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.22);
}

.btn-emerald {
  background: var(--emerald);
  color: #03150e;
  border-color: var(--emerald);
}

.btn-emerald:hover:not(:disabled) {
  background: #34d399;
  border-color: #34d399;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.35);
}

.btn-crimson {
  background: var(--crimson-soft);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.45);
}

.btn-crimson.active,
.btn-crimson:hover:not(:disabled) {
  background: var(--crimson);
  color: var(--white);
  border-color: var(--crimson);
}

.btn-amber {
  background: var(--amber-soft);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.45);
}

.btn-amber.active,
.btn-amber:hover:not(:disabled) {
  background: var(--amber);
  color: #1c1202;
  border-color: var(--amber);
}

.btn-lg {
  padding: 14px 24px;
  font-size: 1.05rem;
  border-radius: 12px;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
  border-color: var(--white);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.select {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  padding: 10px 12px;
  outline: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
}

.pill-white {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.pill-emerald {
  background: var(--emerald-soft);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}

.pill-crimson {
  background: var(--crimson-soft);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}

.pill-amber {
  background: var(--amber-soft);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

/* ==========================================================================
   3D Playing Cards / Doors (Shared between Mobile & Projector)
   ========================================================================== */
.card-scene {
  perspective: 1100px;
}

.door-card {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  outline: none;
}

.door-card.disabled {
  cursor: default;
}

.door-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.door-card.flipped .door-inner {
  transform: rotateY(180deg);
}

.door-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 14px;
  overflow: hidden;
}

/* Card Back (Face Down — Choosing Phase) */
.door-back {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.03) 0px,
      rgba(255, 255, 255, 0.03) 2px,
      transparent 2px,
      transparent 10px
    ),
    linear-gradient(155deg, #1a1a22 0%, #0d0d11 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.door-back::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  pointer-events: none;
}

.door-card:not(.disabled):not(.flipped):hover .door-back {
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-4px);
}

.door-card.selected .door-back {
  border-color: var(--white);
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.08) 0px,
      rgba(255, 255, 255, 0.08) 2px,
      transparent 2px,
      transparent 10px
    ),
    linear-gradient(155deg, #272733 0%, #14141c 100%);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), 0 14px 36px rgba(255, 255, 255, 0.16);
  transform: translateY(-4px);
}

.door-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  font-size: 0.95rem;
}

.door-corner.bottom {
  align-self: flex-end;
  transform: rotate(180deg);
}

.door-center-emblem {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.door-suit-big {
  font-size: 2.3rem;
  line-height: 1;
  opacity: 0.92;
}

.door-label-small {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.selected-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.door-card.selected .selected-badge {
  opacity: 1;
  transform: scale(1);
}

/* Card Front (Revealed) */
.door-front {
  transform: rotateY(180deg);
  align-items: center;
  justify-content: center;
  text-align: center;
}

.door-front.is-winner {
  background: #ffffff;
  color: #09090b;
  border: 3px solid var(--emerald);
  box-shadow: 0 0 36px rgba(16, 185, 129, 0.45);
}

.door-front.is-loser {
  background: #141418;
  color: #71717a;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.door-front.is-loser.user-picked {
  border-color: var(--crimson);
  background: linear-gradient(180deg, #211015 0%, #141013 100%);
  color: #fda4af;
}

.door-front.is-winner.user-picked {
  box-shadow: 0 0 46px rgba(16, 185, 129, 0.65);
}

.reveal-symbol {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.reveal-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 6px;
}

.reveal-sub {
  font-size: 0.72rem;
  opacity: 0.78;
  margin-top: 4px;
}

/* ==========================================================================
   Feedback Animations
   ========================================================================== */
@keyframes shakeMiss {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-10px); }
  36% { transform: translateX(10px); }
  54% { transform: translateX(-7px); }
  72% { transform: translateX(7px); }
  88% { transform: translateX(-3px); }
}

.shake-miss {
  animation: shakeMiss 0.48s ease;
}

.red-flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 35%, rgba(244, 63, 94, 0.42) 100%);
  opacity: 0;
  z-index: 60;
  transition: opacity 0.18s ease;
}

.red-flash-overlay.show {
  opacity: 1;
}

/* ==========================================================================
   MOBILE PLAYER PAGE (/)
   ========================================================================== */
.player-shell {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.suit-strip {
  display: inline-flex;
  gap: 3px;
  font-size: 0.9rem;
  opacity: 0.85;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}

.join-hero {
  text-align: center;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.emblem-cards {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.mini-suit-card {
  width: 44px;
  height: 58px;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.mini-suit-card.inverted {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.16);
}

.join-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.join-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 320px;
}

.form-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.error-msg {
  color: #fda4af;
  background: var(--crimson-soft);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.86rem;
  text-align: center;
}

/* Timer bar */
.timer-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timer-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.timer-track {
  width: 100%;
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  background: var(--white);
  width: 100%;
  border-radius: 999px;
  transition: width 0.08s linear, background-color 0.2s ease;
}

.timer-fill.urgent {
  background: var(--crimson);
}

/* Mobile 2x2 doors grid */
.doors-grid-mobile {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

.doors-grid-mobile.doors-6 {
  grid-template-columns: repeat(3, 1fr);
}

/* Didactic Win Card (X vs Y from Slide 4) */
.win-banner {
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.16) 0%, var(--surface) 60%);
  border: 1.5px solid rgba(16, 185, 129, 0.48);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.xy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.xy-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
}

.xy-box.highlight {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.xy-val {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
}

.xy-desc {
  font-size: 0.74rem;
  margin-top: 4px;
  opacity: 0.8;
}

.miss-banner {
  background: linear-gradient(160deg, rgba(244, 63, 94, 0.16) 0%, var(--surface) 65%);
  border: 1.5px solid rgba(244, 63, 94, 0.48);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 80;
}

/* ==========================================================================
   PROJECTOR / TELÃO DASHBOARD (/telao)
   ========================================================================== */
.telao-login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.telao-login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.telao-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 14px 18px 18px;
  gap: 14px;
  max-width: 1680px;
  margin: 0 auto;
}

.telao-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 16px;
}

.telao-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--white);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
}

.brand-titles h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-titles span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.telao-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* KPI Row */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.kpi-card.emphasis {
  border-color: var(--border-strong);
  background: linear-gradient(135deg, #16161d 0%, #101014 100%);
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--white);
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Main Dashboard Split */
.telao-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.95fr) minmax(320px, 0.95fr);
  gap: 14px;
  min-height: 0;
}

.telao-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* Live Stage Card (4 Doors on Projector) */
.stage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.stage-doors-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stage-doors-row.doors-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stage-doors-row.doors-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stage-door-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stage-door-col .door-card {
  max-width: 140px;
  aspect-ratio: 4 / 3.2;
}

.stage-door-col .door-suit-big {
  font-size: 1.65rem;
}

.stage-door-col .reveal-symbol {
  font-size: 1.8rem;
}

.door-pick-stat {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 18px;
}

/* Chart Block */
.chart-card {
  flex: 1;
  min-height: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 290px;
  width: 100%;
}

/* Right Sidebar (Mural da Sorte & do Azar) */
.telao-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.mural-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mural-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.96rem;
}

.survivor-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
}

.survivor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.survivor-item.danger {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}

.survivor-item.picked {
  border-color: rgba(255, 255, 255, 0.35);
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 130px;
  overflow-y: auto;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  animation: popIn 0.22s ease;
}

.player-chip.lucky {
  background: var(--emerald-soft);
  border-color: rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

.player-chip .kick-x {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 2px;
}

.player-chip .kick-x:hover {
  color: var(--crimson);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.86); }
  to { opacity: 1; transform: scale(1); }
}

.feed-card {
  flex: 1;
  min-height: 150px;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
  font-size: 0.8rem;
}

.feed-row {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border-left: 2.5px solid var(--border-strong);
}

.feed-row.win { border-left-color: var(--emerald); }
.feed-row.miss { border-left-color: var(--crimson); }
.feed-row.bots { border-left-color: var(--amber); }
.feed-row.join { border-left-color: #60a5fa; }

.feed-time {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.72rem;
  flex-shrink: 0;
}

/* ==========================================================================
   MODALS (QR Lobby Overlay & Falta de Memória Spotlight)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 7, 0.88);
  backdrop-filter: blur(10px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.qr-modal {
  width: 100%;
  max-width: 1120px;
  max-height: 92dvh;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 28px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.qr-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.qr-frame {
  background: var(--white);
  padding: 16px;
  border-radius: 20px;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 50px rgba(255, 255, 255, 0.14);
}

.qr-frame svg,
.qr-frame img {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-url-box {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--white);
  word-break: break-all;
}

.lobby-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.lobby-roster {
  flex: 1;
  min-height: 180px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
}

.lobby-roster .player-chip {
  font-size: 0.95rem;
  padding: 7px 14px;
  background: var(--surface-2);
  border-color: var(--border-strong);
}

/* Theatrical Spotlight Modal (Falta de Memória) */
.spotlight-modal {
  width: 100%;
  max-width: 920px;
  background: radial-gradient(circle at top center, #1d1709 0%, #0d0d11 58%);
  border: 2px solid var(--amber);
  border-radius: 26px;
  padding: 36px 38px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: 0 0 90px rgba(245, 158, 11, 0.25);
}

.spotlight-names {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--white);
  line-height: 1.1;
}

.spotlight-question {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 600;
  color: #fde68a;
  max-width: 720px;
}

.spotlight-answer-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(16, 185, 129, 0.55);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: popIn 0.25s ease;
}

.formula-big {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2.2vw, 1.55rem);
  font-weight: 700;
  color: var(--white);
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--white);
  color: var(--black);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 90;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive adjustments */
@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .telao-main {
    grid-template-columns: 1fr;
  }
  .qr-modal {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .qr-frame {
    width: 240px;
    height: 240px;
  }
}
