* {
  box-sizing: border-box;
  border-radius: 0 !important;
}

:root {
  --ui-code-font: "Lucida Console", "Cascadia Mono", "Consolas", "Courier New", monospace;
  --ui-text-main: rgba(230, 242, 255, 0.9);
  --ui-text-soft: rgba(184, 212, 238, 0.82);
  --ui-panel-top: rgba(14, 34, 64, 0.42);
  --ui-panel-bottom: rgba(8, 16, 30, 0.18);
  --ui-panel-line: rgba(168, 206, 238, 0.3);
  --ui-panel-glow: rgba(96, 164, 220, 0.22);
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #0a0a0a;
  cursor: default;
  font-family: "Tahoma", "MS Sans Serif", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  isolation: isolate;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Very subtle vignette: focus on center */
#canvas-container::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.25) 100%);
  opacity: 0.5;
}
#canvas-container::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(120, 210, 255, 0.06) 0px,
      rgba(120, 210, 255, 0.06) 1px,
      rgba(0, 0, 0, 0) 1px,
      rgba(0, 0, 0, 0) 3px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(90, 180, 255, 0.03) 0px,
      rgba(90, 180, 255, 0.03) 1px,
      rgba(0, 0, 0, 0) 1px,
      rgba(0, 0, 0, 0) 4px
    );
  mix-blend-mode: screen;
  opacity: var(--interlace-opacity, 0.16);
  animation: screen-flicker 4.2s steps(2, end) infinite;
}

@keyframes screen-flicker {
  0%, 17%, 100% { opacity: 0.15; }
  18% { opacity: 0.2; }
  19% { opacity: 0.14; }
  64% { opacity: 0.18; }
  65% { opacity: 0.14; }
}

/* Intentional UI overlay layer — floats above effect canvas */
.ui-overlay {
  position: fixed;
  inset: 0;
  z-index: 105;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px 100px;
  isolation: isolate;
}

.ui-intro-hint {
  font: 12px/1.5 "Tahoma", "MS Sans Serif", "Segoe UI", sans-serif;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.04em;
  text-align: center;
  max-width: 360px;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ui-intro-hint.ui-hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease-out, visibility 0.6s;
}

.ui-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  font: 11px/1.4 "Tahoma", "MS Sans Serif", sans-serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #000;
  background: #c0c0c0;
  padding: 6px 14px;
  border: 2px solid #000;
  box-shadow:
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #fff,
    inset -2px -2px 0 #000,
    inset 2px 2px 0 #dfdfdf,
    2px 2px 0 rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.ui-toast.ui-visible {
  opacity: 1;
  visibility: visible;
}

.hud-top-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2500;
  pointer-events: none;
  display: flex;
  align-items: stretch;
  height: 22px;
  padding: 0;
  color: #000;
  font: 11px/22px "Tahoma", "MS Sans Serif", sans-serif;
  letter-spacing: 0.01em;
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  box-shadow: inset 0 1px 0 #fff, 0 1px 0 #404040;
  text-shadow: none;
}
.hud-menu-items {
  display: flex;
  align-items: center;
  pointer-events: auto;
  flex-shrink: 0;
  padding: 0 2px;
}
.hud-menu-item {
  display: inline-block;
  padding: 0 7px;
  color: #000;
  cursor: default;
  height: 20px;
  line-height: 20px;
}
.hud-menu-item:hover {
  background: #000080;
  color: #fff;
}
.hud-menu-item .hud-accel {
  text-decoration: underline;
}
.hud-status-bar {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 2px 3px 2px 6px;
  padding: 0 4px;
  color: #000;
  font: 10px/18px "Tahoma", "MS Sans Serif", sans-serif;
  background: #c0c0c0;
  box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #808080;
}

/* ── Win95 Folder Window ── */
.w95-window {
  position: fixed;
  left: 12px;
  top: 32%;
  transform: translateY(-50%);
  width: 240px;
  z-index: 1500;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow:
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #fff,
    inset -2px -2px 0 #000,
    inset 2px 2px 0 #dfdfdf,
    2px 2px 0 rgba(0, 0, 0, 0.4);
  font: 11px/1.3 "Tahoma", "MS Sans Serif", sans-serif;
  color: #000;
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  flex-direction: column;
}
.w95-titlebar {
  display: flex;
  align-items: center;
  height: 18px;
  padding: 1px 2px 1px 3px;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  cursor: default;
}
.w95-titlebar-icon {
  font-size: 12px;
  margin-right: 3px;
  line-height: 1;
}
.w95-titlebar-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}
.w95-titlebar-buttons {
  display: flex;
  gap: 2px;
}
.w95-titlebar-buttons button {
  width: 16px;
  height: 14px;
  background: #c0c0c0;
  border: 1px solid #000;
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff;
  font: 700 9px/1 "Tahoma", "MS Sans Serif", sans-serif;
  color: #000;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.w95-titlebar-buttons button:active {
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
}
.w95-menubar {
  display: flex;
  padding: 1px 0;
  border-bottom: 1px solid #808080;
  box-shadow: 0 1px 0 #fff;
}
.w95-menubar span {
  padding: 1px 6px;
  cursor: default;
  font-size: 11px;
}
.w95-menubar span:hover {
  background: #000080;
  color: #fff;
}
.w95-menubar span u {
  text-decoration: underline;
}
.w95-filelist {
  background: #fff;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #dfdfdf;
  margin: 4px;
  padding: 4px;
  min-height: 60px;
  flex: 1;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: start;
  gap: 2px;
  scrollbar-width: thin;
}
.w95-filelist::-webkit-scrollbar { width: 16px; }
.w95-filelist::-webkit-scrollbar-track {
  background: #c0c0c0;
  border-left: 1px solid #808080;
}
.w95-filelist::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border: 1px solid #000;
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff;
}
.w95-filelist::-webkit-scrollbar-button { display: block; height: 16px; background: #c0c0c0; border: 1px solid #000; box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff; }
.w95-file-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  cursor: default;
  text-align: center;
  border: 1px solid transparent;
}
.w95-file-item:hover {
  background: rgba(0, 0, 128, 0.06);
}
.w95-file-item.selected {
  background: #000080;
  color: #fff;
}
.w95-file-item.selected .w95-file-name {
  background: #000080;
  color: #fff;
}
.w95-file-icon {
  width: 32px;
  height: 32px;
  pointer-events: none;
}
.w95-file-icon svg {
  width: 32px;
  height: 32px;
}
.w95-file-name {
  font-size: 10px;
  margin-top: 2px;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}
