:root {
    --primary: #ff4757;
    --accent: #2ed573;
    --glass: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    background-color: #000;
    color: white;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror camera */
}

#overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: scaleX(-1); /* Mirror canvas to match camera */
}

#hud {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 10;
}

.hud-item {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    box-shadow: var(--shadow);
}

.label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
    opacity: 0.8;
}

#score, #level {
    font-size: 1.5rem;
    font-weight: 700;
}

#lives-icons {
    display: flex;
    gap: 5px;
    font-size: 1.2rem;
}

#mute-toggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
}

#mute-toggle:hover {
    transform: scale(1.1);
}

#game-over {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s;
}

.modal {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 90%;
}

.modal h1 {
    font-size: 3rem;
    margin: 0 0 10px 0;
    color: var(--primary);
}

.modal p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

#restart-btn {
    background: var(--accent);
    color: black;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

#restart-btn:hover {
    transform: scale(1.05);
    background: #25c165;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes caught {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); color: var(--accent); }
    100% { transform: scale(1); }
}

.score-animate {
    animation: caught 0.3s ease-out;
}