:root {
  --bg: #0f1720;
  --card: #ffffff;
  --text: #1b2430;
  --muted: #6b7683;
  --primary: #2e7d32;
  --primary-dark: #1b5e20;
  --primary-contrast: #ffffff;
  --danger: #d32f2f;
  --verified: #1e88e5;
  --border: #e2e6ea;
  --shadow: 0 6px 24px rgba(0, 0, 0, .16);
  --topbar-h: 58px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #dfe6ea;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* --- Üst bar --- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
  z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-emoji { font-size: 26px; line-height: 1; }
.brand-text { min-width: 0; }
.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 12px;
  opacity: .85;
}
.app-version {
  display: inline-block;
  margin-left: auto;
  padding: 1px 5px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
  vertical-align: 1px;
}
.app-version[hidden] { display: none; }

/* --- Üst bar istatistiği (tüm barın gerçek ortasında) --- */
.stats {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;         /* tıklamaları alttaki öğelere geçir */
}
.stats .stat-num { font-weight: 800; font-size: 15px; }
.stats .stat-sep { opacity: .6; }

/* --- Butonlar --- */
.btn {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: transform .05s ease, background .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #fff; color: var(--primary-dark); }
.topbar .btn-primary { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.mobile-label { display: none; }
.btn-ghost {
  background: #eef2f4;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #e6ebee; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 4px 8px;
}

/* --- Harita --- */
#map {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: 0;
  z-index: 1;
}

/* --- Lejant --- */
.legend {
  position: fixed;
  left: 12px;
  bottom: 12px;
  background: rgba(255, 255, 255, .94);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  z-index: 800;
  line-height: 1.7;
}
.legend-title { font-weight: 700; display: block; margin-bottom: 2px; }
.legend-row { display: flex; align-items: center; gap: 7px; }
.legend .dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .2);
}
.verified-dot { background: var(--verified); }

/* --- Son dönemin hareketli bölgeleri --- */
.hot-regions {
  position: fixed;
  left: 12px;
  top: calc(var(--topbar-h) + 12px);
  width: min(250px, calc(100vw - 24px));
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(27, 94, 32, .12);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 800;
  overflow: hidden;
}
.hot-regions summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}
.hot-regions summary::-webkit-details-marker { display: none; }
.hot-regions summary::after { content: '+'; font-size: 17px; line-height: 1; }
.hot-regions[open] summary::after { content: '−'; }
.hot-regions > p {
  margin: -3px 12px 6px;
  color: var(--muted);
  font-size: 10.5px;
}
.hot-regions ol { list-style: none; margin: 0; padding: 0 10px 10px; }
.hot-regions li {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  padding: 5px 3px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.hot-region-rank {
  flex: 0 0 19px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}
.hot-region-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-region-count {
  flex: 0 0 auto;
  min-width: 25px;
  padding: 2px 6px;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  text-align: center;
}
.hot-regions-loading,
.hot-regions-empty { color: var(--muted); justify-content: center; }

/* --- Sağ alt yığın: sosyal + uyarı (Leaflet atıfının üstünde) --- */
.br-stack {
  position: fixed;
  right: 12px;
  bottom: 26px;               /* Leaflet atıfı görünsün diye yukarıda */
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  max-width: 280px;
}
.social {
  display: flex;
  flex-direction: column;      /* hepsi alt alta */
  gap: 7px;
  align-items: flex-end;
}
.social a,
.social button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, .94);
  border-radius: 50%;
  color: #1b2430;
  text-decoration: none;
  box-shadow: var(--shadow);
  border: 0;
  cursor: pointer;
  font: inherit;
}
.social a:hover,
.social button:hover { color: var(--primary); }
#share-map-btn {
  color: #fff;
  background: var(--primary);
}
#share-map-btn:hover { color: #fff; background: var(--primary-dark); }
.disclaimer {
  width: fit-content;          /* kutu yazı kadar geniş */
  max-width: 240px;
  background: rgba(255, 255, 255, .94);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--muted);
  box-shadow: var(--shadow);
  line-height: 1.45;
  text-align: right;
}
.disclaimer strong { color: var(--danger); }
.legal-links {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 4px;
  font-size: 10.5px;
}
.legal-links a { color: var(--primary-dark); }

.game-banner {
  position: fixed;
  right: 12px;
  top: calc(var(--topbar-h) + 12px);
  background: #263238;
  color: #fff;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 800;
  opacity: .92;
}
.game-banner:hover { opacity: 1; }

