:root {
    --bg-dark: rgba(15, 23, 42, 0.88);
    --bg-panel: rgba(30, 41, 59, 0.94);
    --border-subtle: rgba(148, 163, 184, 0.24);
    --accent-gold: #facc15;
    --accent-green: #4ade80;
    --accent-blue: #38bdf8;
    --accent-purple: #c084fc;
    --accent-red: #f87171;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

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

button > * {
    pointer-events: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #090d16;
    color: var(--text-main);
}

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

/* Soft lens vignette: frames the stage and lifts HUD contrast at the screen edges (docs/DESIGN_SYSTEM.md §2) */
#canvas-container::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 55%, transparent 55%, rgba(2, 6, 23, 0.45) 100%);
}

/* 3D World Projected Overlays */
#world-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.monster-plate {
    position: absolute;
    transform: translate(-50%, -100%);
    text-align: center;
    min-width: 78px;
}

.monster-plate .m-name {
    font-size: 11px;
    font-weight: 700;
    color: #e2e8f0;
    text-shadow: 0 1px 3px #000, 0 0 6px #000;
    margin-bottom: 2px;
}

.monster-plate .m-hp-bg {
    width: 68px;
    height: 7px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    overflow: hidden;
}

.monster-plate .m-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316);
    transition: width 0.12s ease-out;
}

.monster-plate.boss-plate .m-name {
    font-size: 13px;
    font-weight: 900;
    color: #fef08a;
    text-shadow: 0 2px 4px #000, 0 0 8px #ca8a04;
}

.monster-plate.boss-plate .m-hp-bg {
    width: 118px;
    height: 10px;
    border-color: #facc15;
}

.monster-plate.boss-plate .m-hp-fill {
    background: linear-gradient(90deg, #dc2626, #facc15);
}

.structure-label {
    position: absolute;
    transform: translate(-50%, -100%);
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.structure-label.unlocked {
    background: rgba(22, 101, 52, 0.9);
    border: 1px solid #4ade80;
    color: #dcfce7;
}

.structure-label.blueprint {
    background: rgba(161, 98, 7, 0.92);
    border: 1px solid #facc15;
    color: #fef08a;
    animation: pulseGlow 1.6s infinite;
}

.structure-label.locked {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #cbd5e1;
}

/* Floating Combat & Loot Text */
.floating-text {
    position: absolute;
    transform: translate(-50%, -50%);
    font-weight: 800;
    font-size: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
    white-space: nowrap;
    pointer-events: none;
}

.floating-text.damage {
    color: #ffffff;
}

.floating-text.crit {
    color: #facc15;
    font-size: 19px;
}

.floating-text.enemy-hit {
    color: #f87171;
    font-size: 13px;
}

.floating-text.xp {
    color: #38bdf8;
    font-size: 13px;
}

.floating-text.coin {
    color: #fde047;
    font-size: 14px;
}

.floating-text.loot {
    color: #4ade80;
    font-size: 14px;
}

.floating-text.levelup {
    color: #facc15;
    font-size: 22px;
    letter-spacing: 0.5px;
}

/* Top HUD */
#top-hud {
    position: fixed;
    top: 14px;
    left: 16px;
    right: 16px;
    z-index: 15;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    pointer-events: none;
}

.hud-card {
    pointer-events: auto;
    background: var(--bg-dark);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Fixed size so the ◀ ▶ buttons stay put while clicking through stages: every line is one row and truncates */
.zone-panel {
    width: min(340px, calc(100vw - 32px));
    flex-shrink: 0;
}

.zone-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.zone-titles {
    flex: 1;
    min-width: 0;
    text-align: center;
}

#zone-title,
#zone-subtitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#zone-title {
    font-size: 16px;
    font-weight: 800;
    color: #f8fafc;
}

#zone-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-zone-nav {
    background: rgba(51, 65, 85, 0.9);
    border: 1px solid var(--border-subtle);
    color: #f8fafc;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    transition: all 0.15s;
}

.btn-zone-nav:hover:not(:disabled) {
    background: #475569;
    transform: scale(1.06);
}

.btn-zone-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-zone-nav.pulse-ready {
    background: #7e22ce;
    border-color: #c084fc;
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(192, 132, 252, 0.6); }
    50% { box-shadow: 0 0 12px 4px rgba(192, 132, 252, 0.75); }
}

.quota-progress-bar {
    position: relative;
    height: 20px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}

#quota-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
    transition: width 0.2s ease-out;
}

#quota-bar-text {
    position: absolute;
    inset: 0;
    padding: 0 10px;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    font-weight: 700;
    text-shadow: 0 1px 2px #000;
}

#zone-unlock-status {
    height: 15px;
    line-height: 15px;
    text-align: center;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

#zone-unlock-status > * {
    pointer-events: none;
}

.unlocked-pill {
    color: var(--accent-green);
    font-weight: 700;
}

.blueprint-ready-pill {
    color: var(--accent-gold);
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
}

.locked-pill {
    color: #cbd5e1;
}

.hud-right-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.resource-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    background: rgba(15, 23, 42, 0.75);
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.passive-tickers-row {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.mini-skill-pill {
    background: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
}

.mini-progress {
    width: 44px;
    height: 6px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 4px;
    overflow: hidden;
}

.mini-progress > div {
    height: 100%;
    background: var(--accent-green);
}

/* Phones: the zone panel takes the full width, so the resource bar and tickers stack under it and wrap
   (side by side they were pushed off the right edge) */
@media (max-width: 720px) {
    #top-hud {
        top: 8px;
        left: 8px;
        right: 8px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .zone-panel {
        width: auto;
    }

    .hud-right-stack {
        align-items: stretch;
        gap: 6px;
    }

    .resource-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 6px 8px;
    }

    .stat-pill {
        font-size: 12px;
        padding: 4px 8px;
    }

    .passive-tickers-row {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .mini-skill-pill {
        padding: 3px 8px;
        gap: 5px;
        font-size: 10px;
    }

    .mini-progress {
        width: 28px;
    }
}

/* Bottom Dock */
/* Centered with left/right 0 + auto margins (not left:50%, which capped the dock at half the screen and
   stacked the buttons into 3 rows under the vitals). Vitals sit beside the buttons, which wrap to ~2 rows. */
#bottom-dock {
    position: fixed;
    bottom: 14px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    z-index: 15;
    background: var(--bg-dark);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    max-width: min(1240px, 96vw);
    flex-wrap: nowrap;
}

