/* ===================================
   Section Headers
   =================================== */
.section-header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.section-title {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}



/* ===================================
   Contact Section
   =================================== */
.contact-section {
  text-align: center;
  background: linear-gradient(135deg, rgba(13, 115, 119, 0.15) 0%, rgba(20, 33, 61, 0.15) 100%);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  margin: var(--spacing-2xl) 0;
}

.contact-section .section-subtitle {
  color: #ffffff;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: var(--spacing-lg);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.highlight {
  background: linear-gradient(135deg, #03eeff 0%, #00f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  filter: drop-shadow(0 0 15px rgba(3, 238, 255, 0.4));
}

.contact-info {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xl);
  flex-wrap: wrap;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.contact-section .cta-button {
  margin-top: var(--spacing-md);
  padding: 1.2rem 3rem;
}

.contact-icon {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.4));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.contact-item:hover .contact-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.7));
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.contact-item a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-item a:hover {
  color: var(--text-primary);
}

/* ===================================
   Footer
   =================================== */
footer {
  text-align: center;
  padding: var(--spacing-xl) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

/* ===================================
   Animations
   =================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.8s ease-out;
}

.scroll-reveal {
  opacity: 0;
  transform: perspective(1200px) rotateX(8deg) translateY(60px) scale(0.92);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: perspective(1200px) rotateX(0deg) translateY(0) scale(1);
}

/* Specific reveal for viewer to ensure it stays full-bleed */
#model-viewer .viewer-container.scroll-reveal {
  transform: none;
  border-radius: 0;
  box-shadow: none;
}

#model-viewer .viewer-container.scroll-reveal.revealed {
  transform: none;
  opacity: 1;
}

/* Hide viewer UI elements until scroll-reveal is triggered */
.scroll-reveal:not(.revealed) #gallery-toggle,
.scroll-reveal:not(.revealed) #viewer-panel,
.scroll-reveal:not(.revealed) .panel-top-buttons,
.scroll-reveal:not(.revealed) #settings-hub,
.scroll-reveal:not(.revealed) #tour-control-btn {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ===================================
   3D Map Viewer (Fullscreen Overhaul)
   =================================== */
#model-viewer {
  display: none;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: calc(100vh - 80px);
  /* Exactly fills remaining space after 80px navbar */
  position: relative;
  overflow: hidden;
  background: transparent !important;
}

#model-viewer.is-active {
  display: block;
}

#model-viewer .container {
  max-width: none;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
}

.viewer-container {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent !important;
}

#three-container {
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  position: relative;
  overflow: hidden;
}

#three-container canvas:not(.perf-graph) {
  display: block;
  width: 100% !important;
  height: 100% !important;
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading Indicator */
#loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2000;
  /* Higher than drawer */
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 450px;
  font-family: var(--font-display);
  pointer-events: none;
}

#loading-indicator.loading-hidden {
  opacity: 0;
  pointer-events: none;
}

#loading-indicator p:first-of-type {
  width: 100%;
  display: flex;
  justify-content: center;
  /* centred */
  gap: 12px;
  align-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  text-transform: uppercase;
  text-shadow: 0 0 25px rgba(0, 242, 254, 0.5);
  margin-bottom: 20px;
  letter-spacing: 2px;
  opacity: 0.9;
}

.load-text-word {
  background: linear-gradient(to bottom, #fff 0%, #0df 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#loading-map-name {
  margin-top: 20px;
  color: #0df;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
  /* centred */
  opacity: 0.6;
  text-shadow: 0 0 10px rgba(0, 221, 255, 0.3);
}

.load-dots {
  display: inline-block;
  min-width: 24px;
  text-align: left;
}

.load-dots::after {
  content: '.';
  animation: loadingDots 1.5s step-start infinite;
}

@keyframes loadingDots {
  0% {
    content: '.';
  }

  33% {
    content: '..';
  }

  66% {
    content: '...';
  }

  100% {
    content: '.';
  }
}

/* Loading bar - styled like settings sliders */
.loading-bar-track {
  width: 100%;
  height: 18px;
  /* matches settings slider height */
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.05));
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.loading-bar-fill {
  width: 0%;
  height: 100%;
  /* Cyan flat fill matching settings slider */
  background: var(--accent-cyan);
  border-radius: 3px 0 0 3px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.6);
}

/* Glowing right edge */
.loading-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: #fff;
  box-shadow: 0 0 10px #fff, 0 0 22px #0df;
  border-radius: 0 3px 3px 0;
}

/* % always centred inside the bar track */
.loading-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000;
  font-size: 11px;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  white-space: nowrap;
  text-shadow: none;
  pointer-events: none;
  z-index: 2;
}

/* FPS Crosshair — SVG for pixel-perfect symmetry */
.fps-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  z-index: 150;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Crect x='5' y='0' width='2' height='5' fill='%2300f2fe'/%3E%3Crect x='5' y='7' width='2' height='5' fill='%2300f2fe'/%3E%3Crect x='0' y='5' width='5' height='2' fill='%2300f2fe'/%3E%3Crect x='7' y='5' width='5' height='2' fill='%2300f2fe'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  image-rendering: pixelated;
}

.fps-crosshair span {
  display: none;
}

.fps-crosshair.visible {
  opacity: 1;
}

/* Hide Render Canvas during loading with smooth transition */
body.is-loading-map #three-container canvas:not(.perf-graph) {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.is-cinematic-intro #three-container canvas:not(.perf-graph) {
  transition: none !important;
}

body.is-loading-map #gallery-drawer,
body.is-loading-map #gallery-toggle,
body.is-loading-map .panel-top-buttons,
body.is-loading-map #tour-control-btn,
body.is-loading-map #fpp-hint,
body.is-loading-map #fps-counter,
body.is-loading-map #perf-graph,
body.is-loading-map #speed-hud,
body.is-cinematic-intro #gallery-toggle,
body.is-cinematic-intro .panel-top-buttons,
body.is-cinematic-intro #tour-control-btn,
body.is-cinematic-intro #fpp-hint,
body.is-cinematic-intro #fps-counter,
body.is-cinematic-intro #perf-graph,
body.is-cinematic-intro #speed-hud {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Cinematic Map Title Overlay (Inverse Mask Effect) */
.map-title-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 2000;
  overflow: hidden;
  background-color: transparent;
}

