/* Self-hosted (public/fonts/) rather than a Google Fonts <link> - no third-party dependency for
   a font the whole site's typography rests on, and one less external request in the critical
   render path. Oswald carries headers/labels/nav (condensed, stencil-adjacent - the "field
   manual" register); IBM Plex Sans carries body/data text. */
@font-face {
  font-family: "Oswald";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/oswald600.woff2") format("woff2");
}
@font-face {
  font-family: "Oswald";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/oswald700.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/plex400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/plex600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/plex700.woff2") format("woff2");
}

:root {
  --bg: #12140f;
  --surface: #1a1d15;
  --surface-raised: #21251a;
  --surface-hover: #2a2f20;
  --border: #3a3f2c;
  --border-soft: #262a1c;
  --text: #eae6d5;
  --text-muted: #a8a487;
  --text-faint: #94916f;
  --accent: #d97a34;
  --accent-strong: #f0934a;
  --accent-ink: #241205;
  --ok: #7fb069;
  --warn: #e0b04a;
  --error: #d9534f;
  --radius-sm: 3px;
  --radius: 6px;
  --radius-lg: 9px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --font-display: "Oswald", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  /* Faint diagonal hatch, not a literal hazard-stripe reproduction - just enough grain that
     large flat panels don't read as plain flat-color divs. Practically invisible at normal
     viewing distance/zoom; deliberately subtle rather than a visible decorative pattern. */
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.012) 0px,
    rgba(255, 255, 255, 0.012) 1px,
    transparent 1px,
    transparent 7px
  );
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
}

/* Scrollbars */
.sidebar-scroll::-webkit-scrollbar,
.quest-list::-webkit-scrollbar {
  width: 9px;
}
.sidebar-scroll::-webkit-scrollbar-track,
.quest-list::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb,
.quest-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover,
.quest-list::-webkit-scrollbar-thumb:hover {
  background: #454b34;
}

/* Visually hidden but still reachable by screen readers/keyboard focus - not display:none, which
   removes it from the accessibility tree too. Used for the map page's <h1> (no room for a visible
   heading in that page's compact header without disrupting the layout, but a screen reader user
   still needs a heading to confirm what page they landed on). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Every page repeats the same nav + Progression dropdown before any real content - a keyboard
   user had no way to jump past it. Hidden the same way as .sr-only above, but ONLY until it
   receives focus (Tab is the very first stop on every page), at which point it becomes a real,
   visible, clearly-labeled control rather than staying invisible to a sighted keyboard user too. */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0.5rem;
  z-index: 200;
  padding: 0.5rem 0.9rem;
  background: var(--accent-strong);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: top 0.15s var(--ease);
}

.skip-link:focus {
  top: 0.5rem;
}

/* ---------- Header ---------- */

header {
  flex-shrink: 0;
  padding: 0.6rem 1.1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(to bottom, var(--surface-raised), var(--surface));
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 5;
}

/* Thin gradient strip along the very top edge - the one deliberate accent flourish on the page,
   kept to a hairline so it reads as a considered detail rather than a decorative banner. */
