/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Orbitron', sans-serif;
  background: #1a0033;
  color: #ffffff;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  overscroll-behavior: none;
  overscroll-behavior-y: contain;
}

body.no-scroll {
  overflow: hidden;
  touch-action: none;
}

/* Scanlines Effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 9999;
  animation: scanline 8s linear infinite;
}

@keyframes scanline {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

/* Background Canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Container */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* Island section gets full width */
.island-section {
  max-width: none !important;
  width: 100vw !important;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(26, 0, 51, 0.8);
  border-radius: 10px;
  border: 2px solid rgba(255, 110, 199, 0.3);
}

.header h1 {
  font-size: clamp(1.5rem, 5vw, 3rem);
  margin-bottom: 10px;
}

.subtitle {
  font-size: clamp(0.8rem, 2vw, 1.2rem);
  color: #00d9ff;
  font-weight: 300;
  margin-bottom: 15px;
}

/* Header Controls */
.header-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  border: 1px solid rgba(255, 110, 199, 0.3);
}

/* Header Player */
.header-player {
  margin-top: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* SoundCloud URL Input */
.soundcloud-url-input {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.soundcloud-url-input label {
  color: #00d9ff;
  font-size: 0.9rem;
}

.soundcloud-url-input input {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
  padding: 10px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
}

.soundcloud-url-input input:focus {
  outline: none;
  border-color: #00d9ff;
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.5);
}

/* Mini Player Controls */
.mini-player-controls {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.sc-btn-mini {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #10b981;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 3px;
}

.sc-btn-mini:hover {
  background: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
  transform: scale(1.1);
}

.mini-progress {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mini-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.mini-volume {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-volume span {
  font-size: 1rem;
}

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

.neon-text {
  color: #ff6ec7;
  text-shadow:
    0 0 5px #ff6ec7,
    0 0 10px #ff6ec7,
    0 0 20px #ff6ec7,
    0 0 40px #ff6ec7;
}

/* Sections */
.section {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 3px solid;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
}

.upstream-section {
  border-color: #00d9ff;
  background-color: rgba(0, 217, 255, 0.1);
  min-height: 300px;
}

.combined-sequencer-section {
  border-color: #00d9ff;
  background-color: rgba(0, 217, 255, 0.1);
  min-height: 600px;
}

.island-section {
  border-color: #10b981;
  background-color: rgba(16, 185, 129, 0.1);
  min-height: 1000px;
  width: 100%;
  position: relative;
  overflow: visible;
  touch-action: pan-y;
}

.downstream-section {
  border-color: #0066cc;
  background-color: rgba(0, 102, 204, 0.1);
  min-height: 300px;
}

/* Section Backgrounds */
.section-bg,
.island-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.island-bg {
  position: relative;
  height: 100%;
  min-height: 600px;
  touch-action: none;
}

/* Island PNG background - 120% width */
.island-bg::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120vw;
  height: 100%;
  background-image: url('island.png');
  background-size: 120vw auto;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
}

/* Fallback gradient if no PNG */
.island-bg::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120vw;
  height: 400px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%,
      rgba(34, 197, 94, 0.2) 0%,
      rgba(34, 197, 94, 0.15) 40%,
      rgba(16, 185, 129, 0.1) 60%,
      rgba(16, 185, 129, 0.05) 80%,
      transparent 100%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.section-bg canvas,
.island-bg canvas {
  width: 100%;
  height: 100%;
}

/* Section Content */
.section-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  padding: 30px;
  gap: 20px;
}

.island-content {
  position: relative;
  z-index: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 350px;
}

/* Section Labels */
.section-label {
  font-size: 1.5rem;
  font-weight: 900;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 5px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
}

.water-label {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin-bottom: 15px;
  letter-spacing: 3px;
}

/* Sequencer Container */
.sequencer-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Instrument Row */
.instrument-row {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.instrument-label {
  font-size: 1.5rem;
  min-width: 100px;
  text-align: center;
  font-weight: bold;
}

/* Beat Grid */
.beat-grid {
  display: grid;
  grid-template-columns: repeat(4, 60px);
  grid-template-rows: repeat(2, 60px);
  gap: 10px;
  flex: 1;
  justify-content: center;
}

.beat-box {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.3);
  user-select: none;
}

.beat-box:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: rgba(255, 110, 199, 0.8);
  box-shadow: 0 5px 20px rgba(255, 110, 199, 0.4);
}

.beat-box.active {
  background: rgba(255, 110, 199, 0.4);
  border-color: #ff6ec7;
  box-shadow: 0 0 20px rgba(255, 110, 199, 0.6);
  color: #ffffff;
}

.beat-box.current {
  border-color: #ffbe0b;
  box-shadow: 0 0 30px rgba(255, 190, 11, 0.9);
  animation: pulse 0.3s ease;
}

.beat-box.flash {
  background: rgba(255, 110, 199, 0.9) !important;
  box-shadow: 0 0 50px rgba(255, 110, 199, 1) !important;
  transform: scale(1.15);
}

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

/* Instrument Controls */
.instrument-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 120px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.control-group label {
  font-size: 0.75rem;
  min-width: 25px;
  color: #00d9ff;
}

.control-group input[type="range"] {
  flex: 1;
  min-width: 60px;
}

.control-group .value-display {
  font-size: 0.75rem;
  min-width: 25px;
  text-align: right;
  color: rgba(255, 255, 255, 0.7);
}

/* Icon Toolbar */
.icon-toolbar-container {
  position: relative;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  padding: 15px;
  border-bottom: 3px solid #10b981;
  backdrop-filter: blur(10px);
}

.toolbar-title {
  text-align: center;
  color: #10b981;
  font-size: 1.2rem;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}


.icon-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  min-height: 160px;
  max-width: 1000px;
  margin: 0 auto;
}

