/* ═══════════════════════════════════════════════════════════════
   Design tokens - single source of truth for the GridForge HUD.
   Sweep literals onto these so theming + UI scaling are free.
   --gf-ui-scale drives global HUD sizing (set from prefs at runtime).
   ═══════════════════════════════════════════════════════════════ */
:root {
    /* Accent / brand */
    --gf-accent:        #f0c060;
    --gf-accent-hot:    #ffd884;
    --gf-accent-deep:   #b8862f;
    --gf-accent-glow:   rgba(240,192,96,0.45);

    /* Semantic */
    --gf-danger:        #e0524a;
    --gf-danger-deep:   #8a2a25;
    --gf-success:       #6fc874;
    --gf-info:          #5aa6e0;
    --gf-mana:          #4f86d8;
    --gf-stamina:       #d9b13e;

    /* Text */
    --gf-text-1: #f4ecd8;   /* primary */
    --gf-text-2: #c9c2b4;   /* secondary */
    --gf-text-3: #948d80;   /* muted */
    --gf-text-4: #5e584d;   /* faint */

    /* Panels / surfaces (glass) */
    --gf-panel-bg:        rgba(18,18,26,0.82);
    --gf-panel-bg-strong: rgba(14,14,20,0.94);
    --gf-panel-bg-soft:   rgba(28,28,40,0.55);
    --gf-slot-bg:         rgba(255,255,255,0.045);
    --gf-slot-bg-hover:   rgba(255,255,255,0.10);

    /* Borders */
    --gf-border:        rgba(255,255,255,0.12);
    --gf-border-soft:   rgba(255,255,255,0.07);
    --gf-border-accent: rgba(240,192,96,0.40);

    /* Geometry / depth */
    --gf-radius:    7px;
    --gf-radius-sm: 4px;
    --gf-radius-lg: 12px;
    --gf-shadow:        0 6px 22px rgba(0,0,0,0.55);
    --gf-shadow-strong: 0 10px 38px rgba(0,0,0,0.7);
    --gf-inset:         inset 0 1px 0 rgba(255,255,255,0.08);
    --gf-blur:          7px;

    /* --gf-ui-scale is the GLOBAL HUD scale (set on :root from the `uiScale`
       account pref, default 0.85). Panels read it via `zoom` (see the HUD-scale
       block near the end of this file). --gf-bar-scale is the per-hotbar-slot
       scale hotbar.js sets on each bar; slots compose both so a hotbar honours
       the global scale AND its own per-bar sizing. */
    --gf-ui-scale: 1;
    --gf-bar-scale: 1;
    --gf-slot:   calc(46px * var(--gf-ui-scale) * var(--gf-bar-scale));
    --gf-slot-gap: calc(5px * var(--gf-ui-scale) * var(--gf-bar-scale));

    --gf-mono: 'Consolas', 'SF Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ═══════════════════════════════════════════════════════════════
   Global chrome - sleek, on-theme scrollbars + selection + focus.
   One source of truth: WebKit pseudo-elements are document-global and
   Firefox scrollbar-* is inherited, so this styles every scrollable
   element in the game (HUD, studio, login) regardless of where it's
   defined. Subtle translucent gold thumb, transparent track.
   ═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar        { width: 10px; height: 10px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  {
    background: rgba(240,192,96,0.28);
    border: 2px solid transparent;       /* inset look via padding-box clip */
    background-clip: padding-box;
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover  { background: rgba(240,192,96,0.5); }
::-webkit-scrollbar-thumb:active { background: var(--gf-accent-hot); }
::-webkit-scrollbar-corner       { background: transparent; }

/* Firefox - gated to Firefox so a non-auto scrollbar-color doesn't disable
   the richer WebKit styling in Chromium 121+ (-moz-appearance resolves only
   in Firefox). */
@supports (-moz-appearance: none) {
    * { scrollbar-width: thin; scrollbar-color: rgba(240,192,96,0.32) transparent; }
}

::selection { background: rgba(240,192,96,0.30); color: var(--gf-text-1); }

:focus-visible { outline: 2px solid var(--gf-border-accent); outline-offset: 2px; }

/* ── Fantasy icons (game-icons.net, CC BY 3.0) ──
   Masked SVG tinted to currentColor (gold by default). In-game reuse of the
   marketing-site pipeline. Usage:
     <span class="gf-ic" style="--ic:url('/assets/icons/sword.svg')"></span>
   or via client/js/ui/game_icons.js. Attribution: client/assets/CREDITS.md. */
.gf-ic {
    display: inline-block;
    vertical-align: middle;
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
    color: var(--gf-accent);
    background-color: currentColor;
    -webkit-mask: var(--ic, none) center / contain no-repeat;
    mask: var(--ic, none) center / contain no-repeat;
    /* The SVGs are opaque single-path shapes (fill=currentColor → black when
       used as an external mask image). Force ALPHA masking so the shape shows;
       the default `match-source` uses luminance and would hide black shapes. */
    -webkit-mask-mode: alpha;
    mask-mode: alpha;
}

/* ── HUD icon placements (size/tint per surface) ── */
.cs-cat-ic   { color: var(--gf-accent);      vertical-align: -2px; margin: 0 4px 0 1px; opacity: .95; }
.cs-skill-ic { color: var(--gf-accent-deep); width: 12px; height: 12px; vertical-align: -2px; margin-right: 6px; opacity: .8; }
.sb-tab-ic   { vertical-align: -2px; }
.craft-station-ic { color: var(--gf-accent);      vertical-align: -2px; margin-right: 5px; }
.craft-row-ic     { color: var(--gf-accent-deep); width: 14px; height: 14px; margin-right: 7px; vertical-align: -2px; opacity: .85; }
.pt-name-ic       { color: var(--gf-accent);      width: 15px; height: 15px; vertical-align: -2px; margin-right: 5px; }
.pt-row-ic        { color: var(--gf-accent-deep); width: 12px; height: 12px; vertical-align: -2px; margin-right: 6px; opacity: .8; }
/* Hotbar/action-slot icon: cream on the colored backing plate for legibility. */
.gf-slot-icon .gf-slot-svg {
    width: 74%; height: 74%;
    color: var(--gf-text-1);
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.65));
}
/* Inventory slots: faint equip-slot placeholder + filled-item category icon. */
.inv-slot { position: relative; }
.inv-slot-ph {
    position: absolute; inset: 22%; width: auto; height: auto;
    color: var(--gf-accent); opacity: 0.22; pointer-events: none;
}
.inv-item-ic {
    position: absolute; inset: 20%; width: auto; height: auto;
    color: var(--gf-text-1); filter: drop-shadow(0 1px 1px rgba(0,0,0,0.6)); pointer-events: none;
}
/* Third-party attribution footer in the Quick Help panel (CC BY 3.0). */
.qh-credit {
    margin-top: 10px; padding-top: 8px;
    border-top: 1px solid var(--gf-border-soft);
    font-size: 10px; color: var(--gf-text-3);
    text-align: center; line-height: 1.5;
}
.qh-credit a { color: var(--gf-accent-deep); text-decoration: none; }
.qh-credit a:hover { color: var(--gf-accent); text-decoration: underline; }

body {
    background: #000;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
    color: #fff;
    user-select: none;
}

#canvas-container {
    position: fixed;
    inset: 0;
}

#canvas-container.gf-custom-cursor-active {
    cursor: none !important;
}

#canvas-container.gf-custom-cursor-active * {
    cursor: none !important;
}

#canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ── Custom Gridforge Cursor ── */
#gf-custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    pointer-events: none;
    z-index: 10000;
    /* Top-left anchored to the mouse; each visual offsets its own hotspot
       (e.g. the arrow tip) onto this point. */
    transition: opacity 0.15s ease;
    will-change: left, top;
}

.gf-cursor-visual {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.25);
    transform-origin: center center;
}

/* Targeting reticle: the dashed ring rotates slowly like a locking sensor. */
.gf-cursor-target-visual .gf-reticle-spin {
    animation: gf-reticle-spin 5s linear infinite;
}
@keyframes gf-reticle-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Crosshair */
#crosshair {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 20px; height: 20px;
    pointer-events: none;
}
#crosshair::before, #crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255,255,255,0.85);
}
#crosshair::before { width: 2px; height: 100%; left: 50%; transform: translateX(-50%); }
#crosshair::after  { width: 100%; height: 2px; top: 50%; transform: translateY(-50%); }

/* Minimap - canvas fills its GameWindow content area */
.minimap-canvas-host {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #111;
    position: relative;
}
.minimap-canvas-host canvas {
    width: 100%;
    height: 100%;
    display: block;
    /* auto (not pixelated): the hillshaded background upscales smoothly. Per-pixel
       live terrain is written 1:1 via putImageData, so it stays crisp regardless. */
    image-rendering: auto;
}
/* Minimap window is compact - less titlebar padding so the canvas dominates */
.game-window[data-window-id="minimap"] .game-window-content {
    overflow: hidden;
    padding: 0;
}

/* ── Map shell: header (expanded only) above the canvas host ── */
.gf-map-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}
.gf-map-shell .minimap-canvas-host {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}

.gf-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 9px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--gf-border-soft);
    background: linear-gradient(180deg, rgba(56,52,40,0.35), rgba(30,28,22,0.35));
}
.gf-map-header-title {
    font-family: var(--gf-mono);
    font-size: 11px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--gf-text-2);
}
.gf-map-switcher {
    background: var(--gf-panel-bg-strong);
    color: var(--gf-text-1);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
    font-family: var(--gf-mono);
    font-size: 11px;
    padding: 2px 6px;
    cursor: pointer;
}
.gf-map-switcher:disabled { opacity: 0.7; cursor: default; }

/* ── Controls overlay (zoom / recenter / expand) ── */
.gf-map-controls {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}
.gf-map-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gf-panel-bg-strong);
    color: var(--gf-text-2);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.gf-map-btn:hover { border-color: var(--gf-border-accent); color: #fff; }
.gf-map-btn.is-on {
    border-color: var(--gf-border-accent);
    color: var(--gf-accent);
    box-shadow: 0 0 0 1px var(--gf-accent-glow);
}

/* ── Coords + legend readouts ── */
.gf-map-coords {
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 2;
    pointer-events: none;
    font-family: var(--gf-mono);
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--gf-text-2);
    background: rgba(0,0,0,0.45);
    padding: 2px 6px;
    border-radius: var(--gf-radius-sm);
}
.gf-map-legend {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 8px;
    max-width: 65%;
    background: rgba(0,0,0,0.45);
    padding: 3px 6px;
    border-radius: var(--gf-radius-sm);
}
/* The legend is too busy for the tiny compact map - show it only when expanded
   (the inline display from the toggle still wins to hide it entirely). */
.game-window[data-window-id="minimap"]:not(.gf-map-expanded) .gf-map-legend {
    display: none;
}
.gf-leg-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: var(--gf-mono);
    font-size: 9px;
    color: var(--gf-text-2);
}
.gf-leg-item i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

/* ── Transient "map not available" toast ── */
.gf-map-toast {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    background: var(--gf-panel-bg-strong);
    color: var(--gf-text-1);
    border: 1px solid var(--gf-border-accent);
    border-radius: var(--gf-radius);
    padding: 8px 14px;
    font-size: 12px;
    box-shadow: var(--gf-shadow);
    transition: opacity 0.2s;
}
.gf-map-toast.show { opacity: 1; }

#terrain-loading-indicator {
    position: fixed;
    left: 50%;
    bottom: 74px;
    z-index: 99998;
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    pointer-events: none;
    padding: 7px 13px;
    border: 1px solid rgba(102, 224, 255, 0.5);
    border-radius: var(--gf-radius-sm);
    background: rgba(14, 13, 12, 0.88);
    color: var(--gf-grid-cyan, #66e0ff);
    box-shadow: 0 0 18px rgba(102, 224, 255, 0.12);
    font: 10px/1.2 var(--gf-mono);
    letter-spacing: 0.16em;
    transition: opacity 0.16s, transform 0.16s;
}
#terrain-loading-indicator.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Expanded Split Layout & Tabs ── */
.gf-map-split-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.gf-map-shell .minimap-canvas-host {
    flex: 1;
    min-width: 0;
    position: relative;
}
.gf-map-sidebar {
    width: 320px;
    flex-shrink: 0;
    border-left: 1px solid var(--gf-border);
    background: rgba(14, 12, 10, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: width 0.2s ease, margin-right 0.2s ease;
    z-index: 10;
}
.gf-map-sidebar.collapsed {
    width: 0;
    overflow: hidden;
    border-left: none;
}
.gf-map-sidebar-header {
    padding: 8px 12px;
    background: rgba(30, 28, 24, 0.5);
    border-bottom: 1px solid var(--gf-border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.gf-map-sidebar-title {
    font-family: var(--gf-mono);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gf-gold);
}

/* Tab controls in header */
.gf-map-tabs {
    display: flex;
    gap: 4px;
    align-items: center;
}
.gf-map-tab-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--gf-border-soft);
    border-radius: var(--gf-radius-sm);
    color: var(--gf-text-2);
    font-family: var(--gf-mono);
    font-size: 10px;
    padding: 3px 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.gf-map-tab-btn:hover {
    color: var(--gf-text-1);
    border-color: var(--gf-border);
}
.gf-map-tab-btn.active {
    color: var(--gf-gold);
    border-color: var(--gf-gold);
    background: rgba(184, 154, 74, 0.12);
    text-shadow: 0 0 4px rgba(184,154,74,0.4);
}

/* Sidebar lists and filters */
.gf-map-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}
.gf-entity-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: var(--gf-radius);
    border: 1px solid rgba(255,255,255,0.03);
}
.gf-entity-search {
    width: 100%;
    background: var(--gf-panel-bg-strong);
    color: var(--gf-text-1);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
    padding: 4px 8px;
    font-size: 11px;
}
.gf-entity-search:focus {
    border-color: var(--gf-gold);
    outline: none;
}
.gf-entity-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.gf-filter-tag {
    font-size: 9px;
    font-family: var(--gf-mono);
    padding: 2px 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--gf-text-2);
    cursor: pointer;
    user-select: none;
    transition: all 0.12s;
}
.gf-filter-tag:hover {
    color: var(--gf-text-1);
    background: rgba(255,255,255,0.1);
}
.gf-filter-tag.active {
    background: rgba(184, 154, 74, 0.15);
    border-color: rgba(184, 154, 74, 0.4);
    color: var(--gf-gold);
}

.gf-entity-sort-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--gf-text-3);
    font-family: var(--gf-mono);
}
.gf-entity-sort-select {
    background: var(--gf-panel-bg-strong);
    color: var(--gf-text-2);
    border: 1px solid var(--gf-border-soft);
    border-radius: var(--gf-radius-sm);
    font-size: 10px;
    padding: 1px 4px;
    cursor: pointer;
}

/* Scroller Entity Table */
.gf-entity-table-wrap {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.gf-entity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.gf-entity-row {
    border-bottom: 1px solid rgba(255,255,255,0.02);
    cursor: pointer;
    transition: background 0.1s;
}
.gf-entity-row:hover {
    background: rgba(255, 255, 255, 0.03);
}
.gf-entity-row.selected {
    background: rgba(184, 154, 74, 0.08);
}
.gf-entity-cell {
    padding: 6px 4px;
    vertical-align: middle;
}
.gf-entity-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 4px rgba(255,255,255,0.1);
}
.gf-entity-name {
    font-weight: bold;
    color: var(--gf-text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}
.gf-entity-sub {
    font-size: 9px;
    color: var(--gf-text-3);
    font-family: var(--gf-mono);
}
.gf-entity-dist {
    font-family: var(--gf-mono);
    color: var(--gf-text-2);
    font-size: 10px;
    text-align: right;
}
.gf-entity-status {
    font-size: 9px;
    font-family: var(--gf-mono);
    text-align: right;
}
.gf-status-active { color: #55ee77; }
.gf-status-exhausted { color: #ff5555; animation: gf-pulse-exhausted 1.5s infinite; }
.gf-status-disabled { color: #888888; }
.gf-status-hp { color: #a8a8a8; }

@keyframes gf-pulse-exhausted {
    0% { opacity: 0.6; }
    50% { opacity: 1; text-shadow: 0 0 4px rgba(255,85,85,0.6); }
    100% { opacity: 0.6; }
}

/* Populator Presets Panel */
.gf-presets-panel {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: var(--gf-radius);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.gf-presets-title {
    font-family: var(--gf-mono);
    font-size: 10px;
    color: var(--gf-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 4px;
}
.gf-preset-select {
    width: 100%;
    background: var(--gf-panel-bg-strong);
    color: var(--gf-text-1);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
    padding: 4px;
    font-size: 11px;
}
.gf-preset-btnrow {
    display: flex;
    gap: 4px;
}
.gf-preset-btn {
    flex: 1;
    font-size: 10px;
    font-family: var(--gf-mono);
    padding: 4px 6px;
    cursor: pointer;
    background: var(--gf-panel-bg-strong);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
    color: var(--gf-text-2);
    transition: all 0.15s;
}
.gf-preset-btn:hover {
    color: var(--gf-text-1);
    border-color: var(--gf-gold);
}
.gf-preset-btn.active {
    background: rgba(184, 154, 74, 0.15);
    border-color: var(--gf-gold);
    color: var(--gf-gold);
    box-shadow: 0 0 5px rgba(184,154,74,0.2);
}

/* Brush controls */
.gf-brush-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: rgba(255,255,255,0.02);
    border-radius: var(--gf-radius-sm);
    font-size: 10px;
    font-family: var(--gf-mono);
}
.gf-brush-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.gf-brush-slider {
    flex: 1;
    margin-left: 8px;
    accent-color: var(--gf-gold);
}

/* Edit / Details Form Overlay */
.gf-map-editor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.gf-map-editor-card {
    background: rgba(18, 16, 14, 0.95);
    border: 1px solid var(--gf-gold);
    border-radius: var(--gf-radius);
    width: 290px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.gf-map-editor-head {
    padding: 8px 12px;
    background: rgba(184, 154, 74, 0.1);
    border-bottom: 1px solid rgba(184, 154, 74, 0.2);
    font-family: var(--gf-mono);
    font-size: 11px;
    text-transform: uppercase;
    color: var(--gf-gold);
}
.gf-map-editor-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 380px;
    overflow-y: auto;
}
.gf-map-editor-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
    color: var(--gf-text-2);
    font-family: var(--gf-mono);
}
.gf-map-editor-row label {
    font-weight: bold;
    color: var(--gf-text-3);
}
.gf-map-editor-row input[type="text"],
.gf-map-editor-row input[type="number"],
.gf-map-editor-row select {
    background: var(--gf-panel-bg-strong);
    color: var(--gf-text-1);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
    padding: 4px 6px;
    font-size: 11px;
}
.gf-map-editor-row input:focus,
.gf-map-editor-row select:focus {
    border-color: var(--gf-gold);
    outline: none;
}
.gf-map-editor-row-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: var(--gf-text-2);
    font-family: var(--gf-mono);
}
.gf-map-editor-row-inline label {
    font-weight: bold;
    color: var(--gf-text-3);
}
.gf-map-editor-row-inline input[type="checkbox"] {
    accent-color: var(--gf-gold);
    cursor: pointer;
}
.gf-map-editor-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--gf-border-soft);
    background: rgba(0,0,0,0.2);
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}
.gf-editor-btn {
    font-size: 10px;
    font-family: var(--gf-mono);
    padding: 4px 10px;
    border-radius: var(--gf-radius-sm);
    cursor: pointer;
    border: 1px solid var(--gf-border);
    background: var(--gf-panel-bg-strong);
    color: var(--gf-text-2);
    transition: all 0.12s;
}
.gf-editor-btn:hover {
    color: var(--gf-text-1);
    border-color: var(--gf-border-accent);
}
.gf-editor-btn.primary {
    border-color: var(--gf-gold);
    color: var(--gf-gold);
    background: rgba(184, 154, 74, 0.1);
}
.gf-editor-btn.danger {
    border-color: #ff4444;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.05);
}
.gf-editor-btn.danger:hover {
    background: rgba(255, 68, 68, 0.15);
}

/* Map overlay HUD banner for placement/brush mode */
.gf-map-placement-banner {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 16, 14, 0.88);
    backdrop-filter: blur(8px);
    border: 1px solid var(--gf-gold);
    border-radius: 20px;
    padding: 5px 15px;
    color: var(--gf-text-1);
    font-family: var(--gf-mono);
    font-size: 11px;
    z-index: 99;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}
.gf-banner-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.gf-banner-pulse {
    width: 6px;
    height: 6px;
    background: #ffaa00;
    border-radius: 50%;
    animation: gf-banner-pulse-anim 1.0s infinite alternate;
}
@keyframes gf-banner-pulse-anim {
    from { opacity: 0.3; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.3); box-shadow: 0 0 6px #ffaa00; }
}
.gf-banner-btn {
    background: var(--gf-panel-bg-strong);
    color: var(--gf-gold);
    border: 1px solid var(--gf-gold);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.12s;
}
.gf-banner-btn:hover {
    background: var(--gf-gold);
    color: #000;
}

/* HUD info panel */
#hud-info {
    position: fixed;
    top: 12px; left: 12px;
    font-size: 13px;
    color: #fff;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 8px 12px;
    pointer-events: all;
    line-height: 1.6;
    min-width: 140px;
    z-index: 10;
}

#hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#hud-class {
    font-weight: bold;
    font-size: 15px;
    color: #f0c060;
}

#hud-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: #888;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#hud-toggle:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

#hud-details {
    margin-top: 4px;
}

#hud-fps { color: #8b8; }
#hud-time { color: #aac; }

/* Always-visible gold readout (the realm currency). */
#hud-gold {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #f0d060;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* War/Peace stance badge (toggled with Tab). */
#hud-war-mode {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
#hud-war-mode.peace { color: #8b9a8b; }
#hud-war-mode.war {
    color: #ff5a3c;
    text-shadow: 0 0 8px rgba(255, 60, 30, 0.7), 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Chat panel */
#chat-area {
    position: fixed;
    bottom: 60px; left: 12px;
    width: 360px;
    background: rgba(0,0,0, var(--chat-opacity, 0.6));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    pointer-events: all;
    z-index: 10;
}

#chat-resize {
    position: absolute;
    bottom: -3px; right: -3px;
    width: 14px; height: 14px;
    cursor: se-resize;
    z-index: 2;
}
#chat-resize::after {
    content: '';
    position: absolute;
    bottom: 3px; right: 3px;
    width: 6px; height: 6px;
    border-right: 2px solid rgba(255,255,255,0.25);
    border-bottom: 2px solid rgba(255,255,255,0.25);
}

#chat-log {
    /* Real height (not max-height) so the panel holds whatever size the
       player gave it even when the log is empty - resizing works regardless
       of how much text is in it. */
    height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 6px 8px;
}
/* Pin sparse content to the bottom of the fixed-height log (chat reads up). */
#chat-log > :first-child { margin-top: auto; }

.chat-line {
    font-size: 13px;
    padding: 2px 0;
    word-break: break-word;
    line-height: 1.4;
}

.chat-line .chat-name {
    font-weight: 600;
    color: #7ad;
}

.chat-line.chat-system,
.chat-line[data-category="system"] {
    color: #8fd28f;
    font-style: italic;
    font-size: 12px;
}

.chat-line[data-category="player"] { color: #e0e0e0; }
.chat-line[data-category="skill"]  { color: #7dd3fc; font-size: 12px; }
.chat-line[data-category="stat"]   { color: #a5f3a3; font-size: 12px; }

/* Global channel (A5) - server-wide, a distinct amethyst so it reads apart
   from local say. The [Global] prefix comes from the channel tag, not the DOM. */
.chat-line[data-category="global"] { color: #c9a3ff; }
.chat-line[data-category="global"] .chat-name { color: #b98cff; }

/* Channel tab row (A5) */
.chat-tabs {
    display: flex;
    gap: 2px;
    padding: 3px 4px 0 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.chat-tab {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    color: var(--gf-text-2, #9aa3b5);
    font-size: 11px;
    padding: 2px 9px;
    cursor: pointer;
    line-height: 1.5;
}
.chat-tab:hover { color: var(--gf-text-1, #e0e0e0); background: rgba(255,255,255,0.05); }
.chat-tab.active {
    color: var(--gf-accent-hot, #E2622A);
    background: rgba(226,98,42,0.12);
    border-color: rgba(226,98,42,0.35);
}
/* "+" new-tab button - slimmer, quieter than a real tab. */
.chat-tab-add {
    padding: 2px 7px;
    font-weight: 700;
    color: var(--gf-text-2, #9aa3b5);
    opacity: 0.7;
}
.chat-tab-add:hover { opacity: 1; }

/* Custom-tab editor popup (A5) - a small floating panel over the chat. */
.chat-tab-editor {
    position: fixed;
    z-index: 320;
    min-width: 168px;
    background: var(--gf-panel-bg, rgba(14,13,12,0.96));
    -webkit-backdrop-filter: blur(var(--gf-blur, 6px));
    backdrop-filter: blur(var(--gf-blur, 6px));
    border: 1px solid var(--gf-border-accent, rgba(226,98,42,0.4));
    border-radius: 6px;
    box-shadow: var(--gf-shadow, 0 8px 24px rgba(0,0,0,0.5));
    padding: 8px;
    pointer-events: all;
    font-size: 12px;
}
.chat-tab-editor-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gf-text-2, #9aa3b5);
    margin-bottom: 6px;
}
.chat-tab-editor-name {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    padding: 4px 7px;
    font-size: 12px;
    border-radius: 4px;
    outline: none;
    margin-bottom: 6px;
}
.chat-tab-editor-chan {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gf-text-1, #e0e0e0);
    padding: 2px 0;
    cursor: pointer;
}
.chat-tab-editor-chan input { cursor: pointer; }
.chat-tab-editor-btns {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.chat-tab-editor-save,
.chat-tab-editor-cancel {
    flex: 1;
    appearance: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid transparent;
}
.chat-tab-editor-save {
    background: rgba(226,98,42,0.18);
    border-color: rgba(226,98,42,0.45);
    color: var(--gf-accent-hot, #E2622A);
}
.chat-tab-editor-save:hover { background: rgba(226,98,42,0.28); }
.chat-tab-editor-cancel {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.14);
    color: var(--gf-text-2, #9aa3b5);
}
.chat-tab-editor-cancel:hover { color: var(--gf-text-1, #e0e0e0); }

/* Torn-off chat window (A5) - lives in a GameWindow, so it inherits the gold
   frame; the body is a filtered chat log over a compact send input. */
.chat-tearoff {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.chat-tearoff-log {
    /* #chat-log styling is id-scoped, so restate the log layout here (fill the
       window body, scroll, bottom-pin sparse content). */
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 6px 8px;
    background: rgba(0,0,0,0.28);
}
.chat-tearoff-log > :first-child { margin-top: auto; }
.chat-tearoff-input { padding: 5px 6px 2px; }
.chat-tearoff-input input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 4px;
    outline: none;
}

/* Staff-only channel (/s) - distinct gold so staff can pick it out at a glance. */
.chat-line.chat-staff,
.chat-line[data-category="staff"] { color: #ffd479; }
.chat-line.chat-staff .chat-name { color: #ffb938; }

#chat-box {
    display: none;
    padding: 4px 8px 6px;
    pointer-events: all;
}

#chat-input {
    width: 100%;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    outline: none;
}

/* Context menu */
.ctx-menu {
    position: fixed;
    z-index: 300;
    background: rgba(20,20,30,0.95);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 4px 0;
    min-width: 180px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.ctx-item {
    padding: 8px 14px;
    font-size: 13px;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ctx-item:hover { background: rgba(255,255,255,0.08); color: #fff; }

.ctx-label { flex: 1; }

.ctx-slider {
    width: 80px;
    accent-color: #f0c060;
    cursor: pointer;
}

.ctx-val {
    font-family: 'Consolas', monospace;
    font-size: 11px;
    color: #888;
    min-width: 28px;
    text-align: right;
}

.ctx-sep {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 4px 8px;
}

/* Character select overlay */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: all;
}

#overlay-inner {
    width: 520px;
    text-align: center;
    pointer-events: all;
}

#overlay input {
    user-select: text;
    pointer-events: all;
}

#overlay button {
    pointer-events: all;
    cursor: pointer;
}

#overlay h1 {
    font-size: 42px;
    letter-spacing: 4px;
    color: #f0c060;
    text-shadow: 0 0 20px rgba(240,192,96,0.5);
    margin-bottom: 6px;
}

#overlay .subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 32px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#input-name,
#input-password {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px;
    border-radius: 6px;
    outline: none;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 1px;
}
#input-password {
    /* Match the visual height/font of the username field */
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 4px;
}
#input-name:focus,
#input-password:focus {
    border-color: rgba(240,192,96,0.5);
    box-shadow: 0 0 8px rgba(240,192,96,0.15);
}

#auth-buttons {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.auth-btn {
    flex: 1;
    display: block;
    padding: 14px 16px;
    background: #f0c060;
    color: #1a1000;
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #f0c060;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.15s;
    text-align: center;
    pointer-events: all;
    text-decoration: none;
}
.auth-btn:hover {
    background: #ffd070;
    border-color: #ffd070;
}

.auth-btn.auth-btn-secondary {
    background: rgba(255,255,255,0.06);
    color: #ccc;
    border: 2px solid rgba(255,255,255,0.2);
}
.auth-btn.auth-btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.35);
    color: #fff;
}

.auth-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

#char-select-links {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
}
.overlay-link {
    color: #888;
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.15s;
}
.overlay-link:hover {
    color: #f0c060;
}
.overlay-link-sep {
    color: #555;
}

#race-select {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.race-btn {
    flex: 1;
    padding: 16px 8px;
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: #ccc;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    min-height: 90px;
}

.race-btn:hover {
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.1);
}

.race-btn.selected {
    border-color: #f0c060;
    background: rgba(240,192,96,0.12);
    color: #fff;
}

.race-btn .race-name {
    font-size: 16px;
    font-weight: bold;
    display: block;
    margin-bottom: 4px;
    color: #f0c060;
}

.race-btn .race-stats {
    display: block;
    margin-top: 6px;
    color: #888;
    font-size: 11px;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Lore-color hints (optional, admin-changeable in future) */
.race-btn[data-race="hollowed"] .race-name { color: #8870e0; }
.race-btn[data-race="deepkin"] .race-name { color: #40a060; }
.race-btn[data-race="veilborn"] .race-name { color: #f0c060; }

.race-detail {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 12px;
    line-height: 1.55;
    color: #bbb;
    text-align: left;
    min-height: 60px;
}

.race-detail .race-detail-title {
    color: #f0c060;
    font-weight: bold;
    margin-bottom: 4px;
    display: block;
}

.race-detail .race-detail-perks {
    margin-top: 6px;
    color: #80c0c0;
    font-size: 11px;
}

/* (btn-start removed - replaced by auth buttons) */

/* Character select / create */
#input-char-name {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px;
    border-radius: 6px;
    outline: none;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 1px;
}
#input-char-name:focus {
    border-color: rgba(240,192,96,0.5);
    box-shadow: 0 0 8px rgba(240,192,96,0.15);
}

#char-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}

.char-slot {
    padding: 16px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    color: #ccc;
}
.char-slot:hover {
    border-color: rgba(240,192,96,0.5);
    background: rgba(240,192,96,0.08);
}
.char-slot.empty {
    border-style: dashed;
    color: #888;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    font-size: 14px;
    letter-spacing: 1px;
}

.char-slot .char-name {
    font-size: 18px;
    font-weight: bold;
    color: #f0c060;
    display: block;
    margin-bottom: 4px;
}
.char-slot .char-class {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    color: #888;
    display: block;
    margin-bottom: 8px;
}
.char-slot .char-stats {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 8px;
}

.char-slot[data-race="veilborn"] .char-name { color: #f0c060; }
.char-slot[data-race="hollowed"] .char-name { color: #8870e0; }
.char-slot[data-race="deepkin"] .char-name { color: #40a060; }

.char-slot-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.char-slot-btn {
    flex: 1;
    padding: 6px 10px;
    background: rgba(240,192,96,0.18);
    color: #f0c060;
    border: 1px solid rgba(240,192,96,0.4);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.char-slot-btn:hover { background: rgba(240,192,96,0.3); }
.char-slot-btn.danger {
    background: rgba(218,54,51,0.15);
    color: #f85149;
    border-color: rgba(218,54,51,0.4);
}
.char-slot-btn.danger:hover { background: rgba(218,54,51,0.3); }

/* Escape menu */
#escape-menu {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.esc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
}

.esc-container {
    position: relative;
    z-index: 1;
    width: 380px;
    transition: width 0.2s ease;
}
.esc-container:has(.esc-panel-settings[style*="flex"]) {
    width: 540px;
}

.esc-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(20,20,30,0.95);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 32px 28px;
}

.esc-panel h2 {
    font-size: 22px;
    letter-spacing: 3px;
    color: #f0c060;
    text-align: center;
    margin-bottom: 12px;
}

.esc-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #ddd;
    font-size: 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 1px;
}
.esc-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

.esc-btn-danger { color: #f85149; border-color: rgba(248,81,73,0.3); }
.esc-btn-danger:hover { background: rgba(248,81,73,0.15); }

.esc-btn-secondary { color: #8b949e; font-size: 13px; padding: 8px; margin-top: 8px; }

/* Settings tabs */
.esc-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.esc-tab {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: #8b949e;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
}
.esc-tab.active { background: rgba(240,192,96,0.15); color: #f0c060; border-color: rgba(240,192,96,0.3); }

/* Settings panel - futuristic scanline overlay */
.esc-panel-settings {
    position: relative;
    max-width: 540px;
}
.esc-panel-settings::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg, transparent, transparent 2px,
        rgba(240,192,96,0.03) 2px, rgba(240,192,96,0.03) 4px
    );
    pointer-events: none;
    border-radius: 12px;
}

.esc-btn-small {
    padding: 8px 16px;
    font-size: 12px;
    width: auto;
}

/* Keybind search */
.keybind-search-wrap {
    position: relative;
    margin-bottom: 10px;
}
.keybind-search-wrap::before {
    content: '\2315';
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
    pointer-events: none;
}
.keybind-search {
    width: 100%;
    padding: 8px 12px 8px 30px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 13px;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}
.keybind-search:focus {
    border-color: rgba(240,192,96,0.5);
    box-shadow: 0 0 8px rgba(240,192,96,0.15);
}

/* Keybind list */
.keybinds-list {
    max-height: 380px;
    overflow-y: auto;
}

/* ── Unified Options window (Keybinds | Macros | Abilities | Help) ──
   Lives inside a resizable GameWindow, so panes flex to fill rather than
   capping at a fixed height like the old escape-modal layout did. */
.gf-options-menu {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--gf-text-1);
    font-size: 13px;
}
.gf-options-body { flex: 1; min-height: 0; display: flex; }
.gf-options-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
}
.gf-options-pane.macro-pane { padding: 0; }
.gf-options-pane.macro-pane > .gf-macro-editor { flex: 1; min-height: 0; }
.gf-options-menu .keybinds-list { max-height: none; flex: 1; min-height: 0; }
.gf-options-menu .help-list { flex: 1; min-height: 0; overflow-y: auto; }
.gf-options-menu .keybind-footer { align-items: center; gap: 8px; }
.gf-options-menu .gf-reset-confirm-msg {
    margin-right: auto;
    color: var(--gf-text-2);
    font-size: 12px;
}

/* ── Game Options pane ── */
.gf-options-pane.game-options-pane { overflow-y: auto; }
.gf-go-intro { color: var(--gf-text-3); font-size: 12px; line-height: 1.4; margin-bottom: 6px; }
.gf-go-group {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--gf-accent); margin: 14px 0 2px; padding-bottom: 4px;
    border-bottom: 1px solid var(--gf-border-soft);
}
.gf-go-row {
    display: flex; align-items: center; gap: 12px;
    padding: 7px 4px; cursor: pointer; border-radius: var(--gf-radius-sm);
}
.gf-go-row:hover { background: rgba(255,255,255,0.04); }
.gf-go-label { flex: 1; font-size: 13px; color: var(--gf-text-1); }
.gf-go-select { flex: 0 0 130px; }
.gf-go-check { width: 16px; height: 16px; accent-color: var(--gf-accent); cursor: pointer; }
.gf-go-color { flex: 0 0 42px; width: 42px; height: 24px; padding: 0; border: 1px solid var(--gf-border); border-radius: var(--gf-radius-sm); background: none; cursor: pointer; }

/* Sound options pane (reuses the gf-go-* row/label/group look) */
.gf-options-pane.sound-options-pane { overflow-y: auto; }
.gf-so-slider { flex: 0 0 180px; display: flex; align-items: center; gap: 10px; }
.gf-so-slider input[type="range"] {
    flex: 1; height: 4px; cursor: pointer; accent-color: var(--gf-accent);
    background: transparent;
}
.gf-so-val {
    flex: 0 0 38px; text-align: right; font-size: 12px;
    font-variant-numeric: tabular-nums; color: var(--gf-text-3);
}
.gf-so-np { flex: 1; font-size: 13px; color: var(--gf-accent); font-style: italic; }

.keybind-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Category headers */
.keybind-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px 6px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid rgba(240,192,96,0.15);
    margin-top: 4px;
}
.keybind-cat-arrow {
    color: #666;
    font-size: 12px;
    font-family: 'Consolas', monospace;
    width: 12px;
}
.keybind-cat-label {
    color: #f0c060;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    flex: 1;
}
.keybind-cat-count {
    color: #555;
    font-size: 11px;
    font-family: 'Consolas', monospace;
}
.keybind-category-header:hover .keybind-cat-label { color: #ffd070; }

/* Keybind rows */
.keybind-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 4px 7px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    border-left: 3px solid transparent;
    transition: opacity 0.2s, max-height 0.3s, padding 0.2s, border-color 0.2s;
    max-height: 50px;
    overflow: hidden;
}
.keybind-row:hover { background: rgba(255,255,255,0.03); }
.keybind-row.keybind-filtered {
    opacity: 0;
    max-height: 0;
    padding: 0 4px 0 20px;
    border-bottom: none;
}
.keybind-row.keybind-conflict {
    border-left-color: #f85149;
    animation: conflictPulse 2s ease infinite;
}
.keybind-row.keybind-locked { opacity: 0.5; }

.keybind-category-header.keybind-filtered {
    display: none;
}

/* Help tab (Settings → Help) */
.help-search-wrap {
    position: relative;
    margin-bottom: 10px;
}
.help-search-wrap::before {
    content: '\2315';
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
    pointer-events: none;
}
.help-search {
    width: 100%;
    padding: 8px 12px 8px 30px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 13px;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}
.help-search:focus {
    border-color: rgba(240,192,96,0.5);
    box-shadow: 0 0 8px rgba(240,192,96,0.15);
}
.help-list {
    max-height: 380px;
    overflow-y: auto;
}
.help-blurb {
    color: #ccc;
    font-size: 12px;
    line-height: 1.55;
    padding: 0 4px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 8px;
}
.help-blurb p { margin: 0 0 6px; }
.help-blurb p:last-child { margin-bottom: 0; }
.help-blurb kbd {
    display: inline-block;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(240,192,96,0.3);
    color: #f0c060;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-family: 'Consolas', monospace;
    vertical-align: baseline;
}
.help-section {
    margin-bottom: 10px;
}
.help-section.help-filtered {
    display: none;
}
.help-section-title {
    color: #f0c060;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 8px 0 4px;
    padding: 6px 4px 4px;
    border-bottom: 1px solid rgba(240,192,96,0.15);
}
.help-rows {
    display: flex;
    flex-direction: column;
}
.help-row {
    display: grid;
    grid-template-columns: 150px 120px 1fr;
    gap: 10px;
    padding: 6px 4px 6px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    align-items: baseline;
    transition: opacity 0.2s, max-height 0.3s, padding 0.2s;
    max-height: 60px;
    overflow: hidden;
}
.help-row:hover { background: rgba(255,255,255,0.03); }
.help-row.help-filtered {
    opacity: 0;
    max-height: 0;
    padding: 0 4px 0 20px;
    border-bottom: none;
}
.help-row-label {
    color: #e0e0e0;
    font-size: 12px;
}
.help-row-bind {
    color: #7dd3fc;
    font-size: 11px;
    font-family: 'Consolas', monospace;
}
.help-row-desc {
    color: #999;
    font-size: 11px;
    line-height: 1.4;
}

/* Quick Help overlay (reuses .help-blurb / .help-row* above) */
.quick-help-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 10px 12px 12px;
    background: var(--gf-panel-bg-strong);
}
.help-row-bind.qh-unbound {
    color: var(--gf-text-3);
    opacity: 0.7;
    font-style: italic;
}

/* Floating "?" quick-help button */
#gf-help-btn {
    position: fixed;
    right: 14px;
    bottom: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gf-panel-bg);
    border: 1px solid var(--gf-border-accent);
    color: var(--gf-accent);
    font-family: var(--gf-mono);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    z-index: 50;
    backdrop-filter: blur(var(--gf-blur));
    box-shadow: var(--gf-shadow);
    transition: transform 0.12s, box-shadow 0.12s, color 0.12s;
}
#gf-help-btn:hover {
    color: var(--gf-accent-hot);
    transform: scale(1.12);
    box-shadow: var(--gf-shadow), 0 0 10px var(--gf-accent-glow);
}

