/* ============================================================
   sound-popup.css — Sound Settings Popup styles
   Cosmic Merge game — space theme with gold, cyan, green accents
   ============================================================ */

/* ---------- Fullscreen overlay ---------- */
#sound-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 20, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overscroll-behavior: contain;
  touch-action: none;
}

#sound-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ---------- Popup card ---------- */
#sound-box {
  width: 320px;
  max-width: 90vw;
  padding: 28px 24px 24px;
  border-radius: 24px;
  background: linear-gradient(160deg, #1a1a3e 0%, #0d0d2b 100%);
  border: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow:
    0 0 40px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(255, 215, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: soundBoxIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ---------- Header ---------- */
#sound-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

#sound-box-title {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #FFD700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

#sound-close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  padding: 0;
}

#sound-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}

#sound-close-btn:active {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(0.92);
}

/* ---------- Sections ---------- */
.sound-section {
  margin-bottom: 18px;
}

.sound-section:last-child {
  margin-bottom: 0;
}

.sound-section-label {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 215, 0, 0.7);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ---------- Divider ---------- */
#sound-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.15), transparent);
  margin: 4px 0 18px;
}

/* ---------- Volume Slider ---------- */
.sound-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sound-slider-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #FFD700;
  opacity: 0.7;
}

.sound-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

.sound-slider:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Slider thumb — WebKit */
.sound-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFD700;
  border: 3px solid #1a1a3e;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.sound-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.6);
}

.sound-slider::-webkit-slider-thumb:active {
  transform: scale(1.05);
}

/* Slider thumb — Firefox */
.sound-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFD700;
  border: 3px solid #1a1a3e;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.sound-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.6);
}

/* Slider track filled portion (Firefox) */
.sound-slider::-moz-range-progress {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.5), #FFD700);
  border-radius: 3px;
  height: 6px;
}

.sound-slider-value {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #FFD700;
  min-width: 40px;
  text-align: right;
}

/* ---------- Toggle Rows ---------- */
.sound-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sound-toggle-row:active {
  opacity: 0.8;
}

.sound-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sound-toggle-label {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}

.sound-toggle-desc {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.3px;
}

/* ---------- iOS-style Toggle Switch ---------- */
.sound-toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s ease;
  flex-shrink: 0;
}

/* Music toggle — cyan accent when ON */
#sound-music-switch.on {
  background: #00E5FF;
}

/* Effects toggle — green accent when ON */
#sound-effects-switch.on {
  background: #00dc82;
}

.sound-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sound-toggle-switch.on .sound-toggle-knob {
  transform: translateX(20px);
}

/* ---------- Animations ---------- */
@keyframes soundBoxIn {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes soundBoxOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.9) translateY(8px);
  }
}

/* ---------- Mobile adjustments ---------- */
@media (max-width: 400px) {
  #sound-box {
    padding: 22px 18px 20px;
  }

  #sound-box-title {
    font-size: 18px;
  }

  .sound-toggle-label {
    font-size: 14px;
  }
}

