:root {
  /* Surfaces — deep charcoal SaaS base */
  --bg: #0a0c12;
  --bg-elevated: #10131b;
  --panel: #131722;
  --panel-2: #181c29;
  --ink: #eef1f7;
  --muted: #8b93a7;
  --muted-2: #6b7388;

  /* Accents — phosphor + warm amber story */
  --accent: #ff4d5e;
  --accent2: #5dffc0;
  --phosphor: #5dffc0;
  --amber: #ffc14d;
  --bezel: #1a1e2a;
  --line: #2a3144;
  --line-strong: #3d4660;

  /* Elevation */
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.28);
  --glow-ph: 0 0 24px rgba(93, 255, 192, 0.12);

  /* Type & rhythm */
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-display: "Tektur", "Outfit", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --sys-nes: #ff4d5e;
  --sys-gb: #9bbc0f;
  --sys-gbc: #a78bfa;
  --sys-snes: #818cf8;
  --sys-gba: #6b8afd;
  --sys-n64: #c9a227;
}

body[data-system="gb"] {
  --accent: #8bac0f;
  --accent2: #9bbc0f;
}
body[data-system="gbc"] {
  --accent: #8b5cf6;
  --accent2: #c4b5fd;
}
body[data-system="snes"] {
  --accent: #7c6cf0;
  --accent2: #7dd3fc;
}
body[data-system="gba"] {
  --accent: #6b8afd;
  --accent2: #93c5fd;
}
body[data-system="n64"] {
  --accent: #c9a227;
  --accent2: #ffe082;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { color-scheme: dark; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1000px 520px at 12% -8%, rgba(255, 77, 94, 0.08) 0%, transparent 55%),
    radial-gradient(900px 480px at 92% 0%, rgba(93, 255, 192, 0.07) 0%, transparent 50%),
    radial-gradient(700px 400px at 70% 100%, rgba(129, 140, 248, 0.05) 0%, transparent 45%),
    var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  padding-top: var(--safe-t);
  padding-bottom: var(--safe-b);
}

.skip-link {
  position: absolute;
  left: max(12px, var(--safe-l));
  top: max(8px, var(--safe-t));
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid #fff;
  outline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}
.btn:focus-visible,
.sys-card:focus-visible,
.recent:focus-visible,
.logo-btn:focus-visible,
.tbtn:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}
.btn.primary:focus-visible {
  outline-color: #fff;
}

/* Restrained page scanlines — modern retro, not muddy */
.scanline-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.012) 0px,
    rgba(255, 255, 255, 0.012) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: soft-light;
  opacity: 0.55;
}

/* ——— Topbar ——— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px 12px;
  padding-left: max(28px, var(--safe-l));
  padding-right: max(28px, var(--safe-r));
  gap: var(--space-4);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.logo-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px;
  cursor: pointer;
  color: inherit;
  border-radius: 8px;
  flex-shrink: 0;
}
.logo-mark {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background:
    linear-gradient(135deg, var(--accent) 0 50%, transparent 50%),
    linear-gradient(315deg, var(--phosphor) 0 50%, #1a1e2a 50%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--phosphor) 35%, transparent),
    0 0 14px rgba(93, 255, 192, 0.25);
  animation: pulse 2s ease-in-out infinite;
}
h1 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.22em;
  font-weight: 800;
  line-height: 1.2;
}
.tag {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line);
  max-width: min(420px, 52vw);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.status-rom {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  color: var(--ink);
  font-weight: 550;
}
.status-sep {
  width: 1px;
  height: 12px;
  background: var(--line);
  flex-shrink: 0;
}
.status-fps {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
  flex-shrink: 0;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  flex-shrink: 0;
}
.dot.on {
  background: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor);
}

/* ——— Home ——— */
.home {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-5) 20px var(--space-7);
}
body.view-home {
  background:
    radial-gradient(900px 480px at 18% -10%, rgba(255, 160, 70, 0.10) 0%, transparent 55%),
    radial-gradient(700px 420px at 88% 8%, rgba(120, 80, 200, 0.07) 0%, transparent 50%),
    radial-gradient(600px 380px at 50% 100%, rgba(40, 24, 12, 0.35) 0%, transparent 55%),
    #0a090e;
}
.home-hero {
  margin-bottom: 4px;
}
.home-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--phosphor);
}
.home-lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 40em;
  margin: 0;
}
.sys-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
}
.sys-grid.shelf-grid {
  margin: 0;
}
.sys-grid.shelf-grid-live,
.sys-grid.shelf-grid-hand {
  grid-template-columns: repeat(3, 1fr);
}
a.sys-card {
  text-decoration: none;
  color: inherit;
}
.sys-card {
  appearance: none;
  text-align: left;
  position: relative;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.035) 0%, transparent 42%),
    linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 16px 16px;
  color: var(--ink);
  cursor: pointer;
  min-height: 156px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease;
}
.sys-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--card-accent, var(--accent));
  opacity: 0.9;
}
.sys-pip {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--card-accent, var(--accent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--card-accent, var(--accent)) 55%, transparent);
  margin-bottom: 2px;
}
.sys-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34), var(--glow-ph);
}
.sys-card:focus-visible {
  border-color: var(--accent2);
}
.sys-card.selected {
  border-color: color-mix(in srgb, var(--card-accent, var(--accent)) 70%, var(--line));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--card-accent, var(--accent)) 55%, transparent),
    0 16px 40px rgba(0, 0, 0, 0.38),
    0 0 28px color-mix(in srgb, var(--card-accent, var(--accent)) 18%, transparent);
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--card-accent, var(--accent)) 12%, transparent) 0%, transparent 50%),
    linear-gradient(180deg, #1c2130 0%, #141824 100%);
}
.sys-card.selected .sys-kicker { color: var(--card-accent, var(--accent)); }
.sys-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--muted);
}
.sys-card strong {
  font-size: 20px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  font-weight: 750;
}
.sys-card .sys-desc,
.sys-card span.sys-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  margin-top: auto;
}
.sys-card[data-sys="nes"] { --card-accent: var(--sys-nes); }
.sys-card[data-sys="gb"] { --card-accent: var(--sys-gb); }
.sys-card[data-sys="gbc"] { --card-accent: var(--sys-gbc); }
.sys-card[data-sys="snes"] { --card-accent: var(--sys-snes); }
.sys-card[data-sys="gba"] { --card-accent: var(--sys-gba); }
.sys-card[data-sys="n64"] { --card-accent: var(--sys-n64); }
.sys-card.is-soon { --card-accent: #64748b; }

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  align-items: center;
}
.home-actions .btn { min-width: 7.5rem; }
.home-note { margin-top: 22px; max-width: 44em; }

/* ——— Play stage ——— */
main { padding: 16px 24px 24px; }
.stage {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 320px;
  gap: 28px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}

