:root {
  --accent: #38bdf8;
  --accent2: #a78bfa;
  --text: #eef6ff;
  --muted: #94a3b8;
  --bg: #030712;
  --panel: rgba(12, 18, 36, 0.82);
  --focus: #fde047;
  font-family: "Segoe UI", Trebuchet MS, sans-serif;
}
html[data-theme="judgment"] { --accent:#f97316; --accent2:#fde047; --text:#fff7ed; --bg:#1a120e; --panel:rgba(40,22,12,.82); }
html[data-theme="samurai"] { --accent:#d4af37; --accent2:#b91c1c; --text:#f5f0e6; --bg:#161018; }
html[data-theme="neon"] { --accent:#22d3ee; --accent2:#e879f9; --text:#fdf4ff; --bg:#10081c; }
html[data-theme="atlantis"] { --accent:#2dd4bf; --accent2:#38bdf8; --text:#ecfeff; --bg:#0c2830; }
html[data-theme="vampire"] { --accent:#e11d48; --accent2:#fecdd3; --text:#fff1f2; --bg:#1a0a10; }
html[data-theme="solarpunk"] { --accent:#2dd4bf; --accent2:#facc15; --text:#ecfdf5; --bg:#0f2820; }
html[data-theme="vice"] { --accent:#f472b6; --accent2:#22d3ee; --text:#fff7ed; --bg:#2a0c36; }
html[data-theme="jamaica"] { --accent:#22c55e; --accent2:#fbbf24; --text:#fffbeb; --bg:#0e1c12; }
html[data-theme="gta6"] { --accent:#ff6b9d; --accent2:#00e5cc; --text:#fff1f2; --bg:#1a1020; }
html[data-theme="knockout"] { --accent:#ef4444; --accent2:#3b82f6; --text:#fff1f2; --bg:#0c0a10; }
html[data-theme="classic"] { --accent:#fbbf24; --accent2:#9333ea; --text:#f8fafc; --bg:#141018; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
.hidden { display: none !important; }
.screen { height: 100%; }
.muted { color: var(--muted); }
.eyebrow { letter-spacing: .16em; text-transform: uppercase; font-size: 14px; color: var(--accent); }
.err { color: #fb7185; }

.boot-card {
  width: min(920px, 86vw);
  margin: 10vh auto;
  padding: 40px 48px;
  background: var(--panel);
  border: 2px solid transparent;
  border-radius: 22px;
}
.boot-card:focus, .boot-card:focus-within { border-color: var(--focus); }
label { display: block; margin: 16px 0 8px; font-size: 18px; }
input, select {
  width: 100%;
  font-size: 26px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid #334155;
  background: #0b1220;
  color: var(--text);
}
input:focus, select:focus, button:focus, [data-focus].is-focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.btn {
  font-size: 22px;
  padding: 14px 22px;
  border-radius: 14px;
  border: 0;
  background: #1e293b;
  color: var(--text);
  cursor: pointer;
}
.btn.primary { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #081018; font-weight: 700; }
.btn.ghost { background: transparent; border: 2px solid #475569; }

.top {
  display: flex; align-items: center; gap: 24px;
  padding: 18px 32px 8px;
}
.brand { font-size: 28px; font-weight: 800; color: var(--accent); }
.tabs { display: flex; gap: 10px; flex: 1; }
.tabs button {
  font-size: 22px; padding: 10px 18px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted);
}
.tabs button.on { background: #1e293b; color: var(--text); }
.clock { font-size: 22px; color: var(--muted); }

.view { display: none; height: calc(100% - 78px); overflow: auto; padding: 8px 32px 40px; }
.view.on { display: block; }
h2 { font-size: 26px; margin: 18px 0 10px; }
.shelf, .grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 240px;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.grid { grid-auto-flow: dense; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); overflow: visible; }
.card {
  background: var(--panel);
  border-radius: 16px;
  overflow: hidden;
  min-height: 210px;
  border: 2px solid transparent;
}
.card.is-focus, .card:focus { border-color: var(--focus); transform: scale(1.04); }
.card img { width: 100%; height: 128px; object-fit: cover; background: #111; display: block; }
.card b, .card span { display: block; padding: 8px 12px 0; font-size: 18px; }
.card span { color: var(--muted); font-size: 14px; padding-bottom: 12px; }

.search-row { display: flex; gap: 12px; margin: 12px 0 20px; }
.search-row input { flex: 1; }
.list { display: flex; flex-direction: column; gap: 10px; }
.job {
  background: var(--panel); padding: 14px 18px; border-radius: 12px; font-size: 20px;
}
.theme-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch {
  width: 160px; height: 72px; border-radius: 14px; border: 3px solid transparent;
  color: #fff; font-weight: 700; font-size: 18px;
}
.swatch.is-focus { border-color: var(--focus); }
.pair-code { font-size: 64px; letter-spacing: .28em; font-weight: 800; margin: 8px 0; }
.settings section { margin-bottom: 28px; max-width: 880px; }
.check { display: flex; align-items: center; gap: 12px; font-size: 22px; }
.check input { width: auto; }

.player {
  position: fixed; inset: 0; background: #000; z-index: 20;
}
#yt-host, #html-video { width: 100%; height: calc(100% - 110px); background: #000; }
#html-video { object-fit: contain; }
#html-audio { display: none; }
.player-bar {
  height: 110px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: linear-gradient(180deg, transparent, #000);
}
#toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #111827; padding: 14px 22px; border-radius: 999px; z-index: 40; font-size: 22px;
}
#sleep-veil {
  position: fixed; inset: 0; background: #000; color: #fff; z-index: 50;
  display: grid; place-items: center; font-size: 42px;
}
#sleep-veil.hidden { display: none !important; }
