/* ============================================
   GridForge — Reusable Components + Atmosphere
   Theme: "After the Event"
   Loaded after site.css on every page. Token-driven so a
   later game-HUD reskin can import the same component set.
   ============================================ */

/* ============================================
   Atmosphere — the Grid through the cracks
   ============================================ */
.gf-veil {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(226, 98, 42, 0.10) 0%, transparent 45%),
        radial-gradient(100% 60% at 50% 110%, rgba(0, 0, 0, 0.6) 0%, transparent 55%),
        var(--gf-void);
}

/* Faint structural grid usable as a section backdrop */
.gf-grid-bg {
    position: relative;
}
.gf-grid-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--gf-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--gf-grid-line) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 80%);
    opacity: 0.7;
}

/* Ember-glow scanline override (refined, less CRT) */
.gf-scanlines::after {
    background: repeating-linear-gradient(
        0deg,
        rgba(226, 98, 42, 0.014) 0px,
        rgba(226, 98, 42, 0.014) 1px,
        transparent 1px,
        transparent 4px
    );
}

/* Drifting embers (CSS-only ambient, hero uses canvas/WebGL) */
@keyframes gf-ember-rise {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    10%  { opacity: 0.7; }
    90%  { opacity: 0.5; }
    100% { transform: translateY(-120px) translateX(14px); opacity: 0; }
}
@keyframes gf-crack-pulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}

/* ============================================
   Kicker / eyebrow label
   ============================================ */
.gf-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--gf-font-mono);
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gf-ember);
    margin-bottom: var(--gf-space-md);
}
.gf-kicker::before,
.gf-kicker::after {
    content: '';
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gf-ember), transparent);
}
.gf-section-header .gf-kicker { justify-content: center; }

/* ============================================
   Panel / frame (corner-accented; Kenney border-image optional)
   ============================================ */
.gf-panel {
    position: relative;
    background: var(--gf-panel);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-md);
    padding: var(--gf-space-lg);
}
.gf-frame {
    position: relative;
    background: linear-gradient(180deg, var(--gf-panel-2), var(--gf-panel));
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-lg);
    padding: var(--gf-space-lg);
    box-shadow: var(--gf-shadow-card);
}
/* Optional Kenney 9-slice frame (CC0). Apply .gf-frame-kenney to use the
   ornate border-image instead of the CSS corner ticks. Tune slice to the PNG. */
.gf-frame-kenney {
    border: 18px solid transparent;
    border-image: url('/website/assets/ui/fantasy-ui-borders/PNG/Default/Panel/panel-013.png') 30 fill repeat;
    box-shadow: none;
}
.gf-frame-kenney::before,
.gf-frame-kenney::after { display: none; }

/* Etched corner ticks */
.gf-frame::before,
.gf-frame::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1px solid var(--gf-ember);
    opacity: 0.5;
}
.gf-frame::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.gf-frame::after  { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

/* ============================================
   Icon chip
   ============================================ */
.gf-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--gf-border);
    border-radius: 999px;
    background: var(--gf-bg-glass);
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--gf-bone-dim);
}
.gf-chip .gf-ic { width: 16px; height: 16px; }

/* Icons: masked SVG so a file URL tints to currentColor.
   Usage: <span class="gf-ic" style="--ic:url('/website/assets/icons/fire.svg')"></span> */
.gf-ic {
    display: inline-block;
    vertical-align: middle;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask: var(--ic, none) center / contain no-repeat;
    mask: var(--ic, none) center / contain no-repeat;
}

/* ============================================
   Buttons — ember treatment add-ons
   ============================================ */
