/*
 * Gelatinous Web Client -- Terminal/Brutalist Corporate theme
 *
 * Mobile-first layout using CSS grid and 100dvh.
 * Color palette from the Gelatinous website design language.
 * No Bootstrap, no jQuery, no frameworks.
 */

/* ----------------------------------------------------------------
   Custom properties
   ---------------------------------------------------------------- */
:root {
    /* Ground, plate, raised — mirrored from the site's --terminal-bg-*.
       The client used to sit on neutral greys, which read cooler and
       greyer than every other surface. These are the Atlas values. */
    --bg-dark: #0b0e14;      /* ink — the ground */
    --bg-medium: #11161f;    /* plate — the input bar */
    --bg-light: #182030;     /* plate-hi — the input field itself */
    /* Amber is the house accent — it marks the control you are using.
       Same value as the site's --terminal-accent so the client and the
       website agree. */
    --amber: #e0a86f;
    --amber-dim: #b8834f;
    --amber-glow: rgba(224, 168, 111, 0.3);

    /* Green stays STATE, never decoration: connected, and success
       messages. It is paired with --yellow (connecting / warning) and
       --red (disconnected / error), so it has to keep reading as "good". */
    --green: #5fd38d;
    --green-dim: #4a9d6d;
    /* Bone, not white — matches the site's --terminal-text. This is only
       the DEFAULT colour for unstyled output; ANSI-coloured game text is
       inline-styled by ansi_up and is unaffected by anything here. */
    --text: #d8d3c4;         /* bone */
    --text-muted: #8f8d82;   /* bone-dim */
    --yellow: #e6c547;
    --red: #e85555;
    --border: #232c3a;       /* cool rule, matching --terminal-border */
    --glow: rgba(95, 211, 141, 0.3);

    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --font-size: 14px;
    --context-font-size: 14px;
    --line-height: 1.4;
}

/* ----------------------------------------------------------------
   Reset & base
   ---------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg-dark);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: var(--font-size);
    line-height: var(--line-height);
    -webkit-text-size-adjust: 100%;
}

/* ----------------------------------------------------------------
   App shell -- 2-row CSS grid
   ---------------------------------------------------------------- */
#app {
    display: grid;
    grid-template-rows: 1fr auto;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ----------------------------------------------------------------
   Connection state (floating in output area)
   ---------------------------------------------------------------- */
#connection-state {
    position: sticky;
    top: 0;
    float: right;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-dark);
    border-radius: 0 0 0 3px;
    user-select: none;
    -webkit-user-select: none;
    z-index: 1;
}

#connection-state .state-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.3s ease;
}

#connection-state .state-dot.connected {
    background: var(--green);
    box-shadow: 0 0 4px var(--glow);
}

#connection-state .state-dot.connecting {
    background: var(--yellow);
    animation: pulse 1.2s ease-in-out infinite;
}

#connection-state .state-dot.disconnected {
    background: var(--red);
}

#connection-state .latency {
    font-size: 11px;
    color: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ----------------------------------------------------------------
   Output area (middle)
   ---------------------------------------------------------------- */
#output {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 10px;
    background: var(--bg-dark);
    scroll-behavior: auto;
    /* overscroll-behavior prevents pull-to-refresh on mobile */
    overscroll-behavior: contain;
}

#output-inner {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: var(--font-mono);
    font-size: var(--font-size);
    line-height: var(--line-height);
    color: var(--text);
}

/* Auto-scroll sentinel -- invisible element at the bottom */
#scroll-sentinel {
    height: 1px;
    width: 1px;
}

/* MORE indicator when scrolled up */
#more-indicator {
    position: sticky;
    bottom: 0;
    display: none;
    text-align: center;
    padding: 2px 0;
    background: linear-gradient(transparent, var(--bg-dark) 40%);
    color: var(--yellow);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

#more-indicator.visible {
    display: block;
}

/* Custom scrollbar (Firefox + WebKit) */
#output {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-light) var(--bg-dark);
}
#output::-webkit-scrollbar {
    width: 6px;
}
#output::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
#output::-webkit-scrollbar-thumb {
    background: var(--bg-light);
    border-radius: 3px;
}
#output::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* ----------------------------------------------------------------
   Reconnect overlay
   ---------------------------------------------------------------- */
#reconnect-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    color: var(--text);
    font-size: 14px;
}

#reconnect-overlay.visible {
    display: flex;
}

#reconnect-overlay .reconnect-msg {
    color: var(--yellow);
    font-weight: bold;
}

#reconnect-overlay .reconnect-detail {
    color: var(--text-muted);
    font-size: 12px;
}

/* ----------------------------------------------------------------
   Input area (bottom)
   ---------------------------------------------------------------- */
#input-area {
    display: flex;
    align-items: flex-end;
    gap: 0;
    padding: 6px 8px;
    background: var(--bg-medium);
    border-top: 1px solid var(--border);
    /* Safe area for notched phones */
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    flex-shrink: 0;
}

#input-field {
    flex: 1;
    resize: none;
    overflow-y: auto;
    min-height: 36px;
    max-height: 120px;   /* ~4 lines */
    padding: 7px 10px;
    background: var(--bg-light);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: var(--font-mono);
    /* Use max() to prevent iOS zoom on focus (needs >= 16px) */
    font-size: max(var(--font-size), 16px);
    line-height: var(--line-height);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#input-field:focus {
    border-color: var(--amber-dim);
    box-shadow: 0 0 0 1px var(--amber-glow);
}

#input-field::placeholder {
    color: var(--text-muted);
    /* 0.6 left "Enter command..." at ~2.6:1 against the darker ground.
       0.8 lifts it to ~3.3:1 — still clearly a hint, actually legible. */
    opacity: 0.8;
}

#send-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin-left: 6px;
    background: transparent;
    color: var(--amber-dim);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

#send-btn:hover,
#send-btn:active {
    color: var(--amber);
    border-color: var(--amber-dim);
}

/* ----------------------------------------------------------------
   Mobile adjustments
   ---------------------------------------------------------------- */
@media (max-width: 600px) {
    :root {
        --font-size: 13px;
    }

    #status-bar {
        padding: 3px 8px;
        font-size: 11px;
    }

    #output {
        padding: 6px 8px;
    }

    #input-area {
        padding: 4px 6px;
        padding-bottom: max(4px, env(safe-area-inset-bottom));
    }
}

/* ----------------------------------------------------------------
   System messages (connection info, errors)
   ---------------------------------------------------------------- */
.sys-msg {
    color: var(--text-muted);
    font-style: italic;
}

.sys-msg.error {
    color: var(--red);
}

.sys-msg.success {
    color: var(--green);
}

.sys-msg.warning {
    color: var(--yellow);
}

.sys-echo {
    color: var(--yellow);
}

/* ====================================================================
   SKINS — CHROME ONLY  (2026-08-03)
   --------------------------------------------------------------------
   THE PROTOCOL OWNS GAME COLOUR. ansi_up runs with `use_classes = false`
   (see js/gel.js), so every coloured character the game sends is styled
   inline from the xterm-256 table and NO stylesheet — including this one
   — can reach it. A room title is the same cyan here, in Mudlet, and
   over raw telnet. That is deliberate and must stay true.

   A skin therefore dresses the room around the text: ground, input bar,
   field, borders, muted status. Not one character of game output.

   Consequence: every skin is DARK. The ANSI palette is fixed, so the
   ground has to keep it legible — and must not collide with a colour the
   palette uses (a navy ground eats |b, a maroon one swallows |r).
   ==================================================================== */

/* GENERATED SKINS (build_skins.py) BEGIN */
[data-skin="terminal"] {
    --bg-dark: #1a1a1a;
    --bg-medium: #2a2a2a;
    --bg-light: #3a3a3a;
    --amber: #5fd38d;
    --amber-dim: #4a9d6d;
    --amber-glow: rgba(95, 211, 141, 0.30);
    --text: #e0e0e0;
    --text-muted: #999999;
    --border: #404040;
}
[data-skin="stray"] {
    --bg-dark: #0d0a12;
    --bg-medium: #16111c;
    --bg-light: #201828;
    --amber: #ff3d9a;
    --amber-dim: #c42d76;
    --amber-glow: rgba(255, 61, 154, 0.32);
    --text: #e6dde4;
    --text-muted: #8d8393;
    --border: #2c2136;
}
[data-skin="dub"] {
    --bg-dark: #0e120c;
    --bg-medium: #151b12;
    --bg-light: #1e2818;
    --amber: #f0c34e;
    --amber-dim: #c29a34;
    --amber-glow: rgba(240, 195, 78, 0.30);
    --text: #e8e0c8;
    --text-muted: #979274;
    --border: #33471f;
}
[data-skin="prism"] {
    --bg-dark: #101014;
    --bg-medium: #17171e;
    --bg-light: #20202a;
    --amber: #9d7bff;
    --amber-dim: #7a5fd0;
    --amber-glow: rgba(157, 123, 255, 0.32);
    --text: #dcdce4;
    --text-muted: #8f8f9c;
    --border: #2a2a38;
}
[data-skin="laughing"] {
    --bg-dark: #0a1018;
    --bg-medium: #101a26;
    --bg-light: #182636;
    --amber: #56a8e8;
    --amber-dim: #3d7fb5;
    --amber-glow: rgba(86, 168, 232, 0.30);
    --text: #e6eef7;
    --text-muted: #8b98a8;
    --border: #24384c;
}
[data-skin="ed"] {
    --bg-dark: #171008;
    --bg-medium: #221809;
    --bg-light: #2f2210;
    --amber: #ff8c3a;
    --amber-dim: #cc6a24;
    --amber-glow: rgba(255, 140, 58, 0.32);
    --text: #f2e7d4;
    --text-muted: #a89478;
    --border: #3d2c14;
}
/* GENERATED SKINS (build_skins.py) END */


/* ================================================================
   CYBERPUNK TBG GAME CLIENT — GC-0.2 PLAY SHELL
   Presentation only. Donor transport remains owned by gel.js.
   ================================================================ */

:root {
    --tbg-bg: #071014;
    --tbg-panel: rgba(6, 18, 23, 0.94);
    --tbg-panel-soft: rgba(8, 23, 29, 0.82);
    --tbg-line: rgba(82, 190, 211, 0.32);
    --tbg-line-strong: rgba(82, 190, 211, 0.62);
    --tbg-text: #c8d8dc;
    --tbg-muted: #70868c;
    --tbg-accent: #55c8dd;

    /*
     * Player-selectable Play background visibility.
     * Defaults reproduce approved WEBCLIENT-VIS-3 / Bright.
     */
    --play-art-brightness: 0.76;
    --play-art-opacity: 0.70;
    --play-overlay-left: 0.38;
    --play-overlay-center: 0.28;
    --play-overlay-right: 0.40;
    --play-overlay-mobile: 0.40;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--tbg-bg);
}

body {
    color: var(--tbg-text);
}

#app.tbg-client {
    width: 100vw;
    height: 100dvh;
    display: grid;
    grid-template-rows: 48px minmax(0, 1fr) auto;
    background:
        linear-gradient(rgba(4, 12, 16, 0.95), rgba(4, 12, 16, 0.98));
}

#client-header {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: stretch;
    border-bottom: 1px solid var(--tbg-line-strong);
    background: rgba(3, 12, 16, 0.98);
}

.client-brand {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 1rem;
    border-right: 1px solid var(--tbg-line);
    white-space: nowrap;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.brand-primary {
    color: var(--tbg-accent);
}

.brand-secondary {
    color: var(--tbg-text);
}

#client-tabs {
    min-width: 0;
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    scrollbar-width: none;
}

#client-tabs::-webkit-scrollbar {
    display: none;
}