header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 55%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-right: 0.75rem;
  border-right: 1px solid var(--border-soft);
  margin-right: 0.25rem;
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.brand-name strong {
  color: var(--text);
  font-weight: 700;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.site-nav a {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.site-nav a.active {
  color: var(--accent-strong);
  background: var(--surface-hover);
}

/* ---------- Nav dropdown (Progression, matching tarkov.dev's own top-nav grouping) ---------- */

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.nav-dropdown-toggle::after {
  content: "▾";
  margin-left: 0.3rem;
  font-size: 0.65rem;
  opacity: 0.7;
}

.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown-toggle:focus-visible {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-dropdown-toggle.active {
  color: var(--accent-strong);
  background: var(--surface-hover);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  padding: 0.35rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 40;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a,
.nav-dropdown-disabled {
  display: block;
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.nav-dropdown-menu a {
  color: var(--text);
  text-decoration: none;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  background: var(--surface-hover);
  color: var(--accent-strong);
}

.nav-dropdown-disabled {
  color: var(--text-faint);
  cursor: not-allowed;
}

.field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.field label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

header select {
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

header select:hover {
  border-color: #4a5138;
}

header select:focus-visible,
.btn:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.marker-toggle {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

input[type="range"] {
  accent-color: var(--accent);
}

input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.5rem 0.85rem;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
}

.btn:hover {
  background: #343a25;
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* Admin panel - Disable/Revoke Pro hover red, Grant Pro hover green (see public/admin.js) */
.btn.btn-hover-danger:hover {
  border-color: var(--error);
  color: var(--error);
}

.btn.btn-hover-success:hover {
  border-color: var(--ok);
  color: var(--ok);
}

.btn:active {
  transform: translateY(1px);
}

.btn-icon {
  padding: 0.45rem 0.55rem;
  font-size: 0.7rem;
}

/* The "<<" glyph's own advance width leaves visible whitespace on its right side at this font
   size, reading as right-aligned inside the button even though the box itself is centered. */
#toggle-sidebar {
  text-align: left;
}

.btn-toggle.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

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

.status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.status-ok .status-dot {
  background: var(--ok);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

.status-warn .status-dot {
  background: var(--warn);
  box-shadow: 0 0 6px rgba(234, 182, 84, 0.6);
}

.status-error .status-dot {
  background: var(--error);
  box-shadow: 0 0 6px rgba(241, 101, 101, 0.6);
}

.account-badge {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.account-badge--trial {
  background: var(--surface-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.account-badge--pro,
.account-badge--lifetime {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------- Markers ---------- */

#markers,
#labels,
#hazard-zones {
  position: absolute;
  inset: 0;
  pointer-events: none;
  --marker-scale: 1;
}

#hazard-zones {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hazard-zone {
  fill: rgba(180, 30, 30, 0.3);
  stroke: #e03c3c;
  stroke-width: 2;
  stroke-dasharray: 6, 4;
  vector-effect: non-scaling-stroke;
}

/* Dims the map on any non-ground floor (see app.js's renderFloorDimming) - sits directly above
   the map image and below labels/markers/hazard zones, so those stay fully visible even over a
   dimmed area. Maps with real building-footprint data (calib.floors[].extents[].bounds -
   Customs/Interchange/Reserve/Ground Zero/the Lab) get a precise punched-hole dim around that
   floor's footprint; maps without it (Streets of Tarkov, Woods) get a uniform full-map dim
   instead, matching TTracker's own treatment for the same case. */
#floor-dim-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.floor-dim-rect {
  fill: rgba(0, 0, 0, 0.65);
}

.marker {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: calc(0.65rem * var(--marker-scale));
  white-space: nowrap;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 3px;
}

.marker .marker-icon {
  width: calc(18px * var(--marker-scale));
  height: calc(18px * var(--marker-scale));
  flex-shrink: 0;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9));
}

.marker.container .marker-icon,
.marker.looseLoot .marker-icon {
  width: calc(10px * var(--marker-scale));
  height: calc(10px * var(--marker-scale));
}

/* Same underlying container data/icon as .marker.container, split into its own type (see
   src/markers.ts) specifically so it doesn't just blend into the other 19 generic container
   icons - reported as "easy to miss buried in the Lootable Items list". A gold glow (in place of
   the plain drop-shadow every other marker icon gets) is the map-level equivalent of that same
   "pull it out and make it obvious" ask. */
.marker.hiddenStash .marker-icon {
  width: calc(20px * var(--marker-scale));
  height: calc(20px * var(--marker-scale));
  filter: drop-shadow(0 0 3px #ffcc33) drop-shadow(0 0 5px rgba(255, 204, 51, 0.7));
}

/* Same "pull it out and make it obvious" glow as hidden stashes above, tinted per category
   (--doc-color set inline in app.js) instead of one fixed gold - these are worth just as much
   effort to spot as a stash, and color is the fastest way to tell the 8 categories apart at a
   glance without reading the label. */
.marker.document .marker-icon {
  width: calc(20px * var(--marker-scale));
  height: calc(20px * var(--marker-scale));
  filter: drop-shadow(0 0 3px var(--doc-color, #ffcc33)) drop-shadow(0 0 5px var(--doc-color, #ffcc33));
}

.marker .marker-label {
  text-shadow: 0 0 3px #000, 0 0 3px #000;
  color: #fff;
}


.marker.container .marker-label,
.marker.hiddenStash .marker-label,
.marker.looseLoot .marker-label,
.marker.quest .marker-label,
.marker.document .marker-label,
.marker.spawn .marker-label {
  display: none;
}

.map-label {
  position: absolute;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 0 4px #000, 0 0 4px #000, 0 0 4px #000;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
}

/* User-placed persistent markers (Alt+right-click to add, right-click a marker to remove - see
   app.js's addCustomMarker/removeCustomMarker). Unlike every other marker on this layer these are
   interactive (pointer-events: auto) since removal is a right-click directly on the pin itself,
   and deliberately distinct pink so they never blend into any real in-game marker category. */
.custom-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  pointer-events: auto;
  z-index: 3;
}

.custom-marker-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff5c8a;
  border: 2px solid #1a1d12;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

.custom-marker:hover .custom-marker-pin {
  filter: brightness(1.2);
}

.custom-marker-label {
  padding: 1px 5px;
  background: rgba(23, 26, 31, 0.9);
  border: 1px solid #ff5c8a;
  border-radius: 3px;
  color: #ff5c8a;
  font-size: 0.7rem;
  white-space: nowrap;
}

/* ---------- Layout ---------- */

/* Scoped to this one page (index.html only, via <body class="map-page">) - NOT a plain `body`
   rule. That was tried first and broke every other page (items.html, traders.html, ...): they
   rely on the ordinary page-level scrollbar to reach content past one screen's height, and a
   global height:100vh + overflow:hidden on body silently clips exactly that on every page that
   isn't this one. Only the map page needs an app-shell layout where the outer page itself never
   scrolls (see .sidebar-scroll below for where its own long content actually does). */
body.map-page {
  /* A firm cap, not min-height - .sidebar-scroll (further down) relies on height:100% resolving
     to a real, bounded number all the way up this chain to scroll its own long content
     internally. min-height let the whole chain grow to fit the sidebar's full unscrolled content
     instead - reported back as "a long scroll down with nothing", the map/sidebar were rendering
     at ~1595px tall inside an ~860px viewport, all excess space below the fold just empty
     background. */
  height: 100vh;
  /* Without this, the explicit height above gets silently ignored - overflowing content with the
     default overflow:visible makes the browser propagate scrolling to the viewport itself, and in
     that mode getComputedStyle reports body's height as the CONTENT's natural size, not the
     explicit value (confirmed directly - removing this made body measure ~1668px tall inside an
     ~860px window despite the explicit height:100vh above). */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-layout {
  display: flex;
  align-items: stretch;
  /* Fills whatever space is actually left below the header (see body's own flex-column above) -
     .quest-sidebar/.map-viewport used to each hardcode height:75vh, a guess wholly disconnected
     from the header's real height, leaving a gap of raw page background below everything whenever
     the numbers didn't line up exactly at a given window size. Reported back as a black strip at
     the bottom of the map on Interchange - not a per-map bug at all, this could happen on ANY map
     at the "wrong" window height. min-height:0 lets this flex-row child actually respect that
     fixed size instead of growing to fit its content and pushing the page taller than the
     viewport. */
  flex: 1;
  min-height: 0;
}

.quest-sidebar {
  width: 270px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.18s var(--ease);
  overflow: hidden;
}

.quest-sidebar.collapsed {
  width: 0;
  border-right: none;
}

.sidebar-scroll {
  overflow-y: auto;
  height: 100%;
}

.quest-sidebar details {
  border-bottom: 1px solid var(--border-soft);
}

.quest-sidebar summary {
  font-family: var(--font-display);
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  background: var(--surface-raised);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  list-style: none;
}

.quest-sidebar summary::-webkit-details-marker {
  display: none;
}

.quest-sidebar summary::before {
  content: "\25B8";
  display: inline-block;
  margin-right: 0.5rem;
  color: var(--accent);
  transition: transform 0.15s var(--ease);
  font-size: 0.7rem;
}

.quest-sidebar details[open] summary::before {
  transform: rotate(90deg);
}

.quest-sidebar summary:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.quest-sidebar details > label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.85rem 0.4rem 1.6rem;
  font-size: 0.8rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s var(--ease);
}

.quest-sidebar details > label:hover {
  background: var(--surface-hover);
}

.option-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  order: -1;
}

.quest-list .quest-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.document-category-icon {
  border-radius: 3px;
}

.quest-sidebar-actions {
  display: flex;
  gap: 0.3rem;
  margin-left: auto;
}

.quest-sidebar-actions button {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  padding: 0.2rem 0.5rem;
  background: var(--surface-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.quest-sidebar-actions button:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.quest-list {
  overflow-y: auto;
  max-height: 40vh;
  padding: 0.1rem 0 0.5rem;
  font-size: 0.75rem;
  /* Moves just this scrollbar to the left edge (a scrolling element's scrollbar follows its own
     direction, independent of its content) - distinguishes it from the sidebar's own larger
     scrollbar, which stays on the right, since both otherwise sit close together in a narrow
     column. Every direct child gets direction:ltr back so the actual row content (checkbox, icon,
     text) still reads normally rather than mirroring too. */
  direction: rtl;
}

.quest-list > * {
  direction: ltr;
}

.quest-list-group-heading {
  padding: 0.4rem 0.85rem 0.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.quest-list label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.3rem 0.85rem 0.3rem 1.6rem;
  cursor: pointer;
  transition: background 0.1s var(--ease);
}

.quest-list label:hover {
  background: var(--surface-hover);
}

#marker-size {
  width: 90px;
}

@media (max-width: 700px) {
  .main-layout {
    flex-direction: column;
  }
  .quest-sidebar {
    width: 100%;
    height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .map-viewport {
    height: 60vh;
  }
  .brand-name {
    display: none;
  }
}

/* ---------- Map viewport ---------- */

.map-viewport {
  position: relative;
  width: 100%;
  flex: 1;
  overflow: hidden;
  /* Map SVGs leave undeveloped terrain transparent rather than painting every square meter.
     A near-black page background turns those gaps into what looks like broken empty space;
     a neutral mid-gray (matching tarkov.dev's own page background) reads as plausible ground
     instead. No vignette here for the same reason -- it would darken exactly the edges/corners
     where transparent gaps are most likely to show. */
  background: #2d2d2f;
  cursor: grab;
  touch-action: none;
}

.map-viewport.dragging {
  cursor: grabbing;
}

.map-wrap {
  position: relative;
  width: 100%;
  line-height: 0;
  transform-origin: 0 0;
}

.map-wrap img {
  width: 100%;
  display: block;
  user-select: none;
}

.player-marker {
  position: absolute;
  display: none;
}

.dot {
  position: absolute;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border-radius: 50%;
  background: #ff4d4d;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.25), 0 0 10px rgba(255, 77, 77, 0.8);
  animation: pulse 2s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.25), 0 0 10px rgba(255, 77, 77, 0.8);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 77, 77, 0.12), 0 0 14px rgba(255, 77, 77, 0.9);
  }
}

/* A brief expanding ring fired on every new screenshot, distinct from the constant subtle
   pulse above — meant to catch your eye at the moment a fresh position lands, not just mark
   where the dot generally is. */
.player-ping {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border-radius: 50%;
  border: 3px solid #ff4d4d;
  pointer-events: none;
  opacity: 0;
}

.player-ping.firing {
  animation: ping-flash 0.8s ease-out;
}

@keyframes ping-flash {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  100% {
    transform: scale(4.5);
    opacity: 0;
  }
}

/* Facing direction, from the screenshot's rotation quaternion — see CLAUDE.md
   "Facing direction". 0deg points up; rotated clockwise by computeHeadingDegrees(). */
.facing-arrow {
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  margin-top: -13px;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9));
  transform: rotate(0deg);
}

.facing-arrow polygon {
  fill: rgba(255, 210, 77, 0.35);
  stroke: #ffd24d;
  stroke-width: 0.4;
}

/* Squad party markers - deliberately separate classes from .player-marker/.dot/.player-ping/
   .facing-arrow rather than reusing them: those all hardcode their own colors directly (no CSS
   variable), so overriding per-teammate would mean fighting the existing single-player styling
   instead of just adding alongside it. --party-color is set inline per marker (see shared.js'
   PartyMarkers), one hue per teammate from a fixed palette. */
.party-marker {
  position: absolute;
  display: none;
  transform: translate(-50%, -50%);
  align-items: center;
}

.party-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--party-color);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4), 0 0 8px var(--party-color);
}

.party-ping {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  border: 3px solid var(--party-color);
  pointer-events: none;
  opacity: 0;
}

.party-ping.firing {
  /* Same keyframes the self-marker's .player-ping already uses (style.css, "ping-flash") - they
     only ever animate transform/opacity, never a hardcoded color, so they're already reusable
     as-is for any bordered ring regardless of its border-color. */
  animation: ping-flash 0.8s ease-out;
}

.party-facing-arrow {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9));
  transform: rotate(0deg);
}

