/* Annual Dinner Lucky Draw — Premium Black & Gold */
:root {
  --bg: #08080a;
  --bg-2: #111114;
  --panel: #16161a;
  --panel-2: #1d1d22;
  --line: rgba(212, 175, 55, .22);
  --line-soft: rgba(255, 255, 255, .07);
  --gold: #d4af37;
  --gold-2: #f5d77a;
  --gold-3: #b8860b;
  --gold-grad: linear-gradient(135deg, #b8860b 0%, #f5d77a 45%, #d4af37 60%, #8a6a12 100%);
  --text: #f4efe3;
  --muted: #a39d8f;
  --ok: #3ecf8e;
  --warn: #f0a33a;
  --err: #ef5350;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --serif: 'Cinzel', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -200px, rgba(212, 175, 55, .12), transparent 70%), var(--bg);
  color: var(--text); font: 15px/1.5 var(--sans);
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); letter-spacing: .02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h2 { font-size: 1.15rem; color: var(--gold-2); }
h2 small, h3 small, label small, summary small { font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: .78rem; margin-left: .35em; letter-spacing: 0; }
code { font-size: .9em; color: var(--gold-2); }
kbd { border: 1px solid var(--line); border-radius: 4px; padding: 0 .35em; font-size: .85em; }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gold { color: var(--gold-2); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.right { text-align: right; }
.mt { margin-top: 1.2rem; }
[hidden] { display: none !important; }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem; padding: .6rem 1.2rem;
  background: rgba(8, 8, 10, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none !important; min-width: 0; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-grad); color: #111; font-size: 1.2rem; flex: none; box-shadow: 0 0 18px rgba(212, 175, 55, .4); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-family: var(--serif); color: var(--gold-2); letter-spacing: .06em; }
.brand-text small { color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.mainnav { display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
.mainnav a {
  display: flex; flex-direction: column; align-items: center; padding: .4rem .8rem; border-radius: 10px;
  color: var(--text); font-weight: 600; font-size: .9rem; text-decoration: none; line-height: 1.2;
}
.mainnav a small { font-weight: 400; color: var(--muted); font-size: .68rem; }
.mainnav a:hover { background: rgba(212, 175, 55, .08); }
.mainnav a.active { background: rgba(212, 175, 55, .14); color: var(--gold-2); box-shadow: inset 0 -2px 0 var(--gold); }
.mainnav a.nav-sub { font-weight: 500; color: var(--muted); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--gold-2); border-radius: 8px; font-size: 1.3rem; padding: .2rem .7rem; cursor: pointer; }

.container { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

/* ---------- page parts */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { margin-bottom: .1em; }
.page-head p { margin: 0; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.2rem; box-shadow: var(--shadow);
}
details.card > summary { cursor: pointer; font-weight: 600; color: var(--gold-2); list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: '▸ '; }
details.card[open] > summary { margin-bottom: 1rem; }
details.card[open] > summary::before { content: '▾ '; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + * { margin-top: 1.2rem; }
.empty { text-align: center; padding: 2.5rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

.tabs { display: flex; gap: .3rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: .6rem 1rem; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; text-decoration: none; display: flex; flex-direction: column; line-height: 1.2; }
.tabs a small { font-weight: 400; font-size: .7rem; }
.tabs a.active { color: var(--gold-2); border-bottom-color: var(--gold); }

/* ---------- stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: .6rem; }
.stat {
  position: relative; overflow: hidden; padding: 1.2rem 1.3rem; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--panel-2), var(--bg-2)); border: 1px solid var(--line);
}
.stat::after { content: ''; position: absolute; inset: auto -30% -60% auto; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(rgba(212, 175, 55, .18), transparent 70%); }
.stat-label { display: flex; flex-direction: column; color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat-label small { font-weight: 400; font-size: .72rem; }
.stat strong { display: block; font: 700 clamp(2rem, 5vw, 2.8rem)/1.1 var(--serif); margin-top: .3rem; color: var(--text); }
.stat-ok strong { color: var(--ok); }
.stat-warn strong { color: var(--warn); }
.stat-gold strong { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 1.4rem 0; }
.quick-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; padding: 1.1rem .6rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none !important;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.quick-card:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 0 22px rgba(212, 175, 55, .18); }
.quick-card span { font-size: 1.8rem; }
.quick-card small { color: var(--muted); font-size: .75rem; }

/* ---------- forms & buttons */
input, select, textarea {
  width: 100%; padding: .7rem .85rem; border-radius: 10px; font: inherit; color: var(--text);
  background: #0d0d10; border: 1px solid rgba(255, 255, 255, .12); outline: none;
}
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .18); }
input[type=radio], input[type=checkbox] { width: auto; accent-color: var(--gold); }
select option:disabled { color: #666; }
label { display: block; font-weight: 600; font-size: .9rem; }
label > input, label > select { margin-top: .35rem; font-weight: 400; }
.form-stack { display: grid; gap: .9rem; }
.form-inline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.form-inline input, .form-inline select { flex: 1 1 180px; width: auto; }
.form-inline .input-qty { flex: 0 0 90px; }
.radio-group { border: 1px solid var(--line-soft); border-radius: 10px; padding: .6rem .9rem; margin: 0; }
.radio-group legend { color: var(--muted); font-size: .85rem; padding: 0 .3rem; }
.radio-group label { font-weight: 400; display: flex; gap: .5rem; align-items: center; padding: .2rem 0; }
.file-drop { position: relative; border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.6rem 1rem; text-align: center; cursor: pointer; color: var(--muted); }
.file-drop input { margin: .5rem auto 0; max-width: 100%; border: 0; background: none; padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer;
  padding: .65rem 1.1rem; border-radius: 10px; font: 600 .92rem var(--sans); text-decoration: none !important;
  border: 1px solid transparent; transition: filter .15s, transform .1s, background .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-gold { background: var(--gold-grad); color: #1a1405; box-shadow: 0 4px 16px rgba(212, 175, 55, .25); }
.btn-gold:hover { filter: brightness(1.08); }
.btn-outline { background: transparent; color: var(--gold-2); border-color: var(--line); }
.btn-outline:hover { background: rgba(212, 175, 55, .1); border-color: var(--gold); }
.btn-danger { background: #5c1414; color: #ffd9d9; border-color: #8a2222; }
.btn-danger-ghost { background: transparent; color: #f19999; border-color: rgba(239, 83, 80, .35); }
.btn-danger-ghost:hover { background: rgba(239, 83, 80, .12); }
.btn-sm { padding: .38rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .85rem 1.4rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; }

.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.alert-success { background: rgba(62, 207, 142, .1); border-color: rgba(62, 207, 142, .4); color: #b6f2d6; }
.alert-error { background: rgba(239, 83, 80, .1); border-color: rgba(239, 83, 80, .45); color: #ffc9c8; }
.alert-info { background: rgba(212, 175, 55, .08); border-color: var(--line); color: #f3e3b3; }

.badge { display: inline-block; padding: .18rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 600; background: rgba(255, 255, 255, .07); color: var(--muted); }
.badge-ok { background: rgba(62, 207, 142, .14); color: var(--ok); }
.badge-gold { background: rgba(212, 175, 55, .18); color: var(--gold-2); }

/* ---------- tables */
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input[type=search] { flex: 1 1 260px; width: auto; }
.toolbar select { flex: 0 0 auto; width: auto; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); padding: .75rem .9rem; background: #0e0e11; border-bottom: 1px solid var(--line); }
.table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:hover { background: rgba(212, 175, 55, .04); }
.table th.center, .table td.center { text-align: center; }
.table th.right, .table td.right { text-align: right; }
.table-compact td, .table-compact th { padding: .45rem .6rem; }
.actions { white-space: nowrap; }
.actions form { display: inline; margin: 0; }
.row-done td { opacity: .55; }

.danger-zone { border-color: rgba(239, 83, 80, .3); }
.danger-zone > summary { color: #f19999 !important; }
.reset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.reset-form { display: flex; gap: .5rem; }
.reset-form input { flex: 1; }

/* ---------- auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.auth-card { width: 100%; max-width: 400px; text-align: center; padding: 2.2rem 1.8rem; border-radius: 20px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 60px rgba(212, 175, 55, .08); }
.auth-card form { text-align: left; margin-top: 1.2rem; }
.auth-mark { width: 64px; height: 64px; margin: 0 auto .8rem; border-radius: 50%; display: grid; place-items: center; background: var(--gold-grad); color: #111; font-size: 2rem; box-shadow: 0 0 30px rgba(212, 175, 55, .45); }

/* ---------- QR cards */
.qr-box { background: #fff; border-radius: 10px; padding: 6px; width: 180px; max-width: 100%; margin: 0 auto .6rem; }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.qr-card { text-align: center; padding: 1rem .8rem; border-radius: var(--radius); background: linear-gradient(180deg, #1a1710, #0e0d0a); border: 1px solid var(--gold); break-inside: avoid; page-break-inside: avoid; }
.qr-card-event { font: 700 .78rem var(--serif); color: var(--gold-2); letter-spacing: .08em; text-transform: uppercase; margin-bottom: .6rem; }
.qr-card-name { font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.qr-card-meta { color: var(--muted); font-size: .82rem; margin-top: .15rem; }
.qr-card-note { font-size: .66rem; color: var(--muted); margin: .45rem 0 .55rem; }

/* ---------- scanner */
.scan-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.scan-layout > .card { margin: 0; }
.scanner { position: relative; aspect-ratio: 4 / 3; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scan-frame span { width: 58%; aspect-ratio: 1; border: 3px solid var(--gold); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35), 0 0 25px rgba(212, 175, 55, .5); }
.scan-idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .6rem; background: radial-gradient(circle, #1a1710, #000); padding: 1rem; }
.scan-controls { display: flex; gap: .5rem; margin-top: .7rem; }
.scan-result { position: absolute; left: .6rem; right: .6rem; bottom: .6rem; z-index: 3; padding: .9rem; border-radius: 12px; text-align: center; animation: pop .25s ease-out; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); }
.scan-ok { background: rgba(8, 40, 26, .95); border: 2px solid var(--ok); }
.scan-warn { background: rgba(48, 32, 6, .95); border: 2px solid var(--warn); }
.scan-error { background: rgba(50, 10, 10, .95); border: 2px solid var(--err); }
.scan-title { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; }
.scan-ok .scan-title { color: var(--ok); } .scan-warn .scan-title { color: var(--warn); } .scan-error .scan-title { color: var(--err); }
.scan-name { font: 700 1.6rem/1.2 var(--serif); margin: .25rem 0; }
.scan-meta { color: var(--muted); }
.scan-counter { text-align: right; font-family: var(--serif); }
.scan-counter strong { font-size: 2rem; color: var(--ok); }
.scan-counter small { display: block; font-family: var(--sans); color: var(--muted); font-size: .75rem; }
.manual-list, .recent-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.manual-list li, .recent-list li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line-soft); }
.recent-list li { display: block; }

/* ---------- lucky draw stage */
.draw-page { overflow-x: hidden; }
.stage-wrap { max-width: none; padding: 1rem; }
.draw-controls { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; max-width: 1200px; margin: 0 auto 1rem; }
.prize-pick { flex: 1 1 320px; max-width: 560px; }
.prize-pick select { font-size: 1rem; }
.draw-toggles { display: flex; gap: .5rem; }

.stage {
  position: relative; overflow: hidden; max-width: 1200px; margin: 0 auto; min-height: 70vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6rem;
  padding: 2.5rem 1rem; text-align: center; border-radius: 24px;
  background: radial-gradient(ellipse at center, #1c1709 0%, #0a0907 55%, #050505 100%);
  border: 1px solid var(--line); box-shadow: inset 0 0 120px rgba(212, 175, 55, .08), var(--shadow);
}
.stage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(245, 215, 122, .5) 1px, transparent 1.5px);
  background-size: 46px 46px; mask-image: radial-gradient(ellipse at center, transparent 30%, #000 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 30%, #000 85%);
}
.stage-glow { position: absolute; width: 70vmin; height: 70vmin; border-radius: 50%; background: radial-gradient(rgba(212, 175, 55, .22), transparent 65%); pointer-events: none; animation: breathe 5s ease-in-out infinite; }
.stage > :not(.stage-glow) { position: relative; }
.stage-event { font: 700 clamp(.85rem, 1.6vw, 1.1rem) var(--serif); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.stage-prize { display: flex; flex-direction: column; gap: .2rem; }
.stage-prize-cat { font-size: clamp(.8rem, 1.4vw, 1rem); text-transform: uppercase; letter-spacing: .25em; color: var(--muted); }
.stage-prize-name { font: 900 clamp(1.8rem, 5vw, 3.6rem)/1.1 var(--serif); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 10px rgba(212, 175, 55, .25)); }
.stage-prize-left { color: var(--muted); font-size: .95rem; }
.is-grand .stage-prize-name { font-size: clamp(2.2rem, 6.5vw, 4.6rem); }
.is-grand .stage { box-shadow: inset 0 0 160px rgba(212, 175, 55, .2), 0 0 60px rgba(212, 175, 55, .15); }

.reel {
  width: min(900px, 100%); padding: 1.6rem 1rem; border-radius: 20px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .6), rgba(20, 16, 6, .8));
  border: 2px solid var(--gold); box-shadow: 0 0 0 6px rgba(212, 175, 55, .08), 0 0 40px rgba(212, 175, 55, .2);
}
.reel-name { font: 700 clamp(1.8rem, 5.5vw, 4rem)/1.15 var(--serif); color: var(--text); min-height: 1.15em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel-meta { color: var(--muted); font-size: clamp(.9rem, 1.8vw, 1.3rem); min-height: 1.5em; margin-top: .3rem; }
.reel.spinning .reel-name { filter: blur(.6px); color: var(--gold-2); }
.reel.spinning { animation: shake .12s linear infinite; }
.reel.landed { border-color: var(--gold-2); box-shadow: 0 0 0 8px rgba(245, 215, 122, .15), 0 0 80px rgba(245, 215, 122, .45); }

.countdown {
  font: 900 clamp(4.5rem, 11vw, 8rem)/1 var(--serif); color: var(--gold-2); min-width: 1.4em;
  text-shadow: 0 0 40px rgba(212, 175, 55, .8), 0 0 100px rgba(212, 175, 55, .5);
}
.countdown.pop { animation: countPop .9s ease-out; }

.winner { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.winner.reveal { animation: reveal .8s cubic-bezier(.2, 1.4, .4, 1); }
.winner-tag { font: 700 clamp(.9rem, 2vw, 1.3rem) var(--serif); letter-spacing: .15em; color: var(--gold-2); text-transform: uppercase; }
.winner-name { font: 900 clamp(2.4rem, 7vw, 5.4rem)/1.05 var(--serif); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 20px rgba(212, 175, 55, .45)); }
.winner-meta { font-size: clamp(1rem, 2.4vw, 1.6rem); color: var(--text); display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.winner-meta .dot { color: var(--gold); }
.winner-prize { font-size: clamp(1rem, 2.2vw, 1.5rem); color: var(--muted); }
.winner-prize b { color: var(--gold-2); }
.winner:not([hidden]) ~ .stage-actions { margin-top: .4rem; }
.stage:has(.winner:not([hidden])) .reel { display: none; }

.stage-actions { display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.btn-start {
  font: 900 clamp(1.4rem, 3.5vw, 2.4rem) var(--serif); letter-spacing: .12em; color: #1a1405; cursor: pointer;
  padding: clamp(1rem, 2.2vw, 1.5rem) clamp(2.5rem, 7vw, 5rem); border-radius: 999px; border: 0;
  background: var(--gold-grad); background-size: 200% 200%;
  box-shadow: 0 0 0 6px rgba(212, 175, 55, .15), 0 10px 40px rgba(212, 175, 55, .45), inset 0 2px 0 rgba(255, 255, 255, .4);
  animation: pulse 2.2s ease-in-out infinite, shimmer 4s linear infinite; transition: transform .15s;
}
.btn-start:hover { transform: scale(1.04); }
.btn-start:active { transform: scale(.98); }
.btn-start:disabled { animation: none; filter: grayscale(.8) brightness(.6); cursor: not-allowed; transform: none; }
.stage-foot { color: var(--muted); font-size: .85rem; }
.stage-error { background: rgba(239, 83, 80, .15); border: 1px solid var(--err); color: #ffd1d0; padding: .7rem 1rem; border-radius: 10px; max-width: 600px; }

.recent-winners { max-width: 1200px; margin: 1.2rem auto 0; }
.recent-winners h2 { display: flex; align-items: baseline; gap: .4rem; }
.recent-winners h2 a { margin-left: auto; font-family: var(--sans); }
.recent-winners ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .6rem; }
.recent-winners li { padding: .7rem .9rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-soft); display: flex; flex-direction: column; }
.recent-winners li span { color: var(--muted); font-size: .8rem; }
.recent-winners li em { color: var(--gold-2); font-style: normal; font-size: .88rem; margin-top: .2rem; }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }

/* projector / fullscreen mode */
body.is-fs .topbar, body.is-fs .draw-controls .prize-pick span, body.is-fs .recent-winners { display: none; }
body.is-fs .stage-wrap { padding: 0; }
body.is-fs .draw-controls { position: fixed; top: .6rem; left: .8rem; right: .8rem; z-index: 20; max-width: none; opacity: .15; transition: opacity .2s; }
body.is-fs .draw-controls:hover { opacity: 1; }
body.is-fs .stage { max-width: none; min-height: 100vh; border-radius: 0; border: 0; }
body.is-drawing .draw-controls { pointer-events: none; opacity: .3; }

/* ---------- summary */
.summary-sheet { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 1.5rem; }
.summary-head { text-align: center; margin-bottom: 1.5rem; }
.summary-head h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); margin: .3rem 0; }
.summary-head p { margin: .2rem 0; }
.summary-star { font-size: 2rem; color: var(--gold); }
.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.8rem; }
.summary-stats div { text-align: center; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
.summary-stats strong { display: block; font: 700 2.2rem var(--serif); color: var(--gold-2); }
.summary-stats span { color: var(--muted); font-size: .9rem; }
.summary-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }

/* ---------- animations */
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 6px rgba(212, 175, 55, .15), 0 10px 40px rgba(212, 175, 55, .4), inset 0 2px 0 rgba(255, 255, 255, .4); } 50% { box-shadow: 0 0 0 14px rgba(212, 175, 55, .06), 0 10px 60px rgba(212, 175, 55, .65), inset 0 2px 0 rgba(255, 255, 255, .4); } }
@keyframes shimmer { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes shake { 0% { transform: translateY(0); } 50% { transform: translateY(-2px); } 100% { transform: translateY(0); } }
@keyframes countPop { 0% { transform: scale(2.2); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(.7); opacity: 0; } }
@keyframes reveal { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .btn-start, .stage-glow, .reel.spinning { animation: none; } }

/* ---------- mobile */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .mainnav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: #0b0b0d; border-bottom: 1px solid var(--line); padding: .5rem; }
  .nav-open .mainnav { display: flex; }
  .mainnav a { flex-direction: row; justify-content: space-between; padding: .8rem 1rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .scan-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .container { padding: 1rem .8rem 2.5rem; }
  .stat { padding: .9rem 1rem; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right !important; }
  .table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .78rem; text-align: left; }
  .table td.actions { justify-content: flex-end; flex-wrap: wrap; gap: .35rem; padding-top: .5rem; }
  .summary-stats { gap: .5rem; }
  .summary-stats strong { font-size: 1.6rem; }
  .stage { min-height: 60vh; gap: 1.1rem; padding: 1.8rem .8rem; }
  .reel-name { white-space: normal; }
  .page-head .btn-lg { width: 100%; }
}

/* ---------- print (QR cards & summary) */
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff !important; color: #000; font-size: 11pt; }
  .topbar, .no-print, .tabs, .alert, .page-head { display: none !important; }
  .container { max-width: none; padding: 0; }
  .qr-grid { grid-template-columns: repeat(3, 1fr); gap: 5mm; }
  .qr-card { background: #fff !important; color: #000; border: 1.5px solid #b8860b; border-radius: 4mm; padding: 3mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .qr-card-event { color: #8a6a12; font-size: 7.5pt; margin-bottom: 2mm; }
  .qr-card-name { font-size: 11pt; }
  .qr-card-meta { color: #333; font-size: 9pt; }
  .qr-card-note { color: #333; font-size: 6.5pt; margin: 1.5mm 0 0; }
  .qr-box { width: 36mm; border-radius: 0; padding: 0; margin-bottom: 2mm; }
  .summary-sheet { background: #fff; border: 0; padding: 0; color: #000; }
  .summary-head h2 { color: #000; background: none; }
  .summary-stats div { border-color: #999; }
  .summary-stats strong { color: #000; }
  .summary-stats span, .muted { color: #444 !important; }
  .summary-table { font-size: 10pt; }
  .summary-table th { background: #eee !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .summary-table td { border-bottom: 1px solid #ccc; color: #000; }
  .summary-table thead { display: table-header-group; }
  .summary-table tr { page-break-inside: avoid; }
}
