:root {
  --bg: #0d0b14;
  --bg2: #15121f;
  --panel: #1b1727;
  --line: #2c2640;
  --text: #f1edf8;
  --muted: #a39cb8;
  --hot: #ff3d8b;
  --hot2: #ff9a3d;
  --teal: #2fe0c8;
  --ok: #2fd17a;
  --warn: #ffb02e;
  --danger: #ff5a5a;
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(900px 500px at 85% -10%, rgba(255,61,139,.16), transparent 60%),
              radial-gradient(700px 400px at -10% 10%, rgba(47,224,200,.10), transparent 60%); }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .9em; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.wrap { width: min(1200px, 100% - 32px); margin: 0 auto; }
.main { padding: 22px 0 60px; min-height: 70vh; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.narrow { max-width: 720px; margin: 0 auto; }
.grad { background: linear-gradient(90deg, var(--hot), var(--hot2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Header */
.announce { background: linear-gradient(90deg, var(--hot), var(--hot2)); color: #12091a; text-align: center; font-weight: 700; padding: 7px 12px; font-size: .92rem; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(13,11,20,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 800; font-size: 1.2rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--hot), var(--hot2)); color: #12091a; font-size: .9rem; font-weight: 900; letter-spacing: -.04em; }
.brand-name b { color: var(--hot); }
.brand.small { font-size: 1rem; }
.top-search { flex: 1; max-width: 420px; }
.top-search input { width: 100%; }
.top-nav { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.top-nav > a:not(.btn) { color: var(--muted); font-weight: 600; font-size: .95rem; }
.top-nav > a.on, .top-nav > a:not(.btn):hover { color: var(--text); text-decoration: none; }
.admin-link { color: var(--warn) !important; }
.me-chip { display: flex; align-items: center; gap: 7px; color: var(--text) !important; }
.tier-dot { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 99px; background: linear-gradient(135deg, var(--teal), #6b8cff); color: #071216; font-weight: 800; font-size: .8rem; }

/* Forms & buttons */
input, select, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; outline: none; max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--hot); padding: 0; }
input[type=file] { padding: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; cursor: pointer; white-space: nowrap; color: var(--text); background: var(--panel); }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-hot { background: linear-gradient(135deg, var(--hot), var(--hot2)); color: #12091a; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ok { background: var(--ok); color: #05210f; }
.btn-danger { background: transparent; border-color: rgba(255,90,90,.5); color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: .88rem; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 1.05rem; }
.form { display: grid; gap: 16px; }
.form.wide { max-width: none; }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form label.check, label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.help { font-weight: 400; color: var(--muted); font-size: .85rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.preview { max-height: 260px; border-radius: 10px; margin-top: 8px; object-fit: contain; }
.inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.grow { flex: 1; min-width: 160px; }

/* Flash & boxes */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid var(--line); background: var(--panel); }
.flash-ok { border-color: rgba(47,209,122,.5); }
.flash-warn { border-color: rgba(255,176,46,.6); }
.note { background: var(--panel); border-left: 3px solid var(--warn); padding: 8px 12px; border-radius: 6px; }
.empty { text-align: center; padding: 40px 16px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.status-box { padding: 14px 16px; border-radius: 10px; margin-bottom: 18px; background: var(--panel); border: 1px solid var(--line); }
.status-pending { border-color: rgba(255,176,46,.6); }
.status-rejected, .status-hidden { border-color: rgba(255,90,90,.6); }
.status-duplicate { border-color: rgba(47,224,200,.5); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; padding: 18px 0 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--teal); font-weight: 700; margin-bottom: 8px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.05; }
.lead { font-size: 1.08rem; color: #d9d2e8; max-width: 560px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 22px; }
.stats { display: flex; gap: 26px; flex-wrap: wrap; }
.stats div { display: grid; }
.stats b { font-size: 1.6rem; }
.stats span { color: var(--muted); font-size: .85rem; }
.mini-board { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mini-board li { display: flex; align-items: center; gap: 10px; }
.mini-board li a { flex: 1; color: var(--text); font-weight: 600; }
.winners-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .92rem; }
.rank { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--bg2); font-weight: 800; font-size: .85rem; }
.rank.r1 { background: linear-gradient(135deg, #ffd34d, #ff9a3d); color: #201300; }
.rank.r2 { background: #cfd3e0; color: #15161c; }
.rank.r3 { background: #d0895a; color: #1e0f05; }
.tier-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; background: rgba(47,224,200,.12); color: var(--teal); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.tier-pill.big { font-size: .95rem; padding: 4px 12px; }

/* Sections, grid, cards */
.section { margin-top: 38px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); transition: transform .12s ease, border-color .12s ease; }
.card:hover { text-decoration: none; transform: translateY(-2px); border-color: rgba(255,61,139,.55); }
.card-img { position: relative; aspect-ratio: 16 / 10; background: var(--bg2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img.is-spoiler img { filter: blur(22px) saturate(.6); transform: scale(1.1); }
.spoiler-tag { position: absolute; inset: auto auto 10px 10px; background: var(--warn); color: #201300; font-weight: 800; font-size: .72rem; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; }
.cat-tag { position: absolute; top: 10px; left: 10px; background: rgba(13,11,20,.78); padding: 3px 9px; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.card-body { padding: 12px 14px 14px; display: grid; gap: 6px; }
.card-body h3 { margin: 0; font-size: 1rem; }
.counterpart { font-size: .82rem; color: var(--muted); }
.card-meta { display: flex; gap: 10px; align-items: center; font-size: .82rem; flex-wrap: wrap; }
.first { color: var(--hot2); font-weight: 700; }
.score { margin-left: auto; background: var(--bg2); padding: 1px 8px; border-radius: 99px; font-weight: 700; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cat { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--text); font-weight: 600; }
.cat:hover { border-color: var(--teal); text-decoration: none; }
.cat-icon { font-size: 1.3rem; }
.cat-name { flex: 1; }
.cat-n { color: var(--muted); font-size: .85rem; }
.how .steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.how .steps div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.how .steps span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--hot), var(--hot2)); color: #12091a; font-weight: 900; margin-bottom: 8px; }
.how p { color: var(--muted); font-size: .92rem; margin: 0; }

/* Lists, tabs, tables */
.crumbs { color: var(--muted); font-size: .88rem; margin-bottom: 10px; }
.page-head { margin-bottom: 18px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .tabs { margin: 0; }
.tabs a { padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .9rem; }
.tabs a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on:hover { color: var(--bg); }
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg2); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.me-row { background: rgba(255,61,139,.08); }
.warn-row { background: rgba(255,90,90,.07); }
.pager { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.big-search { display: flex; gap: 8px; margin-top: 10px; }
.big-search input { flex: 1; font-size: 1.05rem; }
.st { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--bg2); }
.st-verified { color: var(--ok); }
.st-pending { color: var(--warn); }
.st-rejected, .st-hidden { color: var(--danger); }
.st-duplicate { color: var(--teal); }

/* Discovery page */
.disc { display: grid; grid-template-columns: 1.35fr 1fr; gap: 26px; align-items: start; }
.shot { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg2); }
.shot img { width: 100%; }
.shot.is-spoiler img { filter: blur(28px) saturate(.6); transform: scale(1.08); }
.reveal { position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; padding: 12px 18px; border-radius: 10px; border: 0; background: var(--warn); color: #201300; font: inherit; font-weight: 800; cursor: pointer; }
.spoiler-text.hidden-text { filter: blur(6px); user-select: none; cursor: pointer; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; margin: 0 6px 8px 0; }
.pill-warn { border-color: rgba(255,176,46,.6); color: var(--warn); }
.first-box { background: linear-gradient(135deg, rgba(255,61,139,.14), rgba(255,154,61,.1)); border: 1px solid rgba(255,61,139,.35); border-radius: 12px; padding: 12px 14px; margin: 10px 0 16px; }
.first-label { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 800; color: var(--hot2); }
.first-who { font-size: 1.25rem; font-weight: 800; }
.first-who a { color: var(--text); }
.also { margin-top: 6px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 12px 0; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; font-weight: 600; }
.actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.value-score b { font-size: 1.8rem; }
.value-score span { color: var(--muted); margin-left: 4px; }
.rate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stars { display: inline-flex; gap: 2px; }
.star { background: none; border: 0; font-size: 1.6rem; color: #4a4262; cursor: pointer; padding: 0 2px; line-height: 1; }
.star.on, .stars:hover .star { color: #ffc93d; }
.stars .star:hover ~ .star { color: #4a4262; }
.report { margin-top: 18px; }
.report form { display: grid; gap: 8px; margin-top: 8px; }

/* Profile */
.profile-head { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.avatar { width: 76px; height: 76px; border-radius: 20px; display: grid; place-items: center; font-weight: 900; font-size: 1.6rem; background: linear-gradient(135deg, var(--hot), var(--hot2)); color: #12091a; flex: none; }
.progress { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; max-width: 420px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--hot)); }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { padding: 5px 11px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: .85rem; font-weight: 600; }
.tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tier { display: grid; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.signout { margin-top: 30px; }

/* Prose */
.prose h2 { margin-top: 1.4em; }
.prose li { margin-bottom: .35em; }

/* Admin */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.admin-nav a.on { background: var(--panel); color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { display: grid; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--text); }
.kpi b { font-size: 1.8rem; }
.kpi span { color: var(--muted); font-size: .85rem; }
.kpi.hot { border-color: var(--hot); }
.kpi.warn { border-color: var(--warn); }
.q-item { display: grid; grid-template-columns: 300px 1fr; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.q-shot img { border-radius: 10px; width: 100%; }
.q-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.q-top .pill { margin: 0; }
.q-desc { color: #d9d2e8; }
.q-actions { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.matches { margin-top: 10px; display: grid; gap: 8px; background: var(--bg2); border-radius: 10px; padding: 10px; }
.match { display: flex; gap: 10px; align-items: center; }
.match img { width: 96px; border-radius: 6px; }
.match.stolen { outline: 2px solid var(--danger); border-radius: 8px; padding: 4px; }
.edit-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; }
.edit-grid .panel form { margin-bottom: 8px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.win-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cat-edit { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 8px; }
.err { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 10px 0; }
.err-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.err pre { white-space: pre-wrap; word-break: break-word; font-size: .8rem; max-height: 260px; overflow: auto; margin: 8px 0 0; color: #d9d2e8; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; background: var(--bg2); }
.foot-in { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-nav a { color: var(--muted); }
.disclaimer { margin-top: 18px; font-size: .78rem; color: var(--muted); line-height: 1.5; }

/* Responsive */
@media (max-width: 420px) { .top-nav > a[href='/leaderboard'] { display: none; } .brand-name { font-size: 1.05rem; } }
@media (max-width: 900px) {
  .hero, .disc, .edit-grid, .two-col { grid-template-columns: 1fr; }
  .how .steps { grid-template-columns: 1fr 1fr; }
  .q-item { grid-template-columns: 1fr; }
  .row3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .top-in { gap: 10px; }
  .top-search { display: none; }
  .hide-sm { display: none !important; }
  .top-nav { gap: 10px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .how .steps { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card-body h3 { font-size: .92rem; }
}
/* Fix: keep the top bar on one line at medium screen widths */
.top-nav > a { white-space: nowrap; }
@media (max-width: 1150px) { .top-search { display: none; } }
@media (max-width: 1000px) { .top-nav > a.hide-sm { display: none !important; } }
/* Points always visible next to the player's name */
.pts-chip { padding: 2px 8px; border-radius: 99px; background: rgba(255,154,61,.15); color: var(--hot2); font-size: .8rem; font-weight: 800; white-space: nowrap; }