.gf-btn-primary {
    background: linear-gradient(180deg, var(--gf-ember-bright), var(--gf-ember));
    box-shadow: 0 0 22px rgba(226, 98, 42, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.gf-btn-ghost {
    background: transparent;
    color: var(--gf-bone);
    border: 1px solid var(--gf-border);
    display: inline-block;
    padding: 12px 28px;
    font-family: var(--gf-font);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: var(--gf-radius-sm);
    cursor: pointer;
    transition: all var(--gf-dur-fast);
}
.gf-btn-ghost:hover {
    border-color: var(--gf-ember);
    color: var(--gf-bone);
    background: rgba(226, 98, 42, 0.06);
}

/* ============================================
   Waitlist
   ============================================ */
.gf-waitlist {
    max-width: 720px;
    margin: 0 auto;
}
.gf-waitlist-perks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gf-space-md);
    margin: var(--gf-space-lg) 0;
}
.gf-perk {
    text-align: center;
    padding: var(--gf-space-md);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-md);
    background: var(--gf-bg-glass);
}
.gf-perk .gf-ic {
    width: 28px; height: 28px;
    color: var(--gf-ember);
    margin: 0 auto 8px;
}
.gf-perk-title {
    font-family: var(--gf-font-display);
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--gf-bone);
    margin-bottom: 2px;
}
.gf-perk-sub { font-size: 11px; color: var(--gf-bone-dim); line-height: 1.5; }
.gf-perk-note {
    text-align: center;
    font-size: 12px;
    font-style: italic;
    color: var(--gf-bone-faint);
    margin-bottom: var(--gf-space-lg);
}

.gf-form-row {
    display: flex;
    gap: var(--gf-space-sm);
    flex-wrap: wrap;
}
.gf-field { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; }
.gf-field label {
    font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--gf-bone-dim);
}
.gf-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--gf-void-2);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
    color: var(--gf-bone);
    font-family: var(--gf-font);
    font-size: 14px;
    transition: border-color var(--gf-dur-fast), box-shadow var(--gf-dur-fast);
}
.gf-input:focus {
    outline: none;
    border-color: var(--gf-ember);
    box-shadow: 0 0 0 2px rgba(226, 98, 42, 0.2);
}
textarea.gf-input { resize: vertical; min-height: 90px; }

.gf-check {
    display: flex; align-items: flex-start; gap: 10px;
    margin-top: var(--gf-space-md);
    cursor: pointer; font-size: 13px; color: var(--gf-bone-dim);
}
.gf-check input { margin-top: 3px; accent-color: var(--gf-ember); width: 16px; height: 16px; }
.gf-check strong { color: var(--gf-bone); }

.gf-staff-pitch { display: none; margin-top: var(--gf-space-md); }
.gf-staff-pitch.gf-show { display: block; }

.gf-waitlist-actions {
    display: flex; align-items: center; gap: var(--gf-space-md);
    margin-top: var(--gf-space-lg); flex-wrap: wrap; justify-content: center;
}
.gf-form-msg {
    margin-top: var(--gf-space-md);
    text-align: center;
    font-size: 14px;
    min-height: 20px;
}
.gf-form-msg.gf-ok { color: var(--gf-nature); }
.gf-form-msg.gf-err { color: var(--gf-hp); }

/* ============================================
   Media gallery
   ============================================ */
.gf-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gf-space-md);
}
.gf-media-card {
    position: relative;
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-md);
    overflow: hidden;
    background: var(--gf-void-2);
    aspect-ratio: 16 / 9;
    cursor: pointer;
    transition: border-color var(--gf-dur), transform var(--gf-dur), box-shadow var(--gf-dur);
}
.gf-media-card:hover {
    border-color: var(--gf-ember);
    transform: translateY(-3px);
    box-shadow: var(--gf-glow-ember);
}
.gf-media-thumb {
    width: 100%; height: 100%; object-fit: cover; display: block;
    background:
        repeating-linear-gradient(45deg, rgba(226,98,42,0.05) 0 12px, transparent 12px 24px),
        var(--gf-void-2);
}
.gf-media-card .gf-media-meta {
    position: absolute; inset-inline: 0; bottom: 0;
    padding: 28px 14px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
.gf-media-title { font-size: 13px; color: var(--gf-bone); letter-spacing: 1px; }
.gf-media-caption { font-size: 11px; color: var(--gf-bone-dim); }
.gf-media-play {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 52px; height: 52px; border-radius: 50%;
    border: 1px solid var(--gf-ember);
    background: rgba(14, 13, 12, 0.6);
    display: flex; align-items: center; justify-content: center;
    color: var(--gf-ember);
}
.gf-media-play::after {
    content: ''; width: 0; height: 0; margin-left: 3px;
    border-left: 14px solid currentColor;
    border-top: 9px solid transparent; border-bottom: 9px solid transparent;
}
.gf-media-placeholder {
    grid-column: 1 / -1; text-align: center; padding: 2rem;
    color: var(--gf-bone-faint); font-style: italic;
}

/* Lightbox */
.gf-lightbox {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, 0.9);
    display: none; align-items: center; justify-content: center; padding: 4vw;
}
.gf-lightbox.gf-open { display: flex; }
.gf-lightbox-inner { width: min(1100px, 92vw); aspect-ratio: 16/9; }
.gf-lightbox-inner img,
.gf-lightbox-inner iframe,
.gf-lightbox-inner video { width: 100%; height: 100%; border: 0; border-radius: var(--gf-radius-md); }
.gf-lightbox-close {
    position: absolute; top: 20px; right: 28px; font-size: 32px;
    color: var(--gf-bone); background: none; border: none; cursor: pointer; line-height: 1;
}

