:root {
    --bg-color: #1a0b2e;
    --accent-color: #ff007c;
    /* Carnival Pink */
    --secondary-color: #7000ff;
    /* Deep Purple */
    --gold: #ffd700;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#timer {
    font-size: 2.5rem;
}


#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    box-shadow: 0 0 50px rgba(112, 0, 255, 0.3);
    overflow: hidden;
    background: radial-gradient(circle at center, #2d1b4e 0%, #1a0b2e 100%);
}

canvas {
    display: block;
    /* Size handled by JS */
    image-rendering: pixelated;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through to canvas explicitly if needed, but buttons need events */
    z-index: 100;
}

#ui-layer>* {
    pointer-events: auto;
}

#header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

h1 {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#score-container {
    font-size: 1.2rem;
    background: var(--glass-bg);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

#controls-hint {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 0.9rem;
    opacity: 0.7;
    color: #ccc;
}

#message-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 40px 30px;
    border-radius: 6px;
    font-size: 2rem;
    color: var(--gold);
    font-weight: bold;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#message-area p {
    color: white;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
    font-size: 3rem;
    margin-bottom: 30px;
}

#message-area button {
    font-size: 1.5rem;
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('assets/sprites/start_game.jpeg');
    background-size: cover;
    background-position: center;
    backdrop-filter: blur(8px);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 100px;
}

#play-again-btn {
    margin-bottom: 20px;
}



button {
    display: block;
    padding: 17px 40px;
    border-radius: 10px;
    border: 0;
    background: linear-gradient(to bottom, rgb(255, 56, 222), rgb(216, 47, 188));
    font-size: 2rem;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    font-family: 'Arial Black', Gadget, sans-serif;
    box-shadow: rgb(161, 37, 151) 0px 10px 0px 0px;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
    text-transform: uppercase;
    color: hsl(0, 0%, 100%);
    cursor: pointer;
}

button:hover {
    scale: 1.05;
}

button:active {
    background-color: rgb(171, 38, 149);
    /*50, 168, 80*/
    box-shadow: rgb(161, 37, 151) 0px 0px 0px 0px;
    transform: translateY(5px);
    transition: 200ms;
}


.hidden {
    display: none !important;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}