.w95-empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px 8px;
  color: #808080;
  font-size: 10px;
}
.w95-statusbar {
  display: flex;
  align-items: center;
  height: 18px;
  padding: 0 4px;
  font-size: 10px;
  color: #000;
  box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #808080;
  margin: 0 4px 4px;
}
.w95-tooltip {
  position: fixed;
  z-index: 9999;
  background: #ffffe1;
  border: 1px solid #000;
  padding: 2px 5px;
  font: 11px/1.4 "Tahoma", "MS Sans Serif", sans-serif;
  color: #000;
  white-space: pre;
  pointer-events: none;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}
.w95-filelist.drag-over {
  background: #e8e8ff;
  outline: 2px dashed #000080;
  outline-offset: -3px;
}
.w95-window-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ── Win95 Dropdown Menu ── */
.w95-dropdown {
  position: fixed;
  z-index: 9990;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow:
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #fff,
    2px 2px 0 rgba(0, 0, 0, 0.35);
  padding: 2px;
  min-width: 140px;
  font: 11px/1.3 "Tahoma", "MS Sans Serif", sans-serif;
  color: #000;
}
.w95-dropdown-item {
  padding: 3px 20px 3px 8px;
  cursor: default;
  white-space: nowrap;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.w95-dropdown-item:hover:not(.disabled) {
  background: #000080;
  color: #fff;
}
.w95-dd-shortcut {
  color: #808080;
  margin-left: auto;
}
.w95-dropdown-item:hover:not(.disabled) .w95-dd-shortcut {
  color: #c0c0c0;
}
.w95-dropdown-item.disabled {
  color: #808080;
  text-shadow: 1px 1px 0 #fff;
}
.w95-dropdown-sep {
  height: 1px;
  margin: 3px 2px;
  background: #808080;
  box-shadow: 0 1px 0 #fff;
}

/* ── Win95 Resize Handle ── on the outer .w95-window */
.w95-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  cursor: se-resize;
  z-index: 2;
  /* Win95 grip dots */
  background-image:
    radial-gradient(circle, #fff 1px, transparent 1px),
    radial-gradient(circle, #808080 1px, transparent 1px);
  background-size: 4px 4px;
  background-position: 1px 1px, 2px 2px;
}
/* Prevent text selection during drag/resize */
body.w95-dragging,
body.w95-resizing {
  cursor: default !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}
body.w95-resizing { cursor: se-resize !important; }
body.w95-dragging { cursor: default !important; }

/* ── Win95 File List scrollbars (both axes) ── */
.w95-filelist {
  overflow: auto;
}
.w95-filelist::-webkit-scrollbar { width: 16px; height: 16px; }
.w95-filelist::-webkit-scrollbar-corner { background: #c0c0c0; }

/* ── MIDI Play/Stop button icons (WMP95 transport) ── */
.midi-btn-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 3px;
  position: relative;
}
.midi-btn-play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #000080;
}
.midi-player-btn:disabled .midi-btn-play {
  border-left-color: #808080;
}
.midi-player-btn:hover:not(:disabled) .midi-btn-play {
  border-left-color: #0000c0;
}
.midi-btn-stop {
  width: 10px;
  height: 10px;
  background: #000080;
}
.midi-player-btn:disabled .midi-btn-stop {
  background: #808080;
}
.midi-player-btn:hover:not(:disabled) .midi-btn-stop {
  background: #0000c0;
}

/* Windows 95 inspired MIDI UI */
.midi-float-panel {
  position: fixed;
  top: 28px;
  right: 12px;
  z-index: 1100;
  width: 370px;
  max-width: 370px;
  padding: 12px 14px;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow:
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #fff,
    inset -2px -2px 0 #000,
    inset 2px 2px 0 #dfdfdf,
    0 4px 0 rgba(0, 0, 0, 0.35);
  isolation: isolate;
}
.midi-progress-wrap.midi-progress-float {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: auto;
  transform: none;
  width: 370px;
  height: 30px;
  z-index: 1120;
  padding: 3px;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow:
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #fff,
    inset -2px -2px 0 #000,
    inset 2px 2px 0 #dfdfdf,
    0 4px 0 rgba(0, 0, 0, 0.35);
}
.midi-progress-wrap.midi-progress-float[data-playing="1"] {
  animation: midi-progress-breathe 2.6s ease-in-out infinite;
}
.midi-progress-wrap.midi-progress-float .midi-progress-bar {
  position: relative;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  box-shadow:
    inset 1px 1px 0 #808080,
    inset -1px -1px 0 #dfdfdf;
}
.midi-progress-wrap.midi-progress-float .midi-progress-bar::before {
  display: none;
}
.midi-progress-wrap.midi-progress-float .midi-progress-fill {
  left: 0;
  right: auto;
  top: 0;
  bottom: auto;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 0, 128, 0.7), rgba(80, 128, 255, 0.9));
  box-shadow: 0 0 6px rgba(80, 128, 255, 0.4);
}
.midi-progress-wrap.midi-progress-float .midi-progress-wave {
  opacity: 0.8;
  mix-blend-mode: screen;
}
.midi-progress-wrap.midi-progress-float[data-playing="1"] .midi-progress-wave {
  animation: midi-progress-wave-breathe 2.2s ease-in-out infinite;
}