/* Staff bug/idea submission button - sits just left of the "?" button */
#gf-submit-btn {
    position: fixed;
    right: 50px;
    bottom: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gf-panel-bg);
    border: 1px solid var(--gf-border-accent);
    color: var(--gf-accent);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    z-index: 50;
    backdrop-filter: blur(var(--gf-blur));
    box-shadow: var(--gf-shadow);
    transition: transform 0.12s, box-shadow 0.12s;
}
#gf-submit-btn:hover {
    transform: scale(1.12);
    box-shadow: var(--gf-shadow), 0 0 10px var(--gf-accent-glow);
}

/* Report / Vote panel (in-game submissions) */
.ss-panel {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: var(--gf-text, #d8cbb6);
    height: 100%;
}
.ss-hidden { display: none !important; }
.ss-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--gf-border, rgba(184,154,74,0.25)); }
.ss-tab {
    flex: 1; padding: 8px 6px; background: transparent; border: none;
    color: var(--gf-dim, #9a8f7d); cursor: pointer; font: inherit; font-size: 12px;
    border-bottom: 2px solid transparent;
}
.ss-tab-active { color: var(--gf-accent, #e2622a); border-bottom-color: var(--gf-accent, #e2622a); }
.ss-tabpage { padding: 12px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.ss-typecards { display: flex; gap: 8px; }
.ss-typecard {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 4px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 12px;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.12); color: inherit;
}
.ss-typecard span { font-size: 20px; }
.ss-typecard-active { border-color: var(--gf-accent, #e2622a); background: rgba(226,98,42,0.15); }
.ss-row { display: flex; flex-direction: column; gap: 4px; }
.ss-row > label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--gf-dim, #9a8f7d); }
.ss-panel select, .ss-panel input[type="text"], .ss-panel textarea {
    background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.15); border-radius: 4px;
    color: inherit; padding: 7px 8px; font: inherit; width: 100%; box-sizing: border-box;
}
.ss-panel textarea { resize: vertical; min-height: 44px; }
.ss-inline { flex-direction: row; gap: 12px; }
.ss-inline > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ss-step { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.ss-step-n { color: var(--gf-dim, #9a8f7d); font-size: 12px; min-width: 16px; }
.ss-step input { flex: 1; }
.ss-step-x, .ss-add-step {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.15); border-radius: 4px;
    color: var(--gf-dim, #9a8f7d); cursor: pointer; font: inherit; padding: 4px 8px;
}
.ss-add-step { align-self: flex-start; font-size: 12px; }
.ss-sev { width: 100%; }
.ss-shot-head { display: flex; align-items: center; justify-content: space-between; }
.ss-recapture {
    background: rgba(0,0,0,0.3); border: 1px solid var(--gf-border-accent, rgba(226,98,42,0.4));
    border-radius: 4px; color: inherit; cursor: pointer; font: inherit; font-size: 11px; padding: 4px 8px;
}
.ss-shots { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-shot { position: relative; }
.ss-shot-canvas { max-width: 160px; border: 1px solid rgba(255,255,255,0.15); border-radius: 4px; cursor: crosshair; touch-action: none; }
.ss-shot-del {
    position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
    background: rgba(0,0,0,0.7); border: none; color: #fff; cursor: pointer; font-size: 11px; line-height: 1;
}
.ss-markhint { font-size: 11px; color: var(--gf-dim, #9a8f7d); }
.ss-diag { font-size: 12px; }
.ss-diag summary { cursor: pointer; color: var(--gf-dim, #9a8f7d); }
.ss-diag-body { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 8px 0; }
.ss-diag-row { display: contents; }
.ss-diag-row span:first-child { color: var(--gf-dim, #9a8f7d); }
.ss-diag-row span:last-child { color: var(--gf-text, #d8cbb6); word-break: break-word; }
.ss-diag-note { font-size: 11px; color: var(--gf-dim, #9a8f7d); opacity: 0.85; }
.ss-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.ss-actions button {
    padding: 7px 16px; border-radius: 4px; border: 1px solid var(--gf-border-accent, rgba(226,98,42,0.4));
    background: rgba(0,0,0,0.3); color: inherit; cursor: pointer; font: inherit;
}
.ss-submit { background: var(--gf-accent, #e2622a); color: #140b05; font-weight: 600; border-color: transparent; }
.ss-actions button:hover { filter: brightness(1.12); }
.ss-status { font-size: 12px; color: var(--gf-accent, #e2622a); min-height: 14px; }
.ss-empty { color: var(--gf-dim, #9a8f7d); text-align: center; padding: 24px 8px; font-size: 12px; }
/* My Reports + Vote lists */
.ss-mine, .ss-vote {
    display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 6px;
    background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.08); margin-bottom: 6px;
}
.ss-mine { cursor: pointer; }
.ss-mine:hover { border-color: var(--gf-border-accent, rgba(226,98,42,0.4)); }
.ss-mine-title, .ss-vote-title { flex: 1; font-size: 12px; }
.ss-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gf-accent, #e2622a); }
.ss-badge {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; padding: 2px 7px;
    border-radius: 999px; border: 1px solid rgba(184,154,74,0.4); color: var(--gf-ash-gold, #b89a4a); white-space: nowrap;
}
.ss-badge-done, .ss-badge-shipped { color: #7fd18a; border-color: rgba(127,209,138,0.4); }
.ss-badge-in_progress, .ss-badge-planned { color: var(--gf-accent, #e2622a); border-color: rgba(226,98,42,0.45); }
.ss-badge-wontfix, .ss-badge-duplicate { color: #9a8f7d; }
.ss-vote-btn {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.15); border-radius: 4px;
    color: inherit; cursor: pointer; font: inherit; font-size: 12px; padding: 4px 8px; white-space: nowrap;
}
.ss-vote-btn.ss-voted { background: var(--gf-accent, #e2622a); color: #140b05; border-color: transparent; }

/* Chat config tab (Settings → Chat) */
.chat-config-list {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}
.chat-config-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.chat-config-row:hover { background: rgba(255,255,255,0.03); }
.chat-config-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ccc;
    font-size: 13px;
}
.chat-config-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #f0c060;
    cursor: pointer;
}
.chat-config-row input[type="color"] {
    width: 32px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    cursor: pointer;
}
.chat-config-size {
    width: 44px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.15);
    color: #ddd;
    padding: 2px 4px;
    font-size: 12px;
    text-align: right;
    font-family: 'Consolas', monospace;
}
.chat-config-size-suffix {
    color: #666;
    font-size: 11px;
}

@keyframes conflictPulse {
    0%, 100% { border-left-color: #f85149; }
    50% { border-left-color: rgba(248,81,73,0.3); }
}

.keybind-label {
    font-size: 13px;
    color: #ccc;
    flex: 1;
}
.keybind-note {
    display: block;
    font-size: 10px;
    color: #666;
    font-style: italic;
}

.keybind-key-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.keybind-warn {
    color: #f85149;
    font-size: 12px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(248,81,73,0.4);
    border-radius: 3px;
    cursor: help;
}
.keybind-warn-browser {
    color: #d29922;
    border-color: rgba(210,153,34,0.4);
}

.keybind-key {
    min-width: 90px;
    padding: 6px 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.15);
    color: #f0c060;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    white-space: nowrap;
}
.keybind-key:hover {
    border-color: #f0c060;
    box-shadow: 0 0 8px rgba(240,192,96,0.3);
}
.keybind-key-locked {
    cursor: default;
    opacity: 0.6;
}
.keybind-key-locked:hover {
    border-color: rgba(255,255,255,0.15);
    box-shadow: none;
}
.keybind-key.rebinding {
    background: rgba(240,192,96,0.15);
    border-color: #f0c060;
    color: #fff;
    animation: scanPulse 1.5s ease infinite;
}

@keyframes scanPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(240,192,96,0.2); }
    50% { box-shadow: 0 0 16px rgba(240,192,96,0.5); }
}

/* ═══════════════════════════════════════════
   Stat bars
   ═══════════════════════════════════════════ */

#stat-bars {
    position: fixed;
    bottom: 12px; left: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
    pointer-events: none;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 16px;
}

.stat-bar-label {
    font-size: 10px;
    font-weight: 600;
    font-family: 'Consolas', monospace;
    color: #999;
    width: 28px;
    text-align: right;
    letter-spacing: 1px;
}

.stat-bar-track {
    width: 180px;
    height: 10px;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--gf-border-accent);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.45);
    border-radius: 3px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.stat-bar[data-stat="hp"] .stat-bar-fill { background: linear-gradient(90deg, #a03030, #c04040); }
.stat-bar[data-stat="stamina"] .stat-bar-fill { background: linear-gradient(90deg, #907020, #c0a040); }
.stat-bar[data-stat="mana"] .stat-bar-fill { background: linear-gradient(90deg, #304080, #4060c0); }

.stat-bar-value {
    font-size: 10px;
    font-family: 'Consolas', monospace;
    color: #888;
    min-width: 50px;
}

.stat-bar.stat-bar-low .stat-bar-fill {
    animation: lowHpPulse 1s ease infinite;
}

@keyframes lowHpPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── MobileStatBar (draggable per-mobile stat window) ── */
/* Stat-bar windows are always small; override the generic 100px min-height
 * so content doesn't trigger scrollbars when a bar shows HP only. */
.game-window[data-window-id^="statbar:"] {
    min-height: 0;
    min-width: 0;
}
.game-window[data-window-id^="statbar:"] .game-window-content {
    overflow: visible;
}
.stat-bar-panel {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}
.stat-bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 14px;
}
.stat-bar-row .stat-bar-label {
    width: 24px;
}
.stat-bar-row .stat-bar-track {
    flex: 1 1 auto;
    width: auto;
    height: 10px;
}
.stat-bar-row .stat-bar-fill {
    width: 0%;
    height: 100%;
    background: #cc3a3a;
    transition: width 0.2s ease;
}
.stat-bar-val {
    font-size: 10px;
    font-family: 'Consolas', monospace;
    color: #bbb;
    min-width: 56px;
    text-align: right;
}

/* ── UO-style expanded status panel (self bar) ── */
.stat-bar-detail {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(184, 154, 74, 0.35);
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-family: 'Consolas', monospace;
    font-size: 10.5px;
}
.stat-bar-detail .sbd-sec {
    color: #b89a4a;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 9px;
    margin: 5px 0 1px;
    opacity: 0.85;
}
.stat-bar-detail .sbd-sec:first-child { margin-top: 0; }
.stat-bar-detail .sbd-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
    line-height: 15px;
}
.stat-bar-detail .sbd-label { color: #9a927f; }
.stat-bar-detail .sbd-val { color: #e6dcc4; font-weight: 600; white-space: nowrap; }

/* Discreet expand/collapse toggle in the self bar's titlebar. */
.stat-bar-expand {
    background: transparent;
    border: none;
    color: rgba(216, 203, 182, 0.65);
    font-size: 11px;
    line-height: 1;
    padding: 0 5px;
    cursor: pointer;
}
.stat-bar-expand:hover { color: #e2a24a; }

/* ── Companion (pet) bars - compact rows under the self bar ── */
.companion-bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(255,255,255,0.12);
}
.companion-bars:empty { display: none; }
.companion-pet {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 1px 3px;
    border-radius: 3px;
    cursor: pointer;
}
.companion-pet:hover { background: rgba(255,255,255,0.07); }
.companion-pet.companion-hidden { opacity: 0.4; }
.companion-name {
    font-size: 10px;
    font-weight: 600;
    font-family: 'Consolas', monospace;
    color: #9fd0a0;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 172px;
}
.companion-row {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 9px;
}
.companion-row .companion-label {
    font-size: 8px;
    width: 18px;
    text-align: right;
    color: #888;
    font-family: 'Consolas', monospace;
}
.companion-row .companion-track {
    flex: 1 1 auto;
    height: 7px;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--gf-border-accent, rgba(255,255,255,0.15));
    border-radius: 2px;
    overflow: hidden;
}
.companion-row .companion-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.2s ease;
}
.companion-row .companion-val {
    font-size: 8px;
    min-width: 44px;
    text-align: right;
    color: #aaa;
    font-family: 'Consolas', monospace;
}

/* Targeting cursor prompt */
#targeting-prompt.targeting-mobile {
    border: 1px solid #60c080;
    color: #c0f0c0;
}
body.targeting-active {
    cursor: crosshair;
}

/* UO-style: a targeting cursor can resolve on UI surfaces, not just the 3D
   world. A mobile cursor → click a health/stat bar; an item cursor → click an
   occupied hotbar/pack slot. Light those surfaces up so the player sees them
   as clickable targets. */
body.gf-targeting-mobile .game-window[data-window-id^="statbar:"],
body.gf-targeting-mobile .game-window[data-window-id^="statbar:"] .game-window-titlebar {
    cursor: crosshair;
}
body.gf-targeting-mobile .game-window[data-window-id^="statbar:"] {
    outline: 1px solid rgba(96, 192, 128, 0.6);
    outline-offset: 1px;
}
body.gf-targeting-mobile .game-window[data-window-id^="statbar:"]:hover {
    outline-color: #66ff88;
    box-shadow: 0 0 9px rgba(102, 255, 136, 0.5);
}
body.gf-targeting-item .gf-bar-builder .gf-slot:not(.gf-slot-empty),
body.gf-targeting-item .gf-slot-itemref {
    cursor: crosshair;
}
body.gf-targeting-item .gf-bar-builder .gf-slot:not(.gf-slot-empty):hover,
body.gf-targeting-item .gf-slot-itemref:hover {
    outline: 1px solid #66ff88;
    box-shadow: 0 0 9px rgba(102, 255, 136, 0.5);
}

/* ═══════════════════════════════════════════
   Hotbar
   ═══════════════════════════════════════════ */

#hotbar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    z-index: 5;
    pointer-events: none;
}
.hotbar-slot {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 3px;
    position: relative;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    pointer-events: auto;
}
.hotbar-slot.hotbar-slot-active {
    border-color: #f0c060;
    background: rgba(240,192,96,0.15);
    box-shadow: 0 0 8px rgba(240,192,96,0.4);
}
.hotbar-slot-key {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 10px;
    font-family: 'Consolas', monospace;
    color: #888;
    pointer-events: none;
}
.hotbar-slot-active .hotbar-slot-key {
    color: #f0c060;
}

/* ═══════════════════════════════════════════
   Character sheet
   ═══════════════════════════════════════════ */

/* The old standalone #character-sheet panel (and its .cs-header/.cs-title/
   .cs-close chrome) is retired - its content lives in the paperdoll + the
   Skills/Titles windows now. The cs-* stat/skill/section visual classes below
   live on, reused by those panels. .cs-body is just an inner padding wrapper:
   it must NOT scroll - the GameWindow content area is the single scroll region
   (the nested-overflow double scrollbar was the bug this revamp fixes). */
.cs-body {
    padding: 14px 18px;
}

/* Stats section */
.cs-section-header {
    font-size: 11px;
    font-weight: 600;
    color: #f0c060;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 8px 0 6px;
    border-bottom: 1px solid rgba(240,192,96,0.1);
    margin-bottom: 8px;
    cursor: pointer;
}
.cs-section-header:hover { color: #ffd070; }

.cs-stat-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    gap: 10px;
}
.cs-stat-name {
    font-size: 13px;
    font-weight: 600;
    color: #ccc;
    width: 40px;
}
.cs-stat-value {
    font-size: 14px;
    font-family: 'Consolas', monospace;
    color: #fff;
    width: 36px;
    text-align: right;
}
.cs-stat-toggle {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    color: #888;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.cs-stat-toggle:hover { border-color: rgba(255,255,255,0.4); }
.cs-stat-toggle[data-toggle="up"] { color: #4caf50; border-color: rgba(76,175,80,0.4); }
.cs-stat-toggle[data-toggle="down"] { color: #f85149; border-color: rgba(248,81,73,0.4); }
.cs-stat-toggle[data-toggle="locked"] { color: #888; border-color: rgba(255,255,255,0.15); }

.cs-cap-display {
    font-size: 11px;
    color: #666;
    font-family: 'Consolas', monospace;
    text-align: right;
    padding: 4px 0 12px;
}

/* Skills section */
.cs-skill-row {
    display: flex;
    align-items: center;
    padding: 4px 0;
    gap: 8px;
}
.cs-skill-name {
    font-size: 12px;
    color: #bbb;
    width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cs-skill-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.cs-skill-bar-fill {
    height: 100%;
    background: #f0c060;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.cs-skill-value {
    font-size: 11px;
    font-family: 'Consolas', monospace;
    color: #999;
    width: 40px;
    text-align: right;
}
.cs-skill-toggle {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.04);
    color: #888;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.cs-skill-toggle[data-toggle="up"] { color: #4caf50; border-color: rgba(76,175,80,0.3); }
.cs-skill-toggle[data-toggle="down"] { color: #f85149; border-color: rgba(248,81,73,0.3); }
.cs-skill-toggle[data-toggle="locked"] { color: #666; }

/* ═══════════════════════════════════════════
   Ghost overlay (shown while is_ghost = true)
   ═══════════════════════════════════════════ */

#ghost-overlay {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 180;
}
#ghost-overlay.active {
    opacity: 1;
}

.ghost-card {
    min-width: 340px;
    max-width: 420px;
    padding: 20px 28px;
    background: rgba(10, 14, 22, 0.85);
    border: 1px solid rgba(160, 200, 255, 0.35);
    border-radius: 8px;
    box-shadow: 0 0 36px rgba(80, 140, 220, 0.25);
    color: #cfd8e4;
    text-align: center;
    backdrop-filter: blur(4px);
    font-family: sans-serif;
}

.ghost-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #a9c7ff;
    text-shadow: 0 0 12px rgba(120, 170, 240, 0.6);
    margin-bottom: 14px;
}

.ghost-body {
    font-size: 13px;
    line-height: 1.6;
    color: #9aa6b8;
}

.ghost-controls {
    margin: 14px 0 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    text-align: left;
    display: inline-block;
}

.ghost-controls-title {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #6f7c91;
    margin-bottom: 6px;
}

.ghost-key {
    display: inline-block;
    min-width: 46px;
    padding: 1px 6px;
    margin-right: 8px;
    background: rgba(160, 200, 255, 0.1);
    border: 1px solid rgba(160, 200, 255, 0.3);
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
    text-align: center;
    color: #cfd8e4;
}

.ghost-footnote {
    margin-top: 10px;
    font-size: 12px;
    color: #6f7c91;
    font-style: italic;
}

.ghost-cmd {
    font-family: monospace;
    color: #a9c7ff;
    background: rgba(160, 200, 255, 0.1);
    padding: 1px 6px;
    border-radius: 3px;
}

/* Desaturate the world while the local player is ghosted. Applied to the
   canvas only so the overlay and HUD keep their colors. */
body.is-ghost canvas {
    filter: saturate(0.45) brightness(0.85);
    transition: filter 0.4s;
}

/* ═══════════════════════════════════════════
   Inventory panel
   ═══════════════════════════════════════════ */

#inventory-panel {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 560px;
    max-height: 85vh;
    background: rgba(16,16,24,0.96);
    border: 1px solid rgba(240,192,96,0.2);
    border-radius: 12px;
    z-index: 160;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
#inventory-panel.open {
    opacity: 1;
    pointer-events: all;
}

.inv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px 10px;
    border-bottom: 1px solid rgba(240,192,96,0.15);
}
.inv-title {
    font-size: 14px;
    font-weight: 600;
    color: #f0c060;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.inv-close {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: #888;
    width: 26px; height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}
.inv-close:hover { color: #fff; border-color: rgba(255,255,255,0.3); }

.inv-body {
    display: flex;
    gap: 16px;
    padding: 14px 18px;
    overflow-y: auto;
    flex: 1;
}

.inv-section-title {
    font-size: 10px;
    font-weight: 600;
    color: #f0c060;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* QoL automation toolbar (Phase C) */
.inv-qol-bar { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.inv-qol-btn {
    font-size: 11px; padding: 3px 9px; cursor: pointer;
    color: #e8dcc0; background: rgba(240,192,96,0.08);
    border: 1px solid rgba(240,192,96,0.35); border-radius: 4px;
}
.inv-qol-btn:hover { background: rgba(240,192,96,0.18); border-color: #f0c060; }

/* Bag column (equipment moved to the paperdoll - paperdoll.js) */
.inv-bag-col {
    flex: 1;
}
.inv-bag-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 3px;
    max-height: 260px;
    overflow-y: auto;
}

/* Inventory slot (shared by equip + bag) */
.inv-slot {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.inv-slot:hover {
    border-color: rgba(240,192,96,0.4);
    background: rgba(240,192,96,0.06);
}
.inv-slot.inv-slot-filled {
    border-color: rgba(255,255,255,0.15);
}

.inv-slot-label {
    position: absolute;
    bottom: 1px; left: 2px;
    font-size: 7px;
    color: #555;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inv-slot-swatch {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.1s;
}

.inv-slot-qty {
    position: absolute;
    bottom: 2px; right: 3px;
    font-size: 9px;
    font-family: 'Consolas', monospace;
    color: #ddd;
    pointer-events: none;
    text-shadow: 0 0 3px rgba(0,0,0,0.8);
}

/* Weight bar */
.inv-weight-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.inv-weight-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 50px;
}
.inv-weight-track {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}
.inv-weight-fill {
    height: 100%;
    width: 0%;
    background: #50a060;
    border-radius: 2px;
    transition: width 0.2s, background 0.2s;
}
.inv-weight-value {
    font-size: 10px;
    font-family: 'Consolas', monospace;
    color: #aaa;
    width: 70px;
    text-align: right;
}

/* Drag ghost */
.inv-drag-ghost {
    position: fixed;
    width: 36px; height: 36px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.3);
    z-index: 9000;
    pointer-events: none;
    opacity: 0.85;
    font-size: 10px;
    font-family: 'Consolas', monospace;
    color: #fff;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 2px;
    text-shadow: 0 0 3px rgba(0,0,0,0.8);
}

/* ═══════════════════════════════════════════
   Tooltip system
   ═══════════════════════════════════════════ */

.gf-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: rgba(12, 12, 18, 0.95);
    border: 1px solid rgba(240, 192, 96, 0.2);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    color: #ddd;
    max-width: 260px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.1s ease;
}
.gf-tooltip.visible { opacity: 1; }

.gf-tt-name {
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    margin-bottom: 2px;
}
.gf-tt-qty {
    font-size: 11px;
    color: #f0c060;
    font-weight: normal;
}
.gf-tt-type {
    font-size: 10px;
    color: #888;
    margin-bottom: 4px;
}
.gf-tt-sep {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 5px 0;
}
.gf-tt-prop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px 0;
    font-size: 11px;
}
.gf-tt-prop-label {
    color: #999;
}
.gf-tt-prop-value {
    color: #ddd;
    font-family: 'Consolas', monospace;
}
.gf-tt-desc {
    color: #999;
    font-style: italic;
    font-size: 11px;
    line-height: 1.3;
}
/* Universal item-effect lines (hit-spells, stat/resist bonuses, leech, …). */
.gf-tt-effect {
    color: #66E0FF;
    font-size: 11px;
    line-height: 1.35;
}

/* Hotbar item rendering (inside existing hotbar-slot) */
.hotbar-item-swatch {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 28px; height: 28px;
    border-radius: 3px;
    opacity: 0;
    pointer-events: none;
}
.hotbar-item-qty {
    position: absolute;
    bottom: 2px; right: 3px;
    font-size: 9px;
    font-family: 'Consolas', monospace;
    color: #ddd;
    pointer-events: none;
    text-shadow: 0 0 3px rgba(0,0,0,0.8);
}

/* ── Game Window System (UO-style draggable windows) ── */

.game-window {
    background: var(--gf-panel-bg);
    -webkit-backdrop-filter: blur(var(--gf-blur));
    backdrop-filter: blur(var(--gf-blur));
    /* Gold "trim over glass": a thin recolored 9-slice frame (Kenney Fantasy
       UI Borders, CC0) over the dark-glass background. No `fill` keyword → the
       frame center is omitted and the glass shows through. CREDITS.md. */
    border: 9px solid transparent;
    border-image: url('/assets/ui/frames/frame-gold.png') 15 repeat;
    border-radius: 2px;
    box-shadow: var(--gf-shadow), var(--gf-inset);
    display: flex;
    flex-direction: column;
    min-width: 150px;
    min-height: 100px;
    overflow: hidden;
    transition: box-shadow 0.15s, border-color 0.15s;
}
/* Always-on micro HUD (per-mobile stat bars) keeps a light gold hairline - no
   ornate frame - so combat with several bars open stays uncluttered. */
.game-window[data-window-id^="statbar"] {
    border: 1px solid var(--gf-border-accent);
    border-image: none;
    border-radius: var(--gf-radius);
}

/* ── Buff / debuff bar ────────────────────────────────────────────────────── */
/* A strip of square effect icons living in the self stat-bar's titlebar —
   buffs left, debuffs right. Each icon is a kind-tinted square with a radial
   cooldown sweep (+ an optional shield-absorb badge); hover shows the full
   name/type/description/time tooltip. */
.eff-strip {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.eff-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}
.eff-side.empty { display: none; }
/* Keep debuffs pinned right even when the buffs side is hidden. */
.eff-debuffs { margin-left: auto; justify-content: flex-end; }

.eff-ic {
    position: relative;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--eff-color, #3a4152);
    border-radius: 5px;
    background: rgba(10,12,18,0.82);
    box-shadow: inset 0 0 8px rgba(0,0,0,0.45), 0 0 0 1px rgba(0,0,0,0.35);
}
.eff-ic .eff-ic-glyph { width: 17px; height: 17px; }

/* Radial "cooldown" sweep: darkens clockwise as --sweep goes 0 (full) → 1 (expired). */
.eff-cd {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: conic-gradient(from 0deg, rgba(6,8,14,0.62) calc(var(--sweep, 0) * 360deg), transparent 0);
}

/* Shield absorb readout, bottom-right corner. */
.eff-absorb {
    position: absolute;
    right: -3px;
    bottom: -3px;
    display: none;
    padding: 0 2px;
    font: 700 8px/1.35 var(--gf-mono, monospace);
    color: #d8ecff;
    background: rgba(8,12,20,0.92);
    border: 1px solid var(--eff-color, #3a4152);
    border-radius: 3px;
    pointer-events: none;
}
.eff-absorb.on { display: block; }

/* Subtle wear-off cue in the effect's final stretch. */
@keyframes eff-expiring-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.eff-ic.eff-expiring { animation: eff-expiring-pulse 0.9s ease-in-out infinite; }

/* Titlebar in "effects" mode (the self stat bar): hosts the icon strip, with a
   stable min-height so the bar doesn't jump as effects come and go. */
.game-window-titlebar.has-eff-strip {
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 8px;
    min-height: 30px;
}
/* Show the player's name when idle; hand the space to the icons once any effect
   is active (name + icons would otherwise fight for the same row). */
.game-window-titlebar.has-eff-strip.has-effects .game-window-title { display: none; }
/* Focused (most recently raised) window gets an accent lift. */
.game-window.gf-window-focused {
    border-color: var(--gf-border-accent);
    box-shadow: var(--gf-shadow-strong), 0 0 0 1px var(--gf-accent-glow), var(--gf-inset);
}

.game-window-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 9px;
    background: linear-gradient(180deg, rgba(84,66,30,0.6), rgba(40,32,18,0.62));
    border-bottom: 1px solid var(--gf-border-accent);
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
}

.game-window-titlebar:active {
    cursor: grabbing;
}

.game-window-title {
    font-size: 11px;
    font-family: var(--gf-mono);
    color: var(--gf-accent);
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.game-window-close {
    background: none;
    border: none;
    color: var(--gf-text-3);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.12s, transform 0.12s;
}
.game-window-close:hover {
    color: var(--gf-danger);
    transform: scale(1.15);
}

.game-window-content {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

/* When inventory panel is inside a game window, override its fixed positioning */
.game-window-content #inventory-panel {
    position: static;
    transform: none;
    max-height: none;
    width: 100%;
    display: none;
    opacity: 1;
    pointer-events: auto;
    z-index: auto;
    border: none;
    border-radius: 0;
    background: transparent;
}
.game-window-content #inventory-panel.open {
    display: flex;
}
/* Hide internal header when inside game window (window has its own title bar) */
.game-window-content .inv-header {
    display: none;
}
/* Inside a resizable window the body already scrolls (flex:1 + overflow), so
   drop the bag grid's fixed 260px cap - otherwise enlarging the window just
   leaves empty space below the bag instead of showing more rows. */
.game-window-content .inv-body { padding-top: 4px; }
.game-window-content .inv-bag-grid {
    max-height: none;
    overflow: visible;
}

/* ── Paperdoll / Skills / Titles windows (the character window trio) ── */
/* Each panel sits inside a GameWindow content area, which is the single scroll
   region - the panels carry no positioning or overflow of their own (the nested
   double-scrollbar was the old bug). Visibility is gated by .open, kept in sync
   with the window's show/hide by main.js. */
.game-window-content #paperdoll,
.game-window-content #remote-paperdoll { width: 100%; display: none; }
.game-window-content #paperdoll.open,
.game-window-content #remote-paperdoll.open { display: flex; }
.game-window-content #skills-panel,
.game-window-content #titles-panel { width: 100%; display: none; }
.game-window-content #skills-panel.open,
.game-window-content #titles-panel.open { display: block; }

#paperdoll,
#remote-paperdoll {
    --pd-slot: 48px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 12px;
    height: 100%;
    box-sizing: border-box;
}

/* Remote paperdoll: a read-only "gear + identity" view of another player/NPC.
   Reuses every .pd-* rule; adds only a notoriety caption + a read-only tint. */
.pd-noto { text-align: center; font-family: var(--gf-mono); font-size: 10px;
    letter-spacing: 1px; text-transform: uppercase; margin-top: -2px; }
#remote-paperdoll .pd-slot.inv-slot { cursor: default; }

/* Identity caption above the doll */
.pd-name {
    font-family: var(--gf-mono);
    font-size: 13px;
    color: var(--gf-accent);
    letter-spacing: 0.6px;
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gf-border);
}
.pd-race { color: var(--gf-text-3); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-left: 6px; }

/* Body: flanking equip-slot columns · tall portrait preview · flanking column.
   The slot columns spread their five slots along the doll's full height. */
.pd-body {
    display: grid;
    grid-template-columns: var(--pd-slot) 1fr var(--pd-slot);
    gap: 8px;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
}
.pd-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
}

/* Equip slots reuse .inv-slot; this just pins them to a square cell with premium animations. */
.pd-slot.inv-slot {
    width: var(--pd-slot);
    height: var(--pd-slot);
    aspect-ratio: auto;
    flex: 0 0 auto;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
    border: 1px solid rgba(184, 154, 74, 0.25);
    background: rgba(20, 22, 30, 0.4);
}
.pd-slot.inv-slot:hover {
    border-color: var(--gf-accent);
    box-shadow: 0 0 8px rgba(240, 192, 96, 0.35);
    background-color: rgba(240, 192, 96, 0.05);
}
.pd-slot.inv-slot.inv-slot-filled {
    border-color: rgba(184, 154, 74, 0.6);
    background: rgba(20, 22, 30, 0.65);
}
.pd-slot.inv-slot.inv-slot-filled:hover {
    border-color: var(--gf-accent-hot);
    box-shadow: 0 0 10px rgba(240, 192, 96, 0.5);
}

.pd-preview {
    position: relative;
    min-height: 200px;
    border: 1px solid var(--gf-border-accent);
    border-radius: 6px;
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 50% 18%, rgba(240,192,96,0.10), transparent 60%),
        linear-gradient(180deg, rgba(20,22,30,0.92), rgba(10,11,16,0.96));
    box-shadow: inset 0 0 26px rgba(0,0,0,0.55);
    flex: 1 1 auto;
}
.pd-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.pd-poster {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--gf-accent-deep); opacity: 0.45; font-size: 30px;
    pointer-events: none;
}
.pd-preview.has-model .pd-poster { display: none; }

/* Camera Reset Button */
.pd-preview-reset-cam {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 13, 12, 0.6);
    border: 1px solid var(--gf-border-accent);
    border-radius: 50%;
    color: var(--gf-accent);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    z-index: 5;
}
.pd-preview-reset-cam:hover {
    background: rgba(240, 192, 96, 0.2);
    color: var(--gf-accent-hot);
    border-color: var(--gf-accent);
}

/* Bag / scroll buttons tucked at the doll's feet, one each side. The row itself
   is click-through so a drag on the canvas still rotates the doll; the buttons
   re-enable pointer events. */
.pd-feet {
    position: absolute;
    left: 8px; right: 8px; bottom: 8px;
    display: flex; justify-content: space-between; align-items: flex-end;
    pointer-events: none;
}
.pd-feet-btn {
    pointer-events: auto;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--gf-border-accent);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(84,66,30,0.6), rgba(28,22,12,0.72));
    color: var(--gf-accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.12s;
}
.pd-feet-btn:hover {
    background: rgba(240,192,96,0.16);
    border-color: var(--gf-accent);
    color: var(--gf-accent-hot);
    transform: translateY(-1px);
}
.pd-feet-ic { width: 22px; height: 22px; }

/* Attribute value + raise/lower/lock controls grouped at the right of a row */
.stat-bar-detail .sbd-ctl { display: inline-flex; align-items: center; gap: 6px; }
.stat-bar-detail .sbd-toggle-group { display: inline-flex; gap: 2px; }
/* Compact toggle chips for the status panel - all three shown; inactive ones
   are dimmed, the active state is highlighted by its up/down/locked color. */
.stat-bar-detail .sbd-toggle {
    width: 16px; height: 16px;
    border-radius: 3px;
    font-size: 9px;
    line-height: 1;
    flex: 0 0 auto;
    opacity: 0.4;
    color: #9a927f;
    border-color: rgba(255,255,255,0.12);
}
.stat-bar-detail .sbd-toggle:hover { opacity: 0.8; }
.stat-bar-detail .sbd-toggle.is-active { opacity: 1; }
.stat-bar-detail .sbd-toggle.is-active[data-toggle="up"] { color: #4caf50; border-color: rgba(76,175,80,0.5); background: rgba(76,175,80,0.12); }
.stat-bar-detail .sbd-toggle.is-active[data-toggle="down"] { color: #f85149; border-color: rgba(248,81,73,0.5); background: rgba(248,81,73,0.12); }
.stat-bar-detail .sbd-toggle.is-active[data-toggle="locked"] { color: #cbb884; border-color: rgba(203,184,132,0.45); background: rgba(203,184,132,0.12); }

/* Collapsible Quick Actions Container */
.pd-actions-container {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(184, 154, 74, 0.25);
    border-radius: 6px;
    background: rgba(14, 13, 12, 0.45);
    overflow: hidden;
    transition: max-height 0.25s ease-out;
    max-height: 150px;
    flex: 0 0 auto;
}
.pd-actions-container.collapsed {
    max-height: 25px;
}
.pd-actions-toggle-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background: linear-gradient(180deg, rgba(84,66,30,0.4), rgba(40,32,18,0.45));
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid rgba(184, 154, 74, 0.15);
    transition: background 0.15s;
    height: 24px;
    box-sizing: border-box;
}
.pd-actions-toggle-bar:hover {
    background: rgba(240, 192, 96, 0.1);
}
.pd-actions-toggle-title {
    font-family: var(--gf-mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--gf-accent);
    text-transform: uppercase;
}
.pd-actions-toggle-btn {
    font-size: 8px;
    color: var(--gf-accent);
}
.pd-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px;
    background: rgba(14, 13, 12, 0.25);
}
.pd-btn {
    padding: 6px 4px;
    background: linear-gradient(180deg, rgba(84,66,30,0.5), rgba(40,32,18,0.55));
    border: 1px solid var(--gf-border-accent);
    border-radius: 4px;
    color: var(--gf-accent);
    font-family: var(--gf-mono);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pd-btn:hover { background: rgba(240,192,96,0.12); border-color: var(--gf-accent); color: var(--gf-accent-hot); }

.game-window-resize {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(100, 120, 160, 0.4) 50%);
}

/* ── Corpse loot window ── */
.corpse-window-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 6px 10px 10px 10px;
    color: #d8d4cc;
    font-family: inherit;
}
.corpse-header {
    padding: 2px 0 6px 0;
    border-bottom: 1px solid rgba(120, 140, 170, 0.3);
    margin-bottom: 6px;
}
.corpse-subtitle {
    font-weight: bold;
    color: #e8dcaa;
    font-size: 14px;
}
.corpse-list {
    flex: 1;
    overflow-y: auto;
    min-height: 80px;
}
.corpse-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 8px;
    margin: 2px 0;
    background: rgba(60, 55, 45, 0.5);
    border: 1px solid rgba(120, 90, 60, 0.4);
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.1s;
}
.corpse-item:hover {
    background: rgba(100, 80, 55, 0.7);
    border-color: rgba(180, 140, 80, 0.6);
}
.corpse-item-name {
    flex: 1;
    font-size: 13px;
}
.corpse-item-qty {
    color: #d0c088;
    font-size: 13px;
    margin-left: 8px;
}
.corpse-empty {
    text-align: center;
    color: #888;
    padding: 16px 0;
    font-style: italic;
}
.corpse-footer {
    padding-top: 6px;
    border-top: 1px solid rgba(120, 140, 170, 0.3);
    margin-top: 6px;
}
.corpse-loot-all {
    width: 100%;
    padding: 6px;
    background: rgba(80, 60, 40, 0.7);
    border: 1px solid rgba(180, 140, 80, 0.6);
    color: #e8dcaa;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    border-radius: 2px;
}
.corpse-loot-all:hover:not(:disabled) {
    background: rgba(120, 85, 50, 0.8);
}
.corpse-loot-all:disabled {
    opacity: 0.4;
    cursor: default;
}
.corpse-skin {
    width: 100%;
    padding: 6px;
    margin-bottom: 6px;
    background: rgba(60, 78, 46, 0.7);
    border: 1px solid rgba(140, 180, 90, 0.6);
    color: #d8e8aa;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    border-radius: 2px;
}
.corpse-skin:hover {
    background: rgba(85, 110, 60, 0.85);
}
.corpse-loading {
    color: #a89c80;
    padding: 10px;
    text-align: center;
}

/* ── Crafting panel ── */
.crafting-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #e8dcc0;
    font-family: 'Cinzel', 'Times New Roman', serif;
    background: rgba(20, 16, 12, 0.95);
}
.craft-subheader {
    padding: 6px 12px;
    border-bottom: 1px solid #4a3a26;
    background: rgba(0,0,0,0.3);
}
.craft-station-label {
    font-size: 13px;
    color: #c0a070;
    letter-spacing: 0.05em;
}
.craft-body {
    display: flex;
    flex: 1;
    min-height: 0;
}
.craft-list {
    flex: 1 1 55%;
    overflow-y: auto;
    border-right: 1px solid #4a3a26;
    padding: 4px 0;
}
.craft-detail {
    flex: 1 1 45%;
    padding: 12px;
    overflow-y: auto;
}
.craft-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    cursor: pointer;
    border-left: 3px solid transparent;
    font-size: 12px;
}
.craft-row:hover {
    background: rgba(160, 120, 60, 0.15);
}
.craft-row.selected {
    background: rgba(160, 120, 60, 0.25);
    border-left-color: #c0a070;
}
.craft-row.no-skill { color: #786858; }
.craft-row.no-mats  { color: #a89c80; }
.craft-row.craftable .craft-name { color: #f0d090; }
.craft-row .craft-skill {
    font-size: 10px;
    color: #807060;
    text-transform: capitalize;
}
.craft-row.exceptional {
    animation: craft-flash-exc 1.2s ease-out;
}
.craft-row.flash {
    animation: craft-flash 0.8s ease-out;
}
@keyframes craft-flash {
    0%   { background: rgba(120,200,120,0.5); }
    100% { background: transparent; }
}
@keyframes craft-flash-exc {
    0%   { background: rgba(240,200,80,0.7); }
    100% { background: transparent; }
}
.craft-detail h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #f0d090;
}
.craft-desc {
    font-size: 11px;
    color: #a89c80;
    margin: 0 0 10px 0;
    font-style: italic;
}
.craft-skill-block {
    margin-bottom: 10px;
    font-size: 11px;
    text-transform: capitalize;
}
.craft-skill-block .ok { color: #80c080; }
.craft-skill-block .fail { color: #c08070; }
.craft-section-hdr {
    margin: 8px 0 4px 0;
    font-size: 11px;
    color: #c0a070;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.craft-ingredients, .craft-output {
    font-size: 12px;
    margin-bottom: 6px;
}
.craft-ing, .craft-output {
    padding: 2px 0;
    text-transform: capitalize;
}
.craft-btn {
    margin-top: 14px;
    padding: 8px 16px;
    width: 100%;
    background: linear-gradient(180deg, #6a4a20 0%, #4a3018 100%);
    color: #f0d090;
    border: 1px solid #8a6840;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.05em;
}
.craft-btn:hover:not(.disabled) {
    background: linear-gradient(180deg, #8a6830 0%, #6a4a20 100%);
}
.craft-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #2a2018;
}
.craft-empty {
    color: #786858;
    text-align: center;
    margin-top: 40px;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   Town NPC dialog (vendor shop / skill trainer / veterinarian)
   ═══════════════════════════════════════════════════════════════ */
.npc-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #e8dcc0;
    font-family: 'Cinzel', 'Times New Roman', serif;
    background: rgba(20, 16, 12, 0.95);
}
.npc-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #4a3a26;
    background: rgba(0, 0, 0, 0.3);
}
.npc-name {
    font-size: 14px;
    color: #f0d090;
    letter-spacing: 0.05em;
}
.npc-subtitle {
    font-size: 10.5px;
    color: #a89c80;
    font-style: italic;
}
.npc-gold {
    margin-left: auto;
    font-size: 12px;
    color: #e0c060;
    white-space: nowrap;
}
.npc-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 10px 0 10px;
}
.npc-tab {
    padding: 5px 16px;
    background: #2a2018;
    color: #b0a080;
    border: 1px solid #4a3a26;
    border-bottom: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 0.04em;
}
.npc-tab.active {
    background: rgba(160, 120, 60, 0.25);
    color: #f0d090;
}
.npc-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0;
}
.npc-list {
    display: flex;
    flex-direction: column;
}
.npc-cat {
    padding: 8px 12px 3px 12px;
    font-size: 10px;
    color: #c0a070;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.npc-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-left: 3px solid transparent;
    font-size: 12px;
}
.npc-row:hover {
    background: rgba(160, 120, 60, 0.12);
}
.npc-row-name {
    flex: 1 1 auto;
    color: #e8dcc0;
}
.npc-row-price {
    flex: 0 0 auto;
    font-size: 11px;
    color: #c0a070;
    white-space: nowrap;
}
.npc-qty {
    width: 52px;
    padding: 3px 4px;
    background: #160f0a;
    color: #f0d090;
    border: 1px solid #4a3a26;
    font-family: inherit;
    font-size: 12px;
}
.npc-btn {
    padding: 4px 12px;
    background: linear-gradient(180deg, #6a4a20 0%, #4a3018 100%);
    color: #f0d090;
    border: 1px solid #8a6840;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 0.04em;
}
.npc-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #8a6830 0%, #6a4a20 100%);
}
.npc-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #2a2018;
}
.npc-btn.sell {
    background: linear-gradient(180deg, #4a5a30 0%, #313e1c 100%);
    border-color: #6a8048;
}
.npc-btn.sell:hover:not(:disabled) {
    background: linear-gradient(180deg, #5a6a38 0%, #4a5a30 100%);
}
.npc-done {
    flex: 0 0 auto;
    font-size: 11px;
    color: #80a080;
    font-style: italic;
    padding-right: 6px;
}
.npc-empty {
    color: #786858;
    text-align: center;
    margin-top: 36px;
    font-style: italic;
    font-size: 12px;
}

/* Banker tab */
.npc-bank {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 16px;
    align-items: stretch;
}
.npc-bank-balance {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #4a3a26;
}
.npc-bank-balance span { color: #c0a070; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.npc-bank-balance strong { color: #f0d060; font-size: 18px; }
.npc-qty-wide { width: 100%; box-sizing: border-box; text-align: center; }
.npc-bank-row {
    display: flex;
    gap: 8px;
}
.npc-bank-row .npc-btn { flex: 1; text-align: center; }

/* ═══════════════════════════════════════════════════════════════
   Player-vendor management window (Phase 12 P4, owner side)
   ═══════════════════════════════════════════════════════════════ */
.vendor-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #e8dcc0;
    font-family: 'Cinzel', 'Times New Roman', serif;
    background: rgba(20, 16, 12, 0.95);
}
.vendor-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #4a3a26;
    background: rgba(0, 0, 0, 0.3);
}
.vendor-count { font-size: 12px; color: #f0d090; letter-spacing: 0.04em; }
.vendor-price-set {
    margin-left: auto;
    font-size: 11px;
    color: #c0a070;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.vendor-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0;
}
.vendor-hint {
    padding: 6px 12px 8px 12px;
    font-size: 10.5px;
    color: #a89c80;
    font-style: italic;
}
.vendor-list { display: flex; flex-direction: column; }
.vendor-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
}
.vendor-row:hover { background: rgba(160, 120, 60, 0.12); }
.vendor-row-name { flex: 1 1 auto; color: #e8dcc0; }
.vendor-row-price { flex: 0 0 auto; font-size: 11px; color: #c0a070; }
.vendor-qty {
    width: 72px;
    padding: 3px 4px;
    background: #160f0a;
    color: #f0d090;
    border: 1px solid #4a3a26;
    font-family: inherit;
    font-size: 12px;
}
.vendor-btn {
    padding: 4px 12px;
    background: linear-gradient(180deg, #6a4a20 0%, #4a3018 100%);
    color: #f0d090;
    border: 1px solid #8a6840;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 0.04em;
}
.vendor-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #8a6830 0%, #6a4a20 100%);
}
.vendor-btn.danger {
    background: linear-gradient(180deg, #6a2a20 0%, #4a1c16 100%);
    border-color: #8a4838;
    width: 100%;
    text-align: center;
}
.vendor-btn.danger:hover { background: linear-gradient(180deg, #8a3830 0%, #6a2a20 100%); }
.vendor-btn.active {
    background: linear-gradient(180deg, #a07830 0%, #7a5420 100%);
    border-color: #c0a060;
    color: #fff0c0;
}

/* ── Housing panel (Phase 12 P5) ── */
.housing-buy, .housing-manage { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.housing-size-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: #c0a070; font-size: 12px; }
.housing-row { display: flex; align-items: center; gap: 6px; }
.housing-quote { color: #f0d090; font-size: 13px; padding: 4px 0; }
.housing-quote.unaffordable { color: #d08070; }
.housing-toggle { display: flex; align-items: center; gap: 4px; color: #d8ccb6; font-size: 12px; cursor: pointer; }

/* ── Mail panel (Phase 12 P6) - reuses the vendor-* skeleton ── */
.mail-list { display: flex; flex-direction: column; gap: 2px; }
.mail-letter { border-bottom: 1px solid rgba(184, 154, 74, 0.12); }
.mail-letter.unread .vendor-row-name { color: #f0d090; font-weight: 600; }
.mail-row { display: flex; align-items: center; justify-content: space-between; cursor: pointer; gap: 8px; }
.mail-row:hover { background: rgba(184, 154, 74, 0.08); }
.mail-date { color: #786858; font-size: 11px; white-space: nowrap; }
.mail-detail { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 10px; }
.mail-body { color: #d8ccb6; font-size: 12px; white-space: pre-wrap; line-height: 1.4;
             max-height: 160px; overflow-y: auto; }
.mail-attach { color: #f0d090 !important; }
.mail-compose { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.mail-field { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mail-textarea {
    width: 100%; box-sizing: border-box; resize: vertical;
    background: rgba(14, 13, 12, 0.6); color: #d8ccb6;
    border: 1px solid rgba(184, 154, 74, 0.35); border-radius: 3px;
    padding: 6px; font-family: inherit; font-size: 12px;
}
.mail-flash { color: #e2622a !important; }
.vendor-empty {
    color: #786858;
    text-align: center;
    margin-top: 30px;
    font-style: italic;
    font-size: 12px;
}
.vendor-footer {
    padding: 8px 12px;
    border-top: 1px solid #4a3a26;
    background: rgba(0, 0, 0, 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   Command Palette (/commands window) - role-filtered clickable commands
   ═══════════════════════════════════════════════════════════════ */
.cmd-palette-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #e8dcc0;
    font-family: 'Cinzel', 'Times New Roman', serif;
    background: rgba(20, 16, 12, 0.95);
}
.cmd-subheader {
    padding: 6px 12px;
    border-bottom: 1px solid #4a3a26;
    background: rgba(0,0,0,0.3);
    font-size: 11px;
    color: #a89c80;
}
.cmd-subheader .cmd-role {
    color: #c0a070;
    text-transform: capitalize;
    letter-spacing: 0.05em;
}
.cmd-search {
    margin: 8px 10px 4px 10px;
    padding: 6px 10px;
    background: rgba(0,0,0,0.4);
    border: 1px solid #4a3a26;
    border-radius: 4px;
    color: #e8dcc0;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}
.cmd-search:focus { border-color: #c0a070; }
.cmd-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0 10px 0;
    min-height: 0;
}
.cmd-cat-hdr {
    margin: 10px 0 4px 0;
    padding: 0 12px;
    font-size: 11px;
    color: #c0a070;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.cmd-cat-hdr-pinned { color: #e0b860; }
.cmd-fav-btn {
    background: none;
    border: none;
    color: #6a5a3c;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0 2px;
    margin-right: 2px;
    transition: color 0.12s ease;
}
.cmd-fav-btn:hover { color: #e0b860; }
.cmd-fav-btn.on { color: #f0c860; }
.cmd-row {
    padding: 6px 12px 8px 12px;
    border-left: 3px solid transparent;
}
.cmd-row:hover {
    background: rgba(160, 120, 60, 0.10);
    border-left-color: #6a5436;
}
.cmd-row-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}
.cmd-label {
    font-size: 13px;
    color: #f0d090;
}
.cmd-slash {
    font-size: 10px;
    color: #807060;
    font-family: 'Courier New', monospace;
}
.cmd-badge {
    margin-left: auto;
    font-size: 9px;
    color: #b0a080;
    background: rgba(160, 120, 60, 0.18);
    border: 1px solid #6a5436;
    border-radius: 3px;
    padding: 1px 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cmd-args {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.cmd-arg {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.cmd-arg-input {
    background: rgba(0,0,0,0.35);
    border: 1px solid #4a3a26;
    color: #e8dcc0;
    font-family: inherit;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 3px;
    width: 86px;
    box-sizing: border-box;
}
.cmd-arg-input:focus {
    outline: none;
    border-color: #c0a070;
}
.cmd-arg-input.invalid {
    border-color: #c06050;
    background: rgba(160, 60, 50, 0.18);
}
select.cmd-arg-input {
    width: auto;
    min-width: 86px;
}
.cmd-arg-player { width: 110px; }
.cmd-pick-btn {
    background: rgba(160, 120, 60, 0.15);
    border: 1px solid #6a5436;
    color: #f0d090;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 3px;
}
.cmd-pick-btn:hover { background: rgba(160, 120, 60, 0.35); }
.cmd-run-btn {
    margin-left: auto;
    padding: 4px 14px;
    background: linear-gradient(180deg, #6a4a20 0%, #4a3018 100%);
    color: #f0d090;
    border: 1px solid #8a6840;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 0.05em;
    border-radius: 3px;
}
.cmd-run-btn:hover {
    background: linear-gradient(180deg, #8a6830 0%, #6a4a20 100%);
}
.cmd-run-btn.confirm {
    background: linear-gradient(180deg, #8a3020 0%, #5a1c12 100%);
    border-color: #c06050;
    color: #f0c0b0;
}
.cmd-empty {
    color: #786858;
    text-align: center;
    margin-top: 40px;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   AAA Action Bars / Hotbars (UO-style hotkeys)
   Multi-bar, floating single-icon buttons, drag-to-assign,
   cooldown sweeps, keybind overlays, slot-state coding.
   ═══════════════════════════════════════════════════════════════ */

.gf-bar {
    position: fixed;
    display: flex;
    gap: var(--gf-slot-gap);
    padding: 6px;
    background: var(--gf-panel-bg);
    -webkit-backdrop-filter: blur(var(--gf-blur));
    backdrop-filter: blur(var(--gf-blur));
    border: 1px solid var(--gf-border-accent);
    border-radius: var(--gf-radius);
    box-shadow: var(--gf-shadow), var(--gf-inset);
    z-index: 40;
    pointer-events: auto;
}
.gf-bar.gf-bar-vertical { flex-direction: column; }
/* Floating single-icon buttons are chromeless until hovered/editing. */
.gf-bar.gf-bar-floating {
    padding: 3px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-color: transparent;
    box-shadow: none;
}
.gf-bar.gf-bar-floating:hover,
body.gf-hud-edit .gf-bar.gf-bar-floating {
    background: var(--gf-panel-bg-soft);
    border-color: var(--gf-border-soft);
}
/* The bar that owns the number keys right now. */
.gf-bar.gf-bar-keyactive {
    border-color: var(--gf-border-accent);
    box-shadow: var(--gf-shadow), 0 0 0 1px var(--gf-accent-glow), var(--gf-inset);
}

/* Drag handle (shown in HUD edit mode) */
.gf-bar-grip {
    display: none;
    align-self: stretch;
    width: 10px;
    margin-right: 2px;
    border-radius: var(--gf-radius-sm);
    background: repeating-linear-gradient(90deg, var(--gf-accent-glow) 0 2px, transparent 2px 4px);
    cursor: grab;
    flex-shrink: 0;
}
.gf-bar.gf-bar-vertical .gf-bar-grip {
    width: auto; height: 10px; margin: 0 0 2px 0;
}
body.gf-hud-edit .gf-bar-grip { display: block; }
body.gf-hud-edit .gf-bar { outline: 1px dashed var(--gf-border-accent); }

/* ── Slots ── */
.gf-slot {
    position: relative;
    width: var(--gf-slot);
    height: var(--gf-slot);
    background: var(--gf-slot-bg);
    border: 1px solid rgba(240,192,96,0.18);
    border-radius: var(--gf-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.12s, background 0.12s, box-shadow 0.12s, transform 0.06s;
    cursor: pointer;
}
.gf-slot:hover {
    background: var(--gf-slot-bg-hover);
    border-color: var(--gf-border-accent);
}
.gf-slot:active { transform: translateY(1px); }
.gf-slot.gf-slot-empty {
    border-style: dashed;
    border-color: var(--gf-border-soft);
    cursor: default;
}
.gf-slot.gf-slot-empty:hover { background: var(--gf-slot-bg); }
/* The armed (selected-for-placement / active) slot. */
.gf-slot.gf-slot-active {
    border-color: var(--gf-accent);
    box-shadow: 0 0 10px var(--gf-accent-glow), inset 0 0 0 1px var(--gf-accent-glow);
}
/* Drop target highlight while dragging an assignable thing over it. */
.gf-slot.gf-slot-droptarget {
    border-color: var(--gf-success);
    box-shadow: 0 0 10px rgba(111,200,116,0.5);
}

/* Icon layer */
.gf-slot-icon {
    position: absolute;
    inset: 3px;
    border-radius: 3px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(20px * var(--gf-ui-scale) * var(--gf-bar-scale));
    font-weight: 700;
    color: rgba(0,0,0,0.55);
    text-shadow: 0 1px 0 rgba(255,255,255,0.25);
}
/* Target-mode colored ring (UO Enhanced Client convention). */
.gf-slot[data-target="self"]    .gf-slot-icon { box-shadow: inset 0 0 0 2px rgba(90,166,224,0.8); }
.gf-slot[data-target="cursor"]  .gf-slot-icon { box-shadow: inset 0 0 0 2px rgba(111,200,116,0.8); }
.gf-slot[data-target="last"]    .gf-slot-icon { box-shadow: inset 0 0 0 2px rgba(150,150,150,0.8); }
.gf-slot[data-target="current"] .gf-slot-icon { box-shadow: inset 0 0 0 2px rgba(224,82,74,0.85); }

/* Keybind overlay (top-left) */
.gf-slot-key {
    position: absolute;
    top: 1px; left: 3px;
    font-size: calc(10px * var(--gf-ui-scale) * var(--gf-bar-scale));
    font-family: var(--gf-mono);
    color: var(--gf-text-2);
    text-shadow: 0 1px 2px #000, 0 0 2px #000;
    pointer-events: none;
    z-index: 3;
}
.gf-slot-active .gf-slot-key { color: var(--gf-accent-hot); }

/* Quantity / charges (bottom-right) */
.gf-slot-qty {
    position: absolute;
    bottom: 1px; right: 3px;
    font-size: calc(11px * var(--gf-ui-scale) * var(--gf-bar-scale));
    font-family: var(--gf-mono);
    color: var(--gf-text-1);
    text-shadow: 0 1px 2px #000, 0 0 2px #000;
    pointer-events: none;
    z-index: 3;
}

/* On-slot state coding */
.gf-slot.gf-slot-unusable .gf-slot-icon { filter: grayscale(0.85) brightness(0.6); }
.gf-slot.gf-slot-nomana::after,
.gf-slot.gf-slot-oorange::after {
    content: '';
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 2;
}
.gf-slot.gf-slot-nomana::after { background: rgba(64,96,200,0.30); }
.gf-slot.gf-slot-oorange::after { background: rgba(0,0,0,0.35); }
/* Ready/proc glow */
.gf-slot.gf-slot-proc {
    animation: gfProcGlow 1.1s ease-in-out infinite;
}
@keyframes gfProcGlow {
    0%,100% { box-shadow: 0 0 6px var(--gf-accent-glow); }
    50%     { box-shadow: 0 0 16px var(--gf-accent-hot); }
}

/* Cooldown radial sweep (GPU-composited conic mask) */
.gf-slot-cooldown {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background: conic-gradient(rgba(0,0,0,0.66) var(--gf-cd, 0deg), transparent 0deg);
    display: none;
}
.gf-slot.gf-slot-cooling .gf-slot-cooldown { display: block; }
.gf-slot-cd-text {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: calc(14px * var(--gf-ui-scale) * var(--gf-bar-scale));
    font-weight: 700;
    font-family: var(--gf-mono);
    color: #fff;
    text-shadow: 0 1px 3px #000;
    pointer-events: none;
}
.gf-slot.gf-slot-cooling .gf-slot-cd-text { display: flex; }
/* "bling" pop when a cooldown finishes */
.gf-slot.gf-slot-ready-pop { animation: gfReadyPop 0.32s ease-out; }
@keyframes gfReadyPop {
    0%   { transform: scale(1); box-shadow: 0 0 0 var(--gf-accent-glow); }
    40%  { transform: scale(1.12); box-shadow: 0 0 18px var(--gf-accent-hot); }
    100% { transform: scale(1); box-shadow: none; }
}

/* ── Macro / hotbar context menu hint chip ── */
.gf-bar-addbtn {
    align-self: center;
    display: none;
    margin-left: 4px;
    padding: 0 8px;
    height: calc(var(--gf-slot) * 0.5);
    font-size: 18px;
    line-height: 1;
    color: var(--gf-accent);
    background: var(--gf-slot-bg);
    border: 1px dashed var(--gf-border-accent);
    border-radius: var(--gf-radius-sm);
    cursor: pointer;
}
body.gf-hud-edit .gf-bar-addbtn { display: inline-flex; align-items: center; }

/* ═══════════════════════════════════════════════════════════════
   Macro Editor + Ability Picker (inside a GameWindow)
   ═══════════════════════════════════════════════════════════════ */
.gf-macro-editor { display: flex; flex-direction: column; height: 100%; color: var(--gf-text-1); font-size: 13px; }
.gf-macro-cols { display: flex; flex: 1; min-height: 0; }
.gf-macro-list {
    width: 190px;
    border-right: 1px solid var(--gf-border-soft);
    overflow-y: auto;
    flex-shrink: 0;
}
.gf-macro-list-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--gf-border-soft);
}
.gf-macro-list-item:hover { background: var(--gf-slot-bg-hover); }
.gf-macro-list-item.gf-active { background: rgba(240,192,96,0.14); box-shadow: inset 3px 0 0 var(--gf-accent); }
.gf-macro-list-icon {
    width: 26px; height: 26px; border-radius: 4px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: rgba(0,0,0,0.6); font-size: 13px;
}
.gf-macro-list-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-macro-list-key { font-family: var(--gf-mono); font-size: 10px; color: var(--gf-text-3); }

.gf-macro-detail { flex: 1; padding: 12px 14px; overflow-y: auto; min-width: 0; }
.gf-macro-detail h4 { color: var(--gf-accent); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin: 14px 0 6px; }
.gf-macro-detail h4:first-child { margin-top: 0; }
.gf-field { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gf-field label { width: 78px; color: var(--gf-text-2); font-size: 12px; flex-shrink: 0; }
.gf-input, .gf-select {
    flex: 1;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
    color: var(--gf-text-1);
    padding: 5px 7px;
    font-family: inherit;
    font-size: 12px;
    min-width: 0;
}
.gf-input:focus, .gf-select:focus { outline: none; border-color: var(--gf-border-accent); }
.gf-keycap {
    flex: 1; text-align: center;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
    color: var(--gf-text-1); padding: 5px 7px; cursor: pointer; font-family: var(--gf-mono); font-size: 12px;
}
.gf-keycap.gf-rebinding { border-color: var(--gf-accent); color: var(--gf-accent-hot); }

.gf-step {
    border: 1px solid var(--gf-border-soft);
    border-radius: var(--gf-radius-sm);
    padding: 9px 10px;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.18);
}
.gf-step-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.gf-step-num { font-size: 11px; color: var(--gf-text-3); font-family: var(--gf-mono); }
.gf-step-del { background: none; border: none; color: var(--gf-text-3); cursor: pointer; font-size: 14px; }
.gf-step-del:hover { color: var(--gf-danger); }
.gf-cond-row { display: flex; gap: 6px; align-items: center; }
.gf-cond-row .gf-select { flex: 1 1 0; }
.gf-cond-row .gf-input { flex: 0 0 60px; }

/* Macro DSL (Phase B): control-flow steps + nested block bodies. */
.gf-step-ctl { border-color: var(--gf-accent, #b89a4a); background: rgba(184,154,74,0.08); }
.gf-macro-body { border-left: 2px solid var(--gf-border-soft); margin: 4px 0 4px 6px; padding-left: 8px; }
.gf-macro-blocklabel { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--gf-text-3); font-family: var(--gf-mono); margin: 6px 0 3px; }
.gf-macro-branch { border-top: 1px dashed var(--gf-border-soft); padding-top: 4px; margin-top: 4px; }
.gf-macro-validate { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.gf-macro-valstatus { font-size: 12px; font-family: var(--gf-mono); }
.gf-macro-valstatus.ok { color: var(--gf-success, #6fbf73); }
.gf-macro-valstatus.err { color: var(--gf-danger, #d9534f); }

.gf-btn {
    background: linear-gradient(180deg, rgba(240,192,96,0.22), rgba(240,192,96,0.10));
    border: 1px solid var(--gf-border-accent);
    color: var(--gf-accent-hot);
    border-radius: var(--gf-radius-sm);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: background 0.12s, transform 0.06s;
}
.gf-btn:hover { background: linear-gradient(180deg, rgba(240,192,96,0.34), rgba(240,192,96,0.16)); }
.gf-btn:active { transform: translateY(1px); }
.gf-btn-sm { padding: 4px 9px; font-size: 11px; }
.gf-btn-danger { color: var(--gf-danger); border-color: var(--gf-danger-deep); background: rgba(224,82,74,0.12); }
.gf-btn-ghost { background: rgba(255,255,255,0.05); border-color: var(--gf-border); color: var(--gf-text-2); }
.gf-macro-toolbar { display: flex; gap: 7px; padding: 9px; border-top: 1px solid var(--gf-border-soft); flex-shrink: 0; }
.gf-macro-empty { color: var(--gf-text-3); text-align: center; margin-top: 48px; font-style: italic; padding: 0 20px; line-height: 1.5; }

/* ── Ability picker grid (drag spells/skills/items onto a bar) ── */
.gf-picker { display: flex; flex-direction: column; height: 100%; }
.gf-picker-tabs { display: flex; gap: 2px; padding: 6px 8px 0; flex-shrink: 0; border-bottom: 1px solid var(--gf-border-soft); }
.gf-picker-tab {
    padding: 6px 12px; cursor: pointer; font-size: 12px; color: var(--gf-text-3);
    border: 1px solid transparent; border-bottom: none; border-radius: var(--gf-radius-sm) var(--gf-radius-sm) 0 0;
}
.gf-picker-tab.gf-active { color: var(--gf-accent); background: var(--gf-slot-bg); border-color: var(--gf-border-soft); }
/* When the macro editor is embedded in the Options window, its own
   Macros/Abilities sub-tab bar is replaced by the Options top-level tabs. */
.gf-macro-editor.gf-embedded > .gf-picker-tabs { display: none; }
/* flex:0 0 auto overrides the inherited `.gf-input { flex:1 }` so the search
   field stays one line tall instead of stretching down the column flex. */
.gf-picker-search { margin: 8px; flex: 0 0 auto; }
.gf-picker-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 6px; padding: 0 8px 8px; align-content: start; }
.gf-picker-cell {
    display: flex; align-items: center; gap: 7px;
    padding: 6px 8px;
    border: 1px solid var(--gf-border-soft);
    border-radius: var(--gf-radius-sm);
    cursor: grab; background: rgba(0,0,0,0.18);
}
.gf-picker-cell:hover { border-color: var(--gf-border-accent); background: var(--gf-slot-bg-hover); }
.gf-picker-cell-icon { width: 24px; height: 24px; border-radius: 4px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: rgba(0,0,0,0.6); }
.gf-picker-cell-name { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-picker-cell-meta { font-size: 10px; color: var(--gf-text-3); }

/* Floating drag-ghost used by hotbar/picker assignment. */
.gf-drag-ghost {
    position: fixed; z-index: 9999; pointer-events: none;
    width: 40px; height: 40px; border-radius: var(--gf-radius-sm);
    border: 1px solid var(--gf-accent); background: var(--gf-panel-bg-strong);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--gf-accent-hot); font-size: 16px;
    box-shadow: var(--gf-shadow);
}

/* ═══════════════════════════════════════════════════════════════
   Enriched resource bars (HP / Stamina / Mana)
   Damage-trail sub-fill + regen shimmer + icon/shape coding.
   ═══════════════════════════════════════════════════════════════ */
.stat-bar-row .stat-bar-track { position: relative; }
/* Delayed "damage trail" - a second fill that lags behind on loss. */
.stat-bar-trail {
    position: absolute;
    left: 0; top: 0; height: 100%;
    width: 0%;
    border-radius: inherit;
    background: rgba(255,255,255,0.28);
    transition: width 0.7s cubic-bezier(.4,0,.2,1) 0.12s;
    z-index: 1;
    pointer-events: none;
}
.stat-bar-row .stat-bar-fill { position: relative; z-index: 2; }
/* Subtle moving shimmer to read as "alive / regenerating". */
.stat-bar-row .stat-bar-fill::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
    background-size: 200% 100%;
    animation: gfShimmer 2.6s linear infinite;
    opacity: 0.0;
    transition: opacity 0.3s;
}
.stat-bar-row.gf-regen .stat-bar-fill::after { opacity: 1; }
@keyframes gfShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
/* Mana shimmer intensifies with local Grid density (set via --gf-grid 0..1). */
.stat-bar-row.gf-mana .stat-bar-fill::after { animation-duration: calc(3.2s - var(--gf-grid, 0) * 1.8s); }
/* Pools are identified by fill COLOR alone - no text label or glyph. */
.stat-bar-row.gf-low .stat-bar-fill { animation: lowHpPulse 1s ease infinite; }

/* ═══════════════════════════════════════════════════════════════
   HUD Edit Mode
   ═══════════════════════════════════════════════════════════════ */
#gf-hud-edit-banner {
    position: fixed;
    top: 14px; left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--gf-panel-bg-strong);
    border: 1px solid var(--gf-border-accent);
    border-radius: var(--gf-radius);
    box-shadow: var(--gf-shadow-strong);
    color: var(--gf-text-1);
    font-size: 13px;
}
body.gf-hud-edit #gf-hud-edit-banner { display: flex; }
#gf-hud-edit-banner .gf-eb-title { color: var(--gf-accent); font-weight: 700; }

/* ── Pet Training window ── */
.pet-training-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #e8dcc0;
    font-family: 'Cinzel', 'Times New Roman', serif;
    background: rgba(20, 16, 12, 0.95);
    overflow: hidden;
}
.pt-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}
.pt-empty { padding: 20px; text-align: center; opacity: 0.7; }
.pt-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid #4a3a26;
    padding-bottom: 6px;
    margin-bottom: 8px;
}
.pt-name { font-size: 16px; font-weight: 700; }
.pt-level { opacity: 0.85; font-size: 13px; }
.pt-bond-badge {
    background: #2a6aa0; color: #cfe8ff;
    border-radius: 3px; padding: 1px 6px; font-size: 11px;
}
.pt-xp { margin-bottom: 8px; }
.pt-xp-bar {
    height: 8px; background: rgba(0,0,0,0.4);
    border: 1px solid #4a3a26; border-radius: 4px; overflow: hidden;
}
.pt-xp-fill { height: 100%; background: linear-gradient(90deg, #6aa84f, #b7e892); }
.pt-xp-label { font-size: 11px; opacity: 0.7; margin-top: 2px; }
.pt-pending { margin-bottom: 8px; }
.pt-pend-bar {
    height: 6px; background: rgba(0,0,0,0.4);
    border: 1px solid #6a5526; border-radius: 4px; overflow: hidden;
}
.pt-pend-fill {
    height: 100%;
    background: repeating-linear-gradient(45deg, #b8893a, #b8893a 6px, #8a6628 6px, #8a6628 12px);
}
.pt-pend-label { font-size: 11px; color: #d8b86a; opacity: 0.85; margin-top: 2px; }
.pt-points { font-weight: 700; color: #f0d890; margin: 6px 0; }
.pt-section {
    margin: 10px 0 4px; font-size: 12px; text-transform: uppercase;
    letter-spacing: 0.06em; color: #b89a64; border-bottom: 1px solid #3a2e1e;
}
.pt-row {
    display: flex; align-items: center; gap: 8px; padding: 3px 0;
}
.pt-row-label { flex: 1; }
.pt-row-val { min-width: 64px; text-align: right; opacity: 0.9; }
.pt-overcap { color: #f0c040; font-weight: 700; }
.pt-btn {
    background: #3a2e1e; color: #e8dcc0; border: 1px solid #5a4632;
    border-radius: 3px; padding: 2px 8px; cursor: pointer; font-family: inherit;
    min-width: 36px;
}
.pt-btn:hover:not(:disabled) { background: #5a4632; }
.pt-btn:disabled { opacity: 0.35; cursor: default; }
/* up/down/locked toggle button on a pet's skills + stats. */
.pt-toggle { min-width: 26px; font-size: 11px; padding: 2px 5px; }
.pt-toggle-up { color: #7fe084; border-color: #3d7a40; }
.pt-toggle-down { color: #e08a7f; border-color: #7a4036; }
.pt-toggle-locked { color: #c0b070; border-color: #6a5e32; }
.pt-showall { float: right; min-width: auto; font-size: 10px; padding: 1px 6px; opacity: 0.8; }
.pt-bond { font-size: 13px; }
.pt-bond-ok { color: #8fd0ff; }
.pt-hint { font-size: 11px; opacity: 0.65; margin-top: 3px; }
.pt-reset { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.pt-reset-confirm { color: #ffb0a0; border-color: #7a4036; background: #4a2620; }
.pt-reset-confirm:hover:not(:disabled) { background: #6a342a; }
.pt-note {
    margin-top: 10px; font-size: 11px; font-style: italic;
    opacity: 0.55; border-top: 1px solid #3a2e1e; padding-top: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   Staff Welcome / Code of Conduct (client/js/ui/staff_welcome.js)
   Full-screen modal; --ribbon-accent is set per-role on the card.
   ═══════════════════════════════════════════════════════════════ */
.staff-welcome-overlay {
    position: fixed; inset: 0;
    z-index: 100000;                 /* above the ribbon, windows, and HUD */
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background: rgba(6, 6, 10, 0.78);
    backdrop-filter: blur(6px);
}
.staff-welcome-card {
    --ribbon-accent: var(--gf-accent);
    display: flex; flex-direction: column;
    width: min(720px, 100%);
    max-height: min(86vh, 900px);
    background: var(--gf-panel-bg-strong);
    border: 1px solid color-mix(in srgb, var(--ribbon-accent) 55%, var(--gf-border));
    border-top: 3px solid var(--ribbon-accent);
    border-radius: var(--gf-radius, 10px);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6),
                0 0 26px color-mix(in srgb, var(--ribbon-accent) 22%, transparent);
    outline: none;
    overflow: hidden;
}
.staff-welcome-header {
    padding: 20px 26px 14px;
    border-bottom: 1px solid var(--gf-border);
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--ribbon-accent) 12%, transparent), transparent);
}
.staff-welcome-title {
    margin: 0; font-size: 22px; font-weight: 700;
    color: var(--gf-text-1);
    font-family: 'Cinzel', 'Times New Roman', serif;
}
.staff-welcome-subtitle {
    margin-top: 6px; font-size: 13px; color: var(--gf-text-2);
}
.staff-welcome-subtitle strong { color: var(--ribbon-accent); }
.staff-welcome-body {
    flex: 1; overflow-y: auto;
    padding: 18px 26px;
}
.staff-welcome-section { margin-top: 6px; }
.staff-welcome-section h2 {
    margin: 0 0 6px; font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--ribbon-accent);
}
.staff-welcome-brief { margin: 0 0 14px; }
.staff-welcome-brief h3 {
    margin: 0 0 2px; font-size: 15px; color: var(--gf-text-1);
}
.staff-welcome-coc {
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--gf-border);
}
.staff-welcome-prose { font-size: 13.5px; line-height: 1.55; color: var(--gf-text-1); }
.staff-welcome-prose p { margin: 0 0 8px; }
.staff-welcome-prose ol {
    margin: 4px 0 14px;
    padding-left: 2.3em;
}
.staff-welcome-prose li {
    padding-left: 0.25em;
}
.staff-welcome-prose li + li {
    margin-top: 9px;
}
.staff-welcome-prose strong { color: var(--gf-accent-hot, var(--gf-accent)); }
.staff-welcome-prose code {
    font-family: 'Consolas', monospace; font-size: 0.9em;
    padding: 1px 5px; border-radius: 4px;
    background: rgba(255, 255, 255, 0.08); color: var(--gf-text-1);
}
.staff-welcome-footer {
    padding: 14px 26px 18px;
    border-top: 1px solid var(--gf-border);
    background: var(--gf-panel-bg);
    display: flex; flex-direction: column; gap: 12px;
}
.staff-welcome-agree {
    display: flex; align-items: center; gap: 10px;
    font-size: 13.5px; color: var(--gf-text-1); cursor: pointer; user-select: none;
}
.staff-welcome-agree input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--ribbon-accent); }
.staff-welcome-buttons { display: flex; justify-content: flex-end; gap: 10px; }
.staff-welcome-btn {
    padding: 9px 20px; border-radius: 7px; cursor: pointer;
    font-size: 13.5px; font-weight: 600; border: 1px solid var(--gf-border);
    background: rgba(255, 255, 255, 0.06); color: var(--gf-text-1);
    transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.staff-welcome-btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.staff-welcome-btn-primary {
    border-color: var(--ribbon-accent);
    background: color-mix(in srgb, var(--ribbon-accent) 26%, transparent);
    color: #fff;
}
.staff-welcome-btn-primary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--ribbon-accent) 42%, transparent);
}
.staff-welcome-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Build Mode (in-world staff editor) - gold trim over glass ──────────────
   The .bm-* namespace styles the Build Mode window (icon toolbar + contextual
   panel + layers), the bottom coach bar, and the CSS-only delayed tooltips.
   Icons are game-icons.net masks via .gf-ic (see game_icons.js). */

.bm-body { display: flex; flex-direction: column; gap: 10px; padding: 10px; font-size: 12px; color: var(--gf-text-1); }
.bm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bm-count { color: var(--gf-text-3); font-size: 11px; }

/* Icon tool tiles - one per tool, hotkey badge in the corner. */
.bm-toolbar { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 6px; }
.bm-tool {
    position: relative; width: 44px; height: 44px; border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--gf-border-accent);
    color: var(--gf-accent);
    transition: background .12s, border-color .12s, box-shadow .12s, transform .08s;
}
.bm-tool:hover:not(:disabled) { background: rgba(240,192,96,0.14); transform: translateY(-1px); }
.bm-tool.active {
    background: rgba(240,192,96,0.22);
    border-color: #f0c060;
    box-shadow: 0 0 10px rgba(240,192,96,0.35), inset 0 0 6px rgba(240,192,96,0.18);
    color: #ffe9b8;
}
.bm-tool:disabled { opacity: .35; cursor: default; }
.bm-tool .gf-ic { width: 22px; height: 22px; }
.bm-key {
    position: absolute; right: 2px; bottom: 1px; font-size: 9px; line-height: 1;
    color: var(--gf-text-3); font-family: var(--gf-mono);
    background: rgba(0,0,0,0.55); border-radius: 3px; padding: 1px 3px; pointer-events: none;
}
.bm-tool.active .bm-key { color: #ffe9b8; }

/* Small labeled action buttons (Undo/Redo/Free Cam/Snap + form actions). */
.bm-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.bm-btn {
    background: rgba(20,16,12,0.8); border: 1px solid rgba(184,154,74,0.45);
    color: var(--gf-text-1); border-radius: 4px; padding: 4px 9px; font-size: 11px; cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.bm-btn:hover:not(:disabled) { background: rgba(240,192,96,0.14); }
.bm-btn.active { background: rgba(184,154,74,0.35); border-color: rgba(226,180,90,0.9); color: #fff0d0; }
.bm-btn.danger { border-color: rgba(255,90,90,0.6); color: #ff8a8a; }
.bm-btn.danger:hover:not(:disabled) { background: rgba(255,90,90,0.12); }
.bm-btn:disabled { opacity: .4; cursor: default; }
.bm-badge {
    display: inline-block; min-width: 14px; margin-left: 5px; padding: 0 4px; border-radius: 7px;
    background: rgba(240,192,96,0.25); color: #ffe9b8; font-size: 9px; font-family: var(--gf-mono);
}

.bm-section {
    font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    font-size: 10px; color: var(--gf-text-3);
    border-bottom: 1px solid rgba(184,154,74,0.3); padding-bottom: 3px;
    display: flex; align-items: center; gap: 6px;
}
.bm-section .gf-ic { width: 11px; height: 11px; }

/* Onboarding / hint card. */
.bm-card {
    border: 1px solid var(--gf-border-accent); border-radius: 6px; padding: 9px 10px;
    background: rgba(240,192,96,0.07); line-height: 1.55; font-size: 11.5px;
}
.bm-card b { color: #ffe9b8; }

.bm-form { display: flex; flex-direction: column; gap: 4px; }

/* Terrain op tiles - colored dot telegraphs the op's preview tint. */
.bm-ops { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.bm-op { position: relative; padding-left: 16px; text-align: left; }
.bm-op::before {
    content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--op-color, var(--gf-accent));
    box-shadow: 0 0 5px var(--op-color, var(--gf-accent));
}

/* Slider rows (brush radius / strength). */
.bm-slider-row { display: flex; align-items: center; gap: 8px; }
.bm-slider-row label { flex: 0 0 62px; color: var(--gf-text-3); font-size: 11px; }
.bm-slider-row input[type=range] { flex: 1; accent-color: #f0c060; height: 14px; cursor: pointer; min-width: 0; }
.bm-slider-val { flex: 0 0 26px; text-align: right; font-family: var(--gf-mono); color: #ffe9b8; font-size: 11px; }

/* World Builder pinned action bar - every world verb visible without scrolling. */
.bm-worldbar {
    position: sticky; top: 0; z-index: 4;
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 7px 0 6px;
    background: rgba(16,12,9,0.97);
    border-bottom: 1px solid rgba(184,154,74,0.3);
}

/* World Builder two-pane layout: a STICKY preview/dashboard aside that stays
   put while the form column scrolls - so you always see the map while tuning.
   `.two` (side-by-side) is toggled by JS when the window is wide enough;
   otherwise it collapses to one column with the preview pinned as a header. */
.bm-world-layout { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: start; }
.bm-world-layout.two { grid-template-columns: minmax(220px, 42%) 1fr; }
.bm-world-aside {
    position: sticky; top: 0; z-index: 3; align-self: start;
    display: flex; flex-direction: column; gap: 5px;
    background: rgba(16,12,9,0.97); padding-bottom: 6px;
}
.bm-world-layout:not(.two) .bm-world-aside {
    border-bottom: 1px solid rgba(184,154,74,0.28); margin-bottom: 2px;
}
/* Keep the pinned preview compact in single-column mode so it doesn't eat the
   whole scroll area. */
.bm-world-layout:not(.two) .bm-preview-host { max-width: 320px; margin: 0 auto; width: 100%; }
.bm-world-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
/* The action bar lives inside the already-sticky aside now - drop its own
   sticky/background so it doesn't double up. */
.bm-world-aside .bm-worldbar {
    position: static; background: transparent; border-bottom: none;
    padding-top: 2px; z-index: auto;
}

/* World Builder gen-param form (grouped sliders / chips / preset cards). */
.bm-genrow { display: flex; align-items: center; gap: 7px; }
.bm-genrow > .bm-genlabel {
    flex: 0 0 118px; color: var(--gf-text-3); font-size: 11px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bm-genrow input[type=range] { flex: 1; accent-color: #f0c060; height: 14px; cursor: pointer; min-width: 0; }
.bm-genrow input[type=number] {
    flex: 0 0 52px; width: 52px; background: rgba(10,8,6,0.85);
    border: 1px solid rgba(184,154,74,0.4); color: #e8dcc2; border-radius: 3px;
    padding: 1px 4px; font-size: 11px; font-family: var(--gf-mono);
}
.bm-help {
    display: inline-block; margin-left: 4px; opacity: 0.45; cursor: help;
    font-size: 9px; border: 1px solid currentColor; border-radius: 50%;
    width: 11px; height: 11px; line-height: 11px; text-align: center; flex: 0 0 auto;
}
.bm-gensec { margin: 1px 0; border-left: 2px solid rgba(184,154,74,0.18); padding-left: 7px; }
.bm-gensec > summary {
    cursor: pointer; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    font-size: 10px; color: var(--gf-text-3); padding: 3px 0; user-select: none;
}
.bm-gensec[open] > summary { color: #ffe9b8; }
.bm-gensec > .bm-gensec-body { display: flex; flex-direction: column; gap: 4px; padding: 2px 0 5px; }
.bm-chiprow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.bm-chip {
    background: rgba(20,16,12,0.8); border: 1px solid rgba(184,154,74,0.35);
    color: var(--gf-text-2); border-radius: 10px; padding: 2px 9px; font-size: 10.5px;
    cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.bm-chip:hover { background: rgba(240,192,96,0.14); }
.bm-chip.active { background: rgba(184,154,74,0.35); border-color: rgba(226,180,90,0.9); color: #fff0d0; }
.bm-preset-bar { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 5px; }
.bm-preset-card {
    flex: 0 0 auto; width: 76px; cursor: pointer; text-align: center;
    border: 1px solid rgba(184,154,74,0.3); border-radius: 6px; padding: 4px;
    background: rgba(14,11,8,0.65); transition: border-color .12s, background .12s;
}
.bm-preset-card:hover { background: rgba(240,192,96,0.1); }
.bm-preset-card.active { border-color: rgba(226,180,90,0.95); background: rgba(184,154,74,0.22); }
.bm-preset-card .bm-preset-name {
    display: block; margin-top: 3px; font-size: 9.5px; color: var(--gf-text-2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bm-hint {
    display: inline-block; margin: 2px 4px 0 0; padding: 2px 8px; border-radius: 9px;
    background: rgba(226,180,90,0.14); border: 1px solid rgba(226,180,90,0.45);
    color: #ffd98a; font-size: 10px; line-height: 1.4;
}
.bm-sketch {
    width: 192px; height: 192px; cursor: crosshair; touch-action: none;
    border: 1px solid rgba(184,154,74,0.45); border-radius: 5px;
    image-rendering: pixelated; align-self: center;
}

/* World Builder terrain preview overlays (WorldPreview component). */
.bm-pv-shimmer {
    position: absolute; left: 0; right: 0; top: 0; height: 3px;
    overflow: hidden; pointer-events: none; border-radius: 4px 4px 0 0;
}
.bm-pv-shimmer::after {
    content: ''; position: absolute; inset: 0; width: 45%;
    background: linear-gradient(90deg, transparent,
        rgba(240,192,96,0.85), transparent);
    animation: bm-pv-sweep 1.1s linear infinite;
}
@keyframes bm-pv-sweep {
    from { transform: translateX(-110%); }
    to   { transform: translateX(320%); }
}
.bm-pv-badge {
    position: absolute; right: 5px; bottom: 5px; pointer-events: none;
    padding: 0 6px; border-radius: 8px; font-size: 8.5px; letter-spacing: .08em;
    text-transform: uppercase; color: #ffd98a; background: rgba(14,11,8,0.75);
    border: 1px solid rgba(226,180,90,0.4);
}
.bm-pv-scale {
    position: absolute; left: 7px; bottom: 6px; pointer-events: none;
    font-size: 9px; color: #f0e6d0; text-shadow: 0 1px 2px #000;
    border-bottom: 2px solid rgba(240,230,208,0.9); padding-bottom: 1px;
    border-left: 1px solid rgba(240,230,208,0.9);
    border-right: 1px solid rgba(240,230,208,0.9);
    text-align: center; line-height: 1.2; min-width: 24px;
}
.bm-pv-toolbar {
    position: absolute; top: 4px; right: 4px; display: flex; gap: 4px;
}
.bm-pv-toolbtn {
    width: 22px; height: 22px; padding: 0; cursor: pointer;
    background: rgba(16,12,9,0.82); border: 1px solid rgba(184,154,74,0.45);
    color: #e8dcc2; border-radius: 4px; font-size: 12px; line-height: 20px;
    transition: background .12s, border-color .12s;
}
.bm-pv-toolbtn:hover { background: rgba(240,192,96,0.18); border-color: rgba(226,180,90,0.9); }

/* Candidate gallery (World Builder "Explore"): 12 tiles, pin + adopt. */
.bm-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.bm-gallery-tile {
    position: relative; cursor: pointer; border-radius: 5px; padding: 2px;
    border: 1px solid rgba(184,154,74,0.25);
    transition: border-color .12s, box-shadow .12s;
}
.bm-gallery-tile:hover { border-color: rgba(226,180,90,0.75); }
.bm-gallery-tile.pinned {
    border-color: rgba(255,209,102,0.95);
    box-shadow: 0 0 7px rgba(255,209,102,0.35);
}
.bm-gallery-tile.adopted { border-color: rgba(57,217,138,0.9); }
.bm-tile-tools {
    position: absolute; top: 3px; right: 3px; display: none; gap: 3px; z-index: 3;
}
.bm-gallery-tile:hover .bm-tile-tools,
.bm-gallery-tile.pinned .bm-tile-tools { display: flex; }
.bm-tile-tools button {
    width: 20px; height: 20px; padding: 0; cursor: pointer; font-size: 10px;
    background: rgba(16,12,9,0.85); border: 1px solid rgba(184,154,74,0.5);
    color: #e8dcc2; border-radius: 4px; line-height: 18px;
}
.bm-tile-tools button:hover { background: rgba(240,192,96,0.2); }
.bm-tile-cap {
    margin-top: 1px; font-size: 9px; opacity: 0.55; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Terrain material swatch grid. */
.bm-swatches { display: grid; grid-template-columns: repeat(auto-fill, 30px); gap: 5px; }
.bm-swatch {
    width: 30px; height: 30px; border-radius: 5px; cursor: pointer;
    border: 1px solid rgba(184,154,74,0.4);
    transition: box-shadow .1s, transform .08s, border-color .1s;
}
.bm-swatch:hover { transform: translateY(-1px); }
.bm-swatch.active { border-color: #ffe9b8; box-shadow: 0 0 8px rgba(240,192,96,0.5); }

/* Segmented toggle (brush shape). */
.bm-seg { display: flex; border: 1px solid rgba(184,154,74,0.45); border-radius: 4px; overflow: hidden; width: max-content; }
.bm-seg .bm-btn { border: none; border-radius: 0; }
.bm-seg .bm-btn + .bm-btn { border-left: 1px solid rgba(184,154,74,0.35); }

/* Layer visibility rows. */
.bm-layer { display: flex; align-items: center; gap: 7px; font-size: 11.5px; cursor: pointer; color: var(--gf-text-1); }
.bm-layer input { accent-color: #f0c060; cursor: pointer; }

/* Coach bar - the persistent "what will my next click do" pill. */
#bm-coach {
    position: fixed; top: 54px; left: 50%; transform: translateX(-50%);
    z-index: 64; pointer-events: none; white-space: nowrap;
    padding: 6px 16px; border-radius: 16px;
    background: rgba(10,8,6,0.78);
    border: 1px solid var(--gf-border-accent);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5), inset 0 0 12px rgba(240,192,96,0.06);
    color: #f0c060; font-size: 12px; font-family: var(--gf-mono);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
#bm-coach .bm-coach-key {
    display: inline-block; padding: 0 5px; margin: 0 2px; border-radius: 3px;
    background: rgba(240,192,96,0.18); border: 1px solid rgba(240,192,96,0.35);
    color: #ffe9b8; font-size: 10px;
}
#bm-coach.warn { color: #ff8a8a; border-color: rgba(255,90,90,0.5); }

/* Build Mode control tooltips are rendered through the body-level .gf-tooltip
   (see BuildMode._wireTips). A CSS ::after tip is clipped by the window's
   overflow:auto content box - the body-appended element floats free and stays
   legible. */

/* ── Mobile & Touch Controls Overlay ── */
.mobile-controls-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 4; /* Stacks above the canvas (0) but below hotbars (5), HUD (10), and game windows (1000+) */
    display: none;
}

body.mobile-controls-active .mobile-controls-overlay {
    display: block;
}

/* Hide desktop floating help/submit buttons when mobile controls overlay is active */
body.mobile-controls-active #gf-help-btn,
body.mobile-controls-active #gf-submit-btn {
    display: none !important;
}

.mobile-move-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 45vw;
    z-index: 1;
    pointer-events: auto;
    touch-action: none;
}

.mobile-swipe-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 55vw;
    z-index: 1;
    pointer-events: auto;
    touch-action: none;
}

.mobile-joystick-container {
    position: absolute;
    bottom: 50px;
    left: 50px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2;
    touch-action: none;
    pointer-events: none;
    opacity: 0.5;
    transform: scale(0.95);
    transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-joystick-container.active {
    opacity: 0.95;
    border-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.05);
}

.mobile-joystick-thumb {
    position: absolute;
    left: 35px;
    top: 35px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(200, 200, 200, 0.9) 100%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

/* Arc Layout for Action Buttons in the bottom-right corner */
.mobile-action-buttons {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 280px;
    height: 280px;
    z-index: 2;
    pointer-events: none;
}

.mobile-btn {
    position: absolute;
    pointer-events: auto;
    border-radius: 50%;
    background: rgba(18, 16, 14, 0.7);
    border: 2px solid rgba(200, 170, 120, 0.5);
    color: #ffd99e;
    font-family: var(--gf-mono), monospace;
    font-weight: bold;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6), inset 0 2px 5px rgba(255, 255, 255, 0.1);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition: transform 0.08s, background-color 0.08s, border-color 0.08s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.mobile-btn:active {
    transform: scale(0.9);
    background-color: rgba(200, 170, 120, 0.25);
    border-color: rgba(255, 217, 158, 0.85);
    color: #fff;
}

/* Individual button sizes, positions, and styling forming an arc */
.mobile-btn-jump {
    bottom: 10px;
    right: 10px;
    width: 68px;
    height: 68px;
    font-size: 11px;
    background: rgba(90, 50, 160, 0.7);
    border-color: rgba(150, 110, 220, 0.65);
    color: #e2d2ff;
}
.mobile-btn-jump:active {
    background-color: rgba(120, 80, 200, 0.85);
    border-color: rgba(180, 140, 255, 0.95);
}

.mobile-btn-war {
    bottom: 90px;
    right: 90px;
    width: 52px;
    height: 52px;
    font-size: 9px;
    background: rgba(160, 40, 40, 0.7);
    border-color: rgba(220, 90, 90, 0.65);
    color: #ffd2d2;
}
.mobile-btn-war:active {
    background-color: rgba(200, 60, 60, 0.85);
    border-color: rgba(255, 120, 120, 0.95);
}

.mobile-btn-target {
    bottom: 155px;
    right: 85px;
    width: 50px;
    height: 50px;
    font-size: 9px;
}

.mobile-btn-gather {
    bottom: 85px;
    right: 155px;
    width: 50px;
    height: 50px;
    font-size: 9px;
}

.mobile-btn-sprint {
    bottom: 160px;
    right: 160px;
    width: 48px;
    height: 48px;
    font-size: 8px;
    background: rgba(25, 95, 50, 0.75);
    border-color: rgba(90, 220, 130, 0.55);
    color: #c5ffc5;
}
.mobile-btn-sprint.active {
    background: rgba(0, 150, 65, 0.85);
    border-color: rgba(0, 255, 120, 0.85);
    color: #fff;
    box-shadow: 0 0 14px rgba(0, 255, 120, 0.55), inset 0 2px 5px rgba(255, 255, 255, 0.25);
}

.mobile-btn-bag {
    bottom: 220px;
    right: 20px;
    width: 46px;
    height: 46px;
    font-size: 8px;
}

.mobile-btn-menu {
    bottom: 20px;
    right: 220px;
    width: 46px;
    height: 46px;
    font-size: 8px;
}

/* Make HUD panels scale better on mobile devices */
body.mobile-controls-active #hud-info {
    transform: scale(0.9);
    transform-origin: top right;
}
body.mobile-controls-active #chat-area {
    max-width: 90vw;
    width: 300px !important;
    height: 140px !important;
    font-size: 11px;
}

/* Responsive Scaling for Draggable Game Windows on Mobile */
body.mobile-controls-active .game-window {
    transform: scale(0.8);
    transform-origin: top left;
    max-width: 90vw;
}

/* Touch-friendly larger Close Buttons on mobile */
body.mobile-controls-active .game-window-close {
    font-size: 22px;
    padding: 4px 10px;
    margin-right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* ── Animal Lore window (lore_window.js) ── */
.lore-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #e8dcc0;
    font-family: 'Cinzel', 'Times New Roman', serif;
    background: rgba(20, 16, 12, 0.95);
}
.lore-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 0 10px;
}
.lore-section {
    padding: 4px 0;
}
.lore-section-title {
    padding: 6px 12px 2px;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #c8a45c;
    border-bottom: 1px solid rgba(160, 120, 60, 0.25);
    margin-bottom: 2px;
}
.lore-section-title:empty {
    display: none;
}
.lore-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 12px;
    font-size: 12px;
}
.lore-label {
    flex: 0 0 44%;
    color: #b09468;
}
.lore-value {
    flex: 1 1 auto;
    color: #e8dcc0;
}
.lore-locked {
    color: #7d6a4d;
    font-style: italic;
}
.lore-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ── Friends panel (Phase 12 P1) ── */
.friends-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #e8dcc0;
    font-family: 'Cinzel', 'Times New Roman', serif;
    background: rgba(20, 16, 12, 0.95);
}
.friends-add {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(160, 120, 60, 0.25);
}
.friends-add-input {
    flex: 1 1 auto;
    min-width: 0;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(160, 120, 60, 0.4);
    color: #e8dcc0;
    font-family: inherit;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 3px;
}
.friends-add-input:focus { outline: none; border-color: #c8a45c; }
.friends-btn {
    background: rgba(120, 90, 40, 0.35);
    border: 1px solid rgba(160, 120, 60, 0.5);
    color: #e8dcc0;
    font-family: inherit;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
}
.friends-btn:hover { background: rgba(160, 120, 60, 0.5); }
.friends-accept { color: #a8e6a0; border-color: rgba(120, 200, 110, 0.5); }
.friends-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0 10px;
}
.friends-section { padding: 2px 0 4px; }
.friends-section-title {
    padding: 6px 12px 2px;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #c8a45c;
    border-bottom: 1px solid rgba(160, 120, 60, 0.25);
    margin-bottom: 2px;
}
.friends-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    font-size: 12px;
}
.friends-row-pending { opacity: 0.9; }
.friends-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 4px currentColor;
}
.friends-dot.is-online { background: #66dd77; color: #66dd77; }
.friends-dot.is-offline { background: #6a5c48; color: transparent; box-shadow: none; }
.friends-name {
    flex: 1 1 auto;
    color: #e8dcc0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.friends-meta {
    flex: 0 0 auto;
    color: #b09468;
    font-size: 11px;
}
.friends-row-btn { padding: 2px 7px; font-size: 10px; }
.friends-empty {
    padding: 8px 14px;
    color: #7d6a4d;
    font-style: italic;
    font-size: 11px;
    line-height: 1.4;
}

/* ── Trade window (Phase 12 P3) - two offer columns + gold + confirm ── */
.trade-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #e8dcc0;
    font-family: 'Cinzel', 'Times New Roman', serif;
    background: rgba(20, 16, 12, 0.95);
}
.trade-cols {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 1px;
    background: rgba(160, 120, 60, 0.25);
}
.trade-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: rgba(20, 16, 12, 0.95);
}
.trade-col-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(160, 120, 60, 0.25);
}
.trade-col-name {
    color: #c8a45c;
    font-size: 12px;
    letter-spacing: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.trade-col-check { font-size: 10px; color: #8a7a58; }
.trade-col-check.is-ok { color: #7ad67f; }
.trade-items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0;
}
.trade-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 12px;
}
.trade-item-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.trade-item-qty { flex: 0 0 auto; color: #b09468; font-size: 11px; }
.trade-item-remove {
    flex: 0 0 auto;
    background: none;
    border: none;
    color: #c8785c;
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
}
.trade-item-remove:hover { color: #ff8a6a; }
.trade-empty {
    padding: 8px 12px;
    color: #7d6a4d;
    font-style: italic;
    font-size: 11px;
}
.trade-gold {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-top: 1px solid rgba(160, 120, 60, 0.25);
    font-size: 12px;
    color: #e6c86a;
}
.trade-gold-input {
    width: 90px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(160, 120, 60, 0.4);
    color: #e6c86a;
    font-family: inherit;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
}
.trade-gold-input:focus { outline: none; border-color: #c8a45c; }
.trade-gold-val { color: #e6c86a; }
.trade-hint {
    padding: 5px 12px;
    font-size: 10px;
    font-style: italic;
    color: #7d6a4d;
    text-align: center;
}
.trade-foot {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid rgba(160, 120, 60, 0.25);
}
.trade-btn {
    flex: 1;
    background: rgba(120, 90, 40, 0.35);
    border: 1px solid rgba(160, 120, 60, 0.5);
    color: #e8dcc0;
    font-family: inherit;
    font-size: 12px;
    padding: 5px 9px;
    border-radius: 3px;
    cursor: pointer;
}
.trade-btn:hover { background: rgba(160, 120, 60, 0.5); }
.trade-confirm.is-on {
    background: rgba(90, 150, 80, 0.5);
    border-color: rgba(120, 200, 110, 0.6);
    color: #b6f0ad;
}
.trade-cancel { color: #e6b09a; }

/* Secure storage chest window (Phase 12 P5b) - a slot grid of the chest's
   contents; double-click a slot to withdraw, double-click a bag item to store. */
.container-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #e8dcc0;
    font-family: 'Cinzel', 'Times New Roman', serif;
    background: rgba(20, 16, 12, 0.95);
}
.container-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 4px;
    padding: 8px;
    align-content: start;
}
.container-slot {
    position: relative;
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px;
    border: 1px solid rgba(160, 120, 60, 0.25);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.25);
}
.container-slot.is-filled {
    border-color: rgba(160, 120, 60, 0.5);
    background: rgba(40, 30, 18, 0.6);
    cursor: pointer;
}
.container-slot.is-filled:hover { background: rgba(70, 52, 28, 0.7); }
.container-slot-swatch {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    background: rgba(150, 120, 70, 0.6);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.container-slot-name {
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
    color: #d8c69a;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.container-slot-qty {
    position: absolute;
    right: 3px;
    bottom: 2px;
    font-size: 10px;
    color: #e6c86a;
    text-shadow: 0 0 3px #000;
}
.container-hint {
    padding: 5px 12px;
    font-size: 10px;
    font-style: italic;
    color: #7d6a4d;
    text-align: center;
    border-top: 1px solid rgba(160, 120, 60, 0.25);
}

/* Guild crafting station - the Cauldron window (GUILD_PROGRESSION Pass 4b). */
.gstation-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    overflow-y: auto;
    color: #e8dcc0;
    font-family: 'Cinzel', 'Times New Roman', serif;
    background: rgba(20, 16, 12, 0.95);
    box-sizing: border-box;
}
.gstation-recipe-row { display: flex; }
.gstation-recipe-select {
    flex: 1;
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.35);
    color: #e8dcc0;
    border: 1px solid rgba(160, 120, 60, 0.4);
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
}
.gstation-recipe-name { font-size: 14px; color: #e6c86a; }
.gstation-ingredients { font-size: 10px; color: #9e8a68; line-height: 1.3; }
.gstation-status { font-size: 11px; font-style: italic; color: #b8a680; }
.gstation-status.status-producing { color: #8fd08f; }
.gstation-status.status-no_upkeep,
.gstation-status.status-output_full { color: #d0925a; }
.gstation-status.status-needs_reagents { color: #c8b46a; }
.gstation-progress {
    height: 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(160, 120, 60, 0.3);
    overflow: hidden;
}
.gstation-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7a4a1f, #e6c86a);
    transition: width 0.4s ease;
}
.gstation-section-label {
    margin-top: 4px;
    font-size: 11px;
    color: #d8c69a;
    border-bottom: 1px solid rgba(160, 120, 60, 0.25);
    padding-bottom: 2px;
}
.gstation-list { display: flex; flex-direction: column; gap: 2px; }
.gstation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #d8c69a;
    padding: 2px 4px;
}
.gstation-item-out { background: rgba(40, 30, 18, 0.5); border-radius: 3px; }
.gstation-empty { font-size: 10px; font-style: italic; color: #7d6a4d; padding: 2px 4px; }
.gstation-btn {
    padding: 3px 10px;
    background: rgba(70, 52, 28, 0.7);
    color: #e8dcc0;
    border: 1px solid rgba(160, 120, 60, 0.5);
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
}
.gstation-btn:hover { background: rgba(100, 74, 40, 0.8); }
.gstation-toggle { margin-top: 6px; align-self: flex-start; }

/* Genetic trait rarity chips (Animal Lore + Pet Training) - tier derives from
   the trait's rarity_weight server-side (breeding.trait_display). */
.gf-trait-chip {
    display: inline-block;
    padding: 1px 7px;
    margin: 1px 2px 1px 0;
    border-radius: 9px;
    border: 1px solid rgba(176, 148, 104, 0.45);
    background: rgba(30, 26, 20, 0.6);
    color: #e8dcc0;
    font-size: 11px;
    line-height: 16px;
    white-space: nowrap;
}
.gf-trait-chip.tier-rare {
    border-color: rgba(106, 163, 224, 0.75);
    color: #a8ccf2;
}
.gf-trait-chip.tier-super_rare {
    border-color: rgba(176, 96, 255, 0.8);
    color: #d0a8ff;
}
.gf-trait-chip.tier-ultra_rare {
    border-color: rgba(245, 197, 66, 0.9);
    color: #f5c542;
    background: rgba(60, 44, 12, 0.65);
    box-shadow: 0 0 6px rgba(245, 197, 66, 0.35);
}

/* ── Universal Ship Controls ────────────────────────────────────────────────
   A compact captain's console used by every vessel. The GameWindow titlebar
   supplies drag/focus behavior; the body owns helm, telegraph, integrity, and
   optional gunnery controls. Per-character position/scale/collapse persistence
   is handled by BoatManager. */
.ship-controls-window {
    min-width: 290px;
    min-height: 0;
    overflow: hidden;
}
.ship-controls-window .game-window-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ship-controls-window .game-window-content { overflow: hidden; }
.ship-controls-window.ship-controls-collapsed {
    min-height: 0 !important;
    height: auto !important;
}
.ship-title-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 1px;
    margin-left: 8px;
}
.ship-title-actions [data-panel-scale-label] {
    min-width: 38px;
    font: 9px/1 var(--gf-mono, monospace);
}
.gf-ship-controls {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 9px;
    color: var(--gf-text-2, #d8cbb6);
    font: 11px/1.25 system-ui, sans-serif;
    user-select: none;
    background:
        radial-gradient(circle at 50% -20%, rgba(184,154,74,.13), transparent 55%),
        rgba(11, 12, 15, .70);
}
.ship-status-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}
.ship-status-row > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
    padding: 5px 3px;
    border: 1px solid rgba(184,154,74,.25);
    border-radius: 5px;
    background: rgba(255,255,255,.025);
}
.ship-status-row strong {
    max-width: 100%;
    overflow: hidden;
    color: var(--gf-text-1, #f4ecd8);
    font: 700 11px/1.1 var(--gf-mono, monospace);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ship-status-label {
    color: var(--gf-text-3, #948d80);
    font: 8px/1 var(--gf-mono, monospace);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.ship-state-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px;
    color: var(--gf-text-3, #948d80);
    font-size: 10px;
}
.ship-state-line [data-ship-state] { color: var(--gf-accent, #e2b85b); }
.ship-control-section {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 9px 7px 7px;
    border: 1px solid rgba(184,154,74,.28);
    border-radius: 6px;
    background: rgba(7,8,11,.38);
}
.ship-section-title {
    position: absolute;
    top: -6px;
    left: 8px;
    padding: 0 5px;
    color: rgba(216,203,182,.72);
    background: #111217;
    font: 8px/1.2 var(--gf-mono, monospace);
    letter-spacing: .12em;
    text-transform: uppercase;
}
.ship-fine-controls,
.ship-course-controls {
    display: grid;
    grid-template-columns: 1fr .72fr 1fr;
    gap: 4px;
}
.ship-telegraph {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    margin-top: 1px;
}
.ship-control-btn {
    min-width: 0;
    min-height: 34px;
    padding: 4px 5px;
    border: 1px solid rgba(184,154,74,.42);
    border-radius: 5px;
    color: var(--gf-text-2, #d8cbb6);
    background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
    font: 600 10px/1.2 system-ui, sans-serif;
    cursor: pointer;
    touch-action: none;
    transition: border-color .12s, background .12s, color .12s, transform .08s;
}
.ship-control-btn:hover:not(:disabled) {
    border-color: rgba(226,184,91,.78);
    color: var(--gf-text-1, #f4ecd8);
    background: rgba(184,154,74,.12);
}
.ship-control-btn:active:not(:disabled),
.ship-control-btn.active {
    transform: translateY(1px);
    border-color: var(--gf-accent, #e2b85b);
    color: #fff4d6;
    background: rgba(184,154,74,.24);
    box-shadow: inset 0 0 9px rgba(226,184,91,.13);
}
.ship-control-btn:disabled { opacity: .38; cursor: not-allowed; }
.ship-steady { color: #b9c8d9; }
.ship-turnaround { color: #e7c879; }
.ship-stop {
    color: #f1c8bd;
    border-color: rgba(193,88,65,.55);
    background: rgba(128,43,29,.14);
}
.ship-integrity {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ship-integrity-item {
    flex: 1 1 0;
    min-width: 0;
    color: var(--gf-text-3, #948d80);
    font-size: 9px;
    text-align: center;
}
.ship-integrity-track {
    height: 5px;
    margin-top: 3px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255,255,255,.10);
}
.ship-integrity-track > div { height: 100%; transition: width .2s; }
.ship-ward { flex: 0 0 38px; color: #66e0ff; }
.ship-ward strong { display: block; margin-top: 1px; }
.ship-ammo,
.ship-fire {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}
.ship-fire { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ship-ammo .ship-control-btn { min-height: 30px; }
.ship-control-help {
    padding: 0 4px 1px;
    color: var(--gf-text-3, #948d80);
    font-size: 9px;
    line-height: 1.35;
    text-align: center;
}
@media (pointer: coarse) {
    .ship-control-btn { min-height: 40px; }
    .ship-title-actions .game-window-titlebar-btn { min-width: 28px; min-height: 26px; }
}

/* ── Global HUD scale (A1) ─────────────────────────────────────────────
   One knob (`--gf-ui-scale`, from the `uiScale` account pref) shrinks/grows
   the whole HUD as if the browser were zoomed, but only over the UI layer —
   the 3D canvas stays full-resolution. `zoom` (not transform:scale) keeps text
   crisp and hit-areas correct. Only top-level, body-appended HUD roots are
   listed so nothing double-scales. The hotbar is intentionally excluded - it
   scales through the --gf-slot token cascade instead (see :root above). */
.game-window,
#hud-info,
#paperdoll,
.staff-ribbon-root {
    zoom: var(--gf-ui-scale, 1);
}

/* ── "You have entered <Town>" banner (Building Content B6) ──────────────────
   A center-top plate the HUD raises when a player crosses into a named
   settlement (server `settlement_entered`), then fades out. pointer-events:none
   so it never eats clicks; below modal dialogs but above the ambient HUD. */
.gf-settlement-banner {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translate(-50%, -8px);
    z-index: 9500;
    pointer-events: none;
    text-align: center;
    padding: 10px 32px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(14,14,20,0.86), rgba(14,14,20,0.64));
    border: 1px solid var(--gf-border-accent);
    box-shadow: 0 6px 26px rgba(0,0,0,0.55), inset 0 0 22px rgba(240,192,96,0.06);
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.gf-settlement-banner.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
.gf-settlement-banner .gf-sb-kicker {
    font: 500 11px/1.2 system-ui, sans-serif;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gf-text-1);
    opacity: 0.6;
    margin-bottom: 3px;
}
.gf-settlement-banner .gf-sb-name {
    font: 600 27px/1.15 Georgia, 'Times New Roman', serif;
    color: var(--gf-accent);
    text-shadow: 0 1px 2px rgba(0,0,0,0.7), 0 0 16px rgba(240,192,96,0.22);
}
/* A landmark reads in the cool Grid accent instead of town gold (matches the map). */
.gf-settlement-banner[data-kind="landmark"] { border-color: rgba(102,224,255,0.42); }
.gf-settlement-banner[data-kind="landmark"] .gf-sb-name {
    color: #8fe3ff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7), 0 0 16px rgba(102,224,255,0.26);
}

/* ── Drag-box multi-select (dragSelectHealthBars) ──
   The rubber-band rectangle drawn while dragging a selection box over the world.
   Grid-cyan (the one cool accent) over a faint fill; pointer-events:none so it
   never eats the drag. Created/positioned/removed imperatively in main.js. */
.gf-marquee {
    position: fixed;
    z-index: 9000;
    pointer-events: none;
    border: 1px solid rgba(102,224,255,0.9);
    background: rgba(102,224,255,0.12);
    box-shadow: 0 0 10px rgba(102,224,255,0.25), inset 0 0 12px rgba(102,224,255,0.08);
    border-radius: 2px;
}