.bezel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, transparent 40%),
    linear-gradient(165deg, #242836 0%, #171a24 55%, #12151d 100%);
  border: 1px solid #343a4e;
  border-radius: var(--radius-lg);
  padding: 18px 18px 12px;
  box-shadow: var(--shadow);
  position: relative;
}
.bezel::before {
  content: "";
  position: absolute;
  inset: 10px 10px auto 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(93, 255, 192, 0.18), transparent);
  pointer-events: none;
  opacity: 0.7;
}
.crt-wrap {
  position: relative;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 256 / 240;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.45);
}
.crt-wrap[data-system="gb"],
.crt-wrap[data-system="gbc"] { aspect-ratio: 160 / 144; }
.crt-wrap[data-system="snes"] { aspect-ratio: 8 / 7; }
#screen {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  display: block;
  background: #000;
}
.crt-wrap.is-ejs #screen {
  visibility: hidden;
  pointer-events: none;
}
.crt-wrap.smooth #screen,
.crt-wrap.smooth .ejs_canvas { image-rendering: auto; }
#ejs-player {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.crt-wrap.is-ejs #ejs-player { display: block; }
#ejs-player .ejs_parent,
#ejs-player .ejs_game,
#ejs-player .ejs_canvas_parent {
  width: 100% !important;
  height: 100% !important;
}
#ejs-player .ejs_canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  image-rendering: pixelated;
}
#ejs-player .ejs_virtual_gamepad { display: none !important; }
.crt-glass, .crt-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
}
/* Tasteful CRT — phosphor glass, lighter vignette */
.crt-wrap.crt-on .crt-glass {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.14)),
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.07) 0px,
      rgba(0, 0, 0, 0.07) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: soft-light;
  opacity: 0.7;
}
.crt-wrap.crt-on .crt-vignette {
  box-shadow: inset 0 0 48px 10px rgba(0, 0, 0, 0.32);
  border-radius: 10px;
}
.crt-wrap.crt-on #screen,
.crt-wrap.crt-on .ejs_canvas {
  filter: contrast(1.06) saturate(1.08) brightness(1.02);
}

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 4px;
}
.hint code {
  color: var(--amber);
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.rotate-hint { display: none; }

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 30%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.btn {
  appearance: none;
  font-family: inherit;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 42%),
    #1a1f2e;
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  min-height: 40px;
  letter-spacing: 0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 2px 0 #0b0e16,
    0 6px 14px rgba(0, 0, 0, 0.28);
  transition: border-color 0.15s ease, background 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.btn:hover {
  border-color: var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, transparent 42%),
    #22283a;
  transform: translateY(-1px);
}
.btn:focus-visible {
  border-color: var(--accent2);
  background: #22283a;
}
.btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.4),
    0 1px 0 #0b0e16;
}
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff) 0%, var(--accent) 100%);
  border-color: transparent;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 2px 0 color-mix(in srgb, var(--accent) 48%, #000),
    0 8px 20px color-mix(in srgb, var(--accent) 32%, transparent);
}
.btn.primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn.primary:active { filter: brightness(0.96); }
.chk {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.meter {
  display: flex;
  justify-content: space-between;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.panel h2 {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 8px;
  font-weight: 650;
}
.keys { width: 100%; border-collapse: collapse; font-size: 13px; }
.keys td { padding: 5px 0; }
.keys td:first-child {
  color: var(--amber);
  width: 84px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.note, .legal { color: var(--muted); font-size: 12px; line-height: 1.5; }
.legal { margin-bottom: 0; }

footer {
  max-width: 1180px;
  margin: 0 auto 28px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.04em;
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  padding-top: 16px;
}
.foot-host {
  color: var(--muted);
  text-decoration: none;
}
.foot-host:hover {
  color: var(--phosphor);
}

.stage.drag {
  outline: 2px dashed var(--accent2);
  outline-offset: 6px;
  border-radius: 12px;
}

dialog {
  max-width: 520px;
  width: calc(100% - 32px);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(4, 6, 10, 0.72); backdrop-filter: blur(4px); }
.drive-form h2 {
  margin: 0 0 8px;
  letter-spacing: 0.1em;
  font-size: 13px;
  text-transform: uppercase;
}
.drive-form p, .drive-form li { color: var(--muted); font-size: 13px; line-height: 1.5; }
.drive-form ul, .drive-form ol { padding-left: 1.2em; }
.drive-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.drive-form input {
  appearance: none;
  background: #0c0f16;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  padding: 9px 11px;
  font-size: 13px;
  font-family: var(--font-mono);
}
.drive-form input:focus-visible,
.vol input:focus-visible,
.chk input:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
  border-color: var(--accent2);
}
.zip-list, .state-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  max-height: 50vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.zip-list .btn { width: 100%; text-align: left; }

.state-slot {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: #0c0f16;
}
.state-slot img, .state-ph {
  width: 72px;
  height: 64px;
  object-fit: cover;
  background: #000;
  border-radius: 6px;
  grid-row: span 2;
}
.state-meta { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.state-meta strong { color: var(--ink); }
.state-actions { display: flex; gap: 6px; flex-wrap: wrap; grid-column: 2; }
.state-actions .btn { min-height: 32px; padding: 4px 8px; font-size: 12px; }

#touch-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding:
    max(8px, env(safe-area-inset-top, 0px))
    max(10px, env(safe-area-inset-right, 0px))
    max(10px, env(safe-area-inset-bottom, 0px))
    max(10px, env(safe-area-inset-left, 0px));
  pointer-events: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
#touch-overlay[hidden] { display: none !important; }
.touch-shoulders, .touch-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  gap: 8px;
}
.touch-shoulders { align-items: flex-start; gap: 6px; }
.tbtn, .dpad {
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.tbtn {
  appearance: none;
  border: 0;
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
}
.tbtn:active, .tbtn.is-down { background: var(--accent); }
.tbtn.pill {
  border-radius: 20px;
  min-width: 76px;
  min-height: 40px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tbtn.shoulder { border-radius: 10px; min-width: 68px; min-height: 44px; }
.dpad {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 2px 12px rgba(0, 0, 0, 0.3);
}
.dpad:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}
.dpad-cross {
  position: absolute;
  inset: 18px;
  background:
    linear-gradient(#fff3, #fff3) center / 36% 100% no-repeat,
    linear-gradient(#fff3, #fff3) center / 100% 36% no-repeat;
  border-radius: 8px;
  pointer-events: none;
}
.face {
  position: relative;
  width: 140px;
  height: 140px;
}
.face .tbtn { position: absolute; }
.face-a { right: 0; top: 44px; }
.face-b { left: 8px; bottom: 8px; }
.face-x { right: 8px; top: 0; }
.face-y { left: 0; top: 44px; }
.touch-mid { display: flex; gap: 8px; align-self: center; pointer-events: none; }
/* Extra face/shoulder visibility is driven by js/touch.js via [data-systems] + [hidden]. */

.sheet-toggle { display: none; }
.sheet-toggle {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  letter-spacing: 0.06em;
  font-weight: 700;
}

@keyframes pulse {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.55; filter: brightness(1.15); }
}

@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: calc(10px + var(--safe-t)) 16px 10px;
    position: static;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .status {
    max-width: none;
    width: 100%;
    justify-content: space-between;
  }
  h1 { font-size: 14px; letter-spacing: 0.18em; }
  /* Room shelf grids are handled in the bedroom scene media queries below */
  .sys-card { min-height: 118px; padding: 12px 10px; }
  .sys-card strong { font-size: 17px; }
  main { padding: 10px 12px 88px; }
  .home { padding: 12px 16px 36px; }
  /* Controls panel stacks inline below the emulator on small screens. */
  .rotate-hint {
    display: block;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin: 6px 0 8px;
    letter-spacing: 0.04em;
    padding: 6px 12px;
    border: 1px dashed var(--line);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
  }
  body.rom-loaded .rotate-hint { display: none; }
}

@media (max-width: 900px) and (orientation: landscape) {
  .rotate-hint { display: none !important; }
  .topbar {
    flex-direction: row;
    align-items: center;
    padding: 4px 12px;
  }
  .topbar .tag,
  .home-eyebrow { display: none; }
  .status { width: auto; max-width: 48vw; padding: 5px 10px; }
  footer { display: none; }
  .bezel { padding: 6px; border-radius: 12px; }
  .bezel::before { display: none; }
  main { padding: 4px 8px 64px; }
  #touch-overlay {
    padding: 6px max(8px, var(--safe-r)) max(6px, var(--safe-b)) max(8px, var(--safe-l));
  }
  .dpad { width: 112px; height: 112px; }
  .face { width: 120px; height: 120px; }
  .tbtn { min-width: 44px; min-height: 44px; }
}

@media (pointer: coarse) {
  .btn { min-height: 44px; }
}

/* Legacy top border accents removed — pip + ::after handle system color */

body[data-system="nes"] .bezel {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sys-nes) 45%, #333), var(--shadow);
}
body[data-system="snes"] .bezel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, #353848, #161822);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sys-snes) 50%, #333), var(--shadow);
}
body[data-system="gb"] .bezel,
body[data-system="gbc"] .bezel {
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, transparent 40%),
    linear-gradient(180deg, #2a3124, #14180f);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sys-gb) 45%, #333), var(--shadow);
}