.client-tab {
    appearance: none;
    border: 0;
    border-right: 1px solid rgba(82, 190, 211, 0.12);
    border-bottom: 2px solid transparent;
    padding: 0 1rem;
    background: transparent;
    color: var(--tbg-muted);
    font: inherit;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.client-tab.active {
    color: var(--tbg-accent);
    border-bottom-color: var(--tbg-accent);
    background: rgba(82, 190, 211, 0.055);
}

.client-tab:disabled {
    opacity: 0.38;
}

#client-header #connection-state {
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    padding: 0 0.85rem;
    min-width: 105px;
    color: var(--tbg-muted);
    background: transparent;
    border: 0;
}

#client-workspace {
    min-height: 0;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.client-panel {
    display: none;
    width: 100%;
    height: 100%;
}

.client-panel.active {
    display: block;
}

#play-panel {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    overflow: hidden;
}

#play-background {
    position: absolute;
    inset: 0 250px 0 0;
    z-index: 0;
    pointer-events: none;

    /*
       GC-0.3 will supply Room/area/Zone imagery here.
       Keep empty now rather than inventing world metadata.
    */

    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0;
}

#play-panel #output {
    position: relative;
    inset: auto;
    z-index: 1;
    min-width: 0;
    min-height: 0;
    height: auto;
    overflow-y: auto;
    padding: 1.4rem 1.6rem 2.2rem;
    box-sizing: border-box;
    background:
        linear-gradient(
            90deg,
            rgba(3, 12, 16, 0.93) 0%,
            rgba(3, 12, 16, 0.82) 70%,
            rgba(3, 12, 16, 0.90) 100%
        );
}

#play-panel #output-inner {
    max-width: 1100px;
    min-height: 100%;
}

#context-panel {
    position: relative;
    z-index: 2;
    min-width: 0;
    overflow-y: auto;
    border-left: 1px solid var(--tbg-line-strong);
    background: var(--tbg-panel);
    font-size: var(--context-font-size);
}

.context-section {
    padding: 1rem;
    border-bottom: 1px solid var(--tbg-line);
}

.context-heading {
    margin-bottom: 0.75rem;
    color: var(--tbg-accent);
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.context-placeholder {
    color: var(--tbg-muted);
    font-size: 0.78em;
    line-height: 1.5;
}

#app.tbg-client #input-area {
    --command-input-height: 42px;

    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    border-top: 1px solid var(--tbg-line-strong);
    background: rgba(3, 12, 16, 0.99);
    box-sizing: border-box;
}

#command-prompt {
    color: var(--tbg-accent);
    font-weight: 700;
}

#app.tbg-client #input-field {
    width: 100%;
    height: var(--command-input-height);
    min-width: 0;
    min-height: 42px;
    max-height: none;
    resize: none;
    box-sizing: border-box;
}

#app.tbg-client #send-btn {
    flex: none;
}

#command-input-resizer {
    position: absolute;
    z-index: 25;
    top: -5px;
    right: 0;
    left: 0;
    height: 10px;
    cursor: row-resize;
    touch-action: none;
    outline: none;
}

#command-input-resizer::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 0;
    left: 0;
    height: 1px;
    background: var(--tbg-line-strong);
    transition:
        height 120ms ease,
        top 120ms ease,
        background-color 120ms ease;
}

#command-input-resizer:hover::after,
#command-input-resizer:focus-visible::after,
body.command-input-resizing #command-input-resizer::after {
    top: 3px;
    height: 3px;
    background: var(--tbg-accent);
}

body.command-input-resizing,
body.command-input-resizing * {
    cursor: row-resize !important;
    user-select: none !important;
}

@media (max-width: 850px) {
    #app.tbg-client {
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    #client-header {
        grid-template-columns: 1fr auto;
    }

    .client-brand {
        min-height: 42px;
    }

    #client-tabs {
        grid-column: 1 / -1;
        grid-row: 2;
        border-top: 1px solid rgba(82, 190, 211, 0.12);
    }

    .client-tab {
        min-height: 38px;
    }

    #play-panel {
        grid-template-columns: 1fr;
    }

    #context-panel {
        display: none;
    }

    #play-background {
        right: 0;
    }
}

@media (max-width: 520px) {
    .brand-primary {
        display: none;
    }

    .client-brand {
        padding: 0 0.75rem;
    }

    #client-header #connection-state {
        min-width: 0;
    }

    #state-text,
    #latency {
        display: none;
    }

    #play-panel #output {
        padding: 1rem 0.85rem 1.8rem;
    }
}


/* ================================================================
   GC-0.2A — NEON DRIFTERS CLIENT MASTHEAD

   Mirrors the established public-site masthead scale and wordmark
   treatment without importing Bootstrap/site CSS into the game client.
   ================================================================ */

#app.tbg-client {
    grid-template-rows: 68px minmax(0, 1fr) auto;
}

#client-header {
    min-height: 68px;
    background:
        linear-gradient(
            90deg,
            rgba(131, 200, 217, 0.055),
            transparent 35%
        ),
        #0b1013;
    border-top: 1px solid #111b20;
}

#client-header::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 180px;
    height: 1px;
    background: var(--tbg-accent);
    opacity: 0.72;
    pointer-events: none;
}

#client-header {
    position: relative;
}

.client-brand {
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    min-width: 180px;
    padding: 0 1.25rem;
    line-height: 1;
}

.client-wordmark {
    color: #eef5f7;
    font-family: inherit;
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.client-wordmark-o {
    display: inline-block;
    width: 0.88em;
    height: 0.88em;
    margin: 0 0.04em;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: var(--tbg-accent);
    line-height: 0.76em;
    text-align: center;
    transform: translateY(-0.01em);
}

.client-tagline {
    margin-top: 0.45rem;
    color: #82949b;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    line-height: 1;
    white-space: nowrap;
}

#client-tabs {
    align-items: stretch;
}

.client-tab {
    min-height: 68px;
    padding: 0 1.05rem;
    color: var(--tbg-muted);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.075em;
    text-transform: uppercase;
    transition:
        color 120ms ease,
        background-color 120ms ease,
        border-color 120ms ease;
}

.client-tab:hover:not(:disabled),
.client-tab:focus-visible:not(:disabled) {
    color: #eef5f7;
}

.client-tab.active {
    color: var(--tbg-accent);
}

#client-header #connection-state {
    min-height: 68px;
    padding: 0 1.1rem;
    font-size: 0.72rem;
}

.client-header-tools {
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.client-settings {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.8rem;
    border-left: 1px solid rgba(82, 190, 211, 0.12);
    border-right: 1px solid rgba(82, 190, 211, 0.12);
    white-space: nowrap;
}

.client-setting-label {
    color: var(--tbg-muted);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.client-setting-select {
    min-width: 5.6rem;
    padding: 0.3rem 1.35rem 0.3rem 0.45rem;
    border: 1px solid var(--tbg-line);
    border-radius: 2px;
    background: var(--bg-light);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    line-height: 1.2;
    cursor: pointer;
}

.client-setting-select:hover {
    border-color: var(--tbg-line-strong);
}

.client-setting-select:focus-visible {
    outline: 2px solid var(--tbg-accent);
    outline-offset: 2px;
}

.client-setting-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.45rem;
    border: 1px solid var(--tbg-line);
    border-radius: 2px;
    background: transparent;
    color: var(--tbg-accent);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    line-height: 1.2;
    cursor: pointer;
}

.client-setting-button-label {
    color: var(--tbg-muted);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.client-setting-button:hover {
    border-color: var(--tbg-line-strong);
    color: #eef5f7;
}

.client-setting-button:focus-visible {
    outline: 2px solid var(--tbg-accent);
    outline-offset: 2px;
}

.client-log-control {
    position: relative;
}

.client-log-summary {
    list-style: none;
}

.client-log-summary::-webkit-details-marker {
    display: none;
}

.client-log-control[open] .client-log-summary {
    border-color: var(--tbg-line-strong);
    background: rgba(82, 190, 211, 0.055);
}

.client-log-actions {
    position: absolute;
    z-index: 60;
    top: calc(100% + 0.45rem);
    right: 0;
    width: 11.5rem;
    padding: 0.35rem;
    border: 1px solid var(--tbg-line-strong);
    background: rgba(3, 12, 16, 0.99);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
}

.client-log-actions button {
    appearance: none;
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-bottom: 1px solid rgba(82, 190, 211, 0.12);
    background: transparent;
    color: var(--tbg-text);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-align: left;
    cursor: pointer;
}

.client-log-actions button:last-child {
    border-bottom: 0;
}

.client-log-actions button:hover:not(:disabled) {
    color: var(--tbg-accent);
    background: rgba(82, 190, 211, 0.055);
}

.client-log-actions button:focus-visible {
    outline: 2px solid var(--tbg-accent);
    outline-offset: -3px;
}

.client-log-actions button:disabled {
    color: var(--tbg-muted);
    cursor: default;
    opacity: 0.48;
}

/* Supersede the old GC-0.2 mobile brand rule. */
@media (max-width: 850px) {
    #app.tbg-client {
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    #client-header {
        grid-template-columns: 1fr auto;
    }

    .client-brand {
        min-height: 58px;
        padding: 0 1rem;
    }

    #client-header #connection-state {
        min-height: 58px;
    }

    .client-settings {
        min-height: 58px;
    }

    #client-tabs {
        min-height: 42px;
    }

    .client-tab {
        min-height: 42px;
        padding: 0 0.9rem;
    }
}

@media (max-width: 520px) {
    #client-header {
        grid-template-columns: 1fr;
    }

    .client-brand {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        padding: 0 0.8rem;
    }

    .client-wordmark {
        font-size: 0.88rem;
    }

    .client-tagline {
        font-size: 0.56rem;
    }

    .client-settings {
        min-height: 40px;
        gap: 0.3rem;
        padding: 0 0.5rem;
    }

    .client-setting-select {
        min-width: 5.1rem;
    }

    #client-header #connection-state {
        min-height: 40px;
        padding: 0 0.65rem;
    }

    .client-header-tools {
        grid-column: 1;
        grid-row: 2;
        justify-content: flex-end;
        border-top: 1px solid rgba(82, 190, 211, 0.12);
    }

    #client-tabs {
        grid-row: 3;
    }

    /* Do not hide the NEON DRIFTERS name on narrow clients. */
    .brand-primary {
        display: initial;
    }
}


/* GC-0.2A live visual tune — slightly stronger client branding */
.client-wordmark {
    font-size: 1.10rem;
}

.client-tagline {
    font-size: 0.67rem;
}

.client-brand {
    min-width: 195px;
}

@media (max-width: 520px) {
    .client-wordmark {
        font-size: 0.98rem;
    }

    .client-tagline {
        font-size: 0.60rem;
    }
}


/* GC-0.2B — return to public NEON DRIFTERS site */
.client-tab-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-decoration: none;
    color: var(--tbg-muted);
}

.client-tab-back:hover,
.client-tab-back:focus-visible {
    color: #eef5f7;
    text-decoration: none;
    background: rgba(82, 190, 211, 0.045);
}


/* ================================================================
   GC-0.3C1 — LOCATION ARTWORK

   Server resolves what the character/client is allowed to know.
   Browser only presents the resolved stable image key.
   ================================================================ */

#play-background {
    opacity: 1;
    overflow: hidden;
    background: #071014;
}

.play-background-layer {
    position: absolute;
    inset: 0;

    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;

    opacity: 0;

    filter:
        brightness(var(--play-art-brightness))
        saturate(0.72)
        contrast(1.04);

    transform: scale(1.015);

    transition:
        opacity 420ms ease,
        transform 900ms ease;

    will-change: opacity;
}

.play-background-layer.active {
    opacity: var(--play-art-opacity);
    transform: scale(1);
}

/*
 * The prose remains authoritative and dominant. This translucent layer
 * provides enough image visibility for atmosphere without sacrificing
 * ANSI/text readability.
 */
#play-panel #output {
    background:
        linear-gradient(
            90deg,
            rgba(3, 12, 16, var(--play-overlay-left)) 0%,
            rgba(3, 12, 16, var(--play-overlay-center)) 62%,
            rgba(3, 12, 16, var(--play-overlay-right)) 100%
        );
}

