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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a1a 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  color: #ffffff;
}

.game-container {
  width: 100%;
  max-width: 800px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
}

.header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0 10px;
}

.title {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #00f5ff 0%, #ff00ff 50%, #ff0080 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(0, 245, 255, 0.5);
  animation: bounce 3s ease-in-out infinite;
}

.stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: #888;
  font-weight: 600;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #00f5ff;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.8);
  animation: pulse 2s ease-in-out infinite;
}

#gameCanvas {
  background: rgba(10, 10, 20, 0.8);
  border: 2px solid rgba(0, 245, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.2), 0 0 40px rgba(255, 0, 255, 0.1), inset 0 0 60px rgba(0, 0, 0, 0.5);
  max-width: 100%;
  display: block;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 20px;
}

.menu-overlay.hidden {
  display: none;
}

.menu-content {
  text-align: center;
  padding: 40px;
  background: rgba(20, 10, 30, 0.8);
  border: 2px solid rgba(0, 245, 255, 0.3);
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(0, 245, 255, 0.3), 0 0 80px rgba(255, 0, 255, 0.2);
  max-width: 90%;
  animation: fadeInScale 0.5s ease;
}

.settings-content-tabs {
  max-width: 650px;
  width: 100%;
  text-align: left;
}

/* Pestañas de navegación */
.tabs-navigation {
  display: flex;
  gap: 10px;
  margin: 25px 0;
  padding: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 15px;
  overflow-x: auto;
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1;
  min-width: 100px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #00f5ff;
  background: rgba(0, 245, 255, 0.1);
}

.tab-btn.active {
  background: linear-gradient(135deg, #00f5ff 0%, #ff00ff 100%);
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.5);
}

/* Contenido de las pestañas */
.tabs-content {
  min-height: 280px;
  padding: 25px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  border: 1px solid rgba(0, 245, 255, 0.2);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Filas de configuración */
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row label {
  color: #fff;
  font-weight: 500;
  font-size: 1rem;
}

.setting-row.data-row {
  padding: 15px 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 60px;
  height: 30px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #00f5ff 0%, #ff00ff 100%);
  border-color: #00f5ff;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(30px);
  background: #fff;
}

/* Slider */
.slider-container {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 250px;
}

.slider {
  flex: 1;
  height: 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00f5ff 0%, #ff00ff 100%);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.8);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(0, 245, 255, 1);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00f5ff 0%, #ff00ff 100%);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.8);
  border: none;
  transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(0, 245, 255, 1);
}

.slider-value {
  min-width: 50px;
  text-align: right;
  color: #00f5ff;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Select */
.select-input {
  padding: 10px 15px;
  background: rgba(0, 245, 255, 0.1);
  border: 2px solid rgba(0, 245, 255, 0.3);
  border-radius: 10px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
}

.select-input:hover {
  border-color: rgba(0, 245, 255, 0.5);
  background: rgba(0, 245, 255, 0.15);
}

.select-input option {
  background: #1a0a1a;
  color: white;
}

/* Data value */
.data-value {
  color: #ff00ff;
  font-weight: 700;
  font-size: 1.2rem;
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.6);
}

/* Mensaje de interacción para audio */
.audio-interaction-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.5s ease;
}

.audio-interaction-message.hidden {
  display: none;
}

.audio-message-content {
  text-align: center;
  padding: 40px;
  background: rgba(20, 10, 30, 0.9);
  border: 2px solid rgba(0, 245, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(0, 245, 255, 0.4), 0 0 80px rgba(255, 0, 255, 0.3);
  max-width: 90%;
  animation: pulseGlow 2s ease-in-out infinite;
}

.audio-message-content p {
  font-size: 1.5rem;
  font-weight: 700;
  color: #00f5ff;
  margin-bottom: 15px;
  text-shadow: 0 0 20px rgba(0, 245, 255, 0.8);
}

.audio-message-hint {
  font-size: 1rem !important;
  color: #aaa !important;
  font-weight: 400 !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5) !important;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 40px rgba(0, 245, 255, 0.4), 0 0 80px rgba(255, 0, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 60px rgba(0, 245, 255, 0.6), 0 0 100px rgba(255, 0, 255, 0.5);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

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

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.8), 0 0 40px rgba(255, 0, 255, 0.4);
  }
}

