/* ============================================================================
 * science-reveal.css — shared "science reveal" mechanic (.sr-*)
 * A wall/grid of plaques + a centred overlay info-card. Page identity comes from
 * --sr-accent (set on <body>) and a per-page ground block. Scientist = brass
 * "Hall of Science"; future pages append their own ground + accent.
 * ========================================================================== */

/* ── THE PAGE HEADING WAS DARK-ON-DARK (fixed 2026-08-18) ────────────────────
   Measured before: h1 computed rgb(33,37,41) - the LIGHT-theme heading colour -
   over these near-black grounds = 1.24:1, and the lead rgb(85,96,107) = 2.97:1.
   Both effectively unreadable, and PRE-EXISTING: identical on the pre-conversion
   backup and the converted view.

   Same shape as the chalkboard fix (--cb-ink, batch 11b). The ink is PAGE
   FURNITURE, so it takes each page's own tint - matching the colours this file
   already uses for .sr-content h2 / .sr-lead - rather than --sr-accent, which is
   the mechanic's colour and belongs on the stage.

   ⚠️ Needs !important and the [data-theme] twin, because themes.css carries
   `body[data-theme] h1 { color: var(--theme-accent) !important }`. COLOUR ONLY. */
body.page-scientist-picker,
body.page-space-mission-picker,
body.page-galaxy-picker {
    --sr-ink: #f2efe6; --sr-ink-dim: #cbc6b8;          /* brass, the Hall default */
}
body.page-space-mission-picker { --sr-ink: #eaf4ff; --sr-ink-dim: #bacde2; }
body.page-galaxy-picker        { --sr-ink: #f1eefe; --sr-ink-dim: #c5bee0; }

body.page-scientist-picker .tool-intro h1,
body.page-space-mission-picker .tool-intro h1,
body.page-galaxy-picker .tool-intro h1,
body.page-scientist-picker[data-theme] .tool-intro h1,
body.page-space-mission-picker[data-theme] .tool-intro h1,
body.page-galaxy-picker[data-theme] .tool-intro h1 {
    color: var(--sr-ink) !important;
}
body.page-scientist-picker .tool-intro .tool-intro-lead,
body.page-space-mission-picker .tool-intro .tool-intro-lead,
body.page-galaxy-picker .tool-intro .tool-intro-lead,
body.page-scientist-picker[data-theme] .tool-intro .tool-intro-lead,
body.page-space-mission-picker[data-theme] .tool-intro .tool-intro-lead,
body.page-galaxy-picker[data-theme] .tool-intro .tool-intro-lead,
body.page-scientist-picker .tool-intro h2.tool-intro-sub,
body.page-space-mission-picker .tool-intro h2.tool-intro-sub,
body.page-galaxy-picker .tool-intro h2.tool-intro-sub {
    color: var(--sr-ink-dim) !important;
}

/* ---- per-page grounds ----------------------------------------------------- */
body.page-scientist-picker {
    background:
        radial-gradient(760px 460px at 50% -6%, rgba(224, 180, 74, .12), transparent 62%),
        radial-gradient(1000px 700px at 50% 122%, rgba(70, 40, 20, .28), transparent 60%),
        linear-gradient(172deg, #12100a 0%, #0c0a12 60%, #08060c 100%) !important;
    min-height: 100vh;
}

/* space-mission — "Mission Board" (deep-space navy + cyan telemetry) */
body.page-space-mission-picker {
    background:
        radial-gradient(820px 500px at 50% -8%, rgba(79, 195, 247, .12), transparent 62%),
        radial-gradient(1000px 720px at 50% 122%, rgba(20, 45, 80, .35), transparent 60%),
        linear-gradient(172deg, #0a1526 0%, #070d18 60%, #050a12 100%) !important;
    min-height: 100vh;
}
body.page-space-mission-picker .sr-plaque { background: linear-gradient(180deg, #132540, #0d1828); }
body.page-space-mission-picker .sr-card { background: linear-gradient(158deg, #132844 0%, #0e1c32 62%, #0b1526 100%); }
body.page-space-mission-picker .sr-name,
body.page-space-mission-picker .sr-plaque .sr-nm,
body.page-space-mission-picker .sr-content h2 { font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; letter-spacing: 0; }
body.page-space-mission-picker .sr-content .sr-kicker { background: linear-gradient(180deg, #7ee0ff, #2aa8e0); color: #04202e; }
body.page-space-mission-picker .sr-content .sr-lead { color: #e3eefb; }
body.page-space-mission-picker .sr-content h2 { color: #eaf4ff; }
body.page-space-mission-picker .sr-content .table thead th { color: #7ee0ff; }

/* ---- field chips ---------------------------------------------------------- */
.sr-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 16px; }
.sr-chip-btn {
    background: rgba(224, 180, 74, .08); border: 1px solid color-mix(in srgb, var(--sr-accent, #e0b44a) 34%, transparent);
    color: #d8cdb4; border-radius: 999px; padding: 7px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sr-chip-btn:hover { background: rgba(224, 180, 74, .16); color: #fff; }
.sr-chip-btn.is-active { background: linear-gradient(180deg, var(--sr-grad-a, #f0cf76), var(--sr-grad-b, #d3a338)); color: #1c1405; border-color: transparent; }
.sr-chip-btn:focus-visible { outline: 2px solid var(--sr-accent, #e0b44a); outline-offset: 2px; }

/* galaxy — "Deep Field" (black space + stars, real Hubble imagery, violet accent) */
body.page-galaxy-picker {
    background:
        radial-gradient(1.5px 1.5px at 18% 24%, rgba(255,255,255,.8), transparent),
        radial-gradient(1.5px 1.5px at 68% 38%, rgba(255,255,255,.55), transparent),
        radial-gradient(1.5px 1.5px at 42% 72%, rgba(255,255,255,.6), transparent),
        radial-gradient(1.5px 1.5px at 85% 66%, rgba(255,255,255,.45), transparent),
        radial-gradient(1.5px 1.5px at 30% 88%, rgba(255,255,255,.5), transparent),
        radial-gradient(1.5px 1.5px at 92% 18%, rgba(255,255,255,.5), transparent),
        radial-gradient(900px 540px at 50% -10%, rgba(150,130,255,.13), transparent 60%),
        linear-gradient(180deg, #0a0b16 0%, #06070f 60%, #040409 100%) !important;
    min-height: 100vh;
}
body.page-galaxy-picker .sr-card { background: linear-gradient(180deg, #0d1122 0%, #090c18 100%); }
/* min-height on reveal REMOVED (galaxy): it grew the stage the moment the card
   opened, and a centred zen column turns half of any growth into an upward
   jump — measured galaxy-picker 63px, space-mission 20px, scientist 20px.
   With the card bounded by the viewport above, the stage never needs to
   grow, so the reveal changes no layout at all (SKILLS rule 75). */
body.page-galaxy-picker .sr-name,
body.page-galaxy-picker .sr-content h2 { font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; letter-spacing: 0; }
body.page-galaxy-picker .sr-content .sr-kicker { background: linear-gradient(180deg, #c9bcff, #8f79e6); color: #12082e; }
body.page-galaxy-picker .sr-content .sr-lead { color: #e6e2fb; }
body.page-galaxy-picker .sr-content h2 { color: #f1eefe; }
body.page-galaxy-picker .sr-content .table thead th { color: #c9bcff; }

/* image tiles (galaxy thumbnails, blurred → focus-pull) */
.sr-grid-img .sr-plaque-img { padding: 0; overflow: hidden; background: #05060d; }
.sr-plaque-img .sr-timg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(2px) brightness(.5) saturate(.9); transition: filter .3s ease, transform .3s ease; }
.sr-plaque-img .sr-nm { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 12px 4px 4px; font-size: 10.5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.sr-plaque-img.sr-lit .sr-timg, .sr-plaque-img.sr-won .sr-timg { filter: none; transform: scale(1.06); }

/* image-hero card (galaxy) */
.sr-card-image { padding: 0; overflow: hidden; }
.sr-card-image .sr-hero { width: 100%; height: 208px; overflow: hidden; background: #05060d; }
.sr-card-image .sr-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sr-card-image .sr-body { padding: 15px 20px 17px; }
.sr-card-image .sr-name { margin: 7px 0 8px; }
.sr-card-image .sr-facts { grid-template-columns: 1fr; gap: 9px; margin-top: 12px; padding-top: 12px; }
.sr-card-image .sr-card-actions button { background: rgba(0, 0, 0, .45); border-color: rgba(255, 255, 255, .28); color: #fff; }
.sr-credit { margin-top: 11px; font-family: ui-monospace, monospace; font-size: 9.5px; letter-spacing: .04em; color: #7a86a8; }

/* ---- stage + plaque wall -------------------------------------------------- */
.sr-stage { position: relative; padding: 14px 6px 6px; border-radius: 16px; }
.sr-grid {
    display: grid; gap: 10px; max-width: 600px; margin: 0 auto;
}
.sr-plaque {
    position: relative; aspect-ratio: 1 / 1.06; border-radius: 9px; min-width: 0;
    border: 1px solid color-mix(in srgb, var(--sr-accent, #e0b44a) 28%, transparent);
    background: linear-gradient(180deg, #20192a, #171220);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
    transition: transform .18s ease, box-shadow .2s ease, background .2s ease;
}
.sr-plaque .sr-emb { font-size: 26px; line-height: 1; }
.sr-plaque .sr-nm { font-family: "Iowan Old Style", Georgia, serif; font-size: 12px; color: #d3c6a4; text-align: center; line-height: 1.05; padding: 0 3px; }
.sr-plaque.sr-lit {
    background: linear-gradient(180deg, #3a2c14, #241a0e); border-color: var(--sr-accent, #e0b44a);
    box-shadow: 0 0 0 1px var(--sr-accent, #e0b44a), 0 0 16px 2px color-mix(in srgb, var(--sr-accent, #e0b44a) 60%, transparent); z-index: 3;
}
.sr-plaque.sr-won {
    background: linear-gradient(180deg, #4a3818, #2a1e0e); border-color: var(--sr-accent, #e0b44a);
    transform: scale(1.12);
    box-shadow: 0 0 0 1px var(--sr-accent, #e0b44a), 0 0 26px 5px color-mix(in srgb, var(--sr-accent, #e0b44a) 70%, transparent), 0 10px 26px -6px rgba(0, 0, 0, .7); z-index: 5;
}
.sr-plaque.sr-won .sr-nm { color: #fff2d6; }

/* dim + scrim when a card is showing */
/* min-height on reveal REMOVED (shared): it grew the stage the moment the card
   opened, and a centred zen column turns half of any growth into an upward
   jump — measured galaxy-picker 63px, space-mission 20px, scientist 20px.
   With the card bounded by the viewport above, the stage never needs to
   grow, so the reveal changes no layout at all (SKILLS rule 75). */
.sr-stage.sr-done .sr-grid { filter: brightness(.4) saturate(.75); transition: filter .35s ease; }
.sr-stage::before { content: ""; position: absolute; inset: 0; border-radius: 16px; z-index: 4; background: rgba(6, 4, 10, .55); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.sr-stage.sr-done::before { opacity: 1; }

/* ---- overlay info-card ----------------------------------------------------- */
.sr-card {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98);
    /* ⚠️ BOUNDED BY THE VIEWPORT, NOT BY THE STAGE. `max-height: 94%` meant 94%
       of .sr-stage, so on a short stage the card did not overflow — it SCROLLED.
       Owner 2026-08-23, of galaxy-picker: "the winner card as a scroll in it.
       There shouldn't be scroll. Increase the height of the card, just a little,
       especially in fullscreen mode, as there is more space there." Capping by
       viewport height does exactly that: in fullscreen the viewport IS the
       screen, so the card gets the extra room automatically, and the stage never
       has to change size to make space. Same fix as element-card.css. */
    width: min(540px, 96%); max-height: 90vh; overflow: auto; z-index: 10;
    border-radius: 18px;
    background: linear-gradient(158deg, #241a2c 0%, #1b1424 62%, #160f1e 100%);
    border: 1px solid color-mix(in srgb, var(--sr-accent, #e0b44a) 42%, transparent);
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .85), 0 0 0 1px color-mix(in srgb, var(--sr-accent, #e0b44a) 16%, transparent);
    padding: 20px 22px 18px;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .34s ease, transform .34s cubic-bezier(.2, .8, .3, 1), visibility .34s;
}
.sr-card.sr-card-open { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.sr-card::after { content: ""; position: absolute; top: -1px; left: 22px; right: 22px; height: 2px; background: linear-gradient(90deg, transparent, var(--sr-accent, #e0b44a), transparent); opacity: .85; }

.sr-card-actions { position: absolute; top: 9px; right: 10px; display: flex; gap: 5px; z-index: 3; }
.sr-card-actions button { background: rgba(255, 255, 255, .06); border: 1px solid color-mix(in srgb, var(--sr-accent, #e0b44a) 30%, transparent); color: #e7ddc7; border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; font-size: 15px; line-height: 1; cursor: pointer; transition: background .15s ease, color .15s ease; }
.sr-card-actions .sr-card-close { font-size: 20px; }
.sr-card-actions button:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.sr-card-actions button:focus-visible { outline: 2px solid var(--sr-accent, #e0b44a); outline-offset: 2px; }

.sr-cardgrid { display: grid; grid-template-columns: 1fr .82fr; gap: 18px; align-items: center; }
.sr-row1 { display: flex; justify-content: space-between; font-family: ui-monospace, monospace; color: #b6a988; font-size: 12px; }
.sr-row1 .sr-meta1 { color: #f3ecdd; font-weight: 600; font-size: 13px; }
.sr-row1 .sr-meta2 { text-align: right; }
.sr-row1 .sr-meta2 b { display: block; color: #f3ecdd; font-size: 13px; font-weight: 600; }
.sr-row1 .sr-meta2 span { font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: #7d7358; }
.sr-name { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 29px; font-weight: 700; letter-spacing: .01em; margin: 8px 0 8px; line-height: 1.02; color: #fff; }
.sr-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--sr-accent, #e0b44a) 45%, #ffffff); background: color-mix(in srgb, var(--sr-accent, #e0b44a) 14%, transparent); border: 1px solid color-mix(in srgb, var(--sr-accent, #e0b44a) 42%, transparent); border-radius: 999px; padding: 5px 12px; }
.sr-chip .sr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sr-accent, #e0b44a); box-shadow: 0 0 10px var(--sr-accent, #e0b44a); }
.sr-embwrap { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--sr-accent, #e0b44a); }
.sr-emblem { width: 128px; height: 128px; filter: drop-shadow(0 0 16px color-mix(in srgb, var(--sr-accent, #e0b44a) 30%, transparent)); }
.sr-emblem svg { width: 100%; height: 100%; display: block; }
.sr-emblemnote { font-family: ui-monospace, monospace; font-size: 11px; color: #b6a988; letter-spacing: .05em; text-align: center; }
.sr-facts { margin-top: 16px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--sr-accent, #e0b44a) 16%, transparent); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sr-fact { display: flex; flex-direction: column; gap: 4px; }
.sr-fact-wide { grid-column: 1 / -1; }
.sr-fact .sr-k { font-family: ui-monospace, monospace; font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: #7d7358; }
.sr-fact .sr-v { font-size: 13.5px; line-height: 1.35; color: #e7ddc7; font-weight: 500; }
.sr-fact .sr-v b { color: #fff; font-weight: 700; }

/* ---- controls ------------------------------------------------------------- */
.sr-revealbtn-wrap { display: flex; justify-content: center; margin-top: 16px; }
.sr-revealbtn-main {
    border: none; border-radius: 12px; padding: 13px 30px; font-size: 16px; font-weight: 700; cursor: pointer;
    color: #1c1405; background: linear-gradient(180deg, var(--sr-grad-a, #f0cf76), var(--sr-grad-b, #d3a338));
    box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--sr-accent, #e0b44a) 70%, transparent);
    transition: transform .12s ease, box-shadow .2s ease;
}
.sr-revealbtn-main:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--sr-accent, #e0b44a) 80%, transparent); }
.sr-effects { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 16px; color: #b6a988; font-size: 14px; }
.sr-effects label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }

/* winner-result-bar not used here (the card is the reveal) */

@media (max-width: 600px) {
    .sr-cardgrid { grid-template-columns: 1fr; gap: 8px; }
    .sr-embwrap { order: -1; }
    .sr-facts { grid-template-columns: 1fr; }
    .sr-grid { max-width: 100%; }
    .sr-plaque .sr-emb { font-size: 21px; }
    .sr-plaque .sr-nm { font-size: 9.5px; }
}

/* ---- SEO content block ---------------------------------------------------- */
.sr-content { color: #d8cdb4; }
.sr-content .sr-inner { max-width: 860px; margin: 0 auto; }
.sr-content .sr-kicker { display: inline-block; font-family: ui-monospace, monospace; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #1c1405; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: linear-gradient(180deg, #f0cf76, #d3a338); margin-bottom: 14px; }
.sr-content .sr-lead { font-size: 1.2rem; line-height: 1.6; color: #f0e7d3; }
.sr-content .sr-section { margin-top: 3rem; }
.sr-content h2 { color: #fbf3e2; font-weight: 700; font-family: "Iowan Old Style", Georgia, serif; }
.sr-content h3 { color: #e7ddc7; font-weight: 700; }
.sr-content .table { color: #d8cdb4; }
.sr-content .table thead th { color: #f0cf76; border-color: rgba(224, 180, 74, .25); }
.sr-content .table td, .sr-content .table th { border-color: rgba(224, 180, 74, .14); }