/* Mobile receives slightly stronger darkening for readability. */
@media (max-width: 850px) {
    .play-background-layer.active {
        opacity: 0.48;
    }

    #play-panel #output {
        background: rgba(
            3,
            12,
            16,
            var(--play-overlay-mobile)
        );
    }
}

@media (prefers-reduced-motion: reduce) {
    .play-background-layer {
        transition: none;
        transform: none;
    }
}


/* ================================================================
   GC-0.2C — RESIZABLE CONTEXT PANEL
   ================================================================ */

#play-panel {
    --context-panel-width: 320px;

    grid-template-columns:
        minmax(0, 1fr)
        var(--context-panel-width);
}

/*
 * Location artwork belongs only behind the primary play area.
 * Its right edge follows the resizable context panel.
 */
#play-background {
    right: var(--context-panel-width);
}

#context-panel {
    position: relative;
    min-width: 0;
}

#context-resizer {
    position: absolute;
    z-index: 10;

    top: 0;
    bottom: 0;
    left: -5px;

    width: 10px;

    cursor: col-resize;
    touch-action: none;

    outline: none;
}

#context-resizer::after {
    content: "";

    position: absolute;
    top: 0;
    bottom: 0;
    left: 4px;

    width: 1px;

    background: var(--tbg-line-strong);

    transition:
        width 120ms ease,
        left 120ms ease,
        background-color 120ms ease;
}

#context-resizer:hover::after,
#context-resizer:focus-visible::after,
body.context-resizing #context-resizer::after {
    left: 3px;
    width: 3px;
    background: var(--tbg-accent);
}

body.context-resizing,
body.context-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

@media (max-width: 850px) {
    #context-resizer {
        display: none;
    }

    /*
     * Context panel is hidden at this breakpoint, so artwork again owns
     * the full horizontal play surface.
     */
    #play-background {
        right: 0;
    }
}


/* ================================================================
   GC-0.2C1 — CONTEXT RESIZER REPAIR

   The resize handle is now its own grid column rather than a
   negatively-positioned child of the scrolling context panel.
   ================================================================ */

#play-panel {
    --context-panel-width: 320px;
    --context-resizer-width: 8px;

    grid-template-columns:
        minmax(0, 1fr)
        var(--context-resizer-width)
        var(--context-panel-width);
}

#play-background {
    right: calc(
        var(--context-panel-width) +
        var(--context-resizer-width)
    );
}

#context-panel {
    border-left: 0;
}

#context-resizer {
    position: relative;
    z-index: 20;

    width: var(--context-resizer-width);
    height: 100%;

    cursor: col-resize;
    touch-action: none;
    outline: none;

    background: rgba(82, 190, 211, 0.035);
    border-left: 1px solid var(--tbg-line);
    border-right: 1px solid var(--tbg-line);
    box-sizing: border-box;
}

#context-resizer::after {
    content: "";

    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;

    width: 1px;

    background: var(--tbg-line-strong);
    transform: translateX(-50%);

    transition:
        width 120ms ease,
        background-color 120ms ease;
}

#context-resizer:hover,
#context-resizer:focus-visible,
body.context-resizing #context-resizer {
    background: rgba(82, 190, 211, 0.10);
}

#context-resizer:hover::after,
#context-resizer:focus-visible::after,
body.context-resizing #context-resizer::after {
    width: 3px;
    background: var(--tbg-accent);
}

@media (max-width: 850px) {
    #play-panel {
        grid-template-columns: 1fr;
    }

    #context-resizer {
        display: none;
    }

    #play-background {
        right: 0;
    }
}

/* ================================================================
   LOCAL CONTEXT PANEL VISIBILITY / MOBILE DRAWER
   Contents stay mounted; only their shell presentation changes.
   ================================================================ */

#context-panel-backdrop,
#context-panel-close {
    display: none;
}

#play-panel.context-panel-hidden {
    grid-template-columns: minmax(0, 1fr) 0 0;
}

#play-panel.context-panel-hidden #play-background {
    right: 0;
}

#play-panel.context-panel-hidden #context-resizer {
    width: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    border: 0;
}

#play-panel.context-panel-hidden #context-panel {
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 850px) {
    #play-panel,
    #play-panel.context-panel-hidden {
        grid-template-columns: 1fr;
    }

    #context-panel {
        display: block;
        position: absolute;
        z-index: 30;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(
            var(--context-panel-width),
            calc(100% - 2.75rem)
        );
        max-width: 520px;
        overflow-y: auto;
        visibility: hidden;
        border-left: 1px solid var(--tbg-line-strong);
        box-shadow: -12px 0 28px rgba(0, 0, 0, 0.42);
        pointer-events: none;
        transform: translateX(100%);
        transition:
            transform 180ms ease,
            visibility 180ms ease;
    }

    #play-panel:not(.context-panel-hidden) #context-panel {
        overflow-y: auto;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(0);
    }

    #context-panel-backdrop {
        display: block;
        position: absolute;
        z-index: 25;
        inset: 0;
        visibility: hidden;
        background: rgba(1, 6, 8, 0.62);
        opacity: 0;
        pointer-events: none;
        transition:
            opacity 180ms ease,
            visibility 180ms ease;
    }

    #play-panel:not(.context-panel-hidden) #context-panel-backdrop {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    #context-panel-close {
        appearance: none;
        position: sticky;
        z-index: 1;
        top: 0;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.45rem;
        padding: 0.65rem 0.8rem;
        border: 0;
        border-bottom: 1px solid var(--tbg-line);
        background: rgba(3, 12, 16, 0.98);
        color: var(--tbg-accent);
        font-family: var(--font-mono);
        font-size: 0.68em;
        font-weight: 700;
        letter-spacing: 0.1em;
        cursor: pointer;
    }

    #context-panel-close:hover {
        color: #eef5f7;
    }

    #context-panel-close:focus-visible {
        outline: 2px solid var(--tbg-accent);
        outline-offset: -3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #context-panel,
    #context-panel-backdrop {
        transition: none;
    }
}

/* ================================================================
   GC-0.4E — CHARACTER WORKSPACE
   Read-only presentation of authoritative Character identity,
   Attributes and visible Skills.
   ================================================================ */

#character-panel {
    overflow-y: auto;
    background:
        linear-gradient(
            135deg,
            rgba(82, 190, 211, 0.035),
            transparent 36%
        ),
        #061015;
}

.character-sheet {
    width: min(1500px, calc(100% - 3rem));
    margin: 0 auto;
    padding: 2rem 0 3rem;
    box-sizing: border-box;
}

.character-sheet__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;

    padding: 0 0 1.35rem;
    border-bottom: 1px solid var(--tbg-line-strong);
}

.character-sheet__eyebrow {
    margin-bottom: 0.45rem;
    color: var(--tbg-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.character-sheet__name {
    margin: 0;

    color: #eef5f7;
    font-size: clamp(1.45rem, 2.4vw, 2.35rem);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.character-sheet__identity {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;

    color: #d0dde1;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.character-sheet__identity-label {
    color: var(--tbg-accent);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.character-sheet__section {
    margin-top: 1.6rem;
}

.character-sheet__section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 0.8rem;
}

.character-sheet__section-heading h2 {
    margin: 0;

    color: var(--tbg-accent);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.character-sheet__section-heading span {
    color: var(--tbg-muted);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
}

.character-attributes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}

.character-attribute {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 0.25rem 0.8rem;

    min-width: 0;
    padding: 0.8rem 0.9rem;

    border: 1px solid var(--tbg-line);
    background: rgba(7, 20, 26, 0.76);
}

.character-attribute__name {
    min-width: 0;

    color: #d7e3e6;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.character-attribute__value {
    grid-row: 1 / 3;
    grid-column: 2;

    align-self: center;

    color: var(--tbg-accent);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1;
}

.character-attribute__descriptor {
    color: var(--tbg-muted);
    font-size: 0.7rem;
}

.character-skills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 0.9rem;
}

.character-skill-group {
    min-width: 0;

    border: 1px solid var(--tbg-line);
    background: rgba(7, 20, 26, 0.70);
}

.character-skill-group__heading {
    margin: 0;
    padding: 0.55rem 0.7rem;

    border-bottom: 1px solid var(--tbg-line);

    color: var(--tbg-accent);
    background: rgba(82, 190, 211, 0.035);

    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.character-skill {
    display: grid;
    grid-template-columns:
        minmax(7rem, 1fr)
        2.2rem
        minmax(5.6rem, 0.72fr);
    align-items: baseline;
    gap: 0.55rem;

    min-width: 0;
    padding: 0.42rem 0.7rem;

    border-bottom: 1px solid rgba(82, 190, 211, 0.07);
}

.character-skill:last-child {
    border-bottom: 0;
}

.character-skill__name {
    min-width: 0;
    overflow: hidden;

    color: #cedadd;
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-skill__rating {
    color: var(--tbg-accent);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}

.character-skill__descriptor {
    min-width: 0;
    overflow: hidden;

    color: var(--tbg-muted);
    font-size: 0.67rem;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .character-attributes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .character-skills {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .character-sheet {
        width: calc(100% - 1.5rem);
        padding-top: 1.1rem;
    }

    .character-sheet__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.8rem;
    }

    .character-sheet__identity {
        align-items: flex-start;
    }

    .character-attributes,
    .character-skills {
        grid-template-columns: 1fr;
    }

    .character-sheet__section-heading span {
        display: none;
    }
}

/* ================================================================
   GC-0.5E4 — INVENTORY WORKSPACE
   Projection of authoritative physical inventory state and server-authored
   command conveniences.
   ================================================================ */

#inventory-panel {
    overflow-y: auto;
    background:
        linear-gradient(
            135deg,
            rgba(82, 190, 211, 0.035),
            transparent 36%
        ),
        #061015;
}

.inventory-sheet {
    width: min(1500px, calc(100% - 3rem));
    margin: 0 auto;
    padding: 2rem 0 3rem;
    box-sizing: border-box;
}

.inventory-sheet__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 1.35rem;
    border-bottom: 1px solid var(--tbg-line-strong);
}

.inventory-sheet__eyebrow {
    margin-bottom: 0.45rem;
    color: var(--tbg-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.inventory-sheet__title {
    margin: 0;
    color: #eef5f7;
    font-size: clamp(1.45rem, 2.4vw, 2.35rem);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.inventory-sheet__status {
    color: var(--tbg-accent);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-align: right;
}

.inventory-layout {
    display: grid;
    grid-template-columns: minmax(15rem, 0.8fr) minmax(18rem, 1fr) minmax(22rem, 1.4fr);
    gap: 1rem;
    padding-top: 1.25rem;
    align-items: start;
}

.inventory-section {
    min-width: 0;
    border: 1px solid var(--tbg-line);
    background: rgba(7, 20, 26, 0.72);
}

.inventory-section__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--tbg-line);
    background: rgba(14, 33, 42, 0.7);
}

.inventory-section__heading h2 {
    margin: 0;
    color: #e5eff2;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.inventory-section__heading span {
    color: var(--tbg-muted);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: right;
}

.inventory-hands,
.inventory-items {
    display: grid;
    gap: 0.65rem;
    padding: 0.75rem;
}

.inventory-hand {
    min-width: 0;
    border: 1px solid var(--tbg-line);
    background: rgba(3, 12, 16, 0.72);
}

.inventory-hand.is-unavailable {
    opacity: 0.55;
}

.inventory-hand__heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid rgba(103, 158, 176, 0.18);
}

.inventory-hand__label {
    color: #dbe8eb;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.inventory-hand__state {
    color: var(--tbg-muted);
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.inventory-item {
    min-width: 0;
    border-left: 2px solid rgba(82, 190, 211, 0.48);
    background: rgba(7, 21, 27, 0.72);
}

.inventory-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.7rem;
}

.inventory-item__name {
    min-width: 0;
    overflow: hidden;
    color: #dce9ec;
    font-size: 0.8rem;
    line-height: 1.3;
    text-overflow: ellipsis;
}

.inventory-item__count {
    flex: 0 0 auto;
    color: var(--tbg-muted);
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.09em;
}

.inventory-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    padding: 0 0.7rem 0.62rem;
}

.inventory-item__action {
    appearance: none;
    min-height: 1.75rem;
    padding: 0.3rem 0.58rem;
    border: 1px solid rgba(255, 185, 86, 0.5);
    background: rgba(61, 39, 12, 0.42);
    color: #f0d2a6;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
}

.inventory-item__action:hover,
.inventory-item__action:focus-visible {
    border-color: rgba(255, 199, 116, 0.9);
    background: rgba(115, 70, 16, 0.46);
    color: #fff1d8;
}

.inventory-item__action:focus-visible {
    outline: 1px solid var(--tbg-accent);
    outline-offset: 2px;
}

.inventory-item__contents {
    display: grid;
    gap: 0.45rem;
    margin: 0 0.55rem 0.55rem 0.75rem;
    padding-left: 0.6rem;
    border-left: 1px solid rgba(82, 190, 211, 0.22);
}

.inventory-item__warning {
    padding: 0 0.7rem 0.55rem;
    color: #d9b36d;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.inventory-empty {
    padding: 0.7rem;
    color: var(--tbg-muted);
    font-size: 0.72rem;
    font-style: italic;
}

@media (max-width: 1050px) {
    .inventory-layout {
        grid-template-columns: 1fr 1fr;
    }

    .inventory-section--carried {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .inventory-sheet {
        width: min(100% - 1.5rem, 1500px);
    }

    .inventory-sheet__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
    }

    .inventory-sheet__status {
        text-align: left;
    }

    .inventory-layout {
        grid-template-columns: 1fr;
    }

    .inventory-section--carried {
        grid-column: auto;
    }

    .inventory-section__heading span {
        display: none;
    }
}

/* ================================================================
   GC-0.4E1 — AUTHORITATIVE CLIENT PANEL VISIBILITY

   #play-panel has its own display:grid declaration, which otherwise
   outranks the generic .client-panel visibility rule by CSS
   specificity. The workspace owns which full-screen panel is visible.
   ================================================================ */

#client-workspace > .client-panel:not(.active) {
    display: none;
}