/* ============================================
   News / Devblog
   ============================================ */
.gf-news-list { display: grid; gap: var(--gf-space-md); max-width: 820px; margin: 0 auto; }
.gf-news-card {
    display: grid; grid-template-columns: 200px 1fr; gap: var(--gf-space-md);
    border: 1px solid var(--gf-border); border-radius: var(--gf-radius-md);
    background: var(--gf-bg-card); overflow: hidden;
    transition: border-color var(--gf-dur), transform var(--gf-dur);
}
.gf-news-card:hover { border-color: var(--gf-ember); transform: translateY(-2px); }
.gf-news-cover { background: var(--gf-void-2); object-fit: cover; width: 100%; height: 100%; min-height: 120px; }
.gf-news-body { padding: var(--gf-space-md) var(--gf-space-md) var(--gf-space-md) 0; }
.gf-news-date { font-family: var(--gf-font-mono); font-size: 11px; letter-spacing: 1px; color: var(--gf-ember); }
.gf-news-card h3 { font-size: 17px; margin: 4px 0 6px; color: var(--gf-bone); }
.gf-news-excerpt { font-size: 13px; color: var(--gf-bone-dim); line-height: 1.7; }

/* ============================================
   Bestiary
   ============================================ */
.gf-bestiary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gf-space-md); }
.gf-beast-card {
    position: relative; overflow: hidden;
    border: 1px solid var(--gf-border); border-radius: var(--gf-radius-md);
    background: var(--gf-bg-card); padding: var(--gf-space-lg);
    transition: border-color var(--gf-dur), transform var(--gf-dur), box-shadow var(--gf-dur);
}
.gf-beast-card:hover { border-color: var(--gf-ember); transform: translateY(-3px); box-shadow: var(--gf-glow-ember); }
.gf-beast-card .gf-ic { width: 40px; height: 40px; color: var(--gf-ember); margin-bottom: var(--gf-space-sm); }
.gf-beast-name { font-family: var(--gf-font-display); font-size: 18px; color: var(--gf-bone); letter-spacing: 1px; }
.gf-beast-where { font-size: 11px; letter-spacing: 1px; color: var(--gf-bone-faint); text-transform: uppercase; margin-bottom: var(--gf-space-sm); }
.gf-beast-quote { font-style: italic; color: var(--gf-ash-gold); font-size: 13px; margin: var(--gf-space-sm) 0; line-height: 1.6; }
.gf-beast-desc { font-size: 13px; color: var(--gf-bone-dim); line-height: 1.7; }
.gf-tier {
    display: inline-block; font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
    padding: 2px 8px; border-radius: 3px; margin-bottom: var(--gf-space-sm);
    border: 1px solid currentColor;
}
.gf-tier-champion { color: var(--gf-ash-gold); }
.gf-tier-woundborn { color: var(--gf-rogue); }
.gf-tier-common { color: var(--gf-bone-dim); }
.gf-tier-npc { color: var(--gf-nature); }