.map-title-text {
  font-family: var(--font-display);
  font-size: clamp(3rem, 15vw, 15rem);
  /* Even bigger for the cutout effect */
  font-weight: 950;
  /* Ultra bold */
  color: #fff;
  /* White acts as the "hole" in multiply mode */
  text-transform: uppercase;
  margin: 0;
  text-align: center;
  line-height: 0.85;
  opacity: 0;
}

/* Overlay animation for the black background */
.map-title-overlay {
  opacity: 0;
  background-color: #000;
  mix-blend-mode: multiply;
  transition: opacity 0.3s ease;
}

.map-title-overlay.active {
  animation: cinematicOverlay 3.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cinematicOverlay {
  0% {
    opacity: 0;
  }

  5% {
    opacity: 1;
  }

  75% {
    opacity: 1;
  }

  /* Start fading earlier */
  100% {
    opacity: 0;
  }
}

.map-title-text.animate {
  animation: cinematicTitle 3.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cinematicTitle {
  0% {
    opacity: 0;
    transform: scale(0.05) translateZ(0);
    filter: blur(30px);
    letter-spacing: 0.5em;
    /* Start wide and mysterious */
  }

  20% {
    opacity: 1;
    filter: blur(0px);
    transform: scale(0.7) translateZ(0);
    letter-spacing: 0.05em;
  }

  65% {
    opacity: 1;
    transform: scale(1.1) translateZ(0);
    letter-spacing: -0.02em;
  }

  100% {
    opacity: 1;
    transform: scale(100) translateZ(0);
    /* Ultra zoom to pierce through */
    letter-spacing: -0.15em;
    /* Crowd the center to eliminate gaps */
  }
}

/* Overlay UI Elements */
#model-viewer .section-header {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;
  text-align: center;
  margin: 0;
}

#model-viewer .section-header .section-title {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8));
}