#client-workspace > #play-panel.client-panel.active {
    display: grid;
}

#client-workspace > #character-panel.client-panel.active {
    display: block;
}

#client-workspace > #inventory-panel.client-panel.active {
    display: block;
}

/* ================================================================
   TRUSTED OBSERVER-AUTHORIZED INTERACTIONS
   ================================================================ */

.inline-room-interaction {
    appearance: none;
    display: inline;
    margin: 0;
    padding: 0 0.06em;
    border: 0;
    border-bottom: 1px dotted rgba(82, 190, 211, 0.62);
    border-radius: 0;
    background: transparent;
    color: #a9e3ed;
    font: inherit;
    line-height: inherit;
    text-align: inherit;
    cursor: pointer;
}

.inline-room-interaction--character {
    border-bottom-color: rgba(210, 117, 255, 0.64);
    color: #d8b5eb;
}

.inline-room-interaction--object {
    border-bottom-color: rgba(255, 185, 86, 0.64);
    color: #dfc49d;
}

.inline-room-interaction:hover,
.inline-room-interaction:focus-visible {
    background: rgba(82, 190, 211, 0.11);
    color: #f1fbfd;
}

.inline-room-interaction:focus-visible {
    outline: 1px solid var(--tbg-accent);
    outline-offset: 2px;
}

.inline-room-interaction:disabled {
    padding: 0;
    border-bottom-color: transparent;
    background: transparent;
    color: inherit;
    cursor: text;
}

.trusted-interactions {
    display: flex;
    flex-direction: column;
    gap: 0.68rem;
    min-width: 0;
}

.trusted-interactions[hidden],
.interaction-popover[hidden] {
    display: none;
}

.trusted-interaction-group {
    min-width: 0;
}

.trusted-interaction-group__heading {
    margin: 0 0 0.3rem;
    color: var(--tbg-muted);
    font-family: var(--font-mono);
    font-size: 0.55em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.trusted-interaction-group__items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    min-width: 0;
}

.trusted-interaction {
    display: inline-flex;
    min-width: 0;
    border: 1px solid rgba(82, 190, 211, 0.38);
    background: rgba(3, 12, 16, 0.78);
}

.trusted-interaction--character {
    border-color: rgba(210, 117, 255, 0.44);
}

.trusted-interaction--object {
    border-color: rgba(255, 185, 86, 0.44);
}

.trusted-interaction button,
.interaction-popover button {
    appearance: none;
    border: 0;
    font-family: var(--font-mono);
    cursor: pointer;
}

.trusted-interaction__action,
.trusted-interaction__label {
    min-height: 2rem;
    padding: 0.38rem 0.52rem;
    background: transparent;
    color: var(--tbg-accent);
    font-size: 0.72em;
    text-align: left;
}

.trusted-interaction__label {
    display: inline-flex;
    align-items: center;
    color: var(--tbg-text);
    overflow-wrap: anywhere;
}

.trusted-interaction--character .trusted-interaction__action {
    color: #dca5f7;
}

.trusted-interaction--object .trusted-interaction__action {
    color: #edbd78;
}

.trusted-interaction__info {
    min-width: 2.5rem;
    min-height: 2rem;
    padding: 0.38rem 0.45rem;
    border-left: 1px solid rgba(82, 190, 211, 0.24) !important;
    background: rgba(82, 190, 211, 0.06);
    color: var(--tbg-muted);
    font-size: 0.52em;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.trusted-interaction button:hover,
.trusted-interaction button:focus-visible,
.interaction-popover button:hover,
.interaction-popover button:focus-visible {
    background: rgba(82, 190, 211, 0.14);
    color: #f1fbfd;
}

.trusted-interaction button:focus-visible,
.interaction-popover button:focus-visible {
    position: relative;
    z-index: 1;
    outline: 2px solid var(--tbg-accent);
    outline-offset: -2px;
}

.interaction-popover {
    position: fixed;
    z-index: 120;
    width: min(19rem, calc(100vw - 1rem));
    max-height: calc(100vh - 1rem);
    overflow: auto;
    padding: 0.75rem;
    border: 1px solid var(--tbg-line-strong);
    border-radius: 2px;
    background: rgba(3, 12, 16, 0.985);
    color: var(--tbg-text);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.62);
    font-family: var(--font-mono);
    font-size: var(--context-font-size);
}

.interaction-popover__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.interaction-popover__header h2 {
    margin: 0;
    color: #edf7f9;
    font-size: 0.84em;
    line-height: 1.3;
}

.interaction-popover__close {
    flex: 0 0 auto;
    min-width: 2rem;
    min-height: 2rem;
    background: transparent;
    color: var(--tbg-muted);
    font-size: 1em;
}

.interaction-popover__description {
    margin: 0.55rem 0 0;
    color: #c9d9dd;
    font-size: 0.7em;
    line-height: 1.45;
}

.interaction-popover__rows {
    display: grid;
    grid-template-columns: minmax(4rem, auto) minmax(0, 1fr);
    gap: 0.28rem 0.7rem;
    margin: 0.65rem 0 0;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(82, 190, 211, 0.16);
    font-size: 0.62em;
    line-height: 1.4;
}

.interaction-popover__rows dt {
    color: var(--tbg-muted);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.interaction-popover__rows dd {
    min-width: 0;
    margin: 0;
    color: var(--tbg-text);
    overflow-wrap: anywhere;
}

.interaction-popover__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.interaction-popover__action {
    min-height: 2rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--tbg-line) !important;
    background: rgba(82, 190, 211, 0.07);
    color: var(--tbg-accent);
    font-size: 0.64em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.client-log-actions button:not(:disabled) {
    opacity: 1;
    pointer-events: auto;
}

#session-log-download:not(:disabled) {
    color: var(--tbg-accent);
    background: rgba(82, 190, 211, 0.08);
}

@media (max-width: 600px), (pointer: coarse) {
    .inline-room-interaction:not(:disabled) {
        display: inline-block;
        min-height: 1.85em;
        margin: -0.18em 0;
        padding: 0.18em 0.12em;
    }

    .trusted-interaction__action,
    .trusted-interaction__label,
    .trusted-interaction__info {
        min-height: 2.75rem;
    }

    .interaction-popover.is-mobile {
        inset: auto 0 0 0;
        width: 100%;
        max-width: 100%;
        max-height: min(70vh, 28rem);
        padding: 0.9rem max(0.8rem, env(safe-area-inset-right))
            max(0.9rem, env(safe-area-inset-bottom))
            max(0.8rem, env(safe-area-inset-left));
        border-width: 1px 0 0;
        border-radius: 0;
    }
}

/* =================================================================
   GPS minimap — compact right-panel 5x5 navigation presentation
   ================================================================= */

.gps-minimap-section {
    padding: 1rem;
}

.gps-minimap-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    cursor: pointer;
    list-style: none;
    user-select: none;
    -webkit-user-select: none;
}

.gps-minimap-summary::-webkit-details-marker {
    display: none;
}

.gps-minimap-section[open] .gps-minimap-summary {
    margin-bottom: 0.75rem;
}

.gps-minimap-toggle-mark {
    color: var(--text-muted);
    font-size: 0.9em;
    transition: transform 120ms ease;
}

.gps-minimap-section:not([open]) .gps-minimap-toggle-mark {
    transform: rotate(-90deg);
}

.gps-minimap-status {
    padding: 0.65rem 0.5rem;
    border: 1px solid var(--border);
    text-align: center;
    letter-spacing: 0.08em;
}

.gps-minimap-active[hidden] {
    display: none;
}

.gps-minimap-header {
    margin-bottom: 0.5rem;
    text-align: center;
}

.gps-minimap-name {
    color: var(--text);
    font-size: 0.76em;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.gps-minimap-coordinates {
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.68em;
    white-space: nowrap;
}

.gps-minimap-compass {
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    font-family: var(--font-mono);
}

.gps-minimap-middle {
    display: grid;
    grid-template-columns: 1.5rem auto 1.5rem;
    align-items: center;
    justify-content: center;
}

.gps-minimap-direction {
    color: var(--text-muted);
    font-size: 0.72em;
    font-weight: 700;
    text-align: center;
}

.gps-minimap-north,
.gps-minimap-south {
    line-height: 1.25;
}

.gps-minimap-grid {
    display: grid;
    grid-template-columns: repeat(5, 2ch);
    grid-template-rows: repeat(5, 1.25em);
    align-items: center;
    justify-items: center;
    font-size: 0.82em;
    font-weight: 700;
    line-height: 1;
}

.gps-minimap-cell {
    display: inline-block;
    width: 2ch;
    white-space: pre;
    text-align: center;
}

/* Shared semantic palette with the text GPS. */
.gps-minimap-cell--current {
    color: #ff4f4f;
    text-shadow: 0 0 5px rgba(255, 79, 79, 0.45);
}

.gps-minimap-cell--road {
    color: var(--yellow);
}

.gps-minimap-cell--poi {
    color: #ff62e8;
}

.gps-minimap-cell--structure {
    color: #f2eee2;
}

.gps-minimap-cell--vegetation {
    color: var(--green);
}

.gps-minimap-cell--water {
    color: #4f8fff;
}

.gps-minimap-cell--deep_water {
    color: #78c7ff;
}

.gps-minimap-cell--marsh {
    color: #55d8d0;
}

.gps-minimap-cell--open_ground {
    color: var(--text-muted);
}

.gps-minimap-cell--blank {
    color: transparent;
}

.gps-minimap-cell--other {
    color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
    .gps-minimap-toggle-mark {
        transition: none;
    }
}


/* ================================================================
   WEBCLIENT-MAP-2B — CANONICAL ASCII CITY MAP

   The browser presents the public reference map returned by the
   server. It does not own geography or Character position truth.
   ================================================================ */

#map-panel {
    overflow: hidden;
    background:
        linear-gradient(
            135deg,
            rgba(82, 190, 211, 0.035),
            transparent 34%
        ),
        #061015;
}

