:root {
  --bg: #0b0612;
  --bg-2: #170a26;
  --bg-3: #24113a;
  --purple: #6d34b0;
  --purple-soft: rgba(141, 82, 214, .22);
  --orange: #ff7a1a;
  --orange-2: #ffa149;
  --orange-glow: rgba(255, 122, 26, .45);
  --gold: #ffd25e;
  --text: #f4ecff;
  --muted: #b8a6cf;
  --line: rgba(255, 170, 90, .16);
  --card: linear-gradient(165deg, rgba(52, 24, 82, .82), rgba(20, 9, 34, .9));
  --radius: 18px;
  --font-display: "Creepster", "Chiller", fantasy;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { overflow-x: clip; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(109, 52, 176, .45), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(255, 122, 26, .10), transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 55%, #050208 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

a { color: var(--orange-2); }
a:hover { color: var(--gold); }

/* Decorative sky */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 8%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 22%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 12%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 71% 30%, #fff7 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 6%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 34%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 40%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 38%, #fff4 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 4%, #fff7 50%, transparent 51%);
  animation: twinkle 6s ease-in-out infinite alternate;
}

.moon {
  position: absolute;
  top: 56px; right: 6%;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #fffaf0 0%, #ffe6b3 45%, #f2b660 100%);
  box-shadow: 0 0 40px 10px rgba(255, 214, 140, .28), 0 0 140px 50px rgba(255, 122, 26, .12);
  opacity: .9;
}
.moon::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 62% 30%, rgba(190, 130, 60, .35) 0 8%, transparent 9%),
    radial-gradient(circle at 40% 64%, rgba(190, 130, 60, .28) 0 11%, transparent 12%),
    radial-gradient(circle at 70% 70%, rgba(190, 130, 60, .22) 0 6%, transparent 7%);
}

.bat {
  position: absolute;
  font-size: 22px;
  filter: brightness(.25) drop-shadow(0 0 6px rgba(255, 122, 26, .35));
  opacity: .85;
  animation: fly 18s linear infinite;
}
.bat-1 { top: 14%; left: -40px; animation-duration: 22s; }
.bat-2 { top: 26%; left: -40px; font-size: 16px; animation-duration: 28s; animation-delay: -9s; }
.bat-3 { top: 8%; left: -40px; font-size: 18px; animation-duration: 34s; animation-delay: -20s; }

.fog {
  position: absolute;
  left: -50%; width: 200%;
  height: 50vh;
  bottom: -8vh;
  filter: blur(18px);
  opacity: .55;
}
.fog-1 {
  background:
    radial-gradient(ellipse 30% 45% at 20% 70%, rgba(190, 160, 235, .20), transparent 70%),
    radial-gradient(ellipse 25% 40% at 55% 80%, rgba(170, 140, 220, .18), transparent 70%),
    radial-gradient(ellipse 30% 45% at 85% 75%, rgba(200, 170, 240, .16), transparent 70%);
  animation: drift 48s ease-in-out infinite alternate;
}
.fog-2 {
  bottom: -14vh;
  background:
    radial-gradient(ellipse 28% 40% at 35% 75%, rgba(255, 160, 90, .08), transparent 70%),
    radial-gradient(ellipse 35% 45% at 70% 70%, rgba(180, 150, 230, .16), transparent 70%);
  animation: drift 64s ease-in-out infinite alternate-reverse;
}

