/* Presentation Mode - Full-screen 16:9 Gala */

.stage {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at top, #2C0F49 0%, #0E0620 65%, #050112 100%);
  color: #fff;
  overflow: hidden;
  font-family: var(--font-sans);
}

/* Ambient background particles (CSS-only) */
.stage::before, .stage::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
}
.stage::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(230,178,60,0.25), transparent 70%);
  top: -120px; left: -120px;
  animation: floaty1 12s ease-in-out infinite alternate;
}
.stage::after {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(155,89,182,0.28), transparent 70%);
  bottom: -160px; right: -160px;
  animation: floaty2 14s ease-in-out infinite alternate;
}
@keyframes floaty1 { to { transform: translate(60px, 80px); } }
@keyframes floaty2 { to { transform: translate(-40px, -60px); } }

/* Header logo bar */
.stage-header {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 24px 40px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 5;
}
.stage-header .logo { display: flex; align-items: center; gap: 12px; }
.stage-header .logo img { height: 46px; }
.stage-header .event {
  text-align: right;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.stage-header .event .name { font-family: var(--font-display); font-size: 16px; color: var(--gala-gold-light); letter-spacing: 0.14em; margin-top: 2px; }

/* Center content */
.stage-body {
  position: absolute; inset: 100px 40px 60px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  pointer-events: none; /* stage-body chỉ để hiển thị; controls phía ngoài (adminbar) nhận click */
}
.stage-body a, .stage-body button { pointer-events: auto; }

/* Prize plaque */
.prize-plaque {
  padding: 16px 32px;
  background: linear-gradient(135deg, rgba(230,178,60,0.15), rgba(230,178,60,0.05));
  border: 1px solid rgba(230,178,60,0.30);
  border-radius: 999px;
  color: var(--gala-gold-light);
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  font-size: 22px;
  margin-bottom: 24px;
  text-transform: uppercase;
}
.prize-plaque .reward { font-family: var(--font-sans); font-size: 14px; color: rgba(255,255,255,0.72); letter-spacing: .1em; display: block; margin-top: 4px; text-transform: none; }

/* Title / prompt */
.stage-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 74px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.05;
  text-shadow: 0 0 40px rgba(230,178,60,0.30);
  margin-bottom: 8px;
}
.stage-subtitle {
  font-size: clamp(14px, 1.4vw, 18px);
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

/* Reel — big numbers rolling */
.reel-row {
  display: flex; gap: 18px; justify-content: center; align-items: center;
  margin: 24px 0;
  flex-wrap: wrap;
}
.reel {
  width: clamp(140px, 12vw, 200px);
  height: clamp(180px, 16vw, 260px);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
  border: 2px solid rgba(230,178,60,0.35);
  box-shadow:
    inset 0 4px 20px rgba(0,0,0,0.4),
    0 0 60px rgba(230,178,60,0.18);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.reel .digit {
  font-size: clamp(80px, 10vw, 160px);
  line-height: 1;
  text-shadow: 0 0 30px rgba(230,178,60,0.4);
  transition: none;
}
.reel.locked .digit {
  color: var(--gala-gold-light);
  text-shadow: 0 0 40px rgba(230,178,60,0.9);
  animation: pulse-gold 1.2s ease-in-out infinite alternate;
}
@keyframes pulse-gold {
  from { text-shadow: 0 0 30px rgba(230,178,60,0.5); }
  to   { text-shadow: 0 0 60px rgba(230,178,60,1); }
}

/* Reveal name */
.winner-reveal {
  margin-top: 28px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.winner-reveal.show { opacity: 1; transform: none; }
.winner-reveal .name {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 72px);
  color: #fff;
  text-shadow: 0 0 30px rgba(230,178,60,0.6);
  letter-spacing: -0.01em;
}
.winner-reveal .dept {
  margin-top: 8px;
  color: var(--gala-gold-light);
  font-size: clamp(16px, 1.4vw, 20px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Multi-winner list */
.multi-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
  max-width: 900px;
}
.multi-list .row-w {
  display: grid; grid-template-columns: 90px 1fr 1fr;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(230,178,60,0.20);
  border-radius: 14px;
  opacity: 0; transform: translateY(15px);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
}
.multi-list .row-w.show { opacity: 1; transform: none; }
.multi-list .row-w .num {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--gala-gold-light);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.multi-list .row-w .n { font-size: 18px; color: #fff; font-weight: 600; }
.multi-list .row-w .d { color: rgba(255,255,255,0.6); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }

/* Special big number for single (large prize) */
.big-number {
  font-family: var(--font-display);
  font-size: clamp(180px, 22vw, 340px);
  font-weight: 700;
  line-height: 0.9;
  color: #fff;
  text-shadow:
    0 0 60px rgba(230,178,60,0.7),
    0 0 120px rgba(230,178,60,0.35);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Confetti canvas */
#confetti-canvas,
.confetti-canvas-el {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Draw overlay — bung fullscreen sân khấu ngay tại tab Admin.
   z-index < .modal-backdrop (8000) để modal xác nhận vẫn bấm được khi overlay đang mở. */
.draw-overlay {
  position: fixed; inset: 0;
  z-index: 5000;
  animation: overlay-in .35s var(--ease-out);
}
.draw-overlay .stage { position: absolute; inset: 0; pointer-events: none; }
.draw-overlay .stage a, .draw-overlay .stage button { pointer-events: auto; }
@keyframes overlay-in {
  from { opacity: 0; transform: scale(1.02); }
  to   { opacity: 1; transform: none; }
}
.draw-overlay.closing { animation: overlay-out .28s var(--ease-in) forwards; }
@keyframes overlay-out {
  to { opacity: 0; transform: scale(0.98); }
}

/* Admin control bar (bottom) inside overlay */
.overlay-adminbar {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex; gap: 10px; align-items: center;
  padding: 12px 18px;
  background: rgba(10, 4, 24, 0.72);
  border: 1px solid rgba(230, 178, 60, 0.35);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 40px rgba(230,178,60,0.15);
  animation: bar-in .32s var(--ease-out) both;
}
@keyframes bar-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.overlay-adminbar .status {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-right: 12px;
  border-right: 1px solid rgba(255,255,255,0.15);
  margin-right: 4px;
}
.overlay-adminbar .btn {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.20);
  padding: 10px 18px;
  font-size: 14px;
}
.overlay-adminbar .btn:hover { background: rgba(255,255,255,0.18); }
.overlay-adminbar .btn-primary {
  background: linear-gradient(135deg, var(--brand-primary-light), var(--brand-primary));
  border-color: transparent;
}
.overlay-adminbar .btn-gold {
  background: linear-gradient(135deg, var(--gala-gold), var(--gala-gold-strong));
  color: #2C0F49; border-color: transparent;
}
.overlay-adminbar .btn-danger { background: rgba(192, 57, 43, 0.6); border-color: rgba(192, 57, 43, 0.8); }
.overlay-adminbar .btn.busy { opacity: .5; cursor: not-allowed; }

/* Close X at top-right of overlay */
.overlay-close {
  position: absolute;
  top: 24px; right: 24px;
  z-index: 15;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s;
}
.overlay-close:hover { background: rgba(255,255,255,0.16); }

/* Cast-to-LED chip */
.overlay-cast-hint {
  position: absolute;
  top: 24px; left: 24px;
  z-index: 15;
  padding: 8px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  letter-spacing: 0.08em;
  display: flex; align-items: center; gap: 6px;
}
.overlay-cast-hint .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gala-gold); box-shadow: 0 0 8px var(--gala-gold-glow); }

/* Admin overlay on presentation (hidden by default in present pure mode) */
.stage-controls {
  position: absolute;
  bottom: 24px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 12px;
  z-index: 12;
  opacity: 0;
  transition: opacity .2s;
}
.stage-controls.show,
.stage:hover .stage-controls { opacity: 1; }
.stage-controls .btn {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.20);
  backdrop-filter: blur(10px);
}
.stage-controls .btn:hover { background: rgba(255,255,255,0.15); }
.stage-controls .btn-primary { background: var(--brand-primary); }
.stage-controls .btn-gold { background: linear-gradient(135deg, var(--gala-gold), var(--gala-gold-strong)); color: #2C0F49; }

/* Ready screen */
.ready-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
}
/* Horizontal logo (icon HT + text "DR HOÀNG TUẤN" ngang cạnh nhau) */
.ready-screen .brand-logo-h {
  width: clamp(280px, 30vw, 440px);
  height: auto;
  filter: drop-shadow(0 6px 30px rgba(230,178,60,0.30));
  margin-bottom: 6px;
}
.ready-screen .brand-mark {
  width: clamp(160px, 20vw, 260px);
  filter: drop-shadow(0 0 40px rgba(230,178,60,0.35));
}
.ready-screen .event-name-large {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 700;
  color: var(--gala-gold-light);
  letter-spacing: 0.20em;
  text-transform: uppercase;
  margin: 14px 0 4px;
  text-shadow: 0 0 24px rgba(230,178,60,0.35);
}
.ready-screen .event-meta {
  color: rgba(255,255,255,0.55);
  font-size: clamp(11px, 1vw, 13px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.ready-screen .title {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 96px);
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 0 40px rgba(230,178,60,0.4);
  margin: 8px 0;
}
.ready-screen .sub {
  color: var(--gala-gold-light);
  font-size: clamp(14px, 1.4vw, 18px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* Handover / status footer */
.stage-footer {
  position: absolute; bottom: 16px; right: 24px;
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Winner mã NV badge — hiện cạnh phòng ban trong reveal */
.winner-reveal .badge-code {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(230, 178, 60, 0.14);
  border: 1px solid rgba(230, 178, 60, 0.5);
  border-radius: 999px;
  color: var(--gala-gold-light);
  font-family: var(--font-sans);
  font-size: 0.72em;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
  margin-right: 4px;
  vertical-align: 2px;
}
.multi-list .row-w .code-inline {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: rgba(230, 178, 60, 0.14);
  border-radius: 999px;
  font-size: 11px;
  color: var(--gala-gold-light);
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  vertical-align: 3px;
}

/* ============================================================
   KIOSK MODE — 1 màn full-screen cho MC
   ============================================================ */
.kiosk-root {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at top, #2C0F49 0%, #0E0620 65%, #050112 100%);
  color: #fff;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

/* Topbar */
.kiosk-topbar {
  padding: 18px 32px;
  display: flex; align-items: center; gap: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
  z-index: 2;
}
.kiosk-brand { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.kiosk-brand img { height: 42px; }
.kiosk-event {
  font-family: var(--font-display);
  color: var(--gala-gold-light);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.kiosk-prize-pills {
  flex: 1;
  display: flex; gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.kiosk-prize-pills::-webkit-scrollbar { display: none; }
.kiosk-pill {
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 8px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.85);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: all .18s var(--ease);
}
.kiosk-pill:hover:not(:disabled) { background: rgba(255,255,255,0.12); }
.kiosk-pill.on {
  background: linear-gradient(135deg, var(--gala-gold), var(--gala-gold-strong));
  color: #2C0F49;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(230,178,60,0.35);
}
.kiosk-pill.done { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
.kiosk-pill .pill-name { font-size: 14px; }
.kiosk-pill .pill-remain { font-size: 10.5px; opacity: 0.75; font-variant-numeric: tabular-nums; margin-top: 1px; }

.kiosk-back {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.kiosk-back:hover { background: rgba(255,255,255,0.12); color: #fff; }
.kiosk-back-warn {
  background: rgba(244, 130, 32, 0.14);
  border-color: rgba(244, 130, 32, 0.5);
  color: var(--brand-orange-light);
}
.kiosk-back-warn:hover { background: rgba(244, 130, 32, 0.28); color: #fff; }

/* Body (stage container) */
.kiosk-body {
  position: relative;
  overflow: hidden;
}
.kiosk-body .stage {
  position: absolute; inset: 0;
  background: transparent;
}
.kiosk-body .stage::before, .kiosk-body .stage::after { content: none; } /* topbar/bottombar đã có gradient */
.kiosk-body .stage-body { inset: 20px 40px; pointer-events: none; }

/* Bottombar */
.kiosk-bottombar {
  padding: 24px 40px 32px;
  display: flex; align-items: center; justify-content: center; gap: 20px;
  z-index: 2;
  background: linear-gradient(0deg, rgba(0,0,0,0.35), transparent);
}
.kiosk-empty {
  color: rgba(255,255,255,0.5);
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 20px;
}

/* GIANT spin button */
.kiosk-spin {
  position: relative;
  min-width: 480px;
  padding: 22px 60px;
  border-radius: 999px;
  border: 3px solid transparent;
  background: linear-gradient(135deg, var(--gala-gold) 0%, #C69A2E 50%, var(--gala-gold) 100%);
  background-size: 200% 200%;
  color: #2C0F49;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow:
    0 0 0 6px rgba(230, 178, 60, 0.15),
    0 20px 60px rgba(230, 178, 60, 0.45),
    inset 0 -6px 16px rgba(198, 154, 46, 0.35);
  animation: spin-glow 3s ease-in-out infinite alternate, spin-shift 4s linear infinite;
  transition: transform .15s var(--ease);
  overflow: hidden;
}
.kiosk-spin:hover:not(:disabled) { transform: translateY(-3px) scale(1.02); }
.kiosk-spin:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.kiosk-spin:disabled { opacity: 0.55; cursor: not-allowed; animation: none; }
.kiosk-spin .spin-label { position: relative; z-index: 2; }
.kiosk-spin .spin-hint {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: none;
  opacity: 0.68;
  position: relative; z-index: 2;
}
.kiosk-spin .spin-ring {
  position: absolute; inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,178,60,0.35), transparent 70%);
  animation: ring-pulse 2.5s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}
@keyframes spin-glow {
  from { box-shadow: 0 0 0 6px rgba(230,178,60,0.15), 0 20px 60px rgba(230,178,60,0.45), inset 0 -6px 16px rgba(198,154,46,0.35); }
  to   { box-shadow: 0 0 0 10px rgba(230,178,60,0.22), 0 30px 90px rgba(230,178,60,0.70), inset 0 -6px 16px rgba(198,154,46,0.35); }
}
@keyframes spin-shift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%      { transform: scale(1.12); opacity: 1; }
}

/* Post-reveal buttons (XÁC NHẬN / QUAY LẠI / QUAY TIẾP) */
.kiosk-btn {
  min-width: 240px;
  padding: 18px 36px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: all .18s var(--ease);
}
.kiosk-btn:hover { transform: translateY(-2px); }
.kiosk-btn-gold {
  background: linear-gradient(135deg, var(--gala-gold), var(--gala-gold-strong));
  color: #2C0F49;
  box-shadow: 0 12px 32px rgba(230,178,60,0.35);
}
.kiosk-btn-outline {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}
.kiosk-btn-outline:hover { background: rgba(255,255,255,0.16); }