.map-workspace {
    min-width: 0;
    min-height: 0;
}

.map-workspace__shell {
    display: flex;
    flex-direction: column;

    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;

    box-sizing: border-box;
}

.map-workspace__header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;

    padding: 1.35rem 1.5rem 1rem;

    border-bottom: 1px solid var(--tbg-line-strong);

    background:
        linear-gradient(
            90deg,
            rgba(82, 190, 211, 0.035),
            transparent 48%
        );
}

.map-workspace__eyebrow {
    margin-bottom: 0.4rem;

    color: var(--tbg-muted);

    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.map-workspace__title {
    margin: 0;

    color: #eef5f7;

    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.map-workspace__status {
    color: var(--tbg-accent);

    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;

    text-align: right;
}

.map-workspace__status.is-error {
    color: #e98c8c;
}

.map-workspace__content {
    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    overflow: auto;

    padding: 1.25rem 1.5rem 2rem;

    box-sizing: border-box;
}

.map-workspace__ascii {
    display: block;

    width: max-content;
    min-width: 100%;

    margin: 0;

    color: #c8d8dc;
    background: transparent;

    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.25;

    white-space: pre;
    tab-size: 4;

    overflow: visible;
}

@media (max-width: 850px) {
    .map-workspace__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.6rem;

        padding:
            1rem
            0.9rem
            0.8rem;
    }

    .map-workspace__status {
        text-align: left;
    }

    .map-workspace__content {
        padding:
            0.9rem
            0.8rem
            1.5rem;
    }

    .map-workspace__ascii {
        font-size: 0.66rem;
    }
}


/* ================================================================
   WEBCLIENT-MAP-2C — CANONICAL ASCII MAP COLORS

   Mirrors the existing GPS semantic palette while preserving the
   canonical help-map color categories.
   ================================================================ */

.map-workspace__ansi--road {
    color: var(--yellow);
}

.map-workspace__ansi--poi {
    color: #ff62e8;
}

.map-workspace__ansi--transit {
    color: #d7a83d;
}

.map-workspace__ansi--structure {
    color: #f2eee2;
}

.map-workspace__ansi--vegetation {
    color: var(--green);
}

.map-workspace__ansi--water {
    color: #4f8fff;
}

.map-workspace__ansi--deep-water {
    color: #78c7ff;
}

.map-workspace__ansi--marsh {
    color: #55d8d0;
}

.map-workspace__ansi--open-ground {
    color: var(--text-muted);
}

.map-workspace__ansi--cyan {
    color: #55d8d0;
}

.map-workspace__ansi--normal {
    color: var(--text);
}


/* ================================================================
   WEBCLIENT-MAP-3 — CURRENT GPS POSITION
   ================================================================ */

.map-workspace__current-location {
    color: #ff4f4f;

    background:
        rgba(255, 79, 79, 0.16);

    font-weight: 800;

    text-shadow:
        0 0 4px rgba(255, 79, 79, 0.85),
        0 0 9px rgba(255, 79, 79, 0.45);

    outline:
        1px solid rgba(255, 79, 79, 0.55);

    outline-offset: -1px;
}


/* ================================================================
   WEBCLIENT-MAP-4A — MAP VIEWPORT + NAVIGATION SIDEBAR
   ================================================================ */

.map-workspace__content {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        310px;

    gap: 0;

    padding: 0;

    overflow: hidden;
}

.map-workspace__viewport {
    min-width: 0;
    min-height: 0;

    overflow: auto;

    padding:
        16px
        20px
        24px;
}

.map-workspace__ascii {
    width: max-content;
    min-width: max-content;

    margin:
        0
        auto;

    font-size:
        0.76rem;
}


/* ---------- Right utility rail ---------- */

.map-utility {
    min-width: 0;
    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding:
        16px;

    border-left:
        1px solid
        rgba(85, 216, 208, 0.34);

    background:
        rgba(11, 14, 20, 0.78);
}

.map-utility__section {
    padding:
        0
        0
        15px;

    margin:
        0
        0
        15px;

    border-bottom:
        1px solid
        var(--border);
}

.map-utility__section:last-child {
    margin-bottom: 0;

    border-bottom: 0;
}

.map-utility__heading {
    color:
        #55d8d0;

    font-size:
        0.68rem;

    font-weight:
        700;

    letter-spacing:
        0.13em;
}

.map-utility__heading-row {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    margin-bottom: 10px;
}


/* ---------- Live navigation readout ---------- */

.map-utility__readout {
    margin-top: 10px;
}

.map-utility__readout > div {
    display: grid;

    grid-template-columns:
        72px
        minmax(0, 1fr);

    gap: 10px;

    align-items: baseline;

    padding:
        5px
        0;
}

.map-utility__readout dt {
    color:
        var(--text-muted);

    font-size:
        0.66rem;

    letter-spacing:
        0.08em;
}

.map-utility__readout dd {
    min-width: 0;

    overflow-wrap: anywhere;

    color:
        var(--text);

    font-size:
        0.72rem;
}


/* ---------- Layer controls ---------- */

.map-layer-list {
    display: grid;

    grid-template-columns:
        1fr;

    gap: 2px;
}

.map-layer-control {
    display: grid;

    grid-template-columns:
        18px
        12px
        minmax(0, 1fr);

    gap: 8px;

    align-items: center;

    min-height: 28px;

    padding:
        3px
        4px;

    cursor: pointer;

    color:
        var(--text);

    font-size:
        0.72rem;
}

.map-layer-control:hover {
    background:
        rgba(255, 255, 255, 0.035);
}

.map-layer-control input {
    width: 14px;
    height: 14px;

    accent-color:
        var(--amber);
}

.map-layer-swatch {
    display: block;

    width: 10px;
    height: 10px;

    border:
        1px solid
        rgba(255, 255, 255, 0.18);
}

.map-layer-swatch--road {
    background:
        var(--yellow);
}

.map-layer-swatch--poi {
    background:
        #ff62e8;
}

.map-layer-swatch--transit {
    background:
        #d7a83d;
}

.map-layer-swatch--structure {
    background:
        #f2eee2;
}

.map-layer-swatch--vegetation {
    background:
        var(--green);
}

.map-layer-swatch--water {
    background:
        #4f8fff;
}

.map-layer-swatch--deep-water {
    background:
        #78c7ff;
}

.map-layer-swatch--marsh {
    background:
        #55d8d0;
}

.map-layer-swatch--open-ground {
    background:
        var(--text-muted);
}

.map-layer-swatch--current {
    background:
        #ff4f4f;

    box-shadow:
        0 0 6px
        rgba(255, 79, 79, 0.55);
}


/* ---------- Utility controls ---------- */

.map-utility__reset {
    padding:
        3px
        7px;

    border:
        1px solid
        var(--border);

    background:
        transparent;

    color:
        var(--text-muted);

    font:
        inherit;

    font-size:
        0.62rem;

    letter-spacing:
        0.08em;

    cursor:
        pointer;
}

.map-utility__reset:hover {
    border-color:
        var(--amber-dim);

    color:
        var(--amber);
}

.map-utility__note {
    margin-top: 9px;

    color:
        var(--text-muted);

    font-size:
        0.68rem;

    line-height:
        1.45;
}

.map-utility__note strong {
    color:
        #ff4f4f;
}


/* ---------- Functional layer visibility ---------- */

.map-layer--hide-pois
.map-workspace__ansi--poi:not(.map-workspace__color-key) {
    visibility: hidden;
}

.map-layer--hide-transit
.map-workspace__ansi--transit:not(.map-workspace__color-key) {
    visibility: hidden;
}

.map-layer--hide-structures
.map-workspace__ansi--structure:not(.map-workspace__color-key) {
    visibility: hidden;
}

.map-layer--hide-vegetation
.map-workspace__ansi--vegetation:not(.map-workspace__color-key) {
    visibility: hidden;
}

.map-layer--hide-water
.map-workspace__ansi--water:not(.map-workspace__color-key) {
    visibility: hidden;
}

.map-layer--hide-deep-water
.map-workspace__ansi--deep-water:not(.map-workspace__color-key) {
    visibility: hidden;
}

.map-layer--hide-marsh
.map-workspace__ansi--marsh:not(.map-workspace__color-key) {
    visibility: hidden;
}

.map-layer--hide-open-ground
.map-workspace__ansi--open-ground:not(.map-workspace__color-key) {
    visibility: hidden;
}

.map-layer--hide-current-location
.map-workspace__current-location {
    visibility: hidden;

    text-shadow: none;

    outline: 0;
}


/* ---------- Narrow-screen fallback ---------- */

@media (max-width: 900px) {
    .map-workspace__content {
        display: block;

        overflow: auto;
    }

    .map-workspace__viewport {
        overflow: visible;

        padding:
            12px;
    }

    .map-workspace__ascii {
        margin: 0;
    }

    .map-utility {
        border-left: 0;

        border-top:
            1px solid
            rgba(85, 216, 208, 0.34);
    }

    .map-layer-list {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }
}


/* ================================================================
   WEBCLIENT-MAP-4B — SPLIT MAP + POI DIRECTORY
   ================================================================ */

.map-workspace__primary {
    display: grid;

    grid-template-rows:
        minmax(0, 1fr)
        minmax(170px, 0.34fr);

    min-width: 0;
    min-height: 0;

    overflow: hidden;

    background:
        rgba(3, 12, 16, 0.42);
}


/* ---------- Shared section shells ---------- */

.map-reference-panel,
.map-poi-panel {
    display: grid;

    grid-template-rows:
        auto
        minmax(0, 1fr);

    min-width: 0;
    min-height: 0;

    overflow: hidden;
}

.map-reference-panel {
    border-bottom:
        1px solid
        rgba(85, 216, 208, 0.24);
}

.map-reference-panel__header,
.map-poi-panel__header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    padding:
        8px
        14px;

    border-bottom:
        1px solid
        rgba(85, 216, 208, 0.14);

    background:
        rgba(7, 20, 26, 0.78);
}

.map-reference-panel__eyebrow,
.map-poi-panel__eyebrow {
    margin-bottom:
        2px;

    color:
        var(--text-muted);

    font-size:
        0.54rem;

    font-weight:
        700;

    letter-spacing:
        0.13em;
}

.map-reference-panel__title,
.map-poi-panel__title {
    margin: 0;

    color:
        #dcebed;

    font-size:
        0.68rem;

    font-weight:
        700;

    letter-spacing:
        0.12em;
}

.map-reference-panel__meta,
.map-poi-panel__meta {
    color:
        #55d8d0;

    font-size:
        0.54rem;

    font-weight:
        700;

    letter-spacing:
        0.09em;

    text-align:
        right;
}


/* ---------- Map retains its own scroll ---------- */

.map-workspace__viewport {
    min-height: 0;

    overflow: auto;
}


/* ---------- POI directory gets independent scroll ---------- */

.map-poi-panel__viewport {
    min-width: 0;
    min-height: 0;

    overflow: auto;

    padding:
        10px
        16px
        16px;
}

.map-poi-panel__directory {
    width: max-content;
    min-width: 100%;

    margin: 0;

    color:
        var(--text);

    font-family:
        var(--font-mono);

    font-size:
        0.70rem;

    line-height:
        1.35;

    white-space:
        pre;

    tab-size:
        4;
}


/* The directory's own cyan heading remains canonical output. */
.map-poi-panel__directory
.map-workspace__ansi--cyan {
    color:
        #55d8d0;
}


/* ---------- Narrow-screen layout ---------- */

