/* =========================================
   VARIABLES & BASE SETUP
   ========================================= */
:root {
    --neon-pink: #ff00ff;
    --neon-cyan: #00ffff;
    --vintage-orange: #d95e16;
    --vintage-brown: #5c3a21;
}

body {
    margin: 0;
    font-family: 'VT323', monospace;
    background-color: #050505;
    color: white;
}

/* =========================================
   LOBBY STYLING (index.html)
   ========================================= */
body.lobby-body {
    overflow: auto;
    min-height: 100vh;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lobby-container {
    max-width: 900px;
    width: 100%;
    text-align: center;
    padding: 20px;
}

.lobby-container h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    color: var(--neon-cyan);
    text-shadow: 3px 3px var(--neon-pink);
    margin: 0 0 10px 0;
    letter-spacing: 4px;
}

.subtitle {
    font-size: 1.5rem;
    color: #888;
    margin-bottom: 50px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* The Large Outline Buttons */
.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 700px;
    margin: 0 auto;
}

.room-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid;
    border-radius: 10px;
    transition: all 0.3s ease;
    letter-spacing: 2px;
}

/* 70s Button Variant */
.room-btn.theme-70s {
    color: var(--vintage-orange);
    border-color: var(--vintage-orange);
}

.room-btn.theme-70s:hover {
    background: var(--vintage-orange);
    color: #000;
    box-shadow: 0 0 20px var(--vintage-orange);
}

/* 80s Button Variant */
.room-btn.theme-80s {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
}

.room-btn.theme-80s:hover {
    background: var(--neon-cyan);
    color: #000;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px var(--neon-cyan);
}

@media (max-width: 600px) {
    .button-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================
   3D GALLERY LAYOUT (70s & 80s html files)
   ========================================= */
body.gallery-body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.gallery-header {
    background: #111;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--vintage-orange);
}

.gallery-header h1 {
    margin: 0 0 0 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--vintage-orange);
}

body[data-theme="80s"] .gallery-header {
    border-bottom: 2px solid var(--neon-pink);
}

body[data-theme="80s"] .gallery-header h1 {
    color: var(--neon-cyan);
    text-shadow: 2px 2px var(--neon-pink);
}

.back-btn {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    border: 1px solid #777;
    padding: 5px 10px;
    background: #333;
    transition: 0.2s;
}

.back-btn:hover {
    background: #555;
}

.gallery-layout {
    display: flex;
    flex: 1;
    height: calc(100vh - 70px);
}

/* THE GRID */
.thumbnail-sidebar {
    width: 300px;
    background: #0a0a0a;
    border-right: 2px solid #333;
    padding: 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-content: start;
}

.toy-thumb {
    aspect-ratio: 1 / 1;
    background: #222;
    border: 2px solid #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: 0.2s;
    font-family: 'Orbitron', sans-serif;
    color: #888;
}

.toy-thumb:hover {
    border-color: white;
    color: white;
}

.toy-thumb.active {
    border-color: var(--vintage-orange);
    color: var(--vintage-orange);
    box-shadow: 0 0 10px var(--vintage-orange);
}

body[data-theme="80s"] .toy-thumb.active {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}

/* THE 3D STAGE */
#canvas-container {
    flex: 1;
    position: relative;
    background: #000;
}

#loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--vintage-orange);
    pointer-events: none;
}

body[data-theme="80s"] #loading-overlay {
    color: var(--neon-cyan);
}

/* --- UNIFIED UI PANEL --- */
.ui-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(0, 0, 0, 0.85);
    padding: 20px;
    border: 1px solid #444;
    border-radius: 12px;
    z-index: 10;
    min-width: 250px;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.divider {
    border: 0;
    height: 1px;
    background: #444;
    width: 100%;
    margin: 5px 0;
}

.switch-label {
    font-size: 1.2rem;
    color: #555;
    transition: 0.3s;
}

.switch-label.active {
    color: var(--vintage-orange);
    text-shadow: 0 0 8px var(--vintage-orange);
}

body[data-theme="80s"] .switch-label.active {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan);
}

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--vintage-brown);
    transition: 0.4s;
    border-radius: 30px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

body[data-theme="80s"] .slider {
    background-color: #333;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #ddd; 
}

input:checked + .slider:before {
    transform: translateX(30px);
    background-color: #333;
}

/* Range Slider Styles */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--vintage-orange);
    cursor: pointer;
    margin-top: -7px;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

body[data-theme="80s"] input[type=range]::-webkit-slider-thumb {
    background: var(--neon-cyan);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #555;
    border-radius: 2px;
}