:root {
  --bg: #0b0b0f;
  --panel: #15151c;
  --panel2: #1d1d27;
  --line: #2a2a36;
  --text: #f2f2f5;
  --muted: #9a9aab;
  --accent: #ff3b5c;
  --accent2: #ffb020;
  --ok: #2fd08a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent2); }
button, .btn {
  font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 10px 18px;
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { border-color: #444457; }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.small { padding: 6px 12px; font-size: 14px; }
.danger { color: #ff7a8f; }
input, select {
  font: inherit; background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: rgba(11,11,15,.9); position: sticky; top: 0; z-index: 5;
}
.logo { font-weight: 900; letter-spacing: .14em; font-size: 20px; cursor: pointer; }
.logo span { color: var(--accent); }
.me { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel2); object-fit: cover; flex: none; }
main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
.hero { text-align: center; padding: 40px 0 20px; }
.hero h1 { font-size: clamp(40px, 8vw, 84px); margin: 0; letter-spacing: .08em; font-weight: 900; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); font-size: 20px; margin: 8px 0 28px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2, .card h3 { margin: 0 0 12px; font-size: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.code { font-family: ui-monospace, monospace; font-size: 28px; letter-spacing: .25em; font-weight: 800; color: var(--accent2); }
.players { display: flex; flex-wrap: wrap; gap: 10px; }
.player { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 14px; }
.player.offline { opacity: .45; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.tag.host { background: var(--accent2); color: #111; }
.tag.done { background: var(--ok); color: #062; }
.tag.failed { background: #5a1a25; color: #ffb3c0; }
.scenes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.scene { background: var(--panel2); border: 2px solid transparent; border-radius: 12px; overflow: hidden; cursor: pointer; }
.scene.sel { border-color: var(--accent); }
.scene img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #000; }
.scene div { padding: 8px 10px; font-size: 14px; }
.stage { background: #000; border-radius: var(--radius); overflow: hidden; position: relative; }
.stage video { width: 100%; display: block; max-height: 70vh; background: #000; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); font-size: 96px; font-weight: 900; }
.rec { position: absolute; top: 14px; left: 14px; background: var(--accent); color: #fff; font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: 14px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .5; } }
.label { position: absolute; top: 14px; left: 14px; background: rgba(0,0,0,.7); padding: 4px 12px; border-radius: 999px; font-weight: 700; }
.timer { font-variant-numeric: tabular-nums; color: var(--accent2); font-weight: 700; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.rank { width: 28px; color: var(--muted); font-weight: 700; text-align: right; }
.grow { flex: 1; min-width: 0; }
.pts { font-weight: 800; color: var(--accent2); }
.votegrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-top: 14px; }
.votegrid button.sel { background: var(--accent); border-color: var(--accent); }
.result { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 12px; border-radius: 12px; background: var(--panel2); margin-bottom: 10px; }
.result.win { outline: 2px solid var(--accent2); }
.result video { width: 260px; max-width: 100%; border-radius: 8px; background: #000; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; z-index: 50; max-width: 90vw; }
.toast.err { border-color: var(--accent); }
.hidden { display: none !important; }
.notice { background: #2a2110; border: 1px solid #5a4416; color: #ffd98a; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
