:root {
  --bg: #0b0820;
  --panel: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.12);
  --ink: #f5f3ff;
  --muted: #a9a3cf;
  --coral: #ff7a59;
  --violet: #7c5cff;
  --cyan: #2ee6d6;
  --gold: #ffd166;
  --g1: #fff1b8; --g2: #ffd34e; --g3: #f0a500; --g4: #a86a00;
  --goldgrad: linear-gradient(120deg, #fff1b8, #ffd34e 35%, #f0a500 70%, #c98600);
  --grad: linear-gradient(120deg, var(--coral), var(--violet) 60%, var(--cyan));
  --radius: 20px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.aurora i { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; filter: blur(90px); opacity: 0.45; animation: drift 22s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { background: var(--violet); top: -20vmax; left: -15vmax; }
.aurora i:nth-child(2) { background: var(--coral); bottom: -25vmax; right: -15vmax; animation-duration: 28s; opacity: 0.32; }
.aurora i:nth-child(3) { background: var(--cyan); top: 30vh; left: 40vw; width: 35vmax; height: 35vmax; animation-duration: 34s; opacity: 0.18; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

.top { display: flex; align-items: center; gap: 16px; padding: 18px max(16px, 4vw); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); background: rgba(11, 8, 32, 0.6); border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; font-size: 1.25rem; text-decoration: none; letter-spacing: -0.02em; margin-right: auto; }
.crown { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.reset { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.reset .label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.count { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--gold); }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 10px 18px; cursor: pointer; font-weight: 600; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, .tab:focus-visible, .vote:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn.primary { background: var(--grad); border-color: transparent; color: #12082e; box-shadow: 0 8px 30px -8px rgba(124, 92, 255, 0.8); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.6; cursor: wait; }

main { max-width: 860px; margin: 0 auto; padding: 0 16px 80px; }
.hero { text-align: center; padding: 56px 0 28px; }
.hero h1 { font-size: clamp(2.4rem, 8vw, 4.4rem); line-height: 1.02; margin: 0 0 12px; letter-spacing: -0.04em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: sheen 6s linear infinite; }
@keyframes sheen { to { background-position: 200% 0; } }
.hero p { color: var(--muted); max-width: 520px; margin: 0 auto 24px; }
.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.tab { border: 0; background: transparent; padding: 8px 20px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tab.active { background: rgba(255, 255, 255, 0.14); color: var(--ink); }

.champion { position: relative; border-radius: 28px; overflow: hidden; margin-bottom: 20px; border: 1px solid rgba(255, 209, 102, 0.5); background: var(--panel); backdrop-filter: blur(10px); box-shadow: 0 0 60px -10px rgba(255, 209, 102, 0.45); animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.champion .media { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #2a1b6e, #6d2a63); display: grid; place-items: center; }
.champion .media img, .champion .media iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.champion .media .placeholder { font-size: 5rem; opacity: 0.4; }
.champion .body { padding: 20px 24px 24px; display: grid; gap: 6px; }
.badge { justify-self: start; background: var(--gold); color: #3a2a00; font-weight: 800; font-size: 0.75rem; padding: 4px 12px; border-radius: 999px; letter-spacing: 0.08em; text-transform: uppercase; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255, 209, 102, 0.0), 0 0 22px rgba(255, 209, 102, 0.6); } }
.champion h2 { margin: 4px 0 0; font-size: 1.8rem; letter-spacing: -0.02em; }
.champion .tag { color: var(--muted); margin: 0; }
.row-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.card { display: grid; grid-template-columns: 44px 64px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px 12px 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1), border-color 0.2s, background 0.2s; animation: rise 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.card:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.09); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.rank { font-weight: 800; font-size: 1.3rem; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank.r2 { color: #d7dcff; } .rank.r3 { color: #ffb48a; }
.thumb { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: linear-gradient(135deg, var(--violet), var(--coral)); display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.info { min-width: 0; }
.info a.name { font-weight: 700; font-size: 1.05rem; text-decoration: none; display: inline-block; }
.info a.name:hover { text-decoration: underline; }
.info p { margin: 0; color: var(--muted); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { display: inline-block; font-size: 0.7rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin-left: 8px; vertical-align: middle; }
.vote { display: grid; justify-items: center; min-width: 58px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: transparent; cursor: pointer; transition: transform 0.15s, background 0.15s, border-color 0.15s; }
.vote:hover { transform: translateY(-2px); border-color: var(--cyan); }
.vote.voted { background: rgba(46, 230, 214, 0.18); border-color: var(--cyan); }
.vote b { font-variant-numeric: tabular-nums; }
.vote span { font-size: 0.7rem; color: var(--muted); }

.hall { display: grid; gap: 16px; }
.day { padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.day h3 { margin: 0 0 10px; font-size: 0.85rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.podium { display: grid; gap: 8px; }
.podium div { display: flex; gap: 10px; align-items: baseline; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 32px 16px 48px; }

dialog { border: 1px solid var(--line); border-radius: 24px; background: #15103a; color: var(--ink); width: min(520px, calc(100vw - 32px)); padding: 0; }
dialog::backdrop { background: rgba(5, 3, 20, 0.7); backdrop-filter: blur(4px); }
dialog form { padding: 24px; display: grid; gap: 14px; }
dialog h2 { margin: 0; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; }
label small { font-weight: 400; color: var(--muted); }
input, select { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); }
select option { background: #15103a; }
#imagePreview { max-height: 140px; border-radius: 12px; justify-self: start; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.error { color: #ff8fa3; margin: 0; font-size: 0.9rem; }

@media (max-width: 560px) {
  .card { grid-template-columns: 32px 52px 1fr auto; gap: 10px; }
  .thumb { width: 52px; height: 52px; }
  .top .btn.primary { padding: 8px 12px; font-size: 0.85rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  #confetti { display: none; }
}

/* ---------- gold / crown ---------- */
.sprite { position: absolute; width: 0; height: 0; }
.crown-ico { width: 1.5em; height: 1.2em; vertical-align: -0.2em; filter: drop-shadow(0 2px 6px rgba(240, 165, 0, 0.55)); }
.crown-ico.big { width: 2em; height: 1.6em; }
.logo .crown-ico { width: 28px; height: 22px; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-2px) rotate(-4deg); } }
.btn.gold { background: var(--goldgrad); color: #3a2400; border-color: transparent; font-weight: 800; box-shadow: 0 8px 30px -8px rgba(240, 165, 0, 0.8); position: relative; overflow: hidden; }
.btn.gold::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.65) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.6s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(120%); } }
.hero h1 .grad { background: var(--goldgrad); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; }

.crowns-wrap { margin: 0 0 28px; padding: 18px; border-radius: 28px; background: linear-gradient(160deg, rgba(255, 211, 78, 0.12), rgba(255, 255, 255, 0.04)); border: 1px solid rgba(255, 211, 78, 0.35); box-shadow: 0 0 80px -30px rgba(240, 165, 0, 0.7), inset 0 0 40px rgba(255, 211, 78, 0.06); }
.crowns-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.crowns-head h2 { margin: 0; font-size: 1.15rem; background: var(--goldgrad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.crowns-head h2 .crown-ico { -webkit-text-fill-color: initial; }
.crowns-head p { margin: 0; font-size: 0.8rem; color: var(--muted); }
.crowns { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.crown-card { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 14px 12px 12px; border-radius: 18px; text-decoration: none; background: linear-gradient(#171040, #171040) padding-box, var(--goldgrad) border-box; border: 1.5px solid transparent; transition: transform 0.2s, box-shadow 0.2s; animation: rise 0.5s both; }
.crown-card:hover { transform: translateY(-3px); box-shadow: 0 14px 40px -12px rgba(240, 165, 0, 0.8); }
.crown-card .tick { position: absolute; top: -13px; left: 14px; }
.crown-card .tick .crown-ico { width: 30px; height: 24px; }
.crown-card .thumb { width: 52px; height: 52px; }
.crown-card b { display: block; line-height: 1.2; }
.crown-card small { display: block; color: var(--muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crown-card .spons { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--g2); font-weight: 700; }
.crown-card.open { background: transparent; border-image: none; border: 1.5px dashed rgba(255, 211, 78, 0.55); cursor: pointer; color: var(--g1); grid-template-columns: 1fr; text-align: center; padding: 20px 12px; font: inherit; }
.crown-card.open:hover { background: rgba(255, 211, 78, 0.08); }
.crown-card.open span { font-weight: 800; }
.crown-card.open small { color: var(--muted); }

.champion { border-color: rgba(255, 211, 78, 0.7); box-shadow: 0 0 80px -8px rgba(240, 165, 0, 0.6); }
.champion .crown-float { position: absolute; top: 14px; right: 18px; z-index: 2; animation: bob 4s ease-in-out infinite; }
.champion .crown-float .crown-ico { width: 64px; height: 50px; }
.badge { background: var(--goldgrad); }
.rank:first-child { color: var(--g2); }
.card.spot { border-color: var(--g2); box-shadow: 0 0 0 3px rgba(255, 211, 78, 0.25); }
.mini { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.75rem; padding: 2px 6px; border-radius: 8px; }
.mini:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.info .tools { display: flex; gap: 2px; margin-top: 2px; flex-wrap: wrap; }

dialog .lead { margin: 0; color: var(--muted); }
dialog .lead b { color: var(--g2); }
.traffic { margin: 0; font-size: 0.85rem; color: var(--cyan); }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan { text-align: center; padding: 16px 10px; border-radius: 18px; border: 1.5px solid rgba(255, 211, 78, 0.5); background: rgba(255, 211, 78, 0.07); cursor: pointer; position: relative; transition: transform 0.15s, background 0.15s; }
.plan:hover:not(:disabled) { transform: translateY(-2px); background: rgba(255, 211, 78, 0.16); }
.plan:disabled { opacity: 0.55; cursor: not-allowed; }
.plan b { display: block; font-size: 1.9rem; background: var(--goldgrad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan span { display: block; font-size: 0.85rem; color: var(--muted); }
.plan .best { position: absolute; top: -10px; right: 10px; background: var(--goldgrad); color: #3a2400; font-size: 0.65rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.note { margin: 0; font-size: 0.8rem; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #15103a; border: 1px solid var(--g2); color: var(--ink); padding: 10px 18px; border-radius: 999px; z-index: 60; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } .crowns { grid-template-columns: 1fr; } .top .btn { padding: 8px 10px; font-size: 0.8rem; } .reset { display: none; } }
.logo { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ---------- admin ---------- */
.adminpage main.admin { max-width: 820px; margin: 0 auto; padding: 32px 16px 80px; }
.admin h1 { margin: 0 0 20px; letter-spacing: -0.03em; }
.admin h2 { font-size: 1.1rem; margin: 28px 0 8px; }
.panel { padding: 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); display: grid; gap: 12px; }
.panel.row { grid-template-columns: 1fr auto; align-items: start; }
.stack { display: grid; gap: 10px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn.danger { background: rgba(255, 90, 122, 0.2); border-color: #ff5a7a; }
.chip.gold { color: var(--g2); border-color: var(--g2); }
.admin code { font-size: 0.8rem; color: var(--cyan); word-break: break-all; }
.log { list-style: none; padding: 0; margin: 0; font-size: 0.8rem; color: var(--muted); display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .panel.row { grid-template-columns: 1fr; } .acts { justify-content: flex-start; } }

/* ---------- legal pages ---------- */
.legalnav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.9rem; margin-bottom: 24px; }
.legalnav a { color: var(--muted); text-decoration: none; } .legalnav a:hover { color: var(--ink); }
main.legal { max-width: 760px; margin: 0 auto; padding: 32px 16px 40px; }
.legal h1 { font-size: clamp(2rem, 6vw, 2.8rem); letter-spacing: -0.03em; margin: 0 0 8px; }
.legal h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.legal p, .legal li { color: #d9d5f3; line-height: 1.65; }
.legal .lead { font-size: 1.1rem; }
.legal a { color: var(--cyan); }
.legal .btn.gold { color: #3a2400; text-decoration: none; display: inline-block; }
.legalplans { margin: 20px 0; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.legalplans .plan { text-align: left; cursor: default; display: grid; gap: 6px; }
.legalplans .plan h2 { margin: 0; font-size: 1rem; }
.legalplans .plan ul { margin: 6px 0 0; padding-left: 18px; font-size: 0.85rem; }
.legalfoot { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 24px 16px 48px; }
.legalfoot a { color: var(--muted); }
.legalpage .top { justify-content: flex-start; }
