/* Preferences UI */
#prefs-gear {
    position: fixed;
    top: 26px;
    left: 20px;
    width: 19px;
    height: 19px;
    cursor: pointer;
    z-index: 1000;
    color: #999; /* Medium gray */
}

.prefs-content-tippy {
    padding: 10px;
    font-family: serif;
    text-align: left;
}

.prefs-content-tippy .prefs-option {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.prefs-content-tippy .prefs-option:last-child {
    margin-bottom: 0;
}

.prefs-content-tippy .prefs-option input {
    margin-right: 8px;
    transform: scale(1.2);
}

.prefs-content-tippy .prefs-option label {
    font-size: 14px;
    color: #f0f0f0;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

body.transitions-enabled #stage-container,
body.transitions-enabled #game-container {
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1), margin 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

#main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#stage-container,
#game-container {
    transform-origin: top center !important;
    touch-action: none;
}

/* Force hardware acceleration and expand paint bounds on scaled elements
   to prevent rendering artifacts (ghosting/tearing) during motion at large scales */
#stage-container *,
#game-container * {
    outline: 1px solid transparent;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

#stage-container *:focus-visible,
#game-container *:focus-visible {
    outline: -webkit-focus-ring-color auto 2px;
    outline-offset: 2px;
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -50px;
    left: 10px;
    background: #000;
    color: #fff;
    padding: 8px 12px;
    z-index: 9999;
    border: 1px solid #fff;
    transition: top 0.2s;
    text-decoration: none;
}

.skip-link:focus {
    top: 10px;
}

.title-img {
    transform: translateY(-2px);
}



/* Mobile Adjustments */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    /* Touch targets */
    .nav-links a,
    .footer-bar a {
        padding: 12px;
        margin: 0;
        display: inline-block;
    }
    
    #prefs-gear {
        padding: 12px;
        margin: 0;
        width: 20px;
        height: 20px;
        top: 0px;
        left: 0px;
    }
    
    .prefs-full-screen {
        display: none !important;
    }
    
    .footer-bar {
        font-size: 1.1rem;
        padding-bottom: 20px;
    }
    
    #layout-container,
    .home-layout {
        margin-top: 15px;
    }
}

.audio-unlock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    cursor: pointer;
}

.audio-unlock-overlay .prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    font-family: 'Courier New', Courier, monospace;
    -webkit-text-stroke: 0.3px currentColor;
    font-size: 22px;
    color: #fff;
    text-shadow: 0px 0px 4px #000;
}


#stage-container, #game-container, #stage {
    position: relative;
}