.crt-wrap.crt-on {
  border-radius: 14px / 18px;
}
.crt-wrap.crt-on .crt-vignette { border-radius: 14px / 18px; }

.recents-wrap { margin: 20px 0 8px; }
.recents-wrap h2 {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 650;
}
.recents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.recent {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: #0c0f16;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  color: var(--ink);
  padding: 0;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.recent-open {
  appearance: none;
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: none;
}
.recent:hover, .recent:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}
.recent-open:focus-visible { outline: 2px solid var(--accent2); outline-offset: -2px; }
.recent img, .recent-ph {
  width: 100%;
  height: 96px;
  object-fit: cover;
  background: #000;
  display: block;
}
.recent-ph {
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--phosphor) 18%, #2a2030), #000);
}
.recent-meta { padding: 8px 10px 10px; }
.recent-meta strong { display: block; font-size: 13px; }
.recent-meta span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.recent-x {
  position: absolute;
  top: 6px;
  right: 6px;
  appearance: none;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
}

.play-hud {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  display: flex;
  gap: 6px;
  pointer-events: none;
}
.hud-pill {
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.hud-pill.turbo { color: var(--amber); }
.hud-pill.rewind { color: var(--accent2); }

#boot-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}
#boot-overlay[hidden] { display: none !important; }
.boot-card {
  text-align: center;
  padding: 20px 24px;
  max-width: 280px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.boot-sys {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent2);
  margin-bottom: 6px;
  font-weight: 650;
}
.boot-card strong { font-size: 17px; letter-spacing: 0.04em; }
.boot-card p { color: var(--muted); font-size: 13px; }
.boot-bar {
  height: 3px;
  background: #1c2030;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 14px;
}
.boot-bar i {
  display: block;
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--accent), var(--phosphor));
  animation: bootslide 1.1s ease-in-out infinite;
}
@keyframes bootslide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(400%); }
}

.vol {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 4px 0 12px;
}
.vol input { flex: 1; accent-color: var(--accent); }

kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  background: #0c0f16;
  color: var(--ink);
}

.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 16px;
}
.help-overlay[hidden] { display: none !important; }
.help-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
}
.help-card h2 {
  margin: 0 0 12px;
  letter-spacing: 0.1em;
  font-size: 13px;
  text-transform: uppercase;
}