.hills {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 16vh;
  background:
    radial-gradient(ellipse 60% 100% at 15% 100%, #07030c 60%, transparent 61%),
    radial-gradient(ellipse 50% 85% at 70% 100%, #09040f 60%, transparent 61%),
    radial-gradient(ellipse 40% 70% at 100% 100%, #07030c 60%, transparent 61%);
}

/* Layout */
.topbar, .wrap, .footer { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 16px;
}

.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 1px;
  color: var(--orange);
  text-decoration: none;
  text-shadow: 0 0 12px var(--orange-glow);
}
.brand:hover { color: var(--orange-2); }
.brand-icon { font-size: 22px; }

.userbox {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  color: var(--muted);
  min-width: 0;
}
.userbox strong { color: var(--text); }
.userbox form { margin: 0; }
.hello { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55vw; }

.wrap {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 20px 16px 28px;
  opacity: .85;
}

/* Hero */
.hero { text-align: center; padding: 40px 0 28px; }
.hero-compact { padding: 12px 0 18px; }

.pumpkin {
  font-size: 88px;
  line-height: 1;
  display: inline-block;
  animation: flicker 3.2s ease-in-out infinite, bob 6s ease-in-out infinite;
}
.hero-compact .pumpkin { font-size: 52px; }

.title {
  margin: 12px 0 4px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 9vw, 84px);
  line-height: 1.05;
  letter-spacing: 2px;
  color: var(--orange);
  text-shadow:
    0 2px 0 #7a2f00,
    0 0 18px rgba(255, 122, 26, .55),
    0 0 48px rgba(255, 122, 26, .25);
}
.hero-compact .title { font-size: clamp(30px, 6.5vw, 56px); }

.tagline {
  margin: 0;
  font-size: clamp(17px, 3.6vw, 22px);
  font-weight: 800;
  color: var(--text);
  opacity: .9;
}

/* Panels */
.panel {
  background: rgba(23, 10, 38, .72);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px 18px;
  margin: 0 auto 20px;
  max-width: 900px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(6px);
}
.panel-center { text-align: center; max-width: 560px; }
.panel-icon { font-size: 56px; line-height: 1; margin-bottom: 8px; }
.panel-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  letter-spacing: 1px;
  color: var(--orange);
}

.section-title {
  margin: 4px 0 6px;
  text-align: center;
  font-size: clamp(20px, 4.4vw, 28px);
  font-weight: 900;
}
.accent { color: var(--orange); }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 14px; }
.lead { font-size: 18px; font-weight: 600; margin: 0 0 22px; }
.nowrap { white-space: nowrap; }

.landing .small { margin: 20px 0 0; }

/* Flash */
.flash {
  max-width: 720px;
  margin: 4px auto 16px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  text-align: center;
  border: 1px solid;
}
.flash-error { background: rgba(170, 30, 50, .25); border-color: rgba(255, 90, 110, .45); color: #ffd5db; }
.flash-info { background: rgba(255, 122, 26, .12); border-color: rgba(255, 122, 26, .4); color: #ffe2c9; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease, background .2s ease;
}
.btn:focus-visible, .link-btn:focus-visible, .field input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.btn-block { width: 100%; }

.btn-orange {
  color: #1d0a00;
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
  box-shadow: 0 6px 18px rgba(255, 122, 26, .35), inset 0 -2px 0 rgba(0, 0, 0, .18);
}
.btn-orange:hover:not(:disabled) { color: #1d0a00; transform: translateY(-1px); box-shadow: 0 10px 26px rgba(255, 122, 26, .55); }

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--text); background: rgba(255, 122, 26, .14); }


.link-btn {
  background: none; border: 0; padding: 4px 2px;
  font: inherit; font-weight: 700;
  color: var(--orange-2);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--gold); }

/* Vote grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  margin: 0;
  padding: 18px 12px 14px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: -40% -40% auto;
  height: 80%;
  background: radial-gradient(circle at 50% 100%, rgba(255, 122, 26, .22), transparent 60%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.card:hover, .card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(255, 122, 26, .65);
  box-shadow: 0 0 0 1px rgba(255, 122, 26, .35), 0 14px 40px rgba(255, 122, 26, .28), 0 0 60px rgba(141, 82, 214, .25);
}
.card:hover::before, .card:focus-within::before { opacity: 1; }
.card.is-sending { border-color: var(--gold); }

.card-emoji {
  display: grid; place-items: center;
  width: 76px; height: 76px;
  margin-bottom: 10px;
  font-size: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(255, 140, 50, .28), rgba(109, 52, 176, .22) 60%, transparent 72%);
  box-shadow: inset 0 0 0 1px rgba(255, 170, 90, .18);
  transition: transform .25s ease;
}
.card:hover .card-emoji { transform: scale(1.08) rotate(-4deg); }

.card-name {
  font-weight: 900;
  font-size: 19px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.card-costume {
  flex: 1;
  margin: 4px 0 14px;
  font-size: 14px;
  color: var(--orange-2);
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (min-width: 640px) {
  .card { padding: 22px 14px 16px; }
  .card-emoji { width: 88px; height: 88px; font-size: 50px; }
  .card-name { font-size: 21px; }
}

/* Voted */
.voted-emoji {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 10px;
  animation: bob 5s ease-in-out infinite;
}
.voted .section-title { line-height: 1.35; }
.cauldron { font-size: 26px; letter-spacing: 8px; margin-top: 14px; opacity: .85; }