.toolbar-icon {
  font-size: 3rem;
  cursor: pointer;
  padding: 15px;
  background: rgba(16, 185, 129, 0.2);
  border: 3px solid rgba(16, 185, 129, 0.5);
  border-radius: 15px;
  transition: all 0.3s ease;
  animation: icon-float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.6));
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.toolbar-icon:hover {
  transform: scale(1.2) translateY(-10px);
  background: rgba(16, 185, 129, 0.4);
  border-color: #10b981;
  filter: drop-shadow(0 0 20px rgba(16, 185, 129, 1));
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.8);
}

.toolbar-icon:nth-child(1) { animation-delay: 0s; }
.toolbar-icon:nth-child(2) { animation-delay: 0.2s; }
.toolbar-icon:nth-child(3) { animation-delay: 0.4s; }
.toolbar-icon:nth-child(4) { animation-delay: 0.6s; }
.toolbar-icon:nth-child(5) { animation-delay: 0.8s; }
.toolbar-icon:nth-child(6) { animation-delay: 1.0s; }
.toolbar-icon:nth-child(7) { animation-delay: 1.2s; }
.toolbar-icon:nth-child(8) { animation-delay: 1.4s; }

@keyframes icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Placed Icons on Island */
.placed-icon {
  position: absolute;
  font-size: 12rem;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.3s ease;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
  z-index: 10;
  padding: 20px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.placed-icon:hover {
  transform: scale(1.3) rotate(-10deg);
  filter: drop-shadow(0 0 20px rgba(16, 185, 129, 1));
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

/* Video Modal */
.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.video-modal.hidden {
  display: none;
}

.video-modal-content {
  position: relative;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  background: rgba(26, 0, 51, 0.95);
  border-radius: 15px;
  border: 3px solid rgba(255, 110, 199, 0.8);
  box-shadow: 0 0 40px rgba(255, 110, 199, 1);
  padding: 20px;
  overflow-y: auto;
}

.video-modal-content video {
  width: 100%;
  max-height: 80vh;
  height: auto;
  border-radius: 10px;
  border: 2px solid rgba(255, 110, 199, 0.5);
}

.video-modal-close {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid #ff6ec7;
  background: rgba(255, 110, 199, 0.9);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1;
}

.video-modal-close:hover {
  transform: scale(1.2) rotate(90deg);
  box-shadow: 0 0 25px rgba(255, 110, 199, 1);
}

@media (max-width: 768px) {
  .video-modal-content {
    max-width: 95%;
    padding: 15px;
  }

  .video-modal-close {
    top: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}


/* SoundCloud Player */
.soundcloud-player {
  width: 100%;
  max-width: 600px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: 15px;
  border: 2px solid rgba(16, 185, 129, 0.5);
}

.track-info {
  text-align: center;
  margin-bottom: 20px;
}

.track-info h2 {
  font-size: 1.5rem;
  color: #10b981;
  margin-bottom: 5px;
}

.track-info p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.player-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sc-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sc-btn:hover {
  background: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
  transform: scale(1.1);
}

.progress-container {
  width: 100%;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: visible;
  cursor: pointer;
  transition: all 0.2s ease;
}

.progress-bar:hover {
  background: rgba(255, 255, 255, 0.3);
  height: 10px;
  margin-bottom: 5px;
  cursor: pointer;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #10b981, #00d9ff);
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
  border-radius: 10px;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: #ff6ec7;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 15px rgba(255, 110, 199, 0.9);
  transition: left 0.1s linear;
  pointer-events: none;
  z-index: 10;
}

.progress-bar:hover .progress-thumb {
  width: 18px;
  height: 18px;
  box-shadow: 0 0 20px rgba(255, 110, 199, 1);
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

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

.volume-control span {
  font-size: 1.2rem;
}

.volume-control input[type="range"] {
  flex: 1;
  max-width: 150px;
}

/* Controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  align-items: center;
  padding: 30px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 15px;
  border: 2px solid rgba(255, 110, 199, 0.3);
}

.control-btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255, 110, 199, 0.4);
  border-color: #ff6ec7;
}

.control-btn.primary {
  background: rgba(255, 110, 199, 0.3);
  border-color: #ff6ec7;
}

.control-btn.special {
  background: linear-gradient(135deg, #ff6ec7, #00d9ff);
  border-color: #ffffff;
  animation: rainbow 3s linear infinite;
}

@keyframes rainbow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.control-btn .icon {
  font-size: 1.2rem;
}

/* BPM Control */
.bpm-control {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
}

.bpm-control label {
  font-size: 0.9rem;
  white-space: nowrap;
  text-align: center;
}

#bpm-value {
  color: #00d9ff;
  font-weight: bold;
  min-width: 35px;
  display: inline-block;
}

.bpm-slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bpm-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  color: #00d9ff;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
}

.bpm-btn:hover {
  background: rgba(0, 217, 255, 0.2);
  border-color: #00d9ff;
  transform: scale(1.1);
}

.bpm-btn:active {
  transform: scale(0.95);
  background: rgba(0, 217, 255, 0.3);
}

/* Preset Control */
.preset-control select {
  padding: 12px 20px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.preset-control select:hover {
  border-color: #00d9ff;
}

/* Range Inputs */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff6ec7;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 110, 199, 0.8);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff6ec7;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px rgba(255, 110, 199, 0.8);
}

/* Message Bubble */
.message-bubble {
  position: fixed;
  bottom: 100px;
  right: 50px;
  max-width: 350px;
  padding: 20px;
  background: rgba(255, 110, 199, 0.9);
  border-radius: 20px;
  border: 2px solid #ffffff;
  box-shadow: 0 10px 40px rgba(255, 110, 199, 0.6);
  z-index: 10000;
  animation: float-up 5s ease forwards;
}

.message-bubble.hidden {
  display: none;
}

.message-bubble p {
  margin-bottom: 10px;
  font-size: 1.1rem;
  line-height: 1.4;
}

.message-bubble span {
  display: block;
  font-size: 0.85rem;
  text-align: right;
  font-style: italic;
  opacity: 0.9;
}

@keyframes float-up {
  0% {
    bottom: 100px;
    opacity: 0;
    transform: scale(0.8);
  }
  20% {
    opacity: 1;
    transform: scale(1);
  }
  80% {
    opacity: 1;
    bottom: 150px;
  }
  100% {
    bottom: 200px;
    opacity: 0;
  }
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(135deg, #1a0033, #330066);
  padding: 40px;
  border-radius: 20px;
  border: 3px solid #ff6ec7;
  box-shadow: 0 20px 60px rgba(255, 110, 199, 0.6);
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-bottom: 20px;
  text-align: center;
  color: #ff6ec7;
}

.modal-content input {
  width: 100%;
  padding: 15px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  margin-bottom: 20px;
}

.modal-content input:focus {
  outline: none;
  border-color: #00d9ff;
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.5);
}

.modal-buttons {
  display: flex;
  gap: 15px;
}

.modal-btn {
  flex: 1;
  padding: 15px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 110, 199, 0.4);
}