body[data-system="snes"] .face-a { background: #c0392b; }
body[data-system="snes"] .face-b { background: #d4a017; }
body[data-system="snes"] .face-x { background: #3b6ea5; }
body[data-system="snes"] .face-y { background: #3d8b4a; }
body[data-system="snes"] .tbtn.shoulder { background: rgba(255, 255, 255, 0.22); }
body[data-system="gba"] .tbtn.shoulder { background: rgba(255, 255, 255, 0.22); }
body[data-system="n64"] .face-a { background: #3d5afe; }
body[data-system="n64"] .face-b { background: #2e7d32; }
body[data-system="n64"] .face-x { background: #fbc02d; }
body[data-system="n64"] .face-y { background: #fbc02d; }
body[data-system="n64"] .tbtn.shoulder { background: rgba(255, 255, 255, 0.22); }

@media (prefers-reduced-motion: reduce) {
  .logo-mark { animation: none; opacity: 1; }
  .boot-bar i { animation: none; width: 100%; }
  .sys-card,
  .btn,
  .recent { transition: none; }
  .sys-card:hover { transform: none; }
  .skip-link { transition: none; }
  .panel { transition: none; }
  .scanline-overlay { opacity: 0.22; }
  .crt-wrap.crt-on .crt-glass {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 20%, transparent 80%, rgba(0, 0, 0, 0.14));
    opacity: 0.5;
  }
  .crt-wrap.crt-on #screen,
  .crt-wrap.crt-on .ejs_canvas {
    filter: contrast(1.03) saturate(1.04) brightness(1.01);
  }
}

@media (max-width: 520px) {
  .home-actions .btn { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .home-lead { font-size: 15px; }
}


/* ——— Immersive teen bedroom / entertainment center (~1999–2003) ——— */
.room {
  --wood-1: #3a2a1c;
  --wood-2: #2a1e14;
  --wood-3: #4a3424;
  --wall-1: #2a2438;
  --wall-2: #1c1828;
  --carpet: #3a1f2e;
  position: relative;
  margin: 18px 0 20px;
  padding: 0;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, #5b4630 55%, var(--line));
  overflow: hidden;
  isolation: isolate;
  min-height: 640px;
  background: var(--wall-2);
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 180, 0.06),
    0 28px 60px rgba(0, 0, 0, 0.45);
}

/* Night sky wash behind wall top */
.room-sky {
  position: absolute;
  inset: 0 0 auto 0;
  height: 38%;
  background:
    radial-gradient(ellipse 80% 70% at 70% 10%, rgba(90, 70, 160, 0.22), transparent 60%),
    linear-gradient(180deg, #12101c 0%, transparent 100%);
  z-index: 0;
  pointer-events: none;
}

.room-wall {
  position: absolute;
  inset: 0 0 28% 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.18) 0%, transparent 8%, transparent 92%, rgba(0,0,0,0.18) 100%),
    linear-gradient(180deg, #322a42 0%, #241e32 55%, #1a1624 100%);
  pointer-events: none;
}
.wall-stripe {
  position: absolute;
  left: 0; right: 0; top: 42%;
  height: 10px;
  background: repeating-linear-gradient(
    90deg,
    #c45c6a 0 28px,
    #e8d5a3 28px 56px,
    #5a8f9a 56px 84px,
    #e8d5a3 84px 112px
  );
  opacity: 0.35;
  box-shadow: 0 1px 0 rgba(0,0,0,0.35);
}

/* Band posters — CSS art */
.poster {
  position: absolute;
  display: grid;
  place-items: center;
  border: 3px solid #1a120c;
  box-shadow:
    0 8px 18px rgba(0,0,0,0.45),
    inset 0 0 0 1px rgba(255,255,255,0.08);
  transform: rotate(var(--tilt, -2deg));
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 6px;
}
.poster span {
  writing-mode: horizontal-tb;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.poster-a {
  --tilt: -3deg;
  left: 4%; top: 10%;
  width: 72px; height: 96px;
  background:
    radial-gradient(circle at 50% 30%, #ff6b7a, transparent 55%),
    linear-gradient(160deg, #1a0a18, #4a1028 60%, #0c0810);
}
.poster-b {
  --tilt: 2.5deg;
  left: 14%; top: 18%;
  width: 64px; height: 84px;
  background:
    linear-gradient(135deg, #2a1a60 0%, #5a3cff 40%, #1a2848 100%);
}
.poster-c {
  --tilt: -1.5deg;
  right: 16%; top: 12%;
  width: 70px; height: 90px;
  background:
    repeating-linear-gradient(0deg, #111 0 4px, #222 4px 8px),
    linear-gradient(180deg, #ffcc33, #ff6622);
  background-blend-mode: soft-light, normal;
  color: #1a1008;
}
.poster-d {
  --tilt: 3deg;
  right: 5%; top: 22%;
  width: 58px; height: 78px;
  background:
    radial-gradient(ellipse at 50% 70%, #5dffc0 0%, transparent 50%),
    linear-gradient(180deg, #0a1820, #123040);
}

/* Desk lamp on left */
.room-lamp {
  position: absolute;
  left: 3%;
  bottom: 30%;
  width: 54px;
  height: 120px;
  z-index: 2;
  pointer-events: none;
}
.lamp-shade {
  position: absolute;
  top: 0; left: 50%;
  width: 48px; height: 28px;
  margin-left: -24px;
  background: linear-gradient(180deg, #e8c48a, #c48a3a);
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
  box-shadow: 0 4px 12px rgba(255, 180, 80, 0.35);
}
.lamp-stem {
  position: absolute;
  top: 26px; left: 50%;
  width: 4px; height: 70px;
  margin-left: -2px;
  background: linear-gradient(90deg, #6a5a48, #3a3028);
}
.lamp-glow {
  position: absolute;
  top: 20px; left: 50%;
  width: 180px; height: 180px;
  margin-left: -90px;
  background: radial-gradient(circle, rgba(255, 190, 100, 0.28) 0%, rgba(255, 160, 60, 0.08) 40%, transparent 70%);
  filter: blur(2px);
  animation: lamp-pulse 4.5s ease-in-out infinite;
}
@keyframes lamp-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* Window with blinds — right side */
.room-window {
  position: absolute;
  right: 6%;
  top: 8%;
  width: 88px;
  height: 110px;
  z-index: 1;
  pointer-events: none;
  border: 4px solid #2a2218;
  border-radius: 4px;
  background: linear-gradient(180deg, #1a2848 0%, #3a5080 40%, #1a2030 100%);
  box-shadow: inset 0 0 20px rgba(80, 120, 200, 0.25), 0 8px 20px rgba(0,0,0,0.4);
  overflow: hidden;
}
.window-pane {
  position: absolute;
  inset: 6px;
  background:
    linear-gradient(180deg, rgba(140, 180, 255, 0.15), transparent 50%),
    linear-gradient(90deg, transparent 48%, rgba(0,0,0,0.25) 48% 52%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(0,0,0,0.25) 48% 52%, transparent 52%);
}
.window-blinds {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0 7px,
    rgba(20, 16, 12, 0.55) 7px 9px
  );
}

/* Bed silhouette — left depth cue */
.room-bed {
  position: absolute;
  left: -2%;
  bottom: 22%;
  width: 28%;
  max-width: 220px;
  height: 90px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
}
.bed-frame {
  position: absolute;
  inset: 30px 0 0;
  background: linear-gradient(180deg, #4a3428, #2a1c14);
  border-radius: 6px 6px 0 0;
  box-shadow: 0 8px 16px rgba(0,0,0,0.35);
}
.bed-pillow {
  position: absolute;
  left: 12%; top: 8px;
  width: 36%; height: 28px;
  background: linear-gradient(160deg, #d8c8b0, #a89078);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.bed-blanket {
  position: absolute;
  left: 8%; right: 8%; top: 36px;
  height: 44px;
  background:
    repeating-linear-gradient(90deg, #5a3048 0 12px, #3a2034 12px 24px);
  border-radius: 4px;
  opacity: 0.85;
}

.room-glow {
  pointer-events: none;
  position: absolute;
  inset: -10% 15% auto;
  height: 50%;
  z-index: 1;
  background: radial-gradient(ellipse at 50% 20%, rgba(255, 180, 90, 0.14), transparent 68%);
  opacity: 0.95;
}

/* Main interactive stage — CRT + shelves */
.room-stage {
  position: relative;
  z-index: 3;
  padding: 28px 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.room-tv {
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  margin: 0 auto 0;
}
.tv-stand-top {
  height: 10px;
  margin: 0 8% -2px;
  background: linear-gradient(180deg, var(--wood-3), var(--wood-1));
  border-radius: 4px 4px 0 0;
  box-shadow: 0 -2px 0 rgba(255,220,170,0.08);
}
.room-tv-chassis {
  position: relative;
  background:
    linear-gradient(160deg, #4a5060 0%, #2a2e3a 35%, #1a1d27 100%);
  border: 3px solid #0c0e14;
  border-radius: 20px 20px 12px 12px;
  padding: 18px 18px 12px;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 8px rgba(0, 0, 0, 0.4);
}
.crt-speakers {
  position: absolute;
  right: 8px;
  top: 22px;
  bottom: 40px;
  width: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  opacity: 0.45;
}
.crt-speakers span {
  display: block;
  height: 3px;
  border-radius: 1px;
  background: #0a0b10;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08);
}
.room-tv-screen {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px / 12px;
  overflow: hidden;
  background: #030405;
  border: 4px solid #08090e;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.9),
    inset 0 0 12px rgba(80, 120, 160, 0.08);
}
.room-tv-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.65);
  pointer-events: none;
  z-index: 3;
}
.no-signal {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  color: #d7dde8;
  z-index: 2;
}
.no-signal strong {
  font-size: clamp(18px, 4vw, 28px);
  letter-spacing: 0.28em;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.25);
  position: relative;
  z-index: 1;
}
.no-signal-sub {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #9aa3b5;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.no-signal-snow {
  position: absolute;
  inset: -10%;
  z-index: 0;
  opacity: 0.42;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255,255,255,0.04) 1px, rgba(255,255,255,0.04) 2px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.12) 2px, rgba(0,0,0,0.12) 3px),
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.06), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.05), transparent 35%);
  animation: snow 0.16s steps(2) infinite;
}
.no-signal-scan {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255,255,255,0.04) 50%,
    transparent 100%
  );
  background-size: 100% 220%;
  animation: crt-scan 3.2s linear infinite;
  opacity: 0.55;
}
@keyframes crt-scan {
  0% { background-position: 0 -100%; }
  100% { background-position: 0 200%; }
}
.room-tv-screen[data-signal="standby"] .no-signal-snow {
  opacity: 0.16;
  background:
    radial-gradient(circle at 50% 45%, rgba(93, 255, 192, 0.14), transparent 55%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 3px);
}
.room-tv-screen[data-signal="standby"] .no-signal strong {
  color: var(--phosphor);
  letter-spacing: 0.18em;
}
.room-tv-screen[data-signal="standby"] .no-signal-sub {
  color: color-mix(in srgb, var(--phosphor) 55%, #9aa3b5);
}
@keyframes snow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-2px, 1px); }
}
.room-tv-ledge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 0 8px 2px;
  gap: 10px;
}
.room-tv-brand {
  font-size: 10px;
  letter-spacing: 0.22em;
  font-weight: 700;
  color: #8b93a7;
}
.room-tv-knobs {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.room-tv-knobs i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6a7080, #2a2e38);
  border: 1px solid #0c0e14;
}
.room-tv-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4d5e;
  box-shadow: 0 0 8px rgba(255, 77, 94, 0.7);
  flex-shrink: 0;
}
.room-tv-screen[data-signal="standby"] ~ .room-tv-ledge .room-tv-led,
.room-tv-chassis:has([data-signal="standby"]) .room-tv-led {
  background: var(--phosphor);
  box-shadow: 0 0 10px rgba(93, 255, 192, 0.75);
}
.tv-feet {
  display: flex;
  justify-content: space-between;
  padding: 0 14% 0;
  margin-top: -2px;
}
.tv-feet i {
  width: 28px;
  height: 8px;
  background: #1a1c24;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 3px 0 #0a0b10;
}

/* Entertainment center cabinet */
.entertainment-center {
  position: relative;
  z-index: 2;
  width: min(100%, 920px);
  margin: -4px auto 0;
}
.ec-wood {
  height: 14px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--wood-1) 0 18px,
      var(--wood-3) 18px 20px,
      var(--wood-2) 20px 38px
    );
  border: 1px solid #1a120c;
  box-shadow: inset 0 1px 0 rgba(255, 220, 170, 0.1);
}
.ec-top {
  border-radius: 8px 8px 0 0;
  height: 16px;
  margin: 0 1%;
}
.ec-base {
  border-radius: 0 0 10px 10px;
  height: 18px;
  margin: 0;
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
}
.ec-cabinet {
  position: relative;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.25) 0%, transparent 4%, transparent 96%, rgba(0,0,0,0.25) 100%),
    linear-gradient(180deg, #2e2218 0%, #1c1510 100%);
  border-left: 1px solid #4a3424;
  border-right: 1px solid #4a3424;
  padding: 12px 12px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 170, 0.06);
}
.shelf-bay {
  position: relative;
  margin-bottom: 12px;
  padding: 10px 8px 12px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.28) 0%, transparent 18%),
    linear-gradient(180deg, #1a1410 0%, #14100c 100%);
  border: 1px solid #3a2a1c;
  border-radius: 8px;
  box-shadow:
    inset 0 8px 16px rgba(0,0,0,0.35),
    inset 0 -1px 0 rgba(255,220,170,0.04);
}
.shelf-bay::before {
  content: "";
  position: absolute;
  left: 6px; right: 6px; bottom: 4px;
  height: 6px;
  background: linear-gradient(180deg, var(--wood-3), var(--wood-1));
  border-radius: 2px;
  opacity: 0.85;
  pointer-events: none;
}
.shelf-bay-lower {
  opacity: 0.92;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 20%),
    linear-gradient(180deg, #15110e 0%, #100c0a 100%);
}
.shelf-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: #c4a574;
  margin: 0 4px 10px;
}
.shelf-label-dim {
  color: #8a7a68;
}
.shelf-footnote {
  margin: 4px 6px 2px;
  font-size: 12px;
  color: #8a7a68;
}

.console-card {
  min-height: 118px;
  padding: 10px 8px 12px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, #1e2230 0%, #141824 100%);
  border-radius: 10px;
  /* Physical shelf unit, not SaaS tile */
  box-shadow:
    0 6px 0 #0a0c12,
    0 10px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border-color: #2a3140;
}
.room .sys-card::after {
  /* Hide accent hairline — shelf units use console-art instead */
  display: none;
}
.room .sys-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 8px 0 #0a0c12,
    0 14px 22px rgba(0, 0, 0, 0.4),
    0 0 20px color-mix(in srgb, var(--card-accent, var(--accent)) 22%, transparent);
}
.room .sys-card.selected {
  border-color: color-mix(in srgb, var(--card-accent, var(--accent)) 65%, #2a3140);
  box-shadow:
    0 6px 0 color-mix(in srgb, var(--card-accent, var(--accent)) 35%, #0a0c12),
    0 0 0 1px color-mix(in srgb, var(--card-accent, var(--accent)) 45%, transparent),
    0 12px 28px rgba(0, 0, 0, 0.4),
    0 0 24px color-mix(in srgb, var(--card-accent, var(--accent)) 20%, transparent);
}
.room .sys-card.is-soon:hover {
  transform: none;
  box-shadow: 0 6px 0 #0a0c12, 0 10px 18px rgba(0, 0, 0, 0.35);
}
.room .sys-kicker {
  font-size: 9px;
  color: #7a8498;
}
.room .sys-card strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}
.room .sys-card .sys-desc {
  font-size: 11px;
}
.console-art {
  display: block;
  width: 100%;
  height: 26px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--card-accent, var(--accent)), color-mix(in srgb, var(--card-accent, var(--accent)) 35%, #111));
  box-shadow: 0 0 12px color-mix(in srgb, var(--card-accent, var(--accent)) 35%, transparent);
  position: relative;
  overflow: hidden;
}
.console-art::after {
  content: "";
  position: absolute;
  inset: 8px 18% auto;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
}
.console-nes { border-radius: 4px; }
.console-snes { border-radius: 10px 10px 4px 4px; }
.console-gb, .console-gbc, .console-gba {
  width: 42%;
  margin-left: auto;
  margin-right: auto;
  height: 34px;
  border-radius: 8px;
}
.console-n64 {
  border-radius: 18px 18px 8px 8px;
  background:
    linear-gradient(90deg, #1a1a1a 0 10%, var(--sys-n64) 10% 90%, #1a1a1a 90%);
}
.console-soon {
  opacity: 0.45;
  filter: grayscale(0.6);
}
.sys-card.is-soon {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}
.sys-card.is-soon:hover {
  transform: none;
  border-color: var(--line);
}
.sys-card.is-soon strong { color: #94a3b8; }

/* Carpet + wood floor */
.room-carpet {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 4%;
  height: 14%;
  z-index: 1;
  pointer-events: none;
  border-radius: 50% / 20%;
  background:
    radial-gradient(ellipse at 50% 40%, #5a2a40 0%, #3a1a2a 55%, transparent 72%);
  opacity: 0.85;
}
.carpet-pattern {
  position: absolute;
  inset: 18% 12%;
  border-radius: 50% / 30%;
  background:
    repeating-conic-gradient(from 0deg at 50% 50%, #6a3450 0deg 12deg, #4a2034 12deg 24deg);
  opacity: 0.25;
  mix-blend-mode: soft-light;
}
.room-floor {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 12%;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      #2a1e14 0 40px,
      #342618 40px 42px,
      #241810 42px 80px
    );
  box-shadow: inset 0 12px 24px rgba(0,0,0,0.45);
}

/* ——— Responsive: simplify scene on narrow widths ——— */
@media (max-width: 900px) {
  .sys-grid,
  .sys-grid.shelf-grid-live { grid-template-columns: repeat(3, 1fr); }
  .sys-grid.shelf-grid-soon { grid-template-columns: repeat(2, 1fr); }
  .room { min-height: 0; }
  .room-bed,
  .room-window,
  .poster-c,
  .poster-d { display: none; }
  .room-lamp { transform: scale(0.85); left: 2%; bottom: 26%; }
  .poster-a { left: 3%; top: 8%; width: 56px; height: 74px; }
  .poster-b { left: 12%; top: 14%; width: 50px; height: 66px; }
  .room-stage { padding: 20px 12px 8px; }
  .room-tv { width: min(100%, 440px); }
}

@media (max-width: 640px) {
  .sys-grid,
  .sys-grid.shelf-grid-live,
  .sys-grid.shelf-grid-soon { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .console-card { min-height: 104px; padding: 10px 8px; }
  .sys-card strong { font-size: 16px; }
  .room {
    border-radius: 16px;
    min-height: 0;
  }
  .room-bed,
  .room-lamp,
  .lava-lamp,
  .room-window,
  .poster,
  .wall-stripe,
  .room-carpet { display: none; }
  .room-wall {
    inset: 0 0 18% 0;
    background: linear-gradient(180deg, #2a2438 0%, #1a1624 100%);
  }
  .room-stage { padding: 14px 8px 6px; }
  .room-tv { max-width: 100%; margin-bottom: 0; width: 100%; }
  .room-tv-chassis { padding: 12px 12px 8px; border-radius: 14px 14px 10px 10px; }
  .crt-speakers { display: none; }
  .no-signal strong { letter-spacing: 0.16em; }
  .ec-top, .ec-base { height: 12px; }
  .shelf-bay { padding: 8px 6px 10px; }
  .shelf-bay::before { height: 4px; }
  .room-floor { height: 8%; }
  .home { padding-left: 14px; padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .no-signal-snow,
  .no-signal-scan,
  .lamp-glow,
  .lava-glass .blob { animation: none; }
}


/* Local bookshelf / BIOS folder dialogs */
.bookshelf-list {
  max-height: min(48vh, 420px);
  overflow: auto;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.bookshelf-list li { margin: 0 0 6px; }
.shelf-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 12px 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.shelf-filter input {
  appearance: none;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
}
#folder-status:empty { display: none; }
/* ——— Bedroom north-star mock (photo room + chrome) ——— */
:root {
  --phosphor: #b8f014;
  --phosphor-dim: rgba(184, 240, 20, 0.35);
  --glass: rgba(12, 16, 22, 0.72);
  --glass-border: rgba(184, 240, 20, 0.35);
}

body.view-home {
  --accent2: var(--phosphor);
}

.top-links {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  margin-right: 12px;
}
.top-link,
.top-link-btn {
  appearance: none;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  padding: 4px 2px;
}
.top-link:hover,
.top-link-btn:hover,
.top-link:focus-visible,
.top-link-btn:focus-visible {
  color: var(--phosphor);
}

body.view-home .brand-text h1 {
  letter-spacing: 0.04em;
  font-size: 16px;
  text-transform: none;
}
body.view-home .tag {
  letter-spacing: 0.08em;
  text-transform: none;
  font-size: 11px;
}

.home--mock {
  display: grid;
  grid-template-columns: minmax(160px, 200px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  padding-left: max(20px, var(--safe-l));
  padding-right: max(20px, var(--safe-r));
}
.home--mock .home-hero { display: none; }

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 72px;
}
.side-nav-panel,
.side-nav-status {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.side-nav-panel {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 4px;
}
.side-nav-item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
}
.side-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.side-nav-item.is-active {
  border-color: var(--phosphor);
  box-shadow: 0 0 0 1px var(--phosphor-dim), 0 0 18px rgba(184, 240, 20, 0.12);
  background: rgba(184, 240, 20, 0.06);
}
.side-nav-item.is-active::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: var(--phosphor);
}
.side-nav-ico {
  width: 1.25em;
  text-align: center;
  opacity: 0.9;
}
.side-nav-status {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--muted);
}
.side-tip {
  margin: 0 0 10px;
  line-height: 1.4;
  color: var(--ink);
  font-size: 12px;
}
.side-ready {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.side-ver {
  margin-left: auto;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
}

.home-main { min-width: 0; }

.room.room--photo {
  --wood-1: transparent;
  position: relative;
  margin: 0 0 16px;
  min-height: 0;
  aspect-ratio: 1290 / 816;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--phosphor) 22%, var(--line));
  overflow: hidden;
  background: #0b0d12;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 28px 60px rgba(0, 0, 0, 0.5);
}
.room.room--photo .room-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

/* Hide legacy CSS-art props if any remain */
.room.room--photo .room-sky,
.room.room--photo .room-wall,
.room.room--photo .room-lamp,
.room.room--photo .room-window,
.room.room--photo .room-bed,
.room.room--photo .room-glow,
.room.room--photo .room-stage,
.room.room--photo .entertainment-center,
.room.room--photo .room-carpet,
.room.room--photo .room-floor { display: none !important; }

.hotspots {
  position: absolute;
  inset: 0;
  z-index: 3;
}
.room.room--photo .sys-card.hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  margin: 0;
  padding: 0;
  min-height: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  display: block;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
}
.room.room--photo .sys-card.hotspot::after { display: none; }
.room.room--photo .sys-card.hotspot .sys-kicker,
.room.room--photo .sys-card.hotspot .sys-desc,
.room.room--photo .sys-card.hotspot .console-art { display: none; }

/* Console-shaped silhouette stroke (live systems only) */
.hotspot-sil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.hotspot-sil path {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.12s ease, fill 0.12s ease, filter 0.12s ease;
  filter: none;
}
.room.room--photo .sys-card.hotspot:hover .hotspot-sil path,
.room.room--photo .sys-card.hotspot:focus-visible .hotspot-sil path,
.room.room--photo .sys-card.hotspot.selected .hotspot-sil path {
  stroke: var(--phosphor);
  fill: rgba(184, 240, 20, 0.07);
  filter:
    drop-shadow(0 0 4px rgba(184, 240, 20, 0.85))
    drop-shadow(0 0 10px rgba(184, 240, 20, 0.45));
}
/* Kill old rectangular hotspot chrome */
.room.room--photo .sys-card.hotspot:hover,
.room.room--photo .sys-card.hotspot:focus-visible,
.room.room--photo .sys-card.hotspot.selected {
  border: none;
  background: transparent;
  box-shadow: none;
  filter: none;
}

.hotspot-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--phosphor);
  background: rgba(8, 12, 18, 0.92);
  border: 1px solid var(--phosphor);
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(184, 240, 20, 0.2);
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 5;
}
.hotspot-label::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--phosphor);
}
.room.room--photo .sys-card.hotspot:hover .hotspot-label,
.room.room--photo .sys-card.hotspot:focus-visible .hotspot-label,
.room.room--photo .sys-card.hotspot.selected .hotspot-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Coming-soon: visible in plate, non-interactive, no play outline / no tip */
.room.room--photo .sys-card.hotspot.is-soon {
  opacity: 1;
  cursor: default;
  filter: none;
  pointer-events: none;
}
.room.room--photo .sys-card.hotspot.is-soon:hover,
.room.room--photo .sys-card.hotspot.is-soon:focus-visible {
  border: none;
  box-shadow: none;
  filter: none;
  background: transparent;
}
.room.room--photo .sys-card.hotspot.is-soon .hotspot-sil,
.room.room--photo .sys-card.hotspot.is-soon .hotspot-label {
  display: none !important;
}