.party-facing-arrow polygon {
  fill: color-mix(in srgb, var(--party-color) 35%, transparent);
  stroke: var(--party-color);
  stroke-width: 0.4;
}

.party-label {
  position: absolute;
  left: 0;
  top: 10px;
  white-space: nowrap;
  font-size: 0.65rem;
  color: #fff;
  text-shadow: 0 0 3px #000, 0 0 3px #000;
  pointer-events: none;
}

.sidebar-hint {
  margin: 0;
  padding: 0.4rem 0.85rem 0.5rem;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--text-faint);
}

.map-notes-textarea {
  display: block;
  width: calc(100% - 1.7rem);
  margin: 0 0.85rem 0.6rem;
  padding: 0.55rem 0.7rem;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.4;
  resize: vertical;
}

.map-notes-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.nearest-extract-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 4;
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.7rem;
  background: rgba(23, 26, 31, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  color: var(--text);
  pointer-events: none;
}

.nearest-extract-arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}

.nearest-extract-arrow polygon {
  fill: #4ade80;
  stroke: #000;
  stroke-width: 0.5;
}

.cursor-coords-badge {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  z-index: 4;
  padding: 0.4rem 0.7rem;
  background: rgba(23, 26, 31, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  font-family: "Consolas", "SF Mono", monospace;
  color: var(--text);
  pointer-events: none;
}

.measure-distance-badge {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  z-index: 4;
  padding: 0.4rem 0.7rem;
  background: rgba(23, 26, 31, 0.9);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  font-family: "Consolas", "SF Mono", monospace;
  color: var(--accent-strong);
  pointer-events: none;
}

/* Measure (see toggle-measure, app.js's updateMeasureLine) - an SVG layer so a rotated line's
   angle stays correct regardless of pan/zoom or the image's aspect ratio (its viewBox is set to
   the map's own reference pixel dimensions, same idiom as #hazard-zones). Distinct class names
   from anything in overlay.html's own .route-line/.waypoint-marker - different rendering approach
   entirely (SVG here vs. a rotated div there), not meant to look identical. */
#measure-line-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.measure-line {
  stroke: var(--accent-strong);
  stroke-width: 2;
  stroke-dasharray: 6, 4;
  vector-effect: non-scaling-stroke;
}