/* ── Denizen roster: toolbar (search + tier filters) ── */
.gf-denizen-toolbar {
    display: flex; flex-wrap: wrap; gap: var(--gf-space-md);
    align-items: center; justify-content: space-between;
    margin-bottom: var(--gf-space-lg);
}
.gf-denizen-search {
    position: relative; display: flex; align-items: center; flex: 1 1 240px; max-width: 360px;
}
.gf-denizen-search .gf-ic {
    position: absolute; left: 12px; width: 16px; height: 16px;
    color: var(--gf-bone-faint); pointer-events: none;
}
.gf-denizen-search input {
    width: 100%; padding: 10px 12px 10px 36px;
    background: var(--gf-bg-card); color: var(--gf-bone);
    border: 1px solid var(--gf-border); border-radius: var(--gf-radius-md);
    font-family: inherit; font-size: 14px;
    transition: border-color var(--gf-dur), box-shadow var(--gf-dur);
}
.gf-denizen-search input:focus {
    outline: none; border-color: var(--gf-ember); box-shadow: var(--gf-glow-ember);
}
.gf-denizen-search input::placeholder { color: var(--gf-bone-faint); }

.gf-denizen-filters { display: flex; flex-wrap: wrap; gap: var(--gf-space-xs); }
.gf-denizen-filter {
    --pill: var(--gf-ember);
    font-family: var(--gf-font-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
    padding: 5px 12px; border-radius: 999px; cursor: pointer;
    background: transparent; color: var(--gf-bone-dim);
    border: 1px solid var(--gf-border);
    transition: color var(--gf-dur-fast), border-color var(--gf-dur-fast), background var(--gf-dur-fast);
}
.gf-denizen-filter:hover { color: var(--gf-bone); border-color: var(--pill); }
.gf-denizen-filter.active {
    color: var(--pill); border-color: var(--pill);
    background: rgba(var(--gf-bone-rgb), 0.04);
}

/* ── Denizen roster: tier groups ── */
.gf-denizen-group { margin-bottom: var(--gf-space-xl); scroll-margin-top: 90px; }
.gf-denizen-group-head { margin-bottom: var(--gf-space-md); }
.gf-denizen-group-head h3 {
    font-family: var(--gf-font-display); font-size: 22px; letter-spacing: 1px; margin: 0 0 4px;
}
.gf-denizen-group-head p { font-size: 13px; color: var(--gf-bone-dim); margin: 0; max-width: 70ch; }
.gf-denizen-empty { color: var(--gf-bone-dim); font-style: italic; }

/* ── Denizen card: badges, stat strip, resist/damage tags ── */
.gf-beast-badges { display: flex; flex-wrap: wrap; gap: var(--gf-space-xs); margin: var(--gf-space-xs) 0 var(--gf-space-sm); }
.gf-beast-badge {
    font-size: 11px; letter-spacing: 1px; padding: 1px 7px; border-radius: 4px;
    border: 1px solid currentColor;
}
.gf-badge-tame { color: var(--gf-nature); }
.gf-badge-fly { color: var(--gf-mana); }
.gf-badge-mystery { color: var(--gf-rogue); }

.gf-beast-stats {
    display: flex; flex-wrap: wrap; gap: var(--gf-space-xs) var(--gf-space-md);
    margin: var(--gf-space-sm) 0;
    padding: var(--gf-space-sm) 0; border-top: 1px solid var(--gf-border);
}
.gf-beast-stat {
    display: flex; flex-direction: column; line-height: 1.2;
    font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--gf-bone-faint);
}
.gf-beast-stat b {
    font-family: var(--gf-font-mono); font-size: 16px; font-weight: 700;
    color: var(--gf-bone); letter-spacing: 0; text-transform: none;
}
.gf-beast-tags { display: flex; flex-wrap: wrap; gap: var(--gf-space-xs); margin-bottom: var(--gf-space-sm); }
.gf-beast-tag {
    font-family: var(--gf-font-mono); font-size: 10px; letter-spacing: .5px;
    padding: 1px 7px; border-radius: 4px;
    color: var(--gf-nature); border: 1px solid currentColor; opacity: .9;
}
.gf-beast-tag.gf-beast-weak { color: var(--gf-hp); }

.gf-beast-mystery { border-style: dashed; }
.gf-beast-mystery .gf-beast-name { color: var(--gf-rogue); }

