:root {
  /* палитра бренда с trigger-fish.ru: акцент #ff5300, тёмные #071420/#17253a */
  --bg: #ffffff;
  --text: #17253a;
  --muted: #6f8497;
  --line: #e6eaef;
  --accent: #ff5300;
  --accent-soft: #fff1e9;
  --paid: #ff5300;
  --catch: #10b981;
  --shadow: 0 4px 16px rgba(16, 32, 43, .12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.45 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  color: var(--text); background: var(--bg); overflow: hidden;
}
/* Карта лежит в самом низу. z-index обязателен: Leaflet рисует свои слои
   на уровне 400-800, и без этого они накрывают наши кнопки. */
#map { position: absolute; inset: 0; z-index: 1; touch-action: none; }

/* штатные кнопки приближения не нужны — на телефоне двигают пальцами */
.leaflet-control-zoom { display: none; }

.top { position: absolute; z-index: 5; top: 0; left: 0; right: 0; padding: 10px 12px 0; }
.search { position: relative; }
#q {
  width: 100%; padding: 12px 14px; border: none; border-radius: 12px;
  background: var(--bg); box-shadow: var(--shadow); font-size: 16px; color: var(--text);
}
#q:focus { outline: 2px solid var(--accent); }
.suggest {
  position: absolute; top: 52px; left: 0; right: 0; background: var(--bg);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; max-height: 46vh; overflow-y: auto;
}
.suggest div { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.suggest div:last-child { border-bottom: none; }
.suggest .sub { color: var(--muted); font-size: 13px; }

.chips { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 14px; border: none; border-radius: 999px;
  background: var(--bg); box-shadow: var(--shadow); font-size: 14px; color: var(--text); cursor: pointer;
}
.chip.active { background: var(--accent); color: #fff; }
/* вторая строка — выбор оценки: помельче, чтобы не спорила с основными фильтрами */
.chips.stars { margin-top: 6px; }
.chip.mini { padding: 6px 12px; font-size: 13px; }
.chip.mini.active { background: #ffb400; color: #3a2a00; }

.locate, .add {
  position: absolute; z-index: 5; border: none; box-shadow: var(--shadow); cursor: pointer;
}
.locate {
  right: 12px; bottom: 84px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--bg); font-size: 20px;
}
.add {
  left: 12px; right: 12px; bottom: 20px; padding: 15px; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 600;
}

.sheet {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 0;
  background: var(--bg); border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  padding: 8px 16px 22px; max-height: 62vh; overflow-y: auto;
  transition: transform .22s ease;
}
.sheet.hidden { transform: translateY(105%); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
.sheet h2 { font-size: 18px; margin: 0 0 4px; }
.sheet .meta { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.sheet .tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 13px; }
.tag.paid { background: var(--accent-soft); color: #b53b00; }
.tag.free { background: #e8eef5; color: #17253a; }
.tag.catch { background: #d1fae5; color: #065f46; }
.sheet .row { display: flex; gap: 10px; margin-top: 14px; }
.sheet button {
  flex: 1; padding: 13px; border: none; border-radius: 12px; font-size: 15px;
  background: #eef2f7; color: var(--text); cursor: pointer;
}
.sheet button.primary { background: var(--accent); color: #fff; }

/* экран загрузки: человек должен видеть, что процесс идёт */
.skeleton {
  position: absolute; z-index: 10; inset: 0; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 0 32px;
}
.skeleton.hidden { display: none; }
.sk-logo { font-size: 54px; animation: bob 1.6s ease-in-out infinite; }
.sk-title { font-size: 20px; font-weight: 700; color: var(--text); }
.sk-note { color: var(--muted); font-size: 14px; text-align: center; min-height: 20px; }
.sk-bar {
  width: 180px; height: 4px; border-radius: 2px; background: var(--line);
  overflow: hidden; margin-top: 6px;
}
.sk-bar-fill {
  height: 100%; width: 10%; border-radius: 2px; background: var(--accent);
  transition: width .4s ease;
}
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .5 } }

.nokey { position: absolute; z-index: 9; inset: 0; display: flex; flex-direction: column;
         align-items: center; justify-content: center; text-align: center; padding: 30px; background: var(--bg); }
.nokey.hidden { display: none; }
.nokey p { color: var(--muted); }
.hidden { display: none; }

@media (prefers-color-scheme: dark) {
  :root { --bg: #071420; --text: #eaf0f6; --muted: #a8b2bd; --line: #17253a; --accent-soft: #2a1409; }
  .sheet button { background: #17253a; color: var(--text); }
  .sk-line { background: #17253a; }
  .chip { background: #17253a; }
}

/* экран добавления улова поверх карты */
.screen {
  position: absolute; z-index: 8; inset: 0; background: var(--bg);
  padding: 14px 16px 24px; overflow-y: auto;
}
.screen.hidden { display: none; }
.screen-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.back { border: none; background: none; font-size: 24px; color: var(--text); cursor: pointer; padding: 0 4px; }
.step.hidden { display: none; }
.lead { font-size: 16px; margin: 0 0 14px; }
.why { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.rules { list-style: none; padding: 0; margin: 0 0 10px; font-size: 15px; }
.rules b { font-weight: 600; }
.note { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.rules li { padding: 5px 0; }
.btn-main {
  display: block; width: 100%; padding: 15px; border: none; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 600;
  text-align: center; cursor: pointer; margin-bottom: 10px;
}
.btn-main input[type=file] { display: none; }
.btn-ghost {
  display: block; width: 100%; padding: 14px; border: none; border-radius: 14px;
  background: transparent; color: var(--muted); font-size: 15px; cursor: pointer;
}
#place-q, #fish-other {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text); font-size: 16px; margin-bottom: 12px;
}
.suggest-inline div { padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.fish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.fish {
  padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg);
  color: var(--text); font-size: 16px; cursor: pointer;
}
.fish:active { background: var(--accent-soft); }
.done-icon { font-size: 44px; text-align: center; margin: 20px 0 10px; }
.reason { color: var(--muted); margin-bottom: 22px; }

/* фото улова: листаются пальцем */
.gallery {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin-bottom: 12px;
  /* браузер любит «придержать» ленту на месте, пока грузятся кадры — запрещаем */
  overflow-anchor: none; scroll-behavior: auto;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img {
  flex: 0 0 auto; width: 82%; max-height: 240px; object-fit: cover;
  border-radius: 12px; scroll-snap-align: center; background: var(--line);
}
.gallery img:only-child { width: 100%; }

/* лента фото: точки под кадрами — сразу видно, что можно листать */
.slider { position: relative; margin-bottom: 12px; }
.slider .gallery { margin-bottom: 0; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line); transition: background .2s, width .2s;
}
.dots i.on { width: 18px; border-radius: 3px; background: var(--accent); }

/* оценка места: звёзды, число, а мелким — откуда она взялась */
.rating { margin: 12px 0 4px; }
.rating .stars { color: #ffb400; letter-spacing: 1px; font-size: 16px; }
.rating b { margin-left: 6px; font-size: 16px; }
.rating .votes { color: var(--muted); font-size: 14px; }
.rating-src { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* строчки с ценой, адресом, телефоном */
.fact { font-size: 14px; margin-top: 6px; line-height: 1.35; }
.fact a { color: var(--accent); text-decoration: none; }

/* отзыв рыбака с сайта-источника */
.review {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--line); font-size: 13px; line-height: 1.4;
}
.review span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }

/* закрыть карточку: крестик, тап по карте или потянуть вниз */
.sheet-close {
  position: absolute; top: 10px; right: 12px; width: 32px; height: 32px;
  border: none; border-radius: 50%; background: var(--line); color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.sheet { padding-top: 8px; }
.sheet-grip { cursor: grab; }

/* короткая пояснялка к фильтру — показывается один раз */
.hint-toast {
  position: absolute; z-index: 7; left: 12px; right: 12px; top: 108px;
  background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: 12px;
  font-size: 14px; box-shadow: var(--shadow); opacity: .96;
}
.hint-toast.hidden { display: none; }

/* постановка метки: карта двигается, метка стоит в центре экрана */
.picker { position: absolute; z-index: 7; inset: 0; pointer-events: none; }
.picker.hidden { display: none; }
.crosshair {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -100%);
  font-size: 38px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
.picker-panel {
  position: absolute; left: 12px; right: 12px; bottom: 20px; pointer-events: auto;
  background: var(--bg); border-radius: 16px; padding: 14px; box-shadow: var(--shadow);
}
#picker-note { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 12px; }

/* что проверили: видно, из-за чего именно отказ */
.checks { margin: 0 0 22px; }
.checks div { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.checks div:last-child { border-bottom: none; }
.checks .no { color: var(--muted); }

/* число внутри кластера */
.cluster-count {
  color: #fff; font-weight: 700; font-size: 14px; text-align: center;
  line-height: 54px; width: 54px; height: 54px;
}

/* короткое обучение: затемняем всё, кроме того, о чём рассказываем */
.tour { position: absolute; z-index: 20; inset: 0; }
.tour.hidden { display: none; }
.tour-hole {
  position: absolute; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(8, 20, 32, .72);
  transition: all .28s ease;
}
.tour-tip {
  position: absolute; left: 16px; right: 16px; background: var(--bg);
  border-radius: 16px; padding: 16px; box-shadow: var(--shadow);
  transition: top .28s ease;
}
.tour-step { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.tour-title { font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.tour-text { color: var(--muted); font-size: 14px; line-height: 1.45; }
.tour-actions { display: flex; gap: 10px; margin-top: 14px; }
.tour-skip {
  flex: 1; padding: 12px; border: none; border-radius: 12px;
  background: transparent; color: var(--muted); font-size: 15px; cursor: pointer;
}
.tour-next {
  flex: 2; padding: 12px; border: none; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}

/* предупреждение на время загрузки: свернуть приложение — значит оборвать отправку */
.warn {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--accent-soft); color: #8a3200;
  font-size: 13px; line-height: 1.4; text-align: center;
}

/* полоска загрузки: видно, что процесс идёт, а не завис */
.bar {
  height: 8px; border-radius: 999px; background: var(--line);
  overflow: hidden; margin: 14px 0 4px;
}
.bar i {
  display: block; height: 100%; width: 0%;
  background: var(--accent); border-radius: 999px;
  transition: width .25s ease;
}
/* когда процент неизвестен — полоска бегает сама */
.bar.idle i { width: 40%; animation: run 1.1s ease-in-out infinite; }
@keyframes run {
  0%   { margin-left: -40%; }
  100% { margin-left: 100%; }
}

/* мелкая сноска про данные — не отвлекает от главной кнопки */
.note.tiny { font-size: 11.5px; line-height: 1.4; color: var(--muted); margin-top: 12px; }
.note.tiny a { color: var(--accent); }


/* отзывы: одна карточка на экран, листаются вбок */
.reviews { margin-top: 14px; }
.review-head { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.review-strip {
  display: flex; gap: 8px; overflow-x: auto;
  scroll-snap-type: x mandatory; overflow-anchor: none;
}
.review-strip::-webkit-scrollbar { display: none; }
.review-strip .review {
  flex: 0 0 100%; scroll-snap-align: start; margin-top: 0;
  box-sizing: border-box;
}
.review-strip .review:only-child { flex-basis: 100%; }
/* длинный отзыв не растягивает карточку — прокручивается внутри себя */
.review-text { max-height: 96px; overflow-y: auto; }

/* разделитель между подсказкой по снимку и ручным выбором */
.or {
  text-align: center; color: var(--muted); font-size: 13px;
  margin: 14px 0 10px; position: relative;
}
.or::before, .or::after {
  content: ''; position: absolute; top: 50%; width: 28%; height: 1px;
  background: var(--line);
}
.or::before { left: 0; }
.or::after { right: 0; }

/* ---------- метки на карте ---------- */
.pin-wrap { background: none; border: none; }
.pin {
  width: 100%; height: 100%; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
/* обычный водоём — точка поскромнее, их тысячи */
.pin.dot { border-width: 1.5px; box-shadow: 0 1px 2px rgba(0,0,0,.25); }

/* кружок с числом, когда точки собрались вместе */
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background: var(--accent); color: #fff; font-weight: 600;
}
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
  background: rgba(255, 83, 0, .3);
}

/* подпись про источник карты — обязательна по условиям OpenStreetMap */
.leaflet-control-attribution {
  font-size: 10px; background: rgba(255,255,255,.75); padding: 1px 5px;
}
.leaflet-control-attribution a { color: var(--muted); }