.modal-btn.primary {
  background: rgba(255, 110, 199, 0.5);
  border-color: #ff6ec7;
}

/* Story Modal */
.story-modal-content {
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: linear-gradient(135deg, #1a0033, #330066);
  padding: 30px;
  border-radius: 20px;
  border: 3px solid #ff6ec7;
  box-shadow: 0 20px 60px rgba(255, 110, 199, 0.6);
}

.story-modal-content img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 2px solid rgba(255, 110, 199, 0.5);
}

.story-modal-content img[src=""] {
  display: none;
}

.story-modal-content h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: #00d9ff;
}

.story-modal-content p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
}

.story-modal-close {
  padding: 12px 30px;
  border-radius: 8px;
  border: 2px solid #ff6ec7;
  background: rgba(255, 110, 199, 0.3);
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.story-modal-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255, 110, 199, 0.6);
  background: rgba(255, 110, 199, 0.5);
}

/* Confetti */
#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ff6ec7;
  animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .section-content {
    flex-direction: column;
    padding: 20px;
  }

  .section-label {
    writing-mode: horizontal-tb;
    font-size: 1.2rem;
  }

  .instrument-row {
    flex-direction: column;
    gap: 10px;
  }

  .instrument-label {
    min-width: auto;
  }

  .beat-box {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .beat-grid {
    grid-template-columns: repeat(4, 40px);
    grid-template-rows: repeat(2, 40px);
    gap: 6px;
  }

  .instrument-controls {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    gap: 5px;
    min-width: 0;
  }

  .control-group {
    flex: 1;
    min-width: 0;
    max-width: 48%;
  }

  .control-group input[type="range"] {
    min-width: 40px;
    max-width: 80px;
  }

  .control-group .value-display {
    min-width: 20px;
  }

  .soundcloud-player {
    padding: 20px;
  }

  .controls {
    padding: 20px;
    gap: 10px;
  }

  .control-btn {
    font-size: 0.8rem;
    padding: 10px 15px;
  }

  .message-bubble {
    right: 20px;
    max-width: 250px;
  }

  .people-container {
    gap: 8px;
  }

  .person {
    font-size: 1.8rem;
  }

  .sound-system {
    right: 5%;
  }

  .speaker {
    font-size: 2rem;
  }

  .object {
    font-size: 1.5rem;
  }

  .soundcloud-url-input {
    flex-direction: column;
  }

  .soundcloud-url-input input {
    min-width: 200px;
    width: 100%;
  }

  .header-player {
    padding: 10px;
  }

  .mini-player-controls {
    flex-direction: column;
    gap: 10px;
  }

  .mini-progress {
    min-width: 100%;
  }

  .story-objects {
    gap: 10px;
    top: 65%;
  }

  .story-obj {
    font-size: 1.8rem;
  }

  .story-modal-content {
    padding: 20px;
    max-width: 95vw;
    max-height: 85vh;
  }

  .story-modal-content img {
    max-height: 70vh;
  }

  .island-section {
    min-height: 700px;
  }

  .toolbar-icon {
    font-size: 2.2rem;
    padding: 12px;
  }

  .toolbar-title {
    font-size: 1rem;
  }

  .placed-icon {
    font-size: 9rem;
    padding: 16px;
  }
}

