/* ==========================================================================
   Civifolio - Minimalist 2D Emlak Stratejisi (tasarım dili: docs/tasarim-dili.md)
   Google Maps / Apple sadeliğinde açık renk teması
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;

  /* Harita Renkleri */
  --map-sea: #dbeafe;              /* Doğal pastel deniz / Boğaz mavisi */
  --map-land-default: #ffffff;     /* Temiz beyaz kara */
  --map-land-hover: #e0f2fe;       /* Üzerine gelince açık mavi */
  --map-land-owned: #10b981;       /* Oyuncunun ilçesi: Zümrüt yeşili */
  --map-land-owned-border: #059669;
  --map-stroke: #94a3b8;           /* İlçe sınır çizgisi */

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --color-green: #10b981;
  --color-blue: #2563eb;
  --color-red: #ef4444;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-drawer: -4px 0 24px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- ÜST HEADER: DENGELİ & MERKEZİ --- */
.app-header {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 20;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.app-icon {
  font-size: 1.4rem;
}

.app-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

/* MERKEZİ HUD KARTI (Tam ortada, temiz, dengeli) */
.hud-center-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  padding: 6px 20px;
  box-shadow: var(--shadow-sm);
  gap: 16px;
}

.hud-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-icon {
  font-size: 1.15rem;
}

.hud-stat-text {
  display: flex;
  flex-direction: column;
}

.hud-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1;
}

.hud-stat-value {
  font-size: 0.96rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1.2;
}

.hud-stat-divider {
  width: 1px;
  height: 24px;
  background: var(--border-light);
}

.text-green { color: var(--color-green); }
.text-blue { color: var(--color-blue); }

.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* Header Multiplayer Test Kontrolleri */
.multiplayer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-select-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.player-select-pill:hover {
  border-color: var(--color-blue);
}

.player-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-green);
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.player-dropdown {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.btn-mp-action {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-mp-action:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn-reset-room {
  color: var(--text-muted);
}

.btn-reset-room:hover {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fca5a5;
}

.game-day-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.day-icon {
  font-size: 0.95rem;
}

.btn-next-day {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
  font-weight: 800;
}

.btn-next-day:hover {
  background: #dcfce7;
  border-color: #22c55e;
}

/* --- HARİTA ALANI (SABİT & TAM EKRAN) --- */
.map-container {
  flex: 1;
  position: relative;
  background: var(--map-sea);
  overflow: hidden;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-svg-frame {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.map-svg-frame.grabbing,
.map-svg-frame.grabbing svg,
.map-svg-frame.grabbing * {
  cursor: grabbing !important;
}

#map-svg {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: calc(100vh - 64px);
  display: block;
  touch-action: none;
  will-change: transform;
  transition: transform 0.12s ease-out;
}

.map-container.grabbing #map-svg {
  transition: none !important;
}

/* Başlangıç İpucu */
.start-hint-pill {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-md);
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  z-index: 10;
  backdrop-filter: blur(8px);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Dinamik Harita Tooltip */
.map-tooltip {
  position: absolute;
  display: none;
  background: #0f172a;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  pointer-events: none;
  z-index: 25;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -130%);
  white-space: nowrap;
}

/* İlçe Sınır Poligonları */
.district-polygon {
  fill: var(--map-land-default);
  stroke: var(--map-stroke);
  stroke-width: 0.9;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

.district-polygon:hover {
  fill: var(--map-land-hover);
  stroke: var(--color-blue);
  stroke-width: 1.8;
}

/* --- MULTIPLAYER İLÇE VE RENK SİSTEMİ --- */
.district-polygon.owned-player_1 {
  fill: #10b981 !important;
  stroke: #059669 !important;
  stroke-width: 1.4 !important;
}
.district-polygon.owned-player_1:hover {
  fill: #059669 !important;
}

.district-polygon.owned-player_2 {
  fill: #8b5cf6 !important;
  stroke: #7c3aed !important;
  stroke-width: 1.4 !important;
}
.district-polygon.owned-player_2:hover {
  fill: #7c3aed !important;
}

.district-polygon.owned-player_3 {
  fill: #f59e0b !important;
  stroke: #d97706 !important;
  stroke-width: 1.4 !important;
}
.district-polygon.owned-player_3:hover {
  fill: #d97706 !important;
}

/* Seçili İlçe Vurgusu */
.district-polygon.selected {
  stroke: #1d4ed8 !important;
  stroke-width: 2.4 !important;
}

/* İlçe İsim Etiketleri (Beyaz Konturlu & Kristal Netliğinde) */
.district-label {
  font-family: var(--font-sans);
  paint-order: stroke fill;
  stroke: #ffffff;
  stroke-width: 1.8px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: #0f172a;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  user-select: none;
  font-weight: 700;
  letter-spacing: 0.15px;
  transition: fill 0.15s ease, stroke-width 0.15s ease;
}

.district-label.label-hovered {
  fill: #1d4ed8 !important;
  stroke: #ffffff !important;
  stroke-width: 2.2px !important;
  font-weight: 800 !important;
}

/* Multiplayer Etiket Konturları */
.district-label.owned-label-player_1 {
  stroke: #064e3b !important;
  stroke-width: 2px !important;
  fill: #ffffff !important;
  font-weight: 800 !important;
}

.district-label.owned-label-player_2 {
  stroke: #4c1d95 !important;
  stroke-width: 2px !important;
  fill: #ffffff !important;
  font-weight: 800 !important;
}

.district-label.owned-label-player_3 {
  stroke: #78350f !important;
  stroke-width: 2px !important;
  fill: #ffffff !important;
  font-weight: 800 !important;
}

/* Başka Bir Oyuncuya Ait İlçe Bilgi Kutusu */
.district-other-owner-box {
  background: #fdf4ff;
  border: 1.5px solid #d8b4fe;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.other-owner-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.other-owner-badge {
  font-size: 1.25rem;
}

.other-owner-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #581c87;
}

.other-owner-desc {
  font-size: 0.84rem;
  color: #7e22ce;
  line-height: 1.4;
}

.other-owner-income-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed #e9d5ff;
  font-size: 0.86rem;
  color: #581c87;
  font-weight: 600;
}

