:root{
  --bg:#0b1410;
  --panel:#0f1f17;
  --panel2:#10261c;
  --text:#e7f6ee;
  --muted:#a8cbb8;
  --accent:#22c55e;        /* зеленый */
  --accent2:#16a34a;
  --danger:#ef4444;
  --warning:#f59e0b;
  --shadow: 0 16px 50px rgba(0,0,0,.45);
  --radius:18px;
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family: ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial;
  background:
    radial-gradient(1200px 800px at 30% 20%, rgba(34,197,94,.12), transparent 55%),
    radial-gradient(900px 700px at 85% 65%, rgba(22,163,74,.10), transparent 55%),
    var(--bg);
  color:var(--text);
  overflow:hidden;
}

.hidden{display:none !important;}
a{color:inherit;}

hr{
  border:0;
  border-top:1px solid rgba(255,255,255,.08);
  margin:16px 0;
}

.btn{
  border:0;
  padding:10px 14px;
  border-radius:14px;
  color:var(--text);
  background:rgba(255,255,255,.06);
  cursor:pointer;
  transition:.15s transform,.15s background,.15s box-shadow,.15s border-color;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
.btn:hover{transform:translateY(-1px); background:rgba(255,255,255,.10);}
.btn:active{transform:translateY(0px);}

.btn-primary{
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  box-shadow: 0 10px 30px rgba(34,197,94,.22);
}
.btn-primary:hover{box-shadow: 0 14px 40px rgba(34,197,94,.28);}

.btn-outline{
  background:transparent;
  border:1px solid rgba(255,255,255,.14);
}
.btn-outline:hover{border-color: rgba(255,255,255,.22);}

.btn-danger{
  background:rgba(239,68,68,.16);
  border:1px solid rgba(239,68,68,.30);
}
.btn-danger:hover{background:rgba(239,68,68,.22);}

.input, select, textarea{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:var(--text);
  outline:none;
}
.input:focus, select:focus, textarea:focus{
  border-color: rgba(34,197,94,.55);
  box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}
textarea{resize:vertical;}
select{appearance:none;}

.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  font-size:12px;
  color:var(--muted);
}
.pill strong{color:var(--text); font-weight:800;}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  color:var(--text);
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
}
.badge.warn{
  background: rgba(245,158,11,.18);
  border-color: rgba(245,158,11,.30);
}

.hint{font-size:12px; color:var(--muted); line-height:1.3;}
.error{
  background: rgba(239,68,68,.14);
  border: 1px solid rgba(239,68,68,.30);
  padding:10px 12px;
  border-radius:14px;
  color:#ffd7d7;
  font-size:13px;
}
.ok{
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.26);
  padding:10px 12px;
  border-radius:14px;
  color:#dfffe9;
  font-size:13px;
}

/* layout */
.app{
  height:100%;
  display:flex;
  flex-direction:column;
}

.navbar{
  height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:0 16px;
  background:rgba(15,31,23,.72);
  border-bottom:1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
}

.brand{
  display:flex; align-items:center; gap:12px;
  min-width: 260px;
}
.logo{
  width:40px; height:40px;
  border-radius:14px;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  display:grid; place-items:center;
  font-weight:1000;
  box-shadow: 0 12px 30px rgba(34,197,94,.20);
}
.logo span{filter: drop-shadow(0 6px 10px rgba(0,0,0,.25));}