.viewer-controls {
  position: absolute;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: auto;
  max-width: 320px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.upload-section {
  text-align: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.upload-section:hover {
  background: rgba(13, 115, 119, 0.15);
  border-color: rgba(13, 115, 119, 0.5);
  box-shadow: 0 0 20px rgba(13, 115, 119, 0.2);
}

.upload-section.drag-over {
  background: rgba(13, 115, 119, 0.2);
  border-color: rgba(13, 115, 119, 0.8);
  transform: scale(1.02);
}

.upload-button {
  display: inline-block;
  padding: var(--spacing-md) var(--spacing-xl);
  background: var(--gradient-accent);
  color: white;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(13, 115, 119, 0.4);
}

.upload-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 30px rgba(13, 115, 119, 0.6);
}

.upload-hint {
  margin-top: var(--spacing-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.viewer-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  background: none;
  border: none;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.info-label {
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.95rem;
}

.info-item span:last-child {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Control Buttons */
.control-button {
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.control-button:hover {
  background: rgba(13, 115, 119, 0.15);
  border-color: rgba(13, 115, 119, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(13, 115, 119, 0.3);
}

.control-button:active {
  transform: translateY(0);
}

.control-button.active {
  background: rgba(13, 115, 119, 0.25);
  border-color: rgba(13, 115, 119, 0.6);
  color: var(--accent-cyan);
}

/* ===================================
   Viewer Control Panel (Collapsible)
   =================================== */
.viewer-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 100;
  transition: all 0.3s ease;
}

.fpp-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* HUD Hiding Logic */
.hide-on-move {
  /* Unified transition for all HUD elements to ensure perfectly synchronized hiding */
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease !important;
}

.hud-hidden-mode .hide-on-move:not(#fps-counter):not(#perf-graph) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.tour-active-mode .hide-on-move:not(#tour-control-btn):not(#gallery-toggle):not(.panel-top-buttons):not(#settings-hub):not(#gallery-drawer):not(#controls-panel):not(#cc-panel):not(#perf-panel):not(#fps-counter):not(#perf-graph) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Ensure the button itself is never hidden by tour mode */
.tour-active-mode #tour-control-btn {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.panel-top-buttons {
  display: flex;
  gap: 8px;
  position: absolute;
  right: 0;
  top: 0;
  /* Match unified 0.3s transition */
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.panel-toggle,
.fullscreen-settings-btn,
.close-btn {
  outline: none !important;
}

.panel-toggle {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
}

.panel-toggle svg {
  stroke: #ffffff;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease, stroke 0.3s ease;
}

.panel-toggle:hover svg {
  stroke: var(--accent-cyan);
  filter: drop-shadow(0 0 8px rgba(3, 238, 255, 0.6));
}

/* Only the settings gear should rotate */
#settings-hub-toggle:hover svg {
  transform: rotate(90deg);
}

/* Suble scale for fullscreen hover */
#fullscreen-btn:hover svg {
  transform: scale(1.1);
}

.panel-toggle:hover {
  background: transparent;
  border-color: transparent;
}

/* Settings Hub */
.settings-hub {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 99;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* FPS Counter Overlay (GTA / Cyberpunk Style) */
.fps-counter {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(3, 238, 255, 0.25);
  border-radius: 12px;
  padding: 12px 16px;
  color: #03eeff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  z-index: 99999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(3, 238, 255, 0.05);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-shadow: 0 0 10px rgba(3, 238, 255, 0.3);
}

.fps-detail {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 6px;
  letter-spacing: 0.5px;
}

.settings-hub-content {
  position: absolute;
  right: 0;
  top: 45px;
  background: rgba(10, 10, 15, 0.98);
  border: 1px solid rgba(13, 115, 119, 0.4);
  border-radius: 12px;
  padding: 15px;
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(15px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(13, 115, 119, 0.2);
}

.settings-hub:not(.collapsed) .settings-hub-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hub-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.hub-btn {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hub-btn:hover {
  background: rgba(13, 115, 119, 0.15);
  border-color: var(--accent-cyan);
  transform: translateX(-4px);
  box-shadow: -4px 0 10px rgba(13, 115, 119, 0.3);
}

.hub-btn:active {
  transform: scale(0.98);
}

.hub-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 5px rgba(13, 115, 119, 0.5));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.hub-icon svg {
  width: 100%;
  height: 100%;
}

.hub-text {
  display: flex;
  flex-direction: column;
}

.hub-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hub-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.controls-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 99;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.controls-panel-content {
  position: absolute;
  right: 0;
  top: 55px;
  background: rgba(10, 10, 15, 0.95);
  border: 1px solid rgba(13, 115, 119, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 170px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  max-height: 540px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) rgba(0, 0, 0, 0.3);
}

.controls-panel:not(.collapsed) .controls-panel-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.panel-sub-settings {
  padding-left: 8px !important;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  margin: 2px 0 6px 4px !important;
}

.panel-sub-settings .panel-group {
  margin-bottom: 4px;
}

@media (max-height: 700px),
(max-width: 768px) {

  .controls-panel-content,
  .cc-panel-content {
    max-height: 350px;
  }
}

#three-container:fullscreen .controls-panel-content,
#three-container:fullscreen .cc-panel-content {
  max-height: 90vh;
}

/* Custom scrollbar for panel content */
.controls-panel-content::-webkit-scrollbar,
.cc-panel-content::-webkit-scrollbar {
  width: 8px;
}

.controls-panel-content::-webkit-scrollbar-track,
.cc-panel-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.controls-panel-content::-webkit-scrollbar-thumb,
.cc-panel-content::-webkit-scrollbar-thumb {
  background: var(--accent-cyan);
  border-radius: 4px;
}

.panel-content h4 {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(13, 115, 119, 0.2);
}

.panel-group {
  margin-bottom: 6px;
}

.panel-group label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.panel-group input[type="range"] {
  width: 100%;
  height: 10px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0.05));
  border-radius: 4px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.panel-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 2px;
  height: 10px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: -400px 0 0 400px var(--accent-cyan);
  border: none;
}

.panel-group input[type="range"]::-moz-range-thumb {
  width: 0;
  height: 10px;
  background: transparent;
  cursor: pointer;
  border: none;
  border-radius: 0;
}

.panel-group input[type="range"]::-moz-range-progress {
  background-color: var(--accent-cyan);
  height: 10px;
}

.panel-group input[type="range"]::-webkit-slider-thumb:hover {
  background: transparent;
  box-shadow: -400px 0 0 400px #fff;
}


.panel-divider {
  height: 1px;
  background: rgba(13, 115, 119, 0.2);
  margin: 6px 0;
}

.panel-toggles {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.panel-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 2px 0;
  transition: color 0.2s ease;
}

.panel-toggle-item:hover {
  color: var(--text-primary);
}

.panel-toggle-item input[type="checkbox"] {
  display: none;
}

.tick-mark {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(13, 115, 119, 0.4);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
}

.tick-mark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid transparent;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: border-color 0.2s ease;
}

.panel-toggle-item input[type="checkbox"]:checked+.tick-mark {
  background: rgba(13, 115, 119, 0.3);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(13, 115, 119, 0.3);
}

.panel-toggle-item input[type="checkbox"]:checked+.tick-mark::after {
  border-color: var(--accent-cyan);
}

.panel-reset-btn {
  margin-top: 4px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(13, 115, 119, 0.3);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.panel-reset-btn:hover {
  background: rgba(13, 115, 119, 0.2);
  border-color: rgba(13, 115, 119, 0.5);
  color: var(--text-primary);
}

/* ===================================
   Color Correction Panel
   =================================== */
.cc-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 99;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cc-panel-content {
  position: absolute;
  right: 0;
  top: 55px;
  background: rgba(10, 10, 15, 0.95);
  border: 1px solid rgba(13, 115, 119, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 170px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) rgba(0, 0, 0, 0.3);
}

.cc-panel:not(.collapsed) .cc-panel-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===================================
   Performance Panel
   =================================== */
.perf-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 99;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.perf-panel-content {
  position: absolute;
  right: 0;
  top: 55px;
  background: rgba(10, 10, 15, 0.95);
  border: 1px solid rgba(13, 115, 119, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 170px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.perf-panel:not(.collapsed) .perf-panel-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* (Moved to line 1300 block) */

/* Performance Graph */
.perf-graph {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 210px;
  height: 62px;
  background: rgba(10, 10, 20, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 8px;
  z-index: 1999;
  pointer-events: none;
  backdrop-filter: blur(8px);
  transform: translateZ(0);
  will-change: transform;
}

/* Fullscreen styles */
#three-container:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  background: #0a0a0f;
}

/* Ensure performance overlays are visible in native fullscreen (top layer) */
#three-container:fullscreen #fps-counter,
#three-container:fullscreen #perf-graph,
#three-container:-webkit-full-screen #fps-counter,
#three-container:-webkit-full-screen #perf-graph,
#three-container:-moz-full-screen #fps-counter,
#three-container:-moz-full-screen #perf-graph,
#three-container:-ms-fullscreen #fps-counter,
#three-container:-ms-fullscreen #perf-graph {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 2147483647 !important;
  position: fixed !important;
  left: 20px !important;
  transform: none !important;
}

/* Let JS control the bottom property for the FPS counter specifically */
#three-container:fullscreen #perf-graph,
#three-container:-webkit-full-screen #perf-graph {
  bottom: 20px !important;
}

/* No !important bottom for #fps-counter here so updateFpsPosition() works */

#three-container:fullscreen .viewer-panel {
  top: 20px;
  right: 20px;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
  .nav-links {
    gap: var(--spacing-md);
  }

  .packages-grid {
    grid-template-columns: 1fr;
  }

  .contact-info {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  section {
    padding: var(--spacing-2xl) 0;
  }

  #three-container {
    height: 400px;
  }

  .viewer-info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .nav-links {
    font-size: 0.9rem;
    gap: var(--spacing-sm);
  }

  .package-card {
    padding: var(--spacing-lg);
  }
}

/* ===================================
   MAP GALLERY
   =================================== */
.map-gallery {
  max-width: 900px;
  margin: 0 auto var(--spacing-xl);
  padding: var(--spacing-md) var(--spacing-lg);
}

.gallery-title {
  color: var(--accent-primary);
  font-size: 1.1rem;
  margin-bottom: var(--spacing-md);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--spacing-md);
}

.map-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(13, 115, 119, 0.2);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.map-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(3, 238, 255, 0.3), transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.map-card:hover::before {
  opacity: 1;
}

.map-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(3, 238, 255, 0.4);
  box-shadow: 0 8px 32px rgba(3, 238, 255, 0.1);
}