/* Results */
.results { list-style: none; margin: 18px 0 10px; padding: 0; display: grid; gap: 10px; }

.result {
  display: grid;
  grid-template-columns: 26px 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .06);
  opacity: 0;
  animation: rise .5s ease-out forwards;
  animation-delay: var(--delay, 0ms);
}
.result.is-mine { border-color: rgba(255, 122, 26, .55); background: rgba(255, 122, 26, .07); }
.result.is-winner {
  background: linear-gradient(100deg, rgba(255, 210, 94, .14), rgba(255, 122, 26, .10) 60%, rgba(109, 52, 176, .12));
  border-color: rgba(255, 210, 94, .7);
  animation: rise .5s ease-out forwards, winner-pulse 2.4s ease-in-out infinite;
  animation-delay: var(--delay, 0ms), .8s;
}

.result-rank { font-weight: 900; color: var(--muted); text-align: right; }
.is-winner .result-rank { color: var(--gold); }

.result-emoji {
  position: relative;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  font-size: 28px;
  border-radius: 50%;
  background: rgba(109, 52, 176, .25);
}
.crown {
  position: absolute;
  top: -16px; left: 50%;
  font-size: 22px;
  transform: translateX(-50%) rotate(-12deg);
  filter: drop-shadow(0 0 8px rgba(255, 210, 94, .8));
  animation: crown 2.4s ease-in-out infinite;
}

.result-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; margin-bottom: 6px; }
.result-name { font-weight: 900; font-size: 17px; }
.result-costume { font-size: 13px; color: var(--orange-2); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-radius: 999px;
  color: #1d0a00;
  background: var(--orange);
}
.badge-gold { background: var(--gold); }

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: var(--pct, 0%);
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--orange));
  box-shadow: 0 0 12px rgba(255, 122, 26, .45);
  animation: grow 1.3s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--delay, 0ms) + 200ms);
}
.is-winner .bar-fill { background: linear-gradient(90deg, var(--orange), var(--gold)); }

.result-stats { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.result-count { font-size: 22px; font-weight: 900; }
.is-winner .result-count { color: var(--gold); }
.result-pct { font-size: 12px; color: var(--muted); }

@media (min-width: 640px) {
  .panel { padding: 30px 28px; }
  .result { grid-template-columns: 34px 56px minmax(0, 1fr) 70px; gap: 14px; padding: 14px 16px; }
  .result-emoji { width: 56px; height: 56px; font-size: 34px; }
  .result-name { font-size: 19px; }
  .result-costume { font-size: 14px; }
  .moon { width: 120px; height: 120px; top: 70px; }
}

/* Admin */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-head .panel-title { margin: 0; }
.admin-head form { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.stat {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
}
.stat-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.stat-value { font-size: 28px; font-weight: 900; }

.status { align-self: flex-start; padding: 4px 12px; border-radius: 999px; font-weight: 900; }
.status-open { background: rgba(80, 200, 120, .18); color: #9ff0b8; border: 1px solid rgba(80, 200, 120, .45); }
.status-closed { background: rgba(255, 90, 110, .16); color: #ffc2cb; border: 1px solid rgba(255, 90, 110, .45); }

.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-actions form { margin: 0; }

.stack { display: grid; gap: 14px; text-align: left; }
.field { display: grid; gap: 6px; font-weight: 700; }
.field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.table-wrap { overflow-x: auto; margin-top: 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .06); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; background: rgba(255, 255, 255, .03); }
.table tr:last-child td { border-bottom: 0; }

/* Animations */
@keyframes grow { from { width: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes flicker {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(255, 122, 26, .7)); }
  45% { filter: drop-shadow(0 0 30px rgba(255, 150, 40, .95)); }
  50% { filter: drop-shadow(0 0 12px rgba(255, 110, 20, .5)); }
  55% { filter: drop-shadow(0 0 26px rgba(255, 140, 40, .85)); }
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes winner-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 94, .0), 0 0 18px rgba(255, 210, 94, .18); }
  50% { box-shadow: 0 0 0 4px rgba(255, 210, 94, .12), 0 0 38px rgba(255, 170, 60, .45); }
}
@keyframes crown { 0%, 100% { transform: translateX(-50%) rotate(-12deg); } 50% { transform: translateX(-50%) translateY(-3px) rotate(-6deg); } }
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }
@keyframes drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes fly {
  0% { transform: translate(0, 0) scaleX(-1); }
  25% { transform: translate(30vw, -20px) scaleX(-1); }
  50% { transform: translate(60vw, 18px) scaleX(-1); }
  75% { transform: translate(90vw, -12px) scaleX(-1); }
  100% { transform: translate(calc(100vw + 80px), 0) scaleX(-1); }
}

