/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
:root {
  /* Colors */
  --bg-dark: #000000;
  --text-light: rgba(255, 255, 255, 0.9);
  --backdrop-dark: rgba(0, 0, 0, 0.3);
  --border-light: rgba(255, 255, 255, 0.1);
  
  /* Transitions */
  --transition-speed: 0.3s;
  --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Remove default margins/padding and set a dark background */
body,
html {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg-dark);
  font-family: system-ui, -apple-system, sans-serif;
}

/* Ensure canvas fills its container */
canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* Collapsible debug log container styling */
#debug-log-container {
  position: fixed;
  bottom: 1.25rem;
  left: 4.5rem; /* positioned to the right of the button */
  width: 400px; /* base width for desktop */
  max-width: calc(100vw - 6rem); /* prevent overflow on small screens */
  height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  color: #fff;
  font-family: monospace;
  font-size: 12px;
  padding: 0.5rem;
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Only show when active class is present - no hover behavior */
#debug-log-container.active {
  opacity: 1;
  pointer-events: all;
}

#debug-log {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  width: 100%;
}

/* New Style for floating debug toggle button (bottom left) */
#debug-button {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--backdrop-dark);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-light);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
  transition: background-color var(--transition-speed) var(--transition-timing);
}
#debug-button:hover,
#debug-button.active {
  background: rgba(255, 255, 255, 0.1);
}

/* Modify the debug button hover behavior */
#debug-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Create a smaller hover detection area just around the button */
#debug-button::before {
  content: '';
  position: absolute;
  left: -10px;
  top: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  z-index: -1;
}

/* Add these responsive styles for the debug log container */
@media (max-width: 600px) {
  #debug-log-container {
    left: 1.25rem; /* align with left edge on mobile */
    bottom: 4.5rem; /* place above the button on mobile */
    width: calc(100% - 2.5rem); /* nearly full width */
    height: 150px; /* smaller height on mobile */
    font-size: 10px; /* smaller text on mobile */
  }
  
  #debug-log {
    word-break: break-word; /* ensure text wraps properly */
  }
}

