:root {
  --bg-color: #030408;
  --panel-bg: rgba(18, 22, 36, 0.65);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text-main: #f0f4fd;
  --text-muted: #8a99b5;
  --accent-color: #ff7733;
  --accent-glow: rgba(255, 119, 51, 0.35);
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  font-family: var(--font-family);
  color: var(--text-main);
  user-select: none;
  touch-action: none; /* Prevents unwanted mobile elastic scroll */
}

#canvas-container {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Glass Panel Base */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* Start Overlay */
.start-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(3, 4, 8, 0.7);
  backdrop-filter: blur(8px);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.start-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-card {
  padding: 40px 48px;
  border-radius: 24px;
  text-align: center;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: floatCard 4s infinite ease-in-out;
}

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

.sparkle-icon {
  font-size: 2.5rem;
  margin-bottom: 4px;
}

.start-card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.start-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.primary-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #ff7733 0%, #ff5500 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 30px var(--accent-glow);
}

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

.primary-btn .arrow {
  transition: transform 0.2s ease;
}

.primary-btn:hover .arrow {
  transform: translateX(4px);
}

/* Lightbox Modal (Click-to-Zoom Fullscreen View) */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s ease;
}

.lightbox-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 4, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.lightbox-content {
  position: relative;
  z-index: 205;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-img-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  padding: 16px 16px 20px 16px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(255, 119, 51, 0.2);
  transform: scale(1);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-modal.hidden .lightbox-img-wrapper {
  transform: scale(0.85);
}

#lightbox-img {
  max-width: 80vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: inset 0 0 1px rgba(0,0,0,0.2);
}

.lightbox-caption {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-counter {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.lightbox-close-btn {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(12px);
  z-index: 210;
  transition: all 0.25s ease;
}

.lightbox-close-btn:hover {
  background: #ff4444;
  border-color: #ff6666;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

/* Glassmorphism Header */
.glass-header {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.glow-dot {
  width: 10px;
  height: 10px;
  background-color: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-color), 0 0 24px var(--accent-color);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.25); }
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glass Buttons */
.controls-group {
  display: flex;
  gap: 12px;
}

.glass-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.glass-btn:active {
  transform: translateY(0);
}

.glass-btn .icon {
  font-size: 1rem;
}

/* Footnote HUD Panel */
.hud-footnote {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  border-radius: 40px;
}

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

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
}

.stat-hint {
  font-size: 0.8rem;
  color: #c7d2fe;
}

/* Mobile Responsive Breakpoints (< 768px) */
@media (max-width: 768px) {
  .glass-header {
    top: 12px;
    left: 12px;
    right: 12px;
    padding: 10px 14px;
    border-radius: 14px;
  }

  .brand h1 {
    font-size: 0.95rem;
  }

  .controls-group {
    gap: 6px;
  }

  .glass-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    border-radius: 8px;
  }

  .glass-btn span:not(.icon) {
    display: none; /* Show compact icons only on mobile header */
  }

  .start-card {
    padding: 28px 20px;
    width: 90vw;
    border-radius: 20px;
  }

  .start-card h2 {
    font-size: 1.35rem;
  }

  .start-card p {
    font-size: 0.85rem;
  }

  .primary-btn {
    padding: 12px 22px;
    font-size: 0.9rem;
  }

  .hud-footnote {
    bottom: 12px;
    width: calc(100vw - 24px);
    padding: 8px 16px;
    gap: 12px;
    border-radius: 20px;
    justify-content: space-around;
  }

  .stat-label {
    font-size: 0.6rem;
  }

  .stat-value {
    font-size: 0.8rem;
  }

  .stat-hint {
    display: none; /* Hide long hint on mobile */
  }

  #lightbox-img {
    max-width: 86vw;
    max-height: 65vh;
  }

  .lightbox-close-btn {
    top: -16px;
    right: -16px;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
}
