/* UnliMIDI - Demo-inspired layout with Retro Neon Styling */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

:root {
  /* UnliMIDI Neon/Arcade Color Palette */
  --neon-blue: #00ffff;
  --neon-purple: #ff00ff;
  --neon-pink: #ff0080;
  --neon-green: #00ff80;
  --electric-blue: #0080ff;

  /* Demo-inspired Dark Theme */
  --bg: #0a0a0a;
  --panel: #1a1a2e;
  --panel-2: #16213e;
  --text: #ffffff;
  --muted: #9aa4b2;
  --accent: #00ffff;
  --accent-2: #ff0080;
  --ok: #00ff80;
  --warn: #FFDD57;
  --danger: #ff0080;

  /* Layout */
  --radius: 16px;
  --gap: 14px;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
  --shadow-soft: 0 3px 12px rgba(0,0,0,.25);
  --bottom-bar-h: 84px;
  --sidebar-w: 320px;
  --grid-max: 1280px;

  /* UnliMIDI specific */
  --button-primary: linear-gradient(45deg, #ff0080, #ff00ff);
  --button-secondary: linear-gradient(45deg, #0080ff, #00ffff);
  --grid-active: #ff00ff;
  --grid-inactive: #333366;
  --grid-hover: #6600cc;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font: 16px/1.4 'Orbitron', system-ui, -apple-system, Segoe UI, Roboto, Inter, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
  overflow: hidden;
}

/* Shell layout */
.app {
  display: grid;
  grid-template-rows: auto 1fr var(--bottom-bar-h);
  height: 100svh;
}

/* Fallback for browsers that don't support svh */
@supports not (height: 1svh) {
  .app {
    height: 100vh;
  }
}

header {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: saturate(1.2) blur(8px);
  background: linear-gradient(180deg, rgba(26,26,46,.92), rgba(26,26,46,.6));
  border-bottom: 1px solid rgba(0,255,255,.2);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  max-width: var(--grid-max);
  margin: 0 auto;
}

.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
}

.icon-btn:hover {
  background: rgba(0,255,255,.1);
}

.icon-btn img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.brand {
  font-weight: 900;
  letter-spacing: .3px;
  font-size: 1.2rem;
}

.brand small {
  color: var(--muted);
  font-weight: 500;
}

.content {
  height: calc(100svh - var(--bottom-bar-h) - 54px);
  overflow: auto;
  scroll-behavior: smooth;
  background: linear-gradient(180deg, transparent, rgba(0,255,255,.02));
}

/* Fallback for browsers that don't support svh */
@supports not (height: 1svh) {
  .content {
    height: calc(100vh - var(--bottom-bar-h) - 54px);
  }
}

/* Responsive grid */
.grid {
  max-width: var(--grid-max);
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
  justify-items: center; /* Center grid items */
  width: 100%; /* Ensure grid doesn't exceed viewport */
  box-sizing: border-box; /* Include padding in width calculation */
}

/* Hero section */
.hero {
  grid-column: 1 / -1;
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  background:
    radial-gradient(1200px 400px at 20% -20%, rgba(0,255,255,.16), transparent 60%),
    radial-gradient(900px 300px at 80% 0%, rgba(255,0,128,.14), transparent 60%),
    var(--panel);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,255,255,.15);
  display: grid;
  gap: 14px;
  align-items: end;
  min-height: 140px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 900;
  background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple), var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  margin: 0;
  color: var(--muted);
}


.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,255,255,.1);
  border: 1px solid rgba(0,255,255,.3);
  color: #cfe8ff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid rgba(0,255,255,.1);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

/* Center the track stack card */
.track-stack-card {
  width: 100%;
  max-width: 1800px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: white;
  font-weight: 700;
}

.card p {
  margin: 0;
  color: var(--muted);
}

/* List and rows */
.list {
  display: grid;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  grid-template-columns: repeat(2, 1fr); /* 2 columns for track stack */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.list::-webkit-scrollbar {
  display: none;
}


.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid rgba(0,255,255,.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.row:hover {
  background: rgba(0,255,255,.05);
  border-color: rgba(0,255,255,.3);
}

.cover {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--panel), var(--panel-2));
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(0,255,255,.2);
  font-weight: 900;
  color: var(--accent);
}

