:root[data-theme="phosphor"] body {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='240' viewBox='0 0 320 240'%3E%3Cg fill='none' stroke='%23667146' stroke-opacity='.28'%3E%3Cpath d='M0 32h42l24 24h80v38h34l36 36h104M0 202h64l28-28h56v-26h50l36 36h86M260 0v28l-22 22v30h82M36 240v-26l22-22v-46H0'/%3E%3Ccircle cx='146' cy='56' r='4'/%3E%3Ccircle cx='148' cy='174' r='4'/%3E%3Ccircle cx='238' cy='80' r='4'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(90deg, transparent 23px, #66714618 24px, transparent 25px) 0 0 / 96px 96px,
    linear-gradient(transparent 23px, #66714618 24px, transparent 25px) 0 0 / 96px 96px,
    var(--bg);
}
html[data-theme="phosphor"] body::before,
html[data-theme="phosphor"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}
html[data-theme="phosphor"] body::before {
  background: repeating-linear-gradient(0deg, #0c100b22 0 1px, transparent 1px 4px);
  opacity: .65;
}
html[data-theme="phosphor"] body::after {
  background: radial-gradient(ellipse at center, transparent 55%, #0c100b66 100%);
}
html[data-theme="phosphor"] body :is(.shell,.terminal,.cabinet,.arcade-scores,.overlay-card,.caution,.signal,.session-panel,.transport,.scene-rack,.song-panel,.editor,.mixer-panel,.performance-rack,.voice-panel,.drum-voice-bank) {
  border-radius: 0 !important;
  background:
    linear-gradient(90deg, #efb95440 0 12px, transparent 12px) left top / 40px 1px repeat-x,
    linear-gradient(#66714618 1px, transparent 1px) 0 0 / 8px 8px,
    var(--site-glass-panel,var(--panel)) !important;
  box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 4px var(--edge), 5px 5px 0 var(--bg) !important;
}
html[data-theme="phosphor"] body :is(h1,h2,.scoreboard strong) {
  text-shadow: 2px 0 #ff795533, -1px 0 #82d39b44, 0 0 14px #efb95422;
}
html[data-theme="phosphor"] body :is(button,select,summary,kbd,.button,.scene-pad,.site-header__buttons a,.site-appearance__panel,.sectors li) {
  border-radius: 0 !important;
  box-shadow: inset 1px 1px 0 #f4e4b022, inset -2px -2px 0 var(--bg);
}
html[data-theme="phosphor"] body :is(button,summary,.button,.site-header__buttons a):hover {
  background-image: repeating-linear-gradient(135deg, transparent 0 3px, #efb95412 3px 4px);
}
html[data-theme="phosphor"] body .site-header {
  background: var(--bg);
  box-shadow: 0 3px 0 var(--edge), 0 5px 0 var(--bg);
}
:root[data-theme="phosphor"] body .site-header .site-header__buttons a[aria-current] {
  background: var(--chords);
  color: var(--bg);
  box-shadow: inset 0 -4px 0 #0c100b44;
}
:root[data-theme="phosphor"] body .site-header__inner::after {
  content: "";
  position: absolute;
  height: 3px;
  bottom: 0;
  left: 20px;
  right: 20px;
  background: repeating-linear-gradient(90deg, var(--chords) 0 16px, transparent 16px 19px, var(--edge) 19px 44px, transparent 44px 60px);
  pointer-events: none;
}
html[data-theme="phosphor"] body :is(input,select,textarea) { accent-color: var(--chords); }
html[data-theme="phosphor"] body input[type="range"] {
  background-image: repeating-linear-gradient(90deg, var(--edge) 0 1px, transparent 1px 8px);
}
html[data-theme="phosphor"] body :is(.screen,.xy-pad,.matrix,.draw-lane) {
  border-radius: 0;
  outline: 1px solid var(--edge);
  outline-offset: -1px;
  background-color: var(--bg);
}
html[data-theme="phosphor"] body :is(.screen canvas,.specimens canvas) {
  image-rendering: pixelated;
  filter: sepia(.55) saturate(.8);
}
html[data-theme="phosphor"] body :is(.sectors li,.game-actions button,.touch-controls button,.touch-controls #fire,kbd) {
  background-color: var(--theme-surface);
  color: var(--text);
  border-color: var(--edge);
}
html[data-theme="phosphor"] body .cabinet {
  position: relative;
  background-image:
    linear-gradient(90deg, transparent 0 20%, #efb95444 20% 20.15%, transparent 20.15% 80%, #82d39b44 80% 80.15%, transparent 80.15%),
    linear-gradient(transparent 0 14px, #efb95444 14px 15px, transparent 15px) !important;
}
html[data-theme="phosphor"] body .cabinet::before {
  content: "◈  SIGNAL LAB / UNIT 78";
  position: absolute;
  top: -11px;
  left: 18px;
  padding: 0 8px;
  color: var(--chords);
  background: var(--bg);
  font-size: 9px;
  letter-spacing: 2px;
  pointer-events: none;
}
html[data-theme="phosphor"] body .screen-grain { display: none; }
html[data-theme="phosphor"][data-retro-effects="on"] body .retro-echo {
  animation: ghost-circuit-echo 700ms ease-out;
}
@keyframes ghost-circuit-echo {
  from { box-shadow: 3px 0 0 #efb95488, 6px 0 0 #82d39b55, 9px 0 0 #ff795522, inset 0 0 12px #efb95422; }
  to { box-shadow: 3px 0 0 #efb95400, 6px 0 0 #82d39b00, 9px 0 0 #ff795500, inset 0 0 12px #efb95400; }
}
body .site-appearance__panel .site-effects-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
body .site-effects-option input { width: 18px; height: 18px; flex: 0 0 18px; }
html[data-theme="phosphor"][data-retro-effects="off"] body::before,
html[data-theme="phosphor"][data-retro-effects="off"] body::after { display: none; }
html[data-theme="phosphor"][data-retro-effects="off"] body :is(h1,h2,.scoreboard strong) { text-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  html[data-theme="phosphor"] body .retro-echo { animation: none; }
}
@media (prefers-contrast: more) {
  html[data-theme="phosphor"] body::before,
  html[data-theme="phosphor"] body::after { display: none; }
  html[data-theme="phosphor"] body :is(h1,h2,.scoreboard strong) { text-shadow: none; }
}