/* Sağ üstte oyun bağlantısı üstte, Leaflet zoom kontrolü hemen altında. */
.leaflet-top.leaflet-right { top: 38px; }

/* --- Alt panel (bottom sheet) — harita görünür kalır --- */
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  max-height: 78vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .28);
  padding: 8px 18px 18px;
  z-index: 1200;
  animation: slideup .2s ease;
}
.sheet[hidden] { display: none; }
@keyframes slideup { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.sheet-grip {
  width: 42px; height: 4px;
  border-radius: 999px;
  background: #d3dade;
  margin: 4px auto 8px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 12px; line-height: 1.5; }

/* Panel açıkken alt köşe rozetlerini gizle (çakışmasın) */
body.sheet-open .legend,
body.sheet-open .br-stack,
body.sheet-open .hot-regions,
body.sheet-open .game-banner { display: none; }

.sheet-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.sheet-actions .btn { flex: 1; }

.search-row { display: flex; gap: 8px; }
.search-row input {
  flex: 1;
  font: inherit;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 0;
}
.search-results {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  max-height: 190px;
  overflow-y: auto;
}
.search-results li {
  padding: 9px 11px;
  font-size: 13.5px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.search-results li:last-child { border-bottom: none; }
.search-results li:hover { background: #f2f6f8; }
.search-results .empty { color: var(--muted); cursor: default; }

.selected-loc {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 11px;
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  border-radius: 10px;
  font-size: 13.5px;
}
.selected-loc[hidden] { display: none; }
.selected-loc .check {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex: 0 0 auto;
}

.field { display: block; margin-top: 14px; font-size: 13.5px; font-weight: 600; }
.field > span { display: block; margin-bottom: 6px; }
.field em { color: var(--muted); font-weight: 400; font-style: normal; }
.field input[type="file"] { font-weight: 400; width: 100%; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-weight: 400; }

.form-msg {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 13.5px;
}
.form-msg.error { background: #fdecea; color: var(--danger); }
.form-msg.info  { background: #e3f2fd; color: #1565c0; }
.submission-terms {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}
.submission-terms a { color: var(--primary-dark); }

/* --- Sürüklenebilir "yeni nokta" işaretçisi --- */
.pending-marker {
  width: 22px; height: 22px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
  cursor: grab;
}
.pending-marker:active { cursor: grabbing; }

/* --- Harita pin işaretçileri (divIcon) --- */
.pin-marker {
  width: 18px; height: 18px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  position: relative;
}
.pin-marker-new {
  animation: pin-arrive .65s cubic-bezier(.2, .9, .3, 1.25);
}
.pin-marker-new::after {
  content: '';
  position: absolute;
  inset: -8px;
  border: 3px solid rgba(46, 125, 50, .65);
  border-radius: 50%;
  animation: pin-pulse 2.4s ease-out;
  pointer-events: none;
}
@keyframes pin-arrive {
  0% { transform: rotate(-45deg) scale(.25); opacity: .2; }
  70% { transform: rotate(-45deg) scale(1.22); opacity: 1; }
  100% { transform: rotate(-45deg) scale(1); opacity: 1; }
}
@keyframes pin-pulse {
  0% { transform: scale(.35); opacity: .9; }
  100% { transform: scale(2.4); opacity: 0; }
}
.pin-marker .verified-badge {
  position: absolute;
  top: -7px; right: -7px;
  transform: rotate(45deg);
  background: var(--verified);
  color: #fff;
  width: 14px; height: 14px;
  border-radius: 50%;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  border: 1.5px solid #fff;
  font-weight: 700;
}

/* --- Popup içeriği --- */
.pin-popup { font-size: 13.5px; max-width: 220px; }
.pin-popup img {
  width: 100%;
  border-radius: 8px;
  margin: 6px 0;
  display: block;
}
.pin-popup .pin-addr { font-weight: 600; margin: 0 0 4px; }
.pin-popup .pin-date { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.pin-popup .pin-verified {
  color: var(--verified);
  font-weight: 700;
  font-size: 12px;
}
.pin-popup .pin-pending {
  color: #e65100;
  font-weight: 600;
  font-size: 12.5px;
  background: #fff3e0;
  border-radius: 6px;
  padding: 4px 8px;
  margin: 6px 0 0;
}
.pin-popup .pin-report {
  border-top: 1px solid var(--border);
  margin-top: 9px;
  padding-top: 7px;
}
.pin-popup .pin-report-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  padding: 2px 0;
  text-decoration: underline;
}
.pin-popup .pin-report-btn:hover { color: var(--danger); }
.pin-popup .pin-report-btn:disabled { cursor: wait; opacity: .6; }
.pin-popup .pin-report-status {
  color: var(--muted);
  display: block;
  font-size: 11.5px;
  margin-top: 3px;
}
/* --- Paylaşım kartı --- */
.share-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 20, 12, .62);
  z-index: 3200;
}
.share-overlay[hidden] { display: none; }
.share-card {
  position: relative;
  width: min(430px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  padding: 26px 24px 22px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .36);
  text-align: center;
  animation: pop .2s ease;
}
.share-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #f1f4f2;
  cursor: pointer;
  font-size: 16px;
}
.share-card-icon { font-size: 44px; line-height: 1; }
.share-eyebrow {
  margin: 9px 0 2px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.share-card h2 { margin: 3px 0 8px; font-size: 22px; }
.share-message { margin: 0 auto 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.share-total {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 18px;
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #e8f5e9;
}
.share-total[hidden] { display: none; }
.share-total strong { font-size: 23px; line-height: 1; }
.share-total span { font-size: 12px; font-weight: 700; }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.share-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}
.share-whatsapp { background: #1f9f54; }
.share-x { background: #151515; }
.share-copy { grid-column: 1 / -1; color: var(--primary-dark); background: #edf2ee; }
.share-action:hover { filter: brightness(.94); }
.share-status { min-height: 18px; margin: 9px 0 0; color: var(--primary-dark); font-size: 12px; }

/* --- Onboarding --- */
.onb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 14, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 3000;
}
.onb-overlay[hidden] { display: none; }
.onb-card {
  background: #fff;
  border-radius: 18px;
  max-width: 420px;
  width: 100%;
  padding: 26px 24px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  text-align: center;
  animation: pop .18s ease;
  max-height: 92vh;
  overflow-y: auto;
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.onb-emoji { font-size: 46px; line-height: 1; }
.onb-card h2 { margin: 10px 0 8px; font-size: 20px; }
.onb-lead { color: var(--muted); font-size: 14px; margin: 0 0 16px; line-height: 1.5; }
.onb-steps { list-style: none; margin: 0 0 18px; padding: 0; text-align: left; }
.onb-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.onb-steps li:last-child { border-bottom: none; }
.onb-ic { font-size: 20px; flex: 0 0 auto; width: 24px; text-align: center; }
.onb-txt { flex: 1; }
#onb-start { width: 100%; padding: 12px; font-size: 15px; }
.onb-foot { color: var(--muted); font-size: 11.5px; margin: 14px 0 0; }

/* --- Mobil --- */
@media (max-width: 620px) {
  :root { --topbar-h: 92px; }
  .topbar {
    flex-wrap: wrap;
    align-content: center;
    column-gap: 10px;
    row-gap: 5px;
    padding: 7px 12px;
  }
  .brand {
    order: 1;
    flex: 1 1 0;
  }
  #add-pin-btn {
    order: 2;
    flex: 0 0 auto;
  }
  .stats {
    position: static;
    order: 3;
    transform: none;
    width: 100%;
    justify-content: center;
    padding: 4px 12px;
    font-size: 12px;
  }
  .stats .stat-num { font-size: 14px; }
  .desktop-label { display: none; }
  .mobile-label { display: inline; }
  .hot-regions { width: 215px; }
}
@media (max-width: 560px) {
  .brand h1 { font-size: 15px; }
  .brand-sub { display: none; }
  .brand-emoji { font-size: 23px; }
  #add-pin-btn { font-size: 13px; padding: 8px 11px; }
  .disclaimer { max-width: 200px; font-size: 10.5px; padding: 7px 9px; }
  .legend { font-size: 11px; padding: 8px 10px; }
  .game-banner { font-size: 11.5px; padding: 6px 9px; }
  .social a,
  .social button { width: 32px; height: 32px; }
  .sheet { max-width: none; border-radius: 16px 16px 0 0; }
  .share-card { padding: 24px 18px 18px; border-radius: 17px; }
}
@media (max-width: 360px) {
  .brand { gap: 7px; }
  .brand h1 { font-size: 14px; }
  #add-pin-btn { padding-inline: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .pin-marker-new,
  .pin-marker-new::after,
  .share-card,
  .sheet,
  .onb-card { animation: none; }
}