.other-owner-income-row strong {
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

/* Rakip Oyuncunun Kurulu Binaları Kutusu */
.buildings-list-box.competitor-buildings-box {
  background: #fdf4ff;
  border: 1.5px solid #d8b4fe;
}

.competitor-buildings-box .specials-group-title {
  color: #7e22ce;
  border-bottom: 1px dashed #d8b4fe;
}

.badge-installed {
  padding: 4px 10px;
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-competitor-locked {
  padding: 4px 10px;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.empty-buildings-note {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 8px 4px;
}

/* --- SAĞ İLÇE YÖNETİM ÇEKMECESİ --- */
.district-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow-drawer);
  z-index: 30;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.district-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.drawer-header h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-drawer-close {
  background: var(--bg-subtle);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-drawer-close:hover {
  background: var(--border-medium);
  color: var(--text-main);
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px 20px 80px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-body::-webkit-scrollbar {
  width: 8px;
}

.drawer-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

.drawer-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid #f1f5f9;
}

.drawer-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* İlçe Açıklaması */
.district-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Başlangıç ve Satın Alma Butonları */
.btn-primary-action {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}

.btn-start-free {
  background: var(--color-green);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-start-free:hover {
  background: #059669;
}

/* Satın Alma Kutusu */
.district-buy-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px;
}

.buy-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.btn-buy {
  background: var(--color-blue);
  color: white;
  margin-top: 10px;
}

.btn-buy:hover {
  background: #1d4ed8;
}

.btn-buy:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}

/* ==========================================================================
   MODERN İLÇE GELİR DAĞILIM KARTI (SAĞ PANEL)
   ========================================================================== */
.district-income-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.08);
}

.d-income-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.d-income-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.d-income-spark-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.d-income-badge-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #14532d;
  line-height: 1.2;
}