/* ============================================
   Voxel model stage (live 3D in race / denizen cards)
   ============================================
   Each registered stage gets its OWN in-flow <canvas> (drawn into by ONE shared
   offscreen WebGL renderer in voxel_showcase.js, blitted via drawImage). Being a
   normal in-flow element, the canvas scrolls WITH the card on the compositor — so
   the model never drifts behind the card during scroll. The SVG sigil poster sits
   behind the canvas as the fallback. The showcase adds `gf-stage-on` only when
   live 3D is running (WebGL + no reduced motion); without it the stage collapses
   to its poster (or to nothing for denizen cards), so fallbacks leave no gap.
   The canvas is appended only on a SUCCESSFUL model build, so the :empty /
   [data-model-failed] collapse rules below still hold on failure. */
.gf-model-stage {
    position: relative;
    pointer-events: none;            /* hover/clicks pass through to the card */
    display: flex;
    align-items: center;
    justify-content: center;
}
/* The model's in-flow canvas fills the stage and overlays the poster. */
.gf-model-stage > canvas.gf-model-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
/* Race cards: a sigil poster lives inside; keep its natural size when 3D is off. */
.gf-model-stage.gf-stage-on { height: 150px; }
/* Codex race profile header: a model viewer beside the title (click to enlarge). */
.gf-model-stage--profile { flex-shrink: 0; }
.gf-model-stage--profile.gf-stage-on,
.gf-model-stage--profile.gf-stage-on:empty { width: 150px; height: 150px; }
/* Once a live model is mounted the whole stage is one click target → the enlarge
   modal. The blitted canvas + sigil poster are pass-through so the click lands on
   the stage (and so the card's hover-spin keeps working). */
.gf-model-stage--profile.gf-model-live { cursor: pointer; pointer-events: auto; }
.gf-model-stage--profile > canvas.gf-model-canvas,
.gf-model-stage--profile .gf-model-poster { pointer-events: none; }
/* Denizen cards start empty — reserve the same height once 3D is on. */
.gf-model-stage:empty { height: 0; }
.gf-model-stage.gf-stage-on:empty { height: 150px; }
/* If the model fails to build (no canvas appended → still empty), leave no hole. */
.gf-model-stage[data-model-failed]:empty { height: 0; }

/* The SVG sigil acts as poster: visible until a model mounts, then it fades. */
.gf-model-poster { transition: opacity .45s ease; }
.gf-model-stage.gf-model-live .gf-model-poster { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
    .gf-model-stage.gf-model-live .gf-model-poster { opacity: 1; }
}

/* Scale badge: the model's real height + size class, added by the showcase once
   the model mounts. Sits at the foot of the stage like a label on the scale-grid
   floor, so size is legible as a number, not just visually. */