#bottom-dock .dock-buttons {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 720px) {
    #bottom-dock {
        flex-wrap: wrap;
    }
}

.hero-vitals {
    display: flex;
    align-items: center;
    gap: 10px;
}

.level-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    font-weight: 900;
    font-size: 14px;
    padding: 8px 11px;
    border-radius: 10px;
    white-space: nowrap;
}

.bars-column {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 175px;
}

.vital-bar {
    position: relative;
    height: 16px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 6px;
    overflow: hidden;
}

.vital-bar span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    text-shadow: 0 1px 2px #000;
}

.hp-bar .vital-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #22c55e);
    transition: width 0.15s;
}

.xp-bar .vital-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    transition: width 0.2s;
}

.dock-buttons {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.dock-btn {
    position: relative;
    background: rgba(51, 65, 85, 0.85);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 9px 13px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.dock-btn:hover {
    background: #475569;
    transform: translateY(-1px);
}

.dock-btn.active {
    background: #2563eb;
    border-color: #60a5fa;
}

.nav-badge {
    position: absolute;
    top: -6px;
    right: -5px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 999px;
}

/* Interactive Slide-Up Drawer */
/* --dock-h is the bottom dock's real height (set by UIController); drawers sit just above it, never over it */
:root {
    --drawer-avail: calc(100vh - var(--dock-h, 84px) - 20px);
}

.drawer {
    position: fixed;
    bottom: calc(var(--dock-h, 84px) + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: min(680px, 94vw);
    max-height: min(62vh, var(--drawer-avail));
    z-index: 20;
    background: var(--bg-panel);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease, max-height 0.2s ease;
}

.drawer.map-mode-drawer {
    width: min(980px, 96vw);
    max-height: min(82vh, var(--drawer-avail));
}

.drawer.map-mode-drawer .drawer-body {
    overflow: hidden;
    padding: 10px 14px;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: rgba(15, 23, 42, 0.75);
    border-bottom: 1px solid var(--border-subtle);
}

.drawer-header h2 {
    font-size: 16px;
    font-weight: 800;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.drawer-body {
    padding: 14px 18px;
    overflow-y: auto;
}

.drawer-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.card-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--border-subtle);
    padding: 10px 12px;
    border-radius: 10px;
}

.btn-gold-buy {
    background: linear-gradient(135deg, #eab308, #ca8a04) !important;
    border-color: #fef08a !important;
    color: #0f172a !important;
}

.card-icon {
    font-size: 26px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.9);
    border-radius: 10px;
}

.card-info {
    flex: 1;
}

.card-title {
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 2px;
}

.lvl-tag {
    font-size: 11px;
    color: var(--accent-gold);
    margin-left: 6px;
}

.card-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.card-effect {
    font-size: 12px;
    color: var(--accent-green);
    font-weight: 600;
    margin-top: 3px;
}

.btn-upgrade {
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: 1px solid #4ade80;
    color: #fff;
    padding: 8px 13px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-upgrade:disabled {
    background: rgba(51, 65, 85, 0.6);
    border-color: transparent;
    color: #64748b;
    cursor: not-allowed;
}

/* Inventory Grid */
/* Material is at the storage cap: further drops overflow */
.item-icon {
    font-size: 26px;
    margin-bottom: 4px;
}

.skill-xp-bar {
    position: relative;
    height: 14px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 6px;
}

.skill-xp-bar > div {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.skill-xp-bar > span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.locked-notice {
    text-align: center;
    padding: 26px 16px;
    color: var(--text-muted);
}

.locked-notice h3 {
    color: var(--text-main);
    margin-bottom: 6px;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid #ef4444;
    color: #f87171;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
}

/* Interactive Illustrated World Atlas Map */
.worldmap-wrapper {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.worldmap-tabs-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.world-map-tab {
    position: relative;
    background: rgba(15, 23, 42, 0.82);
    border: 1.5px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    color: var(--text-main);
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.14s ease;
}

.world-map-tab:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: var(--tab-color, #60a5fa);
}

.world-map-tab.active {
    background: rgba(30, 41, 59, 0.98);
    border-color: var(--tab-color, #38bdf8);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.world-map-tab.town-tab {
    font-weight: 800;
    font-size: 11px;
    border-color: rgba(56, 189, 248, 0.45);
}

.world-map-tab.locked {
    opacity: 0.52;
}

.w-tab-icon {
    font-size: 13px;
    line-height: 1;
}

.w-tab-title {
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.w-tab-progress {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.75);
    padding: 1px 5px;
    border-radius: 4px;
}

.tab-here-dot {
    font-size: 11px;
}

.worldmap-canvas {
    position: relative;
    width: 100%;
    height: 315px;
    background: radial-gradient(circle at 50% 50%, #111c33 0%, #070b14 100%);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.75);
}

.worldmap-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.map-region-banner-title {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-anchor: middle;
    opacity: 0.92;
}

.map-road-shadow {
    fill: none;
    stroke: rgba(0, 0, 0, 0.65);
    stroke-width: 6;
    stroke-linecap: round;
}

.map-road-line {
    fill: none;
    stroke-width: 3.2;
    stroke-linecap: round;
}

.map-road-line.unlocked {
    stroke: #facc15;
    stroke-dasharray: none;
    filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.55));
}

.map-road-line.locked {
    stroke: #475569;
    stroke-dasharray: 6 6;
    opacity: 0.65;
}

.worldmap-nodes-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.worldmap-node {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #0f172a;
    border: 3px solid var(--node-color, #94a3b8);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.worldmap-node.town-node {
    width: 60px;
    height: 60px;
    border-width: 3px;
    background: linear-gradient(135deg, #0c4a6e, #0f172a);
}

.worldmap-node.gateway-node {
    width: 48px;
    height: 48px;
    border-style: dashed;
    background: rgba(15, 23, 42, 0.9);
}

.worldmap-node.boss-node {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    border-color: #facc15;
    background: linear-gradient(135deg, #450a0a, #1e1b4b);
}

.worldmap-node.major-node {
    width: 58px;
    height: 58px;
    border-color: #fde047;
}

.worldmap-node.locked {
    background: #1e293b;
    border-color: #475569;
    opacity: 0.62;
}

.worldmap-node.cleared {
    box-shadow: 0 0 14px rgba(74, 222, 128, 0.35), 0 6px 16px rgba(0, 0, 0, 0.8);
}

.worldmap-node:hover {
    transform: translate(-50%, -50%) scale(1.12);
    z-index: 5;
}

.worldmap-node.is-selected {
    transform: translate(-50%, -50%) scale(1.16);
    border-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.85), 0 10px 24px rgba(0, 0, 0, 0.9);
    z-index: 6;
}

.worldmap-node.is-here {
    animation: pulseGlow 1.6s infinite;
    z-index: 7;
}

.worldmap-node .node-icon {
    font-size: 22px;
    line-height: 1;
}

.worldmap-node .node-name-plate {
    position: absolute;
    bottom: -20px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
    color: #f8fafc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.worldmap-node .node-tag {
    position: absolute;
    bottom: -36px;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
    color: #94a3b8;
    text-shadow: 0 1px 3px #000;
}

.hero-here-flag {
    position: absolute;
    top: -22px;
    background: linear-gradient(135deg, #facc15, #eab308);
    color: #090d16;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.worldmap-inspector {
    background: rgba(15, 23, 42, 0.86);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.inspector-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 260px;
}

.inspector-title-row {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.inspector-stage-badge {
    font-size: 11px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 6px;
}

.inspector-title-row h3 {
    font-size: 16px;
    font-weight: 800;
}

.inspector-world-name {
    font-size: 12px;
    color: var(--text-muted);
}

.inspector-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: #cbd5e1;
}

.inspector-unlock-pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
}

.inspector-unlock-pill.built {
    background: rgba(22, 101, 52, 0.45);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.4);
}

.inspector-unlock-pill.bp {
    background: rgba(161, 98, 7, 0.45);
    color: #fef08a;
    border: 1px solid #facc15;
}

.inspector-unlock-pill.boss {
    background: rgba(127, 29, 29, 0.55);
    color: #fca5a5;
    border: 1px solid #f87171;
}

.inspector-unlock-pill.locked,
.inspector-unlock-pill.town {
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.inspector-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-travel-large {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 1px solid #60a5fa;
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.btn-travel-large:disabled {
    background: rgba(51, 65, 85, 0.6);
    border-color: transparent;
    color: #64748b;
    cursor: not-allowed;
}

/* Toast & AFK Modal */
.toast {
    position: fixed;
    top: 96px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--accent-gold);
    color: #fef08a;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(9, 13, 22, 0.8);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: var(--bg-panel);
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 16px;
    width: min(460px, 92vw);
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.modal-header h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--accent-gold);
}

.afk-time-line {
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 14px;
}

.afk-loot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-bottom: 18px;
}

.afk-stat {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-subtle);
    padding: 9px 11px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
}

.afk-stat span {
    color: var(--text-muted);
}

.afk-stat strong {
    font-size: 15px;
    color: var(--accent-green);
}

.btn-primary-large {
    width: 100%;
    background: linear-gradient(135deg, #eab308, #ca8a04);
    border: none;
    color: #0f172a;
    font-weight: 900;
    font-size: 15px;
    padding: 11px;
    border-radius: 10px;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   GRAND OAKHAVEN MUSEUM EXHIBITION HALL & PEDESTALS
   ========================================================================== */

.structure-label.museum-world-label {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96));
    border: 1.5px solid #facc15;
    color: #fef08a;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65), 0 0 14px rgba(250, 204, 21, 0.35);
}

.drawer.museum-mode-drawer {
    width: min(1140px, 96vw);
    max-height: 76vh;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(10, 15, 29, 0.99) 100%);
    border: 1px solid rgba(250, 204, 21, 0.42);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 40px rgba(250, 204, 21, 0.12);
}

.drawer.museum-mode-drawer .drawer-header {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.95), rgba(51, 38, 16, 0.7), rgba(30, 41, 59, 0.95));
    border-bottom: 1px solid rgba(250, 204, 21, 0.35);
}

.drawer.museum-mode-drawer #drawer-title {
    color: #fef08a;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(250, 204, 21, 0.3);
}