@keyframes midi-progress-breathe {
  0%, 100% {
    box-shadow:
      inset -1px -1px 0 #808080,
      inset 1px 1px 0 #fff,
      inset -2px -2px 0 #000,
      inset 2px 2px 0 #dfdfdf,
      0 4px 0 rgba(0, 0, 0, 0.35);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      inset -1px -1px 0 #808080,
      inset 1px 1px 0 #fff,
      inset -2px -2px 0 #000,
      inset 2px 2px 0 #dfdfdf,
      0 4px 0 rgba(0, 0, 0, 0.35),
      0 0 10px rgba(80, 128, 255, 0.2);
    filter: brightness(1.04);
  }
}

@keyframes midi-progress-wave-breathe {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 0.96; }
}

/* Legacy player bar (when #player-bar-root exists) */
.player-bar-root {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  pointer-events: none;
  isolation: isolate;
}
.player-bar-root > * {
  pointer-events: auto;
}
.player-bar {
  background: rgba(18, 18, 20, 0.88);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
  backdrop-filter: blur(24px) saturate(1.15);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  padding: 12px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.25s ease;
}
.player-bar-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 620px;
  margin: 0 auto;
  width: 100%;
}
.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.player-midi-toggle {
  padding: 4px 10px;
  border-radius: 0;
  border: 1px solid #000;
  background: #c0c0c0;
  color: #000;
  font: 11px/1.25 "Tahoma", "MS Sans Serif", sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #fff,
    inset -2px -2px 0 #000,
    inset 2px 2px 0 #dfdfdf;
  transition: filter 0.12s ease;
}
.player-midi-toggle:hover {
  filter: brightness(1.03);
}
.player-midi-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.player-midi-drawer-open {
  max-height: 220px;
}

/* MIDI panel (floating or inside drawer) */
.midi-player {
  padding: 6px 0 2px;
  pointer-events: auto;
  font: 11px/1.35 "Tahoma", "MS Sans Serif", sans-serif;
  color: #0a0a0a;
  background: transparent;
  min-width: 280px;
  border: none;
  letter-spacing: 0.01em;
}
.midi-player:hover {
  background: transparent;
}
.midi-player-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 2px 0 4px;
}
.midi-player-label {
  display: block;
  margin-bottom: 4px;
  cursor: default;
  white-space: nowrap;
}
.midi-player-file {
  margin-left: 4px;
  cursor: pointer;
  font-size: 10px;
}
.midi-player-tracks {
  margin: 6px 0 4px;
  max-height: 120px;
  overflow-y: auto;
  padding: 4px 5px;
  scrollbar-width: thin; /* Firefox 64+, Chrome 121+ */
  border: 1px solid #000;
  background: #fff;
}
.midi-player-tracks::-webkit-scrollbar {
  width: 8px;
}
.midi-player-tracks::-webkit-scrollbar-thumb {
  background: #888;
}
.midi-player-track {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
  padding: 1px 0;
}
.midi-player-track:hover {
  background: rgba(0, 0, 128, 0.08);
}
.midi-track-swatch {
  width: 9px;
  height: 9px;
  border: 1px solid #222;
  flex: 0 0 auto;
}
.midi-player-select {
  margin-left: 3px;
  padding: 1px 4px;
  border-radius: 0;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font: inherit;
  cursor: pointer;
}
.midi-player-info {
  font-size: 11px;
  color: #101010;
  margin: 4px 0;
}
.midi-player-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2px 10px;
  font: 10px/1.4 "Tahoma", "MS Sans Serif", sans-serif;
  color: #00c000;
  margin-bottom: 4px;
  padding: 5px 6px;
  background: #000;
  border: 1px solid #808080;
  box-shadow: inset 1px 1px 0 #404040, inset -1px -1px 0 #c0c0c0;
}
.midi-player-metrics span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.midi-player-metrics .midi-metrics-wide {
  grid-column: 1 / -1;
}
.midi-player-buttons {
  display: flex;
  gap: 0;
  margin-top: 6px;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow:
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #fff;
  width: fit-content;
}
.midi-player-btn {
  padding: 5px 14px;
  border-radius: 0;
  border: none;
  border-right: 1px solid #808080;
  background: #c0c0c0;
  color: #000;
  font: bold 11px/1.2 "Tahoma", "MS Sans Serif", sans-serif;
  cursor: pointer;
  letter-spacing: 0.04em;
  box-shadow:
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #fff,
    inset -2px -2px 0 #404040,
    inset 2px 2px 0 #dfdfdf;
  transition: none;
}
.midi-player-btn:last-child {
  border-right: none;
}
.midi-player-btn:active:not(:disabled) {
  box-shadow:
    inset 1px 1px 0 #808080,
    inset -1px -1px 0 #fff;
  padding: 6px 13px 4px 15px;
}
.midi-player-btn:hover:not(:disabled) {
  background: #d0d0d0;
}
.midi-player-btn:disabled {
  opacity: 0.50;
  cursor: not-allowed;
}
.midi-player-btn-tap {
  padding-left: 10px;
  padding-right: 10px;
}
.midi-player-key-badge {
  display: inline-block;
  background: #000080;
  color: #fff;
  font: bold 10px Tahoma, sans-serif;
  padding: 2px 8px;
  border-radius: 2px;
  margin-left: 6px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  vertical-align: middle;
}

