.sector-item {
    font-size: 1.875rem; /* ~2.5x of original 12px (small) or 16px (medium) context */
    line-height: 1.2;
}

.npc-item {
    font-size: 1.25rem; /* Increased NPC font as well for readability */
}

/* Smartphone gate: RPGy is intentionally a desktop-scale experience. */
.desktop-required {
    display: none;
}

/* Custom-world foundry */
.world-constructor-view {
    position: fixed;
    inset: 0;
    z-index: 9997;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 2rem;
    color: #e8edf5;
    background:
        radial-gradient(circle at 12% 18%, rgba(37, 99, 235, .17), transparent 32%),
        radial-gradient(circle at 88% 82%, rgba(8, 145, 178, .11), transparent 28%),
        #050810;
}

.world-constructor-view.hidden { display: none !important; }
.constructor-aurora { position: absolute; inset: -25%; pointer-events: none; background: conic-gradient(from 210deg at 50% 50%, transparent, rgba(29, 78, 216, .08), transparent 30%, rgba(14, 116, 144, .06), transparent 62%); animation: constructor-drift 22s linear infinite; }
@keyframes constructor-drift { to { transform: rotate(1turn); } }

.world-constructor-studio {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(94vw, 1420px);
    height: min(92vh, 940px);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 1.15rem;
    background: rgba(7, 11, 20, .96);
    box-shadow: 0 34px 100px rgba(0, 0, 0, .62), inset 0 1px rgba(255,255,255,.035);
    backdrop-filter: blur(22px);
}