.mock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}
.mock-action {
  display: inline-flex;
  align-items: center;
  min-width: min(220px, 100%);
  flex: 1 1 180px;
  max-width: 280px;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(30, 36, 48, 0.92), rgba(14, 18, 26, 0.92));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-weight: 700;
}
.mock-action:hover {
  border-color: var(--phosphor);
  box-shadow: 0 0 0 1px var(--phosphor-dim), 0 12px 32px rgba(0, 0, 0, 0.4);
}
.mock-action--ghost {
  flex: 0 1 auto;
  min-width: 0;
  max-width: none;
  opacity: 0.85;
  font-weight: 600;
}
.mock-action-ico { font-size: 16px; line-height: 1; }

.home--mock .home-note {
  text-align: center;
  margin: 16px auto 0;
  max-width: 52em;
}

.home--mock .recents-wrap {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .home--mock {
    grid-template-columns: 1fr;
    padding-top: 10px;
  }
  .side-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }
  .side-nav-panel {
    flex: 1 1 100%;
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
    gap: 6px;
  }
  .side-nav-item {
    flex: 1 1 auto;
    white-space: nowrap;
    padding: 8px 10px;
  }
  .side-nav-item.is-active::after { display: none; }
  .side-nav-status { flex: 1 1 100%; }
  .room.room--photo {
    min-height: 280px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .room.room--photo .room-photo {
    width: auto;
    min-width: 720px;
    height: 100%;
    max-height: 52vh;
  }
  .hotspots {
    min-width: 720px;
  }
  .top-links { display: none; }
}