.meta b {
  display: block;
  font-size: 14px;
}

.meta small {
  color: var(--muted);
}

.pill {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,255,255,.2);
  color: #cde3ff;
  background: rgba(0,255,255,.1);
}

/* Controls */
.control-panel, .sound-controls, .context-controls, .beats-controls {
  display: grid;
  gap: 12px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.change-track-type-btn {
  padding: 8px 16px;
  background: rgba(0,255,255,.1);
  border: 1px solid rgba(0,255,255,.3);
  border-radius: 6px;
  color: white;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.change-track-type-btn:hover {
  background: rgba(0,255,255,.2);
  border-color: rgba(0,255,255,.5);
  transform: translateY(-2px);
}

.change-track-type-btn:active {
  transform: translateY(0);
}

.control-row label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  min-width: 80px;
}

.control-row input[type="number"],
.control-row select {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid rgba(0,255,255,.2);
  color: var(--text);
  font-family: 'Orbitron', monospace;
}

.control-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  outline: none;
}

.control-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent);
}

/* Buttons */
.btn-primary, .btn-secondary {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--button-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(255,0,128,.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,0,128,.5);
}

.btn-secondary {
  background: var(--button-secondary);
  color: var(--panel);
}

.btn-secondary:hover {
  transform: translateY(-2px);
}

.add-track-btn {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  border-radius: 8px;
  border: 2px dashed rgba(0,255,255,.3);
  background: transparent;
  color: var(--accent);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-track-btn:hover {
  background: rgba(0,255,255,.1);
  border-color: var(--accent);
}

/* Export buttons */
.export-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

/* Generator buttons */
.generator-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

/* Drum pattern buttons */
.drum-pattern-buttons {
  display: flex;
  gap: 8px;
}

.drum-pattern-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 14px;
}

.drum-pattern-btn.active {
  background: var(--button-primary);
  color: white;
}

.drum-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

/* MIDI pattern buttons */
.midi-pattern-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  margin-bottom: 8px;
}

.midi-pattern-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 14px;
}

.midi-pattern-btn.active {
  background: var(--button-primary);
  color: white;
}

.midi-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

/* MIDI Container */
.midi-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

/* MIDI and Drum grids */
.midi-grid, .drum-grid {
  margin: 12px auto 0;
  border-radius: 8px;
  padding: 8px;
  background: var(--panel-2);
  border: 1px solid rgba(0,255,255,.1);
  overflow-x: auto;
  display: grid;
  width: fit-content;
  box-sizing: border-box;
}

/* MIDI Grid cells */
.midi-grid {
  gap: 2px;
  grid-auto-columns: minmax(30px, 1fr);
}

.grid-header-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  background: transparent;
}

.grid-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--panel);
  border-radius: 4px;
}

.grid-cell {
  background: var(--grid-inactive);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid rgba(0,255,255,.1);
  min-width: 30px;
  min-height: 30px;
}

.grid-cell:hover {
  background: var(--grid-hover);
  border-color: rgba(0,255,255,.3);
  transform: scale(1.05);
}

.grid-cell.active {
  background: var(--grid-active);
  border-color: var(--neon-pink);
  box-shadow: 0 0 12px rgba(255,0,255,.5);
}

.grid-cell.playing {
  border-color: var(--neon-blue);
  animation: pulse 0.2s ease;
}

.grid-cell.playhead,
.grid-header-cell.playhead {
  position: relative;
}

.grid-cell.playhead::after,
.grid-header-cell.playhead::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: rgba(0, 255, 128, 0.3);
  border: 2px solid var(--neon-green);
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 0 20px var(--neon-green);
  z-index: 10;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Drum Grid */
/* Drum grid now uses same styles as MIDI grid (.grid-cell, .grid-label, .grid-header-cell) */
.drum-grid {
  display: grid;
  gap: 3px;
}

