:root {
    --panel-bg: rgba(0, 0, 0, 0.45);
    --panel-border: rgba(255, 255, 255, 0.2);
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    border: 0;
}

#instructions {
    position: absolute;
    top: 56px;
    left: 10px;
    max-width: min(460px, 85vw);
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.35;
    z-index: 20;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#game-container.is-playing #instructions {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

#hud {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 6px;
    z-index: 20;
}

#hud > div {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(2px);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
    min-width: 86px;
    text-align: center;
}

#countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    display: none;
    z-index: 30;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.7);
}

.utility-button {
    position: absolute;
    bottom: 14px;
    padding: 8px 14px;
    font-size: 14px;
    background-color: rgba(22, 22, 22, 0.75);
    color: white;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    cursor: pointer;
    z-index: 120;
}

#reset-button {
    left: 50%;
    transform: translateX(-50%);
}


#fullscreen-button {
    left: 10px;
    top: 10px;
    bottom: auto;
}

#music-button {
    left: 136px;
    top: 10px;
    bottom: auto;
}


@media (max-width: 768px) {
    #instructions {
        font-size: 12px;
        padding: 8px 10px;
    }

    #hud {
        left: 10px;
        right: 10px;
        grid-template-columns: repeat(4, 1fr);
    }

    #hud > div {
        min-width: 0;
        font-size: 12px;
        padding: 4px 6px;
    }

    .utility-button {
        font-size: 12px;
        padding: 6px 10px;
    }

    #music-button {
        left: 120px;
    }

}

@media (max-width: 480px) {
    #game-container.is-playing #fullscreen-button {
        opacity: 0.65;
    }
}
