body.boot-lock {
    overflow: hidden;
    background: #030806;
}

body .app-shell,
body .mobile-fire-summary {
    transition: opacity 600ms ease, transform 600ms ease;
}

body.boot-lock .app-shell,
body.boot-lock .mobile-fire-summary {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.boot-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
    overflow: hidden;
    color: #83ffba;
    background:
        radial-gradient(circle at 50% 43%, rgba(67, 230, 208, 0.075), transparent 52%),
        #030806;
    opacity: 0;
    transition: opacity 600ms ease;
}

.boot-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(79, 255, 169, 0.055) 4px, transparent 5px);
    opacity: 0.62;
}

.boot-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.92);
}

.boot-overlay.is-running { opacity: 1; }
.boot-overlay.is-leaving { opacity: 0; pointer-events: none; }
.boot-overlay.is-leaving .boot-brand,
.boot-overlay.is-leaving .boot-terminal,
.boot-overlay.is-leaving .boot-welcome { opacity: 0; }

.boot-brand,
.boot-terminal,
.boot-welcome {
    position: relative;
    z-index: 1;
    grid-area: 1 / 1;
    width: min(100%, 520px);
}

.boot-brand {
    display: grid;
    place-items: center;
    opacity: 1;
    transform: scale(1);
    transition: opacity 520ms ease, transform 620ms ease;
}

.boot-brand-logo {
    display: block;
    width: min(62vw, 310px);
    height: auto;
    object-fit: contain;
}

.boot-terminal {
    display: flex;
    flex-direction: column;
    min-height: min(70vh, 610px);
    opacity: 0;
    transform: scale(1.015);
    transition: opacity 480ms ease, transform 560ms ease;
}

.boot-terminal-head,
.boot-progress-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.boot-terminal-head {
    padding-bottom: 12px;
    border-bottom: 1px solid #245c49;
    color: #43e6d0;
    font-family: "Courier New", Consolas, monospace;
    font-size: clamp(0.68rem, 2.8vw, 0.82rem);
    letter-spacing: 0.1em;
}

.boot-live {
    color: #df2d2d;
    text-shadow: 0 0 10px rgba(223, 45, 45, 0.72);
}

.boot-log {
    flex: 1;
    min-height: 0;
    padding: 20px 0 12px;
    overflow: hidden;
    font-family: "Courier New", Consolas, monospace;
    font-size: clamp(0.7rem, 3vw, 0.86rem);
}

.boot-line {
    margin: 0 0 10px;
    color: #83ffba;
    opacity: 0;
    transform: translateY(7px);
    animation: boot-line-in 170ms ease forwards;
}

.boot-line span { color: #df2d2d; }
.boot-line.is-pass span { color: #59f4ba; }

.boot-progress-track {
    height: 4px;
    overflow: hidden;
    background: #10241c;
}

.boot-progress-bar {
    display: block;
    width: 0;
    height: 100%;
    background: #df2d2d;
    box-shadow: 0 0 14px rgba(223, 45, 45, 0.75);
    transition: width 150ms linear;
}

.boot-progress-copy {
    padding-top: 10px;
    color: #6d9f8c;
    font-family: "Courier New", Consolas, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.boot-welcome {
    display: grid;
    place-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(24px);
    pointer-events: none;
    transition: opacity 650ms ease, transform 760ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.boot-logo {
    display: block;
    width: min(68vw, 310px);
    height: auto;
    margin: 0 auto 26px;
    object-fit: contain;
}

.boot-welcome-title {
    margin: 0;
    color: #df2d2d;
    font-family: "Courier New", Consolas, monospace;
    font-size: clamp(1rem, 4.8vw, 1.35rem);
    font-weight: 700;
    letter-spacing: 0.13em;
    text-shadow: 0 0 14px rgba(223, 45, 45, 0.55);
}

.boot-welcome-subtitle {
    margin: 10px 0 0;
    color: #59f4ba;
    font-family: "Courier New", Consolas, monospace;
    font-size: clamp(0.66rem, 3vw, 0.82rem);
    letter-spacing: 0.17em;
}

.boot-overlay.is-welcome .boot-brand,
.boot-overlay.is-welcome .boot-terminal {
    opacity: 0;
    transform: scale(0.985);
    pointer-events: none;
}

.boot-overlay.is-terminal .boot-brand {
    opacity: 0;
    transform: scale(1.035);
    pointer-events: none;
}

.boot-overlay.is-terminal .boot-terminal {
    opacity: 1;
    transform: scale(1);
}

.boot-overlay.is-welcome .boot-welcome {
    opacity: 1;
    transform: translateY(0);
}

@keyframes boot-line-in {
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 430px) {
    .boot-terminal { min-height: min(76vh, 560px); }
    .boot-brand-logo { width: min(68vw, 280px); }
    .boot-logo { width: min(72vw, 280px); }
}

@media (prefers-reduced-motion: reduce) {
    .boot-overlay,
    .boot-brand,
    .boot-terminal,
    .boot-welcome,
    .boot-progress-bar,
    body .app-shell,
    body .mobile-fire-summary {
        transition-duration: 1ms !important;
    }
    .boot-line { animation-duration: 1ms !important; }
}