/* Inline Track Type Selector Panel */
.inline-track-type-panel {
  width: 100%;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 0.3s ease-out, opacity 0.3s ease-out, margin 0.3s ease-out;
}

.inline-track-type-panel.active {
  height: auto;
  opacity: 1;
  margin-top: 16px;
}

.inline-panel-content {
  background: var(--panel);
  border: 2px solid rgba(0,255,255,.3);
  border-radius: 16px;
  padding: 20px;
  max-height: min(44svh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  transform: translateY(-10px);
  transition: transform 0.3s ease-out;
}

.inline-track-type-panel.active .inline-panel-content {
  transform: translateY(0);
}

/* Fallback for browsers that don't support svh */
@supports not (height: 1svh) {
  .inline-panel-content {
    max-height: min(44vh, 420px);
  }
}

.inline-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,255,255,.2);
}

.inline-panel-header h4 {
  margin: 0;
  font-size: 16px;
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
}

.inline-panel-close {
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,255,.2);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.inline-panel-close:hover,
.inline-panel-close:active {
  background: rgba(0,255,255,.15);
  border-color: var(--accent);
  transform: scale(1.1);
}

.inline-panel-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.inline-type-option {
  min-height: 52px;
  padding: 16px 12px;
  text-align: center;
  border-radius: 12px;
  background: var(--panel-2);
  border: 2px solid rgba(0,255,255,.2);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Orbitron', monospace;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.inline-type-option:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(0,255,255,.1);
}

.inline-type-option:active,
.inline-type-option.active {
  transform: scale(0.96);
  border-color: var(--accent);
  background: rgba(0,255,255,.15);
  box-shadow: 0 2px 8px rgba(0,255,255,.4);
}

.inline-type-option.selected {
  border-color: var(--neon-green);
  background: rgba(0,255,128,.15);
  box-shadow: 0 0 16px rgba(0,255,128,.3);
}

.inline-type-option.selected .inline-type-icon {
}

.inline-type-option.selected .inline-type-label {
  color: var(--neon-green);
}

.inline-type-icon {
  font-size: 32px;
}

.inline-type-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
  letter-spacing: 1px;
}

/* Mobile adjustments */
@media (max-width: 540px) {
  .inline-panel-options {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .inline-type-option {
    min-height: 52px;
    padding: 16px 20px;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: 16px;
  }

  .inline-type-icon {
    font-size: 28px;
    flex-shrink: 0;
  }

  .inline-type-label {
    flex: 1;
    text-align: left;
    font-size: 14px;
  }

  .inline-panel-header h4 {
    font-size: 14px;
  }

  .inline-panel-content {
    padding: 16px;
  }
}

/* Track cards in stack */
.track-card {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid rgba(0,255,255,.1);
  transition: all 0.3s ease;
  cursor: pointer;
  gap: 8px; /* Space between track number and content */
}

.track-card:hover {
  background: rgba(0,255,255,.05);
  border-color: rgba(0,255,255,.3);
}

.track-card.active {
  border-color: var(--accent);
  background: rgba(0,255,255,.1);
}

.track-number {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
  color: var(--panel);
  flex-shrink: 0;
}

.track-info {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between; /* Push status to the right */
  gap: 10px;
}

.track-left-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.track-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.track-type-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0,255,255,.1);
  border: 1px solid rgba(0,255,255,.3);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.track-type-icon {
  font-size: 14px;
}

.track-type-label {
  letter-spacing: 1px;
}

.track-status {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.track-edit-btn {
  border: none;
  background: transparent;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}

.track-edit-btn:hover,
.track-edit-btn:active {
  transform: scale(1.1);
}

.track-edit-btn svg {
  width: 16px;
  height: 16px;
}

/* Smaller icon next to the label inside the edit button */
.track-type-icon-img {
  width: 40px !important;
  height: 40px !important;
  display: inline-block;
}

.track-actions {
  display: flex;
  gap: 8px;
}

.track-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,255,.2);
  background: var(--panel);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.3s ease;
  display: grid;
  place-items: center;
}

.track-action-btn:hover {
  background: rgba(0,255,255,.1);
  transform: scale(1.1);
}