.map-card.active {
  border-color: #0df;
  background: rgba(0, 221, 255, 0.12);
  box-shadow: 0 0 30px rgba(0, 221, 255, 0.3), inset 0 0 15px rgba(0, 221, 255, 0.1);
}

.map-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.map-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.map-card:hover .map-card-image img {
  transform: scale(1.08);
}

.map-card-info {
  padding: var(--spacing-sm) var(--spacing-md);
}

.map-card-info h4 {
  color: #e0e0e0;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
  font-family: var(--font-display);
}

.map-card-info p {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  margin: 0;
}

/* Tour button */
.tour-btn {
  background: rgba(3, 238, 255, 0.1) !important;
  border-color: rgba(3, 238, 255, 0.4) !important;
  color: #03eeff !important;
  margin-top: 4px;
}

.tour-btn:hover {
  background: rgba(3, 238, 255, 0.2) !important;
  box-shadow: 0 0 12px rgba(3, 238, 255, 0.2);
}

.tour-btn.touring {
  background: rgba(255, 60, 60, 0.15) !important;
  border-color: rgba(255, 60, 60, 0.5) !important;
  color: #ff5555 !important;
}

/* Tour progress bar */
.tour-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #03eeff, #0d7377);
  transition: width 0.1s linear;
  z-index: 10;
  border-radius: 0 0 0 8px;
}

/* --- Gallery Drawer (Top Pull-down) --- */
#gallery-drawer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent !important;
  z-index: 1500;
  transform: translateY(-100%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 60px 20px 40px;
  gap: 30px;
  overflow-y: auto;
}

.gallery-close-btn {
  position: absolute;
  top: 40px;
  right: 60px;
  width: 44px;
  height: 44px;
  z-index: 10000;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.gallery-close-btn:hover {
  opacity: 1;
  color: var(--accent-cyan);
  transform: scale(1.1) rotate(90deg);
}

/* Hide close button ONLY in initial selection mode (before any map is loaded) */
body.viewer-selection-mode:not(.map-loaded) .gallery-close-btn {
  display: none !important;
}

/* Blur aktywny tylko gdy mapa jest załadowana (frosted glass nad sceną 3D) */
body.map-loaded #gallery-drawer {
  background: rgba(5, 5, 8, 0.6);
  backdrop-filter: blur(25px);
}

.selection-title {
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 6px;
  margin: 0;
  text-align: center;
  background: linear-gradient(to right, #fff, #0df, #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 15px rgba(0, 221, 255, 0.4));
  animation: titleGlow 3s infinite alternate;
}

.selection-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Outfit', sans-serif;
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 400;
  margin: -10px 0 0 0;
  text-align: center;
  letter-spacing: 2px;
}

@keyframes titleGlow {
  from {
    filter: drop-shadow(0 0 10px rgba(0, 221, 255, 0.3));
  }

  to {
    filter: drop-shadow(0 0 25px rgba(0, 221, 255, 0.6));
  }
}

body.viewer-selection-mode .selection-title {
  display: block;
}



#gallery-drawer.open,
body.viewer-selection-mode #gallery-drawer {
  transform: translateY(0);
}

/* Hide toggle handle and other HUD in selection mode */
body.viewer-selection-mode #gallery-toggle,
body.viewer-selection-mode .viewer-panel,
body.viewer-selection-mode #bottom-ui-container,
body.viewer-selection-mode .viewer-controls,
body.viewer-selection-mode #fps-counter,
body.viewer-selection-mode #perf-graph {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.viewer-selection-mode #gallery-drawer {
  height: 100%;
  max-height: 100%;
  background: transparent !important;
}

body.viewer-selection-mode #gallery-drawer .gallery-grid {
  transform: none;
  /* Scale not needed for grid */
}

/* Staggered entry animation for cards (triggered by parent .revealed) */
.map-card {
  opacity: 0;
  transform: translateY(-120px) scale(0.8);
  filter: blur(4px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.4s ease-out,
    box-shadow 0.6s ease;
}

/* When parent is revealed, drop cards in */
.scroll-reveal.revealed .map-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Stagger delays — cascade effect */
.scroll-reveal.revealed .map-card:nth-child(1) {
  transition-delay: 0.05s;
}

.scroll-reveal.revealed .map-card:nth-child(2) {
  transition-delay: 0.12s;
}

.scroll-reveal.revealed .map-card:nth-child(3) {
  transition-delay: 0.19s;
}

.scroll-reveal.revealed .map-card:nth-child(4) {
  transition-delay: 0.28s;
}

.scroll-reveal.revealed .map-card:nth-child(5) {
  transition-delay: 0.35s;
}

.scroll-reveal.revealed .map-card:nth-child(6) {
  transition-delay: 0.42s;
}

.scroll-reveal.revealed .map-card:nth-child(7) {
  transition-delay: 0.49s;
}

.scroll-reveal.revealed .map-card:nth-child(8) {
  transition-delay: 0.56s;
}

.scroll-reveal.revealed .map-card:nth-child(9) {
  transition-delay: 0.63s;
}

/* Reset delays when hidden */
.map-card:nth-child(1),
.map-card:nth-child(2),
.map-card:nth-child(3),
.map-card:nth-child(4),
.map-card:nth-child(5),
.map-card:nth-child(6),
.map-card:nth-child(7),
.map-card:nth-child(8),
.map-card:nth-child(9) {
  transition-delay: 0s;
}

#gallery-drawer .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-template-rows: auto;
  gap: 15px;
  width: 100%;
  max-width: 1200px;
  padding: 10px 20px 40px;
  margin: 0 auto;
  overflow: visible;
}

/* Center the 7th card removed since we have 9 maps now */

.gallery-nav-btn {
  display: none !important;
}

#gallery-drawer .map-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

