/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #fdf6ee;
  --panel:   #ffffff;
  --panel2:  #fef5e4;
  --border:  #e8c870;
  --border2: #c89830;
  --orange:  #c85000;
  --orange2: #e06400;
  --gold:    #9a6800;
  --gold2:   #c88000;
  --text:    #1a0800;
  --muted:   #7a5830;
  --green:   #1a7030;
  --pink:    #c01870;
  --cream:   #fff8ee;
  --red:     #c81800;
  --radius:  8px;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Nav bar ──────────────────────────────────────────────── */
nav {
  background: #fff;
  border-bottom: 3px solid var(--orange);
  box-shadow: 0 2px 12px rgba(200, 80, 0, 0.12);
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 58px;
  gap: 2px;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--orange);
  margin-right: auto;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

nav .brand small {
  display: block;
  font-size: 0.58rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

nav button {
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
  transition: all 0.15s;
}

nav button:hover { color: var(--orange); border-color: var(--border); background: var(--panel2); }
nav button.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  font-weight: 600;
}
/* Admin gear — visually separated, muted */
nav .nav-admin {
  margin-left: auto;
  color: var(--muted);
  font-size: 1rem;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
nav .nav-admin:hover { color: var(--orange); background: var(--panel2); }

/* ── Views ────────────────────────────────────────────────── */
.view { display: none; padding: 20px; max-width: 1200px; margin: 0 auto; }
.view.active { display: block; }

/* Game view: full viewport height, no max-width restriction */
#view-game.active {
  display: flex;
  flex-direction: column;
  max-width: none;
  padding: 14px 20px;
  min-height: calc(100vh - 58px);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.card h2 {
  color: var(--orange);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.help-text {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.help-text code {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.78rem;
  color: var(--orange);
}

.optional-tag {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ── Form controls ────────────────────────────────────────── */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.field input {
  width: 100%;
  background: var(--panel2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus { border-color: var(--orange); background: #fff; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 160px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s;
}

.btn-orange {
  background: var(--orange);
  color: #fff;
  border: 1px solid var(--orange2);
}
.btn-orange:hover { background: var(--orange2); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #fff;
  border: 1px solid var(--border2);
}
.btn-gold:hover { filter: brightness(1.1); }

.btn-outline {
  background: #fff;
  color: var(--orange);
  border: 1.5px solid var(--orange);
}
.btn-outline:hover { background: var(--panel2); }

.btn-reveal {
  background: linear-gradient(135deg, #1a7030, #24a044);
  color: #fff;
  border: 1px solid #1a7030;
  animation: pulse-green 2s infinite;
}
.btn-reveal:hover { filter: brightness(1.1); animation: none; }

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26, 112, 48, 0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(26, 112, 48, 0); }
}

.btn-big { font-size: 1.1rem; padding: 13px 30px; border-radius: 10px; }
.btn-sm  { padding: 5px 12px; font-size: 0.78rem; }

.btn-newgame {
  background: #fff;
  color: var(--red);
  border: 1.5px solid var(--red);
}
.btn-newgame:hover { background: #fdecea; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Status msg ───────────────────────────────────────────── */
.status-msg { margin-left: 12px; font-size: 0.82rem; color: var(--muted); }

/* ── Status pills ─────────────────────────────────────────── */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.stat .val { font-size: 1.6rem; font-weight: 700; color: var(--orange); }
.stat .lbl { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

/* ── Toast ────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #fff;
  border: 1.5px solid var(--orange);
  color: var(--orange);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.err  { border-color: var(--red); color: var(--red); }

/* ════════════════════════════════════════════════════════════
   OVERLAY SCREENS (modal, winner, fail)
   ══════════════════════════════════════════════════════════ */
.overlay-screen {
  position: fixed;
  inset: 0;
  background: rgba(20, 8, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(4px);
}

/* Session modal */
.session-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 36px 48px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}
.session-card-icon { font-size: 3rem; margin-bottom: 8px; }
.session-card h2 { color: var(--orange); font-size: 1.5rem; margin-bottom: 16px; }
.session-info { color: var(--muted); font-size: 0.92rem; margin-bottom: 24px; line-height: 1.6; }
.session-info strong { color: var(--text); }
.session-modal-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.session-setup-link {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 0.8rem; margin-top: 12px;
  text-decoration: underline;
}
.session-setup-link:hover { color: var(--orange); }

/* Winner overlay */
.winner-card {
  position: relative;
  background: linear-gradient(135deg, #fffbe6, #fff5cc);
  border: 3px solid #c88000;
  border-radius: 20px;
  padding: 40px 56px;
  text-align: center;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 0 60px rgba(200, 128, 0, 0.5), 0 16px 48px rgba(0,0,0,0.3);
  animation: winner-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.winner-trophy {
  font-size: 4.5rem;
  animation: trophy-bounce 1s ease-in-out infinite alternate;
  display: block;
  margin-bottom: 8px;
}
@keyframes trophy-bounce {
  from { transform: translateY(0) rotate(-5deg); }
  to   { transform: translateY(-10px) rotate(5deg); }
}
@keyframes winner-pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.winner-title {
  font-size: 1.6rem;
  color: var(--orange);
  font-weight: 700;
  margin-bottom: 4px;
}
.winner-sub {
  font-size: 2.4rem;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.winner-prize {
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 700;
  background: var(--panel2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 20px;
  margin-bottom: 8px;
  display: inline-block;
}
.winner-ticket { font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }

/* Fail overlay */
.fail-card {
  background: #fff;
  border: 2.5px solid #c81800;
  border-radius: 16px;
  padding: 36px 48px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
  animation: fail-shake 0.4s ease;
}
@keyframes fail-shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-12px); }
  40%     { transform: translateX(12px); }
  60%     { transform: translateX(-8px); }
  80%     { transform: translateX(8px); }
}
.fail-icon {
  font-size: 4rem;
  color: var(--red);
  font-weight: 900;
  animation: fail-spin 0.4s ease;
}
@keyframes fail-spin {
  from { transform: scale(0) rotate(-180deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}
.fail-title { font-size: 1.6rem; color: var(--red); font-weight: 700; margin: 12px 0 6px; }
.fail-sub   { font-size: 0.9rem; color: var(--muted); }

/* Confetti */
#confetti-wrap {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 490;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ════════════════════════════════════════════════════════════
   GAME VIEW
   ══════════════════════════════════════════════════════════ */
.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.session-badge {
  display: flex;
  align-items: center;
  gap: 14px;
}
#session-label {
  font-weight: 700;
  color: var(--orange);
  font-size: 0.92rem;
}
.session-count { font-size: 0.85rem; color: var(--muted); }
.session-count strong { color: var(--text); font-size: 1.1rem; }

.game-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.game-main { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }

/* Current Q display */
.q-display {
  background: linear-gradient(135deg, var(--panel2), #fff8e8);
  border: 2px solid var(--border);
  border-radius: 14px;
  flex: 1;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 32px;
  text-align: center;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(200, 128, 0, 0.1);
}
.q-display .q-number {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.q-display .q-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.q-display .a-text {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #e86000);
  border: none;
  border-radius: 12px;
  padding: 14px 36px;
  letter-spacing: 1px;
  box-shadow: 0 4px 18px rgba(200, 80, 0, 0.35);
  animation: answer-reveal 0.45s cubic-bezier(0.175,0.885,0.32,1.275);
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.a-glow {
  opacity: 0.7;
  font-size: 1.4rem;
}
@keyframes answer-reveal {
  from { opacity: 0; transform: scale(0.7) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
/* Media fills the q-display box */
.q-media {
  flex: 1;
  min-height: 0;
  max-width: 100%;
  width: 100%;
  border-radius: 10px;
  object-fit: contain;
  cursor: pointer;
}
.q-media:not(.q-media-ans) {
  border: 2px solid var(--border);
}
.q-media-ans {
  max-height: 180px;
  flex: none;
}
.q-display .placeholder {
  color: var(--muted);
  font-size: 1rem;
}

.draw-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Right panel */
.game-right { display: flex; flex-direction: column; gap: 0; }

.call-history {
  max-height: 200px;
  overflow-y: auto;
  background: var(--panel2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 6px;
}
.call-history::-webkit-scrollbar { width: 4px; }
.call-history::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.history-empty { color: var(--muted); font-size: 0.8rem; text-align: center; padding: 16px; }

.history-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 5px 6px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.history-item .hq {
  color: var(--orange);
  font-weight: 700;
  min-width: 24px;
  font-size: 0.72rem;
  flex-shrink: 0;
}
.history-item .ha { color: var(--text); line-height: 1.3; }

/* ════════════════════════════════════════════════════════════
   VERIFY VIEW
   ══════════════════════════════════════════════════════════ */
.verify-search {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.verify-search .field { flex: 1; max-width: 260px; margin-bottom: 0; }

.verify-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.verify-meta h3 { color: var(--orange); font-size: 1.1rem; font-weight: 700; }
.vt-called-info { font-size: 0.8rem; color: var(--muted); }

/* Verify status banner */
#verify-status-banner {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  animation: banner-in 0.3s ease;
}
@keyframes banner-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.banner-win  { background: #e8f5e9; border: 2px solid var(--green); color: var(--green); }
.banner-fail { background: #fdecea; border: 2px solid var(--red);   color: var(--red); }
.banner-prev { background: #fff8e1; border: 2px solid var(--gold2); color: var(--gold); }

/* Ticket grid 3×5 */
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}
.tcell {
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 8px 4px 6px;
  text-align: center;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.2s;
}
.tcell .tans { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.2; }

.tcell.called {
  background: #ff9a3c;
  border-color: #d46000;
}
.tcell.called .tans { color: #fff; }

.tcell.row-win {
  background: var(--pink);
  border-color: #901050;
}
.tcell.row-win .tans { color: #fff; }

/* Prize chips */
.prize-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.prize-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  border: 1.5px solid var(--border);
  background: var(--panel2);
  color: var(--muted);
}
.prize-chip.eligible {
  border-color: var(--green);
  color: var(--green);
  background: #e8f5e9;
}
.prize-chip.claimed {
  border-color: var(--gold2);
  color: var(--gold);
  background: #fff8e1;
}
.prize-chip .chip-btn {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.prize-chip .chip-btn:hover { background: #1a9040; }

/* ════════════════════════════════════════════════════════════
   PRIZE BOARD VIEW
   ══════════════════════════════════════════════════════════ */
.prize-board-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 18px;
}

.prize-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.prize-table th {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 10px;
  border-bottom: 1.5px solid var(--border);
  text-align: left;
}
.prize-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.prize-table tr:last-child td { border-bottom: none; }
.prize-table .badge {
  background: var(--orange);
  color: #fff;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}
.table-empty { color: var(--muted); text-align: center; padding: 24px; }

.unclaimed-list { display: flex; flex-direction: column; gap: 8px; }
.prize-status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--panel2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.prize-status-item.won-item {
  background: #fff8e1;
  border-color: var(--gold2);
}
.prize-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.won-item .prize-dot { background: var(--gold2); }
.prize-label { color: var(--muted); flex: 1; }
.won-item .prize-label { color: var(--gold); font-weight: 600; }
.prize-winners-badge {
  font-size: 0.72rem;
  color: var(--gold);
  background: #fff;
  border: 1px solid var(--gold2);
  border-radius: 10px;
  padding: 2px 8px;
  margin-left: auto;
}

/* ── Lucky Draw ───────────────────────────────────────────── */
.lucky-layout {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.lucky-card {
  width: 100%;
  max-width: 560px;
}

.ld-textarea {
  width: 100%;
  font-size: 1rem;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel2);
  color: var(--text);
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}
.ld-textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(200, 80, 0, 0.12);
}

.ld-display {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--orange);
  text-align: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, var(--panel2), #fff8e8);
  border: 2px solid var(--border);
  border-radius: 14px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  transition: color 0.1s;
}

.ld-result {
  margin-top: 18px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
  text-align: center;
  padding: 18px;
  background: #eafaf0;
  border: 2px solid var(--green);
  border-radius: 12px;
  animation: answer-reveal 0.4s ease;
}

.ld-stopped {
  color: var(--gold);
  background: #fff8e1;
  border-color: var(--gold2);
}

/* ── Verify: last-called banner & star ───────────────────── */
.last-called-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff8e1;
  border: 1.5px solid var(--gold2);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  color: var(--gold);
}

.last-called-banner .lc-label {
  font-weight: 600;
  color: var(--orange);
  white-space: nowrap;
}

/* ── Dataset list in setup ───────────────────────────────── */
.dataset-list { display: flex; flex-direction: column; gap: 8px; }
.ds-empty { color: var(--muted); font-size: 0.88rem; padding: 12px 0; }
.ds-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.ds-row.ds-active {
  background: #fff8e1;
  border-color: var(--orange);
}
.ds-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ds-name { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.ds-badge {
  display: inline;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--orange);
  margin-left: 8px;
}
.ds-meta { font-size: 0.75rem; color: var(--muted); }
.ds-actions { display: flex; gap: 6px; }

/* Ticket cell with last-called highlight — orange (called) + pulsing ring */
.tcell.last-called-cell {
  background: #ff9a3c !important;
  border-color: transparent !important;
  position: relative;
  z-index: 1;
}
.tcell.last-called-cell .tans { color: #fff; }

.last-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3.5px solid var(--orange);
  pointer-events: none;
  animation: ring-pulse 1.1s ease-in-out infinite;
  z-index: 2;
}

@keyframes ring-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(200, 80, 0, 0.55); border-color: var(--orange); }
  50%  { box-shadow: 0 0 0 8px rgba(200, 80, 0, 0);    border-color: #e86000; }
  100% { box-shadow: 0 0 0 0   rgba(200, 80, 0, 0.55); border-color: var(--orange); }
}

/* ── Verify: status banner ───────────────────────────────── */
#verify-status-banner {
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ── Media sizing in q-display ──────────────────────────── */
.q-display img {
  max-height: 260px;
}
.q-display video {
  max-height: 280px;
}

/* ── Media lightbox ──────────────────────────────────────── */
.media-lightbox-bg {
  background: rgba(0, 0, 0, 0.92);
  z-index: 500;
  cursor: zoom-out;
}
#media-lightbox-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.media-lb-close {
  position: fixed;
  top: 18px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.media-lb-close:hover { background: rgba(255,255,255,0.3); }

/* ── Media in q-display: click cursor hint ───────────────── */
.q-media { cursor: zoom-in; }

/* ── Ticket swipe-in animation ───────────────────────────── */
@keyframes ticket-swipe-in {
  0%   { transform: translateX(-60px) skewX(-6deg); opacity: 0; }
  60%  { transform: translateX(8px)   skewX(2deg);  opacity: 1; }
  100% { transform: translateX(0)     skewX(0);     opacity: 1; }
}
.ticket-swipe {
  animation: ticket-swipe-in 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Verify status banners ───────────────────────────────── */
.banner-win {
  background: #e8faf0; color: var(--green);
  border: 1.5px solid var(--green);
  border-radius: var(--radius); padding: 10px 16px;
  margin-bottom: 12px; font-size: 0.9rem; font-weight: 600;
}
.banner-fail {
  background: #fdecea; color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: var(--radius); padding: 10px 16px;
  margin-bottom: 12px; font-size: 0.9rem; font-weight: 600;
}
.banner-prev {
  background: #fff8e1; color: var(--gold);
  border: 1.5px solid var(--gold2);
  border-radius: var(--radius); padding: 10px 16px;
  margin-bottom: 12px; font-size: 0.9rem; font-weight: 600;
}

/* ── Custom confirm dialog ────────────────────────────────── */
.confirm-card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px 28px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  animation: winner-pop 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
}
.confirm-icon { font-size: 2.4rem; margin-bottom: 10px; }
.confirm-card h2 { font-size: 1.4rem; color: var(--text); margin-bottom: 12px; }
.confirm-card p  { color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }

.btn-red {
  background: var(--red);
  color: #fff;
  border: none;
}
.btn-red:hover { background: #a01000; }

/* ── Lucky draw full-screen spin overlay ─────────────────── */
#ld-spin-overlay {
  background: rgba(26, 8, 0, 0.92);
  z-index: 300;
}
.ld-spin-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.ld-spin-label {
  font-size: 1.4rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.ld-spin-name {
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 900;
  color: var(--orange);
  text-shadow: 0 0 30px rgba(200, 80, 0, 0.7), 0 4px 10px rgba(0,0,0,0.5);
  letter-spacing: 2px;
  text-align: center;
  padding: 0 24px;
  animation: ld-name-pulse 0.12s ease-in-out;
  max-width: 80vw;
  word-break: break-word;
}
@keyframes ld-name-pulse {
  0%   { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1);    opacity: 1; }
}

@media (max-width: 768px) {
  .game-layout      { grid-template-columns: 1fr; }
  .prize-board-grid { grid-template-columns: 1fr; }
  nav .brand small  { display: none; }
  .btn-big          { font-size: 0.95rem; padding: 11px 22px; }
  .q-display .q-text { font-size: 1.5rem; }
  .lucky-layout { padding: 0; }
}