/* Visualizer */
.visualizer-content {
  padding: 10px;
  background: var(--panel-2);
  border-radius: 8px;
  border: 1px solid rgba(0,255,255,.1);
}

#transport-visualizer {
  width: 100%;
  height: 120px;
  border-radius: 4px;
}

/* Unified Bottom Bar */
.bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: rgba(26,26,46,.95);
  border-top: 1px solid rgba(0,255,255,.2);
  backdrop-filter: saturate(1.2) blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  height: var(--bottom-bar-h);
}

/* Left: Navigation */
.bottom-nav {
  display: flex;
  gap: 0px;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.3s ease;
}

/* When track type is shown, move nav to left */
.bottom-bar:has(.bottom-bar-track-type[style*="display: flex"]) .bottom-nav,
.bottom-bar:has(.bottom-bar-selected-track[style*="display: flex"]) .bottom-nav {
  position: static;
  transform: none;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: auto;
}

.nav-btn img {
  width: 64px;
  height: 64px;
  filter: brightness(1);
}

.nav-btn.active {
  color: var(--text);
}

.nav-btn.active img {
  filter: brightness(1);
}

.nav-btn:hover {
  transform: scale(1.05);
}

.nav-btn span {
  display: none;
}

/* Center: Track Type Options in Bottom Bar */
.bottom-bar-track-type {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  max-width: 600px;
  margin-left: auto;
}

.bottom-bar-selected-track {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  padding: 0 10px;
  margin-left: auto;
}

.selected-track-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(0,255,255,.1);
  border: 1px solid rgba(0,255,255,.3);
  border-radius: 20px;
  box-shadow: 0 0 15px rgba(0,255,255,.2);
}

.selected-track-number {
  font-weight: 900;
  font-size: 16px;
  color: var(--accent);
  min-width: 20px;
  text-align: center;
}

.selected-track-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.selected-track-icon {
  font-size: 16px;
}

.selected-track-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
}

/* Editor Home Button */
.bottom-bar-editor-home {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0px;
}

.editor-home-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--muted);
  font-size: 11px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: auto;
  -webkit-tap-highlight-color: transparent;
}

.editor-home-btn img {
  width: 64px;
  height: 64px;
  filter: brightness(1);
}

.editor-home-btn span {
  display: none;
}

.editor-home-btn:hover {
  transform: scale(1.05);
}

.editor-home-btn:active {
  transform: scale(0.95);
}

/* Editor Controls Container */
.bottom-bar-editor-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.editor-control-btn {
  background: transparent;
  border: none;
  width: auto;
  height: 48px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.editor-control-btn:hover {
  transform: scale(1.1);
}

.editor-control-btn:active {
  transform: scale(0.95);
}

.editor-control-btn.active {
  color: white;
}

/* Synth editor */
.synth-container {
  display: grid;
  gap: 12px;
}

.synth-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.synth-keyboard {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(36px, 1fr);
  gap: 4px;
  padding: 8px;
  background: var(--panel-2);
  border: 1px solid rgba(0,255,255,.1);
  border-radius: 8px;
}

.synth-key {
  height: 120px;
  background: linear-gradient(180deg, #ffffff, #dfe7ff);
  border: 1px solid rgba(0,0,0,.2);
  border-radius: 4px;
  box-shadow: inset 0 2px 2px rgba(255,255,255,.6);
  cursor: pointer;
  transition: transform .02s ease;
}

.synth-key.active {
  transform: translateY(2px);
  background: linear-gradient(180deg, #e8f0ff, #c8d8ff);
}

.change-type-btn {
  background: transparent;
  border: none;
  width: auto;
  height: 48px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.change-type-btn:hover {
  transform: scale(1.1);
}

.change-type-btn:active {
  transform: scale(0.95);
}

/* Track Type Change Menu */
.bottom-bar-type-change-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  max-width: 600px;
}

.track-type-change-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  margin-right: 4px;
}

.bottom-type-change-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0,255,255,.04);
  border: 1px solid rgba(0,255,255,.2);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Orbitron', monospace;
}