/* Progress bar: inside player bar, wave = complexity */
.midi-progress-wrap {
  width: 100%;
  padding: 0;
}
.midi-progress-bar {
  position: relative;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  background: #111822;
  border: none;
  cursor: pointer;
  transition: filter 0.12s ease;
}
.midi-progress-bar:hover {
  filter: brightness(1.05);
}
.midi-progress-wave {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.midi-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(245, 250, 255, 0.4) 0%, rgba(255, 255, 255, 0.94) 100%);
  border-radius: 0;
}

/* Main-screen piano roll */
.midi-roll-overlay {
  position: fixed;
  left: 3.2%;
  right: 3.2%;
  bottom: 34px;
  height: 36vh;
  min-height: 220px;
  max-height: 430px;
  z-index: 1110;
  pointer-events: none;
}
.midi-roll-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  cursor: crosshair;
  pointer-events: auto;
  mix-blend-mode: screen;
  opacity: 0.88;
}
.midi-roll-meta {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 6px;
  color: var(--ui-text-main);
  background: linear-gradient(90deg, rgba(8, 34, 72, 0.24), rgba(16, 132, 208, 0.11));
  border-top: 1px solid var(--ui-panel-line);
  border-bottom: 1px solid rgba(0, 0, 0, 0.42);
  font: 10px/1 var(--ui-code-font);
  letter-spacing: 0.07em;
  text-shadow: 0 0 8px rgba(120, 194, 255, 0.22);
  pointer-events: none;
}
.midi-roll-info {
  position: absolute;
  top: 20px;
  max-width: 46%;
  padding: 2px 6px;
  color: var(--ui-text-main);
  background: linear-gradient(180deg, rgba(8, 28, 58, 0.22), rgba(16, 108, 174, 0.1));
  border: 1px solid rgba(162, 196, 226, 0.26);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.2),
    inset -1px -1px 0 rgba(0, 0, 0, 0.42),
    0 0 8px rgba(85, 165, 226, 0.14);
  font: 10px/1.06 var(--ui-code-font);
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 8px rgba(120, 194, 255, 0.18);
  pointer-events: none;
}
.midi-roll-info-left {
  left: 8px;
}
.midi-roll-info-right {
  right: 8px;
  text-align: right;
}
.midi-roll-tooltip {
  position: absolute;
  min-width: 136px;
  max-width: 220px;
  padding: 4px 7px;
  border: 1px solid rgba(160, 200, 236, 0.44);
  background: linear-gradient(180deg, rgba(12, 28, 48, 0.84), rgba(8, 16, 30, 0.64));
  color: rgba(232, 244, 255, 0.95);
  font: 11px/1.3 var(--ui-code-font);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.2),
    inset -1px -1px 0 rgba(0, 0, 0, 0.5),
    0 0 10px rgba(110, 190, 255, 0.2);
  pointer-events: none;
}

@media (max-width: 720px) {
  .midi-float-panel {
    right: 8px;
    top: 26px;
    width: 284px;
    max-width: 284px;
  }
  .midi-progress-wrap.midi-progress-float {
    right: 8px;
    bottom: 8px;
    width: 284px;
    height: 26px;
    padding: 3px;
  }
  .midi-roll-overlay {
    left: 2.4%;
    right: 2.4%;
    height: 30vh;
    min-height: 170px;
    bottom: 28px;
  }
  .midi-roll-meta {
    font-size: 9px;
    height: 14px;
  }
  .midi-roll-info {
    top: 16px;
    max-width: 48%;
    font-size: 9px;
    padding: 1px 4px;
  }
  #beat-step-viz {
    left: 8px;
    bottom: 8px;
    height: 18px;
    width: 80px;
  }
}

/* ═══ Y2K Design Elements ═══ */

/*
 * LAYOUT MAP (avoid overlaps with note text at 72%/88% center)
 * ┌─────────────────────────────────────────┐
 * │ [SysID]              [KeySig] [Bracket] │  top 2-6%
 * │                                         │
 * │   +               +                     │  crosshairs 33%
 * │            [Waveform right edge]         │  right edge 35-65%
 * │                                         │
 * │   +               +                     │  crosshairs 66%
 * │ [Chord]                       [VelMtr]  │  left 62%, right 62%
 * │         ═══ NOTE TEXT ═══               │  72% center
 * │ [Spectrum]     [DataStream]    [ArcRing]│  bottom 4-8%
 * │ [OrbitDots]    [EdgeLines]     [VHS]    │
 * └─────────────────────────────────────────┘
 */

/* ── Global Glitch Keyframes ── */
/* y2k-glitch-shift and y2k-flicker — removed (Win95 cleanup) */
@keyframes y2k-chromatic-shift {
  0%, 88%, 100% { text-shadow: 0 0 12px currentColor; }
  90% { text-shadow: 3px 0 0 rgba(255,0,80,0.7), -3px 0 0 rgba(0,200,255,0.7), 0 0 12px currentColor; }
  92% { text-shadow: -2px 1px 0 rgba(255,0,80,0.5), 2px -1px 0 rgba(0,200,255,0.5), 0 0 12px currentColor; }
  94% { text-shadow: 4px 0 0 rgba(255,0,80,0.8), -4px 0 0 rgba(0,200,255,0.8), 0 0 16px currentColor; }
}
@keyframes y2k-noise-bar {
  0%, 100% { background-position: 0 0; }
  10% { background-position: -5% 0; }
  30% { background-position: 3% 0; }
  50% { background-position: -8% 0; }
  70% { background-position: 2% 0; }
  90% { background-position: -3% 0; }
}
/* y2k-edge-pulse — removed (Win95 cleanup) */
@keyframes y2k-waveform-drift {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.55; }
}