/* Curator Header & Restoration Progress Bar */
/* Wing Navigation Tabs */
.wing-ready-pip {
    font-size: 10px;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 999px;
    background: #eab308;
    color: #090d16;
}

/* Active Museum Bonuses Ribbon */
/* Exhibition Wings & 3-Column Pedestal Galleries */
/* Individual Museum Exhibit Case & Marble Pedestal */
/* Illuminated Glass Case & 3-Tier Marble/Brass Pedestal Stage */
@keyframes museumArtifactFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}

/* 3-Tier Marble & Brass Pedestal Plinth */
.plinth-brass-plate {
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.6px;
    padding: 1px 6px;
    border-radius: 2px;
    background: linear-gradient(90deg, #a16207, #facc15, #a16207);
    color: #090d16;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Curator Plaque & Bonus Pill */
/* Additional Museum Pedestal & Exhibit Case Detail Selectors */
.museum-wings-scroll {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   OAKHAVEN HARBOR — USER-FRIENDLY 2-COLUMN TRADE & EXPORT UI
   ========================================================================== */

.stat-pill.doubloons {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(12, 74, 110, 0.45);
    color: #bae6fd;
}

.stat-pill.doubloons strong {
    color: #38bdf8;
}

.drawer.harbor-mode-drawer {
    width: min(1160px, 96vw);
    height: min(740px, var(--drawer-avail));
    max-height: var(--drawer-avail);
    background: linear-gradient(180deg, rgba(12, 28, 48, 0.98) 0%, rgba(8, 17, 30, 0.99) 100%);
    border: 1px solid rgba(56, 189, 248, 0.45);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 36px rgba(56, 189, 248, 0.14);
}

.drawer.harbor-mode-drawer .drawer-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 10px 14px;
}

.drawer.harbor-mode-drawer .drawer-header {
    background: linear-gradient(90deg, rgba(15, 35, 60, 0.96), rgba(14, 72, 108, 0.65), rgba(15, 35, 60, 0.96));
    border-bottom: 1px solid rgba(56, 189, 248, 0.38);
    padding: 10px 16px;
}

.drawer.harbor-mode-drawer #drawer-title {
    color: #7dd3fc;
}

.harbor-interior-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.harbor-tab-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.harbor-tab-content .card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

/* Compact pass so every Harbor tab fits the drawer without its inner list scrolling (docs/UI_STANDARDS.md) */
.harbor-ports-list {
    gap: 3px !important;
}

.harbor-port-card {
    padding: 4px 8px !important;
    gap: 2px !important;
}

.harbor-cargo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 4px 8px !important;
}