/* Admin extras */
.admin-link {
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
  text-decoration: none;
  color: #1d0a00;
  background: var(--orange);
}
.admin-link:hover { color: #1d0a00; background: var(--orange-2); }
.pill-toggle { border: 1px solid rgba(255, 255, 255, .12); cursor: pointer; font-family: inherit; }
.pill-toggle:hover { border-color: var(--orange); }
.pill-admin { color: #1d0a00; background: var(--gold); border-color: var(--gold); }
.tv-mode-form { margin: 16px 0 6px; }
.tv-mode-form fieldset { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.tv-mode-form legend { padding: 0 6px; font-weight: 800; color: var(--muted); }
.radio { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; cursor: pointer; }
.radio input { accent-color: var(--orange); width: 18px; height: 18px; }

/* TV screen */
body.tv { min-height: 100vh; overflow: hidden; cursor: default; }
.tv-stage {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 2.5vh 4vw 0;
}
.tv-header { text-align: center; }
.tv-title { margin: 0; font-size: clamp(36px, 5.5vw, 120px); }
.tv-screen { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 0; }
body[data-mode="ures"] .tv-ures,
body[data-mode="tombola"] .tv-tombola,
body[data-mode="eredmeny"] .tv-eredmeny { display: flex; }
.tv-pumpkin { font-size: clamp(120px, 18vw, 360px); }
.tv-sub { margin: 2vh 0 0; font-size: clamp(24px, 3vw, 64px); font-weight: 800; opacity: .9; }
.tv-big-text { margin: 2vh 0 0; font-size: clamp(32px, 4.5vw, 96px); font-weight: 900; }
.tv-huge {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(56px, 10vw, 240px);
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255, 210, 94, .6), 0 0 90px rgba(255, 122, 26, .45);
  animation: tv-pulse 2.2s ease-in-out infinite;
}
.tv-label { margin: 0 0 1vh; font-size: clamp(28px, 3.6vw, 80px); font-weight: 900; color: var(--orange-2); }

.tv-waiting, .tv-done, .tv-draw { display: none; flex-direction: column; align-items: center; }
body[data-tombola="waiting"] .tv-waiting,
body[data-tombola="done"] .tv-done,
body[data-tombola="draw"] .tv-draw { display: flex; }

.tv-slot {
  display: flex; align-items: center; justify-content: center;
  min-height: 1.3em;
  max-width: 92vw;
  padding: 0 .3em;
  font-size: clamp(64px, 11vw, 260px);
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
  border-radius: .25em;
}
.tv-slot.is-spinning {
  color: var(--muted);
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(60, 25, 95, .5), rgba(0, 0, 0, .55));
  box-shadow: inset 0 0 0 3px rgba(255, 122, 26, .35), inset 0 18px 30px rgba(0, 0, 0, .6), inset 0 -18px 30px rgba(0, 0, 0, .6);
}
.tv-slot.is-spinning span { filter: blur(1.5px); animation: slot-jitter .1s linear infinite; }
.tv-slot.is-revealed span {
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255, 210, 94, .75), 0 0 80px rgba(255, 122, 26, .55);
  animation: tv-reveal .9s cubic-bezier(.2, 1.4, .3, 1) both, tv-pulse 2.2s ease-in-out .9s infinite;
  display: inline-block;
}
.tv-pool { margin: 2vh 0 0; min-height: 1.4em; font-size: clamp(20px, 2.2vw, 48px); color: var(--muted); font-weight: 700; }