/* ── Corner Bracket Frame — removed ── */

/* ── Cross-hair Registration Marks ── at 1/3 grid */
.y2k-cross {
  position: absolute;
  transform: translate(-50%, -50%);
  font: 300 22px/1 var(--ui-code-font);
  color: rgba(200, 235, 255, 0.4);
  text-shadow: 2px 0 0 rgba(255, 50, 80, 0.18), -2px 0 0 rgba(50, 200, 255, 0.18), 0 0 12px rgba(120, 190, 255, 0.25);
  pointer-events: none;
  mix-blend-mode: screen;
  animation: y2k-chromatic-shift 4s ease-in-out infinite;
}
.y2k-cross::after {
  content: attr(data-coord);
  position: absolute;
  left: 16px;
  top: -3px;
  font: 400 7px/1 var(--ui-code-font);
  letter-spacing: 0.14em;
  color: rgba(160, 210, 255, 0.22);
  white-space: nowrap;
}

/* ── Horizontal Scan Line ── full width CRT sweep */
#y2k-scanline {
  position: fixed;
  left: 0;
  right: 0;
  height: 2px;
  top: 0;
  z-index: 1360;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(200, 240, 255, 0.06) 5%,
    rgba(220, 250, 255, 0.5) 25%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(220, 250, 255, 0.5) 75%,
    rgba(200, 240, 255, 0.06) 95%,
    transparent 100%
  );
  box-shadow: 0 0 24px rgba(140, 220, 255, 0.3), 0 0 6px rgba(255, 255, 255, 0.35);
  mix-blend-mode: screen;
  will-change: transform;
  animation: y2k-scan-sweep 5.5s linear infinite;
}
#y2k-scanline::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  height: 1px;
  background: linear-gradient(90deg, transparent 8%, rgba(200, 240, 255, 0.18) 50%, transparent 92%);
  opacity: 0.5;
}
@keyframes y2k-scan-sweep {
  0%   { transform: translateY(100vh); opacity: 0; }
  2%   { opacity: 0.85; }
  48%  { opacity: 0.85; }
  50%  { opacity: 0.12; }
  52%  { opacity: 0.85; }
  94%  { opacity: 0.85; }
  98%  { opacity: 0; }
  100% { transform: translateY(-2vh); opacity: 0; }
}

/* ── Data Stream ── bottom strip, full width */
#y2k-datastream {
  position: fixed;
  bottom: 1.5%;
  left: 2%;
  right: 2%;
  height: 16px;
  z-index: 1375;
  pointer-events: none;
  overflow: hidden;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 4%, black 96%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 4%, black 96%, transparent 100%);
}
.y2k-datastream-inner {
  white-space: nowrap;
  font: 400 10px/16px var(--ui-code-font);
  letter-spacing: 0.16em;
  color: rgba(200, 230, 255, 0.5);
  text-shadow: 1px 0 0 rgba(255, 60, 80, 0.2), -1px 0 0 rgba(50, 210, 255, 0.2), 0 0 8px rgba(120, 190, 255, 0.25);
  animation: y2k-stream-scroll 20s linear infinite;
}
@keyframes y2k-stream-scroll {
  0%   { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

/* ── Gradient Mesh Corners — removed ── */

/* ── Spectrum Analyzer ── BOTTOM-LEFT cluster */
#y2k-spectrum {
  position: fixed;
  bottom: 4.5%;
  left: 2.5%;
  z-index: 1378;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 36px;
  padding: 3px;
  background: #000;
  border: 1px solid #808080;
  box-shadow: inset 1px 1px 0 #404040, inset -1px -1px 0 #c0c0c0;
  opacity: 0.7;
  overflow: hidden;
}
.y2k-spec-bar {
  width: 6px;
  min-height: 2px;
  max-height: 30px;
  border-radius: 0;
  transition: height 60ms ease-out;
  will-change: height;
  image-rendering: pixelated;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    #000 2px,
    #000 3px
  );
}

/* ── Chord Display ── BOTTOM-RIGHT, Win95 inset panel */
#y2k-chord {
  position: fixed;
  bottom: 4.5%;
  right: 2.5%;
  z-index: 1378;
  pointer-events: none;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 8px;
  background: #000;
  border: 1px solid #808080;
  box-shadow: inset 1px 1px 0 #404040, inset -1px -1px 0 #c0c0c0;
  font: 700 18px/1 'Tahoma', 'Segoe UI', var(--ui-code-font);
  letter-spacing: 0.04em;
  color: #00ff00;
  text-shadow: 0 0 4px rgba(0, 255, 0, 0.25);
  opacity: 0;
  transition: opacity 0.15s;
}
.y2k-chord-name { white-space: nowrap; }
#y2k-chord-sub {
  font: 400 8px/1 'Tahoma', 'Segoe UI', var(--ui-code-font);
  letter-spacing: 0.15em;
  color: #808080;
  text-shadow: none;
  white-space: nowrap;
}

/* ── Arc Progress Ring — removed ── */
/* ── Breathing Dots — removed ── */

/* ── System ID ── TOP-LEFT under bracket */
#y2k-sysid {
  position: fixed;
  top: 2.2%;
  left: 6%;
  z-index: 1365;
  pointer-events: none;
  font: 400 9px/1.6 'Tahoma', 'Segoe UI', var(--ui-code-font);
  letter-spacing: 0.15em;
  color: rgba(192, 192, 192, 0.45);
  text-shadow: none;
  opacity: 0.6;
  text-transform: uppercase;
}
#y2k-sysid span { display: block; }