.measure-marker {
  fill: var(--accent-strong);
  stroke: #1a1d12;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.no-calibration {
  color: var(--warn);
}

/* ---------- Trading page ---------- */

.trading-search input {
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 220px;
}

.trading-panel {
  padding: 1rem 1.25rem;
}

.trading-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 70ch;
  margin: 0 0 1rem;
}

.trading-table-scroll {
  overflow: auto;
  max-height: calc(100vh - 160px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

#trading-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

#trading-table th,
#trading-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

#trading-table th {
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
}

#trading-table th:hover {
  color: var(--text);
  background: var(--surface-hover);
}

#trading-table tbody tr {
  border-top: 1px solid var(--border-soft);
  transition: background 0.1s var(--ease);
}

#trading-table tbody tr:hover {
  background: var(--surface-hover);
}

.item-name-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.item-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.positive {
  color: var(--ok);
}

.negative {
  color: var(--error);
}

/* ---------- Catalog pages (Items / Traders / Bosses) ---------- */

.catalog-sidebar {
  height: calc(100vh - 61px);
}

.catalog-main {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.85rem 0.4rem 1.6rem;
  font-size: 0.8rem;
  color: var(--text);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s var(--ease);
}

.category-item:hover {
  background: var(--surface-hover);
}

.category-item.active {
  background: var(--surface-hover);
  color: var(--accent-strong);
}

