:root {
  --amiga-blue: #000088;
  --amiga-blue-light: #0055AA;
  --amiga-orange: #FF8800;
  --amiga-silver: #AAAAAA;
  --amiga-white: #FFFFFF;
  --amiga-black: #000000;
  --amiga-darkgray: #444444;
  --amiga-gray: #888888;
  --amiga-bg: #0000AA;
  --amiga-title: #0055AA;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'VT323', monospace;
  background-color: #000055;
  background-image:
    linear-gradient(45deg, #000066 25%, transparent 25%),
    linear-gradient(-45deg, #000066 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #000066 75%),
    linear-gradient(-45deg, transparent 75%, #000066 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
  color: var(--amiga-white);
  min-height: 100vh;
  overflow-x: hidden;
}

.amiga-window {
  border: 2px solid var(--amiga-white);
  border-top-color: #ffffff;
  border-left-color: #ffffff;
  border-right-color: #333333;
  border-bottom-color: #333333;
  background: #0000AA;
}

.amiga-titlebar {
  background: var(--amiga-title);
  padding: 2px 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 2px solid var(--amiga-black);
  cursor: default;
  user-select: none;
}

.amiga-titlebar-stripes {
  flex: 1;
  height: 12px;
  background: repeating-linear-gradient(
    0deg,
    var(--amiga-white) 0px,
    var(--amiga-white) 1px,
    var(--amiga-title) 1px,
    var(--amiga-title) 3px
  );
}

.amiga-gadget {
  width: 18px;
  height: 14px;
  border: 2px solid;
  border-top-color: #ffffff;
  border-left-color: #ffffff;
  border-right-color: #333333;
  border-bottom-color: #333333;
  background: var(--amiga-silver);
  cursor: pointer;
  flex-shrink: 0;
}

.amiga-gadget:active {
  border-top-color: #333333;
  border-left-color: #333333;
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
}

.amiga-btn {
  font-family: 'VT323', monospace;
  font-size: 16px;
  padding: 4px 12px;
  border: 2px solid;
  border-top-color: #ffffff;
  border-left-color: #ffffff;
  border-right-color: #333333;
  border-bottom-color: #333333;
  background: var(--amiga-silver);
  color: var(--amiga-black);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.amiga-btn:active, .amiga-btn.pressed {
  border-top-color: #333333;
  border-left-color: #333333;
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
  background: #777777;
}

.amiga-btn:hover { background: #bbbbbb; }

.amiga-btn.active-toggle {
  border-top-color: #333333;
  border-left-color: #333333;
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
  background: var(--amiga-orange);
  color: var(--amiga-black);
}

.amiga-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.amiga-inset {
  border: 2px solid;
  border-top-color: #333333;
  border-left-color: #333333;
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
  background: #000022;
}

.floppy-zone {
  border: 3px dashed var(--amiga-silver);
  background: rgba(0, 0, 80, 0.6);
  transition: all 0.3s;
  cursor: pointer;
}

.floppy-zone:hover, .floppy-zone.dragover {
  border-color: var(--amiga-orange);
  background: rgba(255, 136, 0, 0.1);
}

.floppy-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #440000;
  transition: background 0.15s;
}

.floppy-led.active {
  background: #ff0000;
  box-shadow: 0 0 8px #ff0000;
  animation: led-blink 0.5s ease-in-out infinite;
}

@keyframes led-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.power-led {
  width: 12px;
  height: 6px;
  background: #440000;
  border-radius: 1px;
  transition: all 0.3s;
}

.power-led.on {
  background: #00ff00;
  box-shadow: 0 0 6px #00ff00;
}

.power-led.filter-on {
  background: #ff0000;
  box-shadow: 0 0 6px #ff0000;
}

.vu-meter {
  height: 10px;
  background: #001100;
  border: 1px solid #333;
  position: relative;
  overflow: hidden;
}

.vu-meter-fill {
  height: 100%;
  background: linear-gradient(to right, #00ff00, #00ff00 60%, #ffff00 75%, #ff0000 95%);
  transition: width 0.05s linear;
}

canvas.scope {
  image-rendering: auto;
  background: #000811;
  border: 1px solid #003366;
}

.pattern-row {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre;
}

.pattern-row.current {
  background: rgba(255, 136, 0, 0.35);
}

.chip-svg {
  filter: drop-shadow(0 0 4px rgba(0, 85, 170, 0.5));
  transition: filter 0.3s;
}

.chip-svg.playing {
  filter: drop-shadow(0 0 12px rgba(0, 170, 255, 0.8));
}

@keyframes spark {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.3); }
}

.guru-meditation {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: guru-border 1s ease-in-out infinite;
  cursor: pointer;
}

@keyframes guru-border {
  0%, 100% { border: 8px solid #ff0000; }
  50% { border: 8px solid #000000; }
}

.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,40,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

@keyframes spin-floppy {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spin-floppy {
  animation: spin-floppy 1s linear infinite;
  font-size: 64px;
}

@keyframes boing {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-10px) scaleY(0.95); }
}

.boing-ball {
  animation: boing 2s ease-in-out infinite;
  display: inline-block;
}

.scrollbar-thin::-webkit-scrollbar { width: 14px; }
.scrollbar-thin::-webkit-scrollbar-track { background: #222; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: var(--amiga-silver); border: 2px solid #222; }

.sync-led {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
  transition: background 0.15s, box-shadow 0.15s;
}

.sync-led.green { background: #00ff00; box-shadow: 0 0 4px #00ff00; }
.sync-led.yellow { background: #ffff00; box-shadow: 0 0 4px #ffff00; }
.sync-led.red { background: #ff0000; box-shadow: 0 0 3px #ff0000; }
.sync-led.off { background: #330000; }

.corrscope-panel summary {
  cursor: pointer;
  color: var(--amiga-orange);
  font-size: 16px;
  padding: 4px;
  user-select: none;
}

.corrscope-panel summary:hover { color: #ffaa44; }

.corrscope-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #222;
  border-radius: 3px;
  outline: none;
}

.corrscope-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amiga-orange);
  cursor: pointer;
}

.demoscene-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .pattern-row { font-size: 10px; }
  .amiga-btn { font-size: 14px; padding: 3px 8px; }
}

.demo-btn {
  font-family: 'VT323', monospace;
  font-size: 14px;
  padding: 3px 8px;
  margin: 2px;
}