#gallery-drawer .map-card:hover {
  transform: translateY(-10px) scale(1.03);
  border-color: #0df;
  background: rgba(0, 221, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 221, 255, 0.2);
}

#gallery-drawer .map-card-image {
  width: 100%;
  height: 110px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

#gallery-drawer .map-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.85;
  transition: all 0.5s ease;
  filter: saturate(0.8);
}

#gallery-drawer .map-card:hover img {
  opacity: 1;
  transform: scale(1.1);
  filter: saturate(1.2);
}

#gallery-drawer .map-card.placeholder {
  opacity: 0.6;
  cursor: default;
  filter: grayscale(0.5);
}

#gallery-drawer .map-card.placeholder:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.03);
}

#gallery-drawer .map-card.placeholder::after {
  content: 'COMING SOON';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  background: rgba(0, 221, 255, 0.2);
  color: #0df;
  padding: 5px 15px;
  border: 1px solid #0df;
  font-weight: bold;
  font-size: 10px;
  letter-spacing: 2px;
  z-index: 2;
  backdrop-filter: blur(2px);
  pointer-events: none;
}

#gallery-drawer .map-card-info {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  flex-grow: 1;
}

#gallery-drawer .map-card-info h4 {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.5px;
}

#gallery-drawer .map-card-info p {
  margin: 5px 0 0;
  color: #aaa;
  font-size: 12px;
}

/* --- Gallery Toggle Button (Handle) --- */
#gallery-toggle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 25, 30, 0.4);
  color: #0df;
  padding: 6px 20px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  border: 1px solid rgba(0, 221, 255, 0.25);
  border-top: none;
  font-family: var(--font-display);
  font-size: 11px;
  cursor: pointer;
  z-index: 160;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  font-weight: 700;
  text-transform: uppercase;
  user-select: none;
}

#gallery-toggle:hover {
  background: rgba(0, 221, 255, 0.15);
  border-color: rgba(0, 221, 255, 0.5);
  box-shadow: 0 0 15px rgba(0, 221, 255, 0.2);
}

#gallery-toggle.active {
  background: rgba(0, 221, 255, 0.2);
  border-color: #0df;
  padding-top: 8px;
  box-shadow: 0 0 20px rgba(0, 221, 255, 0.25);
  text-shadow: 0 0 8px rgba(0, 221, 255, 0.6);
}

#gallery-toggle .arrow {
  font-size: 10px;
  transition: transform 0.4s ease;
}

/* --- Fake Fullscreen Mode --- */
#three-container.fake-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

body.fullscreen-active {
  overflow: hidden !important;
}

/* Custom Exit Message */
#fs-exit-msg {
  position: absolute;
  top: 80px;
  /* Below drawer handle */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  color: #0df;
  padding: 8px 20px;
  border-radius: 20px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 200;
  border: 1px solid rgba(0, 221, 255, 0.3);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#fs-exit-msg.visible {
  opacity: 1;
}

/* Rotate arrow when open/active */
#gallery-toggle.active .arrow {
  transform: rotate(180deg);
}

/* Bottom UI Transitions */
#bottom-ui-container,
#tour-control-btn {
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* --- Virtual Cursor for Camera Movement --- */
#virtual-cursor {
  width: 12px;
  height: 12px;
  border: 2px solid #03eeff;
  background: rgba(3, 238, 255, 0.2);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  display: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(3, 238, 255, 0.6);
  transition: opacity 0.15s ease;
}

/* --- Aspect Ratio Optimization --- */

/* 16:9, 16:10 and Large Screens — Filling the whole viewport below navbar */
@media (min-aspect-ratio: 16/10) {
  #three-container {
    height: 100% !important;
    /* Inherit 100vh - 80px from parent logic */
    max-height: none;
  }
}

/* 9:16 (Vertical Mobile) */
@media (max-aspect-ratio: 10/16) {
  .nav-content {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .logo {
    font-size: 1.2rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  #three-container {
    height: 60vh;
  }

  .selection-title {
    font-size: 22px;
    letter-spacing: 3px;
  }

  .selection-subtitle {
    font-size: 14px;
  }

  #gallery-drawer .gallery-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  #gallery-drawer .map-card .map-card-info h4 {
    font-size: 14px;
  }
}

/* General Mobile Fixes */
@media (max-width: 600px) {
  #gallery-drawer {
    padding: 60px 10px 20px 10px;
    justify-content: flex-start;
  }

  #gallery-toggle {
    padding: 4px 15px;
    font-size: 10px;
  }
}

/* --- Warning Modal --- */
.warning-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.4s ease;
}

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

.warning-content {
  background: rgba(15, 25, 35, 0.95);
  border: 1px solid rgba(255, 120, 0, 0.4);
  box-shadow: 0 0 50px rgba(255, 80, 0, 0.15), 0 20px 60px rgba(0, 0, 0, 0.5);
  padding: 40px;
  border-radius: 24px;
  max-width: 450px;
  width: 90%;
  text-align: center;
  animation: modalIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.warning-icon {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.warning-icon svg {
  width: 60px;
  height: 60px;
  color: #ff8c00;
  filter: drop-shadow(0 0 10px rgba(255, 140, 0, 0.4));
}

.warning-content h3 {
  color: #ff8c00;
  font-family: 'Space Mono', monospace;
  font-size: 22px;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.warning-content p {
  color: #ccc;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.warning-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.warning-btn {
  border: none;
  padding: 12px 25px;
  border-radius: 12px;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  flex: 1;
}

.warning-btn.primary {
  background: linear-gradient(135deg, #ff8c00 0%, #ff4500 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 69, 0, 0.3);
}

.warning-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.warning-btn:hover {
  transform: translateY(-2px) scale(1.05);
}

.warning-btn.primary:hover {
  box-shadow: 0 6px 20px rgba(255, 69, 0, 0.5);
}

.warning-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

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

/* ===================================
   Map Screenshots Gallery
   =================================== */
.screenshots-section {
  background: radial-gradient(circle at 50% 0%, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
  padding-bottom: var(--spacing-2xl);
}

.screenshots-container {
  margin-top: var(--spacing-xl);
  position: relative;
}

.screenshots-grid {
  display: flex;
  gap: var(--spacing-lg);
  overflow-x: auto;
  padding: var(--spacing-md) 0;
  scroll-behavior: smooth;
  scrollbar-width: none;
  /* Hide scrollbar for clean look */
  -ms-overflow-style: none;
}

.screenshots-grid::-webkit-scrollbar {
  display: none;
}

.ss-card {
  flex: 0 0 400px;
  height: 250px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  background: var(--bg-card);
}

.ss-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ss-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.6));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ss-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent-cyan);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(3, 238, 255, 0.2);
}

.ss-card:hover img {
  transform: scale(1.1);
}

.ss-card:hover::after {
  opacity: 1;
}

.ss-card-zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  width: 50px;
  height: 50px;
  background: rgba(3, 238, 255, 0.2);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2;
  border: 1px solid rgba(3, 238, 255, 0.5);
  color: white;
  font-size: 1.5rem;
}

