/* Loading Screen Styles */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #000a1b 1%, #000000 70%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 1s ease-out;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-title {
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 40px;
  background: linear-gradient(to right, #9abfff, #6effb2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleGlow 2s ease-in-out infinite alternate;
}

.loading-info {
  margin-top: 30px;
  font-size: 1.1rem;
  color: #9abfff;
  min-height: 2em;
  animation: fadeIn 0.5s ease-in-out;
}

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

@keyframes titleGlow {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.3); }
}

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.spinner-ring {
  width: 20px;
  height: 20px;
  border: 3px solid transparent;
  border-top: 3px solid #6effb2;
  border-right: 3px solid #6effb2;
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Control Buttons */
.control-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(10, 20, 60, 0.7);
  color: #9abfff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(150, 150, 255, 0.2);
  margin-left: 10px;
  font-weight: 600;
  padding: 8px;
  position: relative;
  overflow: hidden;
}

.control-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(110, 255, 178, 0.2), transparent);
  transition: left 0.6s;
}

.control-btn:hover {
  background: rgba(60, 120, 200, 0.4);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 139, 255, 0.3), 0 0 20px rgba(110, 255, 178, 0.2);
  border-color: rgba(110, 255, 178, 0.5);
}

.control-btn:hover::before {
  left: 100%;
}

.control-btn:active {
  transform: translateY(0) scale(0.98);
}

.control-btn.muted {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.3);
}

.control-btn.muted:hover {
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

/* Main Content Styles */
.main-content {
  opacity: 0;
  transition: opacity 1s ease-in;
}

.main-content.show {
  opacity: 1;
}

html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: radial-gradient(circle at center, #000a1b 1%, #000000 70%);
  font-family: Arial, sans-serif;
  min-height: 100vh;
}

body {
  position: relative;
  min-height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
}

canvas {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  background: rgba(0, 0, 30, 0.6);
  padding: 0 18px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(150,150,255,0.18);
  backdrop-filter: blur(7px);
}

.top-bar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.about-btn {
  background: rgba(10, 20, 60, 0.7);
  border: 2px solid rgba(150,150,255,0.2);
  border-radius: 12px;
  color: #9abfff;
  font-weight: 600;
  font-size: 16px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 2px;
  position: relative;
  overflow: hidden;
}

.about-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(110, 255, 178, 0.2), transparent);
  transition: left 0.6s;
}

.about-btn:hover {
  background: rgba(60, 120, 200, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 139, 255, 0.3);
  border-color: rgba(110, 255, 178, 0.5);
}

.about-btn:hover::before {
  left: 100%;
}

.overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 30, 0.6);
  border: 1px solid rgba(150, 150, 255, 0.4);
  border-radius: 12px;
  padding: 20px 30px;
  box-shadow: 0 0 20px rgba(180, 200, 255, 0.3);
  color: #9abfff;
  text-align: center;
  backdrop-filter: blur(6px);
  opacity: 0;
  animation: appear 1.4s ease-out forwards;
  width: 90%;
  max-width: 500px;
  z-index: 1;
}

.overlay h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
  background: linear-gradient(to right, #9abfff, #6effb2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtext {
  margin-top: 12px;
  font-size: 14px;
  color: #c0d7ff;
}

/* Static Buttons Grid */
.static-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
  width: 100%;
  min-height: 60px;
}

.static-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0px 0px;
  font-size: 14px;
  background: linear-gradient(135deg, #6e9aff 0%, #4db89e 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
  word-wrap: break-word;
  hyphens: auto;
  box-shadow: 0 4px 15px rgba(0, 139, 255, 0.2);
}

.static-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.static-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: all 0.6s ease;
  border-radius: 50%;
}

.static-btn:hover {
  background: linear-gradient(135deg, #4db89e 0%, #6e9aff 100%);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(0, 139, 255, 0.4), 0 0 30px rgba(110, 255, 178, 0.3);
}

.static-btn:hover::before {
  opacity: 1;
}

.static-btn:hover::after {
  width: 120%;
  height: 120%;
}

.static-btn:active {
  transform: translateY(-1px) scale(0.98);
}

.static-btn-text {
  font-size: 14px;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  z-index: 1;
  position: relative;
}

@keyframes appear {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* Warning Info Styles */
.warning-info {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: rgba(255, 69, 0, 0.15);
  border-top: 2px solid #ff4500;
  color: #ffcc00;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  backdrop-filter: blur(4px);
  z-index: 3;
  box-shadow: 0 0 10px rgba(255, 69, 0, 0.3);
  max-width: 600px;
  text-align: center;
  border-radius: 8px;
}

.warning-icon {
  font-size: 18px;
  color: #ff4500;
  font-weight: bold;
  animation: pulse 2s infinite;
}

.warning-text {
  font-weight: 500;
  line-height: 1.3;
}

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

/* Modal Styles with Enhanced Animation */
.modal-overlay {
  position: fixed;
  top: 0; 
  left: 0; 
  width: 100vw; 
  height: 100vh;
  background: rgba(0,0,30,0.45);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(8px);
}

.modal-bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: rgba(0,0,30,0.95);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(180,200,255,0.2);
  padding: 25px 20px;
  min-width: 290px;
  max-width: 97vw;
  color: #9abfff;
  border: 2px solid rgba(150,150,255,0.3);
  position: relative;
  z-index: 100;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.5) rotateX(20deg);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(20px);
}