.category-count {
  color: var(--text-faint);
  font-size: 0.72rem;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.7rem;
}

.item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.7rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  text-align: center;
  transition: background 0.1s var(--ease), border-color 0.1s var(--ease);
}

.item-card:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.item-card-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.item-card-name {
  font-size: 0.76rem;
  line-height: 1.25;
}

.item-card-price {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ---------- Modal (item / trader detail) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-panel {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--accent-strong);
  background: #343a25;
}

.item-modal-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.item-modal-image {
  width: 90px;
  height: 90px;
  object-fit: contain;
  background: var(--surface);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.item-modal-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.item-modal-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.item-modal-header a {
  font-size: 0.78rem;
  color: var(--accent-strong);
}

.item-modal-description {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: pre-line;
  margin: 0 0 0.9rem;
}

.modal-panel h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 1rem 0 0.4rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.3rem 1rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.15rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.stat-row span:first-child {
  color: var(--text-muted);
}

.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.modal-table td {
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid var(--border-soft);
}

/* ---------- Traders page ---------- */

.trader-page {
  padding: 1.25rem;
}

.trader-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.8rem;
}

.trader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  text-align: center;
  transition: background 0.1s var(--ease), border-color 0.1s var(--ease);
}

.trader-card:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.trader-card-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.trader-card-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.trader-card-countdown {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.trader-assortment-search {
  margin-bottom: 0.5rem;
}

.trader-assortment-search input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.trader-assortment-scroll {
  max-height: 40vh;
  overflow-y: auto;
}

/* ---------- Bosses page ---------- */

.boss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.8rem;
}