.bottom-type-change-option:hover {
  background: rgba(0,255,255,.1);
  border-color: rgba(0,255,255,.4);
  transform: translateY(-2px);
}

.bottom-type-change-option:active {
  transform: translateY(0);
  background: rgba(0,255,255,.15);
}

/* Bottom Bar Gain Control */
.bottom-bar-gain {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
}

.bottom-bar-gain .gain-label {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.bottom-bar-gain input[type="range"] {
  width: 80px;
  height: 4px;
  background: rgba(0,255,255,.2);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

.bottom-bar-gain input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.bottom-bar-gain input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.track-type-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  margin-right: 4px;
}

.bottom-type-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0,255,255,.04);
  border: 1px solid rgba(0,255,255,.2);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bottom-type-option:hover,
.bottom-type-option:active {
  background: rgba(0,255,255,.1);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.bottom-type-option.selected {
  background: rgba(0,255,255,.2);
  border-color: var(--accent);
  color: var(--accent);
}

.bottom-type-icon {
  font-size: 16px;
}

.bottom-type-text {
  font-family: 'Orbitron', monospace;
  text-transform: uppercase;
}

.bottom-type-close {
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  background: rgba(255,0,0,.1);
  border: 1px solid rgba(255,0,0,.3);
  color: #ff6666;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  touch-action: manipulation;
  margin-left: 4px;
}

.bottom-type-close:hover,
.bottom-type-close:active {
  background: rgba(255,0,0,.2);
  border-color: #ff6666;
}

/* Right: Player Section */
.player-section {
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.play {
  width: auto;
  height: auto;
  padding: 12px 0px;
  background: transparent;
  border: none;
  color: white;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 32px;
  flex-shrink: 0;
}

.play:hover {
  transform: scale(1.1);
}

.circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,255,.2);
  background: var(--panel);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.circle:hover {
  background: rgba(0,255,255,.1);
  border-color: var(--accent);
}

/* Mobile adjustments */
@media (max-width: 540px) {
  .nav-btn {
    min-width: 60px;
    padding: 6px 10px;
  }

  .play {
    padding: 10px 14px;
    font-size: 18px;
  }

  .bottom-type-text {
    display: none;
  }

  .bottom-type-option {
    padding: 8px;
    min-width: 48px;
  }

  .track-type-label {
    font-size: 11px;
  }
}

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  max-width: 90vw;
  transform: translateX(-100%);
  transition: transform .28s ease;
  background: rgba(26,26,46,.98);
  border-right: 1px solid rgba(0,255,255,.2);
  box-shadow: var(--shadow);
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  transform: none;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid rgba(0,255,255,.1);
}

.side-head strong {
  font-weight: 900;
  text-transform: uppercase;
  color: var(--accent);
}

.side-body {
  padding: 12px;
  display: grid;
  gap: 10px;
  overflow: auto;
}

.control-section {
  background: var(--panel-2);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(0,255,255,.1);
  margin-bottom: 10px;
}

.control-section h4 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 700;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid rgba(0,255,255,.1);
  color: var(--text);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.menu-item:hover {
  background: rgba(0,255,255,.1);
  border-color: var(--accent);
  transform: translateX(4px);
}

/* Lip Container for Track Type Selection */
.lip-container {
  position: fixed;
  bottom: var(--bottom-bar-h);
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  max-width: 600px;
  width: 90%;
}

.lip-container.active {
  opacity: 1;
  visibility: visible;
}

.lip-content {
  background: var(--panel);
  border: none;
  border-radius: 16px 16px 0 0;
  padding: 12px 20px 16px;
}

.lip-content h4 {
  margin: 0 0 12px;
  font-size: 10px;
  color: white;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
}

.lip-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0px;
}

.lip-type-option {
  min-height: 80px;
  padding: 16px 4px;
  text-align: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Orbitron', monospace;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.lip-type-option:hover {
  transform: scale(1.1);
}

.lip-type-option:active {
  transform: scale(0.95);
}

.lip-type-icon {
  font-size: 32px;
}

.lip-type-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
  letter-spacing: 1px;
}