/* Compact cargo row: name | owned | value | loaded | buttons */
.harbor-cargo-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px 40px 30px auto;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 7px;
    background: rgba(30, 41, 59, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.22);
    font-size: 11px;
}

.harbor-cargo-row.is-preferred {
    border-color: rgba(250, 204, 21, 0.45);
}

.harbor-cargo-row.has-staged {
    border-color: #38bdf8;
    background: rgba(14, 52, 84, 0.55);
}

.cargo-row-name {
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cargo-row-pref {
    color: #facc15;
}

.cargo-row-have {
    text-align: right;
    color: #e2e8f0;
}

.cargo-row-val {
    text-align: right;
    color: #facc15;
}

.cargo-row-loaded {
    text-align: right;
    font-weight: 900;
    color: #38bdf8;
}

.harbor-tab-content {
    overflow-x: hidden;
}

.harbor-cargo-tile {
    padding: 3px 8px !important;
    gap: 2px !important;
}

.harbor-cargo-tile .cargo-tile-stats {
    padding: 1px 0;
}

/* Only the selected port lists its cravings (cargo tiles already mark preferred items with ⭐) */
.harbor-port-card:not(.selected) .port-cravings-row {
    display: none;
}

.harbor-ship-summary-banner {
    flex-wrap: nowrap !important;
    padding: 8px 12px !important;
}

.harbor-ship-summary-banner .harbor-stats-ribbon {
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
}

.harbor-tab-content .card-row {
    padding: 8px 11px;
}

@media (max-width: 820px) {
    .harbor-tab-content .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Single-Row Top Bar: Tabs + Hot Bonus + Doubloons */
.harbor-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.32);
    border-radius: 10px;
    padding: 6px 10px;
}

.harbor-subtabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.harbor-subtab {
    padding: 7px 14px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.14s ease;
}

.harbor-subtab:hover {
    background: rgba(51, 65, 85, 0.9);
    color: #ffffff;
}

.harbor-subtab.active {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border-color: #7dd3fc;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.35);
}

.harbor-top-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.harbor-hot-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(127, 29, 29, 0.45);
    border: 1px solid rgba(248, 113, 113, 0.5);
    color: #fecaca;
    font-size: 12px;
}

.harbor-hot-pill strong {
    color: #fde047;
}

.harbor-doubloon-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border-radius: 999px;
    background: rgba(9, 16, 29, 0.95);
    border: 1.5px solid #facc15;
    color: #facc15;
    font-size: 14px;
    font-weight: 900;
}

.harbor-doubloon-pill small {
    font-size: 11px;
    font-weight: 700;
    color: #cbd5e1;
}

/* Last Voyage Banner */
.harbor-last-log {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px;
    margin-top: 7px;
    background: rgba(22, 101, 52, 0.35);
    border: 1px solid rgba(74, 222, 128, 0.45);
    color: #dcfce7;
}

.harbor-last-log.pirates {
    background: rgba(127, 29, 29, 0.42);
    border-color: #f87171;
    color: #fecaca;
}

.harbor-last-log.repelled {
    background: rgba(161, 98, 7, 0.42);
    border-color: #facc15;
    color: #fef08a;
}

/* Side-by-Side 2-Column Layout for Send Shipment Tab */
.harbor-two-col-layout {
    display: grid;
    grid-template-columns: 335px 1fr;
    gap: 12px;
    align-items: start;
}

@media (max-width: 900px) {
    .harbor-two-col-layout {
        grid-template-columns: 1fr;
    }
}

.harbor-step-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.step-badge {
    font-size: 10px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 5px;
    background: #0284c7;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.harbor-step-header h3 {
    font-size: 13px;
    font-weight: 800;
    color: #f8fafc;
}

/* Left Column: Clean Vertical Port List */
.harbor-ports-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.harbor-port-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-left: 4px solid var(--port-color, #38bdf8);
    border-radius: 9px;
    padding: 6px 9px;
    transition: all 0.14s ease;
}

.harbor-port-card.selected {
    border-color: var(--port-color, #38bdf8);
    background: linear-gradient(90deg, rgba(14, 58, 92, 0.72), rgba(15, 23, 42, 0.95));
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.2);
}

.harbor-port-card.locked {
    opacity: 0.8;
}

.port-card-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.port-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.port-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.port-name-line {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

.port-name-line h4 {
    font-size: 12px;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
}

.port-mult-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(2, 132, 199, 0.3);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #7dd3fc;
    white-space: nowrap;
}

.port-stats-line {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: #94a3b8;
    margin-top: 1px;
    white-space: nowrap;
}

.port-stats-line .risk-warn {
    color: #fca5a5;
}

.port-stats-line .risk-safe {
    color: #86efac;
}

.port-action-cell {
    flex-shrink: 0;
}

.btn-port-select,
.btn-port-unlock {
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(30, 41, 59, 0.92);
    color: #e2e8f0;
    white-space: nowrap;
}

.btn-port-select:hover:not(:disabled) {
    background: rgba(51, 65, 85, 0.95);
    border-color: #7dd3fc;
}

.btn-port-select.active {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border-color: #7dd3fc;
    color: #ffffff;
}

.btn-port-unlock {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    border-color: #fef08a;
    color: #090d16;
}

.btn-port-select:disabled,
.btn-port-unlock:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.port-cravings-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.crave-label {
    font-size: 10px;
    font-weight: 800;
    color: #facc15;
    white-space: nowrap;
}

.port-crave-chip {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(250, 204, 21, 0.35);
    color: #fef08a;
    white-space: nowrap;
}

/* Right Column: Launch Control Bar & Clean 3x3 Cargo Item Tiles */
.harbor-launch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(56, 189, 248, 0.38);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 8px;
}

.launch-hold-info {
    flex: 1;
    min-width: 210px;
}

.launch-hold-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.launch-hold-text strong {
    color: #7dd3fc;
}

.launch-trip-meta {
    font-size: 11px;
    color: #94a3b8;
}

.launch-hold-bar {
    height: 7px;
    background: rgba(9, 13, 22, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 999px;
    overflow: hidden;
}

.launch-hold-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    transition: width 0.15s ease;
}