.tv-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.confetti {
  position: absolute;
  top: -5vh; left: var(--x);
  width: var(--w); height: calc(var(--w) * .45);
  background: var(--c);
  border-radius: 2px;
  opacity: 0;
  animation: confetti-fall var(--dur) cubic-bezier(.25, .6, .4, 1) var(--delay) forwards;
}

.tv-strip {
  display: none;
  align-items: center;
  gap: 1.2vw;
  margin: 0 -4vw;
  padding: 1.6vh 4vw;
  background: linear-gradient(180deg, rgba(10, 4, 18, .2), rgba(10, 4, 18, .85));
  border-top: 1px solid var(--line);
  font-size: clamp(16px, 1.7vw, 40px);
  overflow: hidden;
}
body.has-winners .tv-strip { display: flex; }
.tv-strip-title { flex: none; font-weight: 900; color: var(--orange-2); }
.tv-strip ol { display: flex; gap: .4em 1.4em; margin: 0; padding: 0; list-style: none; counter-reset: win; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.tv-strip li { counter-increment: win; font-weight: 800; }
.tv-strip li::before { content: counter(win) ". "; color: var(--muted); font-weight: 700; }

.tv-eredmeny { justify-content: flex-start; padding-top: 1vh; }
body[data-mode="eredmeny"] .tv-title { font-size: min(4.2vw, 7vh); }
.tv-eredmeny .tv-label { font-size: min(3vw, 4.6vh); margin: 0; }
.tv-results { width: min(1500px, 92vw); font-size: min(1.5vw, 1.7vh); }
body[data-mode="eredmeny"] .moon { display: none; }
.tv-results .results { gap: .55em; margin: .8em 0 0; }
.tv-results .result { grid-template-columns: 2.2em 2.6em minmax(0, 1fr) 6em; padding: .35em .9em; gap: .8em; }
.tv-results .result-emoji { width: 2.4em; height: 2.4em; font-size: 1.1em; }
.tv-results .result-head { margin-bottom: .25em; }
.tv-results .result-name { font-size: 1.35em; }
.tv-results .result-costume { font-size: 1em; }
.tv-results .result-stats { flex-direction: row; align-items: baseline; gap: .4em; }
.tv-results .result-count { font-size: 1.6em; }
.tv-results .result-pct { font-size: .85em; }
.tv-results .bar { height: .45em; }
.tv-results .crown { font-size: 1.1em; top: -.8em; }
.tv-results .muted { display: none; }
.tv-pending { display: none; }
body.tv:not(.tv-closed) .tv-pending { display: block; }
body.tv:not(.tv-closed) .tv-results { display: none; }

.tv-hint {
  position: fixed; right: 14px; bottom: 12px; z-index: 3;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  opacity: .45;
}
:fullscreen .tv-hint { display: none; }

@keyframes tv-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes tv-reveal { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes slot-jitter { 0% { transform: translateY(-6%); } 50% { transform: translateY(6%); } 100% { transform: translateY(-6%); } }
@keyframes confetti-fall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), 112vh) rotate(var(--rot)); }
}

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

/* Guest login */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.login-form { display: grid; gap: 12px; margin: 0 auto; max-width: 420px; }
.name-label {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1.5px;
  color: var(--orange);
  text-shadow: 0 0 14px rgba(255, 122, 26, .45);
  text-align: left;
  margin: 0 0 -4px 6px;
}
.name-field {
  position: relative;
  border-radius: 999px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(255, 122, 26, .9), rgba(255, 210, 94, .7) 50%, rgba(109, 52, 176, .9));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 24px rgba(255, 122, 26, .18);
  transition: box-shadow .25s ease, transform .25s ease;
}
.name-field:focus-within {
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 5px rgba(255, 122, 26, .18), 0 0 44px rgba(255, 122, 26, .45);
  transform: translateY(-1px);
}
.name-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, .35));
  pointer-events: none;
  transition: transform .3s ease;
}
.name-field:focus-within .name-icon { transform: translateY(-50%) rotate(-12deg) scale(1.12); }
.name-input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 60px;
  min-height: 60px;
  margin: 0;
  padding: 0 24px 0 62px;
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #fff;
  background: linear-gradient(180deg, #1a0b2a, #120720);
  border: 0;
  border-radius: 999px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .55);
  caret-color: var(--orange);
}
.name-input::placeholder { color: rgba(184, 166, 207, .5); font-weight: 600; font-style: italic; }
.name-input:focus { outline: none; }
.login-inline .name-input { padding-left: 18px; }
.btn-big { height: 60px; min-height: 60px; font-size: 19px; }
.landing .small { margin: 14px 0 0; }

