﻿
    :root {
      color-scheme: dark;
      --bg: #0c1017;
      --panel: #0f1624e6;
      --panel-strong: #0b1220;
      --accent: #8fd0ff;
      --text: #dbeafe;
      --border: #1f2937;
      --inv-cell: 72px;
      --inv-gap: 8px;
      --phoenix-ember: #f97316;
      --phoenix-gold: #fbbf24;
      --phoenix-ice: #93c5fd;
    }
    body, html {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
      background: radial-gradient(circle at 20% 20%, #111827, #0a0f18 40%, #0a0c10 90%);
      color: var(--text);
      font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
      overflow: hidden;
    }
    #map-frame {
      position: relative;
      margin: 24px auto;
      width: calc(100vw - 80px);
      height: calc(100vh - 120px);
      max-width: 1600px;
      border-radius: 18px;
      overflow: hidden;
      box-shadow: 0 20px 40px #000c, 0 0 0 2px #0b1220, inset 0 0 0 1px #0b1220;
      background: #05070c;
    }
    #map {
      position: absolute;
      inset: 0;
      background:
        radial-gradient(circle at 30% 30%, rgba(16, 52, 44, 0.85), rgba(6, 12, 18, 0.95) 60%),
        linear-gradient(160deg, #0a1018, #0b1220 45%, #090d14 100%);
    }
    body.intro-active #map {
      opacity: 0;
    }
    #map-loading {
      position: absolute;
      inset: 0;
      z-index: 1500;
      display: none;
      align-items: center;
      justify-content: center;
      background: linear-gradient(120deg, rgba(5, 8, 14, 0.78), rgba(12, 18, 28, 0.62));
      backdrop-filter: blur(4px);
      pointer-events: none;
    }
    body.intro-active #map-loading {
      display: none !important;
    }
    #intro-overlay {
      position: absolute;
      inset: 0;
      z-index: 1800;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      background: rgba(6, 10, 18, 0.42);
      backdrop-filter: blur(8px) saturate(115%);
      overflow: hidden;
      isolation: isolate;
    }
    #intro-overlay::before {
      content: "";
      position: absolute;
      inset: 0;
      background:
        linear-gradient(135deg, rgba(7, 10, 18, 0.65), rgba(5, 8, 14, 0.35)),
        radial-gradient(circle at 50% 30%, rgba(251, 191, 36, 0.18), rgba(0, 0, 0, 0) 60%);
      opacity: 0.8;
      pointer-events: none;
      z-index: 0;
    }
    #intro-overlay::after {
      content: "";
      position: absolute;
      inset: -30%;
      background: radial-gradient(circle, rgba(249, 115, 22, 0.16), rgba(0, 0, 0, 0) 60%);
      opacity: 0.65;
      pointer-events: none;
      animation: introGlow 3.6s ease-in-out infinite;
      z-index: 0;
    }
    .intro-videos {
      position: absolute;
      inset: 0;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: repeat(2, minmax(0, 1fr));
      gap: 0;
      padding: 0;
      overflow: hidden;
      z-index: 1;
      pointer-events: none;
    }
    .intro-videos::before,
    .intro-videos::after {
      content: "";
      position: absolute;
      pointer-events: none;
      background: var(--phoenix-gold);
      z-index: 2;
      opacity: 0.75;
    }
    .intro-videos::before {
      top: 0;
      bottom: 0;
      width: 1px;
      left: 50%;
      transform: translateX(-0.5px);
    }
    .intro-videos::after {
      left: 0;
      right: 0;
      height: 1px;
      top: 50%;
      transform: translateY(-0.5px);
    }
    .intro-video-tile {
      position: relative;
      overflow: hidden;
      background: #05070c;
    }
    .intro-video-tile::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, rgba(3, 6, 12, 0.35), rgba(3, 6, 12, 0.08));
    }
    .intro-video {
      width: 100%;
      height: 100%;
      object-fit: cover;
      filter: saturate(0.95) contrast(1.08) brightness(0.82);
      background: #05070c;
    }
    #intro-overlay.video-disabled .intro-video {
      display: none;
    }
    #intro-overlay.video-disabled .intro-video-tile {
      background: #05070c;
    }
    .intro-shell {
      position: relative;
      z-index: 3;
      display: grid;
      gap: 14px;
      align-items: center;
      justify-items: center;
    }
    .intro-start {
      display: grid;
      gap: 12px;
      align-items: center;
      justify-items: center;
      padding: 26px 34px 22px;
      border-radius: 24px;
      border: 1px solid #1f2937;
      background:
        radial-gradient(circle at 30% 20%, rgba(15, 38, 70, 0.4), rgba(5, 8, 14, 0.95) 65%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(8, 12, 20, 0.96));
      color: #f8fafc;
      box-shadow: 0 28px 54px #000c, inset 0 0 0 1px #0b1220;
      cursor: pointer;
      transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    }
    .intro-start img {
      width: min(300px, 68vw);
      height: auto;
      filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55));
    }
    .intro-title {
      font-size: 20px;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      color: #fef3c7;
    }
    .intro-subtitle {
      font-size: 12px;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--phoenix-ice);
    }
    .intro-cta {
      font-size: 12px;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--phoenix-gold);
    }
    .intro-hint {
      font-size: 12px;
      color: #cbd5e1;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }
    .intro-start:hover {
      transform: translateY(-2px) scale(1.01);
      border-color: var(--phoenix-ember);
      box-shadow: 0 34px 62px #000d, inset 0 0 0 1px var(--phoenix-ember);
    }
    .intro-start:focus-visible {
      outline: 2px solid var(--phoenix-gold);
      outline-offset: 4px;
    }
    @keyframes introGlow {
      0% { opacity: 0.45; transform: scale(0.96); }
      50% { opacity: 0.85; transform: scale(1); }
      100% { opacity: 0.45; transform: scale(0.96); }
    }
    @media (max-width: 720px) {
      .intro-videos {
        inset: 0;
      }
    }
    body:not(.intro-active) #intro-overlay {
      display: none;
    }
    body.intro-active #hud-top,
    body.intro-active #controls,
    body.intro-active #tasks-panel {
      opacity: 0;
      pointer-events: none;
      transform: translateY(-6px);
    }
    .loading-card {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 16px 20px;
      border-radius: 14px;
      border: 1px solid #1f2937;
      background: linear-gradient(135deg, rgba(10, 16, 28, 0.95), rgba(6, 10, 18, 0.95));
      box-shadow: 0 18px 40px #000c, inset 0 0 0 1px #0b1220;
      color: #e2e8f0;
    }
    .loading-spinner {
      width: 42px;
      height: 42px;
      border-radius: 50%;
      border: 3px solid #1f2937;
      border-top-color: #f97316;
      animation: loadingSpin 0.9s linear infinite;
    }
    .loading-text {
      display: grid;
      gap: 4px;
      letter-spacing: 0.02em;
    }
    #map-loading-title {
      font-weight: 800;
      text-transform: uppercase;
      font-size: 12px;
      color: #fef3c7;
    }
    #map-loading-sub {
      font-size: 12px;
      color: #cbd5e1;
    }
    @keyframes loadingSpin {
      to { transform: rotate(360deg); }
    }
    #controls,
    #tasks-panel {
      position: absolute;
      top: 82px;
      left: 16px;
      z-index: 1000;
      background: radial-gradient(circle at 20% 20%, #0f1626, #0b111f 55%, #080d18 100%);
      backdrop-filter: blur(12px);
      padding: 10px 12px;
      border-radius: 14px;
      box-shadow: 0 18px 38px #000c, inset 0 0 0 1px #111827, 0 0 0 1px #0f172a;
      width: 200px;
      max-width: calc(100vw - 32px);
      max-height: calc(100vh - 120px);
      overflow: hidden;
      border: 1px solid #1f2937;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    #controls h1,
    #tasks-panel h1 {
      margin: 0 0 6px;
      font-size: 16px;
      letter-spacing: 0.02em;
    }
    #search { display: none; }
    #status { display: none; }
    #inventory-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.45);
      backdrop-filter: blur(3px);
      z-index: 3000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    .inventory-window {
      position: absolute;
      min-width: 520px;
      max-width: 900px;
      width: 72vw;
      background: linear-gradient(135deg, #0b111c, #0f172a);
      border: 1px solid #1f2937;
      border-radius: 14px;
      box-shadow: 0 24px 48px #000c, inset 0 0 0 1px #0b1220;
      color: #e5e7eb;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      cursor: default;
    }
    .inventory-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 14px;
      background: radial-gradient(circle at 20% 20%, #111827, #0b1220 60%);
      border-bottom: 1px solid #1f2937;
      cursor: move;
    }
    .inventory-title {
      margin: 0;
      font-size: 14px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #fef3c7;
    }
    .inventory-close {
      background: #1f2937;
      border: 1px solid #334155;
      color: #f8fafc;
      border-radius: 8px;
      padding: 6px 10px;
      cursor: pointer;
      font-weight: 700;
    }
    .inventory-body {
      padding: 10px 14px 16px;
      max-height: 70vh;
      overflow: auto;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(var(--inv-cell), var(--inv-cell)));
      grid-auto-rows: var(--inv-cell);
      gap: var(--inv-gap);
      align-items: stretch;
      justify-items: stretch;
      align-content: start;
      justify-content: start;
      background:
        repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 1px, transparent 1px, transparent calc(var(--inv-cell) + var(--inv-gap))),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 1px, transparent 1px, transparent calc(var(--inv-cell) + var(--inv-gap))),
        linear-gradient(180deg, #0d1524, #0a0f1b);
    }
    .inventory-body.tasks-mode {
      display: flex;
      flex-direction: column;
      gap: 10px;
      background: linear-gradient(180deg, #0d1524, #0a0f1b);
    }
    .inventory-body.supplies-mode,
    .inventory-body.access-mode,
    .inventory-body.boss-mode,
    .inventory-body.containers-mode,
    .inventory-body.loot-mode,
    .inventory-body.dead-mode,
    .inventory-body.poi-mode,
    .inventory-body.glitch-mode,
    .inventory-body.parkour-mode,
    .inventory-body.lore-mode {
      display: flex;
      flex-direction: column;
      gap: 10px;
      background: linear-gradient(180deg, #0d1524, #0a0f1b);
    }
    .inventory-tabs {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
      gap: 6px;
      padding: 0 12px 10px;
    }
    .inventory-tab {
      padding: 7px 10px;
      border-radius: 10px;
      border: 1px solid #1f2738;
      background: linear-gradient(145deg, #0f172a, #0a0f1d);
      color: #cbd5e1;
      cursor: pointer;
      font-weight: 700;
      font-size: 12px;
      letter-spacing: 0.03em;
      box-shadow: inset 0 0 0 1px #0b1220, 0 6px 14px #000a;
      text-align: center;
    }
    .inventory-tab.active {
      border-color: #f97316;
      background: linear-gradient(145deg, #1b273d, #111a2c);
      color: #fef3c7;
      box-shadow: 0 8px 18px #000c, inset 0 0 0 1px #f97316;
    }
    .inventory-body.dashboard-mode {
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 14px 14px 18px;
      background: linear-gradient(180deg, #0d1526, #0b111d 60%, #0a0f1a);
      border-top: 1px solid #1f2937;
    }
    .dash-hero {
      display: grid;
      grid-template-columns: 1.4fr 1fr;
      gap: 14px;
      padding: 14px;
      background: linear-gradient(135deg, #10192a, #0c1322);
      border: 1px solid #1f2937;
      border-radius: 12px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .dash-hero .eyebrow {
      font-size: 11px;
      letter-spacing: 0.14em;
      color: #9ca3af;
      text-transform: uppercase;
      margin: 0 0 4px;
    }
    .dash-hero h4 {
      margin: 0 0 8px;
      font-size: 18px;
      letter-spacing: 0.06em;
      color: #fef3c7;
    }
    .dash-hero p {
      margin: 0 0 8px;
      color: #cbd5e1;
      line-height: 1.5;
    }
    .dash-guidelines {
      margin: 0;
      padding-left: 16px;
      color: #e2e8f0;
      line-height: 1.5;
    }
    .dash-guidelines li {
      margin: 4px 0;
    }
    .dash-hero .hero-meta {
      display: grid;
      gap: 8px;
      align-content: start;
    }
    .hero-pill {
      padding: 10px 12px;
      border: 1px solid #1f2937;
      border-radius: 10px;
      background: linear-gradient(145deg, #0f172a, #0b111d);
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .hero-pill strong {
      display: block;
      color: #fef3c7;
      letter-spacing: 0.04em;
      margin-bottom: 4px;
    }
    .hero-pill span {
      color: #94a3b8;
      font-size: 12px;
      letter-spacing: 0.04em;
    }
    .dash-search {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 12px 14px;
      background: #0c1322;
      border: 1px solid #1f2937;
      border-radius: 12px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .dash-search label {
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #e5e7eb;
    }
    .dash-search input {
      width: 100%;
      padding: 10px 12px;
      border-radius: 10px;
      border: 1px solid #1f2937;
      background: #0b111c;
      color: #e5e7eb;
      font-size: 13px;
      letter-spacing: 0.02em;
    }
    .dash-search input:focus {
      outline: 1px solid #f97316;
      border-color: #f97316;
      box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
    }
    .dash-search .hint {
      color: #94a3b8;
      font-size: 12px;
      letter-spacing: 0.04em;
    }
    .dash-search-results {
      display: grid;
      gap: 8px;
    }
    .dash-search-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: #0e1524;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 10px 12px;
      color: #e5e7eb;
      cursor: pointer;
      text-align: left;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .dash-search-row:hover {
      border-color: #f97316;
      box-shadow: 0 8px 16px #000c, inset 0 0 0 1px #f97316;
    }
    .dash-search-row .meta {
      color: #9ca3af;
      font-size: 11px;
      letter-spacing: 0.04em;
    }
    .dash-search-empty {
      padding: 10px 12px;
      color: #9ca3af;
      background: #0e1524;
      border: 1px dashed #1f2937;
      border-radius: 10px;
    }
    .dash-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 12px;
    }
    .dash-card {
      background: #0c1322;
      border: 1px solid #1f2937;
      border-radius: 12px;
      box-shadow: inset 0 0 0 1px #0b1220;
      padding: 12px;
      display: grid;
      grid-template-columns: 1.2fr 1fr;
      gap: 12px;
      align-items: stretch;
    }
    .dash-card h5 {
      margin: 2px 0 6px;
      font-size: 15px;
      letter-spacing: 0.04em;
      color: #fef3c7;
    }
    .dash-card p {
      margin: 0 0 8px;
      color: #cbd5e1;
      line-height: 1.5;
    }
    .dash-card .tab-tag {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: #111a2d;
      border: 1px solid #1f2937;
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 11px;
      letter-spacing: 0.04em;
      color: #e2e8f0;
      width: fit-content;
    }
    .dash-card .tab-tag .dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #f97316;
      box-shadow: 0 0 0 2px #0b111c;
    }
    .dash-card .note {
      color: #94a3b8;
      font-size: 12px;
      letter-spacing: 0.03em;
    }
    .media-frame {
      position: relative;
      width: 100%;
      padding-top: 56%;
      border: 1px dashed #334155;
      border-radius: 10px;
      background: repeating-linear-gradient(135deg, #0e1524, #0e1524 12px, #0c1322 12px, #0c1322 24px);
      box-shadow: inset 0 0 0 1px #0b1220;
      overflow: hidden;
    }
    .media-frame::after {
      content: attr(data-label);
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #94a3b8;
      font-size: 12px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      background: linear-gradient(180deg, rgba(8, 12, 20, 0.55), rgba(8, 12, 20, 0.7));
    }
    .media-frame video {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      background: #0b1220;
    }
    .media-frame.has-media::after {
      content: "";
      background: transparent;
    }
    @media (max-width: 900px) {
      .dash-hero {
        grid-template-columns: 1fr;
      }
      .dash-card {
        grid-template-columns: 1fr;
      }
    }
    .inv-slot {
      position: relative;
      border: 1px solid #1f2738;
      border-radius: 6px;
      background: linear-gradient(145deg, #0e1524, #0b111c);
      width: 100%;
      height: 100%;
      min-height: 0;
      padding: 6px;
      box-sizing: border-box;
      display: grid;
      place-items: center;
      box-shadow: inset 0 0 0 1px #0b1220, 0 3px 8px #0008;
      cursor: pointer;
      transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
    }
    .inv-slot:hover { transform: translateY(-1px); box-shadow: 0 8px 16px #000c, inset 0 0 0 1px #334155; }
    .inv-slot.active { border-color: #f97316; box-shadow: 0 8px 16px #f9731633, inset 0 0 0 1px #f97316; }
    .inv-slot .slot-image { display: block; width: 100%; height: 100%; border-radius: 4px; }
    .inv-slot .slot-icon {
      width: 22px;
      height: 22px;
      border-radius: 4px;
      background: #0b1220;
      border: 1px solid #1f2937;
      box-shadow: 0 0 0 1px #0b1220;
      object-fit: contain;
      display: block;
      max-width: 32px;
      max-height: 32px;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
    .inv-slot .slot-dot {
      width: 10px;
      height: 10px;
      border-radius: 3px;
      box-shadow: 0 0 0 2px #0b1220;
      display: block;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
    .inv-slot .slot-name {
      position: absolute;
      bottom: 2px;
      left: 3px;
      right: 3px;
      font-size: 9px;
      line-height: 1.2;
      font-weight: 700;
      letter-spacing: 0.04em;
      color: #cbd5e1;
      text-align: center;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .inv-slot .slot-badge {
      position: absolute;
      top: 8px;
      right: 8px;
      background: #0ea5e9;
      color: #0b0f16;
      border-radius: 8px;
      padding: 2px 6px;
      font-size: 10px;
      font-weight: 800;
    }
    .inv-tooltip {
      position: fixed;
      z-index: 4000;
      background: #0b1220;
      color: #e5e7eb;
      border: 1px solid #1f2738;
      border-radius: 10px;
      padding: 10px 12px;
      box-shadow: 0 12px 24px #000c, inset 0 0 0 1px #0b1220;
      min-width: 200px;
      max-width: 320px;
      display: none;
      pointer-events: none;
    }
    .inv-tooltip .tooltip-preview {
      width: 100%;
      max-height: 160px;
      object-fit: cover;
      border: 1px solid #1f2738;
      border-radius: 8px;
      box-shadow: inset 0 0 0 1px #0b1220;
      margin-bottom: 8px;
      display: none;
    }
    .inv-tooltip h4 {
      margin: 0 0 6px;
      font-size: 13px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .inv-tooltip .meta {
      font-size: 11px;
      color: #cbd5e1;
      line-height: 1.5;
    }
    .task-tooltip,
    .boss-tooltip {
      position: fixed;
      z-index: 3500;
      background: #0b1220;
      color: #e5e7eb;
      border: 1px solid #1f2738;
      border-radius: 12px;
      padding: 12px 14px;
      box-shadow: 0 16px 32px #000c, inset 0 0 0 1px #0b1220;
      min-width: 260px;
      max-width: 360px;
      display: none;
      pointer-events: none;
    }
    .task-tooltip h4,
    .boss-tooltip h4 {
      margin: 0 0 6px;
      font-size: 14px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .task-tooltip .meta,
    .boss-tooltip .meta {
      font-size: 11px;
      color: #cbd5e1;
      line-height: 1.5;
      margin-bottom: 8px;
    }
    .task-tooltip .brief {
      font-size: 12px;
      line-height: 1.5;
      color: #e2e8f0;
      white-space: pre-wrap;
    }
    .task-tooltip img.preview,
    .boss-tooltip img.preview {
      display: block;
      width: 100%;
      max-height: 160px;
      object-fit: cover;
      border-radius: 10px;
      border: 1px solid #1f2738;
      box-shadow: 0 10px 20px #000a;
      margin-bottom: 10px;
    }
    .trace-line {
      animation: tracePulse 1s infinite;
    }
    @keyframes tracePulse {
      0% { opacity: 0.4; stroke-dashoffset: 0; }
      50% { opacity: 0.9; stroke-dashoffset: 12; }
      100% { opacity: 0.4; stroke-dashoffset: 24; }
    }
    .popup-desc {
      margin-top: 6px;
      font-size: 12px;
      line-height: 1.5;
      color: #000;
    }
    .popup-tasks {
      margin-top: 8px;
      padding-top: 6px;
      border-top: 1px solid #1f2738;
    }
    .popup-task {
      margin-top: 6px;
      font-size: 12px;
      line-height: 1.4;
    }
    .popup-task-name {
      font-weight: 700;
      color: #fef3c7;
    }
    .popup-task-brief {
      color: #000;
      margin-top: 2px;
    }
    /* Popup preview sizing */
    .leaflet-popup-content img.preview {
      display: block;
      width: 100%;
      max-width: 240px;
      max-height: 180px;
      object-fit: cover;
      border-radius: 10px;
      border: 1px solid #1f2738;
      box-shadow: 0 8px 18px #000a;
      margin-top: 8px;
    }
    .popup-media {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: flex-start;
      margin-top: 8px;
    }
    .popup-media .key-thumb {
      max-width: 140px;
      width: 38%;
      min-width: 110px;
      object-fit: contain;
      background: #0b1220;
    }
    /* Tasks */
    #tasks-panel { display:none; width: 360px; }
    .task-filters { margin-top: 8px; font-size: 13px; display: grid; gap: 8px; }
    .task-group {
      background: #0b1220;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
      overflow: hidden;
    }
    .task-group.collapsed .task-list { display: none; }
    .task-group header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-weight: 700;
      color: #dbeafe;
    }
    .task-header-main { display: flex; align-items: center; gap: 8px; }
    .task-caret { font-size: 16px; color: #93c5fd; transition: transform 120ms ease; }
    .task-group.collapsed .task-caret { transform: rotate(-90deg); }
    .task-count { color: #9ca3af; font-weight: 600; font-size: 12px; }
    .task-select-all {
      background: #111827;
      border: 1px solid #1f2937;
      color: #bfdbfe;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
    }
    .task-select-all:hover { border-color: #2563eb; color: #f8fafc; }
    .task-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; margin-top: 6px; }
    .task-item {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 6px 10px;
      font-size: 12px;
      align-items: flex-start;
      padding: 6px 8px;
      border-radius: 8px;
      border: 1px solid #111827;
      background: #0b1220;
    }
    .task-item:hover { border-color: #1e3a8a; }
    .task-title { font-weight: 700; color: #e5e7eb; }
    .task-meta { color: #9ca3af; font-size: 11px; }
    .task-group.vendor-with-image {
      border-color: #1e293b;
      box-shadow: 0 10px 24px #000b, inset 0 0 0 1px #0f172a;
    }
    .task-group.vendor-with-image header {
      position: relative;
      padding: 10px 12px;
      border-radius: 10px;
      background:
        linear-gradient(100deg, rgba(7, 11, 19, 0.92), rgba(7, 11, 19, 0.55)),
        var(--vendor-image, radial-gradient(circle at 30% 40%, #0f172a, #0b1220));
      background-size: cover;
      background-position: center;
      border: 1px solid #1f2937;
      box-shadow: inset 0 0 0 1px #0b1220, 0 8px 18px #000a;
    }
    .task-group.vendor-with-image header::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: 10px;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
      pointer-events: none;
    }
    .task-group.vendor-with-image .task-select-all {
      background: rgba(17, 24, 39, 0.85);
      border-color: #1f2937;
    }
    .vendor-badge {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      background-size: cover;
      background-position: center;
      border: 1px solid #1f2937;
      box-shadow: inset 0 0 0 1px #0b1220, 0 8px 18px #000a;
      flex-shrink: 0;
    }

    /* Supplies accordion */
    .supply-group {
      background: #0b1220;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
    }
    .supply-group.collapsed .supply-list { display: none; }
    .supply-group.collapsed .supply-subgroup { display: none; }
    .supply-group.collapsed .supply-subgroup { display: none; }
    .supply-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-weight: 700;
      color: #e5e7eb;
      gap: 8px;
    }
    .supply-header-main { display: flex; align-items: center; gap: 8px; }
    .supply-caret { font-size: 16px; color: #93c5fd; transition: transform 120ms ease; }
    .supply-group.collapsed .supply-caret { transform: rotate(-90deg); }
    .supply-count { color: #9ca3af; font-weight: 600; font-size: 12px; }
    .supply-select-all {
      background: #111827;
      border: 1px solid #1f2937;
      color: #bfdbfe;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
    }
    .supply-select-all:hover { border-color: #2563eb; color: #f8fafc; }
    .supply-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
      gap: 6px;
      margin-top: 8px;
      padding: 6px 4px;
    }
    .supply-list .inv-slot { min-height: 54px; padding: 6px; }
    .supply-subgroup {
      margin-top: 8px;
      background: #0d1526;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .supply-subheader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: #e5e7eb;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .supply-subheader .sub-caret {
      font-size: 14px;
      color: #93c5fd;
      transition: transform 120ms ease;
    }
    .supply-subgroup.collapsed .supply-sublist { display: none; }
    .supply-subgroup.collapsed .sub-caret { transform: rotate(-90deg); }
    .supply-subtitle { color: #f8fafc; }
    .supply-subcount { color: #94a3b8; font-size: 11px; }
    .supply-sublist {
      margin-top: 6px;
      padding-top: 4px;
      border-top: 1px solid #111827;
    }
    /* Containers accordion */
    .container-group {
      background: #0b1220;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
    }
    .container-group.collapsed .container-list { display: none; }
    .container-group.collapsed .container-subgroup { display: none; }
    .container-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-weight: 700;
      color: #e5e7eb;
      gap: 8px;
    }
    .container-header-main { display: flex; align-items: center; gap: 8px; }
    .container-caret { font-size: 16px; color: #93c5fd; transition: transform 120ms ease; }
    .container-group.collapsed .container-caret { transform: rotate(-90deg); }
    .container-count { color: #9ca3af; font-weight: 600; font-size: 12px; }
    .container-title { color: #e5e7eb; letter-spacing: 0.02em; }
    .container-select-all {
      background: #111827;
      border: 1px solid #1f2937;
      color: #bfdbfe;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
    }
    .container-select-all:hover { border-color: #2563eb; color: #f8fafc; }
    .container-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
      gap: 6px;
      margin-top: 8px;
      padding: 6px 4px;
    }
    .container-list .inv-slot { min-height: 54px; padding: 6px; }
    .container-subgroup {
      margin-top: 8px;
      background: #0d1526;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .container-subheader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: #e5e7eb;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .container-subheader .sub-caret {
      font-size: 14px;
      color: #93c5fd;
      transition: transform 120ms ease;
    }
    .container-subgroup.collapsed .container-sublist { display: none; }
    .container-subgroup.collapsed .sub-caret { transform: rotate(-90deg); }
    .container-subtitle { color: #f8fafc; }
    .container-subcount { color: #94a3b8; font-size: 11px; }
    .container-sublist {
      margin-top: 6px;
      padding-top: 4px;
      border-top: 1px solid #111827;
    }
    /* Loot accordion */
    .loot-group {
      background: #0b1220;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
    }
    .loot-group.collapsed .loot-list { display: none; }
    .loot-group.collapsed .loot-subgroup { display: none; }
    .loot-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-weight: 700;
      color: #e5e7eb;
      gap: 8px;
    }
    .loot-header-main { display: flex; align-items: center; gap: 8px; }
    .loot-caret { font-size: 16px; color: #93c5fd; transition: transform 120ms ease; }
    .loot-group.collapsed .loot-caret { transform: rotate(-90deg); }
    .loot-count { color: #9ca3af; font-weight: 600; font-size: 12px; }
    .loot-title { color: #e5e7eb; letter-spacing: 0.02em; }
    .loot-select-all {
      background: #111827;
      border: 1px solid #1f2937;
      color: #bfdbfe;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
    }
    .loot-select-all:hover { border-color: #2563eb; color: #f8fafc; }
    .loot-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
      gap: 6px;
      margin-top: 8px;
      padding: 6px 4px;
    }
    .loot-list .inv-slot { min-height: 54px; padding: 6px; }
    .loot-subgroup {
      margin-top: 8px;
      background: #0d1526;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .loot-subheader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: #e5e7eb;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .loot-subheader .sub-caret {
      font-size: 14px;
      color: #93c5fd;
      transition: transform 120ms ease;
    }
    .loot-subgroup.collapsed .loot-sublist { display: none; }
    .loot-subgroup.collapsed .sub-caret { transform: rotate(-90deg); }
    .loot-subtitle { color: #f8fafc; }
    .loot-subcount { color: #94a3b8; font-size: 11px; }
    .loot-sublist {
      margin-top: 6px;
      padding-top: 4px;
      border-top: 1px solid #111827;
    }
    /* Dead bodies accordion */
    .dead-group {
      background: #0b1220;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
    }
    .dead-group.collapsed .dead-list { display: none; }
    .dead-group.collapsed .dead-subgroup { display: none; }
    .dead-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-weight: 700;
      color: #e5e7eb;
      gap: 8px;
    }
    .dead-header-main { display: flex; align-items: center; gap: 8px; }
    .dead-caret { font-size: 16px; color: #93c5fd; transition: transform 120ms ease; }
    .dead-group.collapsed .dead-caret { transform: rotate(-90deg); }
    .dead-count { color: #9ca3af; font-weight: 600; font-size: 12px; }
    .dead-title { color: #e5e7eb; letter-spacing: 0.02em; }
    .dead-select-all {
      background: #111827;
      border: 1px solid #1f2937;
      color: #bfdbfe;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
    }
    .dead-select-all:hover { border-color: #2563eb; color: #f8fafc; }
    .dead-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
      margin-top: 8px;
      padding: 10px 6px;
    }
    .dead-list .inv-slot {
      min-height: 200px;
      padding: 0;
      display: block;
    }
    .dead-subgroup {
      margin-top: 8px;
      background: #0d1526;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .dead-subheader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: #e5e7eb;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .dead-subheader .sub-caret {
      font-size: 14px;
      color: #93c5fd;
      transition: transform 120ms ease;
    }
    .dead-subgroup.collapsed .dead-sublist { display: none; }
    .dead-subgroup.collapsed .sub-caret { transform: rotate(-90deg); }
    .dead-subtitle { color: #f8fafc; }
    .dead-subcount { color: #94a3b8; font-size: 11px; }
    .dead-sublist {
      margin-top: 6px;
      padding-top: 4px;
      border-top: 1px solid #111827;
    }
    .dead-previews {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
      gap: 4px;
      padding: 6px;
    }
    .dead-previews .dead-thumb {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 6px;
      border: 1px solid #0b1220;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    /* POIs accordion */
    .poi-group {
      background: #0b1220;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
    }
    .poi-group.collapsed .poi-list { display: none; }
    .poi-group.collapsed .poi-subgroup { display: none; }
    .poi-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-weight: 700;
      color: #e5e7eb;
      gap: 8px;
    }
    .poi-header-main { display: flex; align-items: center; gap: 8px; }
    .poi-caret { font-size: 16px; color: #93c5fd; transition: transform 120ms ease; }
    .poi-group.collapsed .poi-caret { transform: rotate(-90deg); }
    .poi-count { color: #9ca3af; font-weight: 600; font-size: 12px; }
    .poi-title { color: #e5e7eb; letter-spacing: 0.02em; }
    .poi-select-all {
      background: #111827;
      border: 1px solid #1f2937;
      color: #bfdbfe;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
    }
    .poi-select-all:hover { border-color: #2563eb; color: #f8fafc; }
    .poi-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
      gap: 6px;
      margin-top: 8px;
      padding: 6px 4px;
    }
    .poi-list .inv-slot { min-height: 54px; padding: 6px; }
    .poi-subgroup {
      margin-top: 8px;
      background: #0d1526;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .poi-subheader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: #e5e7eb;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .poi-subheader .sub-caret {
      font-size: 14px;
      color: #93c5fd;
      transition: transform 120ms ease;
    }
    .poi-subgroup.collapsed .poi-sublist { display: none; }
    .poi-subgroup.collapsed .sub-caret { transform: rotate(-90deg); }
    .poi-subtitle { color: #f8fafc; }
    .poi-subcount { color: #94a3b8; font-size: 11px; }
    .poi-sublist {
      margin-top: 6px;
      padding-top: 4px;
      border-top: 1px solid #111827;
    }
    /* Glitches accordion */
    .glitch-group {
      background: #0b1220;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
    }
    .glitch-group.collapsed .glitch-list { display: none; }
    .glitch-group.collapsed .glitch-subgroup { display: none; }
    .glitch-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-weight: 700;
      color: #e5e7eb;
      gap: 8px;
    }
    .glitch-header-main { display: flex; align-items: center; gap: 8px; }
    .glitch-caret { font-size: 16px; color: #93c5fd; transition: transform 120ms ease; }
    .glitch-group.collapsed .glitch-caret { transform: rotate(-90deg); }
    .glitch-count { color: #9ca3af; font-weight: 600; font-size: 12px; }
    .glitch-title { color: #e5e7eb; letter-spacing: 0.02em; }
    .glitch-select-all {
      background: #111827;
      border: 1px solid #1f2937;
      color: #bfdbfe;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
    }
    .glitch-select-all:hover { border-color: #2563eb; color: #f8fafc; }
    .glitch-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
      gap: 6px;
      margin-top: 8px;
      padding: 6px 4px;
    }
    .glitch-list .inv-slot { min-height: 54px; padding: 6px; }
    .glitch-subgroup {
      margin-top: 8px;
      background: #0d1526;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .glitch-subheader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: #e5e7eb;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .glitch-subheader .sub-caret {
      font-size: 14px;
      color: #93c5fd;
      transition: transform 120ms ease;
    }
    .glitch-subgroup.collapsed .glitch-sublist { display: none; }
    .glitch-subgroup.collapsed .sub-caret { transform: rotate(-90deg); }
    .glitch-subtitle { color: #f8fafc; }
    .glitch-subcount { color: #94a3b8; font-size: 11px; }
    .glitch-sublist {
      margin-top: 6px;
      padding-top: 4px;
      border-top: 1px solid #111827;
    }
    /* Boss accordion */
    .boss-group {
      display: flex;
      flex-direction: column;
      gap: 8px;
      background: #0b1220;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
      overflow: visible;
    }
    .boss-group.collapsed .boss-list { display: none; }
    .boss-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-weight: 700;
      color: #e5e7eb;
      gap: 8px;
    }
    .boss-header-main { display: flex; align-items: center; gap: 8px; }
    .boss-caret { font-size: 16px; color: #93c5fd; transition: transform 120ms ease; }
    .boss-group.collapsed .boss-caret { transform: rotate(-90deg); }
    .boss-count { color: #9ca3af; font-weight: 600; font-size: 12px; }
    .boss-title { color: #e5e7eb; letter-spacing: 0.02em; }
    .boss-group.with-preview {
      border-color: #1e293b;
      box-shadow: 0 10px 24px #000b, inset 0 0 0 1px #0f172a;
    }
    .boss-group.with-preview .boss-header {
      min-height: 120px;
      position: relative;
      padding: 10px 12px;
      border-radius: 10px;
      background:
        linear-gradient(100deg, rgba(7, 11, 19, 0.92), rgba(7, 11, 19, 0.55)),
        var(--boss-image, radial-gradient(circle at 30% 40%, #0f172a, #0b1220));
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      border: 1px solid #1f2937;
      box-shadow: inset 0 0 0 1px #0b1220, 0 8px 18px #000a;
    }
    .boss-group.with-preview .boss-header::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: 10px;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
      pointer-events: none;
    }
    .boss-badge {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      background-size: cover;
      background-position: center;
      border: 1px solid #1f2937;
      box-shadow: inset 0 0 0 1px #0b1220, 0 8px 18px #000a;
      flex-shrink: 0;
    }
    .boss-select-all {
      background: #111827;
      border: 1px solid #1f2937;
      color: #bfdbfe;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
    }
    .boss-select-all:hover { border-color: #2563eb; color: #f8fafc; }
    .boss-list {
      width: 100%;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 10px;
      margin-top: 8px;
      padding: 8px 6px;
    }
    /* Access accordion (location buckets) */
    .access-group {
      background: #0b1220;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
    }
    .access-group.collapsed .access-list { display: none; }
    .access-group.collapsed .access-subgroup { display: none; }
    .access-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-weight: 700;
      color: #e5e7eb;
      gap: 8px;
    }
    .access-header-main { display: flex; align-items: center; gap: 8px; }
    .access-caret { font-size: 16px; color: #93c5fd; transition: transform 120ms ease; }
    .access-group.collapsed .access-caret { transform: rotate(-90deg); }
    .access-count { color: #9ca3af; font-weight: 600; font-size: 12px; }
    .access-select-all {
      background: #111827;
      border: 1px solid #1f2937;
      color: #bfdbfe;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
    }
    .access-select-all:hover { border-color: #2563eb; color: #f8fafc; }
    .access-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 8px;
      margin-top: 8px;
      padding: 8px 6px;
    }
    .access-list .inv-slot { min-height: 140px; padding: 6px; }
    .slot-image-access {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 6px;
      border: 1px solid #0b1220;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .access-subgroup {
      margin-top: 8px;
      background: #0d1526;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .access-subheader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: #e5e7eb;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .access-subheader .sub-caret {
      font-size: 14px;
      color: #93c5fd;
      transition: transform 120ms ease;
    }
    .access-subgroup.collapsed .access-sublist { display: none; }
    .access-subgroup.collapsed .sub-caret { transform: rotate(-90deg); }
    .access-subtitle { color: #f8fafc; }
    .access-subcount { color: #94a3b8; font-size: 11px; }
    .access-sublist {
      margin-top: 6px;
      padding-top: 4px;
      border-top: 1px solid #111827;
    }
    .access-vendor { color: #e5e7eb; }
    /* Boss cards */
    .inventory-body.boss-mode .boss-list {
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 10px;
    }
    .inventory-body.boss-mode .inv-slot {
      min-height: 300px;
      height: 300px;
      max-height: 60vh;
      padding: 0;
      overflow: hidden;
    }
    .inventory-body.boss-mode .inv-slot .slot-image-boss {
      position: absolute;
      inset: 0;
      width: 100%;
      object-fit: cover;
      object-position: center;
      padding: 6px;
      box-sizing: border-box;
      background: #0b1220;
      border-radius: 4px;
    }
    .inventory-body.boss-mode .inv-slot .slot-name {
      background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.65));
      color: #fef3c7;
      font-size: 11px;
      font-weight: 800;
      text-shadow: 0 1px 3px #000a;
    }
    .inventory-body.supplies-mode .supply-list {
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
      padding: 10px 6px;
    }
    .inventory-body.supplies-mode .inv-slot {
      min-height: 200px;
      padding: 0;
      display: block;
    }
    .inventory-body.supplies-mode .inv-slot .slot-image-supply {
      position: absolute;
      top: 6px;
      left: 6px;
      right: 6px;
      height: 70%;
      max-height: calc(100% - 42px);
      object-fit: cover;
      object-position: center;
      border-radius: 6px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.supplies-mode .inv-slot .slot-name {
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 8px;
      background: linear-gradient(180deg, transparent, rgba(5, 7, 12, 0.8));
      padding: 6px 8px 5px;
      border-radius: 8px;
      color: #f8fafc;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
      line-height: 1.3;
      text-transform: none;
      text-align: left;
      white-space: normal;
      max-height: 3.4em;
      overflow: hidden;
    }
    .inventory-body.supplies-mode .inv-slot .slot-image-supply {
      position: static;
      top: 6px;
      left: 6px;
      right: 6px;
      object-fit: cover;
      object-position: center;
      border-radius: 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.loot-mode .loot-list {
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
      padding: 10px 6px;
    }
    .inventory-body.loot-mode .inv-slot {
      min-height: 200px;
      padding: 0;
      display: block;
    }
    .inventory-body.loot-mode .inv-slot .slot-image-loot {
      position: absolute;
      top: 6px;
      left: 6px;
      right: 6px;
      height: 70%;
      max-height: calc(100% - 42px);
      object-fit: cover;
      object-position: center;
      border-radius: 6px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.loot-mode .inv-slot .slot-name {
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 8px;
      background: linear-gradient(180deg, transparent, rgba(5, 7, 12, 0.8));
      padding: 6px 8px 5px;
      border-radius: 8px;
      color: #f8fafc;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
      line-height: 1.3;
      text-transform: none;
      text-align: left;
      white-space: normal;
      max-height: 3.4em;
      overflow: hidden;
    }
    .inventory-body.loot-mode .inv-slot .slot-image-loot {
      position: static;
      top: 6px;
      left: 6px;
      right: 6px;
      object-fit: cover;
      object-position: center;
      border-radius: 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.dead-mode .dead-list {
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
      padding: 10px 6px;
    }
    .inventory-body.dead-mode .inv-slot {
      min-height: 200px;
      padding: 0;
      display: block;
    }
    .inventory-body.dead-mode .inv-slot .slot-image-dead {
      position: absolute;
      top: 6px;
      left: 6px;
      right: 6px;
      height: 70%;
      max-height: calc(100% - 42px);
      object-fit: cover;
      object-position: center;
      border-radius: 6px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.dead-mode .inv-slot .slot-name {
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 8px;
      background: linear-gradient(180deg, transparent, rgba(5, 7, 12, 0.8));
      padding: 6px 8px 5px;
      border-radius: 8px;
      color: #f8fafc;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
      line-height: 1.3;
      text-transform: none;
      text-align: left;
      white-space: normal;
      max-height: 3.4em;
      overflow: hidden;
    }
    .inventory-body.dead-mode .inv-slot .slot-image-dead {
      position: static;
      top: 6px;
      left: 6px;
      right: 6px;
      object-fit: cover;
      object-position: center;
      border-radius: 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.poi-mode .poi-list {
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
      padding: 10px 6px;
    }
    .inventory-body.poi-mode .inv-slot {
      min-height: 200px;
      padding: 0;
      display: block;
    }
    .inventory-body.poi-mode .inv-slot .slot-image-poi {
      position: absolute;
      top: 6px;
      left: 6px;
      right: 6px;
      height: 70%;
      max-height: calc(100% - 42px);
      object-fit: cover;
      object-position: center;
      border-radius: 6px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.poi-mode .inv-slot .slot-name {
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 8px;
      background: linear-gradient(180deg, transparent, rgba(5, 7, 12, 0.8));
      padding: 6px 8px 5px;
      border-radius: 8px;
      color: #f8fafc;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
      line-height: 1.3;
      text-transform: none;
      text-align: left;
      white-space: normal;
      max-height: 3.4em;
      overflow: hidden;
    }
    .inventory-body.poi-mode .inv-slot .slot-image-poi {
      position: static;
      top: 6px;
      left: 6px;
      right: 6px;
      object-fit: cover;
      object-position: center;
      border-radius: 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.glitch-mode .glitch-list {
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
      padding: 10px 6px;
    }
    .inventory-body.glitch-mode .inv-slot {
      min-height: 200px;
      padding: 0;
      display: block;
    }
    .inventory-body.glitch-mode .inv-slot .slot-image-glitch {
      position: absolute;
      top: 6px;
      left: 6px;
      right: 6px;
      height: 70%;
      max-height: calc(100% - 42px);
      object-fit: cover;
      object-position: center;
      border-radius: 6px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.glitch-mode .inv-slot .slot-name {
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 8px;
      background: linear-gradient(180deg, transparent, rgba(5, 7, 12, 0.8));
      padding: 6px 8px 5px;
      border-radius: 8px;
      color: #f8fafc;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
      line-height: 1.3;
      text-transform: none;
      text-align: left;
      white-space: normal;
      max-height: 3.4em;
      overflow: hidden;
    }
    .inventory-body.glitch-mode .inv-slot .slot-image-glitch {
      position: static;
      top: 6px;
      left: 6px;
      right: 6px;
      object-fit: cover;
      object-position: center;
      border-radius: 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    /* Parkour accordion */
    .parkour-group {
      background: #0b1220;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
    }
    .parkour-group.collapsed .parkour-list { display: none; }
    .parkour-group.collapsed .parkour-subgroup { display: none; }
    .parkour-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-weight: 700;
      color: #e5e7eb;
      gap: 8px;
    }
    .parkour-header-main { display: flex; align-items: center; gap: 8px; }
    .parkour-caret { font-size: 16px; color: #93c5fd; transition: transform 120ms ease; }
    .parkour-group.collapsed .parkour-caret { transform: rotate(-90deg); }
    .parkour-count { color: #9ca3af; font-weight: 600; font-size: 12px; }
    .parkour-title { color: #e5e7eb; letter-spacing: 0.02em; }
    .parkour-select-all {
      background: #111827;
      border: 1px solid #1f2937;
      color: #bfdbfe;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
    }
    .parkour-select-all:hover { border-color: #2563eb; color: #f8fafc; }
    .parkour-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
      gap: 6px;
      margin-top: 8px;
      padding: 6px 4px;
    }
    .parkour-list .inv-slot { min-height: 54px; padding: 6px; }
    .parkour-subgroup {
      margin-top: 8px;
      background: #0d1526;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .parkour-subheader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: #e5e7eb;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .parkour-subheader .sub-caret {
      font-size: 14px;
      color: #93c5fd;
      transition: transform 120ms ease;
    }
    .parkour-subgroup.collapsed .parkour-sublist { display: none; }
    .parkour-subgroup.collapsed .sub-caret { transform: rotate(-90deg); }
    .parkour-subtitle { color: #f8fafc; }
    .parkour-subcount { color: #94a3b8; font-size: 11px; }
    .parkour-sublist {
      margin-top: 6px;
      padding-top: 4px;
      border-top: 1px solid #111827;
    }
    /* Lore accordion */
    .lore-group {
      background: #0b1220;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
    }
    .lore-group.collapsed .lore-list { display: none; }
    .lore-group.collapsed .lore-subgroup { display: none; }
    .lore-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-weight: 700;
      color: #e5e7eb;
      gap: 8px;
    }
    .lore-header-main { display: flex; align-items: center; gap: 8px; }
    .lore-caret { font-size: 16px; color: #93c5fd; transition: transform 120ms ease; }
    .lore-group.collapsed .lore-caret { transform: rotate(-90deg); }
    .lore-count { color: #9ca3af; font-weight: 600; font-size: 12px; }
    .lore-title { color: #e5e7eb; letter-spacing: 0.02em; }
    .lore-select-all {
      background: #111827;
      border: 1px solid #1f2937;
      color: #bfdbfe;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
    }
    .lore-select-all:hover { border-color: #2563eb; color: #f8fafc; }
    .lore-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
      gap: 6px;
      margin-top: 8px;
      padding: 6px 4px;
    }
    .lore-list .inv-slot { min-height: 54px; padding: 6px; }
    .lore-subgroup {
      margin-top: 8px;
      background: #0d1526;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 8px 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .lore-subheader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: #e5e7eb;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .lore-subheader .sub-caret {
      font-size: 14px;
      color: #93c5fd;
      transition: transform 120ms ease;
    }
    .lore-subgroup.collapsed .lore-sublist { display: none; }
    .lore-subgroup.collapsed .sub-caret { transform: rotate(-90deg); }
    .lore-subtitle { color: #f8fafc; }
    .lore-subcount { color: #94a3b8; font-size: 11px; }
    .lore-sublist {
      margin-top: 6px;
      padding-top: 4px;
      border-top: 1px solid #111827;
    }
    .inventory-body.parkour-mode .parkour-list {
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
      padding: 10px 6px;
    }
    .inventory-body.parkour-mode .inv-slot {
      min-height: 200px;
      padding: 0;
      display: block;
    }
    .inventory-body.parkour-mode .inv-slot .slot-image-parkour {
      position: absolute;
      top: 6px;
      left: 6px;
      right: 6px;
      height: 70%;
      max-height: calc(100% - 42px);
      object-fit: cover;
      object-position: center;
      border-radius: 6px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.parkour-mode .inv-slot .slot-name {
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 8px;
      background: linear-gradient(180deg, transparent, rgba(5, 7, 12, 0.8));
      padding: 6px 8px 5px;
      border-radius: 8px;
      color: #f8fafc;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
      line-height: 1.3;
      text-transform: none;
      text-align: left;
      white-space: normal;
      max-height: 3.4em;
      overflow: hidden;
    }
    .inventory-body.parkour-mode .inv-slot .slot-image-parkour {
      position: static;
      top: 6px;
      left: 6px;
      right: 6px;
      object-fit: cover;
      object-position: center;
      border-radius: 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.lore-mode .lore-list {
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
      padding: 10px 6px;
    }
    .inventory-body.lore-mode .inv-slot {
      min-height: 200px;
      padding: 0;
      display: block;
    }
    .inventory-body.lore-mode .inv-slot .slot-image-lore {
      position: absolute;
      top: 6px;
      left: 6px;
      right: 6px;
      height: 70%;
      max-height: calc(100% - 42px);
      object-fit: cover;
      object-position: center;
      border-radius: 6px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.lore-mode .inv-slot .slot-name {
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 8px;
      background: linear-gradient(180deg, transparent, rgba(5, 7, 12, 0.8));
      padding: 6px 8px 5px;
      border-radius: 8px;
      color: #f8fafc;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
      line-height: 1.3;
      text-transform: none;
      text-align: left;
      white-space: normal;
      max-height: 3.4em;
      overflow: hidden;
    }
    .inventory-body.lore-mode .inv-slot .slot-image-lore {
      position: static;
      top: 6px;
      left: 6px;
      right: 6px;
      object-fit: cover;
      object-position: center;
      border-radius: 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.containers-mode .container-list {
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
      padding: 10px 6px;
    }
    .inventory-body.containers-mode .inv-slot {
      min-height: 200px;
      padding: 0;
      display: block;
    }
    .inventory-body.containers-mode .inv-slot .slot-image-container {
      position: absolute;
      top: 6px;
      left: 6px;
      right: 6px;
      height: 70%;
      max-height: calc(100% - 42px);
      object-fit: cover;
      object-position: center;
      border-radius: 6px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.containers-mode .inv-slot .slot-name {
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 8px;
      background: linear-gradient(180deg, transparent, rgba(5, 7, 12, 0.8));
      padding: 6px 8px 5px;
      border-radius: 8px;
      color: #f8fafc;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
      line-height: 1.3;
      text-transform: none;
      text-align: left;
      white-space: normal;
      max-height: 3.4em;
      overflow: hidden;
    }
    .inventory-body.containers-mode .inv-slot .slot-image-container {
      position: static;
      top: 6px;
      left: 6px;
      right: 6px;
      object-fit: cover;
      object-position: center;
      border-radius: 10px;
      box-shadow: inset 0 0 0 1px #0b1220;
    }
    .inventory-body.boss-mode .inv-slot .slot-name {
      position: absolute;
      bottom: 6px;
      left: 6px;
      right: 6px;
      background: linear-gradient(180deg, transparent, rgba(5, 7, 12, 0.75));
      padding: 6px 8px 4px;
      border-radius: 6px;
      font-size: 11px;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: #f8fafc;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }
    .muted { color:#9ca3af; font-size:12px; }
    #hud-top {
      position: absolute;
      top: 16px;
      left: 16px;
      right: 16px;
      z-index: 1200;
      display: flex;
      justify-content: space-between;
      align-items: center;
      pointer-events: none;
    }
    #hud-brand {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      background: #0e1526e6;
      border: 1px solid #1f2937;
      border-radius: 14px;
      padding: 10px 14px;
      box-shadow: 0 10px 20px #000a;
      pointer-events: auto;
    }
    #hud-brand h2 {
      margin: 0;
      font-size: 14px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: #9ec5ff;
    }
    #hud-brand .tagline { margin: 0; font-size: 12px; color: #dbeafe; }
    #credit {
      pointer-events: auto;
      background: linear-gradient(145deg, #0f172a 0%, #0b1220 60%, #1f2937 100%);
      border: 1px solid #334155;
      border-radius: 12px;
      padding: 8px 12px;
      box-shadow: 0 12px 24px #000a, inset 0 0 0 1px #0b1220;
      display: flex;
      align-items: center;
      gap: 10px;
      color: #e5e7eb;
      font-weight: 700;
      letter-spacing: 0.03em;
    }
    #credit img {
      width: 54px;
      height: 54px;
      object-fit: contain;
      filter: drop-shadow(0 6px 16px #000a);
    }
    #credit .byline {
      line-height: 1.2;
      font-size: 13px;
      text-transform: uppercase;
      color: #c7d2fe;
    }
    .exit-home {
      pointer-events: auto;
      margin-left: 12px;
      padding: 10px 14px;
      border-radius: 10px;
      border: 1px solid #1f2937;
      background: linear-gradient(135deg, #0f172a, #111827);
      color: #e5e7eb;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-decoration: none;
      box-shadow: 0 10px 20px #000a, inset 0 0 0 1px #0b1220;
      transition: transform 120ms ease, box-shadow 120ms ease;
    }
    .exit-home:hover { transform: translateY(-1px); box-shadow: 0 14px 28px #000c, inset 0 0 0 1px #334155; }
    .leaflet-control-zoom { display: none !important; }
    @media (max-width: 1100px) {
      #map-frame { width: calc(100vw - 32px); height: calc(100vh - 140px); }
      #controls,
      #tasks-panel { left: 12px; right: 12px; width: auto; max-width: none; }
      .legend { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    }
    @media (max-width: 780px) {
      #map-frame { margin: 12px auto; width: calc(100vw - 12px); height: calc(100vh - 110px); }
      #controls,
      #tasks-panel { top: 70px; }
      #hud-top { flex-direction: column; align-items: flex-start; gap: 8px; }
      #hud-brand, #credit, .exit-home { width: 100%; }
      #credit { order: 3; }
      .pill { width: 100%; justify-content: flex-start; }
      .legend { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
    }

    /* Mobile responsiveness improvements */
    @media (max-width: 600px) {
      #map-frame {
        margin: 8px auto;
        width: calc(100vw - 16px);
        height: calc(100vh - 90px);
        border-radius: 12px;
      }

      #hud-top {
        top: 8px;
        left: 8px;
        right: 8px;
      }

      #hud-brand {
        padding: 8px 10px;
      }

      #hud-brand h2 {
        font-size: 12px;
      }

      #hud-brand .tagline {
        font-size: 10px;
      }

      .exit-home {
        padding: 8px 10px;
        font-size: 12px;
      }

      #controls,
      #tasks-panel {
        top: 60px;
        left: 8px;
        right: 8px;
        width: auto;
        max-width: none;
        min-width: unset;
      }

      .inventory-window {
        min-width: unset;
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        max-height: 85vh;
      }

      .inventory-body {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        --inv-cell: 60px;
        --inv-gap: 6px;
      }

      .inventory-tabs {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 4px;
        padding: 0 8px 8px;
      }

      .inventory-tab {
        padding: 6px 8px;
        font-size: 11px;
      }

      .dash-grid {
        grid-template-columns: 1fr;
      }

      .dash-card {
        grid-template-columns: 1fr;
      }

      .media-frame {
        padding-top: 65%;
      }
    }

    /* Extra small devices */
    @media (max-width: 480px) {
      #map-frame {
        height: calc(100vh - 80px);
      }

      #hud-brand h2 {
        font-size: 11px;
      }

      .exit-home {
        font-size: 11px;
        padding: 7px 9px;
      }

      #controls,
      #tasks-panel {
        top: 55px;
      }

      .inventory-body {
        --inv-cell: 52px;
        --inv-gap: 4px;
      }

      .inv-slot .slot-name {
        font-size: 8px;
        bottom: 1px;
        left: 2px;
        right: 2px;
      }
    }

    /* Landscape orientation adjustments */
    @media (orientation: landscape) and (max-height: 500px) {
      #map-frame {
        height: calc(100vh - 70px);
      }

      #hud-top {
        top: 8px;
      }

      #controls,
      #tasks-panel {
        top: 50px;
      }
    }
  
