/* ══════════════════════════════════════════════════════════════════════════
   MAPA CHRISTIAN CULTURE — STYLESHEET (PREMIUM 2026 MOCKUP 1:1)
   Interaktywna mapa galaktyki ekosystemu Christian Culture
   Paleta: #080F20 (tło kosmiczne), #121D32 (karty), #C4A35A (złoto podstawowe)
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --map-bg: #080F20;
  --map-bg-elevated: #0d172e;
  --map-surface: #121D32;
  --map-surface-hover: #182744;
  --map-surface-active: #1f3256;
  --map-border: rgba(196, 163, 90, 0.22);
  --map-border-strong: rgba(196, 163, 90, 0.45);
  
  --gold-primary: #C4A35A;
  --gold-hover: #D4B578;
  --gold-light: #E2CC9A;
  --gold-dark: #A08040;
  --gold-glow: rgba(196, 163, 90, 0.4);

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #8E9BAE;

  --status-active: #10B981;
  --status-beta: #38BDF8;
  --status-planned: #F59E0B;

  --font-serif: 'Cinzel', serif;
  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --header-height: 68px;
  --mapa-header-height: 68px;
  --mapa-ctrl-height: 0px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--map-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── TŁO KOSMICZNE Z ORBITALNĄ ZIEMIĄ (WIDEO / POSTER) ── */
.cc-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #080F20 url('/assets/mapa/planeta-poster.jpg') center/cover no-repeat;
  overflow: hidden;
}

.cc-background video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.cc-background video.ready {
  opacity: 1;
}

.cc-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 32, 0.52);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .cc-background video {
    display: none;
  }
}

/* Kompatybilność wsteczna */
.mapa-galaxy-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── GŁÓWNY UKŁAD APLIKACJI ── */
.mapa-app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── GÓRNY PASEK NAWIGACJI (MOCKUP 1:1) ── */
.mapa-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(8, 15, 32, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--map-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1.25rem;
}

.mapa-header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.mapa-header-star {
  font-size: 1.4rem;
  color: var(--gold-light);
  line-height: 1;
  filter: drop-shadow(0 0 8px var(--gold-glow));
}

.mapa-header-title-wrap {
  display: flex;
  flex-direction: column;
}

.mapa-header-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #F8FAFC;
  line-height: 1.2;
}

.mapa-header-sub {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Wyszukiwarka w belce narzędziowej (sub-bar) */
.mapa-subbar-search-box {
  flex: 1 1 340px;
  max-width: 540px;
  min-width: 200px;
  margin: 0 0.5rem;
}

.mapa-header-search-box {
  flex: 1 1 360px;
  max-width: 480px;
}

.mapa-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.mapa-search-icon {
  position: absolute;
  left: 14px;
  color: var(--gold-primary);
  pointer-events: none;
  font-size: 0.95rem;
}

.mapa-search-input {
  width: 100%;
  height: 42px;
  padding: 0 4.2rem 0 2.6rem;
  border-radius: 21px;
  border: 1px solid var(--map-border);
  background: rgba(18, 29, 50, 0.85);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition-smooth);
}

.mapa-search-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 14px var(--gold-glow);
  background: rgba(18, 29, 50, 0.98);
}

.mapa-search-kbd {
  position: absolute;
  right: 12px;
  font-size: 0.68rem;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  background: rgba(196, 163, 90, 0.14);
  border: 1px solid var(--map-border);
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
  line-height: 1.4;
}

.mapa-search-clear {
  position: absolute;
  right: 64px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.mapa-search-clear:hover {
  color: var(--text-primary);
}

/* Prawa strona belki górnej (Zakładki + Przyciski) */
.mapa-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.mapa-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.mapa-nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-smooth);
  position: relative;
  user-select: none;
}

.mapa-nav-tab:hover {
  color: var(--gold-light);
}

.mapa-nav-tab.active {
  color: var(--gold-light);
}

.mapa-nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--gold-primary);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--gold-glow);
}

.mapa-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mapa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0 0.9rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--map-border);
  background: var(--map-surface);
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-smooth);
  user-select: none;
}

