/* ── Launch page title — mission terminal typewriter ─────── */
.pg-launch-terminal
{
    margin: 0 0 18px;
}
.pg-launch-terminal__frame
{
    border: 3px solid #262f3f;
    outline: 2px solid #67BAEA;
    border-radius: 6px;
    background: #050a10;
    padding: 10px 14px 12px;
    box-shadow: inset 0 0 24px rgba(0, 192, 112, 0.06);
}
.pg-launch-terminal__prompt
{
    margin: 0 0 8px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    color: #515965;
}
.pg-launch-terminal__screen
{
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.2em;
    padding: 10px 12px;
    border-top: 1px solid rgba(0, 192, 112, 0.25);
    border-bottom: 1px solid rgba(0, 192, 112, 0.25);
    background:
        repeating-linear-gradient(
            0deg,
            rgba(0, 192, 112, 0.03) 0,
            rgba(0, 192, 112, 0.03) 1px,
            transparent 1px,
            transparent 3px
        ),
        #03070c;
}
.pg-launch-terminal__line
{
    display: inline-block;
    max-width: 100%;
    text-align: center;
    font-family: "Orbitron", "Courier New", monospace;
    font-size: clamp(0.68rem, 2.2vw, 0.92rem);
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.06em;
    color: #00C070;
    text-shadow: 0 0 8px rgba(0, 192, 112, 0.45);
    word-break: break-word;
}
.pg-launch-terminal__cursor
{
    display: inline-block;
    width: 0.45em;
    height: 1.05em;
    margin-left: 2px;
    background: #00C070;
    box-shadow: 0 0 6px rgba(0, 192, 112, 0.65);
    animation: pgTerminalCursor 1s step-end infinite;
    vertical-align: -0.12em;
}
@keyframes pgTerminalCursor
{
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}
.pg-launch-terminal__status
{
    margin: 8px 0 0;
    text-align: center;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.58rem;
    letter-spacing: 0.04em;
    color: #67BAEA;
    opacity: 0.85;
}

body.pg-light .pg-launch-terminal__frame
{
    background: #0f1620;
    border-color: #9eb0c2;
}
body.pg-light .pg-launch-terminal__screen
{
    background:
        repeating-linear-gradient(
            0deg,
            rgba(0, 192, 112, 0.04) 0,
            rgba(0, 192, 112, 0.04) 1px,
            transparent 1px,
            transparent 3px
        ),
        #060d14;
}

.launch-board
{
    position: relative;
    background:
        radial-gradient(circle at 18% 12%, rgba(103,186,234,0.18), transparent 38%),
        radial-gradient(circle at 82% 0%, rgba(0,192,112,0.14), transparent 32%),
        #050a14;
    border: 10px solid #262f3f;
    outline: 3px solid #67BAEA;
    border-radius: 8px;
    padding: 28px 24px 28px;   /* no massive bottom gap - rocket lives in its zone */
    text-align: center;
    overflow: hidden;
}

