@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #060814;
  --glass: rgba(18, 22, 40, 0.68);
  --glass-2: rgba(30, 37, 64, 0.72);
  --border: rgba(255, 255, 255, 0.1);
  --border-gold: rgba(251, 191, 36, 0.5);
  --gold-grad: linear-gradient(135deg, #fef08a 0%, #fbbf24 40%, #f59e0b 70%, #ea580c 100%);
  --rainbow: linear-gradient(90deg, #f43f5e, #f59e0b, #10b981, #3b82f6, #a855f7, #f43f5e);
  --gold: #fbbf24;
  --text: #f8fafc;
  --muted: #9aa8c2;
  --alpha: #f43f5e;
  --beta: #3b82f6;
  --gamma: #f59e0b;
  --green: #10b981;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Animated gradient backdrop */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -3;
  background:
    radial-gradient(40% 40% at 15% 15%, rgba(245, 158, 11, 0.28), transparent 70%),
    radial-gradient(45% 45% at 85% 20%, rgba(168, 85, 247, 0.24), transparent 70%),
    radial-gradient(45% 45% at 75% 85%, rgba(59, 130, 246, 0.28), transparent 70%),
    radial-gradient(40% 40% at 15% 85%, rgba(244, 63, 94, 0.22), transparent 70%);
  animation: meshMove 18s ease-in-out infinite alternate;
}

/* Subtle grid overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 20%, transparent 75%);
  pointer-events: none;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #060814; }
::-webkit-scrollbar-thumb { background: #2a3556; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

.ambient-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.3; animation: floatOrb 11s ease-in-out infinite alternate; }
.orb-1 { width: 340px; height: 340px; background: radial-gradient(circle, #f59e0b, transparent 70%); top: -90px; left: -80px; }
.orb-2 { width: 380px; height: 380px; background: radial-gradient(circle, #3b82f6, transparent 70%); bottom: -100px; right: -100px; animation-delay: -5s; }
.orb-3 { width: 280px; height: 280px; background: radial-gradient(circle, #a855f7, transparent 70%); top: 42%; left: 58%; opacity: 0.18; animation-delay: -8s; }

/* Floating particles */
.particles span {
  position: absolute;
  bottom: -20px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  box-shadow: 0 0 12px var(--gold);
  animation: rise 12s linear infinite;
}
.particles span:nth-child(1) { left: 8%;  animation-delay: 0s;  }
.particles span:nth-child(2) { left: 22%; animation-delay: 3s;  background: #60a5fa; box-shadow: 0 0 12px #60a5fa; }
.particles span:nth-child(3) { left: 41%; animation-delay: 6s;  background: #fb7185; box-shadow: 0 0 12px #fb7185; }
.particles span:nth-child(4) { left: 63%; animation-delay: 2s;  }
.particles span:nth-child(5) { left: 79%; animation-delay: 8s;  background: #c084fc; box-shadow: 0 0 12px #c084fc; }
.particles span:nth-child(6) { left: 92%; animation-delay: 5s;  background: #60a5fa; box-shadow: 0 0 12px #60a5fa; }

@keyframes meshMove { 0% { transform: translate(0,0) rotate(0deg) scale(1); } 100% { transform: translate(3%, -3%) rotate(6deg) scale(1.1); } }
@keyframes floatOrb { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(30px, 24px) scale(1.1); } }
@keyframes rise { 0% { transform: translateY(0) scale(0.6); opacity: 0; } 15% { opacity: 0.8; } 100% { transform: translateY(-105vh) scale(1.2); opacity: 0; } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scorePop { 0% { transform: scale(0.8); opacity: 0.4; } 55% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes ripple { 0% { transform: scale(0.75); opacity: 0.9; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes glowPulse { 0%,100% { box-shadow: 0 0 0 1px rgba(251,191,36,.5), 0 10px 30px rgba(251,191,36,.2); } 50% { box-shadow: 0 0 0 1px rgba(251,191,36,.9), 0 14px 44px rgba(251,191,36,.45); } }
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -3px); } }
@keyframes flash { 0% { background-color: rgba(251,191,36,.35); } 100% { background-color: transparent; } }

.container { max-width: 820px; margin: 0 auto; padding: 16px; position: relative; }

/* Header */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  animation: fadeSlideUp 0.45s ease-out both;
  position: relative;
  overflow: hidden;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--rainbow); background-size: 200% 100%; animation: gradientShift 6s linear infinite;
  opacity: 0.85;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-badge {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--gold-grad); background-size: 220% 220%; animation: gradientShift 5s ease infinite;
  color: #090d16; font-weight: 800; display: grid; place-items: center; font-size: 1.15rem;
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.45);
}
.brand h1 {
  font-size: 1.25rem; font-weight: 800; letter-spacing: -0.2px;
  background: linear-gradient(90deg, #fef08a, #f59e0b, #fb7185, #fef08a);
  background-size: 200% auto; animation: shimmer 5s linear infinite;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand p { font-size: 0.78rem; color: var(--muted); }

.header-actions, .nav-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.clock-pill {
  font-family: "JetBrains Mono", monospace; font-size: 0.78rem; color: #e2e8f0;
  background: rgba(10, 14, 28, 0.8); border: 1px solid var(--border);
  padding: 7px 12px; border-radius: 10px;
}

/* Buttons */
.btn {
  position: relative; overflow: hidden;
  background: var(--glass-2); color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 15px; border-radius: 12px;
  font-size: 0.85rem; font-weight: 700; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--border-gold); box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-gold {
  background: var(--gold-grad); background-size: 220% 220%; animation: gradientShift 6s ease infinite;
  color: #090d16; border: none; box-shadow: 0 6px 24px rgba(245, 158, 11, 0.35);
}
.btn-gold::after {
  content: ""; position: absolute; top: 0; left: -130%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg); transition: left 0.55s ease;
}
.btn-gold:hover::after { left: 150%; }

/* Panels */
.panel {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 22px; padding: 18px; margin-bottom: 18px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
  animation: fadeSlideUp 0.55s ease-out both;
}
.hero-panel {
  border-color: rgba(251, 191, 36, 0.28);
  background: linear-gradient(180deg, rgba(28, 34, 58, 0.9) 0%, rgba(14, 18, 32, 0.92) 100%);
}
.hero-panel::before {
  content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 2px; border-radius: 999px;
  background: var(--rainbow); background-size: 200% 100%; animation: gradientShift 5s linear infinite;
}

.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-title { font-size: 1.08rem; font-weight: 800; letter-spacing: -0.2px; }
.sub-note { color: var(--muted); font-size: 0.8rem; display: block; margin-top: 2px; }

/* Live badge */
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.8px; color: #34d399;
  background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 5px 12px; border-radius: 999px;
}
.live-dot { position: relative; width: 8px; height: 8px; background: var(--green); border-radius: 50%; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--green); animation: ripple 1.8s infinite; }

/* Scoreboard */
.board-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.score-box {
  position: relative; background: rgba(8, 11, 22, 0.92);
  border: 1px solid var(--border); border-radius: 18px; padding: 16px 10px 14px; text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}
.score-box::before {
  content: ""; position: absolute; inset: 0; opacity: 0.16; pointer-events: none;
  background: radial-gradient(circle at 50% 0%, var(--c, #fff), transparent 70%);
}
.score-box:hover { transform: translateY(-5px); }
.score-box.alpha { --c: #f43f5e; border-color: rgba(244, 63, 94, 0.5); }
.score-box.beta  { --c: #3b82f6; border-color: rgba(59, 130, 246, 0.5); }
.score-box.gamma { --c: #f59e0b; border-color: rgba(245, 158, 11, 0.5); }
.score-box.is-leader { animation: glowPulse 2.4s ease-in-out infinite; }

.leader-tag {
  position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  background: var(--gold-grad); color: #090d16; font-size: 0.62rem; font-weight: 800;
  padding: 3px 10px; border-radius: 0 0 10px 10px; letter-spacing: 0.7px; text-transform: uppercase;
  display: none; white-space: nowrap; z-index: 2;
}
.score-box.is-leader .leader-tag { display: inline-block; animation: bob 2s ease-in-out infinite; }

.score-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin: 8px 0 10px; position: relative; }
.score-digit {
  position: relative;
  font-family: "JetBrains Mono", monospace; font-size: 2.4rem; font-weight: 800;
  background: linear-gradient(180deg, #0f1528 0%, #05070e 100%);
  border: 1px solid rgba(255,255,255,.08); border-radius: 13px; padding: 12px 4px; color: #fff;
  text-shadow: 0 0 18px var(--c, rgba(255,255,255,.3));
}
.score-pop { animation: scorePop 0.42s cubic-bezier(0.2, 0.8, 0.2, 1); }

.share-bar { height: 5px; border-radius: 999px; background: rgba(255,255,255,.07); margin-top: 11px; overflow: hidden; }
.share-fill { height: 100%; width: 0; border-radius: 999px; background: var(--c, #fff); box-shadow: 0 0 10px var(--c, #fff); transition: width 0.8s cubic-bezier(.2,.8,.2,1); }

/* Day totals */
.totals-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.total-chip {
  text-align: center; padding: 10px 6px; border-radius: 14px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
}
.total-chip b { display: block; font-family: "JetBrains Mono", monospace; font-size: 1.15rem; }
.total-chip small { font-size: 0.64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; font-weight: 700; }
.t-alpha b { color: #fb7185; } .t-beta b { color: #60a5fa; } .t-gamma b { color: #fbbf24; }

/* Inputs */
.filter-wrap { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
select, input {
  width: 100%; background: rgba(8, 11, 22, 0.92); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px;
  font-size: 0.92rem; font-weight: 600; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select:focus, input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.16); }

/* Round cards */
.round-row {
  position: relative; background: rgba(24, 31, 54, 0.66);
  border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; margin-bottom: 11px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: fadeSlideUp 0.4s ease-out both;
  overflow: hidden;
}
.round-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #f43f5e, #3b82f6, #f59e0b);
}
.round-row:hover { transform: translateY(-3px); border-color: rgba(251, 191, 36, 0.4); box-shadow: 0 10px 26px rgba(0,0,0,.32); }
.round-row.flash { animation: fadeSlideUp .4s ease-out both, flash 1.4s ease-out; }

.round-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 0.88rem; color: var(--gold); font-weight: 700; gap: 8px; flex-wrap: wrap; }
.round-note { color: var(--muted); font-weight: 500; font-size: 0.78rem; background: rgba(255,255,255,.06); padding: 2px 10px; border-radius: 999px; }

.badges-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.circle-badge {
  font-family: "JetBrains Mono", monospace; display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 50%; font-size: 1.15rem; font-weight: 800; margin: 0 auto 5px; color: #fff;
  transition: transform 0.22s ease; position: relative;
}
.round-row:hover .circle-badge { transform: scale(1.1) rotate(-4deg); }
.circle-badge.winner::after { content: "★"; position: absolute; top: -8px; right: -4px; font-size: .8rem; color: #fde047; text-shadow: 0 0 8px #f59e0b; }
.bg-alpha { background: linear-gradient(145deg, #fb7185, #e11d48); box-shadow: 0 6px 20px rgba(225, 29, 72, 0.4); }
.bg-beta  { background: linear-gradient(145deg, #60a5fa, #2563eb); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4); }
.bg-gamma { background: linear-gradient(145deg, #fde047, #d97706); color: #090d16; box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4); }
.badge-name { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; font-weight: 700; letter-spacing: 0.6px; }

/* Calendar */
.calendar-box { background: rgba(8, 12, 24, 0.92); border: 1px solid var(--border); border-radius: 18px; padding: 16px; margin-top: 16px; animation: fadeSlideUp 0.3s ease-out both; }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal-dow { font-size: 0.72rem; color: var(--muted); font-weight: 700; padding-bottom: 6px; letter-spacing: 0.6px; }
.cal-day {
  padding: 9px 4px; border-radius: 11px; background: rgba(30, 37, 64, 0.55);
  border: 1px solid transparent; color: var(--text); font-size: 0.86rem; font-weight: 600;
  cursor: pointer; transition: 0.18s ease;
}
.cal-day:hover { border-color: var(--border-gold); background: rgba(30, 37, 64, 0.95); transform: translateY(-2px); }
.cal-day.is-today { border-color: rgba(59, 130, 246, 0.7); }
.cal-day.selected { background: var(--gold-grad); color: #090d16; font-weight: 800; box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4); }
.cal-day.empty { background: transparent; cursor: default; }
.cal-day.empty:hover { transform: none; border-color: transparent; }
.cal-dot { width: 5px; height: 5px; background: var(--gold); border-radius: 50%; margin: 3px auto 0; box-shadow: 0 0 6px var(--gold); }
.cal-day.selected .cal-dot { background: #090d16; box-shadow: none; }

.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); font-size: 0.92rem; }
.empty-icon { font-size: 2.2rem; margin-bottom: 8px; display: block; }

/* Scrolling ticker */
.ticker {
  position: relative; overflow: hidden; white-space: nowrap;
  background: linear-gradient(90deg, #7c2d12, #b45309, #7c2d12);
  border-bottom: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
.ticker-track { display: inline-flex; animation: marquee 32s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  padding: 8px 34px; font-size: 0.8rem; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: #fef3c7;
}
.ticker-item::before { content: "★"; margin-right: 12px; color: #fde047; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Draw status strip */
.status-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; animation: fadeSlideUp 0.5s ease-out both; }
.status-card {
  position: relative; overflow: hidden; text-align: center; padding: 12px 8px;
  background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}
.status-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--rainbow); background-size: 200% 100%; animation: gradientShift 6s linear infinite; }
.status-card small { display: block; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.9px; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.status-card b { font-family: "JetBrains Mono", monospace; font-size: 1.05rem; color: #fff; }
.status-card.countdown b { color: #fde047; font-size: 1.25rem; text-shadow: 0 0 16px rgba(251, 191, 36, 0.6); }
.status-card.countdown.urgent b { color: #fb7185; text-shadow: 0 0 16px rgba(244, 63, 94, 0.7); animation: urgentPulse 1s ease-in-out infinite; }
@keyframes urgentPulse { 50% { opacity: 0.55; } }

/* Results table */
.slots-wrap { max-height: 540px; overflow: auto; border: 1px solid var(--border); border-radius: 16px; background: rgba(8, 11, 22, 0.7); }
.slots-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.slots-table thead th {
  position: sticky; top: 0; z-index: 2; padding: 11px 8px; text-align: center;
  background: linear-gradient(180deg, #2a1a05, #1a1004); color: var(--gold);
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.9px; text-transform: uppercase;
  border-bottom: 1px solid var(--border-gold);
}
.slots-table th.c-alpha { color: #fb7185; } .slots-table th.c-beta { color: #60a5fa; } .slots-table th.c-gamma { color: #fbbf24; }
.slots-table td { padding: 10px 8px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-family: "JetBrains Mono", monospace; font-weight: 700; }
.slots-table td.t-cell { text-align: left; padding-left: 14px; font-family: "Plus Jakarta Sans", sans-serif; color: #e2e8f0; white-space: nowrap; }
.slots-table td.t-cell small { display: block; font-size: 0.68rem; font-weight: 500; color: var(--muted); }
.slots-table tbody tr { transition: background 0.2s ease; }
.slots-table tbody tr:hover { background: rgba(251, 191, 36, 0.07); }
.slots-table tr.pending td:not(.t-cell) { color: rgba(148, 163, 184, 0.45); }
.slots-table tr.pending .t-cell { color: var(--muted); }
.slots-table tr.is-next { background: linear-gradient(90deg, rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0.04)); box-shadow: inset 3px 0 0 var(--gold); }
.slots-table tr.is-next .t-cell::after { content: "NEXT"; margin-left: 8px; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.7px; padding: 2px 7px; border-radius: 999px; background: var(--gold-grad); color: #090d16; }
.slots-table tr.flash { animation: flash 1.6s ease-out; }
.slots-table td.win { color: #fde047; text-shadow: 0 0 12px rgba(251, 191, 36, 0.7); }
.slots-table td.win::after { content: " ★"; font-size: 0.7rem; }
.table-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.is-on { border-color: rgba(16, 185, 129, 0.6); color: #6ee7b7; background: rgba(16, 185, 129, 0.12); }

.auto-tag { color: #c4b5fd; background: rgba(168, 85, 247, 0.16); border: 1px solid rgba(168, 85, 247, 0.35); }
.disclaimer { margin: 8px auto 0; max-width: 560px; font-size: 0.7rem; line-height: 1.5; color: rgba(148, 163, 184, 0.8); }

.footer { text-align: center; font-size: 0.78rem; color: var(--muted); margin: 22px 0 12px; }

@media (max-width: 500px) {
  .score-digit { font-size: 1.7rem; padding: 10px 2px; }
  .score-label { font-size: 0.62rem; letter-spacing: 0.4px; }
  .circle-badge { width: 46px; height: 46px; font-size: 1rem; }
  .topbar { padding: 12px 14px; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .slots-table { font-size: 0.8rem; }
  .ticker-item { font-size: 0.7rem; padding: 7px 22px; }
}

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

/* ---- Demo banner + order panel ---- */
.demo-banner { text-align:center; font-size:.8rem; font-weight:800; letter-spacing:.4px; color:#fef3c7; background:rgba(180,83,9,.35); border:1px dashed var(--border-gold); border-radius:12px; padding:8px 12px; margin-bottom:14px; }
.order-tabs { display:flex; gap:8px; margin-bottom:14px; }
.order-tab { padding:8px 18px; border-radius:10px 10px 0 0; font-size:.8rem; font-weight:800; text-transform:uppercase; background:rgba(255,255,255,.08); color:var(--muted); border:1px solid var(--border); }
.order-tab.active { background:var(--gold-grad); color:#090d16; border:none; }
.order-top { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.order-top select { width:auto; min-width:150px; }
.viewers { font-size:.78rem; font-weight:800; color:var(--gold); }
.order-scroll { overflow-x:auto; border:1px solid var(--border); border-radius:14px; background:rgba(8,11,22,.7); }
.order-table { width:100%; border-collapse:collapse; min-width:640px; font-size:.82rem; }
.order-table th { background:linear-gradient(180deg,#b45309,#7c2d12); color:#fff7ed; padding:8px 4px; font-size:.72rem; letter-spacing:.6px; text-transform:uppercase; }
.order-table td { padding:6px 4px; text-align:center; border-bottom:1px solid rgba(255,255,255,.05); }
.order-table td.ln { text-align:left; padding-left:12px; font-weight:800; white-space:nowrap; }
.order-table td.win-c { color:#fde047; font-weight:800; font-family:"JetBrains Mono",monospace; }
.order-table input { width:38px; padding:6px 2px; text-align:center; font-size:.8rem; border-radius:8px; font-family:"JetBrains Mono",monospace; -moz-appearance:textfield; }
.order-table input::-webkit-outer-spin-button, .order-table input::-webkit-inner-spin-button { -webkit-appearance:none; }
.order-table input.ro { width:52px; background:rgba(255,255,255,.05); color:var(--gold); border-color:transparent; }
.order-actions { display:flex; justify-content:flex-end; align-items:center; gap:10px; flex-wrap:wrap; margin-top:14px; }
.grand { font-size:.78rem; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.7px; }
.grand b { font-family:"JetBrains Mono",monospace; color:#fde047; margin-left:6px; }
.demo-toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(30px); opacity:0; pointer-events:none; z-index:50; max-width:90vw; text-align:center; background:#1a1004; color:#fef3c7; border:1px solid var(--border-gold); border-radius:14px; padding:12px 18px; font-weight:700; font-size:.88rem; box-shadow:0 14px 40px rgba(0,0,0,.6); transition:.3s ease; }
.demo-toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* ==== Dark navy + orange theme, compact 673px layout ==== */
:root {
  --bg: #07080d;
  --glass: #141824;
  --glass-2: #1d2233;
  --border: rgba(255,255,255,.09);
  --orange: #f7941d;
  --orange-grad: linear-gradient(180deg, #ffb347 0%, #f7941d 55%, #e67e00 100%);
  --silver: linear-gradient(180deg, #ffffff 0%, #c9ccd3 45%, #8d9099 100%);
}
body { background: radial-gradient(120% 60% at 50% 0%, #121624 0%, #07080d 70%); }
body::before, body::after, .ambient-bg { display: none; }
.container { max-width: 673px; padding: 12px; }
.topbar, .panel, .status-card, .round-row { backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar { background: #141824; border-radius: 18px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.topbar::after { display: none; }
.brand-badge { background: var(--orange-grad); animation: none; box-shadow: none; border-radius: 12px; width: 40px; height: 40px; font-size: 1rem; }
.brand h1 { background: none; -webkit-text-fill-color: #f3e3c3; color: #f3e3c3; animation: none; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 1.3rem; letter-spacing: .5px; }
.btn { border-radius: 999px; background: #232a3f; font-size: .75rem; padding: 7px 14px; }
.btn-gold { background: var(--orange-grad); animation: none; color: #1a1004; box-shadow: none; border-radius: 10px; }
.btn-gold::after { display: none; }
.panel, .hero-panel { background: #141824; border: 1px solid rgba(255,255,255,.07); border-radius: 18px; padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.55); }
.hero-panel::before { display: none; }
.ticker { background: transparent; border: none; box-shadow: none; }
.ticker-item { color: #d5d7de; font-size: .85rem; letter-spacing: 1.4px; }
.ticker-item::before { color: var(--orange); }
.demo-banner { background: rgba(247,148,29,.12); border: 1px dashed rgba(247,148,29,.6); color: #ffd9a1; font-size: .72rem; }

/* tabs */
.order-tab { background: #e9e9ec; color: #333; border-radius: 8px 8px 0 0; border: none; font-size: .68rem; padding: 7px 16px; }
.order-tab.active { background: #f4f4f6; color: #222; }
.order-tab:nth-child(2) { background: var(--orange-grad); color: #1a1004; }
.order-tabs { margin-bottom: 10px; }
.order-scroll { background: #0d1019; border-color: rgba(255,255,255,.08); border-radius: 12px; }
.order-table { min-width: 0; font-size: .7rem; }
.order-table th { background: var(--orange-grad); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25); padding: 6px 2px; font-size: .62rem; }
.order-table td { padding: 4px 2px; }
.order-table td.ln { color: #e8e8ee; font-size: .68rem; padding-left: 8px; }
.order-table td.win-c { color: #fff; font-family: inherit; font-weight: 700; }
.order-table input { width: 28px; padding: 5px 0; border-radius: 6px; background: #1a1e2c; border: 1px solid #262b3d; font-size: .7rem; }
.order-table input.ro { width: 44px; background: #1a1e2c; color: #ffb347; }
.order-top { margin-bottom: 10px; }
.order-top select { background: #1d2233; border-radius: 8px; padding: 6px 10px; font-size: .75rem; min-width: 110px; }
.viewers { color: #ffcf8a; font-size: .72rem; }
.grand { font-size: .68rem; }
.grand b { color: #ffcf8a; }

/* status strip */
.status-strip { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.status-card { background: #141824; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: 9px 4px; box-shadow: none; }
.status-card::before { display: none; }
.status-card small { display: inline; font-size: .62rem; color: #d5d7de; letter-spacing: .3px; margin: 0; }
.status-card small::after { content: " :"; }
.status-card b { font-family: inherit; font-size: .62rem; font-weight: 600; color: #d5d7de; margin-left: 3px; }
.status-card.countdown b { font-size: .62rem; color: #ffcf8a; text-shadow: none; }
.status-card { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; text-transform: uppercase; }

/* result boxes: silver digits on dark glass */
.hero-panel .panel-header { margin-bottom: 10px; }
.live-pill { color: #ffb347; background: rgba(247,148,29,.12); border-color: rgba(247,148,29,.4); }
.live-dot { background: #f7941d; } .live-dot::after { border-color: #f7941d; }
.board-grid { gap: 10px; }
.score-box, .score-box.alpha, .score-box.beta, .score-box.gamma { background: linear-gradient(180deg, #1a1e2c 0%, #10131d 100%); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 12px 8px 14px; }
.score-box::before { display: none; }
.score-box:hover { transform: none; }
.score-box.is-leader { animation: none; }
.score-label { color: #e9e9ee; font-family: Georgia, "Times New Roman", serif; font-size: .8rem; font-weight: 800; letter-spacing: 1px; text-shadow: 0 1px 0 #000; margin: 2px 0 2px; }
.on-time { font-size: .62rem; color: #cfd2da; margin-bottom: 8px; }
.on-time b { color: #ffb347; font-weight: 700; margin-left: 3px; }
.score-digit { background: #05060a; border: 3px solid transparent; border-radius: 12px;
  background-image: linear-gradient(#05060a,#05060a), linear-gradient(180deg,#f2f3f6,#7e828c 50%,#d9dbe0);
  background-origin: border-box; background-clip: padding-box, border-box;
  font-size: 3.2rem; font-weight: 800; padding: 14px 0; letter-spacing: 2px; color: transparent;
  -webkit-background-clip: padding-box, border-box; text-shadow: none; position: relative; }
.score-digit { color: #e4e6ec; text-shadow: 0 2px 0 #7a7d86, 0 0 14px rgba(255,255,255,.25); }
.share-bar { display: none; }
.filter-wrap { border-top-color: rgba(255,255,255,.07); }
select, input { background: #1d2233; border-color: #2a3046; }
.round-row { background: #10131d; border-radius: 12px; }
.round-row::before { background: var(--orange); }
.round-meta { color: #ffb347; }
.clock-pill { background: #1d2233; }
.footer { color: #9aa0b0; }
.cal-day.selected { background: var(--orange-grad); }
.cal-dot { background: var(--orange); box-shadow: none; }
@media (max-width: 500px) { .score-digit { font-size: 2.2rem; } .status-card small, .status-card b { font-size: .55rem; } }

/* Round "All Results" button */
.all-results-wrap { display: flex; justify-content: center; margin: 22px 0 6px; }
.all-results-btn {
  width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; text-decoration: none;
  background: radial-gradient(circle at 35% 28%, #3fb7a6 0%, #1c7f78 55%, #0f4f55 100%);
  border: 5px solid transparent;
  background-image: radial-gradient(circle at 35% 28%, #3fb7a6 0%, #1c7f78 55%, #0f4f55 100%), linear-gradient(145deg, #fff2b8, #e0a020 45%, #8a5a08 75%, #f6d56a);
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 0 0 3px rgba(0,0,0,.45), 0 10px 26px rgba(0,0,0,.6), inset 0 0 14px rgba(0,0,0,.45);
  transition: transform .2s ease, box-shadow .2s ease;
}
.all-results-btn:hover { transform: scale(1.06); box-shadow: 0 0 0 3px rgba(0,0,0,.45), 0 0 26px rgba(247,200,80,.5), inset 0 0 14px rgba(0,0,0,.45); }
.all-results-btn span { font-family: Georgia, "Times New Roman", serif; font-weight: 800; font-size: .95rem; line-height: 1.15; letter-spacing: 1px; text-align: center; color: #fff6d8; text-shadow: 0 2px 0 #0a3a3a, 0 0 8px rgba(0,0,0,.6); }
section[hidden] { display: none !important; }

/* ==== Results page: dark purple theme ==== */
body.results-page { background: linear-gradient(180deg, #221a3c 0%, #14102a 35%, #0a0914 100%); }
.results-page .res-head { display: flex; align-items: center; gap: 18px; padding: 18px 6px 10px; }
.results-page .res-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 120px; }
.results-page .res-brand .brand-badge { width: 54px; height: 54px; font-size: 1.3rem; }
.results-page .res-brand-name { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 1.35rem; line-height: 1; text-align: center; color: #f3e3c3; }
.results-page .res-title h1 { font-size: 1.9rem; font-weight: 800; line-height: 1.15; color: #fff; }
.results-page .res-title h1 span { color: #fbbf24; }
.results-page .res-title p { color: #a9a6c4; font-size: .95rem; margin-top: 6px; }
.results-page .panel, .results-page .hero-panel { background: #1b1730; border: 1px solid rgba(255,255,255,.1); border-radius: 22px; box-shadow: none; }
.results-page .hero-panel::before { display: none; }
.results-page #selectedDateHeading { color: #fff; font-size: 1.5rem !important; }
.results-page .sub-note { color: #a9a6c4; }
.results-page .btn { background: #2a2552; border-radius: 16px; padding: 12px 18px; font-size: .95rem; font-weight: 500; border: 1px solid rgba(255,255,255,.08); }
.results-page .btn-gold { background: #8a6d2f; color: #1a1004; border-radius: 16px; }
.results-page .nav-links .btn:disabled { opacity: .4; }
.results-page .totals-strip { display: none !important; }
.results-page .panel-header { display: none; }
.results-page #archiveList { max-height: 640px; overflow-y: auto; padding-right: 8px; }
.results-page .round-row { background: #211c3b; border: none; border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.results-page .round-row::before { display: none; }
.results-page .round-row:hover { transform: none; box-shadow: none; }
.results-page .round-meta { color: #fff; font-size: 1.2rem; font-weight: 500; }
.results-page .circle-badge { width: 58px; height: 58px; font-size: 1.4rem; font-weight: 700; font-family: inherit; }
.results-page .circle-badge.winner::after { display: none; }
.results-page .bg-gamma { color: #3a2400; }
.results-page .badge-name { color: #a9a6c4; font-size: .78rem; font-weight: 500; letter-spacing: .5px; }
.results-page .calendar-box { background: #14102a; }
.results-page .cal-day { background: #211c3b; }
.results-page .cal-day.selected { background: #8a6d2f; color: #fff; }
.results-page .footer { color: #a9a6c4; }
@media (max-width: 500px) { .results-page .res-title h1 { font-size: 1.5rem; } .results-page .res-brand { min-width: 96px; } }

/* Logo slot: put your own logo.png next to index.html */
.site-logo { max-width: 130px; max-height: 64px; object-fit: contain; display: block; }
.results-page .site-logo { max-width: 150px; max-height: 80px; }
.logo-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 800; color: #090d16; background: var(--orange-grad, linear-gradient(135deg,#fbbf24,#ea580c)); border-radius: 12px; padding: 8px 12px; min-width: 64px; }
.logo-fallback span { font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: .7rem; }

/* ==== Home: everything fits on one screen (no scroll) ==== */
.home-page .container { padding: 6px 10px 4px; }
.home-page .ticker-item { padding: 4px 24px; font-size: .68rem; }
.home-page .topbar { padding: 6px 10px; margin-bottom: 8px; border-radius: 14px; }
.home-page .site-logo { max-height: 34px; max-width: 80px; }
.home-page .logo-fallback { padding: 4px 8px; min-width: 44px; font-size: .8rem; }
.home-page .logo-fallback span { font-size: .55rem; }
.home-page .brand { gap: 8px; }
.home-page .brand h1 { font-size: 1rem; }
.home-page .brand p { font-size: .65rem; }
.home-page .btn { padding: 5px 10px; font-size: .68rem; }
.home-page .demo-banner { margin-bottom: 8px; padding: 4px 8px; font-size: .6rem; }
.home-page .panel { padding: 8px 10px; margin-bottom: 8px; border-radius: 14px; }
.home-page .order-tabs { margin-bottom: 6px; }
.home-page .order-tab { padding: 4px 12px; font-size: .6rem; }
.home-page .order-top { margin-bottom: 6px; }
.home-page .order-top select { padding: 3px 8px; font-size: .68rem; }
.home-page .order-top label { font-size: .68rem; }
.home-page .viewers { font-size: .62rem; }
.home-page .order-table th { padding: 4px 1px; font-size: .56rem; }
.home-page .order-table td { padding: 2px 1px; }
.home-page .order-table input { padding: 3px 0; width: 26px; font-size: .64rem; }
.home-page .order-table input.ro { width: 38px; }
.home-page .order-table td.ln { font-size: .62rem; }
.home-page .order-actions { margin-top: 6px; }
.home-page .grand { font-size: .6rem; }
.home-page .status-strip { margin-bottom: 8px; gap: 6px; }
.home-page .status-card { padding: 6px 2px; border-radius: 8px; }
.home-page .hero-panel .panel-header { margin-bottom: 6px; }
.home-page .panel-title { font-size: .85rem; }
.home-page .sub-note { font-size: .62rem; margin-top: 0; }
.home-page .live-pill { padding: 2px 8px; font-size: .6rem; }
.home-page .score-box { padding: 8px 6px 8px; }
.home-page .score-label { font-size: .7rem; margin: 0; }
.home-page .on-time { font-size: .56rem; margin-bottom: 4px; }
.home-page .score-digit { font-size: 2.3rem; padding: 6px 0; border-width: 2px; }
.home-page .filter-wrap { display: none; }
.home-page .all-results-wrap { margin: 4px 0 2px; }
.home-page .all-results-btn { width: 74px; height: 74px; border-width: 4px; }
.home-page .all-results-btn span { font-size: .68rem; }
.home-page .footer { margin: 4px 0 2px; font-size: .62rem; }
.home-page .footer .disclaimer { margin-top: 2px; font-size: .58rem; line-height: 1.3; }
.home-page .footer .disclaimer + .disclaimer { display: none; }
@media (max-width: 500px) {
  .home-page .score-digit { font-size: 1.9rem; }
  .home-page .header-actions .btn { font-size: .62rem; padding: 4px 8px; }
  .home-page .status-card small, .home-page .status-card b { font-size: .5rem; }
}

/* Home: fit table on phones, compress further on short screens */
@media (max-width: 500px) {
  .home-page .order-scroll { overflow: hidden; }
  .home-page .order-table { table-layout: fixed; width: 100%; min-width: 0; }
  .home-page .order-table th:nth-child(1) { width: 13%; }
  .home-page .order-table th:nth-child(2) { width: 6%; }
  .home-page .order-table th:nth-child(3) { width: 5%; }
  .home-page .order-table th:nth-child(n+4):nth-child(-n+13) { width: 6%; }
  .home-page .order-table th:nth-child(14), .home-page .order-table th:nth-child(15) { width: 8%; }
  .home-page .order-table th { font-size: .45rem; letter-spacing: 0; padding: 4px 0; }
  .home-page .order-table td { padding: 2px 0; }
  .home-page .order-table td.ln { font-size: .48rem; padding-left: 3px; white-space: normal; }
  .home-page .order-table td.win-c { font-size: .5rem; }
  .home-page .order-table input { width: 90%; padding: 3px 0; font-size: .55rem; border-radius: 4px; }
  .home-page .order-table input.ro { width: 90%; }
  .home-page .demo-banner { font-size: .52rem; letter-spacing: 0; }
  .home-page .header-actions { gap: 6px; }
}
@media (max-height: 740px) {
  .home-page .ticker { display: none; }
  .home-page .on-time { display: none; }
  .home-page .footer .disclaimer { display: none; }
  .home-page .score-digit { font-size: 1.7rem; padding: 4px 0; }
  .home-page .all-results-btn { width: 60px; height: 60px; border-width: 3px; }
  .home-page .all-results-btn span { font-size: .55rem; }
  .home-page .hero-panel .panel-header { margin-bottom: 4px; }
  .home-page .site-logo { max-height: 28px; }
  .home-page .topbar { padding: 4px 8px; margin-bottom: 6px; }
  .home-page .panel, .home-page .status-strip, .home-page .demo-banner { margin-bottom: 6px; }
}
@media (max-height: 680px) {
  .home-page #voiceBtn, .home-page .viewers { display: none; }
  .home-page .topbar { flex-wrap: nowrap; }
  .home-page .header-actions .btn-gold { font-size: .58rem; }
  .home-page .brand p { display: none; }
  .home-page .score-box { padding: 6px 4px; }
  .home-page .footer { display: none; }
}

/* ==== Results: one screen, list scrolls inside and shows 4 rounds ==== */
body.results-page { height: 100dvh; overflow: hidden; }
.results-page .container { height: 100dvh; display: flex; flex-direction: column; padding: 6px 10px 4px; max-width: 673px; }
.results-page .res-head { padding: 2px 4px 4px; gap: 12px; flex: none; }
.results-page .res-brand { min-width: 0; flex: none; }
.results-page .site-logo { max-height: 40px; max-width: 90px; }
.results-page .logo-fallback { padding: 4px 8px; min-width: 44px; font-size: .8rem; }
.results-page .logo-fallback span { font-size: .55rem; }
.results-page .res-title h1 { font-size: 1.35rem; }
.results-page .res-title p { font-size: .72rem; margin-top: 2px; }
.results-page .demo-banner { flex: none; margin-bottom: 6px; padding: 4px 8px; font-size: .58rem; }
.results-page .hero-panel { flex: none; padding: 8px 10px; margin-bottom: 6px; border-radius: 16px; }
.results-page .hero-panel .sub-note { font-size: .6rem !important; }
.results-page #selectedDateHeading { font-size: 1.05rem !important; margin: 0 0 6px !important; }
.results-page .nav-links { gap: 6px; flex-wrap: wrap; }
.results-page .btn { padding: 6px 10px; font-size: .68rem; border-radius: 12px; }
.results-page .calendar-box { padding: 8px; margin-top: 6px; }
.results-page .cal-day { padding: 5px 2px; font-size: .72rem; }
.results-page .panel:not(.hero-panel) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-bottom: 4px; padding: 8px; border-radius: 16px; }
.results-page #archiveList { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; padding-right: 4px; }
.results-page .round-row { padding: 7px 12px; margin-bottom: 7px; border-radius: 12px; }
.results-page .round-meta { font-size: .85rem; margin-bottom: 5px; }
.results-page .circle-badge { width: 40px; height: 40px; font-size: 1rem; margin-bottom: 2px; }
.results-page .badge-name { font-size: .6rem; }
.results-page .footer { flex: none; margin: 2px 0; font-size: .6rem; }
.results-page .footer .disclaimer { display: none; }
@media (max-height: 700px) { .results-page .footer { display: none; } .results-page .round-row { padding: 5px 10px; } .results-page .circle-badge { width: 34px; height: 34px; font-size: .9rem; } }