.ss-card:hover .ss-card-zoom {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.ss-placeholder {
  width: 100%;
  padding: var(--spacing-2xl);
  background: var(--bg-card);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-secondary);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(15px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90%;
  max-height: 80%;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: -40px;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: var(--accent-cyan);
}

@media (max-width: 768px) {
  #loading-indicator {
    width: 90%;
    transform: translate(-50%, -50%) scale(0.85);
  }

  #loading-indicator p:first-of-type {
    font-size: 16px;
  }

  #loading-map-name {
    font-size: 12px;
  }

  .ss-card {
    flex: 0 0 300px;
    height: 200px;
  }

  .lightbox-close {
    right: 0;
    top: -50px;
  }
}

/* Map Selector in Screenshots Section */
.ss-map-selector {
  margin-bottom: var(--spacing-lg);
  position: relative;
  z-index: 20;
}

.ss-map-grid {
  display: flex;
  gap: var(--spacing-sm);
  overflow-x: auto;
  padding: var(--spacing-sm) 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) transparent;
}

.ss-map-grid::-webkit-scrollbar {
  height: 4px;
}

.ss-map-grid::-webkit-scrollbar-thumb {
  background: var(--accent-cyan);
  border-radius: 10px;
}

.ss-map-card {
  flex: 0 0 160px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ss-map-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  filter: grayscale(40%);
  transition: all 0.3s ease;
}

.ss-map-card span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-map-card:hover,
.ss-map-card.active {
  background: rgba(3, 238, 255, 0.1);
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.ss-map-card:hover img,
.ss-map-card.active img {
  filter: grayscale(0%);
  transform: scale(1.05);
}

.ss-map-card:hover span,
.ss-map-card.active span {
  color: var(--accent-cyan);
}

.ss-map-card.active::before {
  content: '✓';
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--accent-cyan);
  color: #000;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  font-weight: bold;
}

@media (max-width: 768px) {
  .ss-map-card {
    flex: 0 0 130px;
  }
}

/* Integrated Cinematic Showreel */
.screenshots-section {
  padding: 0;
  background: #000;
  overflow: hidden;
  position: relative;
}

/* Map Creators Container */
.map-creators-container {
  position: absolute;
  top: 40px;
  left: 40px;
  display: flex;
  gap: 15px;
  z-index: 20;
  pointer-events: none;
}

.map-creator-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 8px 18px 8px 8px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.map-creator-item:hover {
  background: rgba(3, 238, 255, 0.1);
  border-color: var(--accent-cyan);
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(3, 238, 255, 0.2);
}

.map-creator-item img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: border-color 0.3s ease, transform 0.3s ease;
  object-fit: cover;
}

.map-creator-item:hover img {
  border-color: var(--accent-cyan);
  transform: rotate(5deg);
}

.creator-info {
  display: flex;
  flex-direction: column;
}

.map-creator-item .creator-name {
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.1;
}

.map-creator-item .creator-role {
  color: var(--accent-cyan);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
  opacity: 0.8;
}

.showreel-integrated {
  position: relative;
  width: 100%;
  height: 85vh;
  /* Large cinematic height */
  min-height: 600px;
  background: #000;
  overflow: hidden;
}

.showreel-integrated .showreel-slides {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.showreel-integrated .showreel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease-in-out, transform 10s ease-out;
  transform: scale(1.1);
  background-size: cover;
  background-position: center;
}

.showreel-integrated .showreel-slide.active {
  opacity: 1;
  transform: scale(1);
}

.showreel-overlay-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 80px 0 40px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.5), transparent);
  z-index: 10;
}

.integrated-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
}

.text-meta h2 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  color: #fff;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -2px;
  line-height: 0.9;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.text-meta p {
  font-size: 1.1rem;
  color: var(--accent-cyan);
  margin-top: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.8;
}

.showreel-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.view-3d-btn,
.steam-btn {
  background: rgba(3, 238, 255, 0.1);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(5px);
  box-shadow: 0 0 20px rgba(3, 238, 255, 0.1);
  pointer-events: auto;
  text-decoration: none;
  font-size: 14px;
}

.steam-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.view-3d-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 30px rgba(3, 238, 255, 0.4);
  transform: translateY(-2px);
}

.steam-btn:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.view-3d-btn:hover .icon svg {
  stroke: #000;
}

.view-3d-btn .icon,
.steam-btn .icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.integrated-ui {
  flex: 0 0 350px;
}

.showreel-progress-mini {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 25px;
  border-radius: 10px;
  overflow: hidden;
}

.showreel-progress-mini .progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-cyan);
  box-shadow: 0 0 15px var(--accent-cyan);
}

.integrated-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.integrated-nav .nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.integrated-nav .nav-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
  transform: scale(1.1);
}

.integrated-nav .counter {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.2rem;
  letter-spacing: 2px;
}

/* Vertical Right Thumbs Bar (Premium) */
.integrated-thumbs {
  position: absolute;
  top: 50%;
  right: 40px;
  transform: translateY(-50%);
  z-index: 25;
  height: 70%;
  width: 180px;
  /* Room for thumbs + animation */
  display: flex;
  align-items: center;
  pointer-events: none;
}

.thumb-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: visible;
  padding: 20px 10px 20px 30px;
  /* Space for left-pop animation */
  scrollbar-width: none;
  -ms-overflow-style: none;
  pointer-events: auto;
}

