/*
 * Boot screen (src/boot.js): the logo, large, and a bar, from the first paint
 * until the 3D sea behind the title is built. Linked first in <head> and
 * self-contained (no theme tokens), so it is on screen before anything else.
 */
#bootScreen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 70% 55% at 50% 42%, rgba(25, 184, 191, 0.16), transparent 70%),
        radial-gradient(ellipse 120% 80% at 50% 110%, #06414b 0%, transparent 60%),
        linear-gradient(180deg, #05202b 0%, #020c13 100%);
    opacity: 1;
    transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}
#bootScreen.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.boot-inner {
    width: min(86vw, 860px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(22px, 4vh, 44px);
    transform: translateY(-2vh);
}

.boot-logo {
    width: 100%;
    height: auto;
    aspect-ratio: 1400 / 452;
    user-select: none;
    filter: drop-shadow(0 0 28px rgba(242, 184, 75, 0.28)) drop-shadow(0 12px 30px rgba(0, 0, 0, 0.55));
    animation: bootFloat 6s ease-in-out infinite, bootIn 1.1s ease-out both;
}

.boot-bar {
    position: relative;
    width: min(70%, 520px);
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(2, 12, 19, 0.7);
    box-shadow: inset 0 0 0 1px rgba(244, 199, 94, 0.35), 0 0 18px rgba(25, 184, 191, 0.18);
    animation: bootIn 1.1s ease-out 0.2s both;
}
.boot-fill {
    position: absolute;
    inset: 0;
    transform-origin: 0 50%;
    transform: scaleX(0);
    border-radius: inherit;
    background: linear-gradient(90deg, #b97a1c 0%, #f4c75e 45%, #fff1bd 62%, #3fd0cf 80%, #149aa6 100%);
    background-size: 100% 100%;
}
.boot-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
    background-size: 40% 100%;
    background-repeat: no-repeat;
    animation: bootShine 1.8s linear infinite;
}

.boot-meta {
    width: min(70%, 520px);
    margin-top: calc(clamp(22px, 4vh, 44px) * -0.6);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-size: 13px;
    letter-spacing: 0.12em;
    color: rgba(226, 252, 248, 0.72);
    animation: bootIn 1.1s ease-out 0.3s both;
}
.boot-pct {
    color: #f4c75e;
    font-variant-numeric: tabular-nums;
}

@keyframes bootFloat {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -8px; }
}
@keyframes bootIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
@keyframes bootShine {
    from { background-position: -40% 0; }
    to   { background-position: 140% 0; }
}

/* Loaded: the bar fades and «Press to start» takes its place */
#bootScreen.is-ready { cursor: pointer; }
#bootScreen.is-ready .boot-bar,
#bootScreen.is-ready .boot-meta { animation: bootOut 0.5s ease both; }

.boot-press {
    margin-top: calc(clamp(22px, 4vh, 44px) * -1.6);
    padding: 10px 28px;
    border: 0;
    background: none;
    cursor: pointer;
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-size: clamp(16px, 2.1vw, 22px);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #f4c75e;
    text-shadow: 0 0 18px rgba(242, 184, 75, 0.45), 0 2px 8px rgba(0, 0, 0, 0.6);
    animation: bootIn 0.6s ease-out both, bootPulse 2.2s ease-in-out 0.6s infinite;
}
.boot-press:focus { outline: none; }
.boot-press:focus-visible { outline: 1px solid rgba(244, 199, 94, 0.5); outline-offset: 6px; }

@keyframes bootOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes bootPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .boot-logo, .boot-bar, .boot-meta, .boot-fill::after, .boot-press { animation: none; }
    #bootScreen.is-ready .boot-bar, #bootScreen.is-ready .boot-meta { animation: none; opacity: 0; }
    #bootScreen { transition: none; }
}