/* Admin guest list */
.guest-add { margin: 14px 0 6px; }
.guest-add .btn { justify-self: start; }
.field textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px 14px;
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line);
  border-radius: 12px;
  resize: vertical;
}
.field textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.table form { margin: 0; }
.right { text-align: right; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--muted); background: rgba(255, 255, 255, .06); }
.pill-done { color: #9ff0b8; background: rgba(80, 200, 120, .16); }
.link-danger { color: #ff9aa8; }
.link-danger:hover { color: #ffc2cb; }

.login-inline { margin-top: 22px; text-align: center; }
.login-inline .name-input { min-height: 48px; font-size: 18px; }

/* TV centering polish */
body.tv .moon { top: 3vh; right: 3vw; width: min(9vw, 14vh); height: min(9vw, 14vh); opacity: .85; }
.tv-stage { padding: 3vh 5vw 2vh; align-items: center; }
.tv-header { width: 100%; display: flex; flex-direction: column; align-items: center; gap: .6vh; }
.tv-title { text-align: center; line-height: 1; }
.tv-header::after { content: ""; width: min(32vw, 420px); height: 3px; margin-top: 1.4vh; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--orange), var(--gold), var(--orange), transparent); opacity: .8; }
.tv-screen { width: 100%; max-width: 1600px; margin: 0 auto; gap: 1vh; }
.tv-waiting, .tv-done, .tv-draw { width: 100%; text-align: center; justify-content: center; }
.tv-eredmeny { justify-content: center; padding-top: 0; gap: 1.5vh; }
.tv-eredmeny .tv-pending { margin: 0; }
.tv-results .results { width: 100%; }
.tv-slot { width: 100%; display: flex; justify-content: center; }
.tv-strip {
  flex-direction: column; align-items: center; justify-content: center; gap: 1vh;
  margin: 0; padding: 1.4vh 2vw 0; width: 100%; max-width: 1600px;
  background: none; border-top: 0;
}
.tv-strip-title { font-size: .95em; letter-spacing: .5px; text-transform: uppercase; opacity: .9; }
.tv-strip ol { flex-wrap: wrap; justify-content: center; gap: .6em .7em; overflow: visible; white-space: normal; max-height: 14vh; }
.tv-strip li { padding: .25em .9em; border-radius: 999px; background: rgba(23, 10, 38, .75); border: 1px solid rgba(255, 122, 26, .35); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.tv-strip li:last-child { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 18px rgba(255, 210, 94, .35); }
.tv-hint { opacity: .25; }
.tv-keepalive { position: fixed; inset: 0; width: 100vw; height: 100vh; object-fit: cover; z-index: 0; opacity: .08; pointer-events: none; }

/* Tie-break rounds */
.tie-note {
  margin: 0 auto 6px;
  width: fit-content;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 900;
  text-align: center;
  color: #1d0a00;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  box-shadow: 0 0 24px rgba(255, 122, 26, .45);
  animation: tv-pulse 2.2s ease-in-out infinite;
}
.past-round { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; }
.past-round summary { cursor: pointer; font-weight: 800; color: var(--muted); }
.past-round summary:hover { color: var(--orange-2); }
.past-round .result { padding: 8px 10px; }
.past-round .result-count { font-size: 18px; }
.past-compact { margin: .8em 0 0; text-align: center; color: var(--muted); font-size: 1.05em; }
.past-compact strong { color: var(--orange-2); }
.tv-results .results-title { font-size: 1.8em; margin: 0; }
.tv-results .tie-note { font-size: 1.4em; margin-top: .4em; }
.final-title { color: var(--gold); text-shadow: 0 0 18px rgba(255, 210, 94, .45); }
.grid-final { max-width: 760px; margin-left: auto; margin-right: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tie-panel { border-color: rgba(255, 210, 94, .7); box-shadow: 0 0 0 1px rgba(255, 210, 94, .35), 0 0 40px rgba(255, 170, 60, .25); }
.tiebreak-details summary { cursor: pointer; font-weight: 800; margin-bottom: 10px; }
.finalist-picks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