.mapa-btn:hover {
  background: var(--map-surface-hover);
  border-color: var(--gold-hover);
  color: var(--gold-light);
}

.mapa-btn-gold {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  color: #080F20;
  border-color: var(--gold-light);
  font-weight: 700;
}

.mapa-btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-hover) 0%, var(--gold-primary) 100%);
  color: #000;
  box-shadow: 0 4px 18px var(--gold-glow);
}

/* ── PASEK FILTRÓW I KONTROLEK ZASOBÓW (SUB-BAR) ── */
.mapa-control-bar {
  background: rgba(8, 15, 32, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(196, 163, 90, 0.15);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 50;
  flex-wrap: wrap;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, padding 0.3s ease, border-color 0.25s ease;
  max-height: 240px;
  overflow: hidden;
}

.mapa-control-bar.is-hidden {
  max-height: 0 !important;
  opacity: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-bottom-color: transparent !important;
  pointer-events: none !important;
}

.mapa-collapse-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(196, 163, 90, 0.25);
  background: rgba(18, 29, 50, 0.65);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.mapa-collapse-bar-btn:hover {
  color: var(--gold-light);
  border-color: var(--gold-primary);
  background: rgba(196, 163, 90, 0.15);
}

.mapa-bar-restore-pill {
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  z-index: 45;
  display: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 38px;
  padding: 0 1rem;
  background: rgba(18, 29, 50, 0.94);
  border: 1px solid var(--gold-primary);
  border-radius: 20px;
  color: var(--gold-light);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: var(--transition-smooth);
}

.mapa-bar-restore-pill:hover {
  background: var(--gold-primary);
  color: #080F20;
  transform: translateY(-1px);
}

.mapa-control-bar.is-hidden ~ .mapa-viewport .mapa-bar-restore-pill {
  display: inline-flex !important;
}

.mapa-header-toggle-bar.active {
  background: rgba(196, 163, 90, 0.22);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.mapa-filter-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.mapa-filter-chips::-webkit-scrollbar {
  display: none;
}

.mapa-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 34px;
  padding: 0 0.85rem;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 29, 50, 0.7);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
  white-space: nowrap;
}

.mapa-chip.active {
  background: linear-gradient(135deg, rgba(196, 163, 90, 0.35) 0%, rgba(196, 163, 90, 0.15) 100%);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(196, 163, 90, 0.2);
}

.mapa-chip-count {
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 6px;
  border-radius: 10px;
}

.mapa-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 34px;
  padding: 0 0.85rem;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(18, 29, 50, 0.5);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
  white-space: nowrap;
}

.mapa-status-chip:hover {
  background: rgba(18, 29, 50, 0.8);
  color: #FFF;
}

.mapa-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.mapa-status-dot.active {
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
}

.mapa-status-dot.beta {
  background: #38BDF8;
  box-shadow: 0 0 6px #38BDF8;
}

.mapa-status-dot.planned {
  background: #F59E0B;
  box-shadow: 0 0 6px #F59E0B;
}

/* Prawa strona kontrolna w sub-barze */
.mapa-sub-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.mapa-sub-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 34px;
  padding: 0 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--map-border);
  background: rgba(18, 29, 50, 0.6);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mapa-sub-btn:hover {
  color: var(--gold-light);
  border-color: var(--gold-primary);
  background: rgba(18, 29, 50, 0.9);
}

.mapa-zoom-group {
  display: inline-flex;
  background: rgba(18, 29, 50, 0.6);
  border: 1px solid var(--map-border);
  border-radius: 8px;
  overflow: hidden;
}

.mapa-zoom-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.mapa-zoom-btn:hover {
  background: rgba(196, 163, 90, 0.15);
  color: var(--gold-light);
}

