:root{
  color-scheme:dark;
  --bg:#09070d;
  --panel:#14101c;
  --panel2:#1c1527;
  --line:#30243f;
  --text:#f6f1fb;
  --muted:#a99bb7;
  --pink:#f15bb5;
  --purple:#9b5de5;
  --danger:#ef476f;
  --ok:#5de0a5;
}
*{box-sizing:border-box}
html,body{margin:0;background:radial-gradient(circle at 20% 0,#241235 0,#0a0710 36%,#07050a 100%);color:var(--text);font:14px/1.45 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-height:100%}
button,input{font:inherit}
button{cursor:pointer}
button:disabled{opacity:.4;cursor:not-allowed}
.brand{font-size:11px;font-weight:900;letter-spacing:.22em;color:var(--pink)}
h1,h2,h3,p{margin-top:0}
.topbar{position:sticky;top:0;z-index:20;display:flex;justify-content:space-between;gap:20px;align-items:center;padding:18px 28px;background:rgba(9,7,13,.88);backdrop-filter:blur(18px);border-bottom:1px solid var(--line)}
.topbar h1{margin:3px 0 2px;font-size:24px}
.topbar p,.character-head p{margin:0;color:var(--muted)}
.top-actions,.dialog-actions,.slot-actions,.chips{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
button{border:1px solid transparent;border-radius:10px;padding:9px 12px;color:white;background:var(--panel2)}
button.primary{background:linear-gradient(135deg,var(--purple),var(--pink));font-weight:800}
button.ghost{border-color:var(--line);background:#15101c}
button.danger{background:#40121f;border-color:#79243d;color:#ffb8c8}
button.danger-outline{background:transparent;border-color:#693144;color:#ff9cb3}
button.small{padding:5px 8px;font-size:12px}
.stats{max-width:1500px;margin:22px auto 0;padding:0 24px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.stats>div{padding:15px 18px;border:1px solid var(--line);background:rgba(20,16,28,.82);border-radius:14px}
.stats b{display:block;font-size:22px}.stats span{color:var(--muted);font-size:12px}
.toolbar{max-width:1500px;margin:12px auto;padding:0 24px;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.toolbar input,.login-card input,dialog input{border:1px solid var(--line);background:#0d0912;color:white;padding:11px 13px;border-radius:10px;outline:none}
.toolbar input{min-width:260px;flex:1}
.toolbar input:focus,.login-card input:focus,dialog input:focus{border-color:var(--purple);box-shadow:0 0 0 3px rgba(155,93,229,.12)}
.chip.active{border-color:var(--pink);color:#ffd8ef}
.live-dot{margin-left:auto;color:var(--muted);font-size:12px}
.swap-banner{max-width:1452px;margin:12px auto;padding:12px 16px;border:1px solid #68458e;background:#261938;border-radius:12px;display:flex;align-items:center;justify-content:space-between}
.characters{max-width:1500px;margin:0 auto;padding:0 24px 60px}
.character-card{margin:16px 0 24px;padding:18px;border:1px solid var(--line);border-radius:18px;background:rgba(20,16,28,.88);box-shadow:0 20px 50px rgba(0,0,0,.18)}
.character-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.character-head h2{margin:0 0 4px}
.count-pill{padding:6px 10px;border-radius:999px;background:#271a34;color:#e9d9f7;font-weight:800}
.slot-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.slot-card{min-width:0;border:1px solid var(--line);border-radius:14px;background:#0e0a13;overflow:hidden}
.slot-card.selected{outline:2px solid var(--pink);box-shadow:0 0 0 4px rgba(241,91,181,.13)}
.slot-top,.slot-meta,.slot-actions{padding:9px 10px}.slot-top{display:flex;justify-content:space-between;gap:6px;align-items:center}
.status{font-size:10px;color:#c4b6cf;text-transform:uppercase;letter-spacing:.08em}.status.ok{color:var(--ok)}
.image-wrap{aspect-ratio:3/4;background:#0a080d;border-top:1px solid #221a2c;border-bottom:1px solid #221a2c}
.image-wrap img{width:100%;height:100%;display:block;object-fit:cover}
.placeholder{height:100%;display:grid;place-items:center;color:#756881;background:linear-gradient(145deg,#0e0a13,#171020)}
.slot-meta{min-height:64px}.slot-meta span{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.slot-meta small{display:block;color:var(--muted);margin-top:4px}
.slot-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.login-wrap{min-height:100vh;display:grid;place-items:center;padding:24px}
.login-card{width:min(420px,100%);padding:28px;border:1px solid var(--line);border-radius:20px;background:rgba(20,16,28,.92);box-shadow:0 28px 80px rgba(0,0,0,.45)}
.login-card h1{margin:5px 0 4px}.login-card p{color:var(--muted)}
.login-card form{display:grid;gap:10px;margin-top:22px}.login-card label{color:#d6c9df;font-weight:700}.login-card .lang{margin-top:12px}
.alert{padding:10px 12px;border-radius:10px;margin-top:14px}.alert.error{background:#38121d;color:#ffb5c5;border:1px solid #662238}
dialog{border:1px solid var(--line);border-radius:16px;background:#171020;color:white;padding:22px;min-width:min(420px,90vw)}
dialog::backdrop{background:rgba(0,0,0,.7)}
dialog form{display:grid;gap:14px}
.toast{position:fixed;right:22px;bottom:22px;max-width:440px;z-index:50;padding:12px 15px;border-radius:12px;background:#18211c;color:#bdf5d5;border:1px solid #2a6949;opacity:0;transform:translateY(10px);pointer-events:none;transition:.18s}
.toast.show{opacity:1;transform:none}.toast.error{background:#34121b;color:#ffb8c8;border-color:#713048}
.empty-page{padding:60px;text-align:center;color:var(--muted)}
@media(max-width:1100px){.slot-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:760px){.topbar{position:static;align-items:flex-start;flex-direction:column}.stats{grid-template-columns:repeat(2,1fr)}.slot-grid{grid-template-columns:repeat(2,1fr)}.live-dot{margin-left:0}}
@media(max-width:480px){.slot-grid{grid-template-columns:1fr}.stats{grid-template-columns:1fr}.topbar,.characters,.toolbar,.stats{padding-left:14px;padding-right:14px}.character-card{padding:12px}}
