/* ===================================================================
 * Campaign — themed CSS for the 12 story locations.
 *
 * Each location class drops onto the campaign-stage element and provides:
 *   1. a fallback gradient background (for when no real bg image is loaded)
 *   2. a tinted ::after vignette/atmosphere overlay
 *   3. accent colors for the location nameplate / nodes
 *
 * When real exterior/interior background images arrive, drop them into
 * /rice-street/bg/ and add a `background-image:` line to the matching
 * theme — the gradient stays as fallback.
 * =================================================================== */

/* Background lives on its own fixed layer — full viewport, never scrolls,
   floats behind the content. The content layer (#campaign-stage) stays
   transparent and scrolls normally. The theme classes apply to the
   background layer (#campaign-bg). */
#campaign-bg {
    /* Hard-locked to the visible viewport so the artwork never extends past
       what the user can see. Belt-and-suspenders explicit sizing because
       inset:0 alone wasn't enough on mobile (iOS in particular). 100dvh
       uses the *dynamic* viewport on mobile (collapses with the address
       bar) and falls back to 100vh on browsers that don't support it. */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    z-index: 0;
    background-size: cover !important;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    transition: background-image 0.6s ease;
    pointer-events: none;
    overflow: hidden;
}
#campaign-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.55) 100%);
}
#campaign-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    color: var(--ivory);
    font-family: 'Inter', sans-serif;
    background: transparent;
}
#campaign-stage > * { position: relative; z-index: 1; }

/* Two-mode location backdrops:
 *   default (just .theme-X)        → OUTSIDE establishing shot (used on the map)
 *   .theme-X.mode-inside           → INSIDE dialogue backdrop (used when an
 *                                    overlay opens — feels like "going in")
 *
 * Gradient stays as bottom layer so a missing image falls back gracefully.
 */

