/* Font Face */
@font-face {
  font-family: "Lab Mono";
  src: url("../fonts/labmono-regular-web.woff2") format("woff2"),
       url("../fonts/labmono-regular-web.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* CSS Variables */
:root {
  /* Colors */
  --bg-primary: #111;
  --bg-secondary: rgba(17, 17, 17, 0.5);
  --text-primary: #eee;
  --text-secondary: #575757;
  --border-primary: #333;
  --border-secondary: #444;
  --accent-primary: #eee;
  --accent-error: #ff5252;
  --accent-hover: rgba(238, 238, 238, 0.1);
  --accent-active: rgba(238, 238, 238, 0.2);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 20px;
  --space-xl: 30px;
  
  /* Typography */
  --font-family: "Lab Mono", monospace;
  --font-size-xs: 10px;
  --font-size-sm: 11px;
  --font-size-base: 14px;
  --font-size-lg: 24px;
  --font-size-xl: 32px;
  --font-size-2xl: 48px;
  
  /* Components */
  --knob-size: 32px;
  --button-radius: 3px;
  --module-radius: 4px;
  --transition-fast: 0.1s ease;
  --transition-medium: 0.2s ease;
  --transition-slow: 0.3s ease;
  
  /* Layout */
  --container-max-width: 1200px;
  --module-min-width: 380px;
  --grid-gap: var(--space-lg);
}

/* Font Loading */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  text-transform: uppercase !important;
  outline: none;
}

html {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  /*overflow: hidden;*/
  height: 100vh;
}

body {
  margin: 0;
  padding: 0;
  overflow: auto; /* Default - allow scrolling in synth view */
}

/* When shader or about modal is active, hide overflow */
body.shader-active,
body.about-active {
  overflow: hidden;
}

a {
  text-decoration: none;
  color: white;
}
a:hover {
  opacity: 0.5;
}

/* Utility Classes */
.hidden { display: none !important; }

/* WebGL Background Canvas */
#backgroundCanvas {
  position: fixed;
  top: 25%;
  left: 25%;
  width: 50vw;
  height: 50vh;
  z-index: -1;
  background: var(--bg-primary);
  display: block; /* Visible by default (shader view is default) */
  transform: scale(2);
}

#checkerboardOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -0.5; /* Above shader canvas but below UI */
  background-image: url('../assets/img/noise.png');
  background-repeat: repeat;
  background-size: 64px 64px;
  display: block;
  pointer-events: none; /* Don't block mouse events */
}

/* Layout */
.studio-container {
  width: min(95vw, var(--container-max-width));
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto;
  gap: var(--grid-gap);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: var(--space-lg);
  z-index: 1;
  transition: transform var(--transition-slow), opacity var(--transition-slow);
}

.studio-container.minimized {
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  pointer-events: none;
}

/* Synth close button */
.synth-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color var(--transition-medium);
  opacity: 0.7;
  z-index: 10;
}

.synth-close:hover {
  background: var(--accent-hover);
  opacity: 1;
}

.synth-close svg {
  width: 24px;
  height: 24px;
  fill: var(--text-primary);
}

/* Modules */
.noise-module {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--module-radius);
  padding: var(--space-lg);
  text-align: center;
  position: relative;
  transition: opacity var(--transition-medium);
}

.noise-module.eq-module {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: auto;
}

.modules-grid {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  /*height: 600px;*/
  /*overflow-y: auto;*/
  width: var(--module-min-width);
}

.module-label {
  position: absolute;
  top: -8px;
  left: var(--space-xl);
  right: var(--space-xl);
  height: 2px;
}

.module-label .label-text {
  font-size: var(--font-size-base);
  background-color: var(--bg-primary);
  position: relative;
  top: 0;
}

#lfo-module, #space-module, #timefx-module, #volume-module, #transport-module, #storage-module, #saveload-module {
  display: flex;
  align-content: center;
  justify-content: center;
  align-items: center;
  height: 220px;
}

/* Module Order: Space, LFO, Time FX, Storage */
#space-module {
  order: 3;
}

#lfo-module {
  order: 2;
}

#timefx-module {
  order: 4;
}

#saveload-module {
  order: 1;
  height: 110px;
}

/* Controls Group - align sliders to the right */
.controls-group {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  justify-content: flex-end; /* Align controls to the right */
  margin-top: var(--space-md);
}

.save-load-section {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  align-items: center;
}