.d-income-badge-desc {
  font-size: 0.7rem;
  color: #15803d;
  line-height: 1.3;
  margin-top: 1px;
}

.d-income-total-badge {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #15803d;
  background: #dcfce7;
  border: 1.5px solid #86efac;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.15);
}

.d-income-breakdown-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.income-stat-chip {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  white-space: nowrap;
}

.income-stat-chip.chip-taban {
  border-color: #cbd5e1;
  background: #ffffff;
}

.income-stat-chip.chip-yapilar {
  border-color: #86efac;
  background: #f0fdf4;
}

.income-stat-chip.chip-mega {
  border-color: #93c5fd;
  background: #eff6ff;
}

.income-stat-chip.chip-komsu {
  border-color: #fed7aa;
  background: #fff7ed;
}

.income-stat-chip .chip-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.income-stat-chip .chip-label {
  color: var(--text-muted);
  font-weight: 600;
}

.income-stat-chip.chip-mega .chip-label {
  color: #1e40af;
}

.income-stat-chip.chip-komsu .chip-label {
  color: #c2410c;
}

.income-stat-chip .chip-val {
  font-family: var(--font-mono);
  font-weight: 800;
  color: #16a34a;
}

.income-stat-chip.chip-mega .chip-val {
  color: #2563eb;
}

.income-stat-chip.chip-komsu .chip-val {
  color: #ea580c;
}

/* Üst Kısım Mega Proje Kutusu */
.district-top-mega-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.mega-top-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #1e3a8a;
}

/* İKİ AYRI İNŞAAT LİSTESİ */
.construction-sections-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.buildings-list-box {
  border-radius: 10px;
  padding: 12px;
}

/* LİSTE 1: ORTAK YAPILAR (ÜSTTE, BAŞLIKSIZ) */
.buildings-list-box.common-box {
  background: #ffffff;
  border: 1.5px solid var(--border-medium);
}

/* LİSTE 2: İLÇEYE ÖZEL YAPILAR (ALTTA, BAŞLIKLI) */
.buildings-list-box.specials-box {
  background: #f8fafc;
  border: 1.5px solid #93c5fd;
}

.specials-group-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--color-blue);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #93c5fd;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* BİNA KARTLARI LİSTESİ */
.building-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.building-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease;
  min-width: 0;
}

.building-card:hover {
  border-color: var(--border-medium);
}

.building-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.building-icon {
  font-size: 1.45rem;
  flex-shrink: 0;
}

.building-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.building-count-badge {
  font-size: 0.72rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  margin-left: 4px;
  white-space: nowrap;
}

.building-stats {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 3px;
  line-height: 1.3;
}

.building-stats .b-cost {
  color: var(--text-main);
  font-weight: 600;
  white-space: nowrap;
}

.building-stats .b-income {
  color: var(--color-green);
  font-weight: 700;
  white-space: nowrap;
}

/* İNŞA ET / KİLİTLİ BUTONU */
.btn-build-trigger {
  padding: 7px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}

.btn-build-trigger.active-build:hover {
  background: var(--color-green);
  color: white;
  border-color: var(--color-green);
}

.btn-build-trigger:disabled {
  opacity: 0.55;
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: var(--border-light);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast-msg {
  background: #0f172a;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: toastFade 0.2s ease;
}

@keyframes toastFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   SOL AÇILIR MENÜ (ŞEHİR PANELİ & SIRALAMA & MÜLK DURUMU)
   ========================================================================== */

/* Header 3 Çizgili Menü Butonu (Hamburger) */
.btn-hamburger {
  width: 38px;
  height: 38px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.btn-hamburger:hover {
  background: var(--bg-subtle);
  border-color: var(--color-blue);
}

.btn-hamburger.active {
  background: #eff6ff;
  border-color: var(--color-blue);
}

.hamburger-bar {
  width: 18px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.btn-hamburger:hover .hamburger-bar,
.btn-hamburger.active .hamburger-bar {
  background: var(--color-blue);
}

/* Çekmecelerde Fare İmleci ve Kaydırma Koruması */
.left-drawer,
.district-drawer {
  cursor: default !important;
  user-select: text;
}

.left-drawer *,
.district-drawer * {
  cursor: default;
}

.left-drawer button,
.left-drawer a,
.left-drawer .accordion-header,
.left-drawer .portfolio-player-header,
.left-drawer .portfolio-district-header,
.district-drawer button,
.district-drawer a {
  cursor: pointer !important;
}

/* Sol Çekmece Ana Konteyner */
.left-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 440px;
  max-width: 92vw;
  height: 100%;
  max-height: 100%;
  background: var(--bg-card);
  border-right: 1px solid var(--border-light);
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.08);
  z-index: 35;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default !important;
  user-select: text;
}

.left-drawer.open {
  transform: translateX(0);
}

.left-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  flex-shrink: 0;
  height: 64px;
  box-sizing: border-box;
}

