.phase4-section {
  margin-bottom: 3rem;
}

.phase4-head {
  margin-bottom: 1rem;
}

.phase4-head h2 {
  margin-bottom: 0.35rem;
}

.lab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 900px) {
  .lab-grid {
    grid-template-columns: 1fr;
  }
}

.lab-config label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.75rem 0 0.35rem;
}

.lab-config select {
  width: 100%;
  padding: 0.5rem;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

.seg {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.seg-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.seg-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(45, 140, 255, 0.15);
}

.lab-mut-row {
  margin-bottom: 0.75rem;
}

.lab-mut-slot-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.25rem;
}

.lab-mut-slot-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.lab-mut-slot-hint {
  font-size: 0.72rem;
  line-height: 1.3;
}

.lab-mut-row select {
  width: 100%;
  padding: 0.4rem;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
}

.lab-template-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.lab-template-row input {
  flex: 1;
  padding: 0.45rem;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.lab-preview {
  border-radius: 8px;
  background: linear-gradient(135deg, #0a1628, #1a3a5c);
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
}

.lab-species-thumb-wrap {
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  background: #060d14;
  display: grid;
  place-items: center;
  margin-bottom: 0.65rem;
}

.lab-species-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lab-species-thumb-ph {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.75rem;
  text-align: center;
}

.lab-preview-title {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.25rem;
}

.lab-preview-links {
  text-align: center;
  font-size: 0.85rem;
}

.lab-preview-links a {
  color: var(--accent);
}

.lab-mutation-panel {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.lab-mut-head {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.lab-mutation-hints {
  font-size: 0.85rem;
  line-height: 1.45;
}

.lab-mutation-hints p {
  margin: 0 0 0.5rem;
}

.lab-total {
  font-size: 1.1rem;
  margin: 0.75rem 0;
}

.lab-total strong {
  color: #3dd68c;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.skin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius, 14px);
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.skin-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong, rgba(148, 180, 220, 0.28));
}

.skin-card .skin-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.15rem 1.15rem;
}

.skin-card .skin-card-body .btn {
  margin-top: auto;
}

.skin-card.owned::before {
  content: 'OWNED';
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ffc107;
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.inv-presence {
  margin-top: 0.35rem;
  font-size: 0.9rem;
}

.inv-guidelines {
  margin-bottom: 1rem;
}

.inv-guidelines-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.inv-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.inv-tab {
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
}

.inv-tab.active {
  border-color: var(--accent);
  background: rgba(45, 140, 255, 0.15);
}

/* Inventory grid — see inventory.css */

.skin-card-thumb-wrap {
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.65rem;
  background: #060d14;
  border: 1px solid var(--border);
}

.skin-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.skin-blurb {
  font-size: 0.75rem;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}

.skin-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.skin-card .cat {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.skin-prices {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.skin-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.market-tools {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.market-tools .market-hint {
  font-size: 0.8rem;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}

.market-apply-label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 0.35rem;
}

.skin-owned-line {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.55rem;
  line-height: 1.3;
}

.skin-send-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.guide-mutations-card {
  margin-bottom: 1rem;
}

#guide-mutations-body details {
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
}

#guide-mutations-body summary {
  cursor: pointer;
  font-weight: 600;
}

.guide-mutation-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.guide-attrib {
  font-size: 0.8rem;
  margin: 0 0 1rem;
}

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

.dino-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dino-thumb-wrap {
  aspect-ratio: 16 / 10;
  background: #0a1628;
  display: grid;
  place-items: center;
}

.dino-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dino-thumb-missing {
  font-size: 2rem;
  font-weight: 700;
  color: rgba(45, 140, 255, 0.35);
}

.dino-card h3 {
  font-size: 0.95rem;
  margin: 0;
  padding: 0.65rem 0.75rem 0.15rem;
}

.dino-card-links {
  font-size: 0.8rem;
  padding: 0 0.75rem 0.75rem;
}

.dino-card-links a {
  color: var(--accent);
}

.skin-resources {
  margin: 1rem 0;
  padding: 1rem;
}

.skin-resources .subhead {
  margin-top: 0;
}

.resource-links {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.resource-links li {
  margin-bottom: 0.65rem;
  color: var(--muted);
}

.resource-links a {
  color: var(--accent);
  font-weight: 600;
}

.skin-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.skin-filter-row label {
  font-size: 0.85rem;
  color: var(--muted);
}

.skin-filter-row select {
  min-width: 180px;
  padding: 0.4rem 0.6rem;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

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

.preset-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preset-card h3 {
  font-size: 1rem;
  margin: 0;
}

.preset-species {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.preset-code {
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  word-break: break-all;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem;
  color: #b8d4ff;
  max-height: 5.5rem;
  overflow-y: auto;
}

.preset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
}

.map-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.map-subtle {
  max-width: 52rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.map-head-row .btn {
  flex-shrink: 0;
}

.map-controls {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.map-control-row.map-control-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  font-size: 0.85rem;
}

.map-control-toggles label {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  cursor: pointer;
}

.map-legend {
  display: flex;
  gap: 1rem;
  margin: 0.75rem 0 0;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.lgd {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lgd-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-sizing: border-box;
}

.lgd-you .lgd-swatch {
  background: #ffb020;
}

.lgd-sq .lgd-swatch {
  background: #a855f7;
}

.lgd-fr .lgd-swatch {
  background: #38c8ff;
}

.lgd-other .lgd-swatch {
  background: #3dd68c;
}

.map-live-meta {
  font-size: 0.8rem;
  margin: 0.65rem 0 0;
}

.map-overlay-attrib {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
}

.map-wrap {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 300px);
  gap: 1rem;
  padding: 1rem;
}

@media (max-width: 800px) {
  .map-wrap {
    grid-template-columns: 1fr;
  }
}

.map-stage {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.map-zoom-label {
  font-size: 0.78rem;
  min-width: 2.75rem;
  text-align: center;
}

.map-zoom-btn {
  min-width: 2rem;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  font-weight: 700;
}

.map-canvas-wrap {
  position: relative;
  min-height: 480px;
  height: min(62vh, 720px);
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #1a2438;
  cursor: grab;
  touch-action: none;
}

.map-canvas-wrap.is-panning {
  cursor: grabbing;
}

.map-viewport {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.map-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 480px;
  border-radius: 0;
  border: none;
  background: #1a2438;
  overflow: hidden;
}

.map-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #1a6b8a;
}

.map-geo-fit {
  position: absolute;
  z-index: 0;
  /* Pixel size/position set by layoutMapGeoFit() to match the 4096² map aspect. */
}

.map-geo-fit .map-dots-root,
.map-geo-fit .map-search-root,
.map-geo-fit .map-grid-layer,
.map-geo-fit .map-poi-root,
.map-geo-fit .map-placeholder {
  position: absolute;
  inset: 0;
}

/* Keep layers absolutely positioned over the geo-fitted image — pins are placed
   by percentage of this box, so it must always match the drawn map exactly. */
.map-canvas.has-backdrop .map-grid-layer,
.map-canvas.has-backdrop .map-placeholder,
.map-canvas.has-backdrop .map-dots-root,
.map-canvas.has-backdrop .map-search-root,
.map-canvas.has-backdrop .map-poi-root {
  position: absolute;
  inset: 0;
  z-index: 1;
}

body.map-fs-active {
  overflow: hidden;
}

body.map-fs-active .site-header,
body.map-fs-active footer,
body.map-fs-active .bg-grid {
  display: none !important;
}

body.map-fs-active main {
  padding: 0;
  max-width: none;
}

body.map-fs-active #livemap.phase4-section {
  margin: 0;
  padding: 0.5rem;
  min-height: 100vh;
  box-sizing: border-box;
}

body.map-fs-active .map-controls,
body.map-fs-active .phase4-head .map-subtle {
  display: none;
}

body.map-fs-active .map-wrap {
  grid-template-columns: 1fr;
  padding: 0;
  border: none;
  background: transparent;
}

body.map-fs-active .map-player-list {
  display: none;
}

.map-stage.map-is-fullscreen,
.map-stage:fullscreen {
  background: #060d18;
  padding: 0.5rem;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.map-stage.map-is-fullscreen .map-canvas-wrap,
.map-stage:fullscreen .map-canvas-wrap {
  flex: 1;
  height: auto;
  min-height: 0;
}

.map-stage.map-is-fullscreen .map-canvas,
.map-stage:fullscreen .map-canvas {
  min-height: 100%;
}

.map-canvas.has-backdrop .map-grid-layer {
  opacity: 0.35;
}

.map-canvas.has-backdrop .map-placeholder {
  display: none;
}

.map-grid-layer {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: calc(100% / 10) calc(100% / 10);
}

.map-grid-layer.hidden-layer {
  display: none;
}

.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 2rem;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.map-placeholder.hidden-layer {
  opacity: 0;
  visibility: hidden;
}

.map-side-line {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  line-height: 1.25;
}

.map-dots-root {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.map-dots-root .map-pin {
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: default;
  z-index: 2;
}

.map-dots-root .map-pin:hover,
.map-dots-root .map-pin:focus-visible {
  z-index: 12;
}

.map-search-root {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.map-search-root .map-pin {
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.map-search-root .map-pin.is-search .map-dot-main {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff6b35;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.45);
  display: block;
}

.map-search-root .map-pin.is-search .map-dot-label {
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.map-pin-self-badge {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  padding: 0.12rem 0.38rem;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.1;
  color: #1c1408;
  background: linear-gradient(160deg, #ffe082 0%, #f59e0b 55%, #d97706 100%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 4px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.45),
    0 0 10px rgba(245, 158, 11, 0.35);
  pointer-events: none;
  white-space: nowrap;
  z-index: 4;
}

.map-pin-hover-tip {
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  transform: translateX(-50%) translateY(3px);
  padding: 0.22rem 0.5rem;
  min-width: 0;
  max-width: 118px;
  background: rgba(8, 12, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  z-index: 5;
}

.map-pin-hover-tip strong {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f8fafc;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-pin.is-self .map-pin-hover-tip {
  border-color: rgba(245, 158, 11, 0.45);
}

.map-pin.is-squad .map-pin-hover-tip {
  border-color: rgba(168, 85, 247, 0.4);
}

.map-pin.is-friend .map-pin-hover-tip {
  border-color: rgba(56, 189, 248, 0.4);
}

.map-pin.is-other .map-pin-hover-tip {
  border-color: rgba(34, 197, 94, 0.3);
}

.map-pin:hover .map-pin-hover-tip,
.map-pin:focus-visible .map-pin-hover-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.map-pin.is-self {
  z-index: 6;
}

.map-pin.is-squad {
  z-index: 5;
}

.map-pin.is-friend {
  z-index: 4;
}

.map-pin-anchor {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
}

.map-pin-core {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  background: #64748b;
}

.map-pin-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}

.map-pin.is-self .map-pin-core {
  width: 13px;
  height: 13px;
  background: linear-gradient(160deg, #ffe082 0%, #f59e0b 55%, #d97706 100%);
  border-color: #fff;
  box-shadow:
    0 0 0 2px rgba(245, 158, 11, 0.35),
    0 0 14px rgba(245, 158, 11, 0.75),
    0 2px 6px rgba(0, 0, 0, 0.5);
}

.map-pin.is-self .map-pin-pulse {
  background: rgba(245, 158, 11, 0.45);
  animation: map-player-pulse 2.2s ease-out infinite;
}

.map-pin.is-squad .map-pin-core {
  width: 12px;
  height: 12px;
  background: linear-gradient(160deg, #e9d5ff 0%, #a855f7 50%, #7e22ce 100%);
  box-shadow:
    0 0 0 2px rgba(168, 85, 247, 0.3),
    0 0 12px rgba(168, 85, 247, 0.7);
}

.map-pin.is-squad .map-pin-pulse {
  background: rgba(168, 85, 247, 0.35);
  animation: map-player-pulse 2.8s ease-out infinite;
}

.map-pin.is-friend .map-pin-core {
  width: 12px;
  height: 12px;
  background: linear-gradient(160deg, #bae6fd 0%, #38bdf8 50%, #0284c7 100%);
  box-shadow:
    0 0 0 2px rgba(56, 189, 248, 0.3),
    0 0 12px rgba(56, 189, 248, 0.65);
}

.map-pin.is-friend .map-pin-pulse {
  background: rgba(56, 189, 248, 0.3);
  animation: map-player-pulse 3s ease-out infinite;
}

.map-pin.is-other .map-pin-core {
  background: linear-gradient(160deg, #bbf7d0 0%, #22c55e 50%, #15803d 100%);
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.25),
    0 0 10px rgba(34, 197, 94, 0.45);
}

@keyframes map-player-pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.55;
  }
  70% {
    transform: translate(-50%, -50%) scale(2.6);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.6);
    opacity: 0;
  }
}

.map-pin-tag {
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  transform: translateX(-50%);
  padding: 0.22rem 0.5rem;
  min-width: 0;
  max-width: 118px;
  background: rgba(8, 12, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  text-align: center;
  pointer-events: none;
}

.map-pin-tag strong {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f8fafc;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-pin-sub {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.54rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-pin.is-self .map-pin-tag {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 12px rgba(245, 158, 11, 0.15);
}

.map-pin.is-squad .map-pin-tag {
  border-color: rgba(168, 85, 247, 0.4);
}

.map-pin.is-friend .map-pin-tag {
  border-color: rgba(56, 189, 248, 0.4);
}

.map-pin.is-other .map-pin-tag {
  border-color: rgba(34, 197, 94, 0.3);
}

/* Legacy search / coord pins */
.map-dot-main {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  margin: auto;
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.map-pin.is-search .map-dot-main {
  background: #ff6b9d;
}

.map-dot-label {
  position: absolute;
  left: calc(50% + 14px);
  top: -6px;
  font-size: 0.62rem;
  font-weight: 600;
  color: #eaf4ff;
  text-shadow:
    0 0 4px rgba(0, 0, 0, 0.9),
    0 1px 2px #000;
  white-space: nowrap;
  pointer-events: none;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-dot-label.hidden-layer {
  display: none !important;
}

.map-dot-trail {
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.35);
}

.map-pin-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  vertical-align: middle;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.35rem;
  letter-spacing: 0.03em;
}

.map-pin-badge.self {
  background: rgba(255, 176, 32, 0.25);
  color: #ffdc8a;
}

.map-pin-badge.squad {
  background: rgba(168, 85, 247, 0.22);
  color: #e9d5ff;
}

.map-pin-badge.friend {
  background: rgba(56, 200, 255, 0.2);
  color: #94e8ff;
}

.map-player-list {
  list-style: none;
  font-size: 0.85rem;
  max-height: 360px;
  overflow-y: auto;
}

.map-player-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.map-player-list strong {
  color: var(--text);
}

.skin-creator-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.skin-creator-left,
.skin-creator-right {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.skin-creator-panel {
  padding: 0.85rem;
}

.skin-creator-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.skin-creator-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 260px;
}

.skin-creator-name-wrap label {
  font-size: 0.75rem;
  color: var(--muted);
}

.skin-creator-name-wrap input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
}

.skin-creator-marks {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.skin-creator-marks output {
  min-width: 3ch;
  color: var(--text);
  font-family: ui-monospace, monospace;
}

.skin-creator-preview-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #14191f;
}

#creator-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
}

.skin-patterns-card {
  padding: 0.75rem 0.85rem;
}

.skin-patterns-card h3 {
  margin: 0 0 0.5rem;
}

.skin-patterns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.skin-pattern-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.45rem;
  cursor: pointer;
}

.skin-pattern-btn.active {
  border-color: #ae5cff;
  background: rgba(174, 92, 255, 0.18);
}

.creator-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.creator-field span {
  font-size: 0.8rem;
  color: var(--muted);
}

.creator-field select {
  width: 100%;
  padding: 0.5rem;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

.creator-colors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.creator-color-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.creator-color-row label {
  font-size: 0.78rem;
  color: var(--muted);
}

.creator-color-row input[type='color'] {
  width: 32px;
  height: 26px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.creator-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.creator-slots {
  margin-top: 0.8rem;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}

.creator-slots h4 {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
}

.creator-slots ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}

.creator-slots li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}

.creator-slots li:last-child {
  border-bottom: none;
}

.creator-slot-actions {
  display: inline-flex;
  gap: 0.3rem;
}

.creator-modal {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.creator-modal.hidden {
  display: none;
}

.creator-modal-card {
  width: min(680px, 100%);
  border: 1px solid var(--border);
  background: #070b13;
  border-radius: 12px;
  padding: 0.85rem;
}

.creator-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.creator-modal-head h3 {
  margin: 0;
}

#creator-import-text {
  width: 100%;
  min-height: 170px;
  background: #03060a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.55rem;
  resize: vertical;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}

.creator-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

@media (max-width: 1000px) {
  .skin-creator-grid {
    grid-template-columns: 1fr;
  }
}
