body, html {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background-color: #1a1a1a; /* Dark background */
    color: #f0f0f0;
    overflow: hidden; /* Hide scrollbars initially */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
}

#controls {
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

#controls h2 {
    margin-top: 0;
    color: #61dafb;
}

#controls button {
    background-color: #61dafb;
    color: #1a1a1a;
    border: none;
    padding: 10px 15px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
}

#controls button:hover {
    background-color: #4fa8c7;
}

#controls button:active {
    transform: scale(0.95);
}

#stopButton {
    background-color: #ff6b6b;
    color: white;
}
#stopButton:hover {
    background-color: #e05252;
}

.warning {
    font-size: 0.9em;
    color: #ffcc00; /* Yellow for warning */
    margin-top: 15px;
    border: 1px solid #ffcc00;
    padding: 10px;
    border-radius: 4px;
    background-color: rgba(255, 204, 0, 0.1);
}

#stimulation-area {
    position: relative; /* For positioning the fullscreen button */
    width: 100%;
    aspect-ratio: 16 / 9; /* Maintain a widescreen aspect ratio */
    background-color: #000;
    border-radius: 8px;
    overflow: hidden; /* Ensure canvas stays within bounds */
    box-shadow: 0 0 20px rgba(97, 218, 251, 0.3);
}

#hypnoCanvas {
    display: block; /* Remove extra space below canvas */
    width: 100%;
    height: 100%;
}

#fullscreenButton {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s, background-color 0.3s;
}

#fullscreenButton:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.3);
}

/* Fullscreen specific styling */
#stimulation-area:fullscreen { /* For the container */
    width: 100vw;
    height: 100vh;
    border-radius: 0; /* Remove border radius in fullscreen */
}

#stimulation-area:fullscreen #hypnoCanvas { /* Canvas fills the container */
    width: 100%;
    height: 100%;
}

.settings-panel {
    margin-top: 15px;
    padding: 10px;
    background-color: #333;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Spacing between label, slider, and value */
}

.settings-panel label {
    font-size: 0.9em;
    color: #ccc;
}

.settings-panel input[type="range"] {
    flex-grow: 1; /* Allow slider to take available space if needed */
    max-width: 200px; /* Or some other max width */
    cursor: pointer;
}

.settings-panel span {
    font-size: 0.9em;
    color: #61dafb;
    min-width: 30px; /* Ensure space for 3-4 digit numbers */
    text-align: right;
}


/* ... (previous styles) ... */

#stimulation-area {
    position: relative; /* For positioning the fullscreen button and canvas layers */
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(97, 218, 251, 0.3);
}

#hypnoCanvas {
    display: block; /* Default for 2D canvas */
    width: 100%;
    height: 100%;
    position: absolute; /* Allow layering if needed, though we'll mostly toggle display */
    top: 0;
    left: 0;
}

#threejs-container {
    /* display: none; set by JS */
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: #000; /* Fallback background for 3D area */
}

/* Styles for the canvas Three.js will create inside #threejs-container */
#threejs-container canvas.webgl {
    display: block;
    width: 100% !important; /* Ensure it fills container */
    height: 100% !important; /* Ensure it fills container */
}


/* lil-gui default styling is usually fine, but you can override: */
.lil-gui {
    z-index: 1000 !important; /* Ensure it's on top */
}

#fullscreenButton { /* This button is for the 2D canvas area by default */
    position: absolute;
    bottom: 10px;
    right: 10px;
    /* ... other styles ... */
}

/* Hide the 2D fullscreen button when 3D is active, as 3D has its own */
#stimulation-area.threejs-active #fullscreenButton {
    display: none;
}