@media (max-width: 560px) {
  .mock-action { flex: 1 1 100%; max-width: none; }
  body.view-home .brand-text h1 { font-size: 14px; }
  .room.room--photo .room-photo,
  .hotspots { min-width: 640px; }
}

/* ——— "Best on desktop" banner (shown on small / coarse-pointer devices) ——— */
.desktop-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px max(14px, var(--safe-l)) 10px max(14px, var(--safe-r));
  background: linear-gradient(180deg, rgba(184, 240, 20, 0.12), rgba(184, 240, 20, 0.05));
  border-bottom: 1px solid var(--glass-border, rgba(184, 240, 20, 0.35));
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}
.desktop-banner[hidden] { display: none; }
.desktop-banner-txt { flex: 1; min-width: 0; }
.desktop-banner-txt strong { color: var(--phosphor); letter-spacing: 0.02em; }
.desktop-banner-x {
  appearance: none;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.desktop-banner-x:hover { border-color: var(--phosphor); }

/* ——— Deck: the loader + emulator that lives BELOW the room map ——— */
/* The room photo up top is a visual map; selecting a console reveals this. */
#play {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4px 20px 44px;
  padding-left: max(20px, var(--safe-l));
  padding-right: max(20px, var(--safe-r));
  scroll-margin-top: 12px;
}
#play[hidden] { display: none !important; }