.launch-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.btn-harbor-util {
    padding: 7px 11px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.92);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #bae6fd;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.btn-harbor-util:hover:not(:disabled) {
    background: rgba(51, 65, 85, 0.95);
    color: #ffffff;
}

.btn-harbor-util:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-harbor-sail {
    padding: 8px 15px;
    border-radius: 8px;
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: 1px solid #86efac;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.btn-harbor-sail:disabled {
    background: rgba(51, 65, 85, 0.7);
    border-color: transparent;
    color: #64748b;
    box-shadow: none;
    cursor: not-allowed;
}

/* 3x3 Vertical Cargo Item Cards — Zero Overflow */
.harbor-cargo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

@media (max-width: 1080px) {
    .harbor-cargo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.harbor-cargo-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 5px;
    padding: 7px 10px;
    border-radius: 9px;
    background: rgba(30, 41, 59, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.22);
    min-width: 0;
}

.harbor-cargo-tile.is-preferred {
    border-color: rgba(250, 204, 21, 0.55);
    background: linear-gradient(180deg, rgba(66, 48, 14, 0.32), rgba(30, 41, 59, 0.8));
}

.harbor-cargo-tile.has-staged {
    background: rgba(14, 65, 98, 0.6);
    border-color: #38bdf8;
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.cargo-tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}

.cargo-tile-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.cargo-item-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.cargo-item-label {
    font-size: 12px;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cargo-tile-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.cargo-pref-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(161, 98, 7, 0.6);
    border: 1px solid #facc15;
    color: #fef08a;
    white-space: nowrap;
}

.cargo-hot-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(185, 28, 28, 0.65);
    border: 1px solid #f87171;
    color: #fecaca;
    white-space: nowrap;
}

.cargo-tile-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #94a3b8;
    padding: 3px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.cargo-tile-stats strong {
    color: #e2e8f0;
}

.cargo-unit-val strong {
    color: #fde047;
}

.cargo-tile-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.cargo-staged-pill {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    white-space: nowrap;
}

.cargo-staged-pill.active {
    color: #7dd3fc;
}

.cargo-btn-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-cargo-adj {
    padding: 4px 7px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #f8fafc;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.btn-cargo-adj:hover:not(:disabled) {
    background: #0284c7;
    border-color: #7dd3fc;
}

.btn-cargo-adj.clear {
    color: #fca5a5;
    padding: 4px 6px;
}

.btn-cargo-adj:disabled {
    opacity: 0.32;
    cursor: not-allowed;
}

/* Ship Summary Banner in Upgrade Boat Tab */
.harbor-ship-summary-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.ship-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ship-banner-icon {
    font-size: 28px;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(2, 132, 199, 0.25);
    border: 1px solid #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ship-banner-left h3 {
    font-size: 15px;
    font-weight: 900;
    color: #f8fafc;
}

.ship-banner-left p {
    font-size: 12px;
    color: #94a3b8;
}

.harbor-stats-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.harbor-stat-pill {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: #cbd5e1;
}

.harbor-stat-pill strong {
    color: #7dd3fc;
}

.harbor-section-title {
    font-size: 12px;
    font-weight: 800;
    color: #7dd3fc;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}

/* Active Voyage Progress & Claim Spoils Box */
.harbor-voyage-active-box {
    background: linear-gradient(135deg, rgba(14, 52, 84, 0.72), rgba(15, 23, 42, 0.95));
    border: 1.5px solid #38bdf8;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.harbor-voyage-active-box.is-completed {
    border-color: #facc15;
    box-shadow: 0 0 28px rgba(250, 204, 21, 0.22);
}

.voyage-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.voyage-box-header h3 {
    font-size: 16px;
    font-weight: 900;
    color: #f8fafc;
}

.voyage-box-header p {
    font-size: 12px;
    color: #cbd5e1;
    margin-top: 3px;
}

.voyage-payout-badge {
    font-size: 16px;
    font-weight: 900;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(161, 98, 7, 0.45);
    border: 1px solid #facc15;
    color: #fef08a;
}

.voyage-progress-track {
    position: relative;
    height: 28px;
    background: rgba(9, 13, 22, 0.92);
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 999px;
    overflow: hidden;
}

.voyage-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8, #4ade80);
    transition: width 0.25s linear;
}

.voyage-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 3px #000;
}

.voyage-cargo-manifest-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.shipped-cargo-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
}

.btn-harbor-claim {
    width: 100%;
    padding: 12px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eab308, #ca8a04);
    border: 1px solid #fef08a;
    color: #090d16;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(234, 179, 8, 0.4);
}

.voyage-sailing-hint {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    font-style: italic;
}

.btn-doubloon-buy {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border: 1px solid #7dd3fc;
    color: #ffffff;
}

/* Spellbook (list + detail): hotbar slots in the header, slot picker in the detail pane */
.spl-slots {
    display: flex;
    gap: 4px;
}

.spl-slot {
    --slot-color: #475569;
    position: relative;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid var(--slot-color);
    background: rgba(15, 23, 42, 0.85);
    font-size: 18px;
}

.spl-slot b {
    position: absolute;
    top: -2px;
    left: 2px;
    font-size: 9px;
    color: #cbd5e1;
}

.spl-slot.locked {
    font-size: 10px;
    opacity: 0.45;
    border-style: dashed;
}

.spl-assign {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
}

.spl-assign > span {
    margin-right: auto;
}

/* Sanctum Altar: offering on the left, rewards on the right */
.altar-icon {
    font-size: 30px;
    line-height: 1;
}

