/* =========================================================================
   EMBED ON THE IQ BOOKS STAGE  (html.ciq-embed, set by ?ciqEmbed=iqbooks)
   =========================================================================
   CodeIQ opens inside an IQ Books overlay rather than as its own page. The
   host supplies the outer chrome — the title, the organisation, the way out —
   so the duplicated pieces stand down here. Standalone loads never carry the
   parameter and are untouched by everything below.
   ========================================================================= */

/* Identity belongs to the host: it already names the account and owns signing
   out. A Sign Out inside the frame would leave IQ Books logged in around a
   logged-out CodeIQ. */
html.ciq-embed .user-menu { display: none; }

/* The language selector is a fixed flag button at top:12px right:12px with
   z-index 10000, and the Posting Center panel is z-index 1040 — so the flag
   sat directly on top of the panel's minimise and close buttons and you could
   not hit either. IQ Books has no language selector of its own, so inside the
   stage it simply goes. */
html.ciq-embed #language-selector { display: none; }

/* The host's stage bar already carries "Back to IQ Books". */
html.ciq-embed .splash-skip-hint { opacity: 0.55; }

/* The footer itself stays — it carries RiQ. But its shortcut back to IQ Books
   is pointing at the page this frame is sitting on. */
html.ciq-embed #ciqIqbLink { display: none; }

/* -------------------------------------------------------------------------
   Boot readout — the live status the power-up sequence narrates.
   The animation is CodeIQ's existing splash; this is the part that tells the
   truth about it, driven by the real initialisation job rather than a timer.
   ------------------------------------------------------------------------- */

html.ciq-embed .ciq-boot-status {
    position: absolute;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);
    width: min(460px, 78vw);
    text-align: center;
    opacity: 0;
    animation: ciqBootStatusIn 0.8s ease 2.6s forwards;
}

@keyframes ciqBootStatusIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* The power-up runs on a warm near-white ground, not a dark one — ink, not
   white, or the readout is invisible on it. */
html.ciq-embed .ciq-boot-phase {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--splash-white, #1a1a1a);
    margin-bottom: 12px;
    transition: opacity 0.25s ease;
}

html.ciq-embed .ciq-boot-track {
    height: 2px;
    border-radius: 2px;
    background: rgba(26, 26, 26, 0.12);
    overflow: hidden;
}

html.ciq-embed .ciq-boot-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary-500, #c4576a), #e88fa0);
    box-shadow: 0 0 12px rgba(196, 87, 106, 0.55);
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

html.ciq-embed .ciq-boot-sub {
    margin-top: 10px;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: var(--splash-text-subtle, rgba(26, 26, 26, 0.55));
    min-height: 1.2em;
    transition: opacity 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
    html.ciq-embed .ciq-boot-status { animation: none; opacity: 1; }
    html.ciq-embed .ciq-boot-fill { transition: none; }
}