.thumb-grid::-webkit-scrollbar {
  display: none;
}

.thumb-item {
  width: 130px;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.5;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  flex: 0 0 auto;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.6s ease;
  filter: grayscale(0%) brightness(0.65);
}

.thumb-item:hover {
  opacity: 0.8;
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(-10px);
}

.thumb-item.active {
  opacity: 1;
  border-color: var(--accent-cyan);
  border-width: 2px;
  transform: translateX(-20px) scale(1.1);
  box-shadow: 0 0 30px rgba(3, 238, 255, 0.4);
}

.thumb-item.active img {
  transform: scale(1.1);
  filter: grayscale(0%) brightness(1);
}




@media (max-width: 992px) {
  .integrated-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .integrated-ui {
    flex: 0 0 auto;
    width: 100%;
  }

  /* Desktop right-column thumbs: hidden on narrow screens */
  .integrated-thumbs {
    display: none !important;
  }

  /* Action buttons: equal full width on mobile */
  .showreel-actions {
    flex-direction: column;
    gap: 10px;
  }

  .view-3d-btn,
  .steam-btn {
    width: 100%;
    justify-content: center;
  }
}

/* =====================================================================
   Mobile Horizontal Thumb Strip - overlaid at TOP of map image
   ===================================================================== */
.mobile-thumb-strip {
  display: none;
  /* hidden on desktop */
}

@media (max-width: 992px) {

  /* Kill tap highlight on all interactive gallery elements */
  .mobile-thumb-grid .thumb-item,
  .nav-btn,
  .gallery-nav-btn,
  .view-3d-btn,
  .steam-btn {
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-thumb-strip {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.65) 70%, transparent 100%);
    padding: 8px 0 14px;
    z-index: 30;
    pointer-events: auto;
    overflow: hidden;
    box-sizing: border-box;
  }

  .mobile-thumb-grid {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 10px;
    scrollbar-width: none;
    /* hide scrollbar Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    align-items: center;
    scroll-behavior: smooth;
  }

  .mobile-thumb-grid::-webkit-scrollbar {
    display: none;
  }

  /* hide Chrome */

  .mobile-thumb-grid .thumb-item {
    flex: 0 0 130px;
    /* same width as desktop vertical thumbs */
    width: 130px;
    aspect-ratio: 16 / 9;
    /* proper proportions, same as desktop */
    height: auto;
    padding: 0 4px;
    box-sizing: border-box;
    transform: none !important;
    opacity: 0.55;
    transition: opacity 0.3s ease;
    border-radius: 6px;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-thumb-grid .thumb-item:hover {
    opacity: 0.85;
  }

  .mobile-thumb-grid .thumb-item.active {
    opacity: 1;
    border-color: var(--accent-cyan);
    border-width: 2px;
    box-shadow: 0 0 14px rgba(3, 238, 255, 0.55);
  }

  .mobile-thumb-grid .thumb-item img {
    filter: grayscale(20%) brightness(0.85);
  }

  .mobile-thumb-grid .thumb-item.active img {
    filter: grayscale(0%) brightness(1);
  }
}

/* Old showreel overlay clean up */
.showreel-overlay {
  display: none !important;
}


/* Showreel Button */
.showreel-btn {
  background: rgba(3, 238, 255, 0.1);
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 25px;
  box-shadow: 0 0 20px rgba(3, 238, 255, 0.1);
}

.showreel-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 30px rgba(3, 238, 255, 0.4);
  transform: translateY(-3px) scale(1.05);
}

.showreel-btn .icon {
  font-size: 1.4rem;
}

/* ===================================
   Full Screen Settings Menu (GTA Style)
   =================================== */
.settings-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex !important;
  /* Always flex to allow opacity transition */
  flex-direction: column;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
  color: #fff;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ---- Settings backdrop: captures clicks outside the menu ---- */
#settings-backdrop {
  position: absolute;
  inset: 0;
  z-index: 99999;
  /* below overlay (100000) but above everything else */
  display: none;
  cursor: default;
}

.settings-open #settings-backdrop {
  display: block;
}

.settings-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.settings-overlay .menu-header {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 50px);
  background: rgba(5, 5, 12, 0.85);
  backdrop-filter: blur(20px);
  padding: clamp(30px, 8vh, 60px) 12vw clamp(10px, 3vh, 20px) 12vw;
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 0;
}

.menu-nav-btn {
  background: #1a1a1a;
  color: #fff;
  width: clamp(34px, 4vw, 44px);
  padding: 5px 0;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  border: 1px solid #333;
  box-shadow: 0 4px 0 #000;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  pointer-events: none;
  user-select: none;
}

.settings-menu-tab {
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  font-weight: 900;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: clamp(1px, 0.3vw, 3px);
  white-space: nowrap;
}

.settings-menu-tab:hover {
  color: #fff;
}

.settings-menu-tab.active {
  color: var(--accent-cyan);
  position: relative;
}

.settings-menu-tab.active::after {
  content: '';
  position: absolute;
  bottom: -17px;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(3, 238, 255, 0.6);
}

.settings-menu-body {
  display: flex;
  gap: clamp(30px, 6vw, 80px);
  flex: 1;
  min-height: 0;
  padding: clamp(20px, 6vh, 60px) 12vw;
  /* Content is now in the transparent area */
}

.settings-list-pane {
  flex: 1.4;
  overflow-y: auto;
  padding-right: 30px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) rgba(255, 255, 255, 0.05);
}

.settings-info-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4vh, 40px);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  padding-left: clamp(30px, 5vw, 60px);
  padding-top: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(3, 238, 255, 0.3) transparent;
}

