: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: 250px;
    min-width: 250px;
    max-width: 250px;
    flex-shrink: 0;
    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;
    overflow-y: auto;
    /* Allow scrolling if crammed */
}

/* 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 */
    opacity: 0.5;
    /* Fainter interior */
}

.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.7;
    /* More prominent reflection */
    /* 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 - Narrow Icon Bar */
.sidebar {
    width: 70px;
    /* Narrow strip */
    min-width: 70px;
    max-width: 70px;
    flex-shrink: 0;
    background: #16213e;
    display: flex;
    flex-direction: column;
    padding: 1rem 0.5rem;
    /* Less padding */
    gap: 1rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    z-index: 20;
    /* Higher than game */
    align-items: center;
    overflow-y: auto;
    /* Allow scrolling if crammed */
}

.sidebar-header h1,
.sidebar-header .subtitle,
.sidebar-section h2 {
    display: none;
    /* Hide text elements in narrow sidebar */
}

/* Tool Belt - Vertical in Sidebar */
#tool-belt {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: center;
    flex: 1;
}

.sidebar-spacer {
    flex: 1;
    /* Push bottom items down */
}

.tool {
    display: flex;
    flex-direction: column;
    /* Stack if we had text, but we don't */
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.1s ease;
    border: 2px solid rgba(255, 255, 255, 0.05);
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.tool:active {
    transform: scale(0.95);
}

.tool.active {
    background: var(--highlight-color);
    border-color: var(--highlight-color);
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.6);
}

.tool .icon {
    font-size: 1.8rem;
    margin: 0;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

.tool .label,
.tool .key {
    display: none;
    /* Hide labels/keys for clean look */
}

/* Mini Tool specific */
.tool-mini {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tool-mini:hover {
    opacity: 1;
}

/* Overlay UI */
/* Overlay UI */
#game-ui-overlay {
    position: absolute;
    top: 50%;
    right: 20px;
    left: auto;
    transform: translateY(-50%);
    pointer-events: none;
    /* Click through */
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.score-display {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 10px;
    /* Halved from 20px */
    border-radius: 10px;
    /* Halved from 20px */
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 60px;
    /* Halved from 120px */
}

.score-display .value {
    font-size: 1.25rem;
    /* Halved from 2.5rem */
    font-weight: 800;
    color: #fff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
    /* Reduced spacing */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.score-display .label {
    font-size: 0.4rem;
    /* Halved from 0.8rem */
    color: var(--highlight-color);
    font-weight: bold;
    letter-spacing: 1px;
    margin-top: 2px;
    margin-left: 0;
}


/* Location Selector Hack */
#bg-select-mini {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    /* Invisible but clickable */
    cursor: pointer;
}


/* Level Complete Panel - Centered Overlay */
/* User requested "completion window half the size" */
.status-panel {
    position: absolute;
    top: 50%;
    right: 80px;
    /* Force right alignment, clear of sidebar (70px) + margin */
    left: auto;
    transform: translateY(-50%);
    /* Only center vertically */
    background: rgba(22, 33, 62, 0.95);
    padding: 1rem;
    /* Halved from 2rem */
    border-radius: 0.5rem;
    /* Halved from 1rem */
    text-align: center;
    border: 2px solid var(--highlight-color);
    animation: fadeInRight 0.5s ease;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    /* Reduced shadow */
    min-width: 125px;
    /* Halved from 250px */
}

.status-panel.hidden {
    display: none;
}

.status-message {
    color: #fff;
    font-weight: bold;
    font-size: 0.8rem;
    /* Almost halved from 1.5rem */
    /* Larger */
    margin-bottom: 0.75rem;
    /* Halved */
    letter-spacing: 0.05rem;
}

#restart-btn {
    background: var(--highlight-color);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    /* Halved from 0.8rem 2rem */
    font-size: 0.6rem;
    /* Halved from 1.1rem approx */
    border-radius: 1rem;
    /* Pill shape */
    cursor: pointer;
    font-family: var(--font-main);
    width: auto;
    /* Nature width */
    transition: all 0.2s;
    text-transform: uppercase;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(233, 69, 96, 0.4);
}

#restart-btn:hover {
    background: #ff5e78;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(233, 69, 96, 0.6);
}

/* Modals */
#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;
}

#dev-modal {
    position: fixed;
    /* Fixed to stay on screen, but positioned by JS */
    /* No background dimming for popover feel */
    background: transparent;
    display: block;
    /* Not flex center anymore */
    width: auto;
    height: auto;
    z-index: 110;
    pointer-events: none;
    /* Let clicks pass through outside content */
}

#dev-modal .modal-content {
    pointer-events: auto;
    /* Re-enable clicks on content */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--highlight-color);
    margin: 0;
    /* Remove potential auto margins */
}

#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 fadeInRight {
    from {
        opacity: 0;
        transform: translate(50px, -50%);
    }

    to {
        opacity: 1;
        transform: translate(0, -50%);
    }
}