@media (max-width: 900px) {
    .map-workspace__primary {
        display: block;

        overflow: visible;
    }

    .map-reference-panel,
    .map-poi-panel {
        display: block;

        overflow: visible;
    }

    .map-workspace__viewport {
        overflow: auto;
    }

    .map-poi-panel__viewport {
        max-height: 42vh;

        overflow: auto;
    }

    .map-reference-panel__meta,
    .map-poi-panel__meta {
        display: none;
    }
}


/* ================================================================
   WEBCLIENT-MAP-4C — THREE-COLUMN RESIZABLE WORKSPACE

   Desktop:
       [ MAP ] <=> [ POIs ] <=> [ UTILITIES ]

   Width state is browser-local presentation only.
   ================================================================ */

.map-workspace__content {
    --map-poi-width: 330px;
    --map-utility-width: 230px;
    --map-column-resizer-width: 8px;

    grid-template-columns:
        minmax(460px, 1fr)
        var(--map-column-resizer-width)
        var(--map-poi-width)
        var(--map-column-resizer-width)
        var(--map-utility-width);

    min-width: 0;
    min-height: 0;
}


/*
 * MAP-4B used this wrapper for the former vertical map/POI stack.
 * display: contents keeps its semantics while promoting its children
 * into the MAP-4C parent grid.
 */
.map-workspace__primary {
    display: contents;
}


/* ---------- Three independent full-height columns ---------- */

.map-reference-panel,
.map-poi-panel,
.map-utility {
    min-width: 0;
    min-height: 0;
}

.map-reference-panel {
    border-bottom: 0;
}

.map-poi-panel {
    border-left: 0;

    background:
        rgba(3, 12, 16, 0.48);
}

.map-poi-panel__viewport {
    height: auto;
    max-height: none;

    overflow:
        auto;
}

.map-utility {
    padding:
        14px
        12px;

    border-left: 0;
}


/* ---------- Compact utility rail ---------- */

.map-utility__readout > div {
    grid-template-columns:
        58px
        minmax(0, 1fr);

    gap:
        8px;
}

.map-utility__readout dt {
    font-size:
        0.61rem;
}

.map-utility__readout dd {
    font-size:
        0.68rem;
}

.map-layer-control {
    grid-template-columns:
        16px
        10px
        minmax(0, 1fr);

    gap:
        6px;

    min-height:
        26px;

    padding:
        2px;

    font-size:
        0.68rem;
}

.map-layer-control input {
    width:
        13px;

    height:
        13px;
}

.map-layer-swatch {
    width:
        9px;

    height:
        9px;
}

.map-utility__note {
    font-size:
        0.64rem;
}


/* ---------- Draggable column separators ---------- */

.map-column-resizer {
    position:
        relative;

    z-index:
        8;

    width:
        100%;

    min-width:
        0;

    min-height:
        0;

    cursor:
        col-resize;

    touch-action:
        none;

    outline:
        none;

    background:
        rgba(85, 216, 208, 0.025);
}

.map-column-resizer::after {
    content:
        "";

    position:
        absolute;

    top:
        0;

    bottom:
        0;

    left:
        50%;

    width:
        1px;

    background:
        rgba(85, 216, 208, 0.30);

    transform:
        translateX(-50%);

    transition:
        width 100ms ease,
        background-color 100ms ease,
        box-shadow 100ms ease;
}

.map-column-resizer:hover,
.map-column-resizer:focus-visible,
.map-column-resizer.is-resizing {
    background:
        rgba(85, 216, 208, 0.08);
}

.map-column-resizer:hover::after,
.map-column-resizer:focus-visible::after,
.map-column-resizer.is-resizing::after {
    width:
        3px;

    background:
        #55d8d0;

    box-shadow:
        0 0 8px
        rgba(85, 216, 208, 0.42);
}

body.map-column-resizing,
body.map-column-resizing * {
    cursor:
        col-resize !important;

    user-select:
        none !important;
}


/* ---------- Narrow-screen fallback ---------- */

@media (max-width: 1050px) {
    .map-workspace__content {
        display:
            block;

        overflow:
            auto;
    }

    .map-workspace__primary {
        display:
            block;
    }

    .map-column-resizer {
        display:
            none;
    }

    .map-reference-panel {
        min-height:
            52vh;

        border-bottom:
            1px solid
            rgba(85, 216, 208, 0.24);
    }

    .map-poi-panel {
        max-height:
            40vh;

        border-top:
            1px solid
            rgba(85, 216, 208, 0.18);
    }

    .map-poi-panel__viewport {
        max-height:
            34vh;
    }

    .map-utility {
        border-top:
            1px solid
            rgba(85, 216, 208, 0.34);
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-column-resizer::after {
        transition:
            none;
    }
}


/* ================================================================
   WEBCLIENT-MAP-5A2 — CLICKABLE CANONICAL POIs
   ================================================================ */

/* Exact two-character canonical POI cell. */
.map-workspace__poi-target {
    display:
        inline-block;

    position:
        relative;

    min-width:
        2ch;
}


/*
 * Selection is an outline/background layer rather than a forced text
 * color so a GPS @@ marker inside the same cell remains visibly red.
 */
.map-workspace__poi-target.is-selected {
    z-index:
        2;

    background:
        rgba(255, 98, 232, 0.18);

    outline:
        2px solid
        rgba(255, 98, 232, 0.95);

    outline-offset:
        1px;

    box-shadow:
        0 0 8px
        rgba(255, 98, 232, 0.68),
        0 0 15px
        rgba(255, 98, 232, 0.28);
}


/*
 * If the general POI layer is hidden, keep the explicitly selected
 * destination visible. All other POIs remain hidden.
 */
.map-layer--hide-pois
.map-workspace__poi-target.is-selected {
    visibility:
        visible;
}


/* ---------- Interactive POI directory ---------- */

.map-poi-directory__entry {
    appearance:
        none;

    display:
        block;

    width:
        max-content;

    min-width:
        100%;

    margin:
        0;

    padding:
        0
        4px;

    border:
        0;

    border-left:
        2px solid
        transparent;

    background:
        transparent;

    color:
        var(--text);

    font:
        inherit;

    line-height:
        inherit;

    text-align:
        left;

    white-space:
        pre;

    cursor:
        pointer;
}

.map-poi-directory__entry:hover {
    border-left-color:
        rgba(255, 98, 232, 0.55);

    background:
        rgba(255, 98, 232, 0.07);

    color:
        #f4e9f2;
}

.map-poi-directory__entry:focus-visible {
    position:
        relative;

    z-index:
        1;

    border-left-color:
        #ff62e8;

    background:
        rgba(255, 98, 232, 0.10);

    color:
        #ffffff;

    outline:
        1px solid
        rgba(255, 98, 232, 0.82);

    outline-offset:
        -1px;
}

.map-poi-directory__entry.is-selected {
    border-left-color:
        #ff62e8;

    background:
        rgba(255, 98, 232, 0.14);

    color:
        #ffffff;

    text-shadow:
        0 0 5px
        rgba(255, 98, 232, 0.35);
}

.map-poi-directory__heading {
    color:
        #55d8d0;

    font-weight:
        700;
}

.map-poi-directory__category {
    color:
        var(--text-muted);

    font-weight:
        700;
}

.map-poi-directory__line {
    color:
        inherit;
}


/* ================================================================
   WEBCLIENT-MAP-5B — SELECTED POI READOUT
   ================================================================ */

.map-selected-poi {
    border-left:
        2px solid
        rgba(255, 98, 232, 0.62);

    background:
        rgba(255, 98, 232, 0.035);
}

.map-selected-poi[hidden] {
    display:
        none;
}

.map-selected-poi__readout dd {
    min-width:
        0;

    overflow-wrap:
        anywhere;
}

[data-map-selected-poi-code] {
    color:
        #ff62e8;

    font-weight:
        700;
}

[data-map-selected-poi-name] {
    color:
        #ffffff;
}

[data-map-selected-poi-coordinates] {
    color:
        #55d8d0;

    white-space:
        nowrap;
}


/* ================================================================
   WEBCLIENT-MAP-5C — GRAPHICAL POI CATEGORY BADGES
   Visual language follows the earlier NeoOrleans graphical map.
   ================================================================ */

.map-poi-directory__entry {
    display:
        flex;

    align-items:
        center;

    gap:
        0.55ch;
}

.map-poi-directory__entry-text {
    display:
        inline-block;

    white-space:
        pre;
}


/* Small pictogram tile directly left of the canonical POI number. */

.map-poi-directory__badge {
    box-sizing:
        border-box;

    display:
        inline-flex;

    flex:
        0 0 1.45em;

    align-items:
        center;

    justify-content:
        center;

    width:
        1.45em;

    height:
        1.45em;

    border:
        1px solid
        currentColor;

    border-radius:
        2px;

    font-family:
        monospace;

    font-size:
        0.88em;

    font-weight:
        900;

    line-height:
        1;

    text-align:
        center;

    text-shadow:
        0 0 4px
        currentColor;
}


/* English Turn / megacorp enclave. */
.map-poi-directory__badge--enclave {
    color:
        #ff62e8;

    background:
        rgba(255, 98, 232, 0.15);
}


/* Corporate towers / finance / manufacturers. */
.map-poi-directory__badge--corporate {
    color:
        #5edcff;

    background:
        rgba(94, 220, 255, 0.12);
}


/* Medical / cloning / augmentation. */
.map-poi-directory__badge--medical {
    color:
        #ffffff;

    border-color:
        #ff4d5c;

    background:
        #d92d3c;

    text-shadow:
        none;
}


/* Civic / police / fire / transit / infrastructure. */
.map-poi-directory__badge--civic {
    color:
        #91c7ff;

    background:
        rgba(80, 145, 255, 0.14);
}


/* Bars / clubs / casino / social venues. */
.map-poi-directory__badge--entertainment {
    color:
        #ee75ff;

    background:
        rgba(238, 117, 255, 0.13);
}


/* Shops / arms / salvage / services. */
.map-poi-directory__badge--commerce {
    color:
        #f4b451;

    background:
        rgba(244, 180, 81, 0.14);
}


/* Universities / parks. */
.map-poi-directory__badge--education {
    color:
        #68e18b;

    background:
        rgba(104, 225, 139, 0.13);
}


/* Cemeteries. */
.map-poi-directory__badge--cemetery {
    color:
        #d7d7df;

    background:
        rgba(215, 215, 223, 0.09);
}


/* Housing / stacks / cube hotels. */
.map-poi-directory__badge--residential {
    color:
        #55d8d0;

    background:
        rgba(85, 216, 208, 0.13);
}


/* Safety fallback for any future unclassified public POI. */
.map-poi-directory__badge--generic {
    color:
        #8bbcff;

    background:
        rgba(139, 188, 255, 0.10);

    border-radius:
        50%;
}


/* Selected POI keeps its category shape but flashes white/magenta. */
.map-poi-directory__entry.is-selected
.map-poi-directory__badge {
    color:
        #ffffff;

    border-color:
        #ff62e8;

    box-shadow:
        0 0 7px
        rgba(255, 98, 232, 0.78);

    text-shadow:
        0 0 5px
        rgba(255, 98, 232, 0.95);
}


/* ================================================================
   WEBCLIENT-MAP-5C2 — SPECIALIZED MEDICAL POI ICONS
   ================================================================ */

.map-poi-directory__badge svg {
    display:
        block;

    width:
        1.05em;

    height:
        1.05em;

    overflow:
        visible;

    fill:
        none;

    stroke:
        currentColor;

    stroke-width:
        1.45;

    stroke-linecap:
        round;

    stroke-linejoin:
        round;
}


/* DNA / genetics / cloning. */
.map-poi-directory__badge--cloning {
    color:
        #75e9ff;

    background:
        rgba(117, 233, 255, 0.13);

    border-color:
        rgba(117, 233, 255, 0.88);
}


/* Cyberware surgery / augmentation. */
.map-poi-directory__badge--augmentation {
    color:
        #f1c75b;

    background:
        rgba(241, 199, 91, 0.13);

    border-color:
        rgba(241, 199, 91, 0.90);
}


/* ================================================================
   WEBCLIENT-MAP-5C3 — SPECIALIZED EMERGENCY POI ICONS
   ================================================================ */

/* NOPD precinct / police facility. */
.map-poi-directory__badge--police {
    color:
        #d8edff;

    background:
        rgba(34, 92, 166, 0.72);

    border-color:
        #74baff;

    box-shadow:
        inset 0 0 4px
        rgba(116, 186, 255, 0.25);
}


/* Fire & Rescue / emergency response. */
.map-poi-directory__badge--fire-rescue {
    color:
        #ffffff;

    background:
        #187ac7;

    border-color:
        #75c7ff;

    box-shadow:
        inset 0 0 4px
        rgba(117, 199, 255, 0.30);
}


/*
 * Emergency pictograms use slightly stronger strokes than the
 * cloning/cyberware icons so shield/star silhouettes remain legible.
 */
.map-poi-directory__badge--police svg,
.map-poi-directory__badge--fire-rescue svg {
    stroke-width:
        1.55;
}

/* ================================================================
   GAMES-UI-B — generic Games panel shell (empty state only)
   ================================================================ */

.games-workspace {
    min-width: 0;
    min-height: 0;
}

.games-workspace__shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;

    box-sizing: border-box;
    padding: 2rem;
    text-align: center;
}

