/* Radiance — single-page styles (without pseudo-element starfield) */
:root {
  --primary: #ffd23f;
  --primary-2: #f5b800;
  --accent: #ffe680;
  --glow: rgba(255, 210, 63, .55);

  --bg: #0c0a05;
  --bg-grad-top: #1b1708;
  --bg-grad-bot: #07060a;
  --surface: rgba(20, 17, 8, .6);
  --surface-2: rgba(26, 22, 10, .9);
  --modal-bg: #15120a;
  --border: rgba(255, 255, 255, .08);
  --border-2: rgba(255, 255, 255, .14);
  --text: #f6efd6;
  --muted: #8a8268;
  --on-primary: #1a1605;
  --star: #ffffff;

  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-theme="radiance"] {
  --primary:#ffd23f; --primary-2:#f5b800; --accent:#ffe680; --glow:rgba(255,210,63,.55);
  --bg:#0c0a05; --bg-grad-top:#1b1708; --bg-grad-bot:#07060a;
  --surface:rgba(20,17,8,.6); --surface-2:rgba(26,22,10,.9); --modal-bg:#15120a;
  --text:#f6efd6; --muted:#8a8268; --on-primary:#1a1605; --star:#fff5c2;
}
[data-theme="cherry"] {
  --primary:#ff5e8a; --primary-2:#e63973; --accent:#ffb8cf; --glow:rgba(255,94,138,.55);
  --bg:#0e0509; --bg-grad-top:#22070f; --bg-grad-bot:#09040a;
  --surface:rgba(34,7,15,.6); --surface-2:rgba(44,9,20,.9); --modal-bg:#180810;
  --text:#fbeaf0; --muted:#9d7a85; --on-primary:#240811; --star:#ffd6e1;
}
[data-theme="ocean"] {
  --primary:#3fb8ff; --primary-2:#1b8fd1; --accent:#9fdcff; --glow:rgba(63,184,255,.55);
  --bg:#040a12; --bg-grad-top:#0a1d35; --bg-grad-bot:#02060d;
  --surface:rgba(8,22,40,.6); --surface-2:rgba(10,30,55,.9); --modal-bg:#091624;
  --text:#e6f3ff; --muted:#6e8aa3; --on-primary:#04131f; --star:#cce6ff;
}
[data-theme="forest"] {
  --primary:#5fd17a; --primary-2:#36a356; --accent:#b6ecc1; --glow:rgba(95,209,122,.5);
  --bg:#04100a; --bg-grad-top:#0b2218; --bg-grad-bot:#020806;
  --surface:rgba(10,28,20,.6); --surface-2:rgba(14,36,26,.9); --modal-bg:#0a1c15;
  --text:#e9f6ec; --muted:#7c9683; --on-primary:#06170d; --star:#cdf2d4;
}
[data-theme="crimson"] {
  --primary:#ff5252; --primary-2:#cc2a2a; --accent:#ffb3b3; --glow:rgba(255,82,82,.55);
  --bg:#100404; --bg-grad-top:#280808; --bg-grad-bot:#0a0303;
  --surface:rgba(40,8,8,.6); --surface-2:rgba(55,12,12,.9); --modal-bg:#1c0808;
  --text:#fae8e8; --muted:#9b7474; --on-primary:#1f0606; --star:#ffd1d1;
}
[data-theme="lavender"] {
  --primary:#b794ff; --primary-2:#8c63ff; --accent:#dec9ff; --glow:rgba(183,148,255,.55);
  --bg:#0a0716; --bg-grad-top:#1b1240; --bg-grad-bot:#06040d;
  --surface:rgba(24,16,55,.6); --surface-2:rgba(34,22,72,.9); --modal-bg:#150e2c;
  --text:#efe9ff; --muted:#8a82a5; --on-primary:#150b2e; --star:#e2d6ff;
}
[data-theme="sunset"] {
  --primary:#ff8a3d; --primary-2:#e55a17; --accent:#ffc89e; --glow:rgba(255,138,61,.55);
  --bg:#100604; --bg-grad-top:#2b0f04; --bg-grad-bot:#0a0402;
  --surface:rgba(40,15,8,.6); --surface-2:rgba(55,22,10,.9); --modal-bg:#1d0c06;
  --text:#fbe8d8; --muted:#a08272; --on-primary:#1d0a04; --star:#ffd9b8;
}
[data-theme="midnight"] {
  --primary:#7c93ff; --primary-2:#4f63d2; --accent:#b7c4ff; --glow:rgba(124,147,255,.55);
  --bg:#04060e; --bg-grad-top:#0c1024; --bg-grad-bot:#020308;
  --surface:rgba(12,18,40,.6); --surface-2:rgba(16,24,55,.9); --modal-bg:#0a1024;
  --text:#e6ecff; --muted:#717ea3; --on-primary:#080c1d; --star:#c8d2ff;
}
[data-theme="mono"] {
  --primary:#e6e6e6; --primary-2:#a8a8a8; --accent:#ffffff; --glow:rgba(230,230,230,.4);
  --bg:#080808; --bg-grad-top:#1a1a1a; --bg-grad-bot:#040404;
  --surface:rgba(30,30,30,.6); --surface-2:rgba(45,45,45,.9); --modal-bg:#161616;
  --text:#f2f2f2; --muted:#888; --on-primary:#0a0a0a; --star:#fff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(ellipse at top, var(--bg-grad-top) 0%, var(--bg) 60%, var(--bg-grad-bot) 100%);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background-color .4s ease, color .3s ease;
}
button, input, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* Starfield container (no pseudo-elements, stars are created by JS) */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Sidebar, Stage, Games grid, Player, Modals – all unchanged from your original */
/* (I’ll keep the rest identical to your original CSS, just removing the old starfield rules) */