.mapa-view-switch {
  display: inline-flex;
  background: rgba(18, 29, 50, 0.6);
  border: 1px solid var(--map-border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.mapa-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 30px;
  padding: 0 0.65rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mapa-view-btn.active {
  background: rgba(196, 163, 90, 0.22);
  color: var(--gold-light);
}

/* ── OBSZAR GRAFU WEKTOROWEGO (GALAKTYKA) ── */
.mapa-viewport {
  position: relative;
  flex: 1 1 auto;
  height: calc(100vh - var(--mapa-header-height, 68px) - var(--mapa-ctrl-height, 56px));
  height: calc(100dvh - var(--mapa-header-height, 68px) - var(--mapa-ctrl-height, 56px));
  min-height: 480px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.mapa-svg-canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  cursor: grab;
}

.mapa-svg-canvas:active {
  cursor: grabbing;
}

/* Graf - linie i połączenia wektorowe */
.map-link-bg {
  stroke: rgba(196, 163, 90, 0.2);
  stroke-width: 2px;
  fill: none;
}

.map-link-pulse {
  stroke: var(--gold-light);
  stroke-width: 2px;
  fill: none;
  stroke-dasharray: 6 14;
  animation: linkPulse 3.5s linear infinite;
}

@keyframes linkPulse {
  to {
    stroke-dashoffset: -40;
  }
}

.map-link-sub {
  stroke: rgba(196, 163, 90, 0.28);
  stroke-width: 1.2px;
  fill: none;
  transition: stroke 0.2s ease;
}

.map-link-cross {
  stroke: rgba(56, 189, 248, 0.25);
  stroke-width: 1.2px;
  stroke-dasharray: 4 6;
  fill: none;
}

/* Węzły grafu */
.map-node {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.map-node:hover {
  filter: brightness(1.2);
}

.map-node:focus-visible {
  outline: none;
}

/* Ochronne pigułki pod etykietami projektów i hubów */
.map-node-item .map-node-pill,
.map-node-branch rect {
  transition: fill 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              stroke 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              filter 0.25s ease;
}

.map-node-item:hover .map-node-pill {
  fill: rgba(18, 29, 50, 0.98) !important;
  stroke: #C4A35A !important;
  stroke-width: 1.5px !important;
  filter: drop-shadow(0 0 16px rgba(196, 163, 90, 0.55)) !important;
}

.map-node-item:hover text {
  fill: #FFFFFF !important;
}

.map-node-item.selected .map-node-pill {
  fill: rgba(196, 163, 90, 0.3) !important;
  stroke: #FFFFFF !important;
  stroke-width: 2px !important;
}

/* Obracający się majestatycznie złoty pierścień węzła centralnego */
@keyframes mapRingRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.map-root-rotating-ring {
  transform-origin: 0px 0px;
  animation: mapRingRotate 60s linear infinite;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .map-root-rotating-ring {
    animation: none;
  }
}

/* Kontrolki HUD na dole po prawej */
.mapa-hud-controls {
  position: absolute;
  right: 1.5rem;
  bottom: 6.25rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(18, 29, 50, 0.85);
  backdrop-filter: blur(12px);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--map-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mapa-hud-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 15, 32, 0.8);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.mapa-hud-btn:hover {
  background: var(--map-surface-hover);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

/* ── KARTA „WYBRANY OBSZAR” (MOCKUP 1:1) ── */
.mapa-side-card {
  position: absolute;
  right: 1.5rem;
  top: 1.5rem;
  width: 340px;
  max-height: calc(100% - 6.5rem);
  background: rgba(18, 29, 50, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--map-border-strong);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-primary) transparent;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.35s;
}

.mapa-side-card.is-closed {
  transform: translateX(calc(100% + 2.5rem)) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Przycisk przywrócenia zminimalizowanego panelu */
.mapa-drawer-reopen-btn {
  position: absolute;
  right: 1.5rem;
  top: 1.5rem;
  z-index: 40;
  display: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.15rem;
  background: rgba(18, 29, 50, 0.94);
  border: 1px solid var(--gold-primary);
  border-radius: 22px;
  color: var(--gold-light);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.2s ease;
}

.mapa-drawer-reopen-btn:hover {
  background: var(--gold-primary);
  color: #080F20;
  transform: translateY(-1px);
}

.mapa-drawer-reopen-btn.visible {
  display: inline-flex !important;
}

.mapa-card-head-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mapa-card-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mapa-card-eyebrow {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold-light);
  text-transform: uppercase;
}

.mapa-card-action-btn,
.mapa-card-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  line-height: 1;
  transition: all 0.2s ease;
}

.mapa-card-action-btn:hover,
.mapa-card-close:hover {
  color: #FFF;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.08);
}

/* ── TRYB PEŁNOEKRANOWY (FULLSCREEN / MAXIMIZED) ── */
.mapa-side-card.is-fullscreen {
  position: fixed !important;
  top: 1.5rem !important;
  left: 1.5rem !important;
  right: 1.5rem !important;
  bottom: 1.5rem !important;
  width: auto !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
  height: calc(100vh - 3rem) !important;
  max-height: calc(100vh - 3rem) !important;
  z-index: 100 !important;
  padding: 2rem !important;
  gap: 1.25rem !important;
  border-radius: 24px !important;
  border: 1px solid var(--gold-primary) !important;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.9), 0 0 50px rgba(196, 163, 90, 0.25) !important;
}

.mapa-side-card.is-fullscreen .mapa-card-hero {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(196, 163, 90, 0.2);
}

.mapa-side-card.is-fullscreen .mapa-card-hero-icon {
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
}

.mapa-side-card.is-fullscreen .mapa-card-hero-title {
  font-size: 1.4rem;
}

.mapa-side-card.is-fullscreen .mapa-card-desc {
  font-size: 0.95rem;
  line-height: 1.6;
}

.mapa-side-card.is-fullscreen .mapa-card-metrics-grid {
  padding: 0.85rem 1rem;
}

.mapa-side-card.is-fullscreen .mapa-metric-box strong {
  font-size: 1.25rem;
}

.mapa-side-card.is-fullscreen .mapa-card-projects-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  max-height: none !important;
  gap: 0.75rem !important;
}