/* ── CRT Noise Overlay ── */
#y2k-noise {
  position: fixed;
  inset: 0;
  z-index: 1362;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  animation: y2k-noise-bar 0.5s steps(3) infinite;
  transform: translateZ(0);
  contain: strict;
}

/* ── CRT Scanlines Grid ── */
#y2k-crt-lines {
  position: fixed;
  inset: 0;
  z-index: 1361;
  pointer-events: none;
  opacity: 0.04;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.35) 2px,
    rgba(0, 0, 0, 0.35) 4px
  );
  mix-blend-mode: multiply;
  transform: translateZ(0);
  contain: strict;
}

/* ── Glitch Bar ── horizontal tear */
#y2k-glitch-bar {
  position: fixed;
  left: 0;
  right: 0;
  height: 0;
  z-index: 1392;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.08);
  mix-blend-mode: screen;
  will-change: transform, height, opacity;
}

/* ══════════ NEW ELEMENTS ══════════ */

/* ── Velocity Meter ── RIGHT side vertical bar (Win95 style) */
#y2k-velocity {
  position: fixed;
  right: 2%;
  top: 50%;
  transform: translateY(-50%) translateZ(0);
  width: 10px;
  height: 120px;
  z-index: 1378;
  pointer-events: none;
  overflow: hidden;
  background: #000;
  border: 1px solid #808080;
  box-shadow: inset 1px 1px 0 #404040, inset -1px -1px 0 #c0c0c0;
}
#y2k-velocity-fill {
  position: absolute;
  bottom: 0;
  left: 1px;
  right: 1px;
  height: 0%;
  background: #00ff00;
  transition: height 60ms ease-out;
  will-change: height;
  image-rendering: pixelated;
  /* Win95 segmented bar pattern */
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    #000 3px,
    #000 4px
  );
}
#y2k-velocity-label {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font: 700 8px/1 "Tahoma","MS Sans Serif",sans-serif;
  letter-spacing: 0.08em;
  color: rgba(192, 192, 192, 0.5);
  white-space: nowrap;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* ── Key Signature Display ── TOP-RIGHT under bracket */
#y2k-keysig {
  position: fixed;
  top: 2.2%;
  right: 6%;
  z-index: 1378;
  pointer-events: none;
  text-align: right;
  font: 200 28px/1 var(--ui-code-font);
  letter-spacing: 0.08em;
  color: rgba(200, 230, 255, 0.45);
  text-shadow: 2px 0 0 rgba(255, 40, 80, 0.2), -2px 0 0 rgba(40, 200, 255, 0.2), 0 0 20px rgba(120, 190, 255, 0.3);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.2s;
}
#y2k-keysig-sub {
  font: 400 8px/1.4 var(--ui-code-font);
  letter-spacing: 0.25em;
  color: rgba(170, 210, 255, 0.3);
  margin-top: 4px;
  text-shadow: none;
}

/* ── Waveform Display ── RIGHT edge, vertical oscilloscope */
#y2k-waveform {
  position: fixed;
  right: 4%;
  top: 30%;
  width: 80px;
  height: 140px;
  z-index: 1372;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.4;
  animation: y2k-waveform-drift 4s ease-in-out infinite;
}
#y2k-waveform canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  contain: strict;
}

/* ── Edge Lines — removed ── */

/* ── Beat Step Visualizer ── tiny Win95 bar, bottom-left beside progress */
#beat-step-viz {
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 1120;
  height: 20px;
  width: 100px;
  display: flex;
  align-items: center;
  padding: 0;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow:
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #fff,
    inset -2px -2px 0 #000,
    inset 2px 2px 0 #dfdfdf,
    0 4px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}
#beat-step-viz.active { opacity: 1; }
.beat-step-well {
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 0;
  margin: 3px;
  height: calc(100% - 6px);
  background: #000;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #dfdfdf;
  overflow: hidden;
}
.beat-bar {
  flex: 1;
  background: #1a1a2e;
  transition: background 60ms ease-out, box-shadow 60ms ease-out;
}
.beat-bar.hit {
  background: #5080ff;
  box-shadow: 0 0 8px rgba(80, 128, 255, 0.6) inset;
}
.beat-bar.hit.downbeat {
  background: #70a0ff;
  box-shadow: 0 0 10px rgba(100, 160, 255, 0.7) inset;
}
.beat-bar.trail {
  background: #0e1a38;
}
/* ── Frequency Label ── BOTTOM-LEFT */
#y2k-freq-label {
  position: fixed;
  bottom: 10%;
  left: 2.5%;
  z-index: 1376;
  pointer-events: none;
  font: 400 11px/1.4 'Tahoma', 'Segoe UI', var(--ui-code-font);
  letter-spacing: 0.1em;
  color: rgba(192, 192, 192, 0.4);
  text-shadow: none;
  opacity: 0;
  transition: opacity 0.2s;
}
#y2k-freq-hz {
  font-weight: 700;
  font-size: 16px;
  display: block;
  margin-bottom: 2px;
  color: #00c000;
  text-shadow: 0 0 4px rgba(0, 192, 0, 0.2);
}