.boss-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 0.9rem;
}

.boss-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.boss-card-icon {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  flex-shrink: 0;
}

.boss-card-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.boss-map-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.boss-map-row:last-child {
  border-bottom: none;
}

.boss-map-chance {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Calculators page ---------- */

#calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

#calc-table th,
#calc-table td {
  text-align: left;
  padding: 0.45rem 0.7rem;
  vertical-align: top;
}

#calc-table th {
  color: var(--text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

#calc-table tbody tr {
  border-top: 1px solid var(--border-soft);
  transition: background 0.1s var(--ease);
}

#calc-table tbody tr:hover {
  background: var(--surface-hover);
}

.converter-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.converter-row input,
.converter-row select {
  padding: 0.5rem 0.7rem;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.converter-row input {
  width: 120px;
}

.converter-result {
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 100px;
}

/* ---------- Tasks page ---------- */

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.8rem;
}

.task-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: background 0.1s var(--ease), border-color 0.1s var(--ease);
}

.task-card:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.task-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.task-card-icon {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  flex-shrink: 0;
}

.task-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
}

.task-card-trader {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.task-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge-kappa {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Shown only for a task the local quest-log watcher detected automatically (see
   src/questLogWatcher.ts's SessionMode / tasks.js's mode badge) - distinct colors so the three
   modes read apart from each other and from every other badge on the card at a glance. */
.badge-mode-pve {
  background: #2a5a34;
  color: #c2f5cf;
}

.badge-mode-pvp {
  background: #3a4a63;
  color: #cfe0f5;
}

.badge-mode-pvp-season {
  background: #5a3a63;
  color: #ecc2f5;
}

.admin-logs-output {
  margin: 0.75rem 0 0;
  padding: 0.85rem 1rem;
  max-height: 480px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-family: "Consolas", "SF Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.tasks-progress-toolbar {
  margin: 0.75rem 0;
}

.task-status-pill {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.task-status-pill:disabled {
  cursor: not-allowed;
}

.task-status-pill.status-locked {
  background: var(--surface-hover);
  color: var(--text-muted);
  opacity: 0.7;
}

.task-status-pill.status-available {
  background: var(--surface-hover);
  color: var(--text);
}

.task-status-pill.status-active {
  background: #3a4a63;
  color: #cfe0f5;
}

.task-status-pill.status-complete {
  background: #2a5a34;
  color: #c2f5cf;
}

.task-card.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.badge-lightkeeper {
  background: #3a4a63;
  color: #cfe0f5;
}

.task-modal-rewards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Fixed Type column, flowing Description, fixed right-aligned Count - same responsive shape as
   #calc-table, just scoped to this table via column widths below instead of an id. */
.task-objectives-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.task-objectives-table th,
.task-objectives-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  vertical-align: top;
}

.task-objectives-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}

.task-objectives-table tbody tr {
  border-top: 1px solid var(--border-soft);
}

.task-objectives-table tr.optional {
  color: var(--text-muted);
  font-style: italic;
}

.task-objective-type {
  width: 110px;
  white-space: nowrap;
  color: var(--text-faint);
}

.task-objective-count {
  width: 70px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.objective-link {
  color: var(--accent-strong);
  text-decoration: underline dotted;
}

.objective-link:hover {
  color: var(--accent);
}

/* ---------- Achievements page (UI scaffold - see achievements.js for the mock data note) ---------- */

.achievements-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.achievements-table th,
.achievements-table td {
  text-align: left;
  padding: 0.6rem 0.7rem;
  vertical-align: middle;
}

.achievements-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}

.achievements-table tbody tr {
  border-top: 1px solid var(--border-soft);
  transition: background 0.1s var(--ease);
}

.achievements-table tbody tr:hover {
  background: var(--surface-hover);
}

.achievement-name-cell {
  width: 260px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  white-space: nowrap;
}

.achievement-icon {
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* Real artwork path (data-provided `icon` starting with "/") - same footprint as .achievement-icon
   so swapping between the emoji placeholder and a real image doesn't shift row height/alignment. */
.achievement-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.achievement-rarity-cell {
  width: 90px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- Prestige page (UI scaffold - see prestige.js for the mock data note) ---------- */

.prestige-section {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.prestige-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
}

.prestige-section-icon {
  color: var(--accent-strong);
}

.prestige-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.prestige-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border: none;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  color: var(--text);
  transition: background 0.1s var(--ease);
}

.prestige-card:hover {
  background: var(--surface-hover);
}

/* Generic numbered rank badge - a plain shield silhouette (CSS clip-path pentagon) with a tier
   color progression, not a reproduction of any specific game's insignia artwork or texture. */
.prestige-badge {
  width: 56px;
  height: 60px;
  clip-path: polygon(50% 0%, 100% 22%, 100% 70%, 50% 100%, 0% 70%, 0% 22%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.prestige-badge-lg {
  width: 72px;
  height: 78px;
  font-size: 1.6rem;
}

/* Tier progression, purely a color choice - bronze/silver/gold/platinum bands as level increases. */
.prestige-tier-bronze {
  background: linear-gradient(160deg, #c98a4b, #8a5a2e);
  color: #2c1a0c;
}

.prestige-tier-silver {
  background: linear-gradient(160deg, #d9dee3, #8b939c);
  color: #262a2e;
}

.prestige-tier-gold {
  background: linear-gradient(160deg, #f0d27a, #b6862f);
  color: #2c2005;
}

.prestige-tier-platinum {
  background: linear-gradient(160deg, #cdeaff, #6fa8c9);
  color: #0d2430;
}

/* Real artwork path (data-provided `icon`) - same footprint as .prestige-badge so swapping
   between the two per-entry doesn't shift the grid/modal layout. */
.prestige-icon-img {
  width: 56px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}

.prestige-icon-img.prestige-badge-lg {
  width: 72px;
  height: 78px;
}

.prestige-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.task-reward-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.task-reward-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: var(--surface);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.task-required-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.task-required-chip {
  font-size: 0.76rem;
  padding: 0.25rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-muted);
}

/* ---------- Loot tiers page ---------- */

.loot-tier-note {
  margin-bottom: 1rem;
}

.loot-tier-group {
  margin-bottom: 1.1rem;
}

.loot-tier-heading {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.loot-tier-heading .tier-letter {
  font-size: 1.3rem;
  font-weight: 700;
}

.loot-tier-heading .tier-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tier-S .tier-letter { color: #f16565; }
.tier-A .tier-letter { color: var(--accent-strong); }
.tier-B .tier-letter { color: #4ade80; }
.tier-C .tier-letter { color: #6fa8dc; }
.tier-D .tier-letter { color: var(--text-faint); }

/* ---------- Wipe length page ---------- */

.wipe-summary-figure {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.wipe-summary-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ---------- Deep-link marker flash (Tasks objective -> map jump) ---------- */

@keyframes marker-flash-pulse {
  0%, 100% { filter: none; transform: translate(-50%, -50%) scale(1); }
  50% { filter: drop-shadow(0 0 8px var(--accent-strong)); transform: translate(-50%, -50%) scale(1.6); }
}

.marker-flash {
  animation: marker-flash-pulse 0.6s ease-in-out 4;
  z-index: 30;
}

/* ---------- Auth gate (Google Sign-In) ---------- */

.auth-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.auth-gate.open {
  display: flex;
}

.auth-gate-panel {
  position: relative;
  text-align: center;
  max-width: 360px;
  padding: 2.25rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Corner-bracket framing, the one HUD-coded flourish on the sign-in card - a nod to a targeting
   reticle/viewfinder without reproducing any actual crosshair or game icon. */
.auth-gate-panel::before,
.auth-gate-panel::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent);
  opacity: 0.7;
}

.auth-gate-panel::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.auth-gate-panel::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.auth-gate-panel h1 {
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.auth-gate-panel p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.auth-gate-field {
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  margin-bottom: 0.75rem;
}

.auth-gate-field label {
  margin-bottom: 0.3rem;
}

.auth-gate-field input {
  padding: 0.55rem 0.7rem;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.auth-gate-error {
  color: var(--error);
  font-size: 0.8rem;
  min-height: 1.2em;
  margin: 0.25rem 0 0.75rem;
}

.subtle-link {
  display: block;
  margin-top: 1rem;
  color: var(--text-faint);
  font-size: 0.8rem;
  text-decoration: none;
}

.subtle-link:hover {
  color: var(--text-muted);
  text-decoration: underline;
}

#auth-gate-submit {
  width: 100%;
}