.mapa-side-card.is-fullscreen .mapa-card-project-item {
  padding: 0.85rem 1rem;
  border-radius: 12px;
}

.mapa-card-hero {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mapa-card-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(8, 15, 32, 0.8);
  border: 1.5px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 0 14px var(--gold-glow);
}

.mapa-card-hero-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.2;
}

.mapa-card-hero-sub {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mapa-card-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #10B981;
  font-weight: 600;
}

.mapa-card-desc {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.mapa-card-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: rgba(8, 15, 32, 0.65);
  border: 1px solid var(--map-border);
  border-radius: 12px;
  padding: 0.65rem 0.5rem;
  text-align: center;
}

.mapa-metric-box strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--gold-primary);
}

.mapa-metric-box span {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.mapa-btn-block {
  width: 100%;
}

.mapa-card-sublabel {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  margin-bottom: 0.45rem;
}

.mapa-card-projects-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 190px;
  overflow-y: auto;
}

.mapa-card-project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(8, 15, 32, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mapa-card-project-item:hover {
  background: var(--map-surface-hover);
  border-color: var(--gold-hover);
  color: var(--gold-light);
}

.mapa-card-project-item-lead {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapa-card-project-item-trail {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mapa-btn-share {
  margin-top: 0.25rem;
  background: rgba(8, 15, 32, 0.6);
  font-size: 0.78rem;
}

/* ── DOLNY PASEK MISYJNY (PREMIUM 2026 MOCKUP 1:1) ── */
.mapa-mission-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 38;
  background: rgba(8, 15, 32, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--map-border);
  padding: 0.65rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.6);
}

.mapa-mission-lead {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 280px;
}

.mapa-mission-lead-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(196, 163, 90, 0.12);
  border: 1px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  font-size: 1rem;
  flex-shrink: 0;
}

.mapa-mission-lead-title {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  line-height: 1.2;
}

.mapa-mission-lead-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.mapa-mission-stats-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.mapa-mstat {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.mapa-mstat i {
  color: var(--gold-primary);
  font-size: 0.88rem;
}

.mapa-mstat strong {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--gold-light);
}

.mapa-mission-verse-badge {
  text-align: right;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--gold-light);
  opacity: 0.92;
  line-height: 1.3;
  white-space: nowrap;
}

.mapa-verse-cit {
  font-size: 0.7rem;
  color: var(--gold-primary);
  font-style: normal;
  font-weight: 700;
}

