:root {
  font-family: 'Inter', system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #000000;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

body {
  background: #000;
  overflow: hidden;
}

/* LOADING SCREEN */
#loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  z-index: 100;
  transition: opacity 1s;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 2rem;
}

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

#loading-text {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.progress-bar {
  width: 300px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4444ff, #8888ff);
  width: 0%;
  transition: width 0.3s ease;
}

/* ERROR DISPLAY */
#error-display {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
  z-index: 99;
  transition: opacity 0.5s;
}

.error-content {
  text-align: center;
  color: #fff;
  padding: 3rem;
  background: rgba(255, 50, 50, 0.1);
  border: 1px solid rgba(255, 50, 50, 0.3);
  border-radius: 10px;
  max-width: 500px;
}

.error-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.error-content p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

#retry-btn {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
  border-radius: 5px;
}

#retry-btn:hover {
  background: #fff;
  color: #000;
}

/* LANDING PAGE */
#landing {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  background: #000;
  z-index: 10;
  transition: opacity 2s;
}

#landing img {
  width: 60vmin;
  max-width: 500px;
  border-radius: 10px;
  opacity: 0.9;
  will-change: transform;
  box-shadow: 0 0 400px rgb(255, 165, 92);
  animation: fadeInScale 2s ease-out;
}

#landing h1 {
  font-family: 'Cinzel', serif;
  font-size: 4rem;
  margin: 2rem 0 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: fadeInUp 1.5s ease-out 0.5s both;
}

.subtitle {
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgb(187, 187, 187);
  opacity: 0.7;
  margin-bottom: 3rem;
  animation: fadeInUp 1.5s ease-out 0.8s both;
}

#enter-btn {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 5px;
  animation: fadeInUp 1.5s ease-out 1.1s both;
}

#enter-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

#enter-btn:active {
  transform: scale(0.98);
}

/* Pulsing animation for live mode */
#enter-btn.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 60px rgba(255, 255, 255, 0.4);
  }
}

.release-date {
  position: absolute;
  bottom: 4rem;
  font-size: 0.9rem;
  opacity: 0.5;
  letter-spacing: 0.05em;
  animation: fadeIn 1.5s ease-out 1.4s both;
}

.controls-hint {
  position: absolute;
  bottom: 2rem;
  font-size: 0.85rem;
  opacity: 0.4;
  letter-spacing: 0.05em;
  animation: fadeIn 1.5s ease-out 1.6s both;
}

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

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

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

/* EXPERIENCE */
#experience { 
  position: fixed; 
  inset: 0;
}

/* Experience control hints */
.experience-controls {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.experience-controls.visible {
  opacity: 1;
}

.experience-controls p {
  font-size: 0.9rem;
  color: #fff;
  opacity: 0.6;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

#track-info {
  position: absolute;
  bottom: 5vh;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  text-align: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 2s;
  pointer-events: none;
}

#track-info h2 { 
  font-size: 2.5rem; 
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#track-info p { 
  font-size: 1rem; 
  opacity: 0.7;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

/* UTILITY CLASSES */
.hidden { 
  opacity: 0 !important; 
  pointer-events: none !important;
  visibility: hidden;
}

.fade-out { 
  opacity: 0; 
  transition: opacity 3s;
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  #landing {
    padding: 1rem;
  }

  #landing img {
    width: 70vmin;
    max-width: 300px;
  }

  #landing h1 { 
    font-size: 2rem; 
    margin: 1.5rem 0 1rem;
    letter-spacing: 0.1em;
  }

  .subtitle {
    font-size: 1rem;
    padding: 0 1rem;
    margin-bottom: 2rem;
  }
  
  #enter-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
  }

  .release-date {
    bottom: 3rem;
    font-size: 0.8rem;
  }

  .controls-hint {
    bottom: 1.5rem;
    font-size: 0.75rem;
    padding: 0 1rem;
  }
  
  #track-info {
    bottom: 3vh;
    padding: 0 1rem;
  }

  #track-info h2 { 
    font-size: 1.5rem;
  }

  #track-info p {
    font-size: 0.9rem;
  }

  .experience-controls {
    top: 1rem;
    font-size: 0.8rem;
  }

  .experience-controls p {
    font-size: 0.8rem;
  }

  /* Mobile-specific ending message */
  .ending-main {
    font-size: 2rem;
  }

  .ending-sub {
    font-size: 1rem;
  }

  .ending-options {
    flex-direction: column;
    gap: 0.5rem;
    font-size: 1rem;
  }

  .ending-separator {
    display: none;
  }
}

/* SMALL MOBILE OPTIMIZATIONS */
@media (max-width: 480px) {
  #landing {
    padding: 0.75rem;
  }

  #landing img {
    width: 65vmin;
    max-width: 250px;
  }

  #landing h1 { 
    font-size: 1.5rem; 
    margin: 1rem 0 0.75rem;
    letter-spacing: 0.05em;
    word-break: break-word;
    hyphens: auto;
  }

  .subtitle {
    font-size: 0.9rem;
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
  }
  
  #enter-btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
  }

  .release-date {
    bottom: 2.5rem;
    font-size: 0.75rem;
    padding: 0 0.5rem;
  }

  .controls-hint {
    bottom: 1rem;
    font-size: 0.7rem;
    padding: 0 0.75rem;
  }
  
  #track-info {
    bottom: 2vh;
    padding: 0 0.75rem;
  }

  #track-info h2 { 
    font-size: 1.25rem;
  }

  #track-info p {
    font-size: 0.85rem;
  }

  .experience-controls {
    top: 0.75rem;
  }

  .experience-controls p {
    font-size: 0.75rem;
  }

  /* Small mobile ending message */
  .ending-main {
    font-size: 1.5rem;
  }

  .ending-sub {
    font-size: 0.9rem;
  }

  .ending-options {
    font-size: 0.9rem;
  }

  .progress-bar {
    width: 250px;
  }

  #loading-text {
    font-size: 1rem;
  }
}

/* PERFORMANCE OPTIMIZATIONS */
canvas {
  display: block;
  will-change: transform;
}

/* ENDING SEQUENCE */
#ending-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  z-index: 20;
  opacity: 0;
  transition: opacity 2s ease;
  pointer-events: none;
}

#ending-message.visible {
  opacity: 1;
  pointer-events: auto;
}

.ending-text {
  margin-bottom: 3rem;
}

.ending-main {
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ending-sub {
  font-size: 1.1rem;
  opacity: 0.7;
  line-height: 1.6;
}

.ending-options {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ending-option {
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.8;
}

.ending-option:hover {
  opacity: 1;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.ending-separator {
  opacity: 0.5;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .spinner {
    animation: none;
    border-top-color: rgba(255, 255, 255, 0.5);
  }
}
