@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f2f6 0%, #e8ecf1 50%, #dde3ea 100%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  cursor: grab;
  user-select: none;
  transition: all 0.3s ease;
  /* Disable browser zoom */
  touch-action: manipulation;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

body:active {
  cursor: grabbing;
}

/* Loading indicator */
.loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2000;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.loading-text {
  font-size: 18px;
  font-weight: 300;
  margin-bottom: 20px;
  opacity: 0.9;
}

.loading-progress {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 1px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 1px;
}

.loading-indicator.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 30px;
  background: transparent;
  color: #2c3e50;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  z-index: 1000;
  transition: opacity 0.5s ease;
  pointer-events: auto;
}

#overlay h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 600;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
  color: #2c3e50;
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
}

#overlay p {
  font-size: 1.1rem;
  font-weight: 300;
  margin: 0;
  color: #2c3e50;
  opacity: 0.9;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.9rem;
}

canvas {
  display: block;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* Loading animation */
.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #2c3e50;
  font-size: 1.2rem;
  font-weight: 300;
  z-index: 1000;
  opacity: 0;
  animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* Navigation hint */
.nav-hint {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100;
  color: #2c3e50;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.4;
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.8) 0%, 
    rgba(255, 255, 255, 0.6) 100%
  );
  border: 1px solid rgba(44, 62, 80, 0.1);
  border-radius: 16px;
  padding: 12px 24px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  opacity: 1;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  animation: gentleFloat 6s ease-in-out infinite;
}

.nav-hint.hidden {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
}

.nav-hint span {
  display: inline-block;
  margin: 0 2px;
}

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

/* Responsive design */
@media (max-width: 768px) {
  #overlay {
    padding: 25px 25px;
  }
  
  #overlay h1 {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }
  
  #overlay p {
    font-size: 0.8rem;
  }
  
  .nav-hint {
    bottom: 20px;
    right: 20px;
    font-size: 11px;
    padding: 6px 12px;
    line-height: 1.2;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  #overlay {
    padding: 20px 20px;
  }
  
  #overlay::after {
    bottom: 30px;
    height: 40px;
  }
}

@keyframes gentleFloat {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
    filter: brightness(1);
  }
  25% { 
    transform: translateY(-2px) rotate(0.2deg); 
    filter: brightness(1.05);
  }
  50% { 
    transform: translateY(-4px) rotate(0deg); 
    filter: brightness(1.1);
  }
  75% { 
    transform: translateY(-2px) rotate(-0.2deg); 
    filter: brightness(1.05);
  }
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
  .nav-hint {
    bottom: 20px;
    right: 20px;
    font-size: 11px;
    padding: 6px 12px;
    line-height: 1.2;
    white-space: nowrap;
    backdrop-filter: blur(15px) saturate(120%);
    -webkit-backdrop-filter: blur(15px) saturate(120%);
  }
  
  body {
    background: linear-gradient(135deg, #f5f7fa 0%, #eef2f7 50%, #e3e9f0 100%);
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .nav-hint {
    backdrop-filter: blur(25px) saturate(130%);
    -webkit-backdrop-filter: blur(25px) saturate(130%);
  }
}

/* Mobile Navigation Buttons */
.mobile-nav {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 100;
  display: none; /* Hidden by default, shown on mobile */
  gap: 15px;
}

.nav-btn {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.9) 0%, 
    rgba(255, 255, 255, 0.7) 100%
  );
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid rgba(44, 62, 80, 0.1);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.nav-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.15),
    0 6px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(255, 255, 255, 0.8) 100%
  );
}

.nav-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.05),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-btn svg {
  transition: transform 0.2s ease;
}

.nav-btn:hover svg {
  transform: scale(1.1);
}

/* Show mobile nav based on aspect ratio (portrait/square screens) */
@media (max-aspect-ratio: 4/3) {
  .mobile-nav {
    display: flex;
    bottom: 20px;
    left: 20px;
  }
  
  .nav-btn {
    width: 45px;
    height: 45px;
  }
}

@media (max-aspect-ratio: 1/1) {
  .mobile-nav {
    bottom: 15px;
    left: 15px;
    gap: 12px;
  }
  
  .nav-btn {
    width: 42px;
    height: 42px;
  }
}