.modal-overlay.show .modal {
  transform: scale(1) rotateX(0deg);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: #9abfff;
  background: none;
  border: none;
  font-weight: bold;
  transition: all 0.3s ease;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #6effb2;
  background: rgba(110, 255, 178, 0.1);
  transform: rotate(90deg);
}

/* MSP2 Mods Modal Specific Styles */
.mod-content {
  text-align: left;
}

.mod-features ul {
  text-align: left;
  margin: 15px 0;
  padding-left: 20px;
}

.mod-features li {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.4;
}

.mod-install {
  text-align: center;
  margin: 25px 0 15px 0;
}

.install-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 25px;
  background: linear-gradient(135deg, #0ff 0%, #09f 100%);
  color: #000;
  text-decoration: none;
  border-radius: 12px;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 5px 20px rgba(0, 255, 255, 0.3);
}

.install-btn:hover {
  transform: translateY(-2px) scale(1.05);
  background: linear-gradient(135deg, #09f 0%, #0ff 100%);
  box-shadow: 0 8px 30px rgba(0, 255, 255, 0.5);
}

.install-note {
  font-size: 12px;
  color: #ccc;
  margin-top: 10px;
  font-style: italic;
}

/* Sound Settings Modal */
.sound-settings {
  max-width: 400px;
  margin: 0 auto;
}

.setting-group {
  margin: 20px 0;
  text-align: center;
}

.setting-group label {
  display: block;
  margin-bottom: 10px;
  color: #6effb2;
  font-weight: 600;
}

.volume-slider {
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: rgba(150, 150, 255, 0.2);
  outline: none;
  margin: 10px 0;
  -webkit-appearance: none;
  appearance: none;
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ff, #09f);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 255, 255, 0.3);
  transition: all 0.3s ease;
}

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

.volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ff, #09f);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 255, 255, 0.3);
}

.test-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #6effb2, #4db89e);
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.test-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(110, 255, 178, 0.3);
}

#aboutText ul {
  text-align: left;
  margin: 15px 0;
}

#aboutText li {
  margin: 8px 0;
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.3;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .loading-title {
    font-size: 2rem;
  }
  
  .overlay {
    padding: 16px 20px;
    font-size: 13px;
    max-width: 95vw;
    margin: 0 auto;
  }
  
  .static-buttons-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    margin-top: 20px;
  }
  
  .static-btn {
    min-height: 60px;
    padding: 12px 10px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .static-btn-text {
    font-size: 14px;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  
  .top-bar {
    height: 50px;
    font-size: 14px;
    padding: 0 10px;
  }
  
  .top-bar-right {
    gap: 8px;
  }
  
  .about-btn {
    font-size: 14px;
    padding: 6px 10px;
  }
  
  .control-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
    margin-left: 8px;
    padding: 6px;
  }
  
  .modal {
    padding: 20px 15px;
    font-size: 13px;
    min-width: 85vw;
    max-width: 95vw;
    margin: 0 auto;
  }
  
  .warning-info {
    padding: 10px;
    font-size: 12px;
  }

  .loading-info {
    font-size: 1rem;
    padding: 0 20px;
  }

  #aboutText li {
    font-size: 13px;
    line-height: 1.4;
    margin: 6px 0;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .overlay {
    padding: 12px 15px;
    max-width: 90vw;
  }

  .static-btn {
    min-height: 55px;
    padding: 10px 8px;
  }

  .static-btn-text {
    font-size: 13px;
  }

  .modal {
    padding: 15px 10px;
    min-width: 90vw;
  }

  .top-bar {
    padding: 0 8px;
  }

  .about-btn {
    font-size: 12px;
    padding: 5px 8px;
  }

  .control-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
    margin-left: 6px;
  }
}