.left-drawer-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.left-drawer-icon {
  font-size: 1.5rem;
}

.left-drawer-title-box h3 {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.left-drawer-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.left-drawer-body {
  flex: 1 1 0px;
  min-height: 0;
  height: calc(100% - 64px);
  max-height: calc(100% - 64px);
  overflow-y: scroll !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 100px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.left-drawer-body::-webkit-scrollbar {
  width: 8px;
}

.left-drawer-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

.left-drawer-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid #f1f5f9;
}

.left-drawer-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Akordiyon Bölümleri */
.sidebar-accordion-section {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.accordion-header {
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.accordion-header:hover {
  background: #f1f5f9;
}

.sidebar-accordion-section.expanded .accordion-header {
  border-bottom-color: var(--border-light);
  background: #f8fafc;
}

.accordion-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-icon {
  font-size: 1.15rem;
}

.accordion-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
}

.accordion-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 2px 7px;
  border-radius: 999px;
}

.accordion-arrow {
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  display: inline-block;
}

.sidebar-accordion-section.expanded .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  padding: 12px;
}

.sidebar-accordion-section.expanded .accordion-body {
  display: block;
}

/* --- 1. OYUNCU SIRALAMASI KARTLARI --- */
.leaderboard-cards-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-card {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.leaderboard-card:hover {
  border-color: var(--border-medium);
}

.leaderboard-card.is-current-player {
  background: #f0fdf4;
  border-color: #86efac;
}

.leaderboard-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leaderboard-rank-tag {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rank-badge {
  font-weight: 800;
  font-size: 0.78rem;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
}

.rank-1 { background: #fef08a; color: #854d0e; border: 1px solid #fde047; }
.rank-2 { background: #e2e8f0; color: #334155; border: 1px solid #cbd5e1; }
.rank-3 { background: #fed7aa; color: #9a3412; border: 1px solid #fdba74; }

.player-name-label {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-you {
  font-size: 0.68rem;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 800;
}

.player-districts-pill {
  font-size: 0.74rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
}

.leaderboard-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  background: var(--bg-subtle);
  border-radius: 6px;
  padding: 6px 8px;
}

.l-stat-cell {
  display: flex;
  flex-direction: column;
}

.l-stat-cell .lbl {
  font-size: 0.66rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.l-stat-cell .val {
  font-size: 0.84rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* --- 2. MÜLK DURUMU (PORTFÖY AĞACI) --- */
.properties-players-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portfolio-player-group {
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  background: #ffffff;
}

.portfolio-player-header {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  background: #f8fafc;
  transition: background 0.15s ease;
}

.portfolio-player-header:hover {
  background: #f1f5f9;
}

.portfolio-p-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 800;
}

.portfolio-p-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.p-count-pill {
  font-size: 0.72rem;
  padding: 2px 6px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-weight: 600;
  color: var(--text-muted);
}

.p-income-text {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.p-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  display: inline-block;
}

.portfolio-player-group.expanded .p-arrow {
  transform: rotate(180deg);
}

.portfolio-player-body {
  display: none;
  padding: 8px 10px;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
}

.portfolio-player-group.expanded .portfolio-player-body {
  display: flex;
}

.empty-portfolio-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 6px 4px;
}

/* Alt Akordiyon: İlçe Kartı */
.portfolio-district-card {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-card);
}

.portfolio-district-header {
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  background: #ffffff;
  transition: background 0.15s ease;
}

.portfolio-district-header:hover {
  background: var(--bg-subtle);
}

.p-dist-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.p-dist-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-map-focus {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--color-blue);
  line-height: 1.2;
  transition: all 0.15s ease;
}

.btn-map-focus:hover {
  background: var(--color-blue);
  color: #ffffff;
}

.p-dist-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.p-dist-income {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.p-dist-b-count {
  font-size: 0.7rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-muted);
  font-weight: 600;
}

.dist-sub-arrow {
  font-size: 0.68rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  display: inline-block;
}

.portfolio-district-card.expanded .dist-sub-arrow {
  transform: rotate(180deg);
}

.portfolio-district-body {
  display: none;
  padding: 8px 10px;
  background: #f8fafc;
  border-top: 1px dashed var(--border-light);
  flex-direction: column;
  gap: 6px;
}

.portfolio-district-card.expanded .portfolio-district-body {
  display: flex;
}

.dist-base-rent-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}

.dist-base-rent-line strong {
  font-family: var(--font-mono);
}

.portfolio-buildings-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portfolio-b-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  font-size: 0.78rem;
}

.b-mini-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.b-mini-icon {
  font-size: 0.95rem;
}

.b-mini-name {
  font-weight: 600;
  color: var(--text-main);
}

.b-mini-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 0 4px;
  border-radius: 3px;
  border: 1px solid var(--border-light);
}

