: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: 200px;
    /* Fixed width, roughly half of previous min-width 300+ */
    min-width: 200px;
    background: #16213e;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    /* Reduced padding */
    gap: 1.5rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

#office-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('office_bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.8;
}

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.8rem;
    width: 100%;
    height: 40px;
    /* Smaller tools */
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
    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);
}

/* 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;
}

/* URL Modal */
#url-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 {
    display: none;
}

.modal-content {
    background: #16213e;
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--highlight-color);
    text-align: center;
    width: 300px;
}

/* ... keep modal content styles same ... */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}