.constructor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.5rem 1.8rem 1.35rem;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
    background: linear-gradient(90deg, rgba(30, 64, 175, .12), transparent 45%);
}
.constructor-eyebrow { display: block; margin-bottom: .35rem; color: #7ea9f8; font-size: .58rem; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; }
.constructor-header h2 { margin: 0; color: #f8fafc; font-family: Georgia, serif; font-size: clamp(1.75rem, 2.5vw, 2.7rem); font-weight: 400; letter-spacing: -.035em; line-height: 1; }
.constructor-header p { max-width: 720px; margin: .55rem 0 0; color: #8995a7; font-size: .78rem; line-height: 1.45; }
.constructor-close { padding: .55rem .72rem; border: 1px solid rgba(148,163,184,.22); border-radius: .45rem; background: rgba(15,23,42,.72); color: #93a0b4; font-size: .58rem; font-weight: 900; letter-spacing: .14em; }
.constructor-close:hover { color: #fff; border-color: rgba(147,197,253,.55); }

.constructor-body { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(0, 1.8fr); min-height: 0; }
.constructor-master-panel { position: relative; overflow-y: auto; padding: 1.55rem; border-right: 1px solid rgba(148,163,184,.14); background: linear-gradient(180deg, rgba(15,23,42,.58), rgba(2,6,23,.35)); }
.constructor-section-number { margin-bottom: .85rem; color: #5c78a8; font-size: .55rem; font-weight: 900; letter-spacing: .18em; }
.constructor-label { display: block; color: #f4f7fb; font-family: Georgia, serif; font-size: 1.25rem; }
.constructor-help { margin: .35rem 0 .8rem; color: #7c899d; font-size: .68rem; line-height: 1.45; }
.constructor-master-input { width: 100%; min-height: 280px; resize: vertical; padding: 1rem; border: 1px solid rgba(96,165,250,.28); border-radius: .7rem; outline: none; background: rgba(2,6,23,.78); color: #eaf2ff; font-family: Georgia, serif; font-size: .92rem; line-height: 1.52; box-shadow: inset 0 0 28px rgba(15,23,42,.6); }
.constructor-master-input::placeholder { color: #526076; }
.constructor-master-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.1), inset 0 0 28px rgba(15,23,42,.55); }
.constructor-draft-button { display: flex; align-items: center; gap: .75rem; width: 100%; margin-top: .8rem; padding: .78rem .9rem; border: 1px solid rgba(96,165,250,.42); border-radius: .65rem; background: linear-gradient(135deg, rgba(30,64,175,.72), rgba(12,74,110,.55)); color: #fff; text-align: left; }
.constructor-draft-button > span:first-child { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: rgba(255,255,255,.1); color: #bfdbfe; font-size: 1rem; }
.constructor-draft-button strong, .constructor-draft-button small { display: block; }
.constructor-draft-button strong { font-size: .72rem; letter-spacing: .03em; }
.constructor-draft-button small { margin-top: .12rem; color: #a9c7f7; font-size: .58rem; }
.constructor-draft-button:disabled { cursor: wait; filter: saturate(.45); opacity: .68; }
.constructor-draft-status { min-height: 1.6rem; padding: .48rem .15rem 0; color: #93c5fd; font-size: .62rem; line-height: 1.4; }
.constructor-draft-status.is-error { color: #fca5a5; }
.constructor-master-note { display: grid; gap: .3rem; margin-top: 1rem; padding: .8rem; border-left: 2px solid #2563eb; background: rgba(30,64,175,.08); }
.constructor-master-note strong { color: #cbd5e1; font-size: .64rem; }
.constructor-master-note span { color: #64748b; font-size: .6rem; line-height: 1.45; }

.constructor-fields { overflow-y: auto; padding: 0 1.65rem 2rem; scrollbar-color: #263653 transparent; }
.constructor-section { padding: 1.5rem 0 1.65rem; border-bottom: 1px solid rgba(148,163,184,.12); }
.constructor-section:last-child { border-bottom: 0; }
.constructor-section-heading { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.constructor-section-heading > span { display: grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 auto; border: 1px solid rgba(96,165,250,.32); border-radius: 50%; color: #75a7f8; font-family: Georgia, serif; font-size: .72rem; }
.constructor-section-heading h3 { margin: 0; color: #edf2f9; font-family: Georgia, serif; font-size: 1.12rem; font-weight: 400; }
.constructor-section-heading p { margin: .15rem 0 0; color: #64748b; font-size: .62rem; }
.constructor-grid { display: grid; gap: .85rem; }
.constructor-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.constructor-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.constructor-section > label, .constructor-grid > label { display: block; min-width: 0; margin-top: .85rem; }
.constructor-grid > label { margin-top: 0; }
.constructor-section label > span { display: block; margin-bottom: .34rem; color: #8290a5; font-size: .57rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.constructor-section input, .constructor-section textarea, .constructor-section select { width: 100%; padding: .68rem .75rem; border: 1px solid rgba(100,116,139,.34); border-radius: .48rem; outline: none; background: rgba(2,6,23,.62); color: #e2e8f0; font-size: .72rem; line-height: 1.42; transition: border-color .18s, background .18s, box-shadow .18s; }
.constructor-section textarea { resize: vertical; min-height: 72px; }
.constructor-section select { min-height: 38px; color-scheme: dark; }
.constructor-section input::placeholder, .constructor-section textarea::placeholder { color: #465267; }
.constructor-section input:focus, .constructor-section textarea:focus, .constructor-section select:focus { border-color: rgba(96,165,250,.78); background: rgba(6,13,30,.92); box-shadow: 0 0 0 3px rgba(59,130,246,.08); }
.constructor-section [data-world-field].is-ai-filled { animation: constructor-filled 1.1s ease; }
@keyframes constructor-filled { 0% { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(59,130,246,.18); } 100% { border-color: rgba(100,116,139,.34); box-shadow: none; } }
.constructor-companion-label { margin: 1.15rem 0 .75rem; color: #7ea9f8; font-size: .56rem; font-weight: 900; letter-spacing: .18em; }
.constructor-companion-divider { height: 1px; margin: 1.75rem 0 1.2rem; background: linear-gradient(90deg, transparent, rgba(96,165,250,.35), transparent); }
.constructor-image-forge { display: grid; grid-template-columns: 112px minmax(0,1fr); align-items: center; gap: 1rem; margin-top: .9rem; padding: .85rem; border: 1px solid rgba(96,165,250,.18); border-radius: .65rem; background: linear-gradient(115deg, rgba(15,23,42,.72), rgba(3,10,24,.44)); }
.constructor-image-forge-banner { grid-template-columns: minmax(190px, .72fr) minmax(0,1fr); }
.constructor-image-preview { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid rgba(100,116,139,.32); border-radius: .48rem; background: radial-gradient(circle at 50% 25%, #17233a, #050914 70%); }
.constructor-image-preview-portrait { aspect-ratio: 2 / 3; }
.constructor-image-preview img { display: none; width: 100%; height: 100%; object-fit: cover; }
.constructor-image-preview-portrait img { object-fit: contain; object-position: center bottom; }
.constructor-image-preview.has-image img { display: block; }
.constructor-image-preview.has-image > span { display: none; }
.constructor-image-preview > span { padding: .5rem; color: #53647e; font-size: .48rem; font-weight: 900; letter-spacing: .12em; text-align: center; }
.constructor-image-forge strong { display: block; color: #dce6f5; font-family: Georgia, serif; font-size: .92rem; font-weight: 400; }
.constructor-image-forge p { margin: .22rem 0 .6rem; color: #65748a; font-size: .59rem; line-height: 1.4; }
.constructor-image-forge button { padding: .52rem .65rem; border: 1px solid rgba(96,165,250,.45); border-radius: .4rem; background: rgba(30,64,175,.35); color: #bfdbfe; font-size: .55rem; font-weight: 900; letter-spacing: .08em; }
.constructor-image-forge button:disabled { cursor: wait; opacity: .55; }
.constructor-image-forge small { display: block; min-height: .95rem; margin-top: .35rem; color: #7da9ee; font-size: .55rem; line-height: 1.35; }
.constructor-image-forge small.is-error { color: #fca5a5; }

.rpg-custom-world-card { position: relative; border-color: rgba(37,99,235,.42) !important; }
.rpg-custom-world-card::after { content: "CUSTOM WORLD"; position: absolute; top: .55rem; right: .55rem; padding: .22rem .38rem; border: 1px solid rgba(147,197,253,.35); border-radius: .25rem; background: rgba(3,7,18,.78); color: #bfdbfe; font-size: .46rem; font-weight: 900; letter-spacing: .1em; }

.constructor-footer { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem 1.5rem; border-top: 1px solid rgba(148,163,184,.14); background: rgba(4,8,17,.98); }
.constructor-footer > div:first-child span, .constructor-footer > div:first-child small { display: block; }
.constructor-footer > div:first-child span { color: #9fb0c7; font-size: .66rem; font-weight: 800; }
.constructor-footer > div:first-child small { margin-top: .18rem; color: #536177; font-size: .56rem; }
.constructor-footer-actions { display: flex; align-items: center; gap: .65rem; }
#btn-reset-world { padding: .7rem .9rem; border: 1px solid rgba(148,163,184,.2); border-radius: .45rem; background: transparent; color: #7e8ba0; font-size: .58rem; font-weight: 900; letter-spacing: .1em; }
#btn-enter { display: flex; align-items: center; gap: 1.4rem; padding: .78rem 1rem .78rem 1.15rem; border: 1px solid #3b82f6; border-radius: .48rem; background: linear-gradient(135deg,#1d4ed8,#1e40af); color: #fff; font-size: .68rem; font-weight: 900; letter-spacing: .08em; }
#btn-enter i { color: #bfdbfe; font-size: 1rem; font-style: normal; }
#btn-enter:disabled { cursor: wait; opacity: .55; }

@media (max-width: 1100px) {
    .world-constructor-view { padding: 1rem; }
    .world-constructor-studio { width: 97vw; height: 95vh; }
    .constructor-body { grid-template-columns: minmax(250px, .7fr) minmax(0, 1.45fr); }
    .constructor-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* World generation owns the whole stage until the new reality is complete. */
body.is-constructing-world > :not(#world-construction):not(.desktop-required):not(script) {
    visibility: hidden !important;
}

.world-construction {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: grid;
    overflow: hidden;
    color: #f5f1e9;
    background: #050810;
    isolation: isolate;
}

.world-construction.hidden { display: none; }
.construction-aurora {
    position: absolute;
    z-index: -2;
    width: 75vw;
    height: 75vw;
    top: -48vw;
    right: -12vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(84, 133, 255, .25), rgba(122, 75, 164, .08) 42%, transparent 70%);
    filter: blur(6px);
    animation: construction-breathe 6s ease-in-out infinite alternate;
}

.construction-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .28;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle at 60% 45%, black 0, transparent 68%);
}

.construction-brand {
    position: absolute;
    top: clamp(1.7rem, 5vh, 3.5rem);
    left: clamp(2rem, 6vw, 6.5rem);
    display: grid;
    grid-template-columns: 42px auto;
    align-items: center;
    column-gap: .75rem;
}

.construction-brand > span {
    grid-row: 1 / 3;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #6399f3;
    border-radius: 10px;
    color: #e3edff;
    background: linear-gradient(145deg, #193b77, #09152d);
    font-family: Georgia, serif;
    font-size: 1.45rem;
    box-shadow: 0 12px 36px rgba(49, 105, 210, .18);
}

.construction-brand strong { align-self: end; font-family: Georgia, serif; font-size: 1rem; letter-spacing: .04em; }
.construction-brand small { align-self: start; color: #65728a; font-size: .5rem; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; }

.construction-shell {
    align-self: center;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(480px, 1.1fr);
    gap: clamp(4rem, 9vw, 10rem);
    width: min(86vw, 1420px);
    margin: auto;
}

.construction-copy { align-self: center; }
.construction-kicker {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0 0 1.5rem;
    color: #89aef4;
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .24em;
    text-transform: uppercase;
}
.construction-kicker span { width: 2.5rem; height: 1px; background: linear-gradient(90deg, #6ea2ff, transparent); }

.construction-copy h1 {
    max-width: 650px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3.2rem, 5.7vw, 6.6rem);
    font-weight: 400;
    letter-spacing: -.055em;
    line-height: .96;
}

.construction-briefing {
    max-width: 620px;
    margin: 2rem 0 0;
    color: #aab4c5;
    font-size: clamp(.95rem, 1.2vw, 1.12rem);
    line-height: 1.75;
}

.construction-live {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 1.5rem;
    margin-top: 2.2rem;
    color: #d3ddeb;
    font-size: .75rem;
    letter-spacing: .04em;
}
.construction-live i {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #75a9ff;
    box-shadow: 0 0 0 0 rgba(117,169,255,.55);
    animation: construction-pulse 1.8s ease-out infinite;
}

.construction-return {
    margin-top: 1.6rem;
    padding: .9rem 1.2rem;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 4px;
    color: #e5edf9;
    background: rgba(255,255,255,.05);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.construction-steps {
    position: relative;
    align-self: center;
    margin: 0;
    padding: 0;
    list-style: none;
}
.construction-steps::before {
    content: "";
    position: absolute;
    top: 2.4rem;
    bottom: 2.4rem;
    left: 1.15rem;
    width: 1px;
    background: linear-gradient(to bottom, rgba(103,154,244,.7), rgba(255,255,255,.08));
}
.construction-steps li {
    position: relative;
    display: grid;
    grid-template-columns: 2.35rem 1fr;
    gap: 1.5rem;
    padding: 1.4rem 0;
    color: #5e6879;
    transition: color .5s ease, transform .5s ease;
}
.construction-steps li > span {
    z-index: 1;
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 1px solid #283244;
    border-radius: 50%;
    background: #070b13;
    font-size: .57rem;
    font-weight: 900;
    letter-spacing: .08em;
    transition: inherit;
}
.construction-steps strong { display: block; margin: .05rem 0 .4rem; color: #7e899a; font-family: Georgia, serif; font-size: 1.2rem; font-weight: 400; transition: color .5s ease; }
.construction-steps p { max-width: 560px; margin: 0; font-size: .78rem; line-height: 1.55; }
.construction-steps li.is-active { color: #aebbd0; transform: translateX(.45rem); }
.construction-steps li.is-active > span { border-color: #6b9cf0; color: #dceaff; box-shadow: 0 0 28px rgba(75,130,225,.24); }
.construction-steps li.is-active strong { color: #f2f5fa; }
.construction-steps li.is-complete { color: #667389; }
.construction-steps li.is-complete > span { border-color: #426da9; color: transparent; background: #0d213d; }
.construction-steps li.is-complete > span::after { content: "✓"; color: #86b4ff; font-size: .8rem; }
.construction-steps li.is-complete strong { color: #99a5b8; }

.construction-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgba(255,255,255,.06);
}
.construction-progress span {
    display: block;
    width: 8%;
    height: 100%;
    background: linear-gradient(90deg, #4e89ef, #ac7be9, #fb7185);
    box-shadow: 0 0 18px rgba(103,155,244,.5);
    transition: width .7s cubic-bezier(.2,.8,.2,1);
}

@keyframes construction-pulse { 70%, 100% { box-shadow: 0 0 0 12px rgba(117,169,255,0); } }
@keyframes construction-breathe { to { transform: translate(-4vw, 5vw) scale(1.12); } }

@media (max-width: 1000px) {
    .construction-shell { grid-template-columns: 1fr; gap: 3rem; padding-top: 5rem; }
    .construction-copy h1 { font-size: clamp(3.2rem, 8vw, 5rem); }
    .construction-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
    .construction-steps::before { display: none; }
}

@media (max-width: 767px) {
    body > :not(.desktop-required):not(script) {
        display: none !important;
    }

    .desktop-required {
        position: fixed;
        inset: 0;
        z-index: 99999;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        padding: 28px;
        color: #f4f0e8;
        background:
            radial-gradient(circle at 50% 28%, rgba(60, 120, 255, .18), transparent 34%),
            radial-gradient(circle at 90% 95%, rgba(246, 73, 116, .10), transparent 32%),
            #050912;
        isolation: isolate;
    }

    .desktop-required::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        opacity: .25;
        background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
        background-size: 32px 32px;
        mask-image: linear-gradient(to bottom, black, transparent 82%);
    }

    .desktop-required-glow {
        position: absolute;
        width: 260px;
        height: 260px;
        top: 17%;
        left: 50%;
        border: 1px solid rgba(111, 165, 255, .15);
        border-radius: 50%;
        transform: translateX(-50%);
        box-shadow: 0 0 80px rgba(74, 131, 255, .08), inset 0 0 80px rgba(74, 131, 255, .05);
    }

    .desktop-required-card {
        width: min(100%, 390px);
        text-align: center;
    }

    .desktop-required-brand {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-bottom: 62px;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 21px;
        letter-spacing: .02em;
    }

    .desktop-required-brand span {
        display: grid;
        width: 36px;
        height: 36px;
        place-items: center;
        border: 1px solid #5e91ed;
        border-radius: 10px;
        color: #d9e7ff;
        background: linear-gradient(145deg, #18366a, #091329);
        box-shadow: 0 10px 30px rgba(35, 91, 190, .2);
    }

    .desktop-required-icon {
        position: relative;
        width: 116px;
        height: 91px;
        margin: 0 auto 32px;
    }

    .desktop-required-screen {
        position: absolute;
        inset: 0 0 18px;
        border: 1px solid rgba(144, 184, 255, .8);
        border-radius: 8px;
        background: linear-gradient(145deg, rgba(91, 139, 229, .16), rgba(16, 30, 55, .42));
        box-shadow: 0 0 38px rgba(71, 132, 245, .18), inset 0 0 28px rgba(88, 144, 244, .08);
    }

    .desktop-required-screen::after {
        content: "";
        position: absolute;
        width: 5px;
        height: 5px;
        right: 8px;
        bottom: 7px;
        border-radius: 50%;
        background: #78a9ff;
        box-shadow: 0 0 8px #78a9ff;
    }

    .desktop-required-stand::before,
    .desktop-required-stand::after {
        content: "";
        position: absolute;
        left: 50%;
        background: rgba(144, 184, 255, .75);
        transform: translateX(-50%);
    }

    .desktop-required-stand::before { bottom: 8px; width: 1px; height: 11px; }
    .desktop-required-stand::after { bottom: 7px; width: 45px; height: 1px; }

    .desktop-required-kicker {
        margin: 0 0 13px;
        color: #7faaff;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .22em;
        text-transform: uppercase;
    }

    .desktop-required h1 {
        margin: 0;
        font-family: Georgia, "Times New Roman", serif;
        font-size: clamp(37px, 10vw, 48px);
        font-weight: 400;
        line-height: 1.04;
        letter-spacing: -.04em;
    }

    .desktop-required-card > p:nth-of-type(2) {
        max-width: 340px;
        margin: 23px auto 0;
        color: #9aa5b8;
        font-size: 14px;
        line-height: 1.7;
    }

    .desktop-required-card > p strong { color: #dce6f8; }

    .desktop-required-rule {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-top: 40px;
        color: #647086;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: .18em;
        text-transform: uppercase;
    }

    .desktop-required-rule span { flex: 1; height: 1px; background: rgba(122, 142, 178, .2); }
}

/* --- Cinematic landing page ------------------------------------------------ */
.rpg-landing {
    --landing-ink: #07090e;
    --landing-paper: #f4f0e8;
    --landing-muted: #a7afbd;
    --landing-blue: #6ea8ff;
    --landing-red: #ff5d52;
    background:
        radial-gradient(circle at 75% 12%, rgba(37, 99, 235, 0.16), transparent 28rem),
        radial-gradient(circle at 18% 44%, rgba(153, 27, 27, 0.13), transparent 30rem),
        var(--landing-ink);
    color: var(--landing-paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    isolation: isolate;
    scroll-behavior: smooth;
}

.rpg-landing::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -3;
    background: linear-gradient(115deg, rgba(5, 8, 15, 0.98), rgba(5, 8, 15, 0.74) 48%, rgba(3, 6, 12, 0.94));
}

.rpg-landing-aurora {
    position: fixed;
    z-index: -2;
    top: -20rem;
    right: -10rem;
    width: 58rem;
    height: 58rem;
    border-radius: 999px;
    background: conic-gradient(from 210deg, rgba(37, 99, 235, 0.28), rgba(239, 68, 68, 0.12), transparent 40%, rgba(56, 189, 248, 0.15));
    filter: blur(75px);
    opacity: 0.65;
    animation: landing-drift 16s ease-in-out infinite alternate;
}

.rpg-landing-grain {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    opacity: 0.075;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
}

.rpg-landing-nav {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(92vw, 1480px);
    margin: 0 auto;
    padding: 1.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rpg-landing-brand {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    color: #fff;
    text-decoration: none;
}

.rpg-brand-mark {
    display: grid;
    width: 2.45rem;
    height: 2.45rem;
    place-items: center;
    border: 1px solid rgba(110, 168, 255, 0.65);
    border-radius: 0.72rem 0.72rem 0.72rem 0.18rem;
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.28), rgba(15, 23, 42, 0.78));
    box-shadow: inset 0 0 18px rgba(96, 165, 250, 0.12), 0 8px 32px rgba(0, 0, 0, 0.28);
    color: #dbeafe;
    font-family: Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
}

.rpg-landing-brand strong,
.rpg-landing-brand small { display: block; }
.rpg-landing-brand strong { font-size: 1.1rem; letter-spacing: 0.04em; }
.rpg-landing-brand small { margin-top: 0.02rem; color: #7c879a; font-size: 0.57rem; letter-spacing: 0.22em; text-transform: uppercase; }
.rpg-landing-nav-actions { display: flex; align-items: center; gap: 0.55rem; }

.rpg-language-link {
    padding: 0.45rem 0.55rem;
    background: transparent;
    color: #8994a7;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.rpg-language-link:hover { color: #fff; }
.rpg-continue-button {
    margin-left: 0.6rem;
    padding: 0.68rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #eef2ff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    backdrop-filter: blur(12px);
}

.rpg-hero {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(520px, 1.1fr);
    align-items: center;
    gap: clamp(3rem, 7vw, 8rem);
    width: min(92vw, 1480px);
    min-height: calc(100vh - 84px);
    margin: 0 auto;
    padding: clamp(4rem, 8vh, 8rem) 0 6rem;
}

.rpg-hero-copy { position: relative; z-index: 3; }
.rpg-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #91a1b8;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.rpg-eyebrow span { width: 2.2rem; height: 1px; background: linear-gradient(90deg, var(--landing-blue), transparent); }

.rpg-hero h1 {
    max-width: 760px;
    margin: 1.25rem 0 1.4rem;
    color: #f7f4ed;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(4rem, 7vw, 7.6rem);
    font-weight: 400;
    letter-spacing: -0.065em;
    line-height: 0.88;
    text-wrap: balance;
}

.rpg-hero h1 em {
    color: transparent;
    font-size: .88em;
    font-weight: 400;
    white-space: nowrap;
    background: linear-gradient(100deg, #dbeafe 10%, #79aafa 45%, #fb7185 88%);
    background-clip: text;
    -webkit-background-clip: text;
}

.rpg-hero-lede {
    max-width: 620px;
    color: #aeb7c5;
    font-size: clamp(1rem, 1.45vw, 1.28rem);
    line-height: 1.7;
}

.rpg-hero-actions { display: flex; gap: 0.75rem; margin-top: 2.2rem; }
.rpg-primary-cta,
.rpg-secondary-cta {
    min-height: 3.35rem;
    padding: 0 1.35rem;
    border-radius: 0.25rem;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.rpg-primary-cta { background: #edf4ff; color: #07101f; box-shadow: 0 15px 50px rgba(59, 130, 246, 0.2); }
.rpg-primary-cta span { display: inline-block; margin-left: 1.25rem; color: #2563eb; font-size: 1rem; }
.rpg-secondary-cta { border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.045); color: #dbe4f0; backdrop-filter: blur(8px); }
.rpg-proof-row { display: flex; gap: 2.2rem; margin-top: 2.7rem; padding-top: 1.45rem; border-top: 1px solid rgba(255,255,255,.1); }
.rpg-proof-row div { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0.48rem; }
.rpg-proof-row strong { color: #f8fafc; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 400; }
.rpg-proof-row span { color: #737f92; font-size: 0.59rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }

.rpg-hero-stage { position: relative; min-height: 690px; perspective: 1100px; }
.rpg-stage-card {
    position: absolute;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 0.55rem;
    background: #101722;
    box-shadow: 0 38px 90px rgba(0, 0, 0, 0.55);
    text-align: left;
    transform-style: preserve-3d;
}
.rpg-stage-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.rpg-stage-card:hover img { transform: scale(1.045); }
.rpg-stage-card-main { z-index: 2; top: 4%; left: 4%; width: 63%; height: 84%; transform: rotateY(4deg) rotateZ(-1deg); }
.rpg-stage-card-top { z-index: 3; top: 0; right: 1%; width: 36%; height: 42%; transform: rotateY(-5deg) rotateZ(2deg); }
.rpg-stage-card-bottom { z-index: 4; right: 3%; bottom: 2%; width: 39%; height: 45%; transform: rotateY(-4deg) rotateZ(-2deg); }
.rpg-stage-card:hover { z-index: 6; border-color: rgba(147, 197, 253, .75); filter: brightness(1.06); }
.rpg-stage-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 43%, rgba(3,6,13,.22) 62%, rgba(3,6,13,.96) 100%); }
.rpg-stage-meta { position: absolute; right: 0; bottom: 0; left: 0; padding: 1.25rem; }
.rpg-stage-meta small, .rpg-stage-meta strong, .rpg-stage-meta > span { display: block; }
.rpg-stage-meta small { margin-bottom: .4rem; color: #93c5fd; font-size: .58rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.rpg-stage-meta strong { color: #fff; font-family: Georgia, serif; font-size: clamp(1.1rem, 2vw, 1.85rem); font-weight: 400; line-height: 1.05; }
.rpg-stage-meta > span { margin-top: .45rem; color: #bbc5d3; font-size: .72rem; }
.rpg-stage-orbit { position: absolute; z-index: 5; top: 46%; right: -1%; display: grid; width: 7.1rem; height: 7.1rem; place-items: center; border: 1px solid rgba(147,197,253,.32); border-radius: 50%; background: rgba(6,12,23,.72); box-shadow: 0 0 0 9px rgba(59,130,246,.05), 0 20px 50px rgba(0,0,0,.4); backdrop-filter: blur(10px); animation: landing-float 5s ease-in-out infinite; }
.rpg-stage-orbit::before { content: ''; width: .62rem; height: .62rem; border-radius: 50%; background: #60a5fa; box-shadow: 0 0 18px #3b82f6; }
.rpg-stage-orbit span { position: absolute; bottom: 1.5rem; color: #a5c8ff; font-size: .48rem; font-weight: 900; letter-spacing: .15em; }

.rpg-manifesto { position: relative; z-index: 2; width: min(92vw, 1480px); margin: 0 auto; padding: 7rem 0; border-top: 1px solid rgba(255,255,255,.1); }
.rpg-manifesto > p { color: #667085; font-size: .7rem; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.rpg-manifesto > h2, .rpg-catalog-heading h2 { margin: .6rem 0 3.7rem; font-family: Georgia, serif; font-size: clamp(2.8rem, 5vw, 5.2rem); font-weight: 400; letter-spacing: -.045em; line-height: .98; }
.rpg-manifesto-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); }
.rpg-manifesto-grid article { min-height: 270px; padding: 2.1rem; background: rgba(7,9,14,.88); }
.rpg-manifesto-grid article > span { color: #5d6a7d; font-family: Georgia, serif; font-size: 1rem; }
.rpg-manifesto-grid h3 { margin: 3.9rem 0 .8rem; color: #f1f5f9; font-family: Georgia, serif; font-size: 1.65rem; font-weight: 400; }
.rpg-manifesto-grid p { max-width: 25rem; color: #8994a5; font-size: .86rem; line-height: 1.75; }

.rpg-world-catalog { position: relative; z-index: 2; padding: 7rem max(4vw, calc((100vw - 1480px)/2)); background: linear-gradient(180deg, rgba(13,17,26,.45), rgba(5,7,11,.96)); border-top: 1px solid rgba(255,255,255,.08); }
.rpg-catalog-heading { display: grid; grid-template-columns: 1fr minmax(280px, 420px); align-items: end; gap: 3rem; max-width: 1480px; margin: 0 auto 3rem; }
.rpg-catalog-heading h2 { margin: .75rem 0 0; }
.rpg-catalog-heading > p { padding-bottom: .5rem; color: #8792a4; font-size: .86rem; line-height: 1.7; }
.rpg-world-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .85rem; max-width: 1480px; margin: 0 auto; }
.rpg-world-grid > .overlay-box { position: relative; min-height: 315px; padding: .65rem !important; border: 1px solid rgba(255,255,255,.1); border-radius: .42rem; background: rgba(14,19,29,.82); box-shadow: 0 12px 30px rgba(0,0,0,.16); transition: transform .25s ease, border-color .25s ease, background .25s ease; }
.rpg-world-grid > .overlay-box:hover { z-index: 2; border-color: rgba(110,168,255,.55); background: rgba(22,29,43,.96); transform: translateY(-5px); }
.rpg-world-grid > .overlay-box > div:first-child { height: 10.8rem !important; margin-bottom: .65rem !important; border-radius: .28rem; }
.rpg-world-grid > .overlay-box img { filter: saturate(.85) contrast(1.04); transition: transform .45s ease, filter .45s ease; }
.rpg-world-grid > .overlay-box:hover img { filter: saturate(1.08) contrast(1.04); transform: scale(1.04); }
.rpg-world-grid > .overlay-box h3 { min-height: 2.25rem; color: #f1f5f9; font-family: Georgia, serif; font-size: 1.03rem !important; font-weight: 400; line-height: 1.08 !important; }
.rpg-world-grid > .overlay-box > p { min-height: 2rem; color: #7d899b !important; font-size: .65rem !important; line-height: 1.45 !important; }
.rpg-world-grid > .overlay-box span { letter-spacing: .02em; }

.rpg-landing-footer { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2rem; width: min(92vw,1480px); margin: 0 auto; padding: 3.2rem 0; color: #626d7f; font-size: .68rem; }
.rpg-landing-footer > span { color: #dbeafe; font-family: Georgia, serif; font-size: 1.15rem; }
.rpg-landing-footer p { text-align: center; }
.rpg-landing-footer button { justify-self: end; background: transparent; color: #8390a3; font-size: .65rem; }
.rpg-live-presence { grid-column: 1 / -1; justify-self: center; display: inline-flex; align-items: center; gap: .45rem; margin-top: .35rem; padding: .48rem .72rem; border: 1px solid rgba(74,222,128,.16); border-radius: 999px; background: rgba(3,12,10,.58); color: #718078; font-size: .55rem; font-weight: 900; letter-spacing: .13em; }
.rpg-live-presence i { width: .38rem; height: .38rem; border-radius: 50%; background: #4ade80; box-shadow: 0 0 .65rem rgba(74,222,128,.8); animation: presence-pulse 2.2s ease-in-out infinite; }
.rpg-live-presence strong { min-width: 1ch; color: #bbf7d0; font-size: .66rem; }

@keyframes presence-pulse { 50% { opacity: .45; transform: scale(.82); } }

@keyframes landing-drift { to { transform: translate(-5rem, 4rem) scale(1.08); } }
@keyframes landing-float { 50% { transform: translateY(-8px); } }

@media (max-width: 1180px) {
    .rpg-hero { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .rpg-hero-stage { min-height: 570px; }
    .rpg-world-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .rpg-hero { grid-template-columns: 1fr; padding-top: 5rem; }
    .rpg-hero-copy { max-width: 700px; }
    .rpg-hero-stage { min-height: 640px; }
    .rpg-manifesto-grid { grid-template-columns: 1fr; }
    .rpg-manifesto-grid article { min-height: 210px; }
    .rpg-manifesto-grid h3 { margin-top: 2.3rem; }
    .rpg-world-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .rpg-landing-nav { width: 88vw; }
    .rpg-continue-button { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rpg-hero { width: 88vw; min-height: auto; padding: 5rem 0 4rem; }
    .rpg-hero h1 { font-size: clamp(3.25rem, 17vw, 5rem); }
    .rpg-hero-lede { font-size: .95rem; }
    .rpg-hero-actions { flex-direction: column; }
    .rpg-proof-row { display: grid; grid-template-columns: repeat(3,1fr); gap: .5rem; }
    .rpg-proof-row div { display: block; }
    .rpg-proof-row strong, .rpg-proof-row span { display: block; }
    .rpg-proof-row span { margin-top: .3rem; }
    .rpg-hero-stage { min-height: 500px; }
    .rpg-stage-card-main { left: 0; width: 72%; height: 78%; }
    .rpg-stage-card-top { right: 0; width: 38%; height: 37%; }
    .rpg-stage-card-bottom { right: 0; width: 43%; height: 41%; }
    .rpg-stage-orbit { width: 5.5rem; height: 5.5rem; }
    .rpg-manifesto { width: 88vw; padding: 5rem 0; }
    .rpg-world-catalog { padding: 5rem 6vw; }
    .rpg-catalog-heading { grid-template-columns: 1fr; gap: 1rem; }
    .rpg-world-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rpg-world-grid > .overlay-box { min-height: 290px; }
    .rpg-world-grid > .overlay-box > div:first-child { height: 9rem !important; }
    .rpg-landing-footer { grid-template-columns: 1fr; text-align: center; }
    .rpg-landing-footer button { justify-self: center; }
}

@media (prefers-reduced-motion: reduce) {
    .rpg-landing *, .rpg-landing *::before, .rpg-landing *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
}

/* --- High-intensity gameplay landing ------------------------------------- */
.rpg-landing-nav {
    position: absolute;
    z-index: 30;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.rpg-hero.rpg-hero-intense {
    position: relative;
    display: grid;
    grid-template-columns: minmax(360px, .72fr) minmax(560px, 1.28fr);
    align-items: center;
    gap: clamp(2.5rem, 5vw, 7rem);
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 8rem max(4vw, calc((100vw - 1480px) / 2)) 6.75rem;
    overflow: hidden;
    isolation: isolate;
}

.rpg-hero-intense::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        radial-gradient(circle at 83% 45%, rgba(11, 86, 172, .14), transparent 34%),
        radial-gradient(circle at 54% 43%, rgba(240, 70, 27, .16), transparent 31%);
    pointer-events: none;
}

.rpg-hero-backdrop {
    position: absolute;
    z-index: -3;
    inset: -4%;
    overflow: hidden;
    background: #020409;
}

.rpg-hero-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 48%;
    filter: saturate(1.15) contrast(1.08) brightness(.7);
    transform: scale(1.035);
    animation: rpg-hero-breathe 18s ease-in-out infinite alternate;
}

.rpg-hero-backdrop-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 5, 11, .97) 0%, rgba(2, 5, 11, .88) 23%, rgba(2, 5, 11, .28) 62%, rgba(2, 5, 11, .42) 100%),
        linear-gradient(180deg, rgba(2, 5, 11, .78) 0%, transparent 22%, transparent 65%, rgba(2, 5, 11, .96) 100%);
}

.rpg-hero-intense .rpg-hero-copy {
    z-index: 4;
    max-width: 700px;
    padding-top: 1rem;
}

.rpg-hero-intense .rpg-eyebrow { color: #d2d9e6; text-shadow: 0 1px 12px #000; }
.rpg-hero-intense .rpg-eyebrow span { background: linear-gradient(90deg, #ff563b, #71abff); }

.rpg-hero-intense h1 {
    margin: 1.25rem 0 1.3rem;
    font-size: clamp(4.4rem, 6.65vw, 8rem);
    line-height: .84;
    text-shadow: 0 5px 45px rgba(0, 0, 0, .82);
}

.rpg-hero-intense h1 em {
    background: linear-gradient(100deg, #ffffff 4%, #9ac5ff 48%, #ff8172 100%);
    background-clip: text;
    -webkit-background-clip: text;
}

.rpg-hero-intense .rpg-hero-lede {
    max-width: 590px;
    color: #d0d7e3;
    font-size: clamp(.98rem, 1.2vw, 1.18rem);
    line-height: 1.62;
    text-shadow: 0 2px 18px #000;
}

.rpg-hero-intense .rpg-hero-lede strong { color: #fff; }
.rpg-hero-intense .rpg-primary-cta { background: #f4f7ff; box-shadow: 0 12px 44px rgba(51, 117, 255, .34); }
.rpg-hero-intense .rpg-secondary-cta { background: rgba(3, 7, 15, .68); }
.rpg-hero-intense .rpg-proof-row { border-color: rgba(255, 255, 255, .22); }
.rpg-hero-intense .rpg-proof-row strong { color: #fff; text-shadow: 0 2px 12px #000; }
.rpg-hero-intense .rpg-proof-row span { color: #aeb9ca; }

.rpg-live-stage {
    position: relative;
    z-index: 3;
    width: min(100%, 870px);
    justify-self: end;
    perspective: 1300px;
}

.rpg-live-halo {
    position: absolute;
    inset: 8% -6% -12% 8%;
    background: radial-gradient(ellipse, rgba(31, 111, 255, .29), rgba(236, 58, 25, .14) 40%, transparent 72%);
    filter: blur(48px);
}

.rpg-live-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(183, 211, 255, .47);
    border-radius: .55rem;
    background: #05080d;
    box-shadow: 0 48px 110px rgba(0, 0, 0, .73), 0 0 0 1px rgba(255, 255, 255, .06) inset;
    transform: rotateY(-3.5deg) rotateZ(.25deg);
    transform-origin: center right;
}

.rpg-live-chrome,
.rpg-live-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.55rem;
    padding: 0 .9rem;
    background: rgba(3, 6, 12, .96);
    color: #8b98ac;
    font-size: .53rem;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.rpg-live-chrome span { display: flex; align-items: center; gap: .48rem; color: #dce8fa; }
.rpg-live-chrome i { width: .45rem; height: .45rem; border-radius: 50%; background: #45e7a1; box-shadow: 0 0 11px #26c281; }
.rpg-live-chrome strong { color: #759cd9; font-size: inherit; }

.rpg-live-screen {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1.94 / 1;
    overflow: hidden;
    background: #06090e;
}

.rpg-live-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform .65s cubic-bezier(.2, .75, .2, 1), filter .65s ease;
}

.rpg-live-screen:hover img { filter: saturate(1.12) brightness(1.06); transform: scale(1.025); }
.rpg-live-screen-shade { position: absolute; inset: 0; box-shadow: inset 0 0 55px rgba(0, 0, 0, .28); }
.rpg-live-status { justify-content: flex-start; gap: 1.4rem; min-height: 2.4rem; }
.rpg-live-status span { position: relative; padding-left: .75rem; }
.rpg-live-status span::before { content: ''; position: absolute; top: 50%; left: 0; width: .3rem; height: .3rem; border-radius: 50%; background: #548ff7; transform: translateY(-50%); }

.rpg-live-pullquote {
    position: absolute;
    z-index: 5;
    right: -1.25rem;
    bottom: -2.5rem;
    max-width: 330px;
    padding: .85rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, .22);
    border-left: 3px solid #ff654d;
    background: rgba(4, 7, 13, .94);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .6);
    color: #f5f7fb;
    font-family: Georgia, serif;
    font-size: .96rem;
    font-style: italic;
}

.rpg-live-pullquote span { margin-right: .6rem; color: #ff806c; font-family: Inter, sans-serif; font-size: .5rem; font-style: normal; font-weight: 900; letter-spacing: .14em; }

.rpg-hero-foot {
    position: absolute;
    right: max(4vw, calc((100vw - 1480px) / 2));
    bottom: 1.7rem;
    left: max(4vw, calc((100vw - 1480px) / 2));
    display: flex;
    align-items: center;
    gap: 1.2rem;
    color: #8c98a9;
    font-size: .52rem;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.rpg-hero-foot i { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .04)); }

.rpg-session-showcase {
    position: relative;
    z-index: 3;
    padding: clamp(6rem, 9vw, 10rem) max(4vw, calc((100vw - 1480px) / 2));
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, .12);
    background:
        radial-gradient(circle at 7% 24%, rgba(157, 35, 24, .16), transparent 28rem),
        radial-gradient(circle at 91% 61%, rgba(28, 87, 181, .16), transparent 31rem),
        #05070b;
}

.rpg-showcase-heading {
    display: grid;
    grid-template-columns: minmax(500px, 1fr) minmax(280px, 410px);
    align-items: end;
    gap: 4rem;
    max-width: 1480px;
    margin: 0 auto clamp(3rem, 5vw, 5.5rem);
}

.rpg-showcase-heading .rpg-eyebrow { grid-column: 1 / -1; margin-bottom: -2.6rem; }
.rpg-showcase-heading h2 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(3.2rem, 6.3vw, 7.4rem);
    font-weight: 950;
    letter-spacing: -.075em;
    line-height: .83;
    text-transform: uppercase;
}

.rpg-showcase-heading h2 em { color: transparent; font-family: Georgia, serif; font-size: .9em; font-weight: 400; text-transform: none; background: linear-gradient(90deg, #89b8ff, #ff7864); background-clip: text; -webkit-background-clip: text; }
.rpg-showcase-heading > p { padding-bottom: .35rem; color: #9ca7b8; font-size: .9rem; line-height: 1.75; }

.rpg-session-shot {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1.72 / 1;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: .28rem;
    background: #090d14;
    box-shadow: 0 35px 80px rgba(0, 0, 0, .44);
    text-align: left;
}

.rpg-session-shot-wide { max-width: 1480px; aspect-ratio: 2.32 / 1; margin: 0 auto 1.1rem; }
.rpg-session-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; max-width: 1480px; margin: 0 auto; }
.rpg-session-shot > img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.18, .72, .18, 1), filter .8s ease; }
.rpg-session-shot-wide > img { object-position: center 45%; }
.rpg-session-shot:hover { z-index: 2; border-color: rgba(140, 186, 255, .75); }
.rpg-session-shot:hover > img { filter: saturate(1.12) contrast(1.02); transform: scale(1.025); }
.rpg-session-vignette { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(2, 4, 9, .93) 0%, rgba(2, 4, 9, .5) 31%, transparent 66%), linear-gradient(0deg, rgba(2, 4, 9, .74), transparent 45%); }
.rpg-session-number { position: absolute; top: 1.25rem; right: 1.35rem; color: rgba(255, 255, 255, .6); font-size: .58rem; font-weight: 900; letter-spacing: .18em; }
.rpg-session-caption { position: absolute; bottom: clamp(1.4rem, 3vw, 3.5rem); left: clamp(1.4rem, 3vw, 3.5rem); display: block; width: min(43%, 520px); }
.rpg-session-caption small, .rpg-session-caption strong, .rpg-session-caption > span { display: block; }
.rpg-session-caption small { margin-bottom: .7rem; color: #74aaff; font-size: .56rem; font-weight: 900; letter-spacing: .17em; }
.rpg-session-caption strong { color: #fff; font-family: Georgia, serif; font-size: clamp(1.55rem, 3vw, 3.5rem); font-weight: 400; letter-spacing: -.035em; line-height: .98; text-shadow: 0 3px 24px #000; }
.rpg-session-caption > span { margin-top: .85rem; color: #bdc7d5; font-size: clamp(.7rem, .95vw, .9rem); line-height: 1.58; }
.rpg-session-split .rpg-session-caption { width: min(72%, 430px); }
.rpg-session-split .rpg-session-caption strong { font-size: clamp(1.4rem, 2.15vw, 2.6rem); }

.rpg-engine-signals {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    max-width: 1480px;
    margin: 1.1rem auto 0;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .1);
}

.rpg-engine-signals article { min-height: 205px; padding: clamp(1.6rem, 2.7vw, 2.8rem); background: rgba(6, 9, 15, .96); }
.rpg-engine-signals article > span { color: #5f91e2; font-size: .52rem; font-weight: 900; letter-spacing: .16em; }
.rpg-engine-signals h3 { margin: 2.7rem 0 .65rem; color: #f4f7fb; font-family: Georgia, serif; font-size: clamp(1.4rem, 2vw, 2rem); font-weight: 400; }
.rpg-engine-signals p { max-width: 28rem; color: #8c98aa; font-size: .78rem; line-height: 1.65; }

@keyframes rpg-hero-breathe { to { transform: scale(1.085) translate3d(-.5%, -.4%, 0); } }

@media (max-width: 1180px) {
    .rpg-hero.rpg-hero-intense { grid-template-columns: minmax(330px, .78fr) minmax(460px, 1.22fr); gap: 2.2rem; }
    .rpg-live-pullquote { right: -.25rem; }
}

@media (max-width: 900px) {
    .rpg-hero.rpg-hero-intense { grid-template-columns: 1fr; min-height: auto; padding-top: 8.5rem; }
    .rpg-live-stage { width: 100%; margin-top: 1rem; }
    .rpg-showcase-heading { grid-template-columns: 1fr; gap: 1.5rem; }
    .rpg-showcase-heading .rpg-eyebrow { margin-bottom: 0; }
    .rpg-session-split, .rpg-engine-signals { grid-template-columns: 1fr; }
    .rpg-session-shot-wide, .rpg-session-shot { aspect-ratio: 1.55 / 1; }
    .rpg-session-caption, .rpg-session-split .rpg-session-caption { width: 72%; }
}

@media (max-width: 640px) {
    .rpg-hero.rpg-hero-intense { width: 100%; padding-right: 6vw; padding-bottom: 5.5rem; padding-left: 6vw; }
    .rpg-hero-intense h1 { font-size: clamp(3.25rem, 17vw, 5rem); }
    .rpg-live-chrome strong, .rpg-live-status span:nth-child(3), .rpg-live-pullquote { display: none; }
    .rpg-live-frame { transform: none; }
    .rpg-hero-foot { right: 6vw; left: 6vw; }
    .rpg-session-showcase { padding-right: 6vw; padding-left: 6vw; }
    .rpg-session-shot-wide, .rpg-session-shot { aspect-ratio: .9 / 1; }
    .rpg-session-caption, .rpg-session-split .rpg-session-caption { width: 82%; }
    .rpg-session-vignette { background: linear-gradient(0deg, rgba(2, 4, 9, .96), rgba(2, 4, 9, .08) 72%); }
}

#narrative {
    height: 16rem;
    transition: height .24s cubic-bezier(.2, .75, .25, 1), box-shadow .24s ease;
}

#narrative:hover {
    height: 32rem;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .62), 0 0 0 1px rgba(96, 165, 250, .12);
}

#narrative p {
    margin-bottom: 0.65rem;
    line-height: 1.38;
    font-size: 1rem;
    border-left: 2px solid #3b82f6;
    padding-left: 10px;
}

#input {
    font-size: 1.125rem;
    border: 1px solid #30363d;
    transition: border-color 0.2s;
}

#sidebar-content {
    font-size: 1rem;
}

.quest-log-panel {
    top: 19rem;
    width: 340px;
    max-height: 13rem;
    padding: .8rem 1rem 1rem;
    border-right: 3px solid rgba(234, 179, 8, .68);
    box-shadow: 0 14px 38px rgba(0, 0, 0, .36);
}

.quest-log-title {
    margin-bottom: .75rem;
    color: #fbbf24;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .22em;
    text-align: right;
    text-shadow: 0 0 8px rgba(234, 179, 8, .35);
}

.quest-log-content {
    max-height: 9.5rem;
    padding-left: .35rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(234, 179, 8, .3) transparent;
}

button {
    font-size: 1rem;
    transition: all 0.2s;
}

button:hover {
    filter: brightness(1.2);
}

.sidebar-header {
    font-size: 2.25rem;
    font-weight: bold;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.survivor-roster {
    position: absolute;
    z-index: 8;
    right: 1.5rem;
    bottom: 1.5rem;
    left: calc(33.333% + 3.25rem);
    pointer-events: none;
}

.survivor-roster.hidden {
    display: none;
}

.survivor-roster-heading {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 1rem;
    margin: 0 0 0.6rem auto;
    color: #e2e8f0;
    text-align: right;
    pointer-events: auto;
}

.survivor-roster-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
}

.party-verbose-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2rem;
    padding: 0.38rem 0.58rem 0.38rem 0.68rem;
    border: 1px solid rgba(148, 163, 184, 0.36);
    border-radius: 999px;
    background: rgba(8, 15, 28, 0.84);
    color: #94a3b8;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    backdrop-filter: blur(10px);
    transition: border-color .25s ease, color .25s ease, background .25s ease, box-shadow .25s ease;
}

.party-verbose-toggle:hover,
.party-verbose-toggle:focus-visible {
    border-color: rgba(129, 160, 210, .75);
    color: #e2e8f0;
    outline: none;
}

.party-verbose-switch {
    position: relative;
    display: inline-block;
    width: 1.75rem;
    height: .92rem;
    border: 1px solid rgba(148, 163, 184, .3);
    border-radius: 999px;
    background: #202938;
}

.party-verbose-switch i {
    position: absolute;
    top: 2px;
    left: 2px;
    width: .58rem;
    height: .58rem;
    border-radius: 50%;
    background: #7b8798;
    transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.party-verbose-toggle small {
    min-width: 1.35rem;
    color: #64748b;
    font-size: .48rem;
    letter-spacing: .09em;
}

.party-verbose-toggle[aria-pressed="true"] {
    border-color: rgba(251, 146, 60, .68);
    color: #ffedd5;
    background: rgba(67, 29, 10, .76);
    box-shadow: 0 0 22px rgba(249, 115, 22, .13);
}

.party-verbose-toggle[aria-pressed="true"] .party-verbose-switch {
    border-color: rgba(251, 146, 60, .58);
    background: #7c2d12;
}

.party-verbose-toggle[aria-pressed="true"] .party-verbose-switch i {
    transform: translateX(.79rem);
    background: #fdba74;
    box-shadow: 0 0 8px rgba(251, 146, 60, .75);
}

.party-verbose-toggle[aria-pressed="true"] small { color: #fdba74; }

.survivor-roster-kicker {
    display: block;
    color: #ef4444;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.28em;
}

#survivor-roster-title {
    margin: 0.12rem 0 0;
    color: #f8fafc;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-shadow: 0 2px 16px #000;
}

.survivor-roster-all {
    padding: 0.42rem 0.72rem;
    border: 1px solid rgba(248, 113, 113, 0.5);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #fecaca;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    backdrop-filter: blur(8px);
}

.survivor-roster-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 210px));
    justify-content: end;
    gap: 0.75rem;
    pointer-events: auto;
}

.survivor-card-shell {
    display: grid;
    grid-template-rows: 350px 38px;
    gap: 0.45rem;
    min-width: 0;
}

.survivor-card {
    position: relative;
    min-width: 0;
    height: 350px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 0.8rem;
    background: #08101c;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.62);
    isolation: isolate;
    text-align: left;
    transform: translateY(0);
    width: 100%;
}

.survivor-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.02) 30%, rgba(2, 6, 23, 0.32) 55%, rgba(2, 6, 23, 0.98) 100%);
    pointer-events: none;
}

.survivor-card[data-unit-kind="player"] {
    border-color: rgba(250, 204, 21, 0.62);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.66), 0 0 22px rgba(250, 204, 21, 0.1);
}

.survivor-card[data-presence="separated"],
.survivor-card[data-presence="departed"] {
    filter: saturate(.45) brightness(.72);
    border-style: dashed;
}

.survivor-card[data-presence="departed"] { opacity: .7; }

.survivor-card:hover,
.survivor-card:focus-visible {
    border-color: rgba(96, 165, 250, 0.9);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.72), 0 0 28px rgba(59, 130, 246, 0.23);
    outline: none;
    transform: translateY(-5px);
}

.survivor-card-portrait,
.survivor-card-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.survivor-card-portrait {
    object-fit: cover;
    object-position: center top;
    transition: transform 0.35s ease;
}

.survivor-card:hover .survivor-card-portrait {
    transform: scale(1.025);
}

.survivor-card-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, #1e293b, #020617);
    color: #64748b;
    font-size: 3rem;
}

.survivor-card-badge {
    position: absolute;
    z-index: 2;
    top: 0.65rem;
    left: 0.65rem;
    padding: 0.22rem 0.48rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.78);
    color: #dbeafe;
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    backdrop-filter: blur(6px);
}

.survivor-card[data-unit-kind="player"] .survivor-card-badge {
    border-color: rgba(250, 204, 21, 0.55);
    color: #fde68a;
}

.survivor-card-content {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 1rem 0.85rem 0.85rem;
}

.survivor-card-name {
    display: block;
    overflow: hidden;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    text-shadow: 0 2px 10px #000;
    white-space: nowrap;
}

.survivor-card-role {
    display: block;
    margin-top: 0.2rem;
    overflow: hidden;
    color: #cbd5e1;
    font-size: 0.67rem;
    letter-spacing: 0.06em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.survivor-health-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.65rem;
    color: #e2e8f0;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.survivor-health-track {
    height: 0.42rem;
    margin-top: 0.28rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
}

.survivor-health-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #15803d, #4ade80);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.survivor-health-fill[data-health="wounded"] {
    background: linear-gradient(90deg, #b45309, #fbbf24);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.45);
}

.survivor-health-fill[data-health="critical"] {
    background: linear-gradient(90deg, #991b1b, #ef4444);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.survivor-card-ai {
    display: block;
    max-height: 0;
    overflow: hidden;
    color: #93c5fd;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    opacity: 0;
    text-align: right;
    transition: max-height 0.2s ease, margin-top 0.2s ease, opacity 0.2s ease;
}

.survivor-card:hover .survivor-card-ai,
.survivor-card:focus-visible .survivor-card-ai {
    max-height: 2rem;
    margin-top: 0.5rem;
    opacity: 1;
}

.survivor-card-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
    gap: 0.4rem;
    min-width: 0;
}

.survivor-chat-button,
.survivor-reaction-button {
    width: 100%;
    border: 1px solid rgba(96, 165, 250, 0.52);
    border-radius: 0.55rem;
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.88), rgba(30, 58, 138, 0.9));
    color: #eff6ff;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    box-shadow: 0 8px 22px rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(8px);
}

.survivor-chat-button:hover,
.survivor-chat-button:focus-visible,
.survivor-reaction-button:hover,
.survivor-reaction-button:focus-visible {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.3);
    outline: none;
}

.survivor-reaction-button {
    border-color: rgba(245, 158, 11, 0.58);
    background: linear-gradient(180deg, rgba(146, 64, 14, 0.94), rgba(120, 53, 15, 0.94));
    color: #fff7ed;
    font-size: 0.59rem;
    letter-spacing: 0.1em;
}

.survivor-reaction-button:hover,
.survivor-reaction-button:focus-visible {
    border-color: #fbbf24;
    background: linear-gradient(180deg, #b45309, #92400e);
    box-shadow: 0 10px 26px rgba(245, 158, 11, 0.25);
}

.survivor-reaction-button:disabled,
.survivor-chat-button:disabled {
    cursor: wait;
    filter: grayscale(.45);
    opacity: .55;
}

.survivor-chat-spacer {
    visibility: hidden;
}

.companion-chat-window {
    display: flex;
    flex-direction: column;
    width: min(760px, calc(100vw - 2rem));
    max-height: min(780px, calc(100vh - 2rem));
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, 0.42);
    border-radius: 1rem;
    background:
        radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.18), transparent 35%),
        linear-gradient(155deg, rgba(15, 23, 42, 0.99), rgba(2, 6, 23, 0.99));
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.78), 0 0 35px rgba(37, 99, 235, 0.12);
}

.companion-chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.17);
    background: rgba(15, 23, 42, 0.72);
}

.companion-chat-portrait {
    width: 72px;
    height: 88px;
    flex: 0 0 auto;
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 0.65rem;
    background: #0f172a;
    object-fit: cover;
    object-position: center 20%;
}

.companion-chat-kicker {
    margin: 0;
    color: #60a5fa;
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.2em;
}

.companion-chat-name {
    margin: 0.18rem 0 0;
    overflow: hidden;
    color: #f8fafc;
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.companion-chat-role {
    margin: 0.28rem 0 0;
    color: #94a3b8;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.companion-chat-close {
    align-self: flex-start;
    padding: 0.38rem 0.62rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.45rem;
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 900;
}

.companion-chat-content {
    min-height: 320px;
    max-height: 480px;
    overflow-y: auto;
    padding: 0.85rem 1rem;
    scrollbar-color: #334155 transparent;
}

.companion-chat-empty {
    max-width: 460px;
    margin: 6rem auto;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.6;
    text-align: center;
}

.companion-chat-message {
    display: flex;
    flex-direction: column;
    max-width: 78%;
    margin-bottom: 0.55rem;
}

.companion-chat-message.player {
    align-items: flex-end;
    margin-left: auto;
}

.companion-chat-message.companion {
    align-items: flex-start;
    margin-right: auto;
}

.companion-chat-speaker {
    margin-bottom: 0.15rem;
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.companion-chat-bubble {
    padding: 0.52rem 0.72rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0.8rem 0.8rem 0.8rem 0.2rem;
    background: rgba(30, 41, 59, 0.78);
    color: #e2e8f0;
    font-size: 0.8rem;
    line-height: 1.35;
}

.companion-chat-message.player .companion-chat-bubble {
    border-color: rgba(96, 165, 250, 0.3);
    border-radius: 0.8rem 0.8rem 0.2rem 0.8rem;
    background: rgba(30, 64, 175, 0.5);
    color: #eff6ff;
}

.companion-chat-status {
    min-height: 1.8rem;
    padding: 0.35rem 1.2rem;
    color: #93c5fd;
    font-size: 0.66rem;
    font-style: italic;
}

.companion-chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    padding: 0.9rem 1rem 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 6, 23, 0.7);
}

#companion-chat-input {
    width: 100%;
    border: 1px solid rgba(100, 116, 139, 0.55);
    border-radius: 0.55rem;
    background: rgba(15, 23, 42, 0.9);
    color: #f8fafc;
    padding: 0.72rem 0.85rem;
    outline: none;
}

#companion-chat-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

#companion-chat-send {
    min-width: 92px;
    border: 1px solid #3b82f6;
    border-radius: 0.55rem;
    background: #1d4ed8;
    color: #fff;
    padding: 0.65rem 1rem;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

#companion-chat-send:disabled,
#companion-chat-input:disabled {
    cursor: wait;
    opacity: 0.55;
}

.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
    gap: 1rem;
}

.unit-frame {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    min-height: 370px;
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.96), rgba(3, 7, 18, 0.92));
    border: 1px solid rgba(96, 165, 250, 0.3);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.unit-frame[data-unit-kind="player"] {
    border-color: rgba(250, 204, 21, 0.55);
}

.unit-avatar-stage {
    min-height: 370px;
    background:
        radial-gradient(circle at 50% 30%, rgba(59, 130, 246, 0.25), transparent 48%),
        linear-gradient(180deg, rgba(30, 41, 59, 0.8), rgba(2, 6, 23, 0.98));
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
}

.unit-avatar-stage img {
    width: 100%;
    height: 100%;
    max-height: 370px;
    object-fit: contain;
    object-position: center bottom;
}

.unit-avatar-placeholder {
    align-self: center;
    color: #64748b;
    text-align: center;
    padding: 1rem;
}

.unit-avatar-action {
    position: absolute;
    left: 0.6rem;
    right: 0.6rem;
    bottom: 0.6rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 0.35rem;
    background: rgba(3, 7, 18, 0.88);
    color: #bfdbfe;
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(6px);
}

.unit-sheet {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
}

.unit-field-label {
    display: block;
    margin-bottom: 0.2rem;
    color: #94a3b8;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.unit-input,
.unit-textarea {
    width: 100%;
    border: 1px solid rgba(100, 116, 139, 0.45);
    border-radius: 0.35rem;
    background: rgba(2, 6, 23, 0.72);
    color: #e2e8f0;
    padding: 0.5rem 0.6rem;
    font-size: 0.78rem;
    line-height: 1.45;
    outline: none;
}

.unit-input:focus,
.unit-textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.unit-textarea {
    resize: vertical;
}

.unit-master-prompt {
    min-height: 125px;
}

.credit-balance {
    min-width: 9rem;
    padding: .42rem .8rem;
    border: 1px solid rgba(245, 158, 11, .38);
    border-radius: 999px;
    background: rgba(3, 7, 18, .82);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .4), inset 0 0 20px rgba(245, 158, 11, .05);
    color: #fcd34d;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-align: center;
    text-transform: uppercase;
}
.credit-balance.is-locked { color: #fca5a5; border-color: rgba(239, 68, 68, .45); }
.byok-unlock-badge,
.rpg-byok-badge {
    border: 1px solid rgba(96, 165, 250, .78);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(29, 78, 216, .96), rgba(37, 99, 235, .88));
    box-shadow: 0 10px 34px rgba(37, 99, 235, .28), inset 0 1px 0 rgba(255, 255, 255, .16);
    color: #eff6ff;
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .085em;
    text-transform: uppercase;
}
.byok-unlock-badge { padding: .52rem .85rem; }
.rpg-byok-badge { margin-left: .35rem; padding: .62rem .95rem; }
.byok-unlock-badge:hover,
.rpg-byok-badge:hover { border-color: #bfdbfe; background: linear-gradient(135deg, #2563eb, #3b82f6); }
.byok-unlock-badge.is-active,
.rpg-byok-badge.is-active { border-color: rgba(52, 211, 153, .7); background: rgba(6, 95, 70, .88); box-shadow: 0 10px 30px rgba(5, 150, 105, .2); }
.license-window { position:relative; width:min(520px, calc(100vw - 2rem)); padding:2.25rem; border:1px solid rgba(245,158,11,.38); border-radius:1rem; background:radial-gradient(circle at 85% 0%, rgba(120,53,15,.28), transparent 42%), #070b13; box-shadow:0 30px 100px rgba(0,0,0,.8); color:#e5e7eb; }
#license-modal {
    position: fixed !important;
    z-index: 10050 !important;
    isolation: isolate;
}
.license-close { position:absolute; top:1rem; right:1rem; color:#94a3b8; font-size:.75rem; }
.license-kicker { margin:0 0 .55rem; color:#fbbf24; font-size:.65rem; font-weight:800; letter-spacing:.18em; }
.license-window h2 { margin:0; color:#fff; font:700 2rem/1.05 Georgia,serif; }
.license-copy { margin:.8rem 0 1.2rem; color:#94a3b8; font-size:.86rem; line-height:1.55; }
.license-balance { padding:.85rem 1rem; border:1px solid rgba(148,163,184,.2); border-radius:.55rem; background:rgba(15,23,42,.7); color:#f8fafc; font-weight:700; }
.license-form { margin-top:1.2rem; }
.license-form label { display:block; margin-bottom:.4rem; color:#cbd5e1; font-size:.68rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.license-input-row { display:grid; grid-template-columns:1fr auto; gap:.55rem; }
.license-input-row input { min-width:0; border:1px solid #334155; border-radius:.45rem; background:#020617; color:#fff; padding:.72rem .8rem; outline:none; }
.license-input-row input:focus { border-color:#f59e0b; box-shadow:0 0 0 2px rgba(245,158,11,.12); }
.license-input-row button,.license-buy { border:1px solid #d97706; border-radius:.45rem; background:#92400e; color:#fff7ed; padding:.72rem 1rem; font-size:.7rem; font-weight:800; letter-spacing:.08em; text-decoration:none; }
.license-status { min-height:1.25rem; margin:.65rem 0 0; color:#fca5a5; font-size:.75rem; }
.license-actions { display:flex; align-items:center; gap:1rem; margin-top:.75rem; }
.license-remove { color:#94a3b8; font-size:.7rem; text-decoration:underline; }
.license-privacy { margin:1.25rem 0 0; color:#64748b; font-size:.66rem; line-height:1.5; }
.license-check { display:flex; align-items:center; gap:.45rem; margin-top:.7rem; color:#cbd5e1; font-size:.7rem; cursor:pointer; }
.license-check input { accent-color:#f59e0b; }
.byok-wallet { margin-top:1.25rem; padding-top:1.25rem; border-top:1px solid rgba(148,163,184,.2); }
.byok-wallet h3 { margin:0; color:#f8fafc; font:700 1.05rem/1.2 Georgia,serif; }
.byok-wallet > p:not(.license-kicker):not(.license-privacy) { margin:.45rem 0 .8rem; color:#94a3b8; font-size:.78rem; line-height:1.45; }
.byok-status { min-height:1.15rem; margin:.55rem 0 0; color:#86efac !important; font-size:.72rem !important; }

/* Temporary BYOK-only operating mode. */
.license-window {
    border-color: rgba(96, 165, 250, .48);
    background: radial-gradient(circle at 88% 0%, rgba(29, 78, 216, .3), transparent 44%), #070b13;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .84), 0 0 55px rgba(37, 99, 235, .12);
}
.license-kicker { color: #7db1ff; }
.license-status { color: #bfdbfe; }
.byok-wallet-primary { margin-top: 1.1rem; padding: 1.2rem; border: 1px solid rgba(96, 165, 250, .32); border-radius: .72rem; background: rgba(10, 22, 45, .72); }
.byok-wallet-primary .license-input-row button { border-color: #60a5fa; background: linear-gradient(135deg, #1d4ed8, #2563eb); color: #eff6ff; }
.byok-wallet-primary .license-input-row input:focus { border-color: #60a5fa; box-shadow: 0 0 0 2px rgba(59, 130, 246, .16); }
.byok-wallet-primary .license-check input { accent-color: #3b82f6; }
.serial-access-paused { margin-top: 1rem; border-style: dashed; color: #64748b; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.serial-controls-disabled { opacity: .34; filter: grayscale(1); pointer-events: none; user-select: none; }
.serial-controls-disabled input,
.serial-controls-disabled button { cursor: not-allowed; }

.share-window { position:relative; width:min(440px, calc(100vw - 2rem)); padding:2rem; border:1px solid rgba(59,130,246,.55); border-radius:1rem; background:radial-gradient(circle at 85% 0%, rgba(30,64,175,.32), transparent 43%), #070b13; box-shadow:0 30px 100px rgba(0,0,0,.82), 0 0 45px rgba(37,99,235,.12); color:#e5e7eb; }
.share-close { position:absolute; top:1rem; right:1rem; color:#94a3b8; font-size:.75rem; }
.share-kicker { margin:0 0 .55rem; color:#60a5fa; font-size:.64rem; font-weight:800; letter-spacing:.18em; }
.share-window h2 { margin:0; color:#fff; font:700 1.8rem/1.08 Georgia,serif; }
.share-copy { margin:.7rem 0 1.15rem; color:#94a3b8; font-size:.82rem; line-height:1.5; }
.share-gift-panel { padding:1rem; border:1px solid rgba(96,165,250,.25); border-radius:.7rem; background:rgba(15,23,42,.72); }
.share-gift-panel legend { padding:0 .25rem; color:#f8fafc; font-size:.88rem; font-weight:700; line-height:1.45; }
.share-choice-row { display:grid; grid-template-columns:1fr 1fr; gap:.6rem; margin-top:.85rem; }
.share-choice-row button { padding:.62rem; border:1px solid #334155; border-radius:.5rem; background:#111827; color:#94a3b8; font-size:.72rem; font-weight:900; letter-spacing:.12em; transition:.16s ease; }
.share-choice-row button:hover:not(:disabled) { border-color:#60a5fa; color:#dbeafe; }
.share-choice-row button.is-selected { border-color:#3b82f6; background:#1d4ed8; color:#fff; box-shadow:0 7px 25px rgba(37,99,235,.24); }
.share-choice-row button:disabled { cursor:not-allowed; border-color:#1f2937; background:#0b1020; color:#475569; opacity:.58; }
.share-gift-status { min-height:2rem; margin:.7rem 0 0; color:#fca5a5; font-size:.7rem; line-height:1.4; }
.share-gift-status.is-ready { color:#86efac; }
.share-final-note { margin:.9rem 0; color:#64748b; font-size:.67rem; line-height:1.45; }
.share-url-output { width:100%; margin:0 0 .65rem; padding:.65rem .7rem; border:1px solid #334155; border-radius:.45rem; background:#020617; color:#bfdbfe; font-size:.7rem; outline:none; }
.share-copy-button { width:100%; padding:.8rem 1rem; border:1px solid #60a5fa; border-radius:.55rem; background:linear-gradient(135deg,#1d4ed8,#2563eb); color:#eff6ff; box-shadow:0 12px 32px rgba(29,78,216,.28); font-size:.75rem; font-weight:900; letter-spacing:.12em; }
.share-copy-button:hover:not(:disabled) { background:linear-gradient(135deg,#2563eb,#3b82f6); }
.share-copy-button:disabled { cursor:wait; opacity:.58; }

.discussion-message {
    border-left: 2px solid #a78bfa;
    padding: 0.48rem 0.65rem;
    margin-bottom: 0.5rem;
    background: rgba(30, 27, 75, 0.32);
    border-radius: 0 0.4rem 0.4rem 0;
    font-size: 0.9rem;
    line-height: 1.35;
}

.discussion-message.interrupt {
    border-left-color: #f59e0b;
    background: rgba(120, 53, 15, 0.28);
}

.discussion-message.agency {
    border-left-color: #f97316;
    background: linear-gradient(90deg, rgba(124, 45, 18, .34), rgba(67, 20, 7, .12));
    box-shadow: inset 0 0 22px rgba(249, 115, 22, .04);
}

.discussion-speaker {
    color: #c4b5fd;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 900px) {
    .survivor-roster {
        top: 5rem;
        right: 1rem;
        bottom: auto;
        left: 1rem;
    }
    .survivor-roster-list {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
    .survivor-card { height: 245px; }
    .survivor-card-shell { grid-template-rows: 245px 34px; }
    .survivor-chat-button { font-size: 0.58rem; }
    .companion-chat-content { min-height: 260px; }
    .unit-grid { grid-template-columns: 1fr; }
    .unit-frame { grid-template-columns: 140px minmax(0, 1fr); }
    .unit-avatar-stage { min-height: 330px; }
}