/* ── Note Count / Polyphony ── TOP-RIGHT area */
#y2k-polycount {
  position: fixed;
  top: 7%;
  right: 2.5%;
  z-index: 1376;
  pointer-events: none;
  text-align: right;
  font: 700 28px/1 'Tahoma', 'Segoe UI', var(--ui-code-font);
  color: rgba(0, 192, 0, 0.35);
  text-shadow: none;
  opacity: 0;
  transition: opacity 0.15s;
}
#y2k-polycount-label {
  font: 400 7px/1.4 'Tahoma', 'Segoe UI', var(--ui-code-font);
  letter-spacing: 0.2em;
  color: rgba(192, 192, 192, 0.3);
  display: block;
  margin-top: 2px;
}

/* ── Horizontal Ticker Bars ── LEFT edge small bars */
/* ── Ticker bars — removed ── */

/* ── Audio Constellation ── TOP-LEFT interactive tone circle */
#y2k-constellation {
  position: fixed;
  top: 4%;
  left: 0.8%;
  width: 240px;
  height: 240px;
  z-index: 1382;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.5;
  contain: strict;
  transform: translateZ(0);
}
#y2k-constellation canvas {
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

/* ── Smooth opacity transitions for JS-driven HUD elements ── */
#y2k-scanline { transition: opacity 60ms ease-out; }
#y2k-spectrum { transition: opacity 80ms ease-out; }
#y2k-sysid { transition: opacity 100ms ease-out; }
#y2k-noise { transition: opacity 80ms ease-out; }
#y2k-velocity { transition: opacity 100ms ease-out; }
#y2k-waveform { transition: opacity 100ms ease-out; }
#y2k-polycount { transition: opacity 100ms ease-out; }
#y2k-constellation { transition: opacity 120ms ease-out; }
.y2k-crosshairs-wrap { transition: opacity 100ms ease-out; }

/* ════════════════════════════════════════════════════
   Synth Rack + Editor — Win95 + Analog Hardware
   ════════════════════════════════════════════════════ */

