/* ============================================================
   ASKETPLAY theme for squaremap
   Переопределение оформления под ЧБ-стиль донат-сайта
   ============================================================ */

/* -------------------- Переменные -------------------- */
:root {
    --ak-bg: #000000;
    --ak-card: #111111;
    --ak-card-hover: #1a1a1a;
    --ak-border: #222222;
    --ak-border-hover: #444444;
    --ak-accent: #ffffff;
    --ak-text: #ffffff;
    --ak-text-dim: #999999;
    --ak-text-muted: #666666;
    --ak-header-h: 64px;
    --ak-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* -------------------- Отступ под фиксированную шапку -------------------- */
/* Сдвигаем #map, чтобы шапка не перекрывала верхние панели Leaflet */
html, body {
    background: #000 !important;
    overflow: hidden;
}

#map {
    height: calc(100vh - var(--ak-header-h)) !important;
    margin-top: var(--ak-header-h);
    background: #000 !important;
}

/* Leaflet позиционирование верхних контролов — опустим их чуть ниже шапки */
.leaflet-top {
    top: var(--ak-header-h) !important;
}

/* ============================================================
   ШАПКА ASKETPLAY
   ============================================================ */
.asket-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--ak-header-h);
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--ak-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 99999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.asket-logo {
    font-family: 'Russo One', sans-serif;
    font-size: 1.5em;
    font-weight: 400;
    color: #000000;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    -webkit-text-stroke: 2px #ffffff;
    paint-order: stroke fill;
    text-shadow:
        -1px -1px 0 #fff,
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff,
         0 0 8px rgba(255, 255, 255, 0.4);
    transition: all 0.3s;
}

.asket-logo:hover {
    text-shadow:
        -1px -1px 0 #fff,
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff,
         0 0 16px rgba(255, 255, 255, 0.9);
}

.asket-nav {
    display: flex;
    gap: 4px;
    align-items: center;
}

.asket-nav a {
    padding: 10px 18px;
    color: var(--ak-text-dim);
    font-weight: 500;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.asket-nav a:hover {
    color: var(--ak-text);
    border-color: var(--ak-border-hover);
}

.asket-nav a.active {
    color: var(--ak-text);
    border-color: var(--ak-accent);
    background: rgba(255, 255, 255, 0.03);
}

/* ============================================================
   БОКОВАЯ ПАНЕЛЬ (правая)
   ============================================================ */
#sidebar {
    background-color: rgba(0, 0, 0, 0.85) !important;
    border-left: 1px solid var(--ak-border) !important;
    font-family: 'Inter', sans-serif !important;
    top: var(--ak-header-h) !important;
    height: calc(100vh - var(--ak-header-h)) !important;
}

#sidebar fieldset {
    border-top: 1px solid var(--ak-border) !important;
}

#sidebar legend {
    font-family: 'Russo One', sans-serif !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85em;
}

#sidebar fieldset a {
    color: var(--ak-text) !important;
    font-size: 0.9em;
}

#sidebar fieldset a:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

#sidebar fieldset a.following {
    background-color: rgba(0, 212, 255, 0.15) !important;
    border-left: 2px solid var(--ak-accent);
}

/* Кнопка пина */
#sidebar #pin.pinned:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: #ffffff !important;
}

/* ============================================================
   КОНТРОЛЫ LEAFLET (zoom, layers, координаты)
   ============================================================ */

/* Кнопки zoom +/- */
.leaflet-bar {
    border: 1px solid var(--ak-border) !important;
    border-radius: 0 !important;
    box-shadow: var(--ak-shadow) !important;
    overflow: hidden;
}

.leaflet-bar a {
    background-color: #000 !important;
    color: #fff !important;
    border-bottom: 1px solid var(--ak-border) !important;
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    font-size: 1.2em !important;
    transition: all 0.2s;
}

.leaflet-bar a:hover,
.leaflet-bar a:focus {
    background-color: var(--ak-card-hover) !important;
}

.leaflet-bar a.leaflet-disabled {
    background-color: #0a0a0a !important;
    color: #444 !important;
}

/* Кнопка переключения слоёв */
.leaflet-control-layers {
    background: #000 !important;
    border: 1px solid var(--ak-border) !important;
    border-radius: 0 !important;
    box-shadow: var(--ak-shadow) !important;
}

.leaflet-control-layers-toggle {
    background-color: #000 !important;
    width: 34px !important;
    height: 34px !important;
}

.leaflet-control-layers-expanded {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid var(--ak-border-hover) !important;
    border-radius: 0 !important;
    padding: 8px 12px !important;
    font-family: 'Inter', sans-serif !important;
}

.leaflet-control-layers label {
    color: #fff !important;
    font-size: 0.85em;
    letter-spacing: 0.3px;
}

.leaflet-control-layers-separator {
    border-top: 1px solid var(--ak-border) !important;
}

/* Кнопка "координаты" */
.leaflet-control-layers.coordinates {
    background: rgba(0, 0, 0, 0.85) !important;
    border: 1px solid var(--ak-border) !important;
    color: #fff !important;
    font-family: 'Inter', sans-serif !important;
    padding: 6px 10px !important;
    border-radius: 0 !important;
}

/* Кнопка "ссылка" (link) */
div.leaflet-control-layers.link img {
    filter: invert(1);
}

/* ============================================================
   ПОДПИСИ И POPUP'Ы
   ============================================================ */

/* Попап (открывается по клику на маркер) */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid var(--ak-border-hover) !important;
    border-radius: 0 !important;
    box-shadow: var(--ak-shadow) !important;
}

.leaflet-popup-content-wrapper {
    padding: 4px;
}

.leaflet-popup-content {
    color: #fff !important;
    font-family: 'Inter', sans-serif !important;
}

.leaflet-container a.leaflet-popup-close-button {
    color: #999 !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #fff !important;
}

/* Тултипы (по наведению) */
.leaflet-tooltip {
    background-color: #000 !important;
    color: #fff !important;
    border: 1px solid var(--ak-border-hover) !important;
    border-radius: 0 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.85em !important;
    box-shadow: var(--ak-shadow) !important;
}

.leaflet-tooltip-top:before { border-top-color: var(--ak-border-hover) !important; }
.leaflet-tooltip-bottom:before { border-bottom-color: var(--ak-border-hover) !important; }
.leaflet-tooltip-left:before { border-left-color: var(--ak-border-hover) !important; }
.leaflet-tooltip-right:before { border-right-color: var(--ak-border-hover) !important; }

/* Плейт-таблички над игроками */
div.leaflet-nameplate-pane > div {
    background: rgba(0, 0, 0, 0.85) !important;
    border: 1px solid var(--ak-border-hover) !important;
    border-radius: 0 !important;
    font-family: 'Inter', sans-serif !important;
    letter-spacing: 0.3px;
}

/* ============================================================
   ФОН КАРТЫ
   ============================================================ */
.leaflet-container {
    background: #000 !important;
    font-family: 'Inter', sans-serif !important;
}

/* Скрываем упоминание Leaflet в правом нижнем углу (уже отключено в JS,
   но на случай если включится) */
.leaflet-control-attribution {
    display: none !important;
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 640px) {
    :root { --ak-header-h: 56px; }

    .asket-header {
        padding: 0 12px;
    }

    .asket-logo {
        font-size: 1.1em;
        -webkit-text-stroke: 1.5px #ffffff;
    }

    .asket-nav a {
        padding: 8px 10px;
        font-size: 0.75em;
        letter-spacing: 0.3px;
    }
}