.altar-grid {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.altar-grid .dw-detail h4 {
    font-size: 14px;
    font-weight: 900;
    color: #f8fafc;
}

.altar-rewards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.altar-rewards .dw-kv {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.altar-odds {
    font-style: normal;
    font-weight: 700;
    color: var(--text-muted);
    margin-left: 4px;
}

@media (max-width: 720px) {
    .altar-grid {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* Anvil / Items (list + detail) */
.gear-costs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Grand Museum (list + detail) */
.mus-status {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
}

.mus-status.mounted,
.mus-status.omni {
    color: #facc15;
}

.mus-status.ready {
    color: #38bdf8;
}

.mus-power {
    font-size: 12px;
    font-weight: 700;
    color: #86efac;
}

.mus-slots-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
}

.mus-slots-row > span:first-child {
    margin-right: auto;
}

.mus-slot {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(250, 204, 21, 0.12);
    border: 1px solid rgba(250, 204, 21, 0.5);
    font-size: 14px;
}

.mus-slot.empty {
    background: rgba(15, 23, 42, 0.6);
    border: 1px dashed rgba(148, 163, 184, 0.4);
    color: var(--text-muted);
}

.mus-slot.locked {
    opacity: 0.4;
    border-color: rgba(148, 163, 184, 0.25);
    background: transparent;
}

.mus-actions {
    margin-top: auto;
    display: flex;
    gap: 6px;
}

.mus-actions .dw-action:first-child {
    flex: 1;
}

.mus-actions .dw-action {
    margin-top: 0;
    width: auto;
}

.dw-action.alt {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border-color: #c084fc;
}

.mus-powers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 6px;
}

.mus-power-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 8px;
    font-size: 11px;
    color: #86efac;
}

.mus-power-row > span {
    font-size: 18px;
}

.mus-power-row > div {
    flex: 1;
    min-width: 0;
}

.mus-power-row strong {
    color: #f8fafc;
}

.mus-power-row em {
    font-style: normal;
    color: #c084fc;
}

.mus-facility {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mus-facility h4 em {
    font-style: normal;
    font-weight: 700;
    color: var(--text-muted);
    margin-left: 4px;
}

.mus-facility.built {
    border-color: rgba(74, 222, 128, 0.45);
}

/* Small stage / boss badges (Sanctum Altar header) */
/* 3D Monster Plate Mastery Star Badge */
.monster-plate .m-star-badge {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    color: #090d16;
    font-weight: 900;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 999px;
    margin-right: 4px;
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.6);
    vertical-align: middle;
}


/* =========================================================================
   PHASE 2: BOSS ARENA GATING, SANCTUM ALTAR, UNIQUE LOOT & TROPHIES
   ========================================================================= */

/* Top HUD Boss / Altar Banners */
.boss-active-banner {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: #fef08a;
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.85), rgba(245, 158, 11, 0.85));
    border: 1px solid #facc15;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
    animation: bossBannerPulse 1.8s infinite ease-in-out;
}

@keyframes bossBannerPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 0 18px rgba(250, 204, 21, 0.75); }
}

.boss-summon-ready {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.85), rgba(56, 189, 248, 0.85)) !important;
    border: 1px solid #4ade80 !important;
    color: #ffffff !important;
    animation: summonReadyGlow 1.6s infinite alternate;
}

@keyframes summonReadyGlow {
    from { box-shadow: 0 0 8px rgba(74, 222, 128, 0.4); }
    to { box-shadow: 0 0 18px rgba(74, 222, 128, 0.9); }
}

.boss-missing-key-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #fdba74;
    background: rgba(124, 45, 18, 0.7);
    border: 1px solid #ea580c;
    transition: all 0.15s ease;
}

.boss-missing-key-pill:hover {
    background: rgba(194, 65, 12, 0.85);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(234, 88, 12, 0.5);
}

/* Sanctum Altar Drawer */
/* Altar Rewards Section */
/* Altar Offering Box */
@keyframes awakenBtnPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.015); box-shadow: 0 6px 22px rgba(250, 204, 21, 0.65); }
}

/* Anvil Sections & Boss Sigils */
/* Inventory Trophies Hall */
/* =========================================================
   SHARED LIST + DETAIL DRAWER LAYOUT (dw-*) — see docs/UI_STANDARDS.md
   Used by Talents and the Bestiary; markup helpers in js/ui/list-detail.js.
   Talent-only pieces keep the tk-* prefix.
   ========================================================= */
/* Fixed-height drawer: header + tabs + a body that fits without scrolling on desktop */
.drawer.dw-drawer {
    width: min(960px, 96vw);
    height: min(560px, var(--drawer-avail));
    max-height: none;
}

/* dw-wrap fills the body exactly, so this only scrolls for drawers not yet on the dw layout (fallback) */
.drawer.dw-drawer .drawer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 14px 12px;
}

.dw-wrap {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dw-header {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 6px 10px;
}

.dw-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.3);
    white-space: nowrap;
}

.dw-stat strong {
    font-size: 20px;
    font-weight: 900;
    color: #94a3b8;
}

.dw-stat span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.dw-stat.is-hot {
    border-color: rgba(56, 189, 248, 0.6);
    background: linear-gradient(135deg, rgba(14, 52, 84, 0.7), rgba(15, 23, 42, 0.85));
}

.dw-stat.is-hot strong {
    color: #38bdf8;
}

.dw-header-mid {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
}

.dw-meta {
    color: var(--text-muted);
}

.dw-meta strong {
    color: #f8fafc;
}

.dw-next {
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dw-next strong {
    color: #facc15;
}

.dw-next em {
    color: var(--text-muted);
    font-style: normal;
}

.dw-next.done {
    color: #4ade80;
}

.dw-header-actions {
    display: flex;
    gap: 6px;
}

.dw-btn {
    border-radius: 8px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s ease;
}

.dw-btn:hover:not(:disabled) {
    filter: brightness(1.2);
}

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

.dw-btn.gold {
    background: linear-gradient(135deg, #ca8a04, #a16207);
    border: 1px solid #facc15;
    color: #fef08a;
}

.dw-btn.danger {
    background: rgba(127, 29, 29, 0.45);
    border: 1px solid rgba(248, 113, 113, 0.55);
    color: #fecaca;
}

.dw-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border-subtle);
}

.dw-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    margin-bottom: -1px;
}

.dw-tab:hover {
    color: #f8fafc;
}

.dw-tab.active {
    color: #f8fafc;
    border-bottom-color: #38bdf8;
}

.dw-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Talents tab: compact list on the left, details of the selected talent on the right */
.dw-split {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 12px;
}

