﻿/* layout.css (layout + structure) */
/* Split from legacy style.css */

.container {
  /* Flex column prevents global `.body { grid-area: body }` rules from reordering children */
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--dark-bg);
}

/* Header */
/* Unified Header */
header.unified-header,
.unified-header {
  width: 100%;
  color: var(--text-primary);
  background: linear-gradient(to bottom, rgba(10, 10, 15, 0.98), rgba(8, 8, 12, 0.95));
  border-bottom: 1px solid rgba(0, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  padding: 0.5rem 0.75rem;
  z-index: 100;
  position: sticky;
  top: 0;
}

.unified-header-content {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
}

.unified-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  line-height: 1;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 255, 0.22);
  background: rgba(0, 255, 255, 0.06);
  color: var(--neon-cyan);
  font-weight: 900;
  letter-spacing: 0.02em;
  font-size: 18px;
}

.mobile-nav-toggle:hover {
  border-color: var(--dark-border-hover);
  background: rgba(0, 255, 255, 0.10);
}

/* Mobile left nav drawer (only enabled on ≤901px) */
.mobile-nav-overlay,
.mobile-nav-drawer {
  display: none;
}

.unified-header-center {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
}

.unified-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
}

.workspace-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.workspace-controls .workspace-info {
  text-align: left;
}

header {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  color: var(--text-primary);
  background: rgba(10, 10, 15, 0.95);
  border-bottom: 1px solid rgba(0, 255, 255, 0.35);
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  padding: 0.4rem 0.6rem;
  z-index: 100;
}

header .header-content {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

/* Desktop: Header always visible, toggle button hidden */
@media screen and (min-width: 902px) {
  header,
  .header {
    position: sticky;
    top: 0;
    transform: none !important;
    animation: none !important;
  }
  
  .header-toggle,
  .header-toggle-in-header {
    display: none !important;
  }

  /* Keep the maze header visible and prevent it from sliding under the sticky site header */
  .maze-header {
    /* Important: base `.maze-header { position: relative; }` is defined later in this file.
       Without !important, the later rule wins and `top` turns into a relative offset (causing a gap). */
    position: sticky !important;
    top: var(--site-header-h, 0px) !important;
    z-index: 900;
  }
}

header h1,
.unified-header .title h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: var(--glow-cyan-soft);
  color: var(--neon-cyan);
  margin: 0;
}

/* Footer removed (kept intentionally blank) */

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: grid;
  place-items: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
  display: none;
}

