/* StreamerList — flat, blocky, purple */
:root {
  --bg: #0e0e10;
  --panel: #18181b;
  --panel-2: #1f1f23;
  --line: #2f2f35;
  --line-hi: #53535f;
  --text: #efeff1;
  --muted: #adadb8;
  --dim: #7a7a85;
  --purple: #9147ff;
  --purple-hi: #a970ff;
  --purple-lo: #26193f;
  --green: #2ee66b;
  --red: #ff4f5e;
  --amber: #ffb000;
  --melt: #ff2d78;
  --rumble: #85c742;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --black: "Archivo Black", "Archivo", Impact, "Arial Black", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 500 14px/1.45 var(--font); }
main { flex: 1; width: 100%; }
a { color: inherit; text-decoration: none; }
p a, .note a, .muted a { color: var(--purple-hi); }
p a:hover, .note a:hover, .muted a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
code { background: var(--panel-2); border: 1px solid var(--line); padding: 1px 5px; font-size: .9em; }
:focus-visible { outline: 2px solid var(--purple-hi); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--purple); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.num { font-variant-numeric: tabular-nums; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
@media (max-width: 600px) { .container { padding-left: 10px; padding-right: 10px; } }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 14px; height: 54px; }
.home-link { font: 400 16px var(--black); white-space: nowrap; flex: none; }
.home-link:hover { color: var(--purple-hi); }
.search { position: relative; flex: 1; max-width: 420px; margin: 0; }
.search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.search input { width: 100%; height: 36px; padding: 0 10px 0 34px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 500 14px var(--font); outline: none; }
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: var(--purple); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.nav form { margin: 0; }
@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; gap: 8px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .is-home { flex-wrap: nowrap; }
  .is-home .search { order: 0; flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 520px) {
  .nav .hide-sm { display: none; }
  .is-home .nav .btn-primary { display: none; }
  .me { max-width: 110px; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border: 1px solid transparent; background: none; color: var(--text); font: 700 13px var(--font); cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-hi); }
.btn-ghost { border-color: var(--line-hi); }
.btn-ghost:hover { border-color: var(--text); }
.btn-text { color: var(--muted); padding: 0 9px; }
.btn-text:hover { color: var(--text); }
.btn-danger { background: var(--red); color: #1c0306; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-block { width: 100%; height: 40px; }
.btn[disabled] { opacity: .5; cursor: default; }
.me { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Headings ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; padding: 22px 0 16px; }
.hero h1 { margin: 0; font: 400 clamp(22px, 3.5vw, 30px)/1.1 var(--black); }
.hero p { margin: 6px 0 0; color: var(--muted); }
.h-page { margin: 0 0 16px; font: 400 21px/1.15 var(--black); }
.h-sec { margin: 0 0 12px; font: 700 13px var(--font); color: var(--muted); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: space-between; gap: 8px; padding: 16px 0 12px; }
.tabs, .pf { display: flex; border: 1px solid var(--line); max-width: 100%; }
.tabs a, .pf a { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 13px; font: 700 13px var(--font); color: var(--muted); white-space: nowrap; border-left: 1px solid var(--line); }
.tabs a:first-child, .pf a:first-child { border-left: 0; }
.tabs a:hover, .pf a:hover { color: var(--text); background: var(--panel); }
.tabs a.on, .pf a.on { background: var(--purple); color: #fff; }
.pf a { min-width: 44px; padding: 0 12px; }
.pf a.on { background: var(--purple-lo); box-shadow: inset 0 -2px 0 var(--purple); color: var(--text); }
.pf .pi.has-img { height: 16px; }
@media (max-width: 560px) {
  .tabs { width: 100%; }
  .tabs a { flex: 1; padding: 0 4px; font-size: 12.5px; }
  .pf { width: 100%; }
  .pf a { flex: 1; }
}

/* ---------- Platform icons ---------- */
.icons { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.pi { display: inline-flex; align-items: center; flex: none; }
.pi.has-img { height: 13px; }
.pi.has-img img { height: 100%; width: auto; max-width: none; }
.pi.as-text { font: 700 11px var(--font); color: var(--rumble); }
a.pi:hover { opacity: .75; }
.icons.lg { gap: 8px; }
.icons.lg .pi.has-img { height: 20px; }
.icons.lg .pi.as-text { font-size: 13px; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--panel); border: 1px solid var(--line); }
.card:hover { border-color: var(--purple); }
.pic { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--panel-2); container-type: inline-size; }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gen { position: absolute; inset: 0; display: grid; place-items: center; background: hsl(var(--h), 42%, 30%); }
.gen span { font: 400 clamp(26px, 28cqi, 60px)/1 var(--black); color: rgba(255, 255, 255, .9); }
.rank { position: absolute; left: 0; top: 0; z-index: 1; padding: 4px 7px; background: #000; color: #fff; font: 400 12px/1 var(--black); font-variant-numeric: tabular-nums; }
.rank.top { background: var(--purple); }
.mv { position: absolute; right: 0; top: 0; z-index: 1; padding: 4px 6px; font: 700 11px/1 var(--font); font-variant-numeric: tabular-nums; }
.mv.up { background: var(--green); color: #031a0a; }
.mv.down { background: var(--red); color: #1c0306; }
.mv.new { background: var(--text); color: #000; }
.info { padding: 8px 8px 8px 10px; display: grid; gap: 6px; border-top: 1px solid var(--line); }
.nm { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nm .n { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nm .n:hover { color: var(--purple-hi); }
.sc { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.lk b { font: 400 17px/1 var(--black); font-variant-numeric: tabular-nums; }

/* ---------- Vote buttons ---------- */
.vt { display: flex; gap: 3px; margin: 0; flex: none; }
.vb { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 28px; height: 26px; padding: 0; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: 700 14px var(--font); cursor: pointer; }
.vb svg { width: 13px; height: 13px; flex: none; }
.vb.up:hover { color: var(--green); border-color: var(--green); }
.vb.down:hover { color: var(--red); border-color: var(--red); }
.vb.up.on { background: var(--green); border-color: var(--green); color: #031a0a; }
.vb.down.on { background: var(--red); border-color: var(--red); color: #1c0306; }
.vt.busy .vb { opacity: .5; pointer-events: none; }
.vt.lg { gap: 6px; margin-top: 14px; }
.vt.lg .vb { width: auto; flex: 1; height: 42px; }
.vt.lg .vb svg { width: 16px; height: 16px; }

/* ---------- Likeness colors ---------- */
.z-good { color: var(--green); }
.z-warn { color: var(--amber); }
.z-bad { color: var(--red); }
.z-melt { color: var(--melt); }

/* ---------- Empty, pager, flash ---------- */
.empty-state { text-align: center; padding: 44px 20px; border: 1px dashed var(--line-hi); margin-top: 16px; }
.empty-state h2 { margin: 0 0 14px; font: 400 18px var(--black); }
.empty-state p { margin: 0 0 14px; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 20px 0 6px; }
.flash { margin: 14px 0; padding: 10px 12px; font-weight: 700; font-size: 13.5px; }
.flash.ok { background: var(--green); color: #031a0a; }
.flash.err { background: var(--red); color: #1c0306; }

/* ---------- Panels & forms ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); padding: 16px; min-width: 0; }
.narrow { max-width: 380px; margin: 36px auto; }
.form { display: grid; gap: 14px; margin: 0; }
.form label { display: grid; gap: 6px; align-content: start; font-weight: 700; font-size: 13px; color: var(--muted); }
.form small { font-weight: 500; color: var(--dim); font-size: 12px; }
.form input, .form select, .form textarea, .input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 500 14px var(--font); outline: none; }
.form input[type=file] { height: auto; padding: 8px; }
.form input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--purple); }
.form input[type=range] { height: 20px; padding: 0; border: 0; background: none; accent-color: var(--purple); }
.form input:focus, .form select:focus, .input:focus { border-color: var(--purple); }
.form .check { display: flex; align-items: center; gap: 8px; }
input[type=file]::file-selector-button { margin-right: 10px; height: 30px; padding: 0 12px; border: 0; background: var(--purple); color: #fff; font: 700 12.5px var(--font); cursor: pointer; }
.hp { position: absolute !important; left: -9999px !important; height: 1px; overflow: hidden; }
.auth .center { margin: 16px 0 0; }

/* ---------- Streamer page ---------- */
.back { display: inline-block; margin-top: 16px; color: var(--muted); font-weight: 700; font-size: 13px; }
.back:hover { color: var(--text); }
.profile { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; padding: 12px 0 20px; }
@media (max-width: 760px) { .profile { grid-template-columns: minmax(0, 1fr); gap: 14px; } .p-pic { max-width: 180px; } }
.p-pic { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); container-type: inline-size; }
.p-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-pic .rank { font-size: 15px; padding: 6px 9px; }
.pic-edit { position: absolute; right: 0; bottom: 0; z-index: 1; padding: 5px 8px; background: rgba(0, 0, 0, .8); color: #fff; font-weight: 700; font-size: 12px; }
.pic-edit:hover { background: var(--purple); }
.p-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.p-title h1 { margin: 0; font: 400 clamp(24px, 4vw, 36px)/1.05 var(--black); overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 0; padding: 0; list-style: none; }
.tags li, .tag { display: inline-block; padding: 3px 7px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.tag.warn { color: var(--amber); border-color: var(--amber); }
.tag.bad { color: var(--red); border-color: var(--red); }
.tag.good { color: var(--green); border-color: var(--green); }
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0 0; border: 1px solid var(--line); }
.stat { padding: 11px 13px; min-width: 0; border-left: 1px solid var(--line); background: var(--panel); }
.stat:first-child { border-left: 0; }
.stat > span { display: block; font-weight: 600; font-size: 12px; color: var(--dim); }
.stat b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font: 400 26px/1 var(--black); font-variant-numeric: tabular-nums; }
.stat b .mvs { font: 700 12px/1 var(--font); padding: 4px 6px; }
.mvs.up { background: var(--green); color: #031a0a; }
.mvs.down { background: var(--red); color: #1c0306; }
.mvs.new { background: var(--text); color: #000; }
.stat b .w { display: inline-flex; align-items: center; gap: 5px; }
.stat b .w svg { width: 14px; height: 14px; }
@media (max-width: 520px) { .stat { padding: 9px 10px; } .stat b { font-size: 20px; gap: 6px; } .stat b .w svg { width: 12px; height: 12px; } }
.meter { position: relative; margin: 20px 0 0; }
.m-track { display: flex; gap: 2px; height: 10px; }
.m-track i { display: block; height: 100%; }
.m-track .m1 { flex: 500; background: #5a1030; }
.m-track .m2 { flex: 500; background: #5c1a22; }
.m-track .m3 { flex: 60; background: #6b4a00; }
.m-track .m4 { flex: 30; background: #145c2e; }
.m-track .m5 { flex: 10; background: var(--green); }
.m-mark { position: absolute; top: -5px; width: 5px; height: 20px; margin-left: -2.5px; background: #fff; box-shadow: 0 0 0 2px var(--bg); }
.m-scale { position: relative; height: 15px; margin-top: 6px; font: 600 11px var(--font); color: var(--dim); font-variant-numeric: tabular-nums; }
.m-scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.m-scale span:first-child { transform: none; }
.m-scale span:last-child { transform: translateX(-100%); }
.note { margin: 8px 0 0; color: var(--dim); font-size: 12.5px; }
.two { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; margin-bottom: 24px; align-items: start; }
@media (max-width: 760px) { .two { grid-template-columns: minmax(0, 1fr); } }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--dim); font: 600 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .g { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 3 5; opacity: .6; }
.chart .area { fill: rgba(145, 71, 255, .14); }
.chart .line { fill: none; stroke: var(--purple-hi); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--purple-hi); stroke: var(--panel); stroke-width: 3; }
.chart .end { fill: var(--text); font-size: 13px; font-weight: 700; }
@media (max-width: 600px) { .chart text { font-size: 18px; } .chart .end { font-size: 20px; } }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed li > span { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
.feed li > span b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.feed .ico { width: 20px; height: 20px; display: grid; place-items: center; flex: none; }
.feed .ico svg { width: 12px; height: 12px; }
.feed .ico.up { background: var(--green); color: #031a0a; }
.feed .ico.down { background: var(--red); color: #1c0306; }
.feed time { color: var(--dim); font-size: 12px; white-space: nowrap; }
.admin-link { margin: -4px 0 24px; }

/* ---------- How it works ---------- */
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 28px; }
@media (max-width: 900px) { .how { grid-template-columns: minmax(0, 1fr); } }
.how p { margin: 0 0 10px; color: var(--muted); }
.zones { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; font: 400 13px var(--black); }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 30px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px; padding-top: 16px; padding-bottom: 20px; color: var(--dim); font-size: 12.5px; }
.foot nav { display: flex; gap: 16px; }
.foot a { font-weight: 600; }
.foot a:hover { color: var(--text); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; max-width: min(92vw, 420px); padding: 10px 16px; background: var(--text); color: #000; font-weight: 700; font-size: 13.5px; text-align: center; }

/* ---------- Admin ---------- */
.admin-nav { display: flex; flex-wrap: wrap; margin: 20px 0 14px; border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.admin-nav a { padding: 8px 12px; font-weight: 700; font-size: 13px; color: var(--muted); border-left: 1px solid var(--line); }
.admin-nav a:first-child { border-left: 0; }
.admin-nav a:hover { color: var(--text); background: var(--panel); }
.admin-nav a.on { background: var(--purple); color: #fff; }
.admin-nav .count { display: inline-block; min-width: 18px; margin-left: 5px; padding: 1px 5px; background: var(--red); color: #fff; font-size: 11px; text-align: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; border: 1px solid var(--line); }
.kpis .stat em { font-style: normal; font-size: 12px; color: var(--muted); display: block; margin-top: 5px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }
table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.list th { text-align: left; font-weight: 600; font-size: 12px; color: var(--dim); padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
table.list td { padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: var(--panel-2); }
.thumb { width: 38px; height: 38px; overflow: hidden; position: relative; display: block; background: var(--panel-2); flex: none; container-type: inline-size; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .gen span { font-size: 13px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { font-weight: 700; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.row-actions form { margin: 0; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.bar .input { max-width: 300px; height: 34px; }
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; align-items: start; }
.edit-grid .panel { display: grid; gap: 14px; align-content: start; }
@media (max-width: 860px) { .edit-grid { grid-template-columns: minmax(0, 1fr); } }
.form .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .form .cols { grid-template-columns: minmax(0, 1fr); } }
.plat-label { display: inline-flex; align-items: center; gap: 6px; }
.plat-label .pi.has-img { height: 14px; }
.img-preview { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); container-type: inline-size; }
.img-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-preview.crop { cursor: grab; touch-action: none; border-color: var(--purple); }
.img-preview.crop.dragging { cursor: grabbing; }
.img-preview.crop img { pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.crop-tools { display: flex; align-items: center; gap: 10px; }
.crop-tools input[type=range] { flex: 1; min-width: 0; }
.drop { border: 2px dashed var(--line-hi); padding: 20px; text-align: center; background: var(--bg); }
.drop.over { border-color: var(--purple); background: var(--purple-lo); }
.drop p { margin: 5px 0 12px; color: var(--muted); }
.drop input[type=file] { color: var(--muted); font: 500 13px var(--font); max-width: 100%; }
.ph-list { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line); }
.ph-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto minmax(200px, 340px); gap: 10px; align-items: center; padding: 6px 8px; border-top: 1px solid var(--line); background: var(--bg); }
.ph-row:first-child { border-top: 0; }
.ph-name { min-width: 0; }
.ph-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-name code { font-size: 11.5px; }
.ph-form { display: flex; gap: 4px; margin: 0; min-width: 0; }
.ph-form .input { height: 28px; font-size: 13px; min-width: 0; flex: 1; padding: 0 8px; }
.ph-row.done { background: #0f2417; }
.ph-row.done .ph-form .btn { background: var(--green); color: #031a0a; }
@media (max-width: 720px) { .ph-row { grid-template-columns: 38px minmax(0, 1fr) auto; } .ph-form { grid-column: 1 / -1; } }
.results { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13.5px; }
.danger-zone { border-color: var(--red); margin-top: 10px; }
.card .pi.as-text { display: none; }