/* Controls */
.control-section {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  transition: opacity var(--transition-slow);
}

.control-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--space-xs) + 0px);
  width: 50px;
  cursor: pointer;
  transition: opacity var(--transition-medium);
}

.control-item.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.control-label {
  font-size: var(--font-size-base);
}

.control-knob {
  width: var(--knob-size);
  height: var(--knob-size);
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  cursor: ns-resize;
  position: relative;
  --rotation: -135deg;
  transition: transform var(--transition-fast);
}

.control-knob::before {
  content: '';
  width: 2px;
  height: 14px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -7px 0 0 -1px;
  background-color: var(--accent-primary);
  transform: rotate(var(--rotation));
  transition: transform var(--transition-fast);
  transform-origin: center;
}

.control-value {
  font-size: var(--font-size-base);
  min-height: 1.2em;
}

/* EQ Controls */
.eq-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.eq-container {
  /*border: 1px solid var(--border-primary);*/
  border-radius: var(--module-radius);
  width: 100%;
  aspect-ratio: 1 / 1;
  /*overflow: hidden;*/
  /*background: red;*/
}

.eq-container canvas {
  touch-action: pan-y; /* Allow vertical scrolling, prevent horizontal */
  user-select: none; /* Prevent text selection on canvas */
  -webkit-user-select: none;
  cursor: crosshair;
  /*opacity: 0.5;*/
}

.crossfade-control,
.randomize-bias-control,
.repeat-control,
.master-volume-control,
.auto-generate-control,
.save-load-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.crossfade-control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: #333;
  border-radius: 2px;
  border: none;
  cursor: pointer;
}

.randomize-bias-control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: var(--bg-secondary);
  border-radius: 2px;
  border: none;
  cursor: pointer;
}

.crossfade-control input[type="range"] {
  width: 100px;
}

.randomize-bias-control input[type="range"] {
  width: 100px;
  background: linear-gradient(to right, #ff6b35 0%, var(--bg-secondary) 50%, #4a9eff 100%);
}

.master-volume-control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: #333;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  width: 100px;
}

.crossfade-control input[type="range"]::-webkit-slider-thumb,
.randomize-bias-control input[type="range"]::-webkit-slider-thumb,
.repeat-control input[type="range"]::-webkit-slider-thumb,
.master-volume-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  border-radius: 50%;
  border: 0;
  cursor: pointer;
}

.crossfade-control label,
.randomize-bias-control label,
.repeat-control label,
.master-volume-control label {
  font-size: var(--font-size-xs);
  color: var(--accent-primary);
  font-family: var(--font-family);
  text-transform: uppercase;
  font-weight: normal;
}

.crossfade-control span,
.randomize-bias-control span,
.repeat-control span,
.master-volume-control span {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  min-width: 35px;
  text-align: center;
}

.repeat-control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 5px;
  background: #333;
  border-radius: 2px;
  border: none;
  cursor: pointer;
}

.repeat-control input[type="range"]:disabled,
.crossfade-control input[type="range"]:disabled,
.randomize-bias-control input[type="range"]:disabled {
  cursor: not-allowed;
}

.repeat-control {
  opacity: 1;
  transition: opacity var(--transition-medium);
}

.repeat-control.active {
  opacity: 1;
}

.crossfade-control {
  opacity: 1;
  transition: opacity var(--transition-medium);
}

.crossfade-control.active {
  opacity: 1;
}

.randomize-bias-control {
  opacity: 1;
  transition: opacity var(--transition-medium);
}

.randomize-bias-control.active {
  opacity: 1;
}

/* Buttons */
.preset-section {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  cursor: pointer;
  transition: opacity var(--transition-medium);
}

.preset-section.disabled {
  opacity: 0.3;
}

.preset-btn,
.transport-btn {
  padding: 6px var(--space-md);
  border: 1px solid var(--accent-primary);
  background: transparent;
  color: var(--accent-primary);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  cursor: pointer;
  border-radius: var(--button-radius);
  transition: background-color var(--transition-fast);
}

.preset-btn:hover,
.transport-btn:hover {
  background: var(--accent-hover);
}

.auto-generate-btn {
  white-space: nowrap;
}