.dw-list-col {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dw-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.dw-chip {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.dw-chip:hover {
    border-color: #38bdf8;
}

.dw-chip.active {
    background: rgba(2, 132, 199, 0.45);
    border-color: #7dd3fc;
    color: #ffffff;
}

.dw-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    /* --tile-min: narrower tiles fit more columns (set via dwSplit's tileMin option) */
    grid-template-columns: repeat(auto-fill, minmax(var(--tile-min, 176px), 1fr));
    grid-auto-rows: 38px;
    gap: 4px;
    align-content: start;
}

/* --accent colors the left edge (category / world); set it per tile with style="--accent:…" or a class */
.dw-tile {
    --accent: #94a3b8;
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 8px 4px 6px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    color: #e2e8f0;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.dw-tile.cat-combat {
    --accent: #f87171;
}

.dw-tile.cat-gathering {
    --accent: #4ade80;
}

.dw-tile.cat-utility {
    --accent: #c084fc;
}

.dw-tile:hover {
    background: rgba(30, 41, 59, 0.95);
}

.dw-tile.is-selected {
    border-color: #38bdf8;
    border-left-color: var(--accent);
    background: rgba(14, 52, 84, 0.6);
    box-shadow: 0 0 0 1px #38bdf8 inset;
}

.dw-tile.is-locked {
    opacity: 0.5;
}

/* Fully maxed / completed entry */
.dw-tile.is-maxed {
    border-color: rgba(250, 204, 21, 0.6);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(66, 32, 6, 0.4));
}

/* Small dot = there's something you can do with this entry right now */
.dw-tile.is-ready::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 6px #38bdf8;
}

.dw-tile-icon {
    font-size: 18px;
    line-height: 1;
}

.dw-tile-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dw-tile-name {
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dw-tile-bar {
    height: 3px;
    background: rgba(9, 13, 22, 0.9);
    border-radius: 999px;
    overflow: hidden;
}

.dw-tile-bar span {
    display: block;
    height: 100%;
    background: #38bdf8;
}

.dw-tile-bar span.maxed {
    background: linear-gradient(90deg, #f59e0b, #facc15);
}

.dw-tile-side {
    font-size: 11px;
    font-weight: 900;
    color: #f8fafc;
    white-space: nowrap;
}

.dw-tile-side em {
    font-style: normal;
    color: var(--text-muted);
    font-weight: 700;
}

.dw-detail {
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px;
}

.tk-plan {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tk-plan h4 {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 900;
    color: #facc15;
}

.tk-plan h4 span {
    font-size: 11px;
    color: #38bdf8;
}

.tk-plan-actions {
    display: flex;
    gap: 5px;
}

.tk-plan-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
}

.tk-plan-row {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 6px;
    padding: 3px 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.14);
}

.tk-plan-row strong {
    color: #4ade80;
}

.tk-plan-row em {
    grid-column: 1 / -1;
    font-style: normal;
    color: var(--text-muted);
}

.tk-plan-add {
    margin-left: 4px;
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    font-size: 10px;
}

.dw-detail-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dw-detail-icon {
    font-size: 30px;
    line-height: 1;
}

.dw-detail-name {
    font-size: 15px;
    font-weight: 900;
    color: #f8fafc;
}

.dw-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 3px;
}

.dw-effect {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.dw-effect > div {
    display: flex;
    gap: 8px;
}

.dw-effect span {
    min-width: 34px;
    color: var(--text-muted);
    font-weight: 700;
}

.dw-effect strong {
    color: #e2e8f0;
}

.dw-effect .next strong {
    color: #38bdf8;
}

.tk-buy-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.6fr;
    gap: 6px;
}

.tk-buy-row .btn-talent-buy {
    padding: 8px 6px;
    font-size: 13px;
}

/* Progress bar inside a detail pane, with an optional label row above it */
.dw-progress {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    color: var(--text-muted);
}

.dw-progress > div:not(.dw-bar) {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.dw-progress strong {
    color: #e2e8f0;
}

.dw-bar {
    height: 6px;
    background: rgba(9, 13, 22, 0.9);
    border-radius: 999px;
    overflow: hidden;
}

.dw-bar > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.dw-bar.maxed > i {
    background: linear-gradient(90deg, #f59e0b, #facc15);
}

/* The detail pane's main action (one per pane), pinned to the bottom */
.dw-action {
    margin-top: auto;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border: 1px solid #38bdf8;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.dw-action:hover:not(:disabled) {
    filter: brightness(1.15);
}

.dw-action:disabled {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.25);
    color: var(--text-muted);
    cursor: default;
}

/* One-line status note in a detail pane: neutral hint, locked (red) or maxed (gold) */
.dw-note {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.dw-note.locked {
    color: #fca5a5;
}

.dw-note.maxed {
    color: #facc15;
}

/* Grid of key/value cards (e.g. Hero Stats tab) */
.dw-kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    align-content: start;
}

.dw-kv {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
}

.dw-kv h4 {
    font-size: 12px;
    font-weight: 900;
    color: #7dd3fc;
    margin-bottom: 6px;
}

.dw-kv > div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.14);
}

.dw-kv > div:last-child {
    border-bottom: none;
}

.dw-kv span {
    color: var(--text-muted);
}

.tk-caps .cap-vectors-sub {
    margin-bottom: 10px;
}

#hud-level {
    cursor: pointer;
}

/* Bestiary (list + detail) — mastery stars, tags, bonus box, lore */
.bst-stars {
    font-size: 13px;
    letter-spacing: 1px;
    color: rgba(148, 163, 184, 0.3);
}

.bst-stars b {
    color: #facc15;
    font-weight: 400;
    text-shadow: 0 0 6px rgba(250, 204, 21, 0.6);
}

.dw-tile-side .bst-stars {
    font-size: 10px;
    letter-spacing: 0;
}

.bst-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
}

.bst-tag.boss {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
    color: #090d16;
}

.bst-bonus {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(192, 132, 252, 0.25);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bst-bonus h4 {
    font-size: 12px;
    font-weight: 800;
    color: #e9d5ff;
}

.bst-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 10px;
    font-size: 11px;
    color: #94a3b8;
}

.bst-lore {
    font-size: 11px;
    font-style: italic;
    color: #94a3b8;
    border-left: 2px solid rgba(192, 132, 252, 0.4);
    padding: 2px 8px;
}

.bst-resonance {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 150px;
}

