/* Nebula — sleek black + violet. No glow-slop, no gradients-for-fun. */
:root {
  --bg: #08080c;
  --bg-soft: #0c0c13;
  --panel: #101018;
  --panel-2: #14141d;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);
  --text: #e7e7ec;
  --muted: #8e8e99;
  --faint: #5b5b66;
  --violet: #7c3aed;
  --violet-hi: #8b5cf6;
  --violet-dim: rgba(124, 58, 237, 0.14);
  --danger: #e5484d;
  --radius: 12px;
  --font-ui: "Outfit", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Outfit", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(900px 480px at 50% -180px, rgba(124, 58, 237, 0.13), transparent 70%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.6; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; height: 56px;
  background: rgba(8, 8, 12, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; user-select: none; }
.mark {
  width: 26px; height: 26px; border-radius: 8px; overflow: hidden;
  background: #14141d;
  display: grid; place-items: center;
}
.logo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand b { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.14em; font-weight: 700; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav button {
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 13px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; font-family: var(--font-ui);
}
.nav button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav button.active { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.clock { margin-left: auto; color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
main { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 28px 20px 90px; }
.view { display: none; }
.view.active { display: block; animation: in 0.22s ease; }
@keyframes in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.22em;
  color: var(--violet-hi); text-transform: uppercase;
}

/* ---------- home ---------- */
.home { text-align: center; padding: 64px 16px 20px; max-width: 680px; margin: 0 auto; }
.home h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 60px);
  margin: 10px 0 0; letter-spacing: -0.02em; font-weight: 700;
}
.home .sub { color: var(--muted); margin: 12px auto 0; line-height: 1.6; font-size: 15px; max-width: 520px; }
.search {
  margin: 28px auto 0; max-width: 600px;
  display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.search:focus-within { border-color: rgba(139, 92, 246, 0.55); }
.search input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--text); font-size: 15px; font-family: var(--font-ui); min-width: 0;
}
.search input::placeholder { color: var(--faint); }
.search button {
  border: 0; cursor: pointer; font-weight: 600; font-size: 14px;
  padding: 11px 22px; border-radius: 10px; color: #fff;
  background: var(--violet); font-family: var(--font-ui);
}
.search button:hover { background: var(--violet-hi); }
.quick { display: flex; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.quick button {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 8px 15px; border-radius: 999px; cursor: pointer; font-size: 13px; font-family: var(--font-ui);
}
.quick button:hover { color: var(--text); border-color: rgba(139, 92, 246, 0.5); }

/* ---------- browse ---------- */
.toolbar {
  display: flex; gap: 6px; align-items: center; padding: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 10px; flex-wrap: wrap;
}
.toolbar input {
  flex: 1; min-width: 180px; background: var(--bg-soft);
  border: 1px solid var(--line-soft); color: var(--text);
  border-radius: 8px; padding: 9px 12px; outline: none;
  font-size: 13.5px; font-family: var(--font-ui);
}
.toolbar input:focus { border-color: rgba(139, 92, 246, 0.55); }
.tbtn {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  border-radius: 8px; padding: 8px 11px; cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: var(--font-ui); white-space: nowrap;
}
.tbtn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.tbtn.primary { background: var(--violet); color: #fff; font-weight: 600; }
.tbtn.primary:hover { background: var(--violet-hi); }
.tbtn.ghost { border-color: var(--line); }
.statusline { font-size: 12px; color: var(--faint); margin: 0 2px 10px; }
.statusline b { color: var(--muted); font-weight: 500; }
.stage {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: #000; min-height: 60vh; position: relative;
}
.stage iframe { width: 100%; height: 68vh; border: 0; background: #0a0a10; display: block; }
.stage-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--faint); text-align: center; padding: 30px; pointer-events: none; font-size: 14px;
}

/* ---------- library ---------- */
.lib-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; }
.lib-head input {
  flex: 1; min-width: 180px; background: var(--panel);
  border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 14px; outline: none;
  font-size: 14px; font-family: var(--font-ui);
}
.lib-head input:focus { border-color: rgba(139, 92, 246, 0.55); }
.lib-head input::placeholder { color: var(--faint); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 8px 14px; cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: var(--font-ui);
}
.chip:hover { color: var(--text); }
.chip.active { color: #fff; background: var(--violet-dim); border-color: rgba(139, 92, 246, 0.6); }
.count { font-size: 12px; color: var(--faint); margin-left: auto; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.game {
  border: 1px solid var(--line-soft); background: var(--panel);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.game:hover { transform: translateY(-2px); border-color: rgba(139, 92, 246, 0.55); }
.cover { position: relative; aspect-ratio: 16 / 10; background: #17131f; overflow: hidden; }
.cover .letter {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 34px; color: rgba(139, 92, 246, 0.4);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #17131f; }
.game .t { padding: 10px 12px 2px; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game .m { padding: 0 12px 11px; font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- settings ---------- */
.sections { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 820px) { .sections { grid-template-columns: 1fr; } }
.card {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 14px; padding: 20px;
}
.card.full { grid-column: 1 / -1; }
.card h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 15px; letter-spacing: 0.01em; }
.card .desc { margin: 0 0 6px; color: var(--faint); font-size: 12.5px; line-height: 1.5; }
.field { margin: 13px 0; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input, .field select {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--text); border-radius: 9px; padding: 10px 12px; outline: none;
  font-size: 13.5px; font-family: var(--font-ui);
}
.field input:focus, .field select:focus { border-color: rgba(139, 92, 246, 0.55); }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn {
  border: 1px solid var(--line); background: transparent; color: var(--text);
  padding: 9px 16px; border-radius: 9px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; font-family: var(--font-ui);
}
.btn:hover { border-color: rgba(139, 92, 246, 0.55); }
.btn.primary { background: var(--violet); border-color: transparent; color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--violet-hi); }
.btn.danger { color: #f1a9ab; }
.btn.danger:hover { border-color: rgba(229, 72, 77, 0.6); }
.hint { font-size: 12.5px; color: var(--faint); line-height: 1.6; margin: 12px 0 0; }
code.inline { background: rgba(255, 255, 255, 0.07); padding: 2px 6px; border-radius: 5px; font-size: 12px; font-family: ui-monospace, monospace; }
.footer { text-align: center; color: var(--faint); font-size: 12px; margin-top: 44px; line-height: 1.7; }
.footer a { color: var(--violet-hi); text-decoration: none; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #ffffff1a; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ backgrounds (photo layer + tint) ============ */
#bg-photo {
  position: fixed; inset: -3%; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 0.8s ease;
  animation: kenburns 60s ease-in-out infinite alternate;
}
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.09); } }
body.fx-off #bg-photo { animation: none; }
#bg-tint {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 8, 12, 0.42), rgba(8, 8, 12, 0.72));
}
#bg-video {
  position: fixed; inset: -3%; z-index: 0; pointer-events: none;
  width: 106%; height: 106%; object-fit: cover;
  opacity: 0; transition: opacity 0.8s ease;
}
body.bg-css #bg-tint {
  background:
    radial-gradient(900px 480px at 50% -180px, rgba(124, 58, 237, 0.13), transparent 70%),
    transparent;
}
.topbar, main { position: relative; }
.topbar { z-index: 10; }
main { z-index: 1; }