/* Acid Synth XY Pad */
.acid-synth-container {
  margin-top: 20px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 15px;
  border: 2px solid rgba(255, 110, 199, 0.3);
  backdrop-filter: blur(10px);
}

.acid-title {
  text-align: center;
  color: #ff6ec7;
  font-size: 1.5rem;
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(255, 110, 199, 0.8);
  letter-spacing: 2px;
}

.acid-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.acid-waveform-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #00d9ff;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
}

.waveform-select {
  padding: 8px 15px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid #ff6ec7;
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.waveform-select:hover {
  border-color: #00d9ff;
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.5);
}

.waveform-select:focus {
  border-color: #00d9ff;
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.7);
}

.waveform-select option {
  background: #1a0033;
  color: #ffffff;
  padding: 10px;
}

.acid-btn {
  background: rgba(255, 110, 199, 0.2);
  border-color: #ff6ec7;
  font-size: 1.1rem;
  padding: 15px 30px;
  transition: all 0.3s ease;
}

.acid-btn:hover {
  background: rgba(255, 110, 199, 0.4);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 110, 199, 0.8);
}

.acid-btn.active {
  background: rgba(255, 110, 199, 0.5);
  border-color: #ff0080;
  box-shadow: 0 0 30px rgba(255, 0, 128, 0.9);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 30px rgba(255, 0, 128, 0.9); }
  50% { box-shadow: 0 0 50px rgba(255, 0, 128, 1); }
}