/* ── Instruments Rack ── */
#synth-rack-window {
  position: fixed !important;
}
.synth-rack-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: #fff;
  border: 2px inset #808080;
  min-height: 0;
  overflow-y: auto;
  max-height: 220px;
}
.synth-rack-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 22px;
  padding: 0 4px;
  cursor: pointer;
  gap: 5px;
  -webkit-user-select: none;
  user-select: none;
  font: 400 11px/22px "Tahoma", "MS Sans Serif", sans-serif;
  color: #000;
}
.synth-rack-row:hover { background: #1084d0; color: #fff; }
.synth-rack-row.active { background: #000080; color: #fff; }
.synth-rack-light {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.35;
  border: 1px solid #808080;
}
.synth-rack-light.on {
  opacity: 1;
  box-shadow: 0 0 3px 1px currentColor;
}
.synth-rack-icon {
  font-size: 11px;
  line-height: 1;
  width: 14px;
  text-align: center;
}
.synth-rack-row.active .synth-rack-icon,
.synth-rack-row:hover .synth-rack-icon { color: #fff; }
.synth-rack-name {
  font: inherit;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.synth-rack-open-btn {
  width: 16px; height: 15px;
  font-size: 8px;
  line-height: 15px;
  background: #c0c0c0;
  border: 1.5px outset #dfdfdf;
  cursor: pointer;
  padding: 0;
  text-align: center;
  color: #000;
}
.synth-rack-open-btn:active { border-style: inset; }
#synth-rack-status {
  font: 400 10px/18px "Tahoma", "MS Sans Serif", sans-serif;
  padding: 0 4px;
  color: #000;
}

/* ── Synth Editor Window ── */
.synth-window {
  width: 272px;
}
.synth-window > .w95-titlebar {
  font: bold 11px/20px "Tahoma", "MS Sans Serif", sans-serif;
}
.synth-window .w95-titlebar-icon {
  font-size: 11px;
  margin-right: 3px;
}
.synth-window-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  background: #c0c0c0;
  overflow: hidden;
}
.synth-editor-inner {
  padding: 4px 5px 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}
.synth-logo {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 36px;
  line-height: 1;
  opacity: 0.25;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  text-shadow: 0 0 8px currentColor;
}
.synth-window.minimized > .synth-window-body { display: none; }

/* ── Section Divider — Win95 etched rule ── */
.synth-section-divider {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 1px 0 0;
  height: 10px;
}
.synth-section-divider::before,
.synth-section-divider::after {
  content: '';
  flex: 1;
  height: 0;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
}
.synth-section-label {
  font: bold 7px/1 "Tahoma", "Arial", sans-serif;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  flex-shrink: 0;
}
.synth-group-row {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Knob — SVG rotary (matches EQ mixer) ── */
.synth-knob-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 42px;
  cursor: default;
}
.synth-knob-value {
  font: 500 8px/1 "Tahoma", "Arial", sans-serif;
  color: #000;
  text-align: center;
  min-width: 32px; height: 10px;
}
.synth-knob-label {
  font: 400 7px/1 "Tahoma", "Arial", sans-serif;
  color: #444;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 42px;
}

/* ── Fader (kept for future use) ── */
.synth-fader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 28px;
  cursor: default;
}
.synth-fader-label {
  font: 400 7px/1 "Tahoma", "Arial", sans-serif;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
}
.synth-fader-track {
  width: 5px;
  background: #1a1a24;
  border: 2px inset #808080;
  position: relative;
  cursor: pointer;
}
.synth-fader-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, var(--fader-accent, var(--synth-accent, #4080c0)), transparent);
  opacity: 0.5;
  pointer-events: none;
}
.synth-fader-thumb {
  position: absolute;
  left: -8px;
  width: 21px; height: 7px;
  background: linear-gradient(to bottom, #e0e0e0 0%, #c0c0c0 40%, #909090 60%, #b0b0b0 100%);
  border: 1px outset #dfdfdf;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  pointer-events: none;
}
.synth-fader-thumb::before {
  content: '';
  position: absolute;
  top: 2px; left: 5px; right: 5px;
  height: 1px;
  background: rgba(0,0,0,0.12);
  box-shadow: 0 2px 0 rgba(0,0,0,0.08);
}
.synth-fader-value {
  font: 500 8px/1 "Tahoma", "Arial", sans-serif;
  color: #000;
  text-align: center;
}

/* ── Cycle Button — Win95 beveled ── */
.synth-cycle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 52px;
}
.synth-cycle-btn {
  width: 52px; height: 18px;
  background: #c0c0c0;
  border: 2px outset #dfdfdf;
  font: 500 8px/14px "Tahoma", "Arial", sans-serif;
  color: #000;
  cursor: pointer;
  text-align: center; padding: 0 3px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.synth-cycle-btn:hover { background: #d0d0d0; }
.synth-cycle-btn:active { border-style: inset; background: #b0b0b0; }
.synth-cycle-label {
  font: 400 7px/1 "Tahoma", "Arial", sans-serif;
  color: #444;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Waveform Canvas — recessed LCD ── */
.synth-waveform-canvas {
  display: block;
  background: #0a0a1a;
  border: 2px inset #808080;
  flex-shrink: 0;
}

/* ── Live Oscilloscope — recessed LCD strip ── */
.synth-oscilloscope {
  width: 100%; height: 68px;
  display: block;
  background: #0a0a18;
  border: 2px inset #808080;
}

/* ── Preset Selector — Win95 button bar ── */
.synth-preset-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 1px 0;
  flex-wrap: wrap;
}
.synth-preset-btn {
  height: 18px;
  padding: 0 5px;
  background: #c0c0c0;
  border: 2px outset #dfdfdf;
  font: 500 8px/14px "Tahoma", "Arial", sans-serif;
  color: #000;
  cursor: pointer;
  white-space: nowrap;
}
.synth-preset-btn:hover { background: #d0d0d0; }
.synth-preset-btn:active,
.synth-preset-btn.active {
  border-style: inset;
  background: #b0b0b0;
}

/* ── OSC two-row layout ── */
.synth-osc-section {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.synth-osc-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  justify-content: center;
}
.synth-osc-row {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: center;
}
.synth-osc-label {
  font: bold 9px/1 "Tahoma", "Arial", sans-serif;
  color: #555;
  width: 11px;
  text-align: center;
  flex-shrink: 0;
}
/* ── Synth Tooltip — Win95 help popup ── */
#synth-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 220px;
  padding: 4px 6px;
  background: #ffffcc;
  border: 1px solid #000;
  font: 400 11px/15px "Tahoma", "MS Sans Serif", sans-serif;
  color: #000;
  pointer-events: none;
  white-space: pre-line;
  display: none;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}

/* ═══ Tutorial / Onboarding ═══ */
#tutorial-callout {
  position: fixed;
  z-index: 10000;
  width: 260px;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow:
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #fff,
    inset -2px -2px 0 #000,
    inset 2px 2px 0 #dfdfdf,
    3px 3px 0 rgba(0,0,0,0.35);
  font: 11px/1.45 "Tahoma", "MS Sans Serif", sans-serif;
  color: #000;
  padding: 0;
  pointer-events: auto;
}
.tut-text {
  padding: 10px 12px 6px;
  white-space: pre-line;
  font-size: 12px;
  line-height: 1.5;
}
.tut-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 6px;
  border-top: 1px solid #808080;
  box-shadow: 0 -1px 0 #fff;
}
.tut-step-num {
  flex: 1;
  font: 400 9px/1 "Tahoma", sans-serif;
  color: #808080;
}
.tut-btn {
  height: 20px;
  padding: 0 10px;
  font: 11px "Tahoma", sans-serif;
  background: #c0c0c0;
  border: none;
  box-shadow:
    inset -1px -1px 0 #000,
    inset 1px 1px 0 #fff,
    inset -2px -2px 0 #808080,
    inset 2px 2px 0 #dfdfdf;
  cursor: pointer;
}
.tut-btn:active {
  box-shadow:
    inset 1px 1px 0 #000,
    inset -1px -1px 0 #fff,
    inset 2px 2px 0 #808080;
  padding: 1px 9px 0 11px;
}
.tut-skip {
  color: #808080;
}
.tut-action-hint {
  font: italic 9px/1 "Tahoma", sans-serif;
  color: #000080;
  display: none;
}

/* Arrow indicators */
.tut-arrow-up::before,
.tut-arrow-down::after,
.tut-arrow-left::before,
.tut-arrow-right::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
}
.tut-arrow-up::before {
  top: -8px;
  left: 24px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #000;
}
.tut-arrow-down::after {
  bottom: -8px;
  left: 24px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #000;
}
.tut-arrow-left::before {
  left: -8px;
  top: 16px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #000;
}
.tut-arrow-right::after {
  right: -8px;
  top: 16px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid #000;
}

/* Spotlight highlight ring */
#tutorial-highlight {
  position: fixed;
  z-index: 9998;
  border: 2px solid #000080;
  border-radius: 2px;
  box-shadow:
    0 0 0 3px rgba(0, 0, 128, 0.25),
    0 0 12px rgba(0, 0, 128, 0.3);
  pointer-events: none;
  animation: tut-pulse 1.5s ease-in-out infinite;
}
@keyframes tut-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0,0,128,0.25), 0 0 12px rgba(0,0,128,0.3); }
  50% { box-shadow: 0 0 0 5px rgba(0,0,128,0.35), 0 0 20px rgba(0,0,128,0.4); }
}