/* Mobile adjustments */
@media (max-width: 540px) {
  .lip-options {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .lip-type-option {
    min-height: 70px;
    padding: 12px 8px;
  }

  .lip-type-icon {
    font-size: 24px;
  }

  .lip-type-label {
    font-size: 10px;
  }

  .lip-content h4 {
    font-size: 9px;
    margin-bottom: 10px;
  }

  .lip-content {
    padding: 16px;
  }
}

/* Utility */
.spacer { flex: 1; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Mobile optimizations */
@media (max-width: 540px) {
  .grid {
    padding: 10px;
  }

  .hero h1 {
    font-size: 20px;
  }

  .card {
    padding: 12px;
  }

  .generator-buttons {
    grid-template-columns: 1fr;
  }

  .export-buttons {
    grid-template-columns: 1fr;
  }

  /* Edit page mobile adjustments */
  #edit-page {
    padding: 8px;
    gap: 12px;
    justify-items: stretch; /* Override center alignment on mobile */
  }

  #edit-page .midi-card,
  #edit-page .beats-card,
  #edit-page .sound-card,
  #edit-page .generators-card,
  #edit-page .context-card {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin: 0; /* Remove any margins that could cause clipping */
  }

  /* Force all containers to respect viewport */
  .midi-container,
  .sound-controls,
  .context-controls,
  .beats-controls {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* Make grids scrollable horizontally if needed */
  .midi-grid,
  .drum-grid {
    max-width: calc(100vw - 32px); /* Account for padding */
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  /* Ensure grid containers don't overflow */
  .midi-container {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Reduce minimum heights on mobile */
  #edit-page .midi-card {
    min-height: auto;
  }

  #edit-page .beats-card {
    min-height: auto;
  }

  /* Scale down grid cells for better mobile fit */
  .grid-cell {
    min-width: 20px;
    min-height: 20px;
  }

  /* Adjust ADSR grid for mobile */
  .adsr-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Stack generator buttons on mobile */
  .generator-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  /* Make control rows stack better on mobile */
  .control-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .control-row label {
    min-width: auto;
    text-align: left;
  }

  .control-row input[type="number"],
  .control-row select,
  .control-row input[type="range"] {
    width: 100%;
  }

  /* Reduce card title size on mobile */
  .card h3 {
    font-size: 13px;
    margin-bottom: 8px;
  }

  /* Ensure generator params don't overflow */
  .generator-params {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Fix grid clipping on mobile */
  .grid {
    padding: 8px;
    justify-items: stretch; /* Stretch items to full width instead of centering */
    width: 100vw; /* Full viewport width */
    max-width: 100vw; /* Don't exceed viewport */
    margin: 0; /* Remove auto margins */
  }

  /* Ensure all cards fit within viewport */
  .card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal scroll */
  }

  /* Force page sections to respect viewport */
  .page-section {
    max-width: 100vw;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Ensure content area doesn't exceed viewport */
  .content {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Track stack: 1 column on mobile */
  .list {
    grid-template-columns: 1fr;
    max-height: 600px; /* Increase height for mobile to fit all 8 tracks */
  }
}

/* Edit page layout */
#edit-page {
  padding: 16px;
  gap: 16px;
  grid-template-columns: 1fr;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* All cards in edit page should be full width on mobile */
#edit-page .card {
  width: 100%;
  max-width: 100%;
  padding: 12px;
}

/* MIDI Sequencer - full width, larger height */
#edit-page .midi-card {
  grid-column: 1 / -1;
  min-height: 400px;
}

/* Beats card - full width, larger height */
#edit-page .beats-card {
  grid-column: 1 / -1;
  min-height: 350px;
}

/* Desktop layout: single centered column */
@media (min-width: 900px) {
  #edit-page {
    grid-template-columns: 1fr;
    gap: 16px;
    justify-items: center;
    padding: 16px;
  }

  /* MIDI Sequencer - centered, full width of container */
  #edit-page .midi-card {
    width: 40%;
    max-width: 600px;
    min-height: 500px;
  }

  /* Beats card - centered, full width of container */
  #edit-page .beats-card {
    width: 100%;
    max-width: 100%;
    min-height: 500px;
  }

  /* Sound Bank, Generators, Musical Context - centered below */
  #edit-page .sound-card,
  #edit-page .generators-card,
  #edit-page .context-card {
    width: 100%;
    max-width: 100%;
  }
}