.b-mini-income {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.empty-sub-buildings {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 3px 0;
}

/* Bilgi İpucu */
.left-drawer-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.4;
}

/* ==========================================================================
   MEGA ALTYAPI YATIRIMLARI (METRO AĞI & DEVAM EDEN PROJELER)
   ========================================================================== */

/* Sağ Çekmece: Mega Altyapı Kutusu */
.mega-box {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
}

#drawer-mega-title {
  color: #4338ca;
  border-bottom: 1px dashed #c7d2fe;
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 10px;
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mega-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   KOMŞU MEGA ALTYAPI GELİR KATKISI KUTUSU (SAĞ PANEL)
   ========================================================================== */
.district-neighbor-bonus-box {
  margin-top: 10px;
}

.neighbor-bonus-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.n-bonus-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.n-bonus-title-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.n-bonus-badge-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.n-bonus-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #14532d;
  line-height: 1.2;
}

.n-bonus-subtitle {
  font-size: 0.7rem;
  color: #15803d;
  line-height: 1.3;
  margin-top: 2px;
}

.n-bonus-total-pill {
  font-size: 0.88rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.n-bonus-chips-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.n-source-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.74rem;
}

.n-chip-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.n-chip-district {
  font-weight: 700;
  color: #166534;
}

.n-chip-project {
  color: #15803d;
  font-size: 0.72rem;
  flex: 1;
}

.n-chip-amount {
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  white-space: nowrap;
}

/* ==========================================================================
   MEGA ALTYAPI SEÇİM & İNŞAAT KARTLARI (SAĞ PANEL)
   ========================================================================== */
.mega-choice-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.76rem;
  color: #1e40af;
  margin-bottom: 8px;
  line-height: 1.35;
}

.mega-choice-notice .notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.mega-choice-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mega-choice-card {
  min-width: 0;
}

.mega-card-info {
  min-width: 0;
  flex: 1;
}

.mega-building-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  width: 100%;
}

.mega-building-card.in-progress {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
}

.mega-building-card.completed {
  border-color: #86efac;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.mega-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mega-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.mega-card-stage-pill {
  font-size: 0.72rem;
  color: #2563eb;
  font-weight: 700;
  margin-top: 2px;
}

.mega-card-stage-pill.is-completed {
  color: #15803d;
}