.auto-generate-btn input[type="number"] {
  width: 40px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  padding: 0 2px;
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  text-align: center;
  margin: 0 2px;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.auto-generate-btn input[type="number"]::-webkit-outer-spin-button,
.auto-generate-btn input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.auto-generate-btn input[type="number"]:focus {
  outline: none;
  border-bottom-color: var(--accent-primary);
}

.auto-generate-btn.active {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
}

.transport-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: var(--font-size-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.transport-btn:active {
  opacity: 0.7;
}

.transport-btn.muted {
  background: var(--accent-error);
  border-color: var(--accent-error);
}

/* Effect Groups */
.effect-groups-container {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  margin: var(--space-md) 0;
  flex-wrap: wrap;
}

.effect-group,
.lfo-group {
  padding: var(--space-sm);
  border: 1px solid var(--border-primary);
  border-radius: var(--module-radius);
  /*flex: 1;*/
  width: 161px;
  height: 161px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity var(--transition-slow), filter var(--transition-slow);
  justify-content:center;
}

.effect-group.disabled,
.lfo-group.disabled {
  opacity: 0.3;
  filter: grayscale(0.8);
}

.effect-group-label,
.lfo-group-label {
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--border-secondary);
  cursor: pointer;
  border-radius: var(--button-radius);
  background: var(--accent-hover);
  transition: background-color var(--transition-medium);
}

.effect-group-label:hover,
.lfo-group-label:hover {
  background: var(--accent-active);
}

.effect-description,
.lfo-description {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  transition: opacity var(--transition-slow);
}

/* Reverb Type Selector - styled to look like effect-group-label */
.reverb-type-selector {
  margin-bottom: var(--space-sm);
  text-align: center;
  position: relative;
  display: inline-block;
}

.reverb-dropdown {
  background: var(--accent-hover);
  border: none;
  border-bottom: 1px solid var(--border-secondary);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  padding: var(--space-xs) 6px;
  padding-right: 20px; /* Space for arrow + 4px padding */
  border-radius: var(--button-radius);
  cursor: pointer;
  transition: all var(--transition-medium);
  width: auto;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Add down arrow after the dropdown */
.reverb-type-selector::after {
  content: '↓';
  position: absolute;
  right: 8px; /* 4px more padding from the right edge */
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-primary);
  font-size: var(--font-size-xs);
}

.reverb-dropdown:hover {
  background: var(--accent-active);
}

.reverb-dropdown:focus {
  outline: none;
  background: var(--accent-active);
}

/* Minimized View */
.minimized-controls {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: transform var(--transition-slow), opacity var(--transition-slow);
}

.minimized-controls.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.minimized-title {
  font-size: var(--font-size-2xl);
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  opacity: 1.,0;
  font-family: var(--font-family);
  letter-spacing: 0.05em;
  position: relative;
  height: 48px; /* Fixed height to prevent jumping - matches font-size-2xl */
  display: flex;
  align-items: center;
}

/* White cursor that follows text */
.typing-cursor {
  position: absolute;
  width: 1.5px;
  height: 1em; /* Match text height */
  background-color: white;
  animation: blink 1s infinite;
  pointer-events: none;
  transition: left 0.4s ease-out; /* 2x faster slide back */
  border-radius: 1px;
  top: 50%; /* Center vertically, responsive to container changes */
  transform: translateY(-50%); /* Perfect vertical centering */
  font-size: inherit; /* Inherit font size to scale with text */
}

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

/* Linear sequential character fade-in */
.char-fade {
  display: inline-block;
  opacity: 0;
  animation: linearCharFade 0.15s linear forwards;
  transition: opacity 0.8s linear, transform 0.8s linear;
}

@keyframes linearCharFade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Smooth fade-out effect for text transition */
.text-fadeout {
  opacity: 0 !important;
  transform: translateY(-5px) !important;
}

.randomize-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-slow);
  position: relative;
}

.randomize-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.randomize-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.randomize-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent-primary);
  mask: radial-gradient(circle, transparent 56px, black 56px, black 60px, transparent 60px);
  -webkit-mask: radial-gradient(circle, transparent 56px, black 56px, black 60px, transparent 60px);
  opacity: 1;
  transition: opacity 0.5s ease;
}

.randomize-btn.progressing::before {
  opacity: 0.1;
}

.randomize-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--accent-primary) 0%, transparent 0%);
  mask: radial-gradient(circle, transparent 56px, black 56px, black 60px, transparent 60px);
  -webkit-mask: radial-gradient(circle, transparent 56px, black 56px, black 60px, transparent 60px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.randomize-btn.progressing::after {
  opacity: 1;
}

/* Fixed Buttons */
.about-btn {
  position: fixed;
  bottom: var(--space-lg);
  right: calc(var(--space-lg) + 60px); /* Position left of minimize button */
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  font-family: var(--font-family);
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-slow);
  z-index: 1000;
}

