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

html, body {
  width: 100%; height: 100%;
  background: #141317;
  overflow: hidden;
  /* overflow гасит прокрутку, но не зум: щипок должен доходить до Flutter,
     который сам меняет размер текста. */
  touch-action: none;
  overscroll-behavior: none;
}

#preloader {
  position: fixed;
  inset: 0;
  background: #141317;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

#preloader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.diamond-wrap {
  position: relative;
  width: 76px;
  height: 76px;
}

.ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* старт сверху */
}

.ring-track {
  fill: none;
  stroke: #26232b;
  stroke-width: 1.5;
}

.ring-fill {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 1.5;
  stroke-linecap: round;
  /* circumference ≈ 2π×35 ≈ 219.9 */
  stroke-dasharray: 219.9;
  stroke-dashoffset: 219.9; /* 0% заполнено */
  transition: stroke-dashoffset 0.3s ease;
}

.diamond {
  position: absolute;
  inset: 10px;
  background: #c8a565;
  transform: rotate(45deg) scale(0.62);
  border-radius: 3px;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: rotate(45deg) scale(0.62); }
  50%      { opacity: 0.6; transform: rotate(45deg) scale(0.55); }
}

.label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 4px;
  color: #6b6458;
  text-transform: uppercase;
  user-select: none;
}

/* ── Яндекс.Карты: маркеры, кластеры и подпись точки ──────────────────────
   Рисуются в DOM внутри платформенного вида, поэтому стили живут здесь, а не
   в теме Flutter. Цвета приходят из RoleTokens кастомными свойствами
   (--ymb-*), чтобы карта не разъезжалась с палитрой панели. */

.ymb-pin {
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translate(-6px, -6px);
  cursor: pointer;
  white-space: nowrap;
}

.ymb-pin__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ymb-accent, #e6ba69);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.45);
  flex: none;
}

.ymb-pin__label {
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: #f6f1e9;
  background: rgba(14, 13, 16, 0.82);
  border: 1px solid rgba(230, 186, 105, 0.3);
  padding: 2px 6px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ymb-pin--pick .ymb-pin__dot {
  width: 16px;
  height: 16px;
}

.ymb-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  transform: translate(-17px, -17px);
  background: var(--ymb-accent, #e6ba69);
  color: #16141a;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.ymb-popup {
  position: relative;
  transform: translate(-50%, calc(-100% - 16px));
  width: 240px;
  padding: 12px 14px 12px;
  background: var(--ymb-bg, #26232b);
  border: 1px solid var(--ymb-border, rgba(230, 186, 105, 0.28));
  color: var(--ymb-fg, #f6f1e9);
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.ymb-popup__name {
  font-family: 'Unbounded', 'Onest', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding-right: 16px;
  margin-bottom: 6px;
}

.ymb-popup__line { color: #b9b0a1; }

.ymb-popup__addr {
  color: #8c8477;
  margin-top: 2px;
}

.ymb-popup__status {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 7px;
  border: 1px solid var(--ymb-border, rgba(230, 186, 105, 0.28));
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ymb-accent, #e6ba69);
}

.ymb-popup__open {
  display: block;
  margin-top: 10px;
  color: var(--ymb-accent, #e6ba69);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.ymb-popup__open:hover { text-decoration: underline; }

.ymb-popup__close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: #8c8477;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.ymb-popup__close:hover { color: #f6f1e9; }