/* ============ hero (full-bleed, PeteZah-style) ============ */
.hero { margin: -28px -20px 0; padding: 16vh 20px 14vh; position: relative; }
.hero-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.wordmark {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(56px, 10vw, 96px); letter-spacing: -0.02em; margin: 0;
  color: #fff; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55);
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.search.glass {
  background: rgba(12, 12, 19, 0.62);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.45);
  animation: rise 0.7s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.search-ic { color: var(--faint); font-size: 16px; padding-left: 6px; }
.shortcuts { display: flex; gap: 12px; justify-content: center; margin-top: 22px; animation: rise 0.7s 0.16s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.shortcuts button {
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 12, 19, 0.55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 16px;
  display: grid; place-items: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.shortcuts button:hover { transform: translateY(-3px) scale(1.05); border-color: var(--violet-hi); }
/* legacy home block retired */
.home { display: none; }

/* panels float above photos */
.card, .toolbar, .lib-head input {
  background: rgba(14, 14, 22, 0.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}

/* ============ background picker ============ */
.bg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.bg-tile {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: transparent; padding: 0; cursor: pointer; font-family: var(--font-ui);
}
.bg-tile.active { border-color: var(--violet-hi); box-shadow: 0 0 0 1px var(--violet-hi); }
.bg-thumb {
  display: block; aspect-ratio: 16 / 9; background-size: cover; background-position: center;
  background-color: #17131f; position: relative; overflow: hidden;
  background-image: radial-gradient(circle at 50% 120%, rgba(124, 58, 237, 0.35), transparent 70%);
}
.bg-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.live-badge {
  position: absolute; top: 5px; right: 5px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  color: #fff; background: rgba(124, 58, 237, 0.85);
  padding: 2px 7px; border-radius: 999px;
}
.bg-name { display: block; font-size: 11px; color: var(--muted); padding: 6px 4px; }
.bg-tile.active .bg-name { color: var(--text); }
.field.check label { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.field.check input { width: auto; accent-color: var(--violet); }
/* relay test */
#relay-results { margin-top: 10px; display: grid; gap: 6px; }
.relay { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); }
.relay .rdot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.relay.ok .rdot { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.7); }
.relay.dead .rdot { background: var(--danger); }
.relay span:last-child { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; }
/* engine diagnostics */
#engine-log { margin-top: 4px; display: grid; gap: 4px; max-height: 180px; overflow-y: auto; }
.dline { display: flex; gap: 8px; font-size: 11.5px; color: var(--muted); font-family: ui-monospace, monospace; }
.dline span:first-child { color: var(--faint); flex: none; }
.dline.bad { color: #f1a9ab; }
.dline.ok span:nth-child(2) { color: #86efac; }

/* ============ boot splash ============ */
#boot {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  transition: opacity 0.5s ease;
}
#boot.done { opacity: 0; pointer-events: none; }
.boot-mark {
  width: 54px; height: 54px; border-radius: 16px; overflow: hidden;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.boot-name { font-family: var(--font-display); letter-spacing: 0.3em; font-size: 12px; color: var(--muted); }
.boot-bar { width: 168px; height: 2px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 40%; background: var(--violet-hi); border-radius: 2px; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(430%); } }

/* ============ viewer loading ============ */
.stage-loader {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(8, 8, 12, 0.55); backdrop-filter: blur(3px);
}
.stage-loader[hidden] { display: none; }
.stage.loading iframe { opacity: 0.2; }
.ring {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14); border-top-color: var(--violet-hi);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ polish: decorated but disciplined ============ */
.wordmark {
  background: linear-gradient(180deg, #ffffff 30%, #c4b5fd 78%, #8b5cf6 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 28px rgba(124, 58, 237, 0.35));
}
.hero-chips { display: flex; gap: 8px; justify-content: center; margin-top: 16px; animation: rise 0.7s 0.04s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.hchip {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: #d6c9ff; padding: 6px 13px; border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.4); background: rgba(124, 58, 237, 0.14);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.search.glass:focus-within {
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22), 0 12px 44px rgba(0, 0, 0, 0.45);
}
.shortcuts button { padding: 0; }
.shortcuts button svg { width: 20px; height: 20px; }
.game .cover img { transition: transform 0.35s ease; }
.game:hover .cover img { transform: scale(1.06); }
/* spotlight */
.spot { margin: 4px 0 16px; }
.spot-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--violet-hi); margin-bottom: 10px;
}
.spot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.spot-grid .game { border-color: rgba(139, 92, 246, 0.35); }
/* in-library player */
.player-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.player-title {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
#game-player .stage iframe { height: 72vh; }

/* ============ ambient effects ============ */
.hero::before {
  content: ""; position: absolute; left: 50%; top: 6%; transform: translateX(-50%);
  width: min(720px, 90vw); height: 340px; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, rgba(124, 58, 237, 0.22), transparent 70%);
  animation: breathe 7s ease-in-out infinite;
}
.hero-inner { position: relative; z-index: 1; }
@keyframes breathe { 0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.12); } }
.wordmark { position: relative; overflow: hidden; }
.wordmark::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: sheen 6s ease-in-out infinite;
  -webkit-background-clip: text; background-clip: text;
}
@keyframes sheen { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.shortcuts button:nth-child(1) { animation-delay: 0.16s; }
.shortcuts button:nth-child(2) { animation-delay: 0.22s; }
.shortcuts button:nth-child(3) { animation-delay: 0.28s; }
.shortcuts button:nth-child(4) { animation-delay: 0.34s; }
.shortcuts button:nth-child(5) { animation-delay: 0.4s; }
.shortcuts button { animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.shortcuts button:hover { box-shadow: 0 0 18px rgba(139, 92, 246, 0.5); }
.game:hover { box-shadow: 0 8px 30px rgba(124, 58, 237, 0.18); }
.chip { transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease; }
.chip:hover { transform: translateY(-1px); }
.tbtn { transition: background 0.15s ease, color 0.15s ease; }
#boot { background: radial-gradient(700px 420px at 50% 60%, rgba(124, 58, 237, 0.12), transparent 70%), var(--bg); }

/* ============ performance mode + reduced motion ============ */
body.perf #bg-photo, body.perf #bg-video { animation: none; }
body.perf #stars { display: none; }
body.perf .topbar, body.perf .card, body.perf .toolbar, body.perf .lib-head input,
body.perf .search.glass, body.perf .shortcuts button, body.perf .hchip {
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.perf .card, body.perf .toolbar, body.perf .lib-head input { background: #101018; }
body.perf .search.glass { background: #0c0c13; }
body.perf .hero::before, body.perf .wordmark::after { display: none; }
body.perf .shortcuts button, body.perf .game, body.perf .chip, body.perf .tbtn { transition: none; }
@media (prefers-reduced-motion: reduce) {
  #bg-photo, .hero::before, .wordmark::after, .boot-mark, .boot-bar span { animation: none !important; }
}

/* ============ mode chooser ============ */
#mode-pick {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center; padding: 20px;
  background: rgba(5, 5, 9, 0.72);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#mode-pick[hidden] { display: none; }
.mp-box { text-align: center; max-width: 520px; }
.mp-mark {
  width: 52px; height: 52px; border-radius: 15px; margin: 0 auto; overflow: hidden;
  background: #14141d;
}
.mp-box h2 { font-family: var(--font-display); margin: 16px 0 4px; font-size: 26px; }
.mp-box p { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.mp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mp-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 22px 12px; cursor: pointer;
  background: rgba(14, 14, 22, 0.8); color: var(--text); font-family: var(--font-ui);
  display: grid; gap: 6px; justify-items: center;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.mp-card:hover { border-color: var(--violet-hi); transform: translateY(-2px); }
.mp-card b { font-size: 15px; }
.mp-card span { font-size: 12px; color: var(--faint); }
.mp-remember { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 16px; font-size: 13px; color: var(--muted); cursor: pointer; }
.mp-remember input { accent-color: var(--violet); }

/* ============ OS desktop ============ */
body[data-mode="os"] .topbar, body[data-mode="os"] main { display: none; }
#os { position: fixed; inset: 0; z-index: 40; overflow: hidden; }
#os[hidden] { display: none; }
.os-icons {
  position: absolute; top: 18px; left: 18px; z-index: 1;
  display: grid; gap: 14px;
}
.os-icon {
  border: 0; background: transparent; cursor: pointer; color: #fff;
  display: grid; gap: 5px; justify-items: center; font-family: var(--font-ui); font-size: 11.5px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); padding: 6px; border-radius: 10px;
}
.os-icon:hover { background: rgba(255, 255, 255, 0.1); }
.os-ic {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; font-size: 22px; color: #fff;
  background: rgba(16, 16, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  text-shadow: none;
}
.os-wins { position: absolute; inset: 0; pointer-events: none; }
.win {
  position: absolute; pointer-events: auto;
  left: 6vw; top: 8vh; width: min(920px, 88vw); height: min(600px, 76vh);
  display: flex; flex-direction: column;
  background: rgba(12, 12, 20, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 14px; overflow: hidden;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.win[hidden] { display: none; }
.win-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 8px 9px 16px; cursor: grab; user-select: none;
  background: rgba(255, 255, 255, 0.05); border-bottom: 1px solid var(--line-soft);
  font-size: 13px; font-weight: 600;
}
.win-head:active { cursor: grabbing; }
.win-head div { display: flex; gap: 4px; }
.win-head button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 28px; height: 24px; border-radius: 6px; font-size: 14px; line-height: 1;
}
.win-head button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.win-body { flex: 1; overflow: auto; padding: 14px; min-height: 0; }
.win-body .toolbar { position: sticky; top: 0; z-index: 2; }
.win.focused { border-color: rgba(139, 92, 246, 0.45); }
#win-library-body .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
#win-settings-body .sections { grid-template-columns: 1fr; }
.os-task {
  position: absolute; left: 0; right: 0; bottom: 0; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 8, 15, 0.82);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
#os-start {
  position: absolute; left: 12px;
  width: 36px; height: 36px; border-radius: 9px; border: 0; cursor: pointer;
  background: transparent; display: grid; place-items: center;
}
#os-start:hover { background: rgba(255, 255, 255, 0.08); }
.os-start-orb {
  width: 22px; height: 22px; border-radius: 6px; overflow: hidden;
  display: block;
}
.os-pinned { display: flex; gap: 4px; align-items: center; }
.os-pinned button {
  position: relative; width: 42px; height: 42px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: #e7e7ec;
  font-size: 19px; cursor: pointer; font-family: var(--font-ui);
}
.os-pinned button:hover { background: rgba(255, 255, 255, 0.09); }
.os-pinned button.running::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--violet-hi);
}
.os-pinned button.active { background: rgba(124, 58, 237, 0.25); border-color: rgba(139, 92, 246, 0.4); }
.os-tray { position: absolute; right: 12px; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.tray-ic svg { width: 17px; height: 17px; display: block; }
.tray-clock { display: grid; justify-items: end; font-size: 11.5px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.tray-clock #os-date { color: var(--faint); }
.os-startmenu {
  position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%);
  padding: 16px; width: min(480px, 92vw);
  background: rgba(12, 12, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 16px;
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.os-startmenu[hidden] { display: none; }
.sm-label { font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); margin: 0 4px 8px; }
.sm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.sm-grid button {
  border: 0; background: transparent; color: var(--text);
  padding: 12px 6px; border-radius: 10px; cursor: pointer;
  font-size: 12.5px; font-family: var(--font-ui);
  display: grid; gap: 7px; justify-items: center;
}
.sm-grid button:hover { background: rgba(124, 58, 237, 0.22); }
.sm-grid button span:first-child { font-size: 24px; }
.sm-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding: 10px 6px 0; border-top: 1px solid var(--line-soft);
}
.sm-user { font-size: 13px; font-weight: 600; }
#os-classic {
  border: 0; background: transparent; color: var(--violet-hi); cursor: pointer;
  font-size: 18px; width: 34px; height: 34px; border-radius: 9px;
}
#os-classic:hover { background: rgba(124, 58, 237, 0.22); }
/* soundboard pads */
.pad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pad {
  border: 1px solid var(--line); border-radius: 12px; padding: 22px 8px; cursor: pointer;
  background: var(--panel-2); color: var(--text); font-family: var(--font-ui);
  font-size: 14px; font-weight: 600;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}
.pad:hover { border-color: rgba(139, 92, 246, 0.6); }
.pad.hit { transform: scale(0.94); background: var(--violet-dim); border-color: var(--violet-hi); }
/* ai chat */
.ai-body { display: flex; flex-direction: column; gap: 10px; }
.ai-models select {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--text); border-radius: 9px; padding: 9px 12px; outline: none;
  font-size: 13px; font-family: var(--font-ui);
}
.ai-log {
  flex: 1; min-height: 220px; max-height: 46vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px; padding: 4px 2px;
}
.ai-hi { color: var(--faint); font-size: 13px; text-align: center; margin-top: 30px; }
.ai-msg {
  max-width: 85%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.55;
  word-break: break-word;
}
.ai-msg.you { align-self: flex-end; background: var(--violet); color: #fff; }
.ai-msg.ai { align-self: flex-start; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line-soft); }
.ai-bar { display: flex; gap: 8px; }
.ai-bar input {
  flex: 1; background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 10px 13px; outline: none;
  font-size: 13.5px; font-family: var(--font-ui); min-width: 0;
}
.ai-bar input:focus { border-color: rgba(139, 92, 246, 0.55); }
.ai-bar button {
  border: 0; background: var(--violet); color: #fff; font-weight: 600;
  padding: 10px 18px; border-radius: 10px; cursor: pointer; font-family: var(--font-ui);
}
.ai-bar button:hover { background: var(--violet-hi); }