.about-btn:hover {
  background: var(--accent-hover);
}

.about-btn svg {
  width: 24px;
  height: 24px;
}

.minimize-btn {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  font-family: var(--font-family);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-slow);
  z-index: 1000;
}

.minimize-btn:hover {
  background: var(--accent-hover);
}

.minimize-btn svg {
  width: 24px;
  height: 24px;
}

/* About View - Fullscreen with zoom transition */
.about-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 2000;
  transform: scale(1.2);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--transition-slow), opacity var(--transition-slow), visibility var(--transition-slow);
}

.about-view.show {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
}

.about-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  font-family: var(--font-family);
  line-height: 1.33;
  text-align: left;
  position: relative;
  padding: 8vh 5vw 5vw 5vw;
  box-sizing: border-box;
  letter-spacing: -0.025vw;
}

.about-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 48px;
  cursor: pointer;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color var(--transition-medium);
  opacity: 0.7;
  z-index: 100000000000;
}

.about-close:hover {
  background: var(--accent-hover);
  opacity: 1;
}

.about-close svg {
  width: 24px;
  height: 24px;
  fill: var(--text-primary);
}

.about-content h1 {
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  margin: 0 0 3vw 0;
  font-family: var(--font-family);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.about-content h2 {
  color: var(--accent-primary);
  font-size: var(--font-size-lg);
  margin: 0 0 2vw 0;
  font-family: var(--font-family);
  font-weight: normal;
  letter-spacing: 0.05em;
}

.about-content p {
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  margin: 0 0 2vw 0;
  
  margin-left: auto;
  margin-right: auto;
  opacity: 0.3;
}


.about-content strong {
  color: var(--accent-primary);
  font-weight: normal;
}

/* Inner text container for width control */
.about-text {
  max-width: 40vw;
  margin: 0 auto;
}

/* Transport Auto Generate Controls */
.transport-auto-generate {
  margin-top: var(--space-md);
}

.auto-generate-group {
  padding: var(--space-sm);
  border: 1px solid var(--border-primary);
  border-radius: var(--module-radius);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity var(--transition-slow), filter var(--transition-slow);
}

.auto-generate-group.disabled {
  opacity: 0.3;
  filter: grayscale(0.8);
}

.auto-generate-group-label {
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--border-secondary);
  cursor: pointer;
  border-radius: var(--button-radius);
  background: var(--accent-hover);
  transition: all var(--transition-medium);
  text-align: center;
  min-width: 80px;
}

.auto-generate-group-label:hover {
  background: var(--accent-active);
}

.auto-generate-group-label.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-bottom-color: var(--accent-primary);
}

.auto-generate-group.disabled .auto-generate-group-label {
  background: rgba(255, 82, 82, 0.3);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.auto-generate-interval {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  transition: opacity var(--transition-slow);
  margin-top: -5px;
}

.auto-generate-interval input[type="number"] {
  width: 30px;
  background: transparent;
  border: 1px solid var(--border-secondary);
  border-radius: var(--button-radius);
  color: var(--text-primary);
  padding: 2px var(--space-xs);
  font-size: var(--font-size-xs);
  font-family: var(--font-family);
  text-align: center;
}

.auto-generate-interval input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.auto-generate-group.disabled .auto-generate-interval {
  opacity: 0.3;
  pointer-events: none;
}

/* Auto Generate Status */
.auto-generate-status {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: center;
  z-index: 1000;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: opacity var(--transition-slow);
  display: none;
  align-items: center;
  gap: 6px;
  opacity: 0.5;
}

.auto-generate-status:hover {
  opacity: 0.7;
}

.auto-generate-status.active {
  opacity: 1;
}

.auto-generate-input {
  width: 32px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-secondary);
  color: var(--text-primary);
  padding: 0 2px;
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  text-align: center;
  cursor: text;
}

.auto-generate-input:focus {
  outline: none;
  border-bottom-color: var(--text-secondary);
}

