: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: radial-gradient(circle at center, #16213e, #1a1a2e);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through to canvas */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
}

h1 {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    pointer-events: auto;
}

#start-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    border-radius: 1rem;
    pointer-events: auto;
}

#stats {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 2rem;
    pointer-events: auto;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-box .label {
    font-size: 0.8rem;
    opacity: 0.6;
    letter-spacing: 0.1rem;
}

.stat-box .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--highlight-color);
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

#tool-belt {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    padding: 0;
    pointer-events: auto;
}

.tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tool:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.tool.active {
    background: var(--highlight-color);
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.4);
}

.tool .icon {
    font-size: 0.9rem;
}

.tool .key {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #000;
    color: #fff;
    font-size: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#level-complete {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 52, 96, 0.95);
    padding: 3rem;
    border-radius: 2rem;
    text-align: center;
    border: 2px solid var(--highlight-color);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

#level-complete.hidden {
    display: none;
}

#level-complete h2 {
    font-size: 2.5rem;
    color: #fff;
    margin: 0;
}

#level-complete .score-final {
    font-size: 4rem;
    font-weight: 700;
    color: var(--highlight-color);
}

#restart-btn {
    background: var(--highlight-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-family: var(--font-main);
    transition: transform 0.2s;
}

#restart-btn:hover {
    transform: scale(1.05);
    background: #ff5e78;
}