/*

$N64X GBA Player — player chrome.

Loaded after main.css and retro.css. main.css is upstream IodineGBA layout;
this file supplies the 8-bit skin, the boot overlay, and the error panel.

*/


/*
|-----------------------------------------
| Menu bar
|-----------------------------------------
*/

.menu {
    background: var(--void-2);
    border-bottom: 3px solid var(--line);
    box-shadow: none;
    font-family: var(--mono);
    align-items: center;
}

#menu_top > li {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-dim);
    background: transparent;
    transition: color var(--snap), background var(--snap);
}

#menu_top > li:hover { color: var(--ink); background: var(--void-3); }

.menu ul {
    background: var(--void-2);
    border: 2px solid var(--line);
    box-shadow: var(--shadow-hard);
}

.menu ul li {
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--ink-dim);
    background: transparent;
}

.menu ul li:hover { color: var(--ink); background: var(--void-3); }

#logo-small {
    height: 32px;
    width: 32px;
    image-rendering: auto;
    display: block;
}

.menu a,
.menu a:visited { color: var(--magenta); text-decoration: none; }

.menu input[type="range"] { accent-color: var(--magenta); }
.menu input[type="checkbox"] { accent-color: var(--magenta); }


/*
|-----------------------------------------
| Boot overlay
|-----------------------------------------
|
| Covers the canvas until the player provides the gesture that both the
| browser (for audio) and the emulator (which never auto-starts) require.
*/

.boot {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--u6);
    background: var(--void);
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0 1px,
        transparent 1px 3px
    );
}

.boot--gone {
    opacity: 0;
    transition: opacity 200ms steps(4, end);
    pointer-events: none;
}

.boot__panel {
    width: min(520px, 100%);
    text-align: center;
}

.boot__back {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: var(--u8);
    transition: color var(--snap);
}

.boot__back:hover { color: var(--magenta); }

.boot__title {
    font-family: var(--display);
    font-size: clamp(1.5rem, 6vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0 0 var(--u4);
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.9);
}

.boot__status {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin: 0 0 var(--u3);
    min-height: 1.4em;
}

.boot__track {
    height: var(--u3);
    background: var(--void-3);
    border: 2px solid var(--line);
    margin-bottom: var(--u8);
    overflow: hidden;
}

.boot__bar {
    height: 100%;
    width: 0;
    background: var(--magenta);
    /* Stepped so the bar advances in visible chunks, like a loading meter. */
    transition: width 200ms steps(8, end);
}

.boot__bar--indeterminate {
    background: repeating-linear-gradient(
        90deg,
        var(--magenta) 0 8px,
        var(--void-3) 8px 16px
    );
}

.boot__prompt {
    font-family: var(--display);
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--acid);
    background: transparent;
    border: 0;
    padding: var(--u3) var(--u6);
    cursor: pointer;
}

.boot__prompt:hover { color: var(--ink); }

.boot__hint {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: var(--u8) 0 0;
}


/*
|-----------------------------------------
| Error panel
|-----------------------------------------
|
| Replaces alert("Invalid game request!"), which blocked the page and any
| automation behind a modal the player could not dismiss meaningfully.
*/

#loaderError {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--u3);
    padding: var(--u6);
    text-align: center;
    background: var(--void);
    color: var(--ink);
}

#loaderError h2 {
    font-family: var(--display);
    font-size: clamp(1.4rem, 5vw, 2.25rem);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--red);
    margin: 0;
}

#loaderError p {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--ink-dim);
    max-width: 46ch;
    margin: 0;
}

.loader-error__back {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--magenta);
    border: 2px solid var(--magenta);
    padding: var(--u2) var(--u4);
    margin-top: var(--u4);
    transition: color var(--snap), background var(--snap);
}

.loader-error__back:hover { background: var(--magenta); color: var(--void); }


/*
|-----------------------------------------
| Transient messages
|-----------------------------------------
*/

.message,
#tempMessage {
    background: var(--void-2);
    border-top: 3px solid var(--acid);
    padding: var(--u3) var(--u6);
    color: var(--acid);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 400;
    text-align: center;
    position: fixed;
    left: 0;
    bottom: 0;
    display: none;
    z-index: 400;
}

#loadedGameMsg {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--u6);
    text-align: center;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-dim);
    z-index: 400;
    pointer-events: none;
}


/*
 Embedded in the $N64X cabinet: the parent frame draws the boot screen, so hide
 this one. It must stay in the DOM and stay clickable — XAudioServer binds its
 WebAudio setup to #bootStart, and hiding it with display:none would still allow
 .click() but removing it would break audio entirely.
*/
.boot--embedded {
    opacity: 0;
    pointer-events: none;
}

/* The cabinet supplies its own chrome; the legacy menu bar would be a second one. */
body.is-embedded #menu { display: none; }
body.is-embedded #main { top: 0; }

.loader-error__note {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    max-width: 44ch;
    margin: 0;
}