.badge-ongoing {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-completed {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #15803d;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-mini-progress-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.card-mini-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.mega-card-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mega-pill-stat {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  white-space: nowrap;
}

/* ==========================================================================
   HARİTA ÜZERİNDEKİ MİNİMAL MEGA PROJE ROZETLERİ
   ========================================================================== */
.map-mega-badge-group {
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* ==========================================================================
   SOL PANEL: DEVAM EDEN YATIRIMLAR KARTLARI
   ========================================================================== */
.investments-projects-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-investments-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 12px 8px;
  line-height: 1.45;
  text-align: center;
  background: var(--bg-subtle);
  border-radius: 8px;
  border: 1px dashed var(--border-light);
}

.investment-card {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
  box-sizing: border-box;
}

.investment-card:hover {
  border-color: var(--border-medium);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.investment-card.is-completed {
  background: #f0fdf4;
  border-color: #86efac;
}

.invest-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.invest-header-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.invest-project-badge-icon {
  font-size: 1.45rem;
  flex-shrink: 0;
  line-height: 1;
}

.invest-header-titles {
  min-width: 0;
}

.invest-card-district-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.invest-card-project-type {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 1px;
}

.invest-owner-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.invest-owner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-you {
  color: #2563eb;
  font-weight: 800;
}

/* Aşama ve İlerleme Bölümü */
.invest-timeline-block {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invest-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.invest-stage-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.stage-num {
  font-weight: 800;
  color: var(--text-main);
}

.stage-slash {
  color: var(--text-dim);
}

.stage-total {
  color: var(--text-muted);
}

.stage-pct {
  font-size: 0.7rem;
  color: #2563eb;
  margin-left: 4px;
  font-family: var(--font-sans);
  font-weight: 700;
}

.invest-days-left-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.invest-progress-bar-wrap {
  width: 100%;
  height: 7px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.invest-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.invest-segments-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
}

.invest-segment-dot {
  height: 3px;
  background: #cbd5e1;
  border-radius: 2px;
}

.invest-segment-dot.done {
  background: #10b981;
}

/* 2 Kolonlu Ekonomik KPI Izgarası */
.invest-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.invest-stat-tile {
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border-light);
}

.invest-stat-tile.tile-primary {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.invest-stat-tile.tile-secondary {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.stat-tile-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.2;
}

.stat-tile-val {
  font-size: 0.94rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1.2;
  margin-top: 1px;
}

.stat-tile-sub {
  font-size: 0.66rem;
  color: var(--text-muted);
}

/* Sınırdaki Komşu İlçeler */
.invest-neighbors-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.neighbors-section-header {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.neighbors-icon {
  font-size: 0.82rem;
}

.neighbor-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.neighbor-chip {
  font-size: 0.68rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  line-height: 1.2;
}

.neighbor-chip.is-mine {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
  font-weight: 700;
}

.invest-my-neighbor-bonus-alert {
  font-size: 0.72rem;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

/* Buton ve Katkı Durumu */
.invest-card-footer {
  margin-top: 2px;
}

.btn-invest-action {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.btn-invest-action.btn-can-invest {
  background: #2563eb;
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-invest-action.btn-can-invest:hover {
  background: #1d4ed8;
}

.btn-invest-action.btn-invest-done {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid var(--border-medium);
  cursor: not-allowed;
}

.btn-invest-action.btn-invest-completed {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  cursor: default;
}

.btn-invest-action.btn-no-cash {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid var(--border-light);
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .district-drawer,
  .left-drawer {
    width: 100vw;
  }
  .hud-center-card {
    padding: 4px 12px;
    gap: 10px;
  }
}

/* --- AKSİYONLAR VE CANLI ETKİNLİK AKIŞI BUTONU --- */
.btn-action-feed {
  background: #f8fafc;
  color: #1e293b;
  border: 1px solid var(--border-medium);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: all 0.2s ease;
}

.btn-action-feed:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
  transform: translateY(-1px);
}

.action-feed-icon {
  font-size: 1rem;
  line-height: 1;
}

.feed-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* --- SAĞ ÜST AÇILIR AKSİYON PANELİ --- */
.action-feed-panel {
  position: fixed;
  top: 56px;
  right: 16px;
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: 600px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-medium);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.05);
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: feedSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes feedSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.action-feed-header {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

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

.action-feed-title-icon {
  font-size: 1.35rem;
  line-height: 1;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 4px;
}

.action-feed-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.action-feed-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

.action-feed-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-feed-count-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.btn-close-action-feed {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s ease;
}

.btn-close-action-feed:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

/* Filtre Sekmeleri */
.action-feed-filters {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}

.feed-filter-btn {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.feed-filter-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.feed-filter-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25);
}

/* Kaydırılabilir Liste */
.action-feed-list {
  padding: 10px 14px;
  overflow-y: auto;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafafa;
}

.action-feed-list::-webkit-scrollbar {
  width: 5px;
}

.action-feed-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Aksiyon Kartı */
.action-item-card {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.action-item-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.action-item-card.is-clickable {
  cursor: pointer;
}

.action-item-card.is-clickable:hover {
  transform: translateY(-1px);
}

.action-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.action-player-badge {
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-main);
}

.action-player-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.action-tag-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.action-tag-pill.tag-building-start {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
}

.action-tag-pill.tag-building-complete {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.action-tag-pill.tag-mega-start,
.action-tag-pill.tag-mega-invest {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.action-tag-pill.tag-mega-complete {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}

.action-tag-pill.tag-district {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.action-tag-pill.tag-day {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.action-item-body {
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.35;
  font-weight: 600;
}

.action-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.action-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.action-mini-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.action-mini-chip.cost {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.action-mini-chip.income {
  color: #16a34a;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.action-mini-chip.duration {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.action-item-time {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}

.action-feed-empty {
  padding: 36px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.feed-empty-icon {
  font-size: 2.2rem;
  opacity: 0.8;
}

.feed-empty-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
}

.feed-empty-desc {
  font-size: 0.78rem;
  line-height: 1.4;
  max-width: 280px;
}

/* --- DEVAM EDEN İNŞAATLARIN ÇEKMECE İÇİ DURUM GÖSTERGELERİ --- */
.building-card.is-under-construction {
  background: #fffbeb;
  border-color: #fcd34d;
}

.badge-under-construction {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-build-trigger.btn-under-construction {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
  cursor: not-allowed;
  font-weight: 700;
  opacity: 0.85;
}

.building-duration-chip {
  font-size: 0.68rem;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1px 5px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* --- 10 DAKİKALIK GERÇEK ZAMANLI GERİ SAYIM ROZETİ --- */
.day-countdown-badge {
  background: #0f172a;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  margin-left: 6px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  display: inline-flex;
  align-items: center;
}

/* --- GÜNLÜK 1 İLÇE ALIM SINIRI UYARISI --- */
.buy-limit-warning {
  background: #fef2f2;
  color: #b91c1c;
  border: 1.5px solid #fecaca;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- RAKİP İLÇESİNDE DEVAM EDEN İNŞAATLARIN ÇEKMECE GÖRÜNÜMÜ --- */
.competitor-subgroup-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.competitor-ongoing-card {
  border-left: 3.5px solid #f59e0b !important;
}

.competitor-construction-status-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}

.status-days-text {
  font-size: 0.78rem;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.status-left-text {
  font-size: 0.68rem;
  font-weight: 600;
  color: #92400e;
}

.badge-competitor-construction {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.badge-competitor-construction .mini-days-left {
  font-size: 0.67rem;
  font-weight: 600;
  color: #78350f;
}


/* ==========================================================================
   ÇOK OYUNCULU SÜRÜM EKLERİ (MVP'den sonra eklenenler)
   Kural: docs/tasarim-dili.md. Yeni renk, font veya gölge icat edilmez;
   yukarıdaki MVP token'ları ve bileşenleri yeniden kullanılır.
   ========================================================================== */

/* Mobil tarayıcıda adres çubuğu açılıp kapanınca yükseklik doğru hesaplansın */
body {
  height: 100dvh;
}

/* Ekranlar: Türkiye haritasında (ana sayfa) oyun parçaları gizlenir */
.screen-home .game-only {
  display: none !important;
}

/* Bir ilçenin içinde başka bir ilçe olan illerde (delikli sınır) boyama doğru olsun */
.district-polygon {
  fill-rule: evenodd;
}

/* Oyuncu 4 (Kırmızı) ve 5 (Mavi): MVP'deki 1-3 ile aynı kalıp */
.district-polygon.owned-player_4 {
  fill: #ef4444 !important;
  stroke: #dc2626 !important;
  stroke-width: 1.4 !important;
}
.district-polygon.owned-player_4:hover {
  fill: #dc2626 !important;
}

.district-polygon.owned-player_5 {
  fill: #0ea5e9 !important;
  stroke: #0284c7 !important;
  stroke-width: 1.4 !important;
}
.district-polygon.owned-player_5:hover {
  fill: #0284c7 !important;
}

.district-label.owned-label-player_4 {
  stroke: #7f1d1d !important;
  stroke-width: 2px !important;
  fill: #ffffff !important;
  font-weight: 800 !important;
}

.district-label.owned-label-player_5 {
  stroke: #0c4a6e !important;
  stroke-width: 2px !important;
  fill: #ffffff !important;
  font-weight: 800 !important;
}

/* Oyuncu adı (MVP'deki oyuncu seçici açılır listenin yerinde, aynı pill içinde) */
.player-name-text {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Harita kaynağı notu (OpenStreetMap lisansı gereği), ipucu pill'inin sönük hali */
.map-attribution {
  position: absolute;
  right: 8px;
  bottom: 6px;
  z-index: 5;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 7px;
  border-radius: 999px;
  text-decoration: none;
}

/* --- POPUP (İsim girişi, Oda lobisi, Oyun sonu) ---
   Kart: Aksiyonlar panelinin birebir aynısı (beyaz cam, 14px köşe, büyük gölge, aynı açılış animasyonu) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: 480px;
  max-width: 100%;
  max-height: calc(100dvh - 32px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-medium);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: feedSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-body {
  padding: 14px 16px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fafafa;
}

.modal-body .btn-primary-action:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* Metin kutusu: satın alma kutusu ile aynı kenarlık ve köşe, odakta mavi (MVP hover rengi) */
.text-input {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--border-medium);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-card);
  outline: none;
  transition: border-color 0.15s ease;
}

.text-input:focus {
  border-color: var(--color-blue);
}

.lobby-rooms-list .btn-join-room {
  width: 100%;
}

/* --- TELEFON VE TABLET --- */
@media (max-width: 900px) {
  .app-header {
    height: auto;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }

  .header-left {
    flex: 1 1 auto;
    min-width: 0;
  }

  .app-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-right {
    flex: 0 0 auto;
  }

  .multiplayer-bar {
    gap: 6px;
  }

  /* HUD kartı ikinci satıra, tam genişlikte */
  .hud-center-card {
    order: 3;
    flex: 1 1 100%;
    justify-content: space-between;
  }

  /* Butonlarda sadece ikon kalsın */
  .action-feed-label,
  .btn-label,
  .day-label,
  .day-icon {
    display: none;
  }

  .player-name-text {
    max-width: 90px;
  }

  .action-feed-panel {
    top: 112px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 124px);
  }

  .action-feed-list {
    max-height: none;
  }

  #map-svg {
    max-height: none;
  }

  .start-hint-pill {
    width: calc(100% - 24px);
    justify-content: center;
    text-align: center;
    font-size: 0.8rem;
    top: 10px;
  }

  .toast-container {
    left: 8px;
    right: 8px;
    bottom: 12px;
  }
}

@media (max-width: 520px) {
  .screen-game .player-select-pill {
    display: none;
  }

  .hud-center-card {
    padding: 4px 10px;
    gap: 6px;
  }

  .hud-icon {
    font-size: 0.95rem;
  }

  .hud-stat-label {
    font-size: 0.6rem;
  }

  .hud-stat-value {
    font-size: 0.82rem;
  }
}