/* Stars generated by JS */
.launch-stars
{
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.star
{
    position: absolute;
    border-radius: 50%;
    background: #fff;
    animation: starTwinkle var(--tw-dur, 3s) var(--tw-delay, 0s) ease-in-out infinite alternate both;
}
@keyframes starTwinkle
{
    0%   { opacity: var(--tw-lo, 0.12); }
    100% { opacity: var(--tw-hi, 0.9); }
}

.launch-header
{
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    color: #85C8EE;
    font-family: "Orbitron", "Montserrat", sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    margin-bottom: 18px;
}
.launch-live
{
    justify-self: start;
    color: #00C070;
    text-align: left;
}
.launch-live i
{
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00C070;
    margin-right: 6px;
    animation: livePulse 1.2s ease infinite;
}
.launch-venue
{
    justify-self: center;
    text-align: center;
    color: #85C8EE;
}
#launch-clock
{
    justify-self: end;
    text-align: right;
}

@keyframes livePulse
{
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.launch-kicker
{
    position: relative;
    z-index: 1;
    color: #49BCB3;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 10px;
}
.launch-name
{
    position: relative;
    z-index: 1;
    font-family: "Orbitron", "Montserrat", sans-serif;
    color: #fff;
    font-weight: 700;
    font-size: clamp(1.5rem, 4.4vw, 3.2rem);
    line-height: 1.2;
    min-height: 2.4em;
    margin: 0 0 10px;
    text-shadow: 0 0 24px rgba(103, 186, 234, 0.45);
    word-break: break-word;
}
.launch-name.is-reveal
{
    animation: launchFlash 0.6s ease;
}
@keyframes launchFlash
{
    0% { filter: brightness(3); transform: scale(1.04); }
    100% { filter: brightness(1); transform: scale(1); }
}

/* Copy button - height reserved so show/hide never shifts the board */
.launch-copy-wrap
{
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.launch-copy-wrap .pg-copy
{
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.launch-copy-wrap.is-ready .pg-copy
{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.launch-tagline
{
    position: relative;
    z-index: 1;
    color: #bfbfbf;
    font-size: 1rem;
    margin-bottom: 8px;
    opacity: 1;
    transition: opacity 0.45s ease;
}
.launch-tagline.is-hidden
{
    opacity: 0;
}
.launch-tagline.is-visible
{
    opacity: 1;
}

/* ── ROCKET ZONE ─────────────────────────────────────────── */
.launch-rocket-zone
{
    position: relative;
    z-index: 0;
    height: 172px;
    pointer-events: none;
    overflow: visible;  /* rocket flies past zone boundary; board's overflow:hidden clips it */
}

.launch-rocket
{
    position: absolute;
    bottom: 0;
    left: 50%;
    margin-left: -44px;
    width: 88px;
    pointer-events: none;
    opacity: 0.5;
}
/* SC colour palette */
.rocket-hull       { fill: #67BAEA; }
.rocket-hull-shade { fill: #3a8fbf; opacity: 0.45; }
.rocket-nose       { fill: #85C8EE; }
.rocket-fin        { fill: #00C070; }
.rocket-fin-shade  { fill: #007a46; opacity: 0.5; }
.rocket-stripe     { fill: #fff; opacity: 0.6; }
.rocket-window     { fill: #050a14; stroke: #fff; stroke-width: 2; }
.rocket-window-shine { fill: #fff; opacity: 0.5; }
.rocket-nozzle     { fill: #262f3f; }
.rocket-nozzle-ring { fill: #515965; }

.rocket-svg
{
    display: block;
    width: 88px;
    height: 160px;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,0.55));
}

.rocket-exhaust
{
    position: absolute;
    left: 50%;
    top: 156px;
    width: 44px;
    margin-left: -22px;
    height: 70px;
    opacity: 0;
    pointer-events: none;
}
.flame
{
    position: absolute;
    left: 50%;
    top: 0;
    border-radius: 40% 40% 50% 50%;
    transform: translateX(-50%);
}
.flame-core  { width: 10px; height: 26px; background: #fff8d0; box-shadow: 0 0 10px #fff; }
.flame-mid   { width: 20px; height: 40px; background: linear-gradient(#ffe566, #ff7a18); opacity: 0.95; }
.flame-outer { width: 28px; height: 54px; background: linear-gradient(rgba(255,122,24,0.9), rgba(103,186,234,0.05)); opacity: 0.85; }
.spark
{
    position: absolute;
    left: 50%;
    top: 16px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ffd56a;
    box-shadow: 0 0 5px #ff7a18;
    opacity: 0;
}

/* ── GENERATE / LAUNCH button inside the board ───────────── */
.launch-generate
{
    position: relative;
    z-index: 1;
    margin-top: 8px;
}
.launch-generate .btn
{
    min-width: 180px;
}

/* ── LIFTOFF ANIMATIONS ──────────────────────────────────── */
.launch-board.is-liftoff .launch-rocket
{
    /* Slowed from 1.45s → 2.4s for dramatic effect */
    animation: rocketOut 2.4s cubic-bezier(0.2, 0.0, 0.8, 1.0) forwards;
}
.launch-board.is-liftoff .rocket-exhaust  { opacity: 1; }
.launch-board.is-liftoff .flame           { animation: flameFlicker 0.12s linear infinite; }
.launch-board.is-liftoff .spark:nth-child(4)  { animation: sparkFly 0.44s linear infinite; }
.launch-board.is-liftoff .spark:nth-child(5)  { animation: sparkFly 0.54s linear 0.06s infinite; left: 28%; }
.launch-board.is-liftoff .spark:nth-child(6)  { animation: sparkFly 0.38s linear 0.11s infinite; left: 72%; }
.launch-board.is-liftoff .spark:nth-child(7)  { animation: sparkFly 0.62s linear 0.08s infinite; left: 40%; }
.launch-board.is-liftoff .spark:nth-child(8)  { animation: sparkFly 0.49s linear 0.17s infinite; left: 63%; }
.launch-board.is-liftoff .spark:nth-child(9)  { animation: sparkFly 0.36s linear 0.21s infinite; left: 20%; }
.launch-board.is-liftoff .spark:nth-child(10) { animation: sparkFly 0.47s linear 0.13s infinite; left: 80%; }
.launch-board.is-liftoff .spark:nth-child(11) { animation: sparkFly 0.57s linear 0.19s infinite; left: 50%; }

.launch-rocket.is-away { visibility: hidden; }

@keyframes flameFlicker
{
    0%   { transform: translateX(-50%) scaleY(0.85) scaleX(1.06); }
    50%  { transform: translateX(-50%) scaleY(1.16) scaleX(0.91); }
    100% { transform: translateX(-50%) scaleY(0.90) scaleX(1.00); }
}
@keyframes sparkFly
{
    0%   { opacity: 1;   transform: translate(-50%, 0) scale(1);   }
    100% { opacity: 0;   transform: translate(-50%, 48px) scale(0.35); }
}
@keyframes rocketOut
{
    0%   { bottom: 0;      opacity: 0.5; }
    8%   { bottom: 0;      opacity: 1; }
    100% { bottom: 1200px; opacity: 1; }
}

/* ── DAY / LIGHT MODE (Launch Control) ───────────────────── */
body.pg-light .launch-board
{
    background:
        radial-gradient(circle at 20% 10%, rgba(255,255,255,0.85), transparent 40%),
        radial-gradient(circle at 80% 0%, rgba(103,186,234,0.45), transparent 42%),
        linear-gradient(180deg, #7ec8f0 0%, #b8dff5 42%, #e8f4fc 72%, #f6e7c6 100%);
    border-color: #9bb8cc;
    outline-color: #49BCB3;
}
body.pg-light .star
{
    background: #fff;
    box-shadow: 0 0 4px rgba(255,255,255,0.8);
}
body.pg-light .launch-header { color: #003C5E; }
body.pg-light .launch-venue { color: #003C5E; }
body.pg-light .launch-live { color: #007a46; }
body.pg-light .launch-live i { background: #00C070; }
body.pg-light .launch-kicker { color: #007a46; }
body.pg-light .launch-name
{
    color: #003C5E;
    text-shadow: 0 2px 12px rgba(255,255,255,0.55);
}
body.pg-light .launch-tagline { color: #3a5568; }
body.pg-light .rocket-hull { fill: #fff; }
body.pg-light .rocket-nose { fill: #e8f4fc; }
body.pg-light .rocket-hull-shade { fill: #c5d8e8; }
body.pg-light .pg-log-modal-name
{
    font-family: "Orbitron", "Montserrat", sans-serif;
    text-shadow: none;
}

@media (max-width: 700px)
{
    .launch-header
    {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .launch-live,
    .launch-venue,
    #launch-clock { justify-self: center; text-align: center; }
}