.sidebar {
  position: fixed;
  left: 14px; top: 14px; bottom: 14px;
  width: 56px;
  z-index: 20;
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px;
  backdrop-filter: blur(12px);
  transition: transform .25s ease, width .25s ease, opacity .25s ease;
}
.sidebar.collapsed { transform: translateX(-72px); }
.side-top, .side-bot { display: flex; flex-direction: column; gap: 6px; width: 100%; align-items: center; }
.side-bot { margin-top: auto; }

.nav-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: var(--muted);
  transition: background .15s, color .15s, transform .15s;
  position: relative;
}
.nav-btn:hover { 
  background: color-mix(in srgb, var(--primary) 12%, transparent); 
  color: var(--primary); 
}
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn.active {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  color: var(--on-primary);
  box-shadow: 0 6px 22px -8px var(--glow);
}
.nav-btn .tip {
  position: absolute; left: calc(100% + 10px);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-size: 12px;
  padding: 5px 9px; border-radius: 8px;
  white-space: nowrap;
  opacity: 0; transform: translateX(-4px);
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  z-index: 30;
}
.nav-btn:hover .tip { opacity: 1; transform: translateX(0); }

.collapse-btn .ic-close { display: none; }
.sidebar.collapsed .collapse-btn .ic-open { display: none; }
.sidebar.collapsed .collapse-btn .ic-close { display: inline-block; }

.reopen-btn {
  position: fixed; top: 18px; left: 18px; z-index: 21;
  width: 40px; height: 40px;
  display: none; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.sidebar.collapsed ~ .reopen-btn { display: flex; }
.reopen-btn svg { width: 18px; height: 18px; }

.stage {
  position: relative; z-index: 1;
  min-height: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  padding: 24px;
  text-align: center;
}
.brand-mark {
  font-size: clamp(64px, 11vw, 132px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 40px var(--glow));
  animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { filter: drop-shadow(0 0 30px var(--glow)); }
  50%     { filter: drop-shadow(0 0 60px var(--glow)); }
}
.tagline {
  margin-top: 14px;
  letter-spacing: .35em;
  text-transform: lowercase;
  font-size: 13px;
  color: var(--muted);
}

.stage-games {
  align-items: stretch; justify-content: flex-start;
  padding: 32px 32px 32px 96px;
  overflow-y: auto;
  text-align: left;
}
.sidebar.collapsed ~ .stage-games { padding-left: 32px; }
.games-head { max-width: 1200px; margin: 0 auto 20px; width: 100%; }
.games-title {
  font-size: 36px; margin: 0 0 16px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}
.games-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.games-controls .search { flex: 1; min-width: 220px; margin: 0; }
.games-meta { color: var(--muted); font-size: 12px; margin-top: 10px; letter-spacing: .15em; text-transform: uppercase; }

.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search input {
  width: 100%; padding: 12px 16px 12px 40px;
  border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }

.select {
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); outline: none; cursor: pointer;
}
.select:focus { border-color: var(--primary); }

