:root {
    --bg: #2e1065;
    --panel: rgba(255, 255, 255, .06);
    --panel-strong: rgba(255, 255, 255, .1);
    --border: rgba(255, 255, 255, .12);
    --text: #f8fafc;
    --muted: #c4b5fd;
    --accent: #a78bfa;
    --gold: #fbbf24;
    --ok: #4ade80;
    --err: #f87171;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
}
a { color: inherit; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 24px 16px 48px; }

header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
h1 small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.health { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--ok); }
.dot.error { background: var(--err); }

form.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 14px; margin-bottom: 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.filters input, .filters select {
    font: inherit; color: var(--text); background: rgba(0, 0, 0, .25); border: 1px solid var(--border);
    border-radius: 8px; padding: 7px 9px; min-width: 0;
}
.filters select option { background: #1e0a45; }
.filters .actions { display: flex; align-items: flex-end; gap: 8px; }
button, .btn {
    font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 8px 14px;
    background: var(--accent); color: #1e0a45; font-weight: 600; text-decoration: none; display: inline-block;
}
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); font-weight: 400; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat strong { font-size: 22px; font-variant-numeric: tabular-nums; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); }
.tabs a.active { background: var(--panel-strong); color: var(--text); font-weight: 600; }
.refresh { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 14px; text-align: left; white-space: nowrap; }
th { font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid rgba(255, 255, 255, .05); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .04); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.game { display: flex; align-items: center; gap: 10px; }
.game img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: var(--panel-strong); flex: none; }
.game div { display: flex; flex-direction: column; }
.game small, .sub { font-size: 12px; color: var(--muted); }
.x { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--panel-strong); font-weight: 600; }
.x.big { background: rgba(167, 139, 250, .3); }
.x.huge { background: rgba(251, 191, 36, .25); color: var(--gold); }
.empty { padding: 40px 14px; text-align: center; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

aside { display: flex; flex-direction: column; gap: 20px; }
aside h2 { margin: 0; font-size: 14px; }
.bars { list-style: none; margin: 0; padding: 8px 14px 12px; }
.bars li { padding: 6px 0; }
.bars .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.bars .row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .row span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.bar { height: 4px; margin-top: 4px; border-radius: 2px; background: var(--accent); opacity: .7; }
.health-list .err { color: var(--err); font-size: 12px; white-space: normal; }
.dot.paused { background: transparent; border: 1px solid var(--muted); }
tr.win-row { cursor: pointer; }
tr.win-row[aria-expanded="true"] { background: rgba(255, 255, 255, .07); }
tr.detail-row > td { padding: 0; white-space: normal; background: rgba(0, 0, 0, .18); }
.detail { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; padding: 16px; }
@media (max-width: 760px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.detail-media { display: flex; flex-direction: column; gap: 10px; }
.detail .hero { width: 100%; border-radius: 10px; background: var(--panel-strong); }
.detail .hero.none { aspect-ratio: 1; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.variant { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.variant img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--panel-strong); }
.variant .formats a { margin-right: 4px; }
.detail-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 24px; align-content: start; }
.detail h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.detail dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; margin: 0; font-size: 13px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.detail .missing { color: rgba(255, 255, 255, .3); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tags span { padding: 2px 7px; border-radius: 6px; background: var(--panel-strong); font-size: 11px; }
.detail .raw { grid-column: 1 / -1; }
.detail .raw summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.detail .raw pre { max-height: 360px; overflow: auto; padding: 12px; border-radius: 8px; background: rgba(0, 0, 0, .3); font-size: 12px; }
.detail-empty { padding: 16px; color: var(--muted); }
footer { margin-top: 24px; font-size: 12px; color: var(--muted); }
.chip.live { cursor: pointer; }
.chip.live input { margin: 0; accent-color: var(--ok); }
#updated { color: var(--muted); font-variant-numeric: tabular-nums; }
html.js .filters .apply { display: none; }
#results { transition: opacity .15s; }
#results.loading { opacity: .55; pointer-events: none; }
.cron-cmd { display: block; margin-top: 4px; padding: 6px 8px; border-radius: 6px; background: rgba(0, 0, 0, .3); font-size: 11px; overflow-wrap: anywhere; white-space: normal; }