.deck-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border, var(--line));
  background: var(--glass, rgba(12, 16, 22, 0.72));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  position: relative;
}
.deck-head::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, transparent, var(--card-accent, var(--accent)), transparent);
  opacity: 0.7;
}
.deck-head-main { min-width: 0; }
.deck-eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--phosphor);
  margin-bottom: 4px;
}
.deck-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.deck-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 60ch;
}
.deck-up {
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* Per-system accent on the deck header, mirroring the console pips. */
body[data-system="nes"] .deck-head { --card-accent: var(--sys-nes); }
body[data-system="snes"] .deck-head { --card-accent: var(--sys-snes); }
body[data-system="gb"] .deck-head { --card-accent: var(--sys-gb); }
body[data-system="gbc"] .deck-head { --card-accent: var(--sys-gbc); }
body[data-system="gba"] .deck-head { --card-accent: var(--sys-gba); }
body[data-system="n64"] .deck-head { --card-accent: var(--sys-n64); }

.library-panel {
  max-width: 1280px;
  margin: 0 auto 18px;
  padding: 16px 18px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}
.library-panel .btn-row { margin-bottom: 8px; }
.library-panel .recents-wrap { margin-top: 16px; }
body.page-play #play {
  display: block;
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px 44px;
  padding-left: max(20px, var(--safe-l));
  padding-right: max(20px, var(--safe-r));
}
a.logo-btn { display: grid; place-items: center; text-decoration: none; }
a.deck-up { text-decoration: none; }

/* Obsolete mobile bottom-sheet toggle — panel now stacks inline. */
.sheet-toggle { display: none !important; }

@media (max-width: 900px) {
  #play { padding: 4px 14px 40px; }
  .deck-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .deck-up { align-self: flex-start; }
}