/* ADSR grid styling */
.adsr-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

/* Generator params styling */
.generator-params {
  margin-top: 12px;
}

/* Audio track styling */
.audio-clip-controls {
  display: grid;
  gap: 16px;
}

.audio-upload-section,
.audio-clip-settings,
.audio-record-section {
  display: grid;
  gap: 12px;
}

.audio-file-input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid rgba(0,255,255,.2);
  color: var(--text);
  cursor: pointer;
  font-family: 'Orbitron', monospace;
}

.audio-file-input:hover {
  background: rgba(0,255,255,.05);
  border-color: rgba(0,255,255,.4);
}

.audio-file-info {
  padding: 10px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid rgba(0,255,255,.1);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.audio-preview-section {
  display: flex;
  gap: 10px;
}

.audio-waveform-container {
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
  border: 1px solid rgba(0,255,255,.2);
}

#audio-waveform-canvas {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.volume-value {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

/* Theremin Styles */
.theremin-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.theremin-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theremin-info {
  display: flex;
  justify-content: space-around;
  padding: 12px;
  background: var(--panel-2);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.theremin-pad {
  position: relative;
  width: 100%;
  height: 300px;
  background: linear-gradient(180deg, #1a1a2e 0%, #0a0a0a 100%);
  border: 2px solid var(--accent);
  border-radius: 12px;
  cursor: crosshair;
  touch-action: none;
  box-shadow: 0 0 20px rgba(0,255,255,0.3), inset 0 0 30px rgba(0,255,255,0.1);
  overflow: hidden;
}

#theremin-trail-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.theremin-help {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}

/* Guitar Styles */
.guitar-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guitar-controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
}

.guitar-controls label {
  font-size: 12px;
  color: var(--muted);
}

.guitar-info {
  padding: 8px 12px;
  background: var(--panel-2);
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  color: var(--accent);
}

.guitar-fretboard {
  position: relative;
  background: linear-gradient(90deg, #1a1a2e 0%, #0a0a0a 100%);
  border-radius: 12px;
  padding: 20px 12px;
  overflow-x: auto;
  border: 2px solid var(--accent);
  box-shadow: 0 0 20px rgba(0,255,255,0.2), inset 0 0 30px rgba(0,255,255,0.05);
}

.fretboard-grid {
  display: grid;
  grid-template-columns: 50px repeat(13, 1fr);
  gap: 0;
  min-width: 900px;
}

.fret-marker {
  position: relative;
  height: 100%;
  border-right: 2px solid rgba(0, 255, 255, 0.2);
}

.fret-marker:first-child {
  border-right: 3px solid rgba(0, 255, 255, 0.4); /* Nut */
}

.fret-marker.has-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: rgba(0, 255, 255, 0.4);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

.fret-number {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}

.guitar-string-row {
  display: contents;
}

.string-label {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 0;
  text-shadow: 0 0 8px currentColor;
}

.guitar-string-row:nth-child(1) .string-label { color: var(--neon-blue); }
.guitar-string-row:nth-child(2) .string-label { color: var(--neon-purple); }
.guitar-string-row:nth-child(3) .string-label { color: var(--neon-pink); }
.guitar-string-row:nth-child(4) .string-label { color: var(--neon-green); }
.guitar-string-row:nth-child(5) .string-label { color: var(--electric-blue); }
.guitar-string-row:nth-child(6) .string-label { color: var(--neon-blue); }

.fret-position {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.fret-position::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-50%);
  transition: all 0.15s ease;
}

.guitar-string-row:nth-child(1) .fret-position::before { background: var(--neon-blue); box-shadow: 0 0 8px var(--neon-blue); }
.guitar-string-row:nth-child(2) .fret-position::before { background: var(--neon-purple); box-shadow: 0 0 8px var(--neon-purple); }
.guitar-string-row:nth-child(3) .fret-position::before { background: var(--neon-pink); box-shadow: 0 0 8px var(--neon-pink); }
.guitar-string-row:nth-child(4) .fret-position::before { background: var(--neon-green); box-shadow: 0 0 8px var(--neon-green); }
.guitar-string-row:nth-child(5) .fret-position::before { background: var(--electric-blue); box-shadow: 0 0 8px var(--electric-blue); }
.guitar-string-row:nth-child(6) .fret-position::before { background: var(--neon-blue); box-shadow: 0 0 8px var(--neon-blue); }

.fret-position:hover {
  background: rgba(0, 255, 255, 0.15);
}

.fret-position:hover::before {
  height: 4px;
  box-shadow: 0 0 16px currentColor !important;
  filter: brightness(1.5);
}

.fret-position.active {
  background: rgba(0, 255, 255, 0.3);
}

.fret-position.active::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--accent), 0 0 40px var(--accent);
  animation: fretPulse 0.4s ease-out;
  z-index: 10;
}