.menu-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #00f5ff 0%, #ff00ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.menu-title.game-over {
  background: linear-gradient(135deg, #ff0080 0%, #ff0000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.menu-title.win {
  background: linear-gradient(135deg, #00ff88 0%, #00f5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.menu-subtitle {
  font-size: 1.1rem;
  color: #aaa;
  margin-bottom: 30px;
  line-height: 1.6;
}

.developer-credit {
  font-size: 1rem;
  color: #00f5ff;
  margin-bottom: 30px;
  line-height: 1.6;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.6);
  letter-spacing: 0.05em;
  margin-top: 25px;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  margin-top: 25px;
}

.btn-menu {
  background: linear-gradient(135deg, #00f5ff 0%, #ff00ff 100%);
  color: #fff;
  border: none;
  padding: 15px 50px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
  text-transform: uppercase;
  min-width: 250px;
  animation: glow 2s ease-in-out infinite;
}

.btn-menu:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 245, 255, 0.6), 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-menu:active {
  transform: translateY(0);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ff0080 0%, #ff0000 100%);
  color: #fff;
  border: none;
  padding: 12px 30px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(255, 0, 128, 0.4);
  text-transform: uppercase;
  width: 100%;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(255, 0, 128, 0.6);
}

.controls-info {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sound-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 245, 255, 0.2);
  border: 2px solid rgba(0, 245, 255, 0.5);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 3000;
  transition: all 0.3s ease;
}

.sound-toggle:hover {
  background: rgba(0, 245, 255, 0.4);
  transform: scale(1.1);
}

.sound-toggle.muted {
  background: rgba(255, 0, 128, 0.2);
  border-color: rgba(255, 0, 128, 0.5);
}

.combo-display {
  position: absolute;
  font-size: 1.2rem;
  font-weight: bold;
  color: #ff00ff;
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.8);
  animation: comboFloat 1s ease-out forwards;
  pointer-events: none;
}

@keyframes comboFloat {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-50px);
    opacity: 0;
  }
}

.level-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  font-weight: bold;
  color: #00f5ff;
  text-shadow: 0 0 20px rgba(0, 245, 255, 0.8);
  opacity: 0;
  z-index: 100;
  pointer-events: none;
}

.pause-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 500;
  backdrop-filter: blur(5px);
}

.pause-overlay.hidden {
  display: none;
}

.pause-text {
  font-size: 2rem;
  font-weight: bold;
  color: #00f5ff;
  text-shadow: 0 0 20px rgba(0, 245, 255, 0.8);
}

@media (max-width: 768px) {
  .game-container {
    padding: 10px;
  }

  .header {
    flex-direction: column;
    gap: 15px;
  }

  .stats {
    width: 100%;
    justify-content: space-around;
  }

  .menu-content {
    padding: 30px 20px;
  }

  .settings-content-tabs {
    padding: 25px 15px;
  }

  .tabs-navigation {
    gap: 5px;
    padding: 5px;
  }

  .tab-btn {
    min-width: 80px;
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .tabs-content {
    padding: 20px 15px;
  }

  .setting-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .slider-container {
    width: 100%;
    min-width: auto;
  }

  .select-input {
    width: 100%;
  }

  .sound-toggle {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .btn-menu {
    min-width: 200px;
    padding: 12px 30px;
    font-size: 1rem;
  }

  /* Mensaje de audio responsive */
  .audio-message-content {
    padding: 30px 20px;
  }
  
  .audio-message-content p {
    font-size: 1.2rem;
  }
  
  .audio-message-hint {
    font-size: 0.9rem !important;
  }
}