:root {
    --primary: #ff4757;
    --secondary: #2f3542;
    --accent: #eccc68;
}

body {
    user-select: none;
    margin: 0;
    overflow: hidden;
    background: #222;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

video {
    display: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through empty areas */
}

/* Screen container should NOT block hits, only contents */
.screen {
    pointer-events: none;
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    /* Managed by JS */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
}

.screen.active {
    display: flex;
}

/* Interactive elements MUST capture events */
button {
    pointer-events: auto;
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.5rem;
    cursor: pointer;
    margin-top: 20px;
    border-radius: 8px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #c0392b;
    transition: transform 0.1s;
}

button:active {
    transform: translateY(4px);
    box-shadow: none;
}

h1 {
    font-size: 4rem;
    text-shadow: 3px 3px 0 #000;
    margin-bottom: 0.5rem;
}

.calibration-point {
    position: absolute;
    width: 40px;
    height: 40px;
    background: red;
    border: 3px solid white;
    border-radius: 50%;
}

/* Loading Screen Styles */
@keyframes pulse-text {
    0% {
        opacity: 0.5;
        transform: scale(0.98);
    }

    50% {
        opacity: 1;
        transform: scale(1.02);
    }

    100% {
        opacity: 0.5;
        transform: scale(0.98);
    }
}

#loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    pointer-events: none;
    /* Just in case */
}

#loading-msg {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent);
    animation: pulse-text 1.5s infinite ease-in-out;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#progress-container {
    width: 300px;
    height: 10px;
    background: #444;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid white;
    margin-top: 10px;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease-out;
}

#progress-text {
    margin-top: 5px;
    color: #ccc;
    font-size: 1rem;
}

/* Victory Screen Medal */
.medal-container {
    position: relative;
    width: 120px;
    height: 180px;
    margin: 0 auto 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: floating 3s ease-in-out infinite;
}

.medal-ribbon {
    width: 60px;
    height: 80px;
    background: linear-gradient(to right, #e74c3c 33%, #ecf0f1 33%, #ecf0f1 66%, #e74c3c 66%);
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% 80%, 0% 100%);
}

.medal-body {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #f1c40f, #f39c12);
    border: 5px solid #d35400;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    margin-top: -20px;
}

@keyframes floating {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}