/* Toast */
.toast {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  background: rgba(255,255,255,0.05);
  color: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--module-radius);
  font-size: var(--font-size-xs);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: all var(--transition-slow);
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* Bias Colors */
.bias-deeply-warm { color: #ff6b35; }
.bias-very-warm { color: #ff8c42; }
.bias-warm { color: #ffa726; }
.bias-slightly-warm { color: #ffb74d; }
.bias-gently-warm { color: #ffcc80; }
.bias-balanced { color: var(--text-primary); }
.bias-gently-bright { color: #b3e5fc; }
.bias-slightly-bright { color: #81d4fa; }
.bias-bright { color: #4fc3f7; }
.bias-very-bright { color: #29b6f6; }
.bias-intensely-bright { color: #0288d1; }




/* Mobile Responsive */

@media screen and (max-width: 1024px) {
  :root {
    --module-min-width: 100%;
  /*  --font-size-base: 14px;
    --font-size-lg: 20px;
    --font-size-xl: 28px;
    --font-size-2xl: 32px;
    --space-lg: 15px;
    --grid-gap: 15px;
    --module-min-width: 250px;*/
  }
  
  .studio-container {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    padding: var(--space-md);
    grid-template-columns: 1fr;
    display: block;
    transition: none;
  }

  canvas {
 
    overflow: auto !important;
  }
  
  .noise-module {
    /*height: auto !important;*/
  }
  .noise-module.eq-module {
    grid-column: 1;
    margin-bottom: 20px;
    min-width: auto !important;
  }

  /*.noise-module.eq-module canvas {
    width: 90vw !important;
    height: auto !important;
  }
  */
  
  
  .effect-groups-container {
    justify-content: center;
    /*flex-direction: column;*/
  }
  
  .auto-generate-status {
    bottom: 15px;
    font-size: var(--font-size-xs);
    padding: 6px var(--space-sm);
  }
  
  .auto-generate-input {
    width: 28px;
    font-size: var(--font-size-xs);
  }

  .about-text {
    max-width: 80vw !important;
  }

  .about-text p {
    font-size: 1.3em;
  }

  .modules-grid {
      display: flex;
      flex-direction: row;
      gap: var(--grid-gap);
      /* height: 600px; */
      /* overflow-y: auto; */
      width: var(--module-min-width);
      flex-wrap: wrap;
      justify-content: space-between;
  }

  #lfo-module, #space-module, #timefx-module, #volume-module, #transport-module, #storage-module, #saveload-module {
    display: flex;
    align-content: center;
    justify-content: center;
    align-items: center;
    height: auto;
    width: calc(50% - (var(--grid-gap) / 2));
  }
}

@media screen and (max-width: 768px) {
  .eq-controls-row {
    margin-top: var(--space-md);
    flex-direction: column;
    gap: var(--space-md);
  }

  .controls-group {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    justify-content: center;
    margin-top: var(--space-md);
    flex-wrap: wrap;
  }

  .save-load-section {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .effect-group, .lfo-group {
    border: 0;
  }

  .auto-generate-btn {
    width: 80vw;
  }

  .minimized-title {
    font-size: var(--font-size-xl);
    height: var(--font-size-xl);
  }

  .about-text {
    max-width: 95vw !important;
  }
}

/* Drag & Drop Styles */
body.drag-active {
  background: linear-gradient(135deg, rgba(0, 255, 0, 0.1) 0%, rgba(0, 200, 100, 0.05) 100%);
}

body.drag-active::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 3px dashed rgba(0, 255, 100, 0.6);
  border-radius: 10px;
  z-index: 9999;
  pointer-events: none;
  animation: dragPulse 1.5s ease-in-out infinite;
}

body.drag-active::after {
  content: 'DROP JSON FILE TO LOAD MIX';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: bold;
  color: rgba(0, 255, 100, 0.9);
  text-shadow: 0 0 10px rgba(0, 255, 100, 0.5);
  z-index: 10000;
  pointer-events: none;
  animation: dragBounce 0.8s ease-in-out infinite alternate;
}

@keyframes dragPulse {
  0%, 100% {
    border-color: rgba(0, 255, 100, 0.6);
    box-shadow: inset 0 0 20px rgba(0, 255, 100, 0.1);
  }
  50% {
    border-color: rgba(0, 255, 100, 0.9);
    box-shadow: inset 0 0 40px rgba(0, 255, 100, 0.2);
  }
}

@keyframes dragBounce {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/*@media screen and (max-width: 480px) {
  html {
    font-size: 80%;
  }
  
  .control-item {
    margin: var(--space-sm);
  }
  
  .preset-section {
    gap: var(--space-xs);
  }
  
  .preset-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: 14px;
  }
}*/