.navsearch{
  flex: 1;
  max-width: 560px;
  min-width: 260px;
}
.search{
  position:relative;
  z-index:100000;
}
.dropdown{
  position:absolute;
  top: calc(100% + 8px);
  left:0; right:0;
  background: rgba(15,31,23,.96);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow:auto;
  max-height:240px;
  z-index: 100001;
}
.dropItem{
  padding:10px 12px;
  cursor:pointer;
  font-size:13px;
  color: var(--text);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.dropItem:last-child{border-bottom:0;}
.dropItem:hover{background: rgba(255,255,255,.06);}
.dropSmall{
  font-size:12px;
  color: var(--muted);
  margin-top:3px;
}

.userbar{
  display:flex;
  align-items:center;
  gap:10px;
}
.user-meta{display:flex; flex-direction:column; line-height:1.05; align-items:flex-end;}
.user-meta .name{font-weight:900; font-size:14px;}
.user-meta .sub{font-size:12px; color:var(--muted);}

.avatar{
  width:38px; height:38px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  display:grid; place-items:center;
  overflow:hidden;
}
.avatar img{width:100%; height:100%; object-fit:cover;}

.main{
  display:flex;
  height: calc(100% - 64px);
  min-height: 0;
}
.sidebar{
  width: 360px;
  padding: 14px;
  border-right:1px solid rgba(255,255,255,.08);
  background: rgba(15,31,23,.40);
  overflow:auto;
}

#map{
  flex:1;
  height:100%;
}

.card{
  background: rgba(15,31,23,.72);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}
.section-title{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin: 12px 2px 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}
.list{display:flex; flex-direction:column; gap:10px; margin-bottom:8px;}

.task{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 10px 10px;
}
.taskTop{display:flex; justify-content:space-between; gap:10px; align-items:flex-start;}
.taskTitle{font-weight:900; font-size:14px;}
.taskMeta{font-size:12px; color: var(--muted); margin-top:2px;}
.taskDesc{font-size:13px; color: var(--text); opacity:.92; margin-top:8px; line-height:1.25;}
.tag{
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
}
.tag.mine{border-color: rgba(34,197,94,.34); background: rgba(34,197,94,.12);}
.tag.open{border-color: rgba(255,255,255,.14);}
.tag.accepted{border-color: rgba(245,158,11,.34); background: rgba(245,158,11,.14);}

.row{display:flex; gap:10px; align-items:center;}
.rowEnd{display:flex; justify-content:flex-end; gap:10px;}
.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:10px;}

.toasts{
  position: fixed;
  right: 16px;
  bottom: 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  z-index: 100000;
}
.toast{
  min-width: 240px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(15,31,23,.92);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
}

/* overlays/modals */
.overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(12px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 99990;
}
.modal{
  width: min(560px, 96vw);
  background: rgba(15,31,23,.94);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: visible; /* allow dropdowns to extend */
}
.modal.chat{width: min(720px, 96vw);}

.head, .modalTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.body, .stack{padding: 14px 16px;}
.foot{padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); display:flex; justify-content:space-between; gap:10px;}

.close-x, .iconBtn{
  border:0;
  width:40px; height:40px;
  border-radius:14px;
  cursor:pointer;
  background: rgba(255,255,255,.06);
  color: var(--text);
}
.close-x:hover, .iconBtn:hover{background: rgba(255,255,255,.10);}

.modalTitle{font-weight:1000; font-size:16px;}
.modalSub{font-size:12px; color: var(--muted); margin-top:2px;}

.field{margin-bottom:10px;}
.field label{display:block; font-size:12px; color: var(--muted); margin: 0 0 6px 2px; font-weight:900; letter-spacing:.04em;}

.textarea{min-height:96px;}

.overlay.blockMap{pointer-events:none;}
.overlay.blockMap .modal{pointer-events:auto;}

/* avatar picker */
.avatarPick{
  display:flex;
  gap:14px;
  align-items:center;
  cursor:pointer;
  padding: 10px;
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.03);
}
.avatarPick:hover{background: rgba(255,255,255,.05);}
.avatarPick input[type="file"]{display:none;}
.avatarBig{
  width:92px; height:92px;
  border-radius:26px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  display:grid; place-items:center;
  overflow:hidden;
  background-size:cover;
  background-position:center;
}
.avatarBig::after{content:"+"; font-size:26px; opacity:.55;}
.avatarBig.hasImg::after{content:"";}
.avatarBig img{width:100%; height:100%; object-fit:cover;}

