/* Карты вкладки «География» страницы клуба (wwwroot/js/clubGeoMap.js): хост карты, пины, дом клуба, потоки,
   подсказки, поповеры Leaflet и ползунок масштаба.

   Стили глобальные: эти элементы создают Leaflet и JS, атрибута изоляции Blazor у них нет. Токены --ci-* и аватар
   .ci-tav — в ClubPage.css (карта живёт внутри .club-page). Эталон — .gm*, .gp-*, .gt-* макета
   docs/mockups/club-overview/styles.css; классы переименованы с префиксом ci-. */

/* ── хост карты ──────────────────────────────────────────────────────────────
   z-index: 0 запирает слои Leaflet (400+) внутри карты, иначе они перекрыли бы острова и поповеры страницы. */
.ci-gm {
    position: relative;
    z-index: 0;
    height: 600px;
    border-radius: 12px;
    overflow: hidden;
    background: #0d141d;
}

.ci-gm--s {
    height: 280px;
}

.ci-gm.leaflet-container {
    font: inherit;
    background: #0d141d;
}

.ci-gm a {
    color: inherit;
}

/* ── гашение по закреплённому фильтру (setPick) ───────────────────────────── */
.ci-gm .ci-gm-pin,
.ci-gm svg path {
    transition: opacity .15s;
}

.ci-gm .ci-gm-off {
    opacity: .18;
}

/* ── пины и дом клуба ───────────────────────────────────────────────────────── */
.ci-gm-pin,
.ci-gm-home {
    background: none;
    border: 0;
}

.ci-gm-home i {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff center / cover no-repeat;
    box-shadow: 0 0 0 3px #0d1220, 0 0 0 5px var(--ci-acc);
}

/* ── потоки: бегущие по направлению поездки штрихи ────────────────────────── */
.ci-gm-flow {
    fill: none;
    stroke-linecap: round;
    stroke-dasharray: 1 10;
    animation: ci-gm-dash 1.2s linear infinite;
}

.ci-gm-flow-hit {
    stroke-linecap: round;
}

/* Клик мышью по SVG-пути карты (поток, страна) не рисует фокус-рамку; клавиатурный фокус её оставляет. */
.ci-gm .leaflet-interactive:focus:not(:focus-visible) {
    outline: none;
}

@keyframes ci-gm-dash {
    to {
        stroke-dashoffset: -11;
    }
}

/* ── подсказки ─────────────────────────────────────────────────────────────── */
.ci-gm-tip.leaflet-tooltip {
    background: rgba(18, 26, 36, .96);
    border: 1px solid var(--ci-line2);
    color: var(--ci-ink);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
    font-size: 11.5px;
    padding: 3px 7px;
    border-radius: 6px;
}

.ci-gm-tip.leaflet-tooltip::before {
    display: none;
}

.ci-gm-tip--rich.leaflet-tooltip {
    padding: 8px 10px;
    border-radius: 10px;
    min-width: 280px;
    max-width: 360px;
    white-space: normal;
}

.ci-gt-h {
    font-weight: 700;
    font-size: 13px;
}

.ci-gt-s {
    font-size: 11.5px;
    margin: 1px 0 6px;
    font-weight: 600;
}

.ci-gt-k {
    font-size: 10.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
    font-weight: 700;
    margin: 7px 0 3px;
}

.ci-gt-ppl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
}

.ci-gt-ppl > span {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    font-size: 11.5px;
}