.gf-scale-badge {
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    font-family: var(--gf-font-mono);
    font-size: 10px;
    letter-spacing: .06em;
    white-space: nowrap;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--gf-bone, #D8CBB6);
    background: color-mix(in srgb, var(--gf-void, #0E0D0C) 60%, transparent);
    border: 1px solid color-mix(in srgb, var(--gf-ash-gold, #B89A4A) 45%, transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity .45s ease;
}
.gf-model-stage.gf-model-live .gf-scale-badge { opacity: .92; }
/* The compact codex race-profile square has no room for the badge. */
.gf-model-stage--profile .gf-scale-badge { display: none; }

/* ============================================
   Enlarge-model: card expand button, modal viewer, loading spinners
   ============================================ */

/* Per-card expand affordance. Lives in the card as a sibling of the stage (so the
   stage's :empty collapse rules stay intact), positioned over the model. Revealed
   only once a live model has mounted — which also guarantees WebGL is present, so the
   modal will work. Degrades to hidden where :has() is unsupported (no enlarge). */
.gf-beast-expand {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    width: 30px; height: 30px; padding: 0;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--gf-bone);
    background: color-mix(in srgb, var(--gf-void) 62%, transparent);
    border: 1px solid color-mix(in srgb, var(--gf-ash-gold) 45%, transparent);
    border-radius: 8px;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity var(--gf-dur), color var(--gf-dur), border-color var(--gf-dur), transform var(--gf-dur);
}
.gf-beast-card:has(.gf-model-stage.gf-model-live) .gf-beast-expand {
    opacity: .55; visibility: visible; pointer-events: auto;
}
.gf-beast-card:has(.gf-model-stage.gf-model-live):hover .gf-beast-expand,
.gf-beast-card:has(.gf-model-stage.gf-model-live):focus-within .gf-beast-expand { opacity: 1; }
/* Same affordance on the codex race-profile (bloodlines) model. */
.gf-race-profile:has(.gf-model-stage.gf-model-live) .gf-beast-expand {
    opacity: .55; visibility: visible; pointer-events: auto;
}
.gf-race-profile:has(.gf-model-stage.gf-model-live):hover .gf-beast-expand,
.gf-race-profile:has(.gf-model-stage.gf-model-live):focus-within .gf-beast-expand { opacity: 1; }
.gf-beast-expand:hover { color: var(--gf-ember); border-color: var(--gf-ember); transform: scale(1.08); }
.gf-beast-expand:focus-visible { outline: 2px solid var(--gf-ember); outline-offset: 2px; opacity: 1; }
.gf-beast-expand svg { display: block; }

/* Loading spinner shown in a card stage while its model builds (denizen + race). */
.gf-model-loading {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.gf-model-loading::after {
    content: ''; width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--gf-ash-gold) 28%, transparent);
    border-top-color: var(--gf-ash-gold);
    animation: gf-spin .8s linear infinite;
}
@keyframes gf-spin { to { transform: rotate(360deg); } }

/* Enlarge modal — a large interactive viewer above the media lightbox (z 2000). */
.gf-denizen-modal {
    position: fixed; inset: 0; z-index: 2100;
    display: none; align-items: center; justify-content: center;
    padding: 4vmin; background: rgba(0, 0, 0, .9);
}
.gf-denizen-modal.gf-open { display: flex; }
.gf-denizen-modal-body {
    position: relative;
    width: min(960px, 94vw); height: min(78vh, 820px);
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--gf-bg-card);
    border: 1px solid color-mix(in srgb, var(--gf-ash-gold) 30%, var(--gf-border));
    border-radius: var(--gf-radius-md);
    box-shadow: var(--gf-glow-ember);
}
.gf-denizen-modal-stage { position: relative; flex: 1 1 auto; min-height: 0; }
.gf-denizen-modal-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gf-denizen-modal-hint {
    position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
    font-family: var(--gf-font-mono); font-size: 11px; letter-spacing: .08em;
    color: var(--gf-bone-dim); white-space: nowrap; pointer-events: none;
    padding: 4px 12px; border-radius: 999px;
    background: color-mix(in srgb, var(--gf-void) 55%, transparent);
    border: 1px solid color-mix(in srgb, var(--gf-ash-gold) 35%, transparent);
}
.gf-denizen-modal-loading { display: none; }
.gf-denizen-modal-stage.is-loading .gf-denizen-modal-loading {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.gf-denizen-modal-loading::after {
    content: ''; width: 46px; height: 46px; border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--gf-ash-gold) 26%, transparent);
    border-top-color: var(--gf-ash-gold);
    animation: gf-spin .8s linear infinite;
}
.gf-denizen-modal-msg {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    padding: 2rem; text-align: center; color: var(--gf-bone-dim); font-style: italic;
}
.gf-denizen-modal-cap {
    flex: 0 0 auto; text-align: center; padding: var(--gf-space-md);
    border-top: 1px solid var(--gf-border);
    background: color-mix(in srgb, var(--gf-void) 30%, transparent);
}
.gf-denizen-modal-name {
    font-family: var(--gf-font-display); font-size: 22px; letter-spacing: 1px;
    color: var(--gf-bone); margin: 6px 0 4px;
}
.gf-denizen-modal-scale {
    font-family: var(--gf-font-mono); font-size: 12px; letter-spacing: .06em; color: var(--gf-ash-gold);
}
.gf-denizen-modal-close {
    position: absolute; top: 14px; right: 18px; z-index: 3;
    font-size: 30px; line-height: 1; cursor: pointer;
    color: var(--gf-bone); background: none; border: none;
}
.gf-denizen-modal-close:hover { color: var(--gf-ember); }

@media (prefers-reduced-motion: reduce) {
    .gf-model-loading::after,
    .gf-denizen-modal-loading::after { animation: none; opacity: .65; }
}
@media (max-width: 768px) {
    .gf-denizen-modal-body { width: 96vw; height: 86vh; }
    .gf-denizen-modal-name { font-size: 19px; }
}