.games-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.game-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  position: relative;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 12px 30px -16px var(--glow);
}
.game-card img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  background: var(--surface-2);
  display: block;
}
.game-card .name {
  padding: 10px 12px; font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.player-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 35;
}
.player {
  position: fixed;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  z-index: 40;
  background: #000000;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.player-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.player-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  flex: 1;
  color: var(--text);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.player-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.player-actions button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  cursor: pointer;
}
.player-actions button:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.player-frame-wrap {
  flex: 1;
  background: #000;
  position: relative;
  overflow: hidden;
}
.player-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}
.status {
  position: fixed; left: 0; right: 0; bottom: 14px;
  text-align: center; font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted); z-index: 1; pointer-events: none;
  font-weight: 500;
}
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  z-index: 50; display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex !important; animation: fadeIn .2s ease; }
.modal {
  width: 100%; max-width: 480px;
  background: var(--modal-bg);
  border: 1px solid var(--border-2);
  border-radius: 18px;
  padding: 28px;
  animation: rise .25s ease;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.modal h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.01em; }
.modal p.sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.modal .group { margin-bottom: 18px; }
.modal label.field {
  display: block; font-size: 11px; color: var(--muted);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: .14em;
}
.modal input.text {
  width: 100%; padding: 10px 12px;
  background: color-mix(in srgb, var(--bg) 80%, #000);
  border: 1px solid var(--border-2);
  border-radius: 10px; color: var(--text); outline: none;
}
.modal input.text:focus { border-color: var(--primary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.btn {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  color: var(--on-primary);
  font-weight: 600; font-size: 14px;
  padding: 10px 22px; border-radius: 10px;
  box-shadow: 0 6px 20px -8px var(--glow);
  transition: transform .15s, filter .15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-ghost {
  color: var(--muted);
  padding: 8px 14px; border-radius: 10px; font-weight: 500; font-size: 13px;
  transition: color .15s, background .15s;
}
.btn-ghost:hover { color: var(--text); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border-2);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 12px; font-size: 13px;
  transition: all .15s;
  display: flex; align-items: center; gap: 8px;
}
.chip:hover { color: var(--text); border-color: var(--primary); }
.chip.active {
  color: var(--text);
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.swatch {
  width: 14px; height: 14px; border-radius: 4px;
  background: linear-gradient(180deg, var(--sw-1), var(--sw-2));
  border: 1px solid rgba(255,255,255,.15);
}
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle .track {
  width: 38px; height: 22px; border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border-2);
  position: relative; transition: background .2s;
}
.toggle .track::after {
  content: ""; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted);
  top: 2px; left: 2px;
  transition: transform .2s, background .2s;
}
.toggle input:checked + .track {
  background: color-mix(in srgb, var(--primary) 28%, transparent);
  border-color: var(--primary);
}
.toggle input:checked + .track::after {
  transform: translateX(16px); background: var(--primary);
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise  { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: translateY(0) } }
.view-transition {
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}
.view-transition[hidden] {
  display: none !important;
}
.stage:not([hidden]) {
  animation: fadeSlideUp 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1) forwards;
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.favorite-star {
  transition: transform 0.2s ease, color 0.2s ease;
}
.favorite-star:hover {
  transform: scale(1.2);
}
@media (max-width: 520px) {
  .sidebar { width: 48px; left: 8px; top: 8px; bottom: 8px; }
  .nav-btn { width: 38px; height: 38px; }
  .stage-games { padding: 24px 16px 24px 72px; }
  .sidebar.collapsed ~ .stage-games { padding-left: 16px; }
}
.stage[hidden], .player[hidden], .player-backdrop[hidden] { display: none !important; }

/* Starfield container */
.starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Individual star */
.star {
  position: absolute;
  border-radius: 50%;
  animation: starDrift linear infinite;
  will-change: transform;
}

@keyframes starDrift {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy));
    opacity: 0;
  }
}