/* ── WIDOK DRZEWA / SIATKI HIERARCHICZNEJ ── */
.mapa-tree-view {
  padding: 2rem 1.5rem 5rem 1.5rem;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.mapa-tree-hero {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem 1rem;
  background: linear-gradient(180deg, rgba(18, 29, 50, 0.5) 0%, rgba(8, 15, 32, 0) 100%);
  border-radius: 20px;
  border: 1px solid var(--map-border);
}

.mapa-tree-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.mapa-tree-hero-sub {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 680px;
  margin: 0 auto 1.25rem auto;
  line-height: 1.6;
}

.mapa-tree-hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── PROGRESYWNA SIATKA 8 KAFELKÓW & EFEKT DOMINA (2026) ── */
.mapa-branches-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mapa-categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 0 auto 1.5rem auto;
  max-width: 1280px;
  width: 100%;
}

.mapa-category-tile {
  background: rgba(18, 29, 50, 0.85);
  border: 1px solid var(--map-border);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  min-height: 88px;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  outline: none;
}

.mapa-category-tile:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.mapa-category-tile:hover {
  border-color: var(--gold-hover);
  background: rgba(24, 38, 64, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.mapa-category-tile.is-active {
  border-color: var(--gold-primary);
  background: linear-gradient(145deg, rgba(32, 52, 86, 0.95), rgba(18, 29, 50, 0.98));
  box-shadow: 0 0 24px rgba(196, 163, 90, 0.35), 0 8px 28px rgba(0, 0, 0, 0.6);
  transform: translateY(-2px);
}

.mapa-category-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.mapa-category-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: rgba(8, 15, 32, 0.8);
  border: 1.5px solid var(--gold-primary);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mapa-category-tile.is-active .mapa-category-tile-icon {
  border-color: var(--gold-light);
  box-shadow: 0 0 12px rgba(196, 163, 90, 0.5);
}

.mapa-category-tile-chevron {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s ease;
}

.mapa-category-tile:hover .mapa-category-tile-chevron {
  color: var(--gold-light);
}

.mapa-category-tile.is-active .mapa-category-tile-chevron {
  transform: rotate(180deg);
  color: var(--gold-primary);
}

.mapa-category-tile-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mapa-category-tile-name {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  font-weight: 700;
  color: #F8FAFC;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.mapa-category-tile.is-active .mapa-category-tile-name {
  color: var(--gold-light);
}

.mapa-category-tile-tagline {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mapa-category-tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mapa-category-tile-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(196, 163, 90, 0.12);
  color: var(--gold-light);
  border: 1px solid rgba(196, 163, 90, 0.25);
}

.mapa-category-tile-search-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* ── KONTENER ROZWINIĘTEGO OBSZARU ── */
.mapa-tree-expanded-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 0.25rem;
  max-width: 1280px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.mapa-tree-empty-prompt {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: rgba(18, 29, 50, 0.5);
  border: 1px dashed var(--map-border);
  border-radius: 14px;
  color: var(--text-secondary);
}

.mapa-tree-empty-prompt i {
  font-size: 2rem;
  color: var(--gold-primary);
  margin-bottom: 0.75rem;
  display: block;
}

.mapa-tree-empty-prompt h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #F8FAFC;
  margin-bottom: 0.35rem;
}

.mapa-tree-empty-prompt p {
  font-size: 0.88rem;
  max-width: 520px;
  margin: 0 auto;
}

.mapa-expanded-branch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(90deg, rgba(24, 38, 64, 0.95), rgba(18, 29, 50, 0.75));
  border: 1px solid var(--map-border-strong);
  border-left: 4px solid var(--gold-primary);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.mapa-expanded-branch-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mapa-expanded-branch-icon {
  font-size: 1.4rem;
}

.mapa-expanded-branch-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.03em;
}

.mapa-expanded-branch-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mapa-expanded-close-btn {
  background: transparent;
  border: 1px solid var(--map-border);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  transition: all 0.2s ease;
}

.mapa-expanded-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFF;
  border-color: var(--gold-hover);
}

/* ── DOMINO GRID & ANIMACJA ── */
.mapa-domino-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