/* ============================================
   Factions & Characters
   ============================================ */
.gf-faction-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gf-space-md); }
.gf-faction-card {
    border: 1px solid var(--gf-border); border-radius: var(--gf-radius-md);
    background: var(--gf-bg-card); padding: var(--gf-space-lg);
    border-top: 3px solid var(--faction-color, var(--gf-ember));
    transition: transform var(--gf-dur), box-shadow var(--gf-dur);
}
.gf-faction-card:hover { transform: translateY(-3px); box-shadow: var(--gf-shadow-card); }
.gf-faction-card .gf-ic { width: 40px; height: 40px; color: var(--faction-color, var(--gf-ember)); margin-bottom: var(--gf-space-sm); }
.gf-faction-card h3 { color: var(--faction-color, var(--gf-ember)); font-size: 18px; }

.gf-character-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gf-space-md); }
.gf-character-card {
    border: 1px solid var(--gf-border); border-radius: var(--gf-radius-md);
    background: var(--gf-bg-card); padding: var(--gf-space-lg); text-align: center;
    transition: transform var(--gf-dur), border-color var(--gf-dur);
}
.gf-character-card:hover { transform: translateY(-3px); border-color: var(--gf-ember); }
.gf-character-sigil {
    width: 56px; height: 56px; margin: 0 auto var(--gf-space-sm);
    color: var(--gf-ember); display: flex; align-items: center; justify-content: center;
}
.gf-character-sigil .gf-ic { width: 100%; height: 100%; }
.gf-character-name { font-family: var(--gf-font-display); font-size: 18px; color: var(--gf-bone); }
.gf-character-role { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gf-ember); margin-bottom: var(--gf-space-sm); }
.gf-quote {
    font-style: italic; color: var(--gf-ash-gold); font-size: 14px;
    line-height: 1.7; margin: var(--gf-space-sm) 0; padding: 0 var(--gf-space-sm);
}
.gf-character-blurb { font-size: 13px; color: var(--gf-bone-dim); line-height: 1.7; }

/* ============================================
   World & Fragments map
   ============================================ */
.gf-worldmap-wrap {
    position: relative;
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-lg);
    background:
        radial-gradient(120% 120% at 50% 40%, rgba(226,98,42,0.06), transparent 60%),
        var(--gf-void-2);
    overflow: hidden;
    aspect-ratio: 16 / 9;
}
.gf-worldmap-wrap svg { width: 100%; height: 100%; display: block; }
.gf-fragment-label {
    font-family: var(--gf-font-display);
    fill: var(--gf-bone);
    font-size: 13px;
    letter-spacing: 1px;
}
.gf-fragment-region {
    fill: rgba(216, 203, 182, 0.05);
    stroke: var(--gf-border);
    stroke-width: 1;
    transition: fill var(--gf-dur), stroke var(--gf-dur);
    cursor: pointer;
}
.gf-fragment-region:hover { fill: rgba(226, 98, 42, 0.12); stroke: var(--gf-ember); }
.gf-gridgate {
    fill: var(--gf-ember);
    filter: drop-shadow(0 0 6px rgba(226, 98, 42, 0.8));
    animation: gf-crack-pulse 3s ease-in-out infinite;
}
.gf-leyline { stroke: var(--gf-grid-glow); stroke-width: 1; stroke-dasharray: 3 5; fill: none; }
.gf-fragment-tip {
    position: absolute; pointer-events: none; z-index: 5;
    background: var(--gf-panel); border: 1px solid var(--gf-ember);
    border-radius: var(--gf-radius-sm); padding: 10px 12px; max-width: 240px;
    font-size: 12px; color: var(--gf-bone-dim); opacity: 0; transform: translateY(6px);
    transition: opacity var(--gf-dur-fast), transform var(--gf-dur-fast);
}
.gf-fragment-tip.gf-show { opacity: 1; transform: translateY(0); }
.gf-fragment-tip strong { display: block; color: var(--gf-ember); font-family: var(--gf-font-display); margin-bottom: 4px; }

/* ============================================
   Footer credits
   ============================================ */
