/* Global Refets */
:root {
    --primary-color: #FFB7B2;
    --secondary-color: #B5EAD7;
    --accent-color: #E2F0CB;
    --text-color: #FF9AA2;
    --font-family: 'Fredoka', sans-serif;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: var(--font-family);
}

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

/* Canvas fills the screen, mirrored for intuitive feeling */
canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* transform: scaleX(-1);  <-- Removed, handled in JS */
    z-index: 1;
}

/* Feedback Overlay - Centered, Large, Fun */
.feedback-text {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Start centered */
    font-size: 5rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 4px 0 #FF9AA2, 0 0 20px rgba(255, 255, 255, 0.5);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    /* Since the parent/canvas is mirrored, text might appear backwards if not handled carefully.
       If we attach this to body, it's not mirrored. 
       If we attach to something with scaleX(-1), it will be backwards.
       Currently attached to .app-container which is NOT mirrored. Good.
    */
}

.feedback-text.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

/* Timer Display */
.timer-float {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 4rem;
    font-weight: 800;
    color: #B5EAD7;
    /* Start Green */
    z-index: 15;
    text-shadow: 2px 2px 0px #000, 0 0 10px rgba(0, 0, 0, 0.2);
    font-family: 'Fredoka', sans-serif;
    transition: color 1s linear;
}

.timer-float.danger {
    color: #FF9AA2;
    /* Red */
    animation: pulse-red 0.5s infinite alternate;
}

@keyframes pulse-red {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

.hidden {
    opacity: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #FFDAC1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #fff;
    border-top: 5px solid #FF9AA2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}