.fret-position.active::before {
  height: 6px !important;
  box-shadow: 0 0 20px currentColor !important;
  filter: brightness(2);
}

@keyframes fretPulse {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.8);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.guitar-strum-area {
  background: var(--panel-2);
  border: 2px dashed var(--accent);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: ns-resize;
  touch-action: none;
  transition: all 0.2s ease;
  user-select: none;
}

.guitar-strum-area:hover,
.guitar-strum-area:active {
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  background: rgba(255,0,128,0.1);
}

.guitar-strum-area:hover span,
.guitar-strum-area:active span {
  opacity: 1 !important;
  color: var(--neon-pink);
}

/* Bottom Sheet for Track Type Selection */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bottom-sheet-overlay[style*="display: flex"] {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  width: 100%;
  max-width: 600px;
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 80vh;
  overflow-y: auto;
}

.bottom-sheet-overlay[style*="display: flex"] .bottom-sheet {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--muted);
  border-radius: 2px;
  margin: 12px auto;
}

.bottom-sheet-content {
  padding: 0 20px 40px;
}

.bottom-sheet-content h3 {
  color: white;
  font-size: 18px;
  margin-bottom: 8px;
  text-align: center;
}

.bottom-sheet-subtitle {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin-bottom: 24px;
}

/* Scroll Picker Styles */
.picker-container {
  position: relative;
  width: 100%;
  height: 180px;
  margin: 20px 0;
  overflow: hidden;
}

.picker-highlight {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 90%;
  background: rgba(0, 255, 255, 0.05);
  border: 2px solid var(--accent);
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.1);
}

.picker-scroll {
  width: 100%;
  height: 100%;
  overflow-x: scroll;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding: 0 calc(50% - 70px);
  display: flex;
  align-items: center;
  gap: 0;
}

.picker-scroll::-webkit-scrollbar {
  display: none;
}

.picker-item {
  min-width: 140px;
  width: 140px;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  scroll-snap-align: center;
  transition: all 0.3s ease;
  opacity: 0.3;
  transform: scale(0.7);
  cursor: pointer;
  flex-shrink: 0;
}

@keyframes pickerGrowOnce {
  0% {
    transform: scale(0.7);
  }
  100% {
    transform: scale(1);
  }
}

.picker-item.centered {
  opacity: 1;
  transform: scale(1);
  animation: pickerGrowOnce 0.3s ease-out forwards;
}

.picker-icon {
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
}

.picker-icon img {
  width: 64px;
  height: 64px;
  filter: brightness(0.5);
  transition: filter 0.3s ease;
}

.picker-item.centered .picker-icon img {
  filter: brightness(1) drop-shadow(0 0 10px var(--accent));
}

.picker-label {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: white;
  transition: all 0.3s ease;
  text-align: center;
  opacity: 0.5;
}

.picker-item.centered .picker-label {
  color: white;
  opacity: 1;
  text-shadow: 0 0 15px var(--accent);
}

.picker-confirm {
  width: 100%;
  margin-top: 20px;
  font-size: 16px;
  padding: 14px;
}