.settings-section-content {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.settings-section-content.active {
  display: flex;
}

.settings-item,
.settings-item-container[data-info] {
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(12px, 2vh, 18px) clamp(16px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.settings-item.selected,
.settings-item-container.selected .settings-item {
  background: rgba(3, 238, 255, 0.08);
  border-color: rgba(3, 238, 255, 0.3);
}

[data-info].selected {
  transform: translateX(12px) scale(1.01);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.settings-item.selected,
.settings-item-container.selected .settings-item {
  background: rgba(3, 238, 255, 0.08);
  border-color: rgba(3, 238, 255, 0.3);
}

/* If sub-panel is active (open), make the header's bottom part flat to join the sub-panel */
.settings-item-container:has(.settings-sub-panel.active)>.settings-item {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: rgba(3, 238, 255, 0.12);
  border-color: rgba(3, 238, 255, 0.4);
}

/* Nested Items styling */
#sub-advanced-graphics .settings-item {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

#sub-advanced-graphics .settings-label {
  font-size: 0.95rem;
  letter-spacing: 1px;
}

#sub-advanced-graphics .settings-control {
  min-width: unset;
}

#sub-advanced-graphics .settings-sub-panel {
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 20px;
}

.settings-label {
  font-size: clamp(0.9rem, 1.4vw, 1.15rem);
  font-weight: 700;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.settings-item.selected .settings-label,
.settings-item-container.selected .settings-label {
  color: #fff;
}

.settings-item-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0;
  width: 100%;
}

.settings-advanced-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #888;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: clamp(0.6rem, 0.8vw, 0.75rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 15px;
}

.settings-advanced-btn:hover {
  background: rgba(3, 238, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.settings-advanced-btn.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}

/* ---- Chevron variant (Advanced Settings toggle) ---- */
.advanced-chevron-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.5) !important;
  padding: 6px !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-right: 0 !important;
}

.advanced-chevron-btn .chevron-icon {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.advanced-chevron-btn:hover {
  background: rgba(3, 238, 255, 0.1) !important;
  border-color: rgba(3, 238, 255, 0.4) !important;
  color: var(--accent-cyan) !important;
}

.advanced-chevron-btn.active {
  background: rgba(3, 238, 255, 0.08) !important;
  border-color: var(--accent-cyan) !important;
  color: var(--accent-cyan) !important;
}

.advanced-chevron-btn.active .chevron-icon {
  transform: rotate(180deg);
}

.settings-sub-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 15px 25px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: none;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  margin-top: -1px;
}

.settings-sub-panel.active {
  display: flex;
}

.sub-item {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 8px 15px;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sub-item:hover,
.sub-item.selected {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(10px);
  border-color: rgba(255, 255, 255, 0.05);
}

.sub-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #777;
  text-transform: uppercase;
  min-width: 140px;
}

.sub-value {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-cyan);
  min-width: 60px;
  text-align: right;
  font-family: 'Outfit', sans-serif;
}

.settings-sub-panel input[type="range"] {
  flex: 1;
  height: 8px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.05));
  border-radius: 4px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.settings-sub-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 2px;
  height: 8px;
  background: transparent;
  box-shadow: -600px 0 0 600px var(--accent-cyan);
  cursor: pointer;
  border: none;
}

.settings-sub-panel input[type="range"]::-moz-range-thumb {
  width: 0;
  height: 8px;
  background: transparent;
  border: none;
}

.settings-sub-panel input[type="range"]::-moz-range-progress {
  background-color: var(--accent-cyan);
  height: 8px;
}

.settings-control {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 20px);
  min-width: clamp(200px, 30vw, 400px);
  justify-content: flex-end;
}

.settings-control input[type="range"] {
  width: clamp(150px, 20vw, 300px);
  height: 18px;
  /* Even thicker for the main settings menu */
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.6);
}

.settings-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 2px;
  height: 18px;
  background: transparent;
  cursor: pointer;
  box-shadow: -500px 0 0 500px var(--accent-cyan);
  border: none;
  transition: background 0.2s ease;
}

.settings-control input[type="range"]::-moz-range-thumb {
  width: 0;
  height: 18px;
  background: transparent;
  cursor: pointer;
  border: none;
  border-radius: 0;
}

.settings-control input[type="range"]::-moz-range-progress {
  background-color: var(--accent-cyan);
  height: 18px;
}

.settings-control input[type="range"]::-webkit-slider-thumb:hover {
  background: transparent;
  box-shadow: -500px 0 0 500px #fff;
}


.settings-control .value-display {
  min-width: 65px;
  text-align: right;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: var(--accent-cyan);
  font-size: 1.1rem;
  text-shadow: 0 0 10px rgba(3, 238, 255, 0.3);
}

.settings-switch {
  position: relative;
  width: 54px;
  height: 28px;
}

.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-switch {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  transition: .4s;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider-switch:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

input:checked+.slider-switch {
  background-color: var(--accent-cyan);
  border-color: rgba(3, 238, 255, 0.4);
}

input:checked+.slider-switch:before {
  transform: translateX(26px);
}

.info-title {
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  font-weight: 900;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: clamp(10px, 2vh, 20px);
}

.info-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #999;
  max-width: 400px;
}

.menu-footer {
  background: rgba(5, 5, 12, 0.85);
  backdrop-filter: blur(20px);
  padding: clamp(15px, 3vh, 25px) 12vw;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: clamp(20px, 3vw, 40px);
}

.footer-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: #666;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 1px;
}

.btn-key {
  background: #1a1a1a;
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid #333;
  box-shadow: 0 4px 0 #000;
}

.settings-overlay .close-btn,
.settings-overlay .fullscreen-settings-btn {
  position: absolute;
  top: clamp(20px, 5vh, 40px);
  width: clamp(36px, 4vw, 44px);
  height: clamp(36px, 4vw, 44px);
  z-index: 99999;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-overlay .btn-label {
  display: none;
}

.settings-overlay .close-btn {
  right: calc(12vw + 60px);
}

.settings-overlay .fullscreen-settings-btn {
  right: 12vw;
}

.settings-overlay .close-btn:hover,
.settings-overlay .fullscreen-settings-btn:hover {
  opacity: 1;
  color: var(--accent-cyan);
  transform: scale(1.1);
}

.settings-overlay .close-btn:hover {
  transform: scale(1.1) rotate(90deg);
}


.map-brief-preview {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.brief-stats {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.brief-stat-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brief-stat-label {
  color: #666;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.brief-stat-value {
  color: var(--accent-cyan);
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
}

/* --- HUD Hiding during Settings --- */
body.menu-open #gallery-toggle,
body.menu-open #bottom-ui-container,
body.menu-open #tour-control-btn,
body.menu-open #speed-hud {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.4s ease, visibility 0.4s ease !important;
}