.games-workspace__header {
    margin-bottom: 0.9rem;
}

.games-workspace__eyebrow {
    margin-bottom: 0.4rem;

    color: var(--tbg-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.games-workspace__title {
    margin: 0;

    color: var(--tbg-text);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.games-workspace__empty {
    max-width: 32rem;

    color: var(--tbg-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

@media (max-width: 520px) {
    .games-workspace__shell {
        padding: 1.25rem;
    }

    .games-workspace__title {
        font-size: 1rem;
    }
}

/* ================================================================
   GAMES-UI-F1 — shared Blackjack table renderer + Crescent Crown skin
   ================================================================
   Geometry/behavior classes (.blackjack-table*, .blackjack-seat*,
   .blackjack-card*, .blackjack-chip*, .blackjack-btn*) are venue-
   agnostic and shared by every future venue. Venue IDENTITY lives in
   the .blackjack-table--<venue_id> skin modifier only (palette, rail
   material, branding colors, card-back treatment) - never in the
   shared geometry classes themselves, so Obsidian Exchange can be
   added later as a second skin modifier without touching structure.
   ================================================================ */

.blackjack-table {
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    overflow: auto;
    padding: 0.75rem;
}

.blackjack-table__rail {
    flex: 1 1 auto;
    display: flex;
    min-width: 0;
    min-height: 480px;
    box-sizing: border-box;
    border-radius: 2rem;
    padding: 0.9rem;
    /* venue-agnostic fallback rail (no venue_id / unknown venue) */
    background: linear-gradient(160deg, #2a2a2a, #161616 70%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.55),
        0 10px 28px rgba(0, 0, 0, 0.4);
}

.blackjack-table__felt {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    border-radius: 1.5rem;
    padding: 1rem 1.25rem 0.85rem;
    position: relative;
    /* venue-agnostic fallback felt */
    background: linear-gradient(160deg, #1d3b2c, #122419 65%);
    border: 2px solid rgba(255, 255, 255, 0.10);
    color: #e7ede9;
    gap: 0.55rem;
    overflow-y: auto;
}

/* ---- Crescent Crown skin: warm wood rail, green/gold felt ---- */

.blackjack-table--crescent_crown .blackjack-table__rail {
    background:
        linear-gradient(
            160deg,
            #4a2c15,
            #2a180b 55%,
            #1a0f07
        );
    border: 1px solid #6b4423;
    box-shadow:
        inset 0 0 44px rgba(0, 0, 0, 0.6),
        0 10px 30px rgba(0, 0, 0, 0.5);
}

.blackjack-table--crescent_crown .blackjack-table__felt {
    background:
        radial-gradient(
            ellipse at 50% 12%,
            rgba(255, 255, 255, 0.06),
            transparent 55%
        ),
        linear-gradient(
            165deg,
            #0e5232,
            #0a3a23 55%,
            #082c1a
        );
    border: 3px solid #c9a24e;
    box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.45);
}

.blackjack-table__brand {
    flex: 0 0 auto;
    text-align: center;
    padding-top: 0.15rem;
}

.blackjack-table__brand-crown {
    font-size: 1.3rem;
    line-height: 1;
    color: #d8d3c4;
}

.blackjack-table__brand-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    letter-spacing: 0.3em;
    color: #d8d3c4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.blackjack-table__brand-sub {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.66rem;
    letter-spacing: 0.5em;
    color: #b7b2a2;
    margin-top: 0.1rem;
}

.blackjack-table--crescent_crown .blackjack-table__brand-crown,
.blackjack-table--crescent_crown .blackjack-table__brand-name,
.blackjack-table--crescent_crown .blackjack-table__brand-sub {
    color: #e7cf94;
}

/* ---- decorative dealer equipment (non-interactive) ---- */

.blackjack-table__equipment {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    display: flex;
    gap: 0.4rem;
    opacity: 0.55;
    pointer-events: none;
}

.blackjack-table__equipment-piece {
    width: 1.6rem;
    height: 1.1rem;
    border-radius: 0.2rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.blackjack-table--crescent_crown .blackjack-table__equipment-piece {
    background: rgba(201, 162, 78, 0.18);
    border-color: rgba(201, 162, 78, 0.45);
}

/* ---- dealer zone ---- */

.blackjack-dealer {
    flex: 0 0 auto;
    text-align: center;
}

.blackjack-dealer__label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.3rem;
}

.blackjack-dealer__hand {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.blackjack-dealer__total {
    margin-top: 0.3rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #f2e6b8;
}

/* ---- status line (phase / turn / timer) ---- */

.blackjack-table__status {
    flex: 0 0 auto;
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.8);
    min-height: 1.1rem;
}

.blackjack-table__status--your-turn {
    color: #ffe08a;
    font-weight: 700;
}

/* ---- seats ---- */

.blackjack-table__seats {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 0.5rem;
    min-height: 0;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.blackjack-seat {
    flex: 0 1 148px;
    min-width: 108px;
    max-width: 170px;
    border-radius: 0.6rem;
    padding: 0.4rem 0.45rem;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.14);
    text-align: center;
}

.blackjack-seat--empty {
    opacity: 0.45;
    border-style: dashed;
}

.blackjack-seat--you {
    border-color: #ffe08a;
    box-shadow: 0 0 0 1px rgba(255, 224, 138, 0.4);
    background: rgba(255, 224, 138, 0.08);
}

.blackjack-seat--active-turn {
    border-color: #7be6a0;
    box-shadow: 0 0 0 1px rgba(123, 230, 160, 0.5);
}

.blackjack-seat__label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.blackjack-seat__you-badge {
    font-size: 0.55rem;
    padding: 0.05rem 0.3rem;
    border-radius: 0.2rem;
    background: #ffe08a;
    color: #2a1d06;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.blackjack-seat__name {
    font-size: 0.58rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.02em;
}

.blackjack-hand {
    margin-bottom: 0.3rem;
}

.blackjack-hand:last-child {
    margin-bottom: 0;
}

.blackjack-hand__cards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

.blackjack-hand__meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.85);
}

.blackjack-hand__total {
    font-weight: 700;
}

.blackjack-hand__outcome {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.blackjack-hand__outcome--win,
.blackjack-hand__outcome--blackjack {
    color: #7be6a0;
}

.blackjack-hand__outcome--loss,
.blackjack-hand__outcome--bust {
    color: #ff8a8a;
}

.blackjack-hand__outcome--push,
.blackjack-hand__outcome--surrender {
    color: #ffe08a;
}

/* ---- cards ---- */

.blackjack-card {
    /* GAMES-UI-H1R2: significantly enlarged (~1.9x the prior fixed
       2rem/2.8rem) and made responsive via clamp() instead of a single
       fixed desktop value. aspect-ratio keeps height locked to the
       same 2:2.8 card proportion as before, so only one dimension
       needs a clamp. Card face rank/suit rendering itself (semantic
       data, red/black suit color) is unchanged - this is size only. */
    width: clamp(2.4rem, 4.2vw, 3.9rem);
    aspect-ratio: 2 / 2.8;
    border-radius: 0.3rem;
    background: #f4f1e8;
    border: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 700;
    color: #1a1a1a;
    flex: 0 0 auto;
}

.blackjack-card__rank {
    font-size: clamp(1.05rem, 1.9vw, 1.7rem);
}

.blackjack-card__suit {
    font-size: clamp(1.2rem, 2.2vw, 1.95rem);
    margin-top: 0.08rem;
}

.blackjack-card--red {
    color: #b3261e;
}

.blackjack-card--back {
    background: repeating-linear-gradient(
        45deg,
        #1c2a55,
        #1c2a55 4px,
        #243568 4px,
        #243568 8px
    );
    border-color: rgba(255, 255, 255, 0.25);
}

.blackjack-table--crescent_crown .blackjack-card--back {
    background: repeating-linear-gradient(
        45deg,
        #0a3a23,
        #0a3a23 4px,
        #0e5232 4px,
        #0e5232 8px
    );
    border-color: #c9a24e;
}

/* ---- Obsidian Exchange skin: charcoal composite rail, cool graphite
   felt, purple/blue accents. Same shared geometry as every other venue
   skin - only palette/material/branding/card-back/chip color differ. ---- */

.blackjack-table--obsidian_exchange .blackjack-table__rail {
    background:
        linear-gradient(
            160deg,
            #1d1d24,
            #0b0b0e 55%,
            #050506
        );
    border: 1px solid #3c3450;
    box-shadow:
        inset 0 0 44px rgba(0, 0, 0, 0.7),
        0 10px 30px rgba(0, 0, 0, 0.55);
}

.blackjack-table--obsidian_exchange .blackjack-table__felt {
    background:
        radial-gradient(
            ellipse at 50% 12%,
            rgba(123, 140, 255, 0.07),
            transparent 55%
        ),
        linear-gradient(
            165deg,
            #17171f,
            #0e0e13 55%,
            #09090c
        );
    border: 3px solid #6a5acd;
    box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.55);
}

.blackjack-table--obsidian_exchange .blackjack-table__brand-crown,
.blackjack-table--obsidian_exchange .blackjack-table__brand-name,
.blackjack-table--obsidian_exchange .blackjack-table__brand-sub {
    color: #b9a8ff;
}

.blackjack-table--obsidian_exchange .blackjack-table__brand-name {
    text-shadow: 0 0 10px rgba(123, 140, 255, 0.4);
}

.blackjack-table--obsidian_exchange .blackjack-table__equipment-piece {
    background: rgba(90, 79, 196, 0.16);
    border-color: rgba(123, 140, 255, 0.5);
}

.blackjack-table--obsidian_exchange .blackjack-card--back {
    background: repeating-linear-gradient(
        45deg,
        #181229,
        #181229 4px,
        #251c44 4px,
        #251c44 8px
    );
    border-color: #7b8cff;
}

/* ---- viewer betting area ---- */

.blackjack-table__wager-area {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.85);
    min-height: 1.6rem;
}

.blackjack-table__wager-row {
    font-weight: 700;
}

.blackjack-table__wager-limits {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.6);
}

.blackjack-table__pending-chip {
    display: inline-flex;
}

/* ---- chip rack + controls ---- */

.blackjack-table__chiprail {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.blackjack-chip {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.55);
    background: radial-gradient(
        circle at 35% 30%,
        rgba(255, 255, 255, 0.25),
        rgba(0, 0, 0, 0.25) 70%
    );
    color: #fff;
    font-weight: 700;
    font-size: 0.66rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.blackjack-chip:focus-visible {
    outline: 2px solid var(--tbg-accent);
    outline-offset: 2px;
}

.blackjack-chip:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.blackjack-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.blackjack-chip--selected {
    border-style: solid;
    border-color: #ffe08a;
    box-shadow: 0 0 0 2px rgba(255, 224, 138, 0.5);
}

.blackjack-chip--5 { background-color: #5b6b73; }
.blackjack-chip--10 { background-color: #2f5d8a; }
.blackjack-chip--25 { background-color: #4a7a4a; }
.blackjack-chip--50 { background-color: #8a4a2f; }
.blackjack-chip--100 { background-color: #3a3a3a; }
.blackjack-chip--500 { background-color: #6a2f6a; }

/* Obsidian Exchange: darker corporate/metallic chip treatment, solid
   purple/blue borders instead of the default dashed rim. Denomination
   text/size/click behavior is unchanged - only color/border style. */

.blackjack-table--obsidian_exchange .blackjack-chip {
    border-style: solid;
}

.blackjack-table--obsidian_exchange .blackjack-chip--5 {
    background-color: #24242c;
    border-color: #5a4fc4;
}

.blackjack-table--obsidian_exchange .blackjack-chip--10 {
    background-color: #1e2433;
    border-color: #4f7fc4;
}

.blackjack-table--obsidian_exchange .blackjack-chip--25 {
    background-color: #241c3c;
    border-color: #7b5fd6;
}

.blackjack-table--obsidian_exchange .blackjack-chip--50 {
    background-color: #1a2030;
    border-color: #4a9bd6;
}

.blackjack-table--obsidian_exchange .blackjack-chip--100 {
    background-color: #151519;
    border-color: #9b8fff;
}

.blackjack-table--obsidian_exchange .blackjack-chip--500 {
    background-color: #2a1c42;
    border-color: #c9a8ff;
}

.blackjack-chip--pending {
    cursor: default;
    width: 2.1rem;
    height: 2.1rem;
    font-size: 0.58rem;
}

/* ---- action controls ---- */

.blackjack-table__actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding-top: 0.3rem;
}

.blackjack-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.35rem;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font: inherit;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
}

.blackjack-btn:hover,
.blackjack-btn:focus-visible {
    border-color: #ffe08a;
}

.blackjack-btn:focus-visible {
    outline: 2px solid var(--tbg-accent);
    outline-offset: 2px;
}

.blackjack-btn--bet {
    background: rgba(123, 230, 160, 0.18);
    border-color: rgba(123, 230, 160, 0.5);
}

.blackjack-btn--clear {
    background: rgba(255, 255, 255, 0.06);
}

.blackjack-btn--leave {
    background: rgba(255, 138, 138, 0.14);
    border-color: rgba(255, 138, 138, 0.4);
}

.blackjack-table__empty {
    margin: auto;
    color: var(--tbg-muted);
    font-size: 0.78rem;
    text-align: center;
    padding: 1rem;
}

@media (max-width: 850px) {
    .blackjack-table__rail {
        min-height: 0;
    }

    .blackjack-card {
        width: 1.7rem;
        height: 2.4rem;
    }

    .blackjack-seat {
        flex-basis: 120px;
        min-width: 92px;
    }

    .blackjack-table__equipment {
        display: none;
    }
}

@media (max-width: 600px) {
    .blackjack-table {
        padding: 0.4rem;
    }

    .blackjack-table__brand-sub {
        letter-spacing: 0.3em;
    }

    .blackjack-chip {
        width: 2.2rem;
        height: 2.2rem;
        font-size: 0.58rem;
    }
}

/* ============================================================
   GAMES-UI-JP1 - Poker table (own geometry, not a copy of the
   Blackjack table layout). Venue skin uses the same shared concept
   (a .poker-table--<venue_id> modifier keyed off state.venue_id) but
   its own color/branding values - never Blackjack's DOM geometry.
   Card proportions reuse the H1R2-proven clamp()/aspect-ratio approach.
   ============================================================ */

.poker-table {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.8rem;
    border-radius: 0.5rem;
    background: #10241c;
    color: #f5f1e6;
    font-family: inherit;
}

.poker-table__brand {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.poker-table__brand-motif {
    font-size: 1.2rem;
}

.poker-table__brand-sub {
    font-size: 0.7rem;
    opacity: 0.75;
}

.poker-table__title {
    font-size: 0.85rem;
    opacity: 0.85;
}

.poker-table__felt {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.8rem;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
}

.poker-table__variant {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
}

.poker-table__board {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.poker-table__board-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.poker-table__board-cards {
    display: flex;
    gap: 0.4rem;
}

.poker-table__board-empty {
    opacity: 0.5;
}

.poker-table__pot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-weight: 700;
}

.poker-table__turn {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem 0.75rem;
    min-height: 1.2rem;
}

.poker-table__turn-seat {
    font-weight: 600;
}

.poker-table__turn-owner {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.poker-table__turn-time-label {
    font-size: 0.68rem;
    font-weight: 700;
    opacity: 0.85;
}

.poker-table__turn-countdown {
    min-width: 2.4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.poker-table__side-pot {
    font-weight: 400;
    opacity: 0.8;
}

.poker-table__seats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.poker-seat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 110px;
    padding: 0.4rem 0.5rem;
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.poker-seat--empty {
    opacity: 0.5;
}

.poker-seat--acting {
    border-color: #d4af37;
    box-shadow: 0 0 0 1px #d4af37;
}

.poker-seat__number {
    font-size: 0.62rem;
    opacity: 0.7;
}

.poker-seat__name {
    font-weight: 600;
}

.poker-seat__stack,
.poker-seat__bet {
    font-size: 0.68rem;
    opacity: 0.85;
}

.poker-seat__cards {
    display: flex;
    gap: 0.2rem;
    margin-top: 0.2rem;
}

.poker-seat__acting-badge {
    margin-top: 0.2rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: #d4af37;
    letter-spacing: 0.05em;
}

.poker-table__own-cards {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.poker-table__own-cards-row {
    display: flex;
    gap: 0.35rem;
}

.poker-table__idle {
    opacity: 0.7;
    font-style: italic;
}

.poker-table__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.poker-action {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.poker-action__hint {
    font-size: 0.6rem;
    opacity: 0.7;
}

.poker-action__amount {
    width: 5rem;
    padding: 0.2rem 0.35rem;
    border-radius: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.3);
    color: inherit;
}

.poker-btn {
    padding: 0.35rem 0.7rem;
    border-radius: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.poker-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.poker-btn--fold {
    border-color: #a33;
}

.poker-btn--check,
.poker-btn--call {
    border-color: #3a3;
}

.poker-btn--bet,
.poker-btn--raise {
    border-color: #d4af37;
}

.poker-table__lifecycle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
}

.poker-btn--start {
    border-color: #3a3;
}

.poker-btn--buyin {
    border-color: #4a90d9;
}

.poker-btn--leave {
    border-color: #a33;
}

.poker-table__results {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.poker-result {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem;
    border-radius: 0.3rem;
    background: rgba(255, 255, 255, 0.05);
}

.poker-result__seat {
    font-size: 0.62rem;
    opacity: 0.7;
}

.poker-result__name {
    font-weight: 600;
}

.poker-result__cards {
    display: flex;
    gap: 0.2rem;
}

.poker-result__status {
    opacity: 0.7;
    font-style: italic;
}

.poker-result__payout {
    color: #6c6;
    font-weight: 700;
}

.poker-result__stack {
    font-size: 0.68rem;
    opacity: 0.8;
}

.poker-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: clamp(2.4rem, 4.2vw, 3.9rem);
    aspect-ratio: 2 / 2.8;
    border-radius: 0.3rem;
    background: #f5f1e6;
    color: #1a1a1a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    line-height: 1.05;
}

.poker-card--red {
    color: #b31b1b;
}

.poker-card__rank {
    font-size: clamp(1.05rem, 1.9vw, 1.7rem);
    font-weight: 700;
}

.poker-card__suit {
    font-size: clamp(1.2rem, 2.2vw, 1.95rem);
    margin-top: 0.08rem;
}

.poker-table--crescent_crown {
    background: #0d2a1a;
}

.poker-table--crescent_crown .poker-table__felt {
    background: rgba(0, 40, 20, 0.35);
}

.poker-table--crescent_crown .poker-table__brand-name,
.poker-table--crescent_crown .poker-seat--acting {
    color: #d4af37;
}

.poker-table--crescent_crown .poker-table__turn-owner,
.poker-table--crescent_crown .poker-table__turn-countdown {
    color: #d4af37;
}

.poker-table--obsidian_exchange {
    background: #1b1d24;
}

.poker-table--obsidian_exchange .poker-table__felt {
    background: rgba(30, 20, 50, 0.35);
}

.poker-table--obsidian_exchange .poker-table__brand-name {
    color: #8a7ffb;
}

.poker-table--obsidian_exchange .poker-table__turn-owner,
.poker-table--obsidian_exchange .poker-table__turn-countdown {
    color: #8a7ffb;
}

.poker-table--obsidian_exchange .poker-seat--acting {
    border-color: #8a7ffb;
    box-shadow: 0 0 0 1px #8a7ffb;
}

@media (max-width: 600px) {
    .poker-table {
        padding: 0.4rem;
    }

    .poker-seat {
        min-width: 92px;
    }
}

/* TBG-DISPLAY-COLLAPSE-BEGIN */

/*
 * DISPLAY menu presentation.
 *
 * Visibility itself is controlled directly by gel.js with an inline
 * !important display value. This CSS only owns layout/presentation.
 */
#client-header {
    overflow: visible;
}

.client-header-tools {
    flex: 0 0 auto;
    min-width: 0;
    overflow: visible;
}

#client-tabs {
    min-width: 0;
}

.client-display-control {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
    overflow: visible;
}

.client-display-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.client-display-toggle-mark {
    display: inline-block;
    min-width: 1ch;
    text-align: center;
}

#client-display-settings {
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.55rem;

    width: max-content;
    max-width: min(92vw, 760px);

    padding: 0.65rem 0.75rem;

    background: #071217;
    border: 1px solid #164653;
    box-shadow: 0 0.65rem 1.5rem rgba(0, 0, 0, 0.55);
}

/* TBG-DISPLAY-COLLAPSE-END */



/* MAP-GFX-DIRECT-1 */

.map-gfx-direct {
    width: 100%;
    margin-bottom: 1rem;
}

.map-gfx-direct__frame {
    display: block;
    width: 100%;
    height: 68vh;
    min-height: 520px;
    border: 0;
}


/* MAP-GFX-DIRECT-2 — opaque graphical map surface */

.map-gfx-direct {
    position: relative;
    background: #071018;
    overflow: hidden;
}

.map-gfx-direct__frame {
    background: #071018;
}

/* ================================================================
 * MAP-GFX-GRID-FIX-1
 *
 * map-reference-panel is a two-row grid:
 *   row 1 = header
 *   row 2 = graphical map
 *
 * The legacy ASCII viewport remains in the DOM so the existing
 * authoritative GPS presentation code can continue updating it.
 * It is simply not part of graphical webclient layout.
 * ================================================================ */

.map-reference-panel > .map-workspace__viewport {
    display: none !important;
}

.map-reference-panel > .map-gfx-direct {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
}

.map-reference-panel >
.map-gfx-direct >
.map-gfx-direct__frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #071018;
}

/* ================================================================
 * MINIMAP-GFX-1 — graphical PLAY-tab GPS minimap
 *
 * The original 5x5 ASCII grid remains in the DOM and continues to
 * receive the existing presentation updates. The graphical renderer
 * owns the visible center slot.
 * ================================================================ */

.gps-minimap-grid {
    display: none;
}

.gps-minimap-gfx-frame {
    display: block;
    width: 10rem;
    height: 10rem;
    border: 1px solid rgba(85, 216, 208, 0.24);
    background: #071018;
}