/* chat */
.chatBody{
  height: min(56vh, 520px);
  overflow:auto;
  padding: 14px 16px;
  background: rgba(0,0,0,.08);
}
.msgRow{display:flex; gap:10px; margin: 10px 0;}
.msgRow.me{justify-content:flex-end;}
.bubble{
  max-width: 72%;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: var(--text);
  font-size: 13px;
  line-height:1.3;
}
.msgRow.me .bubble{
  background: rgba(34,197,94,.14);
  border-color: rgba(34,197,94,.24);
}
.msgMeta{
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.chatBottom{
  display:flex;
  gap:10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* leaderboard */
.lbRow{
  display:grid;
  grid-template-columns: 26px 44px 1fr auto;
  gap:10px;
  align-items:center;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.lbRank{font-weight:1000; color: var(--muted); font-size:12px;}
.lbName{font-weight:900; font-size:13px;}
.lbLogin{font-size:12px; color: var(--muted);}
.lbPts{font-weight:1000; color: #dfffe9;}

/* pins */
.pin{
  width: 14px;
  height: 14px;
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  border: 2px solid rgba(255,255,255,.26);
  box-shadow: 0 10px 18px rgba(0,0,0,.35);
}
.pin.open{background: rgba(34,197,94,.62); border-color: rgba(34,197,94,.88);}
.pin.mine{background: rgba(34,197,94,.92); border-color: rgba(255,255,255,.55);}
.pin.accepted{background: rgba(245,158,11,.72); border-color: rgba(245,158,11,.95);}

/* Leaflet popup: readable in dark theme */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip{
  background: rgba(15,31,23,.96) !important;
  color: var(--text) !important;
  border:1px solid rgba(255,255,255,.10) !important;
  box-shadow: var(--shadow) !important;
}
.leaflet-popup-content{ margin: 12px 14px !important; color: var(--text) !important; }
.leaflet-container a{ color: var(--text) !important; }

/* make sure modal is above Leaflet */
.leaflet-control-container{ z-index: 10; }


/* App page locks scroll */
body.appBody{ overflow:hidden; }

.logo img{width:22px;height:22px;object-fit:contain;filter:drop-shadow(0 6px 10px rgba(0,0,0,.25));}

/* Auth header brand */
.authHead{display:flex;align-items:center;gap:12px;}
.authBrand{width:44px;height:44px;border-radius:16px;background:linear-gradient(135deg,var(--accent),var(--accent2));
  display:grid;place-items:center;box-shadow:0 12px 30px rgba(34,197,94,.20); overflow:hidden;}
.authLogo{width:34px;height:34px;object-fit:contain;}

/* Role segmented buttons */
.seg{
  display:flex;
  gap:10px;
  padding:6px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
}
.segBtn{
  flex:1;
  padding:12px 10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.88);
  font-weight:900;
  cursor:pointer;
  transition:.15s transform,.15s background,.15s border-color;
}
.segBtn:hover{transform:translateY(-1px); background: rgba(255,255,255,.08);}
.segBtn.active{
  background: linear-gradient(135deg,var(--accent),var(--accent2));
  border-color: rgba(34,197,94,.55);
  color: #082012;
}

.backLink{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: var(--text);
  text-decoration:none;
  font-size:13px;
  font-weight:900;
}
.backLink:hover{background: rgba(255,255,255,.06); transform: translateY(-1px);}

/* Landing page */
body.landingBody{
  background:
    radial-gradient(1200px 800px at 25% 18%, rgba(34,197,94,.18), transparent 58%),
    radial-gradient(900px 700px at 85% 70%, rgba(22,163,74,.14), transparent 58%),
    var(--bg);
  min-height:100%;
  overflow:auto;
}
.landingNav{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 18px;
  background: rgba(15,31,23,.68);
  border-bottom:1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
}
.landingBrand{display:flex;align-items:center;gap:12px;}
.landingLogo{width:46px;height:46px;object-fit:contain;border-radius:16px;background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12); padding:6px;}
.landingName{font-weight:1000;font-size:16px;}
.landingTag{font-size:12px;color:var(--muted);margin-top:2px;}
.landingActions{display:flex;gap:10px;align-items:center;}
.landingMain{padding: 26px 18px 40px; max-width: 1120px; margin:0 auto;}
.hero{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 22px;
  align-items: start;
  padding: 20px 0 10px;
}
.hero h1{font-size:46px; line-height:1.06; margin:0 0 12px;}
.heroLead{font-size:16px; color: rgba(255,255,255,.86); line-height:1.5; margin:0 0 18px; max-width: 56ch;}
.heroButtons{display:flex; gap:12px; flex-wrap:wrap; margin-bottom:18px;}
.heroBtn{padding:12px 18px; border-radius:18px;}
.heroStats{display:flex; gap:12px; flex-wrap:wrap;}
.stat{padding:10px 12px; border-radius:18px; border:1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.03); min-width: 160px;}
.statNum{font-weight:1000; text-transform:uppercase; letter-spacing:.08em; font-size:12px; color: var(--muted);}
.statText{margin-top:6px; font-size:13px; color: rgba(255,255,255,.88);}

.heroCard{
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(15,31,23,.72);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.heroCardTop{
  display:flex; gap:12px; align-items:center;
  padding: 14px 14px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.heroCardLogo{width:44px;height:44px;object-fit:contain;border-radius:16px;background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12); padding:6px;}
.heroCardTitle{font-weight:1000;}
.heroCardSub{font-size:12px;color:var(--muted);}
.heroCardBody{padding: 14px;}
.heroMockRow{
  display:flex; align-items:center; gap:12px;
  padding: 10px 10px;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  margin-bottom:10px;
}
.mockDot{width:12px;height:12px;border-radius:999px;border:2px solid rgba(255,255,255,.35); background: rgba(255,255,255,.10);}
.mockDot.open{background: rgba(34,197,94,.72); border-color: rgba(34,197,94,.95);}
.mockDot.accepted{background: rgba(245,158,11,.72); border-color: rgba(245,158,11,.95);}
.mockText{flex:1;}
.mockTitle{font-weight:1000; font-size:13px;}
.mockSub{font-size:12px;color:var(--muted); margin-top:2px;}
.mockTag{font-size:11px;padding:4px 10px;border-radius:999px;border:1px solid rgba(34,197,94,.35); background: rgba(34,197,94,.12);}
.mockTag.warn{border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.14);}
.heroNote{margin-top: 10px; font-size:12px; color: var(--muted);}

.landingSection{margin-top: 28px; padding-top: 10px;}
.landingSection h2{margin: 0 0 12px; font-size:26px;}
.cards3{display:grid; grid-template-columns: repeat(3,1fr); gap: 12px;}
.lcard{padding: 14px 14px; border-radius: 22px; border:1px solid rgba(255,255,255,.10); background: rgba(15,31,23,.62); box-shadow: 0 10px 28px rgba(0,0,0,.18);}
.lcardTitle{font-weight:1000; margin-bottom:6px;}
.lcardText{color: rgba(255,255,255,.86); font-size:13px; line-height:1.45;}

.howGrid{display:grid; grid-template-columns: repeat(3,1fr); gap: 12px;}
.howStep{display:flex; gap:12px; padding: 14px; border-radius: 22px; border:1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.03);}
.howNum{width:40px;height:40px;border-radius:16px; display:grid; place-items:center; font-weight:1000;
  background: linear-gradient(135deg,var(--accent),var(--accent2)); color:#082012;}
.howTitle{font-weight:1000; margin-bottom:4px;}
.howText{font-size:13px; color: rgba(255,255,255,.86);}
.centerCTA{display:flex; justify-content:center; margin-top: 16px;}

.landingFooter{
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 18px 28px;
  color: var(--muted);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
}
@media (max-width: 980px){
  .hero{grid-template-columns: 1fr;}
  .cards3{grid-template-columns:1fr;}
  .howGrid{grid-template-columns:1fr;}
  .landingActions{gap:8px;}
  .hero h1{font-size:36px;}
}


.dropdown.dropUp{
  top: auto;
  bottom: calc(100% + 8px);
}