@keyframes dominoCascade {
  0% {
    opacity: 0;
    transform: translateY(18px) rotate(-1.5deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}

.mapa-card.domino-item {
  opacity: 0;
  animation: dominoCascade 260ms cubic-bezier(0.16, 1, 0.3, 1) var(--domino-delay, 0ms) forwards;
  pointer-events: auto !important;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .mapa-card.domino-item {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .mapa-category-tile,
  .mapa-category-tile-chevron {
    transition: none !important;
  }
}

.mapa-card {
  background: rgba(18, 29, 50, 0.88);
  border: 1px solid var(--map-border);
  border-radius: 12px;
  padding: 1.05rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
  cursor: pointer;
  user-select: none;
  min-height: 140px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.mapa-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-hover);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.mapa-card.active-selected {
  border-color: var(--gold-primary);
  background: linear-gradient(145deg, rgba(26, 42, 70, 0.95), rgba(18, 29, 50, 0.95));
  box-shadow: 0 0 20px rgba(196, 163, 90, 0.3);
}

.mapa-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.mapa-card-icon-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mapa-card-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.mapa-card-title {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  font-weight: 600;
  color: #F8FAFC;
  line-height: 1.35;
}

.mapa-card-badge {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.mapa-badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.mapa-badge-beta {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.mapa-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.48;
}

.mapa-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mapa-card-btn-open {
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0 4px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.mapa-card-btn-open:hover {
  color: var(--gold-light);
  transform: translateX(2px);
}

/* ── RESPONSYWNOŚĆ MOBILNA DLA KAFELKÓW I KART ── */
@media (max-width: 900px) {
  .mapa-categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .mapa-category-tile {
    padding: 0.85rem 0.95rem;
    min-height: 80px;
  }
}

@media (max-width: 640px) {
  .mapa-categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1.5rem;
  }
  .mapa-category-tile {
    padding: 0.75rem 0.75rem;
    min-height: 76px;
    border-radius: 12px;
  }
  .mapa-category-tile-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .mapa-category-tile-name {
    font-size: 0.85rem;
  }
  .mapa-category-tile-tagline {
    display: none;
  }
  .mapa-domino-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}

/* ── RESPONSYWNOŚĆ MOBILNA I TABLETOWA ── */
@media (max-width: 1200px) {
  .mapa-side-card {
    position: fixed;
    right: 0;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 82vh;
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-right: none;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .mapa-side-card.active:not(.is-closed) {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mapa-side-card.is-closed {
    transform: translateY(100%) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .mapa-side-card.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    padding: 1.25rem !important;
    margin: 0 !important;
    z-index: 100 !important;
  }

  .mapa-side-card.is-fullscreen .mapa-card-projects-list {
    grid-template-columns: 1fr !important;
  }

  .mapa-drawer-reopen-btn {
    top: 3.5rem;
    bottom: auto;
    right: 1rem;
  }
}

@media (max-width: 600px) {
  .mapa-bar-restore-pill {
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.74rem;
    padding: 0 0.75rem;
    min-height: 36px;
  }
  .mapa-drawer-reopen-btn {
    top: 3.5rem !important;
    right: 0.75rem !important;
    font-size: 0.74rem !important;
    padding: 0 0.75rem !important;
    min-height: 36px !important;
  }
}

@media (max-width: 1100px) {
  .mapa-control-bar {
    max-height: 240px;
    gap: 0.75rem;
  }

  .mapa-subbar-search-box {
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
    margin: 0.35rem 0 0 0;
  }
}

@media (max-width: 860px) {
  .mapa-header-search-box {
    display: none; /* Ukryj z belki na korzyść pełnego paska */
  }

  .mapa-nav-tabs {
    display: none;
  }

  .mapa-mission-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .mapa-mission-stats-group {
    gap: 0.75rem;
    font-size: 0.72rem;
  }

  .mapa-mission-verse-badge {
    display: none;
  }
}

@media (max-width: 560px) {
  .mapa-header-sub {
    display: none;
  }

  .mapa-header {
    padding: 0 0.85rem;
  }

  .mapa-control-bar {
    padding: 0.5rem 0.85rem;
  }
}