.cancel-button {
  margin-top: 1rem;
  padding: 0.5rem 1.5rem;
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid rgba(255, 0, 0, 0.5);
  border-radius: 6px;
  color: #ff6666;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.cancel-button:hover {
  background: rgba(255, 0, 0, 0.3);
  border-color: rgba(255, 0, 0, 0.7);
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(0, 255, 255, 0.2);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

.loading-text {
  color: var(--neon-cyan);
  font-size: 1.1rem;
  text-shadow: var(--glow-cyan-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Maze Header (legacy - now part of unified header) */
.maze-header {
  display: none;
}

.maze-header h1 {
  color: var(--neon-cyan);
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: var(--glow-cyan-soft);
  margin: 0;
}

.maze-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

/* In the unified header, the action row sits on the right; align it to the edge. */
.unified-header-right .maze-actions {
  justify-content: flex-end;
}

/* Compact action buttons in the maze header (desktop + mobile) */
.maze-actions button:not(.play-button) {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.play-button {
  padding: 0.5rem 1.05rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: rgba(0, 255, 255, 0.15);
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: var(--glow-cyan-soft);
  text-transform: none;
  letter-spacing: 0.05em;
  width: auto;
  min-width: auto;
  flex: 0 0 auto;
}

.play-button:hover {
  background: rgba(0, 255, 255, 0.25);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.play-button.playing {
  background: rgba(255, 0, 255, 0.15);
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  box-shadow: 0 0 10px var(--neon-pink), 0 0 20px var(--neon-pink);
}

.play-button.playing:hover {
  background: rgba(255, 0, 255, 0.25);
}

/* Header Bar */
.header {
  background: rgba(10, 10, 15, 0.9);
  border-bottom: 1px solid var(--dark-border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  align-items: center;
  /* Override global header styles so mobile sidebar can be interacted with */
  z-index: 100 !important;
}

.header > a {
  padding: 0.4rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: grid;
  align-items: center;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 0.85rem;
}

.header > a:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  background: rgba(0, 255, 255, 0.05);
}

.header > a:active {
  background: rgba(0, 255, 255, 0.1);
  color: var(--neon-cyan);
}

/* Body Layout */
.body {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  overflow: hidden;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  /* Ensure fixed sidebar (nested in .body) can stack above header on mobile */
  z-index: 200;
}

@media screen and (min-width: 901px) {
  .body {
    /* Prevent sidebar content from forcing horizontal overflow */
    grid-template-columns: minmax(0, 1fr) clamp(360px, 28vw, 520px);
    /* Desktop: keep the page from scrolling; let sidebar scroll instead */
    height: calc(100dvh - var(--site-header-h, 0px) - var(--footer-h, 0px));
    overflow: hidden;
  }

  /* Ensure only the sidebar scrolls on desktop */
  .content {
    overflow: hidden;
    min-width: 0;
  }

  .sidebar {
    height: 100%;
    min-width: 0;
    overflow: hidden; /* scroll is handled by tab panels */
    display: flex;
    flex-direction: column;
  }
}

/* Desktop-wide: allow sidebar to use more of the extra space (helps keep previews in one row) */
@media screen and (min-width: 1200px) {
  .body {
    grid-template-columns: minmax(0, 1fr) clamp(420px, 36vw, 760px);
  }
}

@media screen and (min-width: 801px) and (max-width: 900px) {
  .body {
    grid-template-columns: 1.5fr 1.2fr;
  }
}

/* Content Area */
.content {
  background: var(--dark-bg);
  scrollbar-color: rgba(0, 255, 255, 0.2) transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: auto;
  padding: 0.5rem 0.6rem;
}

/* Workspace bar (always visible above the scrollable/zoomable area) */
/* Workspace bar (legacy - now part of unified header) */
.workspace-bar {
  display: none;
}

.workspace-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.workspace-bar-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.workspace-title {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.85rem;
}

.workspace-hint {
  color: var(--text-muted);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.workspace-zoom-pct {
  min-width: 62px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Player container for canvas */
#player {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  /* Subtle frame so the “workspace” feels intentional */
  border: 1px solid rgba(0, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  touch-action: none; /* enable pinch/drag handling */
}

#player.zoomed {
  /* When zoomed in, allow panning via scroll/drag */
  display: block;
  overflow: auto;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 255, 0.25) transparent;
}

#player.zoomed.dragging {
  cursor: grabbing;
}

#player canvas {
  display: block;
}

.canvas-hud-btn {
  min-width: 38px;
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 255, 0.22);
  background: rgba(0, 255, 255, 0.06);
  color: var(--neon-cyan);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.canvas-hud-btn:hover {
  border-color: var(--dark-border-hover);
}

.canvas-hud-btn--reset {
  min-width: 64px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}

.canvas-hud-zoom {
  padding: 0 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  white-space: nowrap;
}

@media screen and (max-width: 520px) {
  .canvas-hud-btn {
    min-width: 34px;
    height: 32px;
  }
  .canvas-hud-btn--reset {
    min-width: 58px;
  }

  .workspace-hint {
    display: none;
  }
  
  /* Keep burger + zoom on the same row even on very small screens */
  .unified-header-content {
    grid-template-columns: auto auto 1fr;
    gap: 0.6rem;
    align-items: center;
    justify-content: start;
  }
  
  .unified-header-center {
    order: 0;
    width: auto;
   
  }
  
  .unified-header-right {
    order: 2;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .workspace-info {
    text-align: left;
  }
}

/* Sidebar */
.sidebar {
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(10, 10, 15, 0.95);
  border-left: 1px solid var(--dark-border);
  scrollbar-color: rgba(0, 255, 255, 0.2) transparent;
  backdrop-filter: blur(10px);
  min-width: 0;
}

/* Mobile split-screen layout (≤901px) */
@media screen and (max-width: 901px) {
  /* Kill legacy header show/hide toggle on mobile (it creates a second burger row). */
  #headerToggleInHeader,
  .header-toggle-in-header {
    display: none !important;
  }

  /* Hide inline nav, use drawer */
  .unified-header-left .nav {
    display: none;
  }

  /* On mobile, keep ONLY burger + zoom controls in the header */
  .unified-header-left .title {
    display: none;
  }
  .unified-header-right {
    display: none;
  }
  .unified-header-center .workspace-info {
    display: none;
  }

  /* Mobile header = burger + zoom side-by-side */
  .unified-header-content {
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 0.6rem;
    justify-content: start;
  }

  .unified-header-left {
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .unified-header-center {
    order: 0;
    width: auto;
    justify-content: flex-start;
  }

  .workspace-controls {
    justify-content: flex-start;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .mobile-nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .mobile-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
    z-index: 17500;
  }

  .mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-drawer {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(86vw, 320px);
    background: rgba(10, 10, 15, 0.98);
    border-right: 1px solid rgba(0, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    transform: translateX(-105%);
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 17501;
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .mobile-nav-drawer.open {
    transform: translateX(0);
  }

  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .mobile-nav-title {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-size: 0.75rem;
  }

  .mobile-nav-close {
    width: 40px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.22);
    background: rgba(0, 255, 255, 0.06);
    color: var(--neon-cyan);
    font-weight: 900;
  }

  .mobile-nav-links {
    display: grid;
    gap: 0.5rem;
  }

  .mobile-drawer-title .title h1 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
  }

  .mobile-drawer-actions .maze-actions {
    display: grid;
    gap: 0.5rem;
  }

  .mobile-drawer-actions .maze-actions button {
    width: 100%;
  }

  .mobile-drawer-workspace .workspace-info {
    display: grid;
    gap: 0.2rem;
    padding: 0.25rem 0.2rem 0.1rem;
  }

  .mobile-drawer-divider {
    border: 0;
    height: 1px;
    background: rgba(0, 255, 255, 0.12);
    margin: 0.25rem 0;
  }

  .mobile-nav-link {
    width: 100%;
    text-align: left;
    display: block;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.14);
    background: rgba(0, 255, 255, 0.03);
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.8rem;
  }

  .mobile-nav-link:hover {
    color: var(--neon-cyan-light);
    border-color: rgba(0, 255, 255, 0.28);
    background: rgba(0, 255, 255, 0.08);
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  /* Mobile: split screen evenly between workspace (top) and settings (bottom). */
  .body {
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-columns: 1fr;
    overflow: visible; /* override base `.body { overflow: hidden; }` */
    min-height: 0;
    height: calc(100dvh - var(--site-header-h, 0px) - var(--footer-h, 0px));
  }
  
  /* Canvas area is locked (no scrolling) */
  .content {
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    /* Allow an optional workspace bar + the canvas area */
    grid-template-rows: auto 1fr;
    padding: 0.25rem;
    gap: 0.25rem;
    min-height: 0;
  }

  /* Ensure the canvas workspace stays centered in the available grid area */
  .content > #player {
    justify-self: center;
    align-self: center;
  }

  /* Make the workspace frame hug the square canvas on mobile (avoid tall empty space) */
  #player {
    height: auto;
    /* Don't force a square on small screens; cap the workspace so settings below get room. */
    max-height: clamp(220px, 44dvh, 520px);
  }

  /* On mobile, only constrain the canvas when NOT zoomed.
     When zoomed, allow the canvas to exceed the viewport so pan works. */
  #player:not(.zoomed) canvas {
    max-width: 100%;
    max-height: 100%;
  }
  #player.zoomed canvas {
    max-width: none !important;
    max-height: none !important;
  }

  /* When settings are hidden (or in play mode), let the workspace expand fully. */
  body.settings-closed #player,
  body.play-mode #player {
    max-height: 100%;
  }

  /* When the fixed header is shown, reserve space so maze-header/body don't slide under it */
  body.header-visible .maze-header {
    margin-top: var(--site-header-h, 0px);
  }
  body.header-visible .body {
    height: calc(100dvh - var(--site-header-h, 0px) - var(--footer-h, 0px));
  }
  
  /* Ensure body doesn't scroll */
  body {
    overflow: hidden;
  }
  
  /* Sidebar becomes static, scrollable in bottom panel */
  .sidebar {
    position: static;
    width: 100%;
    height: 100%;
    max-width: none;
    border-left: none;
    border-top: 1px solid var(--dark-border);
    box-shadow: none;
    transition: none;
    z-index: auto;
    overflow-y: auto;
    min-height: 0;
  }
  
  /* Hide sidebar overlay in this mode */
  .sidebar-overlay {
    display: none !important;
  }
  
  /* Settings closed state - canvas gets full height */
  body.settings-closed .body {
    grid-template-rows: 1fr;
  }
  
  body.settings-closed .sidebar {
    display: none;
  }
  
  /* Play mode - hide settings and give canvas full space */
  body.play-mode .sidebar {
    display: none;
  }
  
  body.play-mode .mobile-settings-toggle {
    display: none;
  }
  
  body.play-mode .body {
    grid-template-rows: 1fr;
  }
  
  /* Header positioning and animation for mobile */
  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInHeader 0.5s ease-out forwards;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.75rem;
  }
  
  /* Header animation on load */
  @keyframes slideInHeader {
    0% {
      transform: translateY(-100%);
    }
    15% {
      transform: translateY(0);
    }
    85% {
      transform: translateY(0);
    }
    100% {
      transform: translateY(-100%);
    }
  }
  
  /* Show header when toggled */
  body.header-visible .header {
    transform: translateY(0);
    animation: none;
  }
  
  /* Header toggle button in maze-header (shown when header is hidden) */
  .maze-header {
    grid-template-columns: auto 1fr auto;
  }
  
  .header-toggle {
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--glow-cyan-soft);
    display: none; /* Hidden by default */
    backdrop-filter: blur(10px);
    align-self: center;
  }
  
  /* Show toggle in maze-header when header is hidden */
  body:not(.header-visible) .header-toggle {
    display: block;
  }
  
  /* Header toggle button in header (shown when header is visible) */
  .header-toggle-in-header {
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--glow-cyan-soft);
    display: none; /* Hidden by default */
    backdrop-filter: blur(10px);
    align-self: center;
  }
  
  /* Show toggle in header when header is visible */
  body.header-visible .header-toggle-in-header {
    display: block;
  }
  
  .header-toggle:hover,
  .header-toggle-in-header:hover {
    background: rgba(0, 255, 255, 0.15);
    box-shadow: var(--glow-cyan);
    transform: translateY(-1px);
  }
  
  .header-toggle:active,
  .header-toggle-in-header:active {
    transform: translateY(0);
  }
  
  /* Compact spacing for mobile */
  header,
  .unified-header {
    padding: 0.4rem 0.6rem;
  }
  
  header h1,
  .unified-header .title h1 {
    font-size: 0.95rem;
  }
  
  .unified-header-content {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  
  .unified-header-left {
    justify-content: space-between;
  }
  
  .unified-header-center {
    order: 3;
    width: 100%;
  }
  
  .unified-header-right {
    order: 2;
    justify-content: space-between;
    width: 100%;
  }
  
  .workspace-info {
    text-align: left;
  }
  
  .workspace-hint {
    font-size: 0.65rem;
  }
  
  .maze-header {
    padding: 0.5rem 0.75rem;
  }
  
  .maze-header h1 {
    font-size: 1.1rem;
  }
  
  .play-button {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }
  
  button {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .content {
    padding: 0.25rem;
  }
  
  .sidebar {
    padding: 0;
  }
  
  .tabContainer .tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.72rem;
  }
  
  .tabContainer .panel {
    gap: 0.75rem;
  }
  
  .panel label {
    font-size: 0.6rem;
  }
  
  .panel input[type="range"] {
    height: 4px;
  }
  
  .panel input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
  }
  
  .panel input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
  }
  
  .panel input[type="text"],
  .panel input[type="file"] {
    padding: 0.4rem;
    font-size: 0.8rem;
  }
  
  .subtabContainer .subtab {
    padding: 0.4rem 0.5rem;
    font-size: 0.62rem;
  }
  
  .subtabContainer .subpanel {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  footer {
    padding: 0.4rem;
    font-size: 0.65rem;
  }
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  /* below sidebar, above content */
  z-index: 4900;
  display: none;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
}

@media screen and (min-width: 902px) {
  .sidebar-overlay {
    display: none !important;
  }
  .mobile-settings-toggle {
    display: none !important;
  }
}

/* Mobile Settings Toggle */
.mobile-settings-toggle {
  padding: 0.5rem 1rem;
  border: 1px solid var(--dark-border);
  border-radius: 4px;
  background: rgba(0, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-settings-toggle:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  background: rgba(0, 255, 255, 0.1);
  color: var(--neon-cyan);
}

/* Tab Container */

