/* All look & feel is driven by CSS custom properties set by js/theme.js */
:root {
  --primary: #7c3aed; --accent: #22d3ee; --bg: #0a0a14; --surface: #14142a; --text: #eef0ff;
  --font-heading: 'Orbitron', sans-serif; --font-body: 'Inter', sans-serif; --radius: 16px;
  --muted: color-mix(in srgb, var(--text) 62%, transparent);
  --border: color-mix(in srgb, var(--text) 14%, transparent);
  --grad: linear-gradient(135deg, var(--primary), var(--accent));
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); line-height: 1.6; overflow-x: hidden; transition: background .3s, color .3s; }
h1, h2, h3, .logo, .btn { font-family: var(--font-heading); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
section { padding: 72px 0; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.sec-head h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
.sec-head h2 span, .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sec-head p { color: var(--muted); }

/* nav */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 75%, transparent); border-bottom: 1px solid var(--border); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .08em; font-size: 1.15rem; }
.logo i { font-style: normal; display: grid; place-items: center; width: 38px; height: 38px; border-radius: calc(var(--radius) * .6); background: var(--grad); color: #fff; font-size: .8rem; box-shadow: 0 0 18px color-mix(in srgb, var(--primary) 60%, transparent); }
.nav-links { display: flex; gap: 26px; list-style: none; }
.nav-links a { color: var(--muted); font-weight: 600; font-size: .95rem; transition: color .2s; }
.nav-links a:hover { color: var(--accent); }
.burger { display: none; background: none; border: 1px solid var(--border); color: var(--text); width: 42px; height: 42px; border-radius: 10px; font-size: 1.3rem; cursor: pointer; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px; border: 0; border-radius: var(--radius); font-weight: 700; font-size: .85rem; letter-spacing: .04em; cursor: pointer; color: #fff; background: var(--grad); transition: transform .2s, box-shadow .2s; box-shadow: 0 6px 24px color-mix(in srgb, var(--primary) 45%, transparent); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 32px color-mix(in srgb, var(--accent) 50%, transparent); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.sm { padding: 8px 16px; font-size: .75rem; }
.btn.danger { background: #dc2626; box-shadow: none; }

/* hero */
.hero { position: relative; min-height: 88vh; display: grid; align-items: center; overflow: hidden; padding: 80px 0; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: 0; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--primary) 55%, transparent), transparent 55%), radial-gradient(circle at 85% 70%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 50%), linear-gradient(to bottom, color-mix(in srgb, var(--bg) 40%, transparent), var(--bg)); animation: drift 14s ease-in-out infinite alternate; }
.hero::after { content: ''; position: absolute; inset: 0; z-index: 1; opacity: .12; background-image: linear-gradient(var(--text) 1px, transparent 1px), linear-gradient(90deg, var(--text) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, #000, transparent 85%); }
@keyframes drift { from { transform: scale(1) translateY(0); } to { transform: scale(1.12) translateY(-14px); } }
.hero .container { position: relative; z-index: 2; }
.kicker { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 70%, transparent); font-size: .8rem; font-weight: 600; color: var(--accent); margin-bottom: 20px; }
.kicker::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(1.6); } }
.hero h1 { font-size: clamp(2.2rem, 6.5vw, 4.6rem); line-height: 1.08; max-width: 14ch; margin-bottom: 18px; text-shadow: 0 4px 30px color-mix(in srgb, var(--bg) 70%, transparent); }
.hero p { max-width: 54ch; font-size: 1.1rem; color: var(--muted); margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.stats { display: flex; gap: 40px; margin-top: 54px; flex-wrap: wrap; }
.stats b { display: block; font-family: var(--font-heading); font-size: 1.7rem; color: var(--accent); }
.stats span { color: var(--muted); font-size: .85rem; }

/* filter */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 28px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.chip { padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); font: 600 .85rem var(--font-body); cursor: pointer; transition: all .2s; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; }
.search, .field input, .field select, .field textarea { background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--border); color: var(--text); padding: 10px 16px; border-radius: calc(var(--radius) * .7); font: inherit; width: 100%; }
.search { width: min(260px, 100%); }
.search:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform .3s, box-shadow .3s, border-color .3s; animation: rise .6s both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.card:hover { transform: translateY(-8px); }
.cover { height: 160px; display: grid; place-items: center; font-size: 3.6rem; background-size: cover; background-position: center; position: relative; }
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--surface), transparent 70%); }
.cover span { position: relative; z-index: 1; filter: drop-shadow(0 6px 14px #0008); transition: transform .3s; }
.card:hover .cover span { transform: scale(1.2) rotate(-6deg); }
.badge { position: absolute; z-index: 2; top: 12px; left: 12px; padding: 3px 12px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--border); }
.badge.hot { left: auto; right: 12px; background: var(--grad); color: #fff; border: 0; }
.card-body { padding: 4px 20px 20px; }
.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; justify-content: space-between; margin-top: 14px; font-size: .85rem; font-weight: 600; }
.meta .rate { color: #fbbf24; } .meta .price { color: var(--accent); }

/* card styles */
[data-card="solid"] .card:hover { box-shadow: 0 16px 36px #0006; border-color: var(--primary); }
[data-card="glass"] .card { background: color-mix(in srgb, var(--surface) 45%, transparent); backdrop-filter: blur(18px) saturate(1.4); border-color: color-mix(in srgb, var(--text) 22%, transparent); }
[data-card="glass"] .cover::after { background: linear-gradient(to top, color-mix(in srgb, var(--surface) 55%, transparent), transparent 70%); }
[data-card="glass"] .card:hover { box-shadow: 0 16px 40px color-mix(in srgb, var(--primary) 35%, transparent); }
[data-card="neon"] .card { border-color: color-mix(in srgb, var(--primary) 55%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--primary) 30%, transparent), inset 0 0 18px color-mix(in srgb, var(--primary) 10%, transparent); }
[data-card="neon"] .card:hover { border-color: var(--accent); box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 0 22px color-mix(in srgb, var(--accent) 14%, transparent); }
[data-card="outline"] .card { background: transparent; border: 2px solid var(--primary); }
[data-card="outline"] .card:hover { border-color: var(--accent); box-shadow: 6px 6px 0 var(--accent); transform: translate(-4px, -4px); }
[data-card="outline"] .cover::after { background: linear-gradient(to top, var(--bg), transparent 70%); }

/* news + leaderboard */
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; }
.news-list { display: grid; gap: 16px; }
.news { display: flex; gap: 16px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: border-color .2s, transform .2s; }
.news:hover { border-color: var(--accent); transform: translateX(6px); }
.news .date { min-width: 58px; height: 58px; border-radius: calc(var(--radius) * .6); background: var(--grad); color: #fff; display: grid; place-items: center; text-align: center; font: 700 .72rem/1.2 var(--font-heading); }
.news h3 { font-size: 1rem; margin-bottom: 4px; } .news p { color: var(--muted); font-size: .88rem; }
.board { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 0; }
.row { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.row:last-child { border: 0; }
.row .rank { font: 700 1rem var(--font-heading); color: var(--muted); }
.row:nth-child(1) .rank { color: #fbbf24; } .row:nth-child(2) .rank { color: #cbd5e1; } .row:nth-child(3) .rank { color: #d97706; }
.row .av { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: 10px; border-radius: 50%; background: var(--grad); color: #fff; font-size: .75rem; font-weight: 700; }
.row .score { font-family: var(--font-heading); color: var(--accent); font-size: .9rem; }

.cta { text-align: center; padding: 56px 24px; border-radius: calc(var(--radius) * 1.5); background: var(--grad); color: #fff; }
.cta h2 { font-size: clamp(1.4rem, 4vw, 2.2rem); margin-bottom: 10px; }
.cta .btn { background: #fff; color: #111; margin-top: 18px; box-shadow: none; }
footer { border-top: 1px solid var(--border); padding: 34px 0; color: var(--muted); font-size: .9rem; }
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 16px; background: #000a; backdrop-filter: blur(6px); }
.modal.open { display: grid; }
.dialog { width: min(720px, 100%); max-height: 92vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); animation: rise .35s; position: relative; }
.dialog .cover { height: 220px; font-size: 5.5rem; }
.dialog .body { padding: 8px 28px 28px; }
.dialog .player { width: 100%; height: min(560px, 68vh); border: 1px solid var(--border); border-radius: calc(var(--radius) * .6); background: var(--bg); margin-top: 8px; }
.nameform { display: grid; gap: 12px; margin: 12px 0 4px; }
.nameform input { padding: 12px 14px; border-radius: calc(var(--radius) * .6); border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.dialog .who { color: var(--muted); font-size: .85rem; } .dialog .who a { color: var(--accent); }
#lbtabs { margin-bottom: 12px; } .row.me { background: color-mix(in srgb, var(--primary) 18%, transparent); }
.board .empty { padding: 20px; text-align: center; color: var(--muted); }
.dialog .btn[disabled] { opacity: .5; cursor: not-allowed; }
.dialog h2 { font-size: 1.6rem; margin-bottom: 8px; }
.dialog .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin: 18px 0 22px; }
.dialog .fact { padding: 12px; border: 1px solid var(--border); border-radius: calc(var(--radius) * .6); text-align: center; }
.dialog .fact b { display: block; color: var(--accent); font-family: var(--font-heading); } .dialog .fact small { color: var(--muted); }
.close { position: absolute; top: 12px; right: 12px; z-index: 5; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #000a; color: #fff; font-size: 1.2rem; cursor: pointer; }
.empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 40px; }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s, transform .7s; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  section { padding: 52px 0; }
  .two-col { grid-template-columns: 1fr; }
  .burger { display: block; }
  .nav-links { position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 14px 20px; }
  .hero { min-height: 78vh; }
  .stats { gap: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }

/* logo image */
.logo i img { width: 100%; height: 100%; object-fit: contain; }
.logo i { width: 42px; height: 42px; padding: 5px; }