/* Narrow screens: stack the detail pane under the list */
@media (max-width: 720px) {
    /* Phones: drawers are a full-height sheet over the (tall, wrapped) dock; ✕ closes it */
    :root {
        --drawer-avail: calc(100vh - 28px);
    }

    .drawer {
        bottom: 14px;
    }

    .drawer.dw-drawer {
        height: var(--drawer-avail);
    }

    .dw-header {
        flex-wrap: wrap;
        gap: 6px 8px;
    }

    .dw-header-mid {
        order: 3;
        flex-basis: 100%;
    }

    .dw-header-actions {
        margin-left: auto;
    }

    .dw-stat {
        padding: 3px 8px;
    }

    .dw-stat strong {
        font-size: 16px;
    }

    .dw-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .dw-tab {
        padding: 6px 8px;
        white-space: nowrap;
    }

    .dw-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 34px;
    }

    /* List and detail share the height 50/50; each scrolls inside its own half */
    .dw-split {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
    }

    .dw-detail {
        padding: 10px;
        gap: 7px;
    }

    .dw-tabs {
        overflow-x: auto;
        scrollbar-width: none;
    }
}

.talent-cat-tag {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 999px;
    letter-spacing: 0.3px;
}

.talent-cat-tag.cat-combat {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fca5a5;
}

.talent-cat-tag.cat-gathering {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(74, 222, 128, 0.45);
    color: #86efac;
}

.talent-cat-tag.cat-utility {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(192, 132, 252, 0.45);
    color: #d8b4fe;
}

.talent-cap-expanded-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(14, 116, 144, 0.4);
    border: 1px solid #38bdf8;
    color: #7dd3fc;
}

.talent-lvl-pill {
    font-size: 11px;
    font-weight: 900;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #e2e8f0;
}

.talent-lvl-pill.maxed {
    background: rgba(161, 98, 7, 0.45);
    border-color: #facc15;
    color: #fef08a;
}

.talent-desc {
    font-size: 12px;
    color: #cbd5e1;
}

.talent-cap-bar {
    height: 6px;
    background: rgba(9, 13, 22, 0.9);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 2px;
}

.talent-cap-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    transition: width 0.2s ease;
}

.talent-cap-fill.overdrive-fill {
    background: linear-gradient(90deg, #f59e0b, #facc15, #4ade80);
}

.btn-talent-buy {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border: 1px solid #38bdf8;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 9px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.btn-talent-buy:hover:not(:disabled) {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.btn-talent-buy:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.btn-talent-buy.btn-talent-max {
    background: linear-gradient(135deg, #ca8a04, #a16207);
    border-color: #facc15;
    color: #fef08a;
}

.talent-overdrive-box {
    background: rgba(9, 13, 22, 0.65);
    border: 1px dashed rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.talent-overdrive-box.is-active {
    background: rgba(161, 98, 7, 0.22);
    border: 1px solid rgba(250, 204, 21, 0.55);
    color: #fef08a;
}

.overdrive-label strong {
    color: #f8fafc;
}

.talent-overdrive-box.is-active .overdrive-label strong {
    color: #facc15;
}

.cap-vectors-section {
    margin-top: 16px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 12px 14px;
}

.cap-vectors-header {
    font-size: 13px;
    font-weight: 900;
    color: #7dd3fc;
    margin-bottom: 4px;
}

.cap-vectors-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.cap-vectors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.cap-vector-card {
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.cap-vector-icon {
    font-size: 20px;
}

.cap-vector-title {
    font-size: 11px;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.cap-vector-source {
    font-size: 9px;
    color: #38bdf8;
    background: rgba(2, 132, 199, 0.2);
    padding: 1px 5px;
    border-radius: 4px;
}

.cap-vector-desc {
    font-size: 10px;
    color: #cbd5e1;
    margin-top: 2px;
}

/* ==========================================
   PHASE 4: GRAND MUSEUM & RELIC PEDESTAL SYSTEM
   ========================================== */
.btn-unlock-omni {
    background: linear-gradient(135deg, #7e22ce, #581c87);
    border: 1px solid #c084fc;
    color: #f3e8ff;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.14s ease;
}

.btn-unlock-omni:hover:not(:disabled) {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.btn-unlock-omni:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ==========================================
   PHASE 5: OAKHAVEN HARBOR & ARMADA OVERHAUL
   ========================================== */
.harbor-armada-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 10px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 10px;
}

.armada-vessel-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-vessel-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
    cursor: pointer;
    text-align: left;
    transition: all 0.14s ease;
}

.btn-vessel-tab:hover {
    border-color: #38bdf8;
    transform: translateY(-1px);
}

.btn-vessel-tab.active {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.42), rgba(30, 58, 138, 0.65));
    border-color: #38bdf8;
    color: #f8fafc;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.btn-vessel-tab.has-ready {
    border-color: #facc15;
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.35);
}

.vessel-tab-icon {
    font-size: 20px;
}

.vessel-tab-info {
    display: flex;
    flex-direction: column;
}

.vessel-tab-info strong {
    font-size: 12px;
    color: #f8fafc;
}

.vessel-tab-info small {
    font-size: 10px;
    color: #94a3b8;
}

.btn-vessel-commission {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(161, 98, 7, 0.38), rgba(15, 23, 42, 0.9));
    border: 1px dashed rgba(250, 204, 21, 0.55);
    color: #fef08a;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.14s ease;
}

.btn-vessel-commission:hover:not(:disabled) {
    border-style: solid;
    filter: brightness(1.15);
}

.btn-vessel-commission:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-vessel-commission small {
    font-size: 10px;
    color: #cbd5e1;
    font-weight: 600;
}

.armada-automation-controls {
    display: flex;
    align-items: center;
}

.btn-auto-dispatch-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #cbd5e1;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.14s ease;
}

.btn-auto-dispatch-toggle.active {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.38), rgba(20, 83, 45, 0.65));
    border-color: #4ade80;
    color: #dcfce7;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.btn-auto-dispatch-toggle small {
    font-size: 10px;
    color: #94a3b8;
}

.btn-auto-dispatch-toggle.active small {
    color: #86efac;
}

.auto-dispatch-locked-pill {
    font-size: 11px;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.7);
    border: 1px dashed rgba(148, 163, 184, 0.3);
    padding: 6px 10px;
    border-radius: 8px;
}

.btn-harbor-util.locked-manifest {
    opacity: 0.55;
    cursor: not-allowed;
    border-style: dashed;
}

.galleon-scale-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(185, 28, 28, 0.35);
    border: 1px solid #f87171;
    color: #fecaca;
    margin-left: 6px;
}

.sloop-scale-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(2, 132, 199, 0.3);
    border: 1px solid #38bdf8;
    color: #bae6fd;
    margin-left: 6px;
}

.cap-vector-card.active-vector {
    border-color: rgba(74, 222, 128, 0.55);
    background: rgba(20, 83, 45, 0.25);
}


