/**
 * Musical Snake game styles
 */

.musical-snake-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  position: relative;
  font-family: 'Arial', sans-serif;
}

/* Reuse menu styles from Flappy DODO */
.menu-screen {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  max-width: 520px;
  width: 100%;
  text-align: center;
  max-height: 90vh;
  overflow-y: auto;
  animation: menuFadeIn 0.4s ease;
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.game-title {
  font-size: 48px;
  font-weight: 800;
  margin: 0 0 10px 0;
  background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 20px rgba(56, 239, 125, 0.3);
}

.game-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  margin: 0 0 30px 0;
}

.menu-section {
  margin-bottom: 30px;
}

.menu-section h3 {
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  margin-bottom: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.button-group.vertical {
  flex-direction: column;
}

.button-group.synth-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.synth-button {
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s;
}

.synth-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.synth-button.selected {
  background: linear-gradient(135deg, #38ef7d, #11998e);
  border-color: rgba(255, 255, 255, 0.5);
}

.difficulty-button {
  min-height: 56px;
  padding: 16px 28px;
  font-size: 18px;
  font-weight: 700;
  border: none;
  color: white;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.difficulty-button.practice {
  background: linear-gradient(135deg, #4e54c8, #8f94fb);
}

.difficulty-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.difficulty-button.easy {
  background: linear-gradient(135deg, #38ef7d, #11998e);
}

.difficulty-button.medium {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}

.difficulty-button.hard {
  background: linear-gradient(135deg, #fa709a, #fee140);
}

.difficulty-button.rhythm {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.practice-note {
  margin-top: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
}

.practice-quickstart-card {
  margin: 18px 0;
  padding: 16px;
  background: rgba(12, 29, 61, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  text-align: left;
}

.practice-quickstart-card h4 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #f7b733;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.practice-quickstart-card ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.practice-quickstart-card .quickstart-challenge {
  color: #9be7ff;
  font-weight: 600;
}

.high-score-display {
  margin: 20px 0;
  padding: 15px;
  background: rgba(255, 215, 0, 0.2);
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 12px;
  color: #ffd700;
  font-size: 20px;
  font-weight: 700;
}

.back-button {
  margin-top: 16px;
  min-height: 50px;
  padding: 14px 32px;
  font-size: 17px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.controls-hint {
  margin-top: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.controls-hint p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin: 8px 0;
}

/* Game Canvas */
.game-canvas {
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  background: #1a1a2e;
}

/* Score Display */
.score-display {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px 30px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.practice-banner {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(78, 84, 200, 0.28);
  border: 1px solid rgba(143, 148, 251, 0.4);
  color: #e6e8ff;
  padding: 8px 18px;
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 28px rgba(78, 84, 200, 0.25);
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-value {
  color: #38ef7d;
  font-size: 24px;
  font-weight: 800;
  margin-top: 5px;
}

/* Countdown Overlay */
.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.countdown-number {
  font-size: 120px;
  font-weight: 900;
  color: #38ef7d;
  margin: 0;
  text-shadow: 0 0 30px rgba(56, 239, 125, 0.5);
  animation: pulse 0.5s ease;
}

.game-overlay p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  margin-top: 20px;
}

/* Game Over Overlay */
.game-over-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  z-index: 200;
  padding: 10px;
}

.game-over-screen {
  background: rgba(26, 26, 46, 0.95);
  padding: 20px;
  border-radius: 24px;
  max-width: 600px;
  width: 100%;
  max-height: 95vh;
  overflow-y: auto;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

@media (min-width: 768px) {
  .game-over-screen {
    padding: 40px;
  }
}

.game-over-title {
  font-size: 36px;
  margin: 0 0 20px 0;
  text-align: center;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (min-width: 768px) {
  .game-over-title {
    font-size: 48px;
    margin: 0 0 30px 0;
  }
}

.stats-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 15px;
  margin: 20px 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

@media (min-width: 768px) {
  .stats-container {
    margin: 30px 0;
    padding: 20px;
  }
}

.stat {
  text-align: center;
}

.stat-label {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  display: block;
  color: #38ef7d;
  font-size: 24px;
  font-weight: 800;
}

@media (min-width: 768px) {
  .stat-value {
    font-size: 32px;
  }
}

/* Audio Playback (reuse from Flappy DODO) */
.audio-playback-modern {
  margin: 15px 0;
  padding: 16px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
  .audio-playback-modern {
    margin: 30px 0;
    padding: 24px;
  }
}

.audio-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

@media (min-width: 768px) {
  .audio-title-bar {
    margin-bottom: 16px;
    gap: 12px;
  }
}

.audio-title {
  color: #fff;
  font-size: 18px;
  margin: 0;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}

@media (min-width: 768px) {
  .audio-title {
    font-size: 20px;
  }
}

.synth-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

@media (min-width: 768px) {
  .synth-badge {
    padding: 6px 14px;
    font-size: 13px;
  }
}

.audio-player-container {
  margin: 16px 0;
}

.modern-audio-player {
  width: 100%;
  border-radius: 8px;
}

.action-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .action-buttons {
    gap: 10px;
    margin-top: 16px;
  }
}

.download-btn,
.suno-upload-button {
  flex: 1;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 140px;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .download-btn,
  .suno-upload-button {
    padding: 12px 24px;
    font-size: 16px;
    min-width: 150px;
  }
}

.download-btn {
  background: linear-gradient(135deg, #11998e, #38ef7d);
  color: white;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
}

.suno-upload-button {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.suno-upload-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.suno-upload-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button-row {
  display: flex;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .button-row {
    gap: 10px;
    flex-wrap: nowrap;
  }
}

.style-select {
  flex: 1;
  min-width: 120px;
  padding: 10px;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .style-select {
    padding: 12px;
    font-size: 16px;
  }
}

.play-again-button {
  min-height: 54px;
  padding: 14px 30px;
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border: none;
  color: white;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  box-shadow: 0 8px 24px rgba(245, 87, 108, 0.4);
}

@media (min-width: 768px) {
  .play-again-button {
    min-height: 60px;
    padding: 18px 40px;
    font-size: 22px;
  }
}

.play-again-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(245, 87, 108, 0.6);
}

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

/* Mobile Controls */
.mobile-controls {
  position: absolute;
  bottom: 30px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.control-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.control-btn {
  width: 60px;
  height: 60px;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  color: white;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-weight: bold;
  touch-action: manipulation;
}

.control-btn:active {
  background: rgba(56, 239, 125, 0.4);
  transform: scale(0.95);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Hide on desktop, show on mobile */
@media (min-width: 769px) {
  .mobile-controls {
    opacity: 0.3;
  }
  .mobile-controls:hover {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .mobile-controls {
    opacity: 1;
    bottom: 100px;
    right: 20px;
  }
  
  .control-btn {
    width: 70px;
    height: 70px;
    font-size: 28px;
  }

  .practice-note {
    font-size: 12px;
  }

  .practice-banner {
    top: 90px;
    font-size: 13px;
    padding: 8px 14px;
  }
}

/* Loading Animation */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 30px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  margin: 20px 0;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.loading-dot {
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  animation: dotBounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.loading-text {
  color: white;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  animation: pulse 2s ease-in-out infinite;
}

.loading-subtext {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  text-align: center;
  max-width: 400px;
  line-height: 1.5;
}

.loading-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.loading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
  background-size: 200% 100%;
  animation: progressShimmer 2s linear infinite;
  border-radius: 10px;
}

@keyframes progressShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.music-notes-animation {
  display: flex;
  gap: 15px;
  font-size: 28px;
  margin: 10px 0;
}

.music-note {
  animation: float 2s ease-in-out infinite;
}

.music-note:nth-child(1) { animation-delay: 0s; }
.music-note:nth-child(2) { animation-delay: 0.3s; }
.music-note:nth-child(3) { animation-delay: 0.6s; }
.music-note:nth-child(4) { animation-delay: 0.9s; }

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-15px);
    opacity: 1;
  }
}

.upload-info-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-style: italic;
  text-align: center;
  margin: 15px 0;
}

/* Suno Options Grid */
.suno-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

@media (min-width: 480px) {
  .suno-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 15px;
  }
}

.option-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
  .option-box {
    padding: 12px;
  }
}

.option-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-weight: 600;
}

@media (min-width: 768px) {
  .option-label {
    font-size: 11px;
    margin-bottom: 8px;
  }
}

.mode-select {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checkbox-option label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

/* Mobile Canvas Adjustments */
@media (max-width: 600px) {
  .musical-snake-container {
    padding: 10px;
  }
  
  .game-canvas {
    max-width: 100%;
    height: auto;
  }

  .practice-banner {
    top: 80px;
    font-size: 12px;
  }
}