.xy-pad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.xy-pad {
  position: relative;
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, rgba(26, 0, 51, 0.9), rgba(51, 0, 102, 0.9));
  border: 3px solid #ff6ec7;
  border-radius: 15px;
  cursor: crosshair;
  overflow: hidden;
  box-shadow:
    0 0 30px rgba(255, 110, 199, 0.5),
    inset 0 0 50px rgba(255, 110, 199, 0.1);
  touch-action: none;
  user-select: none;
}

.xy-pad::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 110, 199, 0.3);
}

.xy-pad::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 110, 199, 0.3);
}

.xy-cursor {
  position: absolute;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #ff6ec7, #ff0080);
  border: 2px solid #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 20px rgba(255, 110, 199, 1);
  transition: all 0.05s ease;
  left: 50%;
  top: 50%;
}

.xy-labels {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.xy-label-x {
  position: absolute;
  bottom: 10px;
  right: 10px;
  color: rgba(255, 110, 199, 0.6);
  font-size: 0.8rem;
  font-weight: bold;
}

.xy-label-y {
  position: absolute;
  top: 10px;
  left: 10px;
  color: rgba(255, 110, 199, 0.6);
  font-size: 0.8rem;
  font-weight: bold;
  line-height: 1.2;
}

.xy-info {
  display: flex;
  gap: 30px;
  color: #00d9ff;
  font-size: 1rem;
  font-family: 'VT323', monospace;
}

.xy-info span {
  color: #ff6ec7;
  font-weight: bold;
}

/* Desktop: Make island wider */
@media (min-width: 1024px) {
  .island-bg::before {
    width: 150vw;
    background-size: 150vw auto;
  }

  .island-bg::after {
    width: 150vw;
  }
}

/* Mobile: Smaller XY pad */
@media (max-width: 768px) {
  .xy-pad {
    width: 250px;
    height: 250px;
  }

  .acid-title {
    font-size: 1.2rem;
  }

  .xy-info {
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
  }

  .acid-param-selectors {
    flex-direction: column;
    gap: 10px;
  }

  .param-selector-group {
    width: 100%;
  }
}

/* Acid Parameter Selectors */
.acid-param-selectors {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.param-selector-group {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #00d9ff;
  font-family: 'VT323', monospace;
  font-size: 1rem;
}

.param-select {
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid #00d9ff;
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.param-select:hover {
  border-color: #ff6ec7;
  box-shadow: 0 0 15px rgba(255, 110, 199, 0.5);
}

.param-select:focus {
  border-color: #ff6ec7;
  box-shadow: 0 0 15px rgba(255, 110, 199, 0.7);
}

.param-select option {
  background: #1a0033;
  color: #ffffff;
  padding: 10px;
}
