a, a:hover, a:visited {
        color: #fff;
      }

      .rain-layer {
        position: fixed;
        inset: 0;
        pointer-events: none;
        overflow: hidden;
        display: block;
        opacity: 0;
        transition: opacity var(--rain-fade-ms, 3000ms) ease;
        filter: brightness(0.82);
      }

      .rain-layer video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }

      .rain-layer.back {
        z-index: 2; /* behind background clouds (z:3) */
      }

      .rain-layer.front {
        z-index: 1188; /* behind foreground clouds (1200) and dimmer (1190) */
      }

      .rain-layer.active {
        opacity: 1;
      }

      .front-dimmer {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.58);
        opacity: 0;
        z-index: 1190; /* behind front clouds (1200), above rain layer (999) */
        pointer-events: none;
        transition: opacity 10s ease-in, visibility 0s linear 6s;
      }

      .front-dimmer.active {
        opacity: 1;
      }

      body.booting {
        overflow: hidden;
      }

      body.booting .scene,
      body.booting .rain-video-wrap,
      body.booting #cloud-track-front,
      body.booting .config-toggle,
      body.booting .announce-toggle,
      body.booting .noir-route-corner-actions,
      body.booting .noir-route-actions {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
      }

      .loading-overlay {
        position: fixed;
        inset: 0;
        z-index: 3000;
        background: radial-gradient(circle at 30% 20%, rgba(120, 120, 120, 0.16), transparent 40%),
          radial-gradient(circle at 70% 10%, rgba(180, 180, 180, 0.12), transparent 55%),
          linear-gradient(145deg, #050608 0%, #020304 80%);
        display: grid;
        place-items: center;
        transition: opacity 0.35s ease, visibility 0.35s ease;
      }

      .loading-overlay.hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
      }

      .loading-card {
        min-width: min(420px, 90vw);
        background: rgba(12, 14, 18, 0.92);
        border: 1px solid rgba(190, 190, 190, 0.26);
        box-shadow: 0 18px 38px rgba(0, 0, 0, 0.55);
        padding: 20px 22px 18px;
      }

      .loading-title {
        margin: 0 0 12px;
        font-size: 18px;
        letter-spacing: 0.4px;
        color: #f0f0f0;
      }

      .loading-bar {
        position: relative;
        width: 100%;
        height: 12px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.08);
        overflow: hidden;
        border: 1px solid rgba(200, 200, 200, 0.24);
      }

      .loading-bar-fill {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 0%;
        background: linear-gradient(120deg, rgba(230, 230, 230, 0.65), rgba(130, 130, 130, 0.9));
        transition: width 0.18s ease-out;
      }

      .loading-progress {
        margin-top: 10px;
        text-align: right;
        color: rgba(240, 240, 240, 0.85);
        font-variant-numeric: tabular-nums;
        letter-spacing: 0.5px;
      }

      .enter-button {
        margin-top: 18px;
        width: 100%;
        padding: 12px 14px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: linear-gradient(120deg, rgba(230, 230, 230, 0.12), rgba(140, 140, 140, 0.25));
        color: #f5f5f5;
        font-weight: 700;
        letter-spacing: 0.8px;
        text-transform: uppercase;
        cursor: pointer;
        border-radius: 10px;
        transition: transform 120ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
        opacity: 0.15;
        pointer-events: none;
        cursor: not-allowed;
      }

      .loading-overlay.ready .enter-button {
        opacity: 1;
        pointer-events: auto;
        cursor: pointer;
      }

      .enter-button:hover {
        background: linear-gradient(120deg, rgba(245, 245, 245, 0.26), rgba(180, 180, 180, 0.38));
        border-color: rgba(255, 255, 255, 0.96);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
      }

      .enter-button:focus-visible {
        background: linear-gradient(120deg, rgba(245, 245, 245, 0.26), rgba(180, 180, 180, 0.38));
        border-color: rgba(255, 255, 255, 0.96);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
        outline: none;
      }

      .enter-button:active {
        transform: translateY(1px) scale(0.99);
      }

      .announce-overlay {
        position: fixed;
        inset: 0;
        z-index: 2100;
        pointer-events: none;
        opacity: 0;
        transition: opacity 220ms ease;
      }

      .announce-overlay.active {
        opacity: 1;
        pointer-events: auto;
      }

      .announce-backdrop {
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.04), transparent 40%),
          rgba(0, 0, 0, 0.78);
        backdrop-filter: blur(6px);
      }

      .announce-card {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: min(90vw, 850px);
        background: rgba(8, 8, 10, 0.96);
        border: 1px solid rgba(255, 255, 255, 0.16);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
        border-radius: 0;
        overflow: hidden;
      }

      .announce-body {
        position: relative;
        width: 100%;
        height: auto;
        background: linear-gradient(135deg, rgba(12, 12, 14, 0.9), rgba(4, 4, 6, 0.95));
        overflow: hidden;
      }

      .announce-body img {
        display: block;
        width: 100%;
        height: auto;
        cursor: zoom-in;
      }

      .announce-card.zoomed {
        width: 100vw;
        height: 100vh;
        max-width: none;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
      }

      .announce-body.zoomed {
        height: 100%;
        overflow: auto;
        display: grid;
        place-items: center;
        -webkit-overflow-scrolling: touch;
        background: #000;
        padding: 0;
      }

      .announce-body.zoomed img {
        display: block;
        width: auto;
        height: auto;
        max-width: none;
        max-height: none;
        margin: auto;
        cursor: zoom-out;
      }

      .announce-close {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        border: 1px solid rgba(255, 255, 255, 0.35);
        background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.72));
        color: #ffffff;
        font-size: 22px;
        font-weight: 800;
        cursor: pointer;
        transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
        z-index: 1;
      }

      .announce-close:hover {
        background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.26), rgba(0, 0, 0, 0.78));
        border-color: rgba(255, 255, 255, 0.96);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 6px 16px rgba(0, 0, 0, 0.6);
      }

      .announce-close:focus-visible {
        background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.26), rgba(0, 0, 0, 0.78));
        border-color: rgba(255, 255, 255, 0.96);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 6px 16px rgba(0, 0, 0, 0.6);
        outline: none;
      }

      .announce-close:active {
        transform: scale(0.95);
      }

      :root {
        color-scheme: dark;
        --scene-bg: #040506;
        --scene-glow: rgba(200, 200, 200, 0.12);
        --scene-scale: 1;
        --cloud-back-track-top: -20%;
        --cloud-back-track-height: 30%;
        --cloud-front-track-top: -12vh;
        --cloud-front-track-height: 26vh;
        --sidewalk-base: 220px;
        --skyline-gap: 150px;
        --walls-gap: 190px;
        --sidewalk-drop: -15px;
        --walls-base-height: 460px;
        --skyline-base-height: 700px;
        --sidewalk-height: calc(var(--scene-scale) * var(--sidewalk-base));
        --walls-height: calc(var(--scene-scale) * var(--walls-base-height));
        --skyline-height: calc(var(--scene-scale) * var(--skyline-base-height));
      }

      * {
        box-sizing: border-box;
      }

      body {
        margin: 0;
        min-height: 100vh;
        background: radial-gradient(circle at 30% -20%, rgba(255, 255, 255, 0.08), transparent 40%),
          radial-gradient(circle at 80% 0%, rgba(245, 245, 245, 0.04), transparent 45%), var(--scene-bg);
        font-family: 'Courier New', Courier, monospace;
        color: #f4f2ef;
      }

      .scene {
        position: relative;
        width: 100vw;
        min-height: 100vh;
        background: linear-gradient(180deg, rgba(7, 10, 15, 0.9), rgba(2, 2, 3, 0.95));
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.65), 0 0 80px var(--scene-glow);
        overflow: hidden;
      }

      .track {
        position: absolute;
        left: 0;
        width: 100%;
        pointer-events: none;
        overflow: hidden;
      }

      .cloud-track {
        inset: 0;
        top: var(--cloud-back-track-top);
        height: var(--cloud-back-track-height);
        z-index: 3;
        overflow: visible;
      }

      .cloud-track-front {
        position: fixed;
        inset: 0;
        top: var(--cloud-front-track-top);
        height: var(--cloud-front-track-height);
        z-index: 1200;
        overflow: visible;
        pointer-events: none;
      }

      .skyline-track {
        bottom: calc(var(--sidewalk-height) + (var(--scene-scale) * var(--skyline-gap)));
        height: var(--skyline-height);
        z-index: 1;
        overflow: visible;
        opacity: 0.9;
      }

      .walls-track {
        bottom: calc(var(--sidewalk-height) - (var(--scene-scale) * var(--walls-gap)));
        height: var(--walls-height);
        z-index: 3;
        overflow: visible;
      }

      .sidewalk-track {
        height: var(--sidewalk-height);
        bottom: calc(var(--scene-scale) * var(--sidewalk-drop));
        z-index: 4;
      }

      .segment {
        position: absolute;
        top: auto;
        bottom: 0;
        left: 0;
        height: 100%;
        will-change: transform;
      }

      .segment-image {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        backface-visibility: hidden;
        image-rendering: crisp-edges;
      }

      .sidewalk-track .segment-image.flipped {
        transform: scaleX(-1);
      }

      .walls-track .segment-image {
        filter: brightness(0.78) contrast(1.05);
      }

      .walker-track {
        position: absolute;
        left: 0;
        right: 0;
        bottom: calc(var(--scene-scale) * var(--sidewalk-drop));
        height: var(--sidewalk-height);
        pointer-events: none;
        z-index: 5;
      }

      .aerial-track {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        pointer-events: none;
        z-index: 6;
      }

      .aerial-track-bg {
        z-index: 2;
      }

      .aerial-track-fg {
        z-index: 6;
      }

      .walker {
        position: absolute;
        left: 0;
        bottom: 0;
        display: flex;
        align-items: flex-end;
        will-change: transform;
        transform-origin: bottom center;
      }

      .cloud {
        position: absolute;
        top: 0;
        left: 0;
        opacity: 0.15;
        will-change: transform, opacity;
      }

      .cloud img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
        filter: brightness(0.94) contrast(1.02);
      }

      .cloud-front img {
        filter: invert(0.76) brightness(0.46) contrast(1.14) saturate(0.84);
      }

      .walker img {
        display: block;
        height: 100%;
        width: auto;
        object-fit: contain;
        filter: drop-shadow(0 15px 22px rgba(0, 0, 0, 0.75));
      }

      .bullet {
        position: absolute;
        left: 0;
        bottom: 0;
        pointer-events: none;
        will-change: transform;
        transform-origin: center;
      }

      .bullet img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
        filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
      }

      .walker.flyer {
        will-change: transform;
      }

      .walker.flyer img {
        filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.55));
      }
      .walker[data-type="lurker"] {
        opacity: 0.75;
      }

      .config-toggle {
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 2006;
        width: 42px;
        height: 42px;
        border-radius: 0;
        border: 1px solid rgba(255, 255, 255, 0.22);
        background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), rgba(6, 8, 11, 0.96));
        color: #f5f4f1;
        font-size: 18px;
        display: grid;
        place-items: center;
        cursor: pointer;
        transition: opacity 0.25s ease, transform 0.25s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
      }

      .config-toggle.is-open {
        background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.24), rgba(8, 10, 12, 0.98));
        border-color: rgba(255, 255, 255, 0.96);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 6px 18px rgba(0, 0, 0, 0.44);
      }

      .config-toggle:hover,
      .config-toggle:focus-visible {
        background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.24), rgba(8, 10, 12, 0.98));
        border-color: rgba(255, 255, 255, 0.96);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 6px 18px rgba(0, 0, 0, 0.44);
        outline: none;
      }

      .config-toggle.hidden {
        opacity: 0;
        pointer-events: none;
        transform: translateY(-6px);
      }

      .announce-toggle {
        right: 106px;
        font-weight: 800;
      }

      #mute-toggle {
        right: 60px;
      }

      .config-drawer {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(360px, 88vw);
        background: rgba(8, 10, 14, 0.96);
        backdrop-filter: blur(10px);
        border-left: 1px solid rgba(255, 255, 255, 0.14);
        box-shadow: -20px 0 38px rgba(0, 0, 0, 0.55);
        transform: translateX(100%);
        transition: transform 0.32s ease, box-shadow 0.32s ease;
        z-index: 2003;
        color: #f4f2ef;
        display: flex;
        flex-direction: column;
        pointer-events: none;
      }

      .config-drawer.open {
        transform: translateX(0);
        pointer-events: auto;
      }

      .config-header {
        align-items: flex-end;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        display: flex;
        min-height: 70px;
        padding: 18px 20px 12px;
      }

      .config-title {
        margin: 0;
        font-size: 18px;
        letter-spacing: 0.6px;
        text-transform: uppercase;
      }

      .config-body {
        padding: 12px 18px 90px;
        overflow-y: auto;
        flex: 1;
        gap: 10px;
        display: flex;
        flex-direction: column;
      }

      .config-section-break {
        align-items: center;
        display: flex;
        gap: 10px;
        margin: 8px 2px 2px;
        padding-top: 14px;
      }

      .config-section-break::before,
      .config-section-break::after {
        background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02));
        content: '';
        flex: 1 1 auto;
        height: 1px;
      }

      .config-section-break-label {
        color: rgba(244, 242, 239, 0.62);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.24em;
        text-transform: uppercase;
        white-space: nowrap;
      }

      .config-row {
        display: flex;
        flex-direction: column;
        gap: 6px;
      }

      .config-row label {
        font-size: 13px;
        letter-spacing: 0.4px;
        color: rgba(244, 242, 239, 0.9);
        display: flex;
        align-items: center;
        justify-content: space-between;
      }

      .config-control {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 0;
      }

        .config-control input[type="range"] {
        accent-color: #cfcfcf;
      }

      .config-value {
        min-width: 68px;
        text-align: right;
        font-variant-numeric: tabular-nums;
        color: rgba(255, 255, 255, 0.85);
      }

      .config-footer {
        position: sticky;
        bottom: 0;
        padding: 14px 18px 18px;
        display: grid;
        gap: 10px;
        grid-template-columns: 1fr;
        background: linear-gradient(180deg, rgba(8, 10, 14, 0.85), rgba(8, 10, 14, 0.98));
        border-top: 1px solid rgba(255, 255, 255, 0.08);
      }

      .config-footer button {
        padding: 10px 12px;
        border-radius: 0;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.05);
        color: #f6f5f3;
        font-weight: 600;
        letter-spacing: 0.4px;
        cursor: pointer;
        transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
      }

      .config-footer button:hover {
        background: rgba(255, 255, 255, 0.14);
        border-color: rgba(255, 255, 255, 0.96);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
      }

      .config-footer button:focus-visible {
        background: rgba(255, 255, 255, 0.14);
        border-color: rgba(255, 255, 255, 0.96);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
        outline: none;
      }

      .config-footer button:active {
        transform: translateY(1px);
      }

      .config-footer button.primary {
        background: linear-gradient(120deg, rgba(215, 215, 215, 0.28), rgba(120, 120, 120, 0.6));
        border-color: rgba(210, 210, 210, 0.6);
      }

      .config-button-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 8px;
        padding: 8px 10px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 0;
      }

      .config-button-row button {
        padding: 9px 10px;
        border-radius: 0;
        border: 1px solid rgba(200, 200, 200, 0.3);
        background: rgba(200, 200, 200, 0.08);
        color: #f6f5f3;
        font-weight: 600;
        letter-spacing: 0.3px;
        cursor: pointer;
        transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
      }

      .config-button-row button:hover {
        background: rgba(255, 255, 255, 0.16);
        border-color: rgba(255, 255, 255, 0.96);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
      }

      .config-button-row button:focus-visible {
        background: rgba(255, 255, 255, 0.16);
        border-color: rgba(255, 255, 255, 0.96);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
        outline: none;
      }

      .config-button-row button:active {
        transform: translateY(1px);
      }

      .config-divider {
        height: 1px;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
        border: none;
        margin: 4px 0;
      }

      .config-section {
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 0;
        background: rgba(255, 255, 255, 0.02);
      }

      .config-section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
        gap: 10px;
        cursor: pointer;
        user-select: none;
      }

      .config-section-header span {
        font-weight: 700;
        letter-spacing: 0.5px;
      }

      .config-section-body {
        display: none;
        padding: 0 10px 10px;
        gap: 8px;
        flex-direction: column;
        max-height: 500px;
        overflow-y: auto;
      }

      /* only show a section's own body when that section is open */
      .config-section.open > .config-section-body {
        display: flex;
      }

      .chevron {
        transition: transform 0.2s ease;
      }

      .config-section.open > .config-section-header .chevron {
        transform: rotate(90deg);
      }

      /* allow tall entity lists to scroll when expanded */
      .config-section[data-faction] .config-section-body {
        max-height: 260px;
        overflow-y: auto;
        padding-right: 4px;
      }

      .talk-bubble {
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translate(-50%, 14px);
        width: 90px;
        pointer-events: none;
        filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.55));
        opacity: 0;
        transition: opacity 120ms ease-out;
      }

      .talk-bubble.visible {
        opacity: 0.92;
        transition: opacity 80ms ease-out;
      }

      .weather-feedback {
        margin-top: 6px;
        font-size: 12px;
        color: rgba(240, 240, 240, 0.8);
        letter-spacing: 0.3px;
        min-height: 14px;
      }