.theme-main-floor                 { background-image: url('../bg/outside-01-main-entrance.jpg'),
                                                       linear-gradient(135deg, #1d4d35 0%, #0a2e1c 60%, #050a08 100%); }
.theme-main-floor.mode-inside     { background-image: url('../bg/inside-01-main-floor.jpg'),
                                                       linear-gradient(135deg, #1d4d35 0%, #0a2e1c 60%, #050a08 100%); }
.theme-main-floor .location-accent { color: #d4af37; }

.theme-salon                      { background-image: url('../bg/outside-02-salon.jpg'),
                                                       linear-gradient(160deg, #093d28 0%, #042418 70%, #02110b 100%); }
.theme-salon.mode-inside          { background-image: url('../bg/inside-02-salon.jpg'),
                                                       linear-gradient(160deg, #093d28 0%, #042418 70%, #02110b 100%); }
.theme-salon .location-accent     { color: #f0d879; }

.theme-cabaret                    { background-image: url('../bg/outside-03-cabaret.jpg'),
                                                       linear-gradient(160deg, #4a0a1a 0%, #220505 60%, #100202 100%); }
.theme-cabaret.mode-inside        { background-image: url('../bg/inside-03-cabaret.jpg'),
                                                       linear-gradient(160deg, #4a0a1a 0%, #220505 60%, #100202 100%); }
.theme-cabaret .location-accent   { color: #e879a5; }

.theme-spa                        { background-image: url('../bg/outside-04-rooftop-spa.jpg'),
                                                       linear-gradient(160deg, #0c2538 0%, #1a1545 60%, #420a3d 100%); }
.theme-spa.mode-inside            { background-image: url('../bg/inside-04-rooftop-spa.jpg'),
                                                       linear-gradient(160deg, #0c2538 0%, #1a1545 60%, #420a3d 100%); }
.theme-spa .location-accent       { color: #66ccff; }

.theme-cigar                      { background-image: url('../bg/outside-05-cigar-lounge.jpg'),
                                                       linear-gradient(160deg, #3a2410 0%, #1a1208 60%, #0a0604 100%); }
.theme-cigar.mode-inside          { background-image: url('../bg/inside-05-cigar-lounge.jpg'),
                                                       linear-gradient(160deg, #3a2410 0%, #1a1208 60%, #0a0604 100%); }
.theme-cigar .location-accent     { color: #c89a4a; }

.theme-counting                   { background-image: url('../bg/outside-06-counting-room.jpg'),
                                                       linear-gradient(160deg, #1a2418 0%, #0a1208 60%, #050805 100%); }
.theme-counting.mode-inside       { background-image: url('../bg/inside-06-counting-room.jpg'),
                                                       linear-gradient(160deg, #1a2418 0%, #0a1208 60%, #050805 100%); }
.theme-counting .location-accent  { color: #c8e890; }

.theme-sportsbook                 { background-image: url('../bg/outside-07-sportsbook.jpg'),
                                                       linear-gradient(160deg, #0a3520 0%, #051a10 60%, #020805 100%); }
.theme-sportsbook.mode-inside     { background-image: url('../bg/inside-07-sportsbook.jpg'),
                                                       linear-gradient(160deg, #0a3520 0%, #051a10 60%, #020805 100%); }
.theme-sportsbook .location-accent{ color: #4adc8a; }

.theme-diner                      { background-image: url('../bg/outside-08-diner.jpg'),
                                                       linear-gradient(160deg, #2a0a0a 0%, #100404 60%, #2a1a3a 100%); }
.theme-diner.mode-inside          { background-image: url('../bg/inside-08-diner.jpg'),
                                                       linear-gradient(160deg, #2a0a0a 0%, #100404 60%, #2a1a3a 100%); }
.theme-diner .location-accent     { color: #ff5a5a; }

.theme-koi                        { background-image: url('../bg/outside-09-koi-lounge.jpg'),
                                                       linear-gradient(160deg, #4a0a1a 0%, #1a0410 60%, #0a020a 100%); }
.theme-koi.mode-inside            { background-image: url('../bg/inside-09-koi-lounge.jpg'),
                                                       linear-gradient(160deg, #4a0a1a 0%, #1a0410 60%, #0a020a 100%); }
.theme-koi .location-accent       { color: #ff8aaa; }

.theme-chapel                     { background-image: url('../bg/outside-10-chapel.jpg'),
                                                       linear-gradient(160deg, #6a1a4a 0%, #2a0a2a 60%, #100410 100%); }
.theme-chapel.mode-inside         { background-image: url('../bg/inside-10-chapel.jpg'),
                                                       linear-gradient(160deg, #6a1a4a 0%, #2a0a2a 60%, #100410 100%); }
.theme-chapel .location-accent    { color: #ffb6e0; }

.theme-fight-pit                  { background-image: url('../bg/outside-11-fight-pit.jpg'),
                                                       linear-gradient(160deg, #2a0505 0%, #100202 60%, #050102 100%); }
.theme-fight-pit.mode-inside      { background-image: url('../bg/inside-11-fight-pit.jpg'),
                                                       linear-gradient(160deg, #2a0505 0%, #100202 60%, #050102 100%); }
.theme-fight-pit .location-accent { color: #ff3030; }

.theme-devils-lair                { background-image: url('../bg/outside-12-devils-lair.jpg'),
                                                       linear-gradient(160deg, #4a0a05 0%, #1a0202 50%, #2a0a3a 100%); }
.theme-devils-lair.mode-inside    { background-image: url('../bg/inside-12-devils-lair.jpg'),
                                                       linear-gradient(160deg, #4a0a05 0%, #1a0202 50%, #2a0a3a 100%); }
.theme-devils-lair .location-accent { color: #ff7d57; }

/* --- New story-specific locations --- */
.theme-gulf                       { background-image: url('../bg/outside-13-gulf.jpg'),
                                                       linear-gradient(180deg, #05282c 0%, #0a1a2a 55%, #020810 100%); }
.theme-gulf.mode-inside           { background-image: url('../bg/inside-13-gulf.jpg'),
                                                       linear-gradient(180deg, #05282c 0%, #0a1a2a 55%, #020810 100%); }
.theme-gulf .location-accent      { color: #9fe4d0; }

.theme-vault                      { background-image: url('../bg/outside-14-vault.jpg'),
                                                       linear-gradient(160deg, #1a2418 0%, #2a1a08 55%, #0a0805 100%); }
.theme-vault.mode-inside          { background-image: url('../bg/inside-14-vault.jpg'),
                                                       linear-gradient(160deg, #1a2418 0%, #2a1a08 55%, #0a0805 100%); }
.theme-vault .location-accent     { color: #d8c078; }

.theme-seance                     { background-image: url('../bg/outside-15-seance.jpg'),
                                                       linear-gradient(180deg, #30104a 0%, #1a0a2a 60%, #0a0410 100%); }
.theme-seance.mode-inside         { background-image: url('../bg/inside-15-seance.jpg'),
                                                       linear-gradient(180deg, #30104a 0%, #1a0a2a 60%, #0a0410 100%); }
.theme-seance .location-accent    { color: #e4a070; }

.theme-under-table                { background-image: url('../bg/outside-16-under-table.jpg'),
                                                       linear-gradient(180deg, #2a2418 0%, #1a2028 55%, #050810 100%); }
.theme-under-table.mode-inside    { background-image: url('../bg/inside-16-under-table.jpg'),
                                                       linear-gradient(180deg, #2a2418 0%, #1a2028 55%, #050810 100%); }
.theme-under-table .location-accent { color: #c8d8e8; }

.theme-racetrack                  { background-image: url('../bg/outside-17-racetrack.jpg'),
                                                       linear-gradient(180deg, #1a3020 0%, #2a2810 55%, #080504 100%); }
.theme-racetrack.mode-inside      { background-image: url('../bg/inside-17-racetrack.jpg'),
                                                       linear-gradient(180deg, #1a3020 0%, #2a2810 55%, #080504 100%); }
.theme-racetrack .location-accent { color: #d8b878; }

.theme-furrier                    { background-image: url('../bg/outside-18-furrier.jpg'),
                                                       linear-gradient(160deg, #3a2818 0%, #1a1208 55%, #0a0804 100%); }
.theme-furrier.mode-inside        { background-image: url('../bg/inside-18-furrier.jpg'),
                                                       linear-gradient(160deg, #3a2818 0%, #1a1208 55%, #0a0804 100%); }
.theme-furrier .location-accent   { color: #d8a868; }

.theme-print-shop                 { background-image: url('../bg/outside-19-print-shop.jpg'),
                                                       linear-gradient(180deg, #28201a 0%, #181208 55%, #050402 100%); }
.theme-print-shop.mode-inside     { background-image: url('../bg/inside-19-print-shop.jpg'),
                                                       linear-gradient(180deg, #28201a 0%, #181208 55%, #050402 100%); }
.theme-print-shop .location-accent { color: #c8a868; }

.theme-docks                      { background-image: url('../bg/outside-20-docks.jpg'),
                                                       linear-gradient(180deg, #0a1a2a 0%, #12202e 55%, #020810 100%); }
.theme-docks.mode-inside          { background-image: url('../bg/inside-20-docks.jpg'),
                                                       linear-gradient(180deg, #0a1a2a 0%, #12202e 55%, #020810 100%); }
.theme-docks .location-accent     { color: #a8c8e8; }

.theme-penthouse                  { background-image: url('../bg/outside-21-penthouse.jpg'),
                                                       linear-gradient(180deg, #0a0a14 0%, #100a1a 55%, #020204 100%); }
.theme-penthouse.mode-inside      { background-image: url('../bg/inside-21-penthouse.jpg'),
                                                       linear-gradient(180deg, #0a0a14 0%, #100a1a 55%, #020204 100%); }
.theme-penthouse .location-accent { color: #e8d470; }

.theme-archives                   { background-image: url('../bg/outside-22-archives.jpg'),
                                                       linear-gradient(160deg, #182818 0%, #2a1a08 55%, #0a0805 100%); }
.theme-archives.mode-inside       { background-image: url('../bg/inside-22-archives.jpg'),
                                                       linear-gradient(160deg, #182818 0%, #2a1a08 55%, #0a0805 100%); }
.theme-archives .location-accent  { color: #b8d478; }

/* --- Generic theme groups for the 28 expansion locations. Each one is
       applied to multiple locations; individual bg images ride on
       body.story-mode.location-X via --loc-bg-image in campaign-board.css.
       For the MAP THUMBNAIL (location header) these still use their own
       gradient fallback since we can't tie bg-image to this selector
       (no parent-aware CSS), so we skip the inside-*.jpg href here —
       the per-location story-node thumbnails in index render already
       use loc.bgOutside slugs directly. */
.theme-generic-ruby                  { background-image: linear-gradient(160deg, #440a12 0%, #200408 60%, #100204 100%); }
.theme-generic-ruby.mode-inside      { background-image: linear-gradient(160deg, #440a12 0%, #200408 60%, #100204 100%); }
.theme-generic-ruby .location-accent { color: #ff8090; }

.theme-generic-green                 { background-image: linear-gradient(160deg, #0a3018 0%, #041808 60%, #02100a 100%); }
.theme-generic-green.mode-inside     { background-image: linear-gradient(160deg, #0a3018 0%, #041808 60%, #02100a 100%); }
.theme-generic-green .location-accent{ color: #d0ff90; }

.theme-generic-rose                  { background-image: linear-gradient(160deg, #3a0818 0%, #200410 60%, #100208 100%); }
.theme-generic-rose.mode-inside      { background-image: linear-gradient(160deg, #3a0818 0%, #200410 60%, #100208 100%); }
.theme-generic-rose .location-accent { color: #ffb0c8; }

.theme-generic-jade                  { background-image: linear-gradient(160deg, #0a2820 0%, #041812 60%, #020808 100%); }
.theme-generic-jade.mode-inside      { background-image: linear-gradient(160deg, #0a2820 0%, #041812 60%, #020808 100%); }
.theme-generic-jade .location-accent { color: #a0ffcc; }

.theme-generic-steel                 { background-image: linear-gradient(160deg, #1a1e24 0%, #0c1014 60%, #050608 100%); }
.theme-generic-steel.mode-inside     { background-image: linear-gradient(160deg, #1a1e24 0%, #0c1014 60%, #050608 100%); }
.theme-generic-steel .location-accent{ color: #c0d0e0; }

.theme-generic-aqua                  { background-image: linear-gradient(180deg, #05282c 0%, #0a1a2a 55%, #020810 100%); }
.theme-generic-aqua.mode-inside      { background-image: linear-gradient(180deg, #05282c 0%, #0a1a2a 55%, #020810 100%); }
.theme-generic-aqua .location-accent { color: #c8ffe8; }

.theme-generic-amber                 { background-image: linear-gradient(160deg, #3a2008 0%, #1c1004 60%, #0a0602 100%); }
.theme-generic-amber.mode-inside     { background-image: linear-gradient(160deg, #3a2008 0%, #1c1004 60%, #0a0602 100%); }
.theme-generic-amber .location-accent{ color: #ffd080; }

.theme-generic-violet                { background-image: linear-gradient(180deg, #30104a 0%, #1a0a2a 60%, #0a0410 100%); }
.theme-generic-violet.mode-inside    { background-image: linear-gradient(180deg, #30104a 0%, #1a0a2a 60%, #0a0410 100%); }
.theme-generic-violet .location-accent { color: #e0a8ff; }

.story-node.theme-generic-ruby   { border-color: rgba(255,128,144,0.55); }
.story-node.theme-generic-green  { border-color: rgba(208,255,144,0.55); }
.story-node.theme-generic-rose   { border-color: rgba(255,176,200,0.55); }
.story-node.theme-generic-jade   { border-color: rgba(160,255,204,0.55); }
.story-node.theme-generic-steel  { border-color: rgba(192,208,224,0.55); }
.story-node.theme-generic-aqua   { border-color: rgba(200,255,232,0.55); }
.story-node.theme-generic-amber  { border-color: rgba(255,208,128,0.55); }
.story-node.theme-generic-violet { border-color: rgba(224,168,255,0.55); }

/* ===================================================================
 * Map / node graph
 * =================================================================== */
.story-header {
    text-align: center;
    padding: 24px 16px 8px;
}
.story-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(28px, 5vw, 44px);
    letter-spacing: 6px;
    color: var(--gold);
    margin: 0 0 4px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.story-header .sub {
    font-size: 12px;
    letter-spacing: 4px;
    color: var(--ash);
    text-transform: uppercase;
}
/* Character-selection grid. Two modes:
 *   default (above the map): compact horizontal rows (not currently used —
 *     the post-pick view hides the picker entirely)
 *   .story-picker-fullscreen: the landing grid when a session starts — big
 *     portrait tiles arranged in a responsive grid, centered.
 */
.story-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    max-width: 1100px;
    margin: 16px auto;
    padding: 0 16px;
}
.story-picker-fullscreen {
    /* Desktop: responsive auto-fit with sane tile sizes. Mobile falls
       through to the .story-picker-fullscreen @media rule below, which
       forces at least 2 columns so the grid never collapses to a single
       stacked list. */
    grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
    justify-content: center;
    gap: 24px;
    max-width: 1200px;
    margin: 80px auto 40px;
    padding: 0 24px;
}
/* Mobile: always at least 2 columns. Tiles shrink to fit. */
@media (max-width: 720px) {
    .story-picker-fullscreen {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-top: 60px;
        padding: 0 12px;
    }
    .story-picker-fullscreen .story-pick { padding: 12px; }
    .story-picker-fullscreen .story-pick-portrait {
        width: 110px;
        height: 110px;
    }
    .story-picker-fullscreen .story-pick-meta h3 {
        font-size: 15px;
        letter-spacing: 2px;
    }
    .story-picker-fullscreen .story-pick-sub {
        font-size: 11px;
        min-height: 0;
    }
    .story-picker-fullscreen .story-pick-btn {
        padding: 8px;
        font-size: 11px;
        letter-spacing: 2px;
    }
}
.story-picker-fullscreen::before {
    content: 'Choose your story';
    grid-column: 1 / -1;
    text-align: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(28px, 5vw, 48px);
    letter-spacing: 8px;
    color: var(--gold);
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
    margin-bottom: 12px;
}
.story-pick {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(28,28,28,0.85), rgba(8,8,8,0.95));
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 10px;
    transition: all 0.2s;
}
/* Fullscreen grid: switch each tile to vertical layout with big portrait. */
.story-picker-fullscreen .story-pick {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
}
.story-picker-fullscreen .story-pick:hover:not(.locked) {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.55), 0 0 16px rgba(212,175,55,0.25);
}
/* Locked tiles stay fully opaque — they're "mystery" cards with a solid
   background, not a faded version of the real tile. No transparency, no
   grayscale filter; the ? glyph + "???" title carries the meaning. */
.story-pick.locked {
    cursor: default;
    background: linear-gradient(180deg, rgba(18,18,18,0.95), rgba(6,6,6,1));
    border-color: rgba(80,80,80,0.5);
}
.story-pick.locked .story-pick-meta h3 { color: #888; letter-spacing: 6px; }
.story-pick-mystery {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 88px;
    color: rgba(212,175,55,0.5);
    text-shadow: 0 2px 6px rgba(0,0,0,0.85);
    background:
        radial-gradient(circle at center, rgba(40,36,24,0.85), rgba(6,4,0,1)) !important;
    border-color: rgba(120,100,60,0.6) !important;
}
.story-pick-portrait {
    width: 56px;
    height: 56px;
    object-fit: cover;
    object-position: center top;
    border-radius: 50%;
    border: 1px solid rgba(212,175,55,0.4);
    background: rgba(0,0,0,0.4);
    flex-shrink: 0;
}
.story-picker-fullscreen .story-pick-portrait {
    width: 180px;
    height: 180px;
    align-self: center;
    border-width: 2px;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
}
.story-pick-meta { flex: 1; min-width: 0; }
.story-picker-fullscreen .story-pick-meta { flex: 0; }
.story-pick-meta h3 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    color: var(--gold);
    letter-spacing: 1px;
}
.story-picker-fullscreen .story-pick-meta h3 {
    font-size: 22px;
    letter-spacing: 3px;
    margin-bottom: 4px;
}
.story-pick-sub {
    font-size: 11px;
    color: var(--ash);
    line-height: 1.3;
    margin-top: 2px;
}
.story-picker-fullscreen .story-pick-sub {
    font-size: 12px;
    line-height: 1.4;
    min-height: 42px;
}
.story-pick-btn {
    padding: 6px 12px;
    background: linear-gradient(180deg, var(--gold), #a88420);
    color: #0a0a0a;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
}
.story-picker-fullscreen .story-pick-btn {
    padding: 12px;
    font-size: 13px;
    letter-spacing: 3px;
}
.story-pick-btn:disabled { opacity: 0.5; cursor: default; background: rgba(60,60,60,0.6); color: var(--ash); }

.story-map {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    max-width: 1100px;
    margin: 16px auto;
    padding: 0 16px;
}
.story-node {
    background: linear-gradient(180deg, rgba(20,20,20,0.85), rgba(8,8,8,0.95));
    border: 1px solid rgba(212,175,55,0.35);
    border-radius: 10px;
    padding: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.story-node-thumb {
    width: 100%;
    aspect-ratio: 16 / 7;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(212,175,55,0.3);
}
.story-node-body { padding: 14px 18px 16px; flex: 1; display: flex; flex-direction: column; }
.story-node-body button.enter { margin-top: auto; }
/* Per-location card border-glow uses the same accent color as the theme */
.story-node.theme-main-floor    { border-color: rgba(212,175,55,0.55); }
.story-node.theme-salon         { border-color: rgba(240,216,121,0.55); }
.story-node.theme-cabaret       { border-color: rgba(232,121,165,0.55); }
.story-node.theme-spa           { border-color: rgba(102,204,255,0.55); }
.story-node.theme-cigar         { border-color: rgba(200,154,74,0.55); }
.story-node.theme-counting      { border-color: rgba(200,232,144,0.55); }
.story-node.theme-sportsbook    { border-color: rgba(74,220,138,0.55); }
.story-node.theme-diner         { border-color: rgba(255,90,90,0.55); }
.story-node.theme-koi           { border-color: rgba(255,138,170,0.55); }
.story-node.theme-chapel        { border-color: rgba(255,182,224,0.55); }
.story-node.theme-fight-pit     { border-color: rgba(255,48,48,0.55); }
.story-node.theme-devils-lair   { border-color: rgba(255,125,87,0.65); box-shadow: 0 0 18px rgba(255,80,40,0.25); }
.story-node.theme-gulf          { border-color: rgba(159,228,208,0.55); }
.story-node.theme-vault         { border-color: rgba(216,192,120,0.55); }
.story-node.theme-seance        { border-color: rgba(228,160,112,0.55); }
.story-node.theme-under-table   { border-color: rgba(200,216,232,0.55); }
.story-node.theme-racetrack     { border-color: rgba(216,184,120,0.55); }
.story-node.theme-furrier       { border-color: rgba(216,168,104,0.55); }
.story-node.theme-print-shop    { border-color: rgba(200,168,104,0.55); }
.story-node.theme-docks         { border-color: rgba(168,200,232,0.55); }
.story-node.theme-penthouse     { border-color: rgba(232,212,112,0.55); }
.story-node.theme-archives      { border-color: rgba(184,212,120,0.55); }
/* Cleared and locked nodes both drop off the map. Cleared = already done,
   locked = the player hasn't earned the right to see it yet. Only available
   nodes are shown — the player makes a decision from a clean slate, not by
   reading a roadmap. */
.story-node.cleared { display: none; }
.story-node.locked { display: none; }
.story-node h3 {
    margin: 0 0 4px;
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 18px;
    letter-spacing: 1.5px;
}
.story-node .loc { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--ash); margin-bottom: 6px; }
.story-node .flavor { font-size: 13px; font-style: italic; color: var(--ivory); margin-bottom: 12px; }
.story-node .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--ash);
    margin-bottom: 12px;
}
.story-node .badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(212,175,55,0.12);
    border: 1px solid rgba(212,175,55,0.4);
    color: var(--gold-soft);
}
.story-node .badge.battle { background: rgba(208,48,48,0.12); border-color: rgba(208,48,48,0.5); color: #ff9090; }
.story-node .badge.dialogue { background: rgba(102,204,255,0.12); border-color: rgba(102,204,255,0.5); color: #9cdcff; }
.story-node .badge.choice { background: rgba(212,175,55,0.12); border-color: rgba(212,175,55,0.5); color: var(--gold); }
.story-node .badge.team { background: rgba(232,121,165,0.12); border-color: rgba(232,121,165,0.5); color: #ffaad0; }
.story-node button.enter {
    width: 100%;
    padding: 10px;
    background: linear-gradient(180deg, var(--gold), #a88420);
    color: #0a0a0a;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
}
.story-node button.enter:hover { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); }
.story-node button.enter:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===================================================================
 * Dialogue overlay
 * =================================================================== */
.dlg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.dlg-panel {
    width: 100%;
    max-width: 1100px;
    background: linear-gradient(180deg, rgba(28,28,32,0.96), rgba(8,8,12,0.98));
    border: 2px solid rgba(212,175,55,0.4);
    border-radius: 14px;
    box-shadow: 0 0 60px rgba(212,175,55,0.18), inset 0 0 40px rgba(0,0,0,0.6);
    padding: 24px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: stretch;
}
@media (max-width: 720px) { .dlg-panel { grid-template-columns: 1fr; padding: 16px; gap: 14px; } }
.dlg-portrait-col { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dlg-portrait {
    width: 100%;
    max-width: 260px;
    border-radius: 10px;
    border: 2px solid rgba(212,175,55,0.5);
    box-shadow: 0 0 24px rgba(212,175,55,0.18);
    background: rgba(0,0,0,0.4);
}
/* Narrator beats with a location id use a per-location scenery image
   painted in the portrait column. object-fit:cover crops to the 2:3
   aspect without stretching. */
.dlg-portrait-scenery {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 2/3;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    border: 2px solid rgba(212,175,55,0.45);
    box-shadow: 0 0 24px rgba(0,0,0,0.7), inset 0 0 18px rgba(0,0,0,0.4);
    background: rgba(0,0,0,0.5);
}
/* Fallback — only renders when no portrait AND no scenery is available. */
.dlg-portrait-narrator {
    aspect-ratio: 2/3;
    background:
        repeating-linear-gradient(45deg,
            rgba(255,255,255,0.025) 0 6px,
            rgba(255,255,255,0) 6px 14px),
        radial-gradient(ellipse at top, rgba(60,42,30,0.55), rgba(8,8,10,0.95));
    position: relative;
    overflow: hidden;
}
.dlg-portrait-narrator::before {
    content: '✶';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 38px;
    color: rgba(212,175,55,0.4);
    text-shadow: 0 0 12px rgba(212,175,55,0.25);
}
.dlg-nameplate {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--gold);
    letter-spacing: 3px;
    text-align: center;
    padding: 6px 18px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 6px;
}
/* When the speaker IS the player character, mark it unambiguously so
   the player doesn't wonder why they're listening to themselves. */
.dlg-nameplate-you {
    background: linear-gradient(180deg, rgba(60,90,40,0.75), rgba(30,50,20,0.9));
    border-color: rgba(156,255,87,0.55);
    color: #d8ffb0;
    box-shadow: 0 0 10px rgba(156,255,87,0.25);
}
.dlg-content-col { display: flex; flex-direction: column; justify-content: space-between; }
.dlg-bubble {
    background: rgba(20,20,20,0.7);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 22px 26px;
    font-size: 18px;
    line-height: 1.6;
    color: var(--ivory);
    min-height: 120px;
    margin-bottom: 16px;
}
.dlg-choices { display: flex; flex-direction: column; gap: 8px; }
.dlg-choice {
    text-align: left;
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(40,40,40,0.7), rgba(20,20,20,0.85));
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 6px;
    color: var(--ivory);
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.dlg-choice:hover {
    background: linear-gradient(180deg, rgba(60,60,60,0.85), rgba(30,30,30,0.95));
    border-color: var(--gold);
    color: var(--gold-soft);
}
.dlg-choice.dlg-continue {
    text-align: center;
    color: var(--gold);
    background: linear-gradient(180deg, rgba(212,175,55,0.18), rgba(120,90,20,0.3));
}

/* ===================================================================
 * Choice overlay
 * =================================================================== */
.choice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.choice-panel {
    width: 100%;
    max-width: 980px;
    background: linear-gradient(180deg, rgba(28,28,32,0.96), rgba(8,8,12,0.98));
    border: 2px solid rgba(212,175,55,0.4);
    border-radius: 14px;
    padding: 28px;
}
.choice-head { text-align: center; margin-bottom: 20px; }
.choice-title { font-family: 'Playfair Display', serif; font-size: 26px; color: var(--gold); margin: 0 0 6px; letter-spacing: 3px; }
.choice-subtitle { color: var(--ash); font-size: 14px; margin-bottom: 8px; }
.choice-counter { font-size: 12px; letter-spacing: 2px; color: var(--gold-soft); text-transform: uppercase; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 20px; }
.choice-card {
    text-align: left;
    padding: 18px;
    background: linear-gradient(180deg, rgba(40,40,40,0.7), rgba(20,20,20,0.85));
    border: 2px solid rgba(212,175,55,0.3);
    border-radius: 8px;
    color: var(--ivory);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.choice-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212,175,55,0.2);
}
.choice-card.picked {
    border-color: #9cff57;
    background: linear-gradient(180deg, rgba(60,120,40,0.4), rgba(30,60,20,0.6));
    box-shadow: 0 0 20px rgba(156,255,87,0.3);
}
.choice-card-label { font-family: 'Playfair Display', serif; font-size: 18px; color: var(--gold); margin-bottom: 6px; letter-spacing: 1.5px; }
.choice-card-flavor { font-size: 13px; color: var(--ivory); margin-bottom: 8px; font-style: italic; }
.choice-card-rule { font-size: 12px; color: var(--ash); }
.choice-footer { text-align: center; }
.choice-confirm {
    padding: 12px 32px;
    background: linear-gradient(180deg, var(--gold), #a88420);
    color: #0a0a0a;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.choice-confirm:disabled { opacity: 0.4; cursor: not-allowed; }