.gf-footer-credits {
    max-width: var(--gf-content-width);
    margin: var(--gf-space-lg) auto 0;
    padding: var(--gf-space-md) var(--gf-space-lg) 0;
    border-top: 1px solid var(--gf-border);
    font-size: 11px;
    color: var(--gf-bone-faint);
    text-align: center;
    line-height: 1.7;
}
.gf-footer-credits a { color: var(--gf-bone-dim); }

/* Footer "Credits" link (replaces the inline credit text) */
.gf-credits-link {
    background: none; border: none; cursor: pointer; padding: 2px 4px;
    font: inherit; font-size: 11px; letter-spacing: 0.04em;
    color: var(--gf-bone-dim); text-decoration: underline;
    text-underline-offset: 3px; transition: color 0.15s;
}
.gf-credits-link:hover { color: var(--gf-ember); }

/* Credits modal */
.gf-credits-modal {
    position: fixed; inset: 0; z-index: 2200;
    display: none; align-items: center; justify-content: center; padding: 5vh 4vw;
}
.gf-credits-modal.gf-open { display: flex; }
.gf-credits-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.82); }
.gf-credits-panel {
    position: relative; z-index: 1;
    width: min(560px, 94vw); max-height: 86vh; overflow-y: auto;
    background: var(--gf-panel, #16130f); border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-md); padding: 28px 30px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.gf-credits-x {
    position: absolute; top: 12px; right: 16px; font-size: 26px; line-height: 1;
    color: var(--gf-bone-dim); background: none; border: none; cursor: pointer;
}
.gf-credits-x:hover { color: var(--gf-ember); }
.gf-credits-title {
    font-family: var(--gf-font-display); color: var(--gf-ember);
    margin: 0 0 4px; font-size: 22px;
}
.gf-credits-intro { color: var(--gf-bone-faint); font-size: 13px; margin: 0 0 16px; line-height: 1.5; }
.gf-credits-h {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--gf-ash-gold, var(--gf-ember)); margin: 18px 0 6px;
    padding-bottom: 4px; border-bottom: 1px solid var(--gf-border);
}
.gf-credits-list { list-style: none; margin: 0; padding: 0; }
.gf-credits-list li { font-size: 13px; color: var(--gf-bone-dim); padding: 5px 0; line-height: 1.5; }
.gf-credits-list a { color: var(--gf-bone); }
.gf-credits-list a:hover { color: var(--gf-ember); }
.gf-credits-item { color: var(--gf-bone); }
.gf-credits-lic {
    display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px;
    font-size: 10px; letter-spacing: 0.05em; color: var(--gf-void, #0e0d0c);
    background: var(--gf-ash-gold, var(--gf-ember));
}
.gf-credits-note { display: block; font-size: 11px; color: var(--gf-bone-faint); margin-top: 2px; }

/* ============================================
   Page intro header (sub-pages)
   ============================================ */
.gf-page-hero {
    position: relative;
    padding: calc(var(--gf-nav-height) + var(--gf-space-2xl)) 0 var(--gf-space-xl);
    text-align: center;
    overflow: hidden;
}
.gf-page-hero h1 { font-family: var(--gf-font-hero); letter-spacing: 6px; }
.gf-page-hero p { max-width: 640px; margin: var(--gf-space-md) auto 0; color: var(--gf-bone-dim); }

/* ============================================
   Reveal helper (shared with landing observer)
   ============================================ */
.gf-reveal { opacity: 0; transform: translateY(20px); }
.gf-reveal.gf-revealed {
    opacity: 1; transform: translateY(0);
    transition: opacity var(--gf-dur-slow) var(--gf-ease), transform var(--gf-dur-slow) var(--gf-ease);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .gf-gallery,
    .gf-bestiary-grid,
    .gf-faction-grid,
    .gf-character-grid { grid-template-columns: repeat(2, 1fr); }
    .gf-waitlist-perks { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .gf-gallery,
    .gf-bestiary-grid,
    .gf-faction-grid,
    .gf-character-grid,
    .gf-waitlist-perks { grid-template-columns: 1fr; }
    .gf-news-card { grid-template-columns: 1fr; }
    .gf-news-cover { min-height: 160px; }
    .gf-news-body { padding: 0 var(--gf-space-md) var(--gf-space-md); }
}
