:root {
    --bg-color: #1a1a2e;
    --glass-color: rgba(255, 255, 255, 0.1);
    --accent-color: #0f3460;
    --highlight-color: #e94560;
    --text-color: #fff;
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #000;
    /* Fallback */
}

.main-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

.game-view {
    flex: 1;
    /* Let it grow to fill */
    position: relative;
    background: #000;
    overflow: hidden;
    border-right: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar {
    width: 240px;
    min-width: 240px;
    background: #16213e;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* Background Layers */
#game-layers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

#layer-interior-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    /* Hide sliding parts */
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#bg-interior-current {
    z-index: 1;
}

#bg-interior-next {
    z-index: 1;
    top: 100%;
    /* Start below */
}

#layer-reflection {
    z-index: 5;
    /* Above interior */
    opacity: 0.2;
    /* Subtly transparent reflection */
    pointer-events: none;
    /* Let clicks pass through to canvas */
    /* Mix blend mode for better reflection look */
    mix-blend-mode: screen;
}

#office-bg {
    display: none;
    /* Legacy */
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    background: transparent;
    z-index: 10;
    /* Top layer for dirt */
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    background: transparent;
}

/* Sidebar Styles */
.sidebar-header h1 {
    font-size: 1.2rem;
    /* Reduced font size */
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    margin-bottom: 0.2rem;
}

.sidebar-header .subtitle {
    color: var(--highlight-color);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.2rem;
}

.sidebar-section h2 {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.2rem;
}

/* Tool Belt - Vertical in Sidebar */
#tool-belt {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0 0.6rem;
    width: 100%;
    height: 34px;
    /* Smaller tools */
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tool:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.tool.active {
    background: var(--highlight-color);
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(233, 69, 96, 0.3);
}

.tool .icon {
    font-size: 1.2rem;
    margin-right: 0.8rem;
}

.tool .label {
    font-size: 0.9rem;
    font-weight: bold;
    flex: 1;
}

.tool .key {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.6rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Stats */
.stat-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-box .label {
    font-size: 0.7rem;
    opacity: 0.7;
}

.stat-box .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--highlight-color);
}

/* Minimap */
#minimap-container {
    margin-top: 1.5rem;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#minimap-building {
    width: 40px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    border-radius: 4px;
    /* Windows pattern on building */
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 10px 10px;
}

#minimap-scaffold {
    position: absolute;
    left: -5px;
    /* Stick out slightly */
    width: 50px;
    height: 12px;
    background: var(--highlight-color);
    box-shadow: 0 0 5px var(--highlight-color);
    top: 10px;
    /* Initial position */
    border-radius: 2px;
    transition: top 3s linear;
    /* Smooth slide matching game animation */
}

/* Level Complete Panel */
.status-panel {
    background: rgba(15, 52, 96, 0.5);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    text-align: center;
    border: 1px solid var(--highlight-color);
    animation: fadeIn 0.5s ease;
}

.status-panel.hidden {
    display: none;
}

.status-message {
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1rem;
}

#restart-btn {
    background: var(--highlight-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 0.3rem;
    cursor: pointer;
    font-family: var(--font-main);
    width: 100%;
    transition: background 0.2s;
}

#restart-btn:hover {
    background: #ff5e78;
}

/* BG Select */
#bg-select {
    width: 100%;
    background: #fff;
    /* Solid white background for max readability */
    color: #000;
    /* Solid black text */
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 0.4rem;
    font-family: var(--font-main);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
}

#bg-select:hover {
    background: #eee;
}

#bg-select option {
    background: #fff;
    color: #000;
}

/* Modals */
#url-modal,
#dev-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#url-modal.hidden,
#dev-modal.hidden {
    display: none;
}

.modal-content {
    background: #16213e;
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--highlight-color);
    text-align: center;
    width: 300px;
}

.settings-modal {
    width: 350px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    color: white;
}

.setting-row label {
    text-align: left;
    margin-right: 1rem;
    font-size: 0.9rem;
    min-width: 120px;
}

.setting-row input {
    cursor: pointer;
    flex-grow: 1;
}

/* ... keep modal content styles same ... */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}