.ci-gt-ppl b {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.ci-gt-ppl em {
    font-style: normal;
    color: var(--ci-dim2);
    margin-left: auto;
}

.ci-gt-club {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 2px 0;
}

.ci-gt-club b {
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.ci-gt-club em {
    font-style: normal;
    color: var(--ci-dim2);
    font-size: 11px;
    margin-left: auto;
    padding-left: 8px;
    white-space: nowrap;
}

/* ── поповеры городов и стран ─────────────────────────────────────────────── */
.ci-gm .leaflet-popup-content-wrapper {
    background: linear-gradient(180deg, #10212b 0%, #0b1820 100%);
    color: var(--ci-ink);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}

.ci-gm .leaflet-popup-tip {
    background: #0b1820;
}

.ci-gm .leaflet-popup-content {
    margin: 10px 14px 10px 12px;
    font-size: 12.5px;
    line-height: 1.4;
}

.ci-gm .leaflet-popup-close-button {
    color: var(--ci-dim) !important;
}

.ci-gp-h {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--ci-acc);
    padding-right: 14px;
}

.ci-gp-s {
    font-size: 11.5px;
    color: var(--ci-dim);
    margin: 1px 0 6px;
}

/* поповер потока: список игроков — кликабельные кнопки (выбрать игрока) */
.ci-gp-ppl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 6px;
    max-height: 320px;
    overflow: auto;
    margin-right: -6px;
    padding-right: 6px;
}

.ci-gp-ppl-b {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    font: inherit;
    font-size: 11.5px;
    color: inherit;
    text-align: left;
    background: none;
    border: 0;
    margin: 0;
    padding: 2px 4px;
    border-radius: 6px;
    cursor: pointer;
}

.ci-gp-ppl-b:hover {
    background: rgba(255, 255, 255, .08);
}

.ci-gp-ppl-b b {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.ci-gp-ppl-b em {
    font-style: normal;
    color: var(--ci-dim2);
    margin-left: auto;
    padding-left: 6px;
}

.ci-gp-ppl .ci-dim {
    align-self: center;
    font-size: 11px;
}

.ci-gp-rows {
    max-height: 320px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    margin-right: -6px;
    padding-right: 6px;
}

.ci-gp-r {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px solid var(--ci-line);
}

.ci-gp-r:last-child {
    border-bottom: 0;
}

.ci-gp-r .n {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ci-gp-r .s {
    color: var(--ci-dim2);
    font-size: 11px;
    white-space: nowrap;
}

/* Строка поповера паспорта — ссылка (турнир или «Игры» клуба): кнопка во всю ширину с подсветкой при наведении. */
.ci-gp-r-go {
    width: 100%;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--ci-line);
}

.ci-gp-r-go:hover {
    background: rgba(255, 255, 255, .05);
}

.ci-gp-t {
    padding: 7px 0;
    border-bottom: 1px solid var(--ci-line);
}

.ci-gp-t:last-child {
    border-bottom: 0;
}

.ci-gp-t-h {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ci-gp-t-h b {
    font-size: 12.5px;
}

.ci-gp-t .ci-gp-s {
    margin: 2px 0 4px;
}

.ci-gp-dir {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

/* Клуб в поповере города — карточка в цвет направления: шапка с логотипом и названием насыщеннее, игроки клуба под
   ней — на бледной подложке того же цвета, и всё вместе отделено от соседних клубов. */
.ci-gp-club {
    flex: none;
    padding: 0;
    margin-bottom: 6px;
    border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--c) 6%, transparent);
    overflow: hidden;
}

.ci-gp-club:last-child {
    margin-bottom: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}

.ci-gp-club .ci-gp-t-h {
    flex-wrap: nowrap;
    padding: 5px 8px;
    background: color-mix(in srgb, var(--c) 22%, transparent);
}

.ci-gp-club .ci-gp-t-p {
    margin-top: 0;
    padding: 6px 8px 7px;
}

.ci-gp-club .ci-gp-t-h b {
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ci-gp-club .ci-gp-dir {
    color: var(--c);
}

.ci-gp-t-p {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 4px;
}

.ci-gp-t-p > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.ci-gp-t-p em {
    font-style: normal;
    color: var(--ci-dim2);
    font-size: 11px;
}

/* Имя с аватаром игрока и шапка клуба в поповере кликабельны: переход в профиль игрока или на страницу клуба. */
.ci-gp-go {
    display: inline-flex;
    align-items: center;
    justify-content: left;
    gap: 4px;
    min-width: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    background: none;
    border: 0;
    margin: 0;
    padding: 1px 3px;
    border-radius: 6px;
    cursor: pointer;
}

.ci-gp-go:hover {
    background: rgba(255, 255, 255, .08);
}

.ci-gp-club .ci-gp-club-go {
    flex: 1;
    min-width: 0;
    gap: 6px;
    padding: 2px 4px;
}

/* Число игр в поповере кликабельно: открывает «Игры» клуба с игроком (или топ-3 из шапки) в фильтре. */
.ci-gp-gn {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.ci-gp-t-p .ci-gp-gn {
    font-size: 11px;
    color: var(--ci-dim2);
}

.ci-gp-gn:hover {
    color: var(--ci-ink);
}

/* ── ползунок масштаба ─────────────────────────────────────────────────────── */
.ci-gm-zoom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(24, 26, 31, .92);
    border-radius: 8px;
    padding: 6px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.ci-gm-zoom__btn {
    width: 30px;
    height: 28px;
    border: 0;
    border-radius: 5px;
    background: rgba(255, 255, 255, .08);
    color: #f0f0f0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.ci-gm-zoom__btn:hover {
    background: rgba(255, 255, 255, .18);
}

.ci-gm-zoom__slider {
    writing-mode: vertical-lr;
    direction: rtl;
    height: 110px;
    width: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, .15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin: 4px 0;
}

.ci-gm-zoom__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ci-acc);
    border: 2px solid rgba(24, 26, 31, .92);
}

.ci-gm-zoom__slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ci-acc);
    border: 2px solid rgba(24, 26, 31, .92);
}

.ci-gm-zoom__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ci-acc);
    min-width: 28px;
    text-align: center;
}

/* ── общие с островами вкладки ───────────────────────────────────────────────
   Логотип клуба, бейдж места, «30+», тег организации и тусклый текст встречаются и в поповерах карты, и в разметке
   островов «Географии» — поэтому здесь, а не в изолированном CSS вкладки. */
.ci-gx-logo {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    background: #fff center / cover no-repeat;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .18);
    font-style: normal;
    font-size: 9px;
    font-weight: 800;
    color: #10141b;
    text-transform: uppercase;
}

.ci-gx-logo--none {
    background: #8d99a8;
}

.ci-gx-logo--l {
    width: 44px;
    height: 44px;
    font-size: 14px;
}

.ci-gx-pl {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 18px;
    padding: 0 4px;
    border-radius: 5px;
    font-style: normal;
    font-size: 11px;
    font-weight: 800;
    background: rgba(255, 255, 255, .1);
    color: var(--ci-ink);
}

.ci-gx-pl--1 {
    background: #ffd166;
    color: #26200c;
}

.ci-gx-pl--2 {
    background: #cfd6df;
    color: #10141b;
}

.ci-gx-pl--3 {
    background: #d9955a;
    color: #1c1006;
}

.ci-gx-pl + .ci-dim {
    font-size: 11px;
    margin-left: 3px;
}

.ci-dim {
    color: var(--ci-dim2);
}

.ci-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ci-acc);
    border: 1px solid #ffd16688;
    border-radius: 4px;
    padding: 0 5px;
}

.ci-otag {
    font-size: 11px;
    color: #fff;
    border-radius: 4px;
    padding: 0 6px;
    background: color-mix(in srgb, var(--c) 26%, transparent);
    box-shadow: inset 3px 0 0 var(--c);
}

@media (max-width: 700px) {
    .ci-gm {
        height: 380px;
    }

    .ci-gm--s {
        height: 240px;
    }

    .ci-gm-zoom__slider {
        height: 70px;
    }
}