/* ——— Visual polish: silhouettes, lava, CRT chrome ——— */
h1,
.deck-title,
.boot-sys,
.shelf-label,
.home-eyebrow {
  font-family: var(--font-display);
}
.no-signal strong {
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  font-size: clamp(15px, 4.4vw, 28px);
  padding: 0 8px;
}
.home-eyebrow {
  color: #ffc14d;
  text-shadow: 0 0 18px rgba(255, 193, 77, 0.28);
}
.home-lead {
  font-size: 17px;
  max-width: 36em;
  color: #b4bccf;
}
.logo-mark {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.room {
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 180, 0.08),
    0 32px 70px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(255, 140, 60, 0.06);
}
.room::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 8;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.55'/></svg>");
}
.poster {
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.poster-a { filter: saturate(1.15); }
.poster-c {
  color: #1a1008;
  text-shadow: none;
}

.lava-lamp {
  position: absolute;
  right: 3.2%;
  bottom: 27%;
  width: 40px;
  height: 138px;
  z-index: 2;
  pointer-events: none;
}
.lava-cap {
  position: absolute;
  top: 0;
  left: 50%;
  width: 18px;
  height: 10px;
  margin-left: -9px;
  background: linear-gradient(180deg, #e8c48a, #8a7018);
  border-radius: 4px 4px 2px 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
.lava-glass {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 22px;
  height: 86px;
  margin-left: -11px;
  border-radius: 42% 42% 48% 48% / 14% 14% 58% 58%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 35%, transparent 70%, rgba(255, 255, 255, 0.08)),
    linear-gradient(180deg, rgba(255, 190, 90, 0.18), rgba(255, 70, 50, 0.22));
  border: 1.5px solid rgba(255, 210, 150, 0.28);
  overflow: hidden;
  box-shadow:
    inset 0 0 14px rgba(255, 90, 40, 0.4),
    0 0 28px rgba(255, 90, 40, 0.22);
}
.lava-glass .blob {
  position: absolute;
  left: 18%;
  width: 64%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffd27a, #ff4d5e 70%);
  filter: blur(0.4px);
}
.lava-glass .b1 {
  height: 20px;
  top: 52%;
  animation: lava-rise 7.2s ease-in-out infinite;
}
.lava-glass .b2 {
  height: 12px;
  width: 48%;
  left: 26%;
  top: 18%;
  animation: lava-rise 9s ease-in-out infinite reverse;
}
.lava-glass .b3 {
  height: 9px;
  width: 42%;
  left: 30%;
  top: 72%;
  animation: lava-rise 6.1s ease-in-out 0.6s infinite;
}
.lava-base {
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: 28px;
  height: 22px;
  margin-left: -14px;
  background: linear-gradient(180deg, #4a3a2c, #1a1612);
  border-radius: 3px 3px 8px 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
@keyframes lava-rise {
  0%, 100% { transform: translateY(14px) scale(1); }
  50% { transform: translateY(-30px) scale(1.12, 0.82); }
}

.room-tv-screen {
  --tv-accent: var(--phosphor);
  transition: box-shadow 0.28s ease, border-color 0.28s ease;
}
.room-tv-screen[data-hover] {
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.82),
    inset 0 0 48px color-mix(in srgb, var(--tv-accent) 32%, transparent),
    0 0 36px color-mix(in srgb, var(--tv-accent) 24%, transparent);
}
.room-tv-screen[data-hover] .no-signal strong {
  color: var(--tv-accent);
  text-shadow: 0 0 22px color-mix(in srgb, var(--tv-accent) 60%, transparent);
}
.room-tv-screen[data-hover] .no-signal-sub {
  color: color-mix(in srgb, var(--tv-accent) 70%, #9aa3b5);
}
.room-tv-chassis:has([data-hover]) .room-tv-led {
  background: var(--tv-accent);
  box-shadow: 0 0 12px var(--tv-accent);
}

.console-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: 50px;
  margin-bottom: 6px;
  background: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.45));
}
.console-art::after { display: none; }
.console-nes,
.console-snes,
.console-n64,
.console-gb,
.console-gbc,
.console-gba {
  width: 100%;
  height: 50px;
  margin-left: 0;
  margin-right: 0;
  border-radius: 0;
  background: none;
}
.console-sil {
  display: block;
  width: 92%;
  height: 48px;
  transition: transform 0.18s ease;
}
.console-art--hand {
  height: 58px;
}
.console-art--hand .console-sil {
  width: 40%;
  height: 56px;
}
.room .sys-card:hover .console-sil,
.room .sys-card:focus-visible .console-sil {
  transform: translateY(-3px) scale(1.05);
}
.room .sys-card {
  overflow: visible;
}
.console-card {
  min-height: 132px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.07) 0%, transparent 42%),
    linear-gradient(180deg, #232838 0%, #141824 100%);
}
.ec-wood {
  background:
    repeating-linear-gradient(
      90deg,
      var(--wood-1) 0 14px,
      #523a28 14px 16px,
      var(--wood-3) 16px 30px,
      var(--wood-2) 30px 46px
    );
}

body.page-play {
  background:
    radial-gradient(900px 520px at 10% -12%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 55%),
    radial-gradient(820px 440px at 94% 0%, color-mix(in srgb, var(--accent2) 14%, transparent), transparent 50%),
    radial-gradient(600px 380px at 50% 110%, rgba(0, 0, 0, 0.45), transparent 55%),
    var(--bg);
}
body.page-play .deck-head {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card-accent, var(--accent)) 10%, rgba(16, 20, 30, 0.92)) 0%, rgba(12, 16, 22, 0.82) 100%);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body.page-play .deck-title {
  font-size: 26px;
  letter-spacing: 0.03em;
}
body.page-play .library-panel {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, var(--panel)) 0%, var(--panel) 32%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 32px rgba(0, 0, 0, 0.22);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
}
body.page-play .bezel {
  border-radius: 24px 24px 18px 18px;
  padding: 22px 36px 16px;
  background:
    linear-gradient(160deg, #4e5466 0%, #2c303c 38%, #161922 100%);
  border: 3px solid #0c0e14;
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.12),
    inset 0 -8px 16px rgba(0, 0, 0, 0.35),
    0 0 40px color-mix(in srgb, var(--accent) 12%, transparent);
}
body.page-play .bezel::before {
  inset: 14px 14px auto 14px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent2) 40%, transparent), transparent);
}
body.page-play .bezel::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 30px;
  bottom: 56px;
  width: 11px;
  pointer-events: none;
  border-radius: 2px;
  background: repeating-linear-gradient(
    180deg,
    #0a0b10 0 3px,
    transparent 3px 7px
  );
  opacity: 0.42;
}
body.page-play .hint {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  color: #8b93a7;
}
body.page-play .panel {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--panel)) 0%, var(--panel) 28%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    var(--shadow-sm);
}
body.page-play .panel h2 {
  color: color-mix(in srgb, var(--accent2) 55%, var(--muted));
}
.boot-sys {
  letter-spacing: 0.22em;
  color: var(--accent2);
}
.recent {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}
.recent:hover,
.recent:focus-within {
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .lava-lamp { transform: scale(0.85); right: 1.5%; }
  body.page-play .bezel { padding: 16px 16px 12px; }
  body.page-play .bezel::after { display: none; }
}
@media (max-width: 640px) {
  .lava-lamp { display: none; }
  .console-art--hand .console-sil { width: 48%; }
}

@media (prefers-reduced-motion: reduce) {
  .lava-glass .blob,
  .console-sil { animation: none; transition: none; }
  .room .sys-card:hover .console-sil,
  .room .sys-card:focus-visible .console-sil {
    transform: none;
  }
  .btn:hover,
  .btn.primary:hover,
  .recent:hover { transform: none; }
}
