:root {
  --bg: #0b0b10;
  --bg-2: #12121a;
  --card: #171722;
  --card-2: #1e1e2c;
  --line: #2a2a3a;
  --text: #ecebf2;
  --muted: #9a98ab;
  --gold: #e8b64c;
  --gold-2: #ffd77a;
  --gold-ink: #1a1306;
  --good: #4fd18b;
  --bad: #ff6b6b;
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: 'Oswald', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  background-image: radial-gradient(1200px 600px at 50% -200px, #2a2140 0%, transparent 70%);
  background-repeat: no-repeat; min-height: 100vh;
}
a { color: var(--gold-2); }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: rgba(11, 11, 16, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--gold-ink); font-weight: 800;
}
.brand b { font-family: var(--display); letter-spacing: .04em; font-size: 18px; text-transform: uppercase; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a, .nav button {
  text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; border: 0; background: none; cursor: pointer;
}
.nav a:hover, .nav button:hover { color: var(--text); background: var(--card); }
.nav a.active { color: var(--gold-ink); background: var(--gold); font-weight: 600; }
.nav .who { color: var(--muted); font-size: 13px; padding: 0 6px; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .02em; margin: 0; }
h1 { font-size: 34px; text-transform: uppercase; }
h2 { font-size: 24px; }

/* ── Buttons & inputs ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card-2); cursor: pointer; text-decoration: none; color: var(--text); font-weight: 500;
}
.btn:hover { border-color: #3d3d52; }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); border: 0; font-weight: 700; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 182, 76, .18); }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
textarea { min-height: 90px; resize: vertical; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

/* ── Toast ───────────────────────────────────────────── */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 100;
  background: var(--card-2); border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px;
  transition: all .2s ease; pointer-events: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { border-color: var(--bad); color: #ffd0d0; }

/* ── Landing / auth ──────────────────────────────────── */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding-top: 30px; }
.hero h1 { font-size: 56px; line-height: 1; }
.hero h1 span { color: var(--gold); }
.hero p { color: var(--muted); font-size: 17px; max-width: 520px; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; background: var(--bg-2); padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; padding: 8px; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--card-2); color: var(--text); font-weight: 600; }
.form-error { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 10px; }
.facts { display: flex; gap: 24px; margin-top: 24px; flex-wrap: wrap; }
.facts div b { display: block; font-family: var(--display); font-size: 26px; color: var(--gold-2); }
.facts div { color: var(--muted); font-size: 13px; }

/* ── Picks page ──────────────────────────────────────── */
.ballot-head { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.countdown { text-align: right; }
.countdown .t { font-family: var(--display); font-size: 26px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.countdown.locked .t { color: var(--bad); }
.progress { height: 6px; border-radius: 99px; background: var(--card-2); overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .3s; }

.jumpbar {
  position: sticky; top: 51px; z-index: 40; display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; margin: 0 -20px 10px;
  padding-left: 20px; padding-right: 20px; background: rgba(11, 11, 16, .9); backdrop-filter: blur(10px); scrollbar-width: thin;
}
.jumpbar a {
  flex: none; font-size: 12.5px; text-decoration: none; color: var(--muted); padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); white-space: nowrap;
}
.jumpbar a.done { color: var(--text); border-color: #4a3f22; background: rgba(232, 182, 76, .08); }
.jumpbar a.done::before { content: '✓ '; color: var(--gold); }
.jumpbar input { flex: none; width: 160px; padding: 5px 10px; border-radius: 999px; font-size: 13px; }

.category { padding: 26px 0 10px; border-top: 1px solid var(--line); }
.category:first-of-type { border-top: 0; }
.cat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.cat-head h2 { text-transform: uppercase; }
.cat-head .pts { font-size: 12px; color: var(--gold); border: 1px solid #4a3f22; padding: 2px 8px; border-radius: 99px; }
.cat-desc { color: var(--muted); margin: 4px 0 16px; max-width: 760px; font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.nom {
  position: relative; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: transform .12s ease, border-color .12s ease, box-shadow .12s; display: flex; flex-direction: column;
  text-align: left; padding: 0;
}
.nom:hover { transform: translateY(-2px); border-color: #3d3d52; }
.nom.picked { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 182, 76, .2), 0 12px 30px rgba(232, 182, 76, .12); }
.nom.locked { cursor: default; }
.nom.locked:hover { transform: none; }
.art { position: relative; aspect-ratio: 3 / 4; background: var(--bg-2); overflow: hidden; }
.art .blur { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(18px) brightness(.55); }
.art img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.art .ph {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px;
  font-family: var(--display); font-size: 22px; color: #5d5a73; text-transform: uppercase; line-height: 1.1;
  background: linear-gradient(160deg, #1d1b2b, #12121a);
}
.badge {
  position: absolute; top: 8px; left: 8px; z-index: 2; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px;
  background: var(--gold); color: var(--gold-ink); letter-spacing: .03em; text-transform: uppercase;
}
.badge.win { background: var(--good); color: #062012; }
.badge.miss { background: var(--bad); color: #2a0606; }
.meta-score {
  position: absolute; top: 8px; right: 8px; z-index: 2; font-weight: 800; font-size: 14px; min-width: 34px; padding: 4px 6px; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; line-height: 1.05; background: #1f7a3e; color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.meta-score small { font-size: 9px; font-weight: 700; letter-spacing: .03em; opacity: .9; margin-top: 2px; white-space: nowrap; }
.meta-score.low { background: #b23b3b; }
.meta-score.mid { background: #b8860b; }
.nom .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nom .name { font-weight: 700; line-height: 1.25; }
.nom .studio { font-size: 12.5px; color: var(--muted); }
.nom .desc { font-size: 12.5px; color: #c4c2d2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nom .desc.open { -webkit-line-clamp: unset; }
.nom .more { font-size: 12px; color: var(--gold-2); background: none; border: 0; padding: 0; cursor: pointer; align-self: flex-start; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.links a {
  font-size: 11.5px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px;
}
.links a:hover { color: var(--text); border-color: var(--gold); }

/* ── Leaderboard ─────────────────────────────────────── */
.lb-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.me td { background: rgba(232, 182, 76, .07); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--card-2); }
.rank { font-family: var(--display); font-size: 20px; color: var(--muted); width: 50px; }
.rank.r1 { color: var(--gold-2); }
.score { font-family: var(--display); font-size: 22px; color: var(--gold-2); }
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-item { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.feed-item img, .feed-item .thumb { width: 46px; height: 60px; object-fit: cover; border-radius: 6px; background: var(--bg-2); flex: none; }
.feed-item .cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.feed-item .win { font-weight: 700; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-right: 6px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

dialog {
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  max-width: 640px; width: calc(100% - 32px); padding: 0; max-height: 85vh;
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog .dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); }
dialog .dlg-body { padding: 8px 20px 20px; }
.pickrow { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pickrow .c { color: var(--muted); }
.pickrow .ok { color: var(--good); font-weight: 600; }
.pickrow .no { color: var(--bad); }

@media (max-width: 860px) {
  .hero, .lb-layout { grid-template-columns: 1fr; }
  .hero h1 { font-size: 42px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .nom .desc { display: none; }
  .topbar { padding: 10px 12px; }
  .brand b, .nav .who { display: none; }
  .nav { flex-wrap: nowrap; gap: 0; }
  .nav a, .nav button { padding: 6px 9px; font-size: 14px; }
  .countdown { text-align: left; }
  main { padding: 16px 14px 80px; }
  .jumpbar { margin: 0 -14px 10px; padding-left: 14px; padding-right: 14px; }
}
