.beat-meter {
    width: 100px;
    height: 20px;
    background-color: gray;
    position: relative;
    margin: 20px auto;
    border-radius: 10px;
    overflow: hidden;
}

.beat-indicator {
    width: 100%;
    height: 100%;
    background-color: red;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.1s ease-out;
    display: none; /* Hide by default */
}

.beat-meter.active .beat-indicator {
    display: block; /* Show when the meter is active */
    transform: scaleX(1); /* Play the scaling animation */
}

.feedback-text {
    position: absolute;
    font-family: 'Press Start 2P', monospace;
    font-size: 22px;
    font-weight: bold;
    color: #ffffff;
    text-shadow:
        2px 2px 0 #000000,
        -2px -2px 0 #000000,
        2px -2px 0 #000000,
        -2px 2px 0 #000000,
        0 0 8px #ffff88;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: pop-fade 1s ease-out forwards;
    z-index: 1000;
}

.pixel-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #fff;
    animation: burst 0.6s ease-out forwards;
    z-index: 999;
}

#control-screen {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    gap: 1em;
}

#start-button, #stop-button {
    padding: 1em 2em;
    font-size: 1.5em;
    cursor: pointer;
}

.floating-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    padding: 1em 2em;
    font-size: 1.5em;
    cursor: pointer;
    background-color: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

@keyframes pop-fade {
    0% { opacity: 1; transform: scale(1) translate(-50%, -50%); }
    100% { opacity: 0; transform: scale(1.5) translate(-50%, -50%); }
}

@keyframes burst {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy));
        opacity: 0;
    }
}