/* ============================================================
   Матч&мяч release v51 — Maps, mobile navigation, messaging shell
   Loaded last on purpose: this file resolves historical shell
   overrides without changing older page-specific visual systems.
   ============================================================ */

/* ---------- Global tools: one quiet, aligned utility rail ---------- */
.global-tools{
    top:14px!important;
    right:22px!important;
    left:auto!important;
    width:auto!important;
    min-height:44px!important;
    height:44px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:7px!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
}
.global-tools>div,
.global-tools>a,
.global-tools>button{position:relative!important;inset:auto!important;flex:0 0 auto!important;margin:0!important}
.global-tools .mobile-shell-brand{display:none!important}
.global-tools .mobile-menu-trigger{display:none!important}
.global-tools #city-switcher-float{order:1!important}
.global-tools #notif-bell-float{order:2!important}
.global-tools #profile-shortcut-float{order:3!important}
.global-tools .city-pill,
.global-tools .notif-btn,
.global-tools .profile-shortcut{
    height:40px!important;
    min-height:40px!important;
    margin:0!important;
    border:1px solid rgba(255,255,255,.09)!important;
    border-radius:13px!important;
    background:rgba(19,24,18,.92)!important;
    color:var(--text-dim)!important;
    box-shadow:0 12px 30px -25px rgba(0,0,0,.9)!important;
    backdrop-filter:blur(16px)!important;
    -webkit-backdrop-filter:blur(16px)!important;
}
.global-tools .city-pill{min-width:0!important;padding:0 13px!important;gap:8px!important}
.global-tools .notif-btn,.global-tools .profile-shortcut{width:40px!important;padding:0!important}
.global-tools .city-pill:hover:not(:disabled),
.global-tools .notif-btn:hover,
.global-tools .profile-shortcut:hover,
.global-tools #profile-shortcut-float.is-open .profile-shortcut{
    transform:none!important;
    color:var(--text)!important;
    border-color:rgba(200,255,61,.32)!important;
    background:#181e16!important;
}

/* Bell should read as active, not merely carry a tiny badge. */
.global-tools .notif-btn.has-unread{
    color:var(--accent)!important;
    border-color:rgba(200,255,61,.52)!important;
    background:rgba(200,255,61,.095)!important;
    box-shadow:inset 0 0 0 1px rgba(200,255,61,.045),0 12px 28px -22px rgba(200,255,61,.38)!important;
}
.global-tools .notif-btn.has-unread svg{filter:drop-shadow(0 0 5px rgba(200,255,61,.22))}
.notif-row-icon.is-message{color:var(--accent)!important;background:rgba(200,255,61,.10)!important}

/* Unread messages in both desktop sidebar and mobile drawer. */
.nav-unread-badge{
    min-width:19px;height:19px;padding:0 6px;margin-left:auto;
    display:inline-grid;place-items:center;flex:0 0 auto;
    border-radius:999px;background:var(--accent);color:var(--accent-ink);
    font:800 9.5px/1 var(--font-mono);letter-spacing:-.02em;
    box-shadow:0 0 0 3px rgba(200,255,61,.055);
}
.sidebar-nav a:has(.nav-unread-badge){color:var(--text)}

/* ---------- Profile shortcut dropdown ---------- */
#profile-shortcut-float{position:relative!important}
.profile-shortcut-menu{
    position:absolute;top:calc(100% + 10px);right:0;z-index:210;
    width:286px;padding:8px;
    border:1px solid rgba(255,255,255,.10);border-radius:18px;
    background:rgba(19,24,18,.985);color:var(--text);
    box-shadow:0 28px 80px -34px rgba(0,0,0,.88);
    backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);
    opacity:0;visibility:hidden;transform:translateY(-5px) scale(.985);
    transform-origin:top right;pointer-events:none;
    transition:opacity .14s ease,transform .14s ease,visibility .14s;
}
#profile-shortcut-float:hover .profile-shortcut-menu,
#profile-shortcut-float:focus-within .profile-shortcut-menu,
#profile-shortcut-float.is-open .profile-shortcut-menu{
    opacity:1;visibility:visible;transform:none;pointer-events:auto;
}
/* Small invisible bridge prevents the hover menu from collapsing in the 10px gap. */
.profile-shortcut-menu::before{content:'';position:absolute;left:0;right:0;top:-11px;height:12px}
.profile-menu-head{
    display:grid;grid-template-columns:42px minmax(0,1fr);align-items:center;gap:10px;
    padding:7px 7px 11px;margin-bottom:4px;border-bottom:1px solid rgba(255,255,255,.075)
}
.profile-menu-avatar,.profile-menu-avatar img,.profile-menu-avatar .profile-shortcut-initial{
    width:42px!important;height:42px!important;border-radius:12px!important;object-fit:cover
}
.profile-menu-head b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;line-height:1.3}
.profile-menu-head span{display:block;margin-top:2px;color:var(--text-faint);font-size:10px}
.profile-shortcut-menu>a,.profile-shortcut-menu>button{
    width:100%;min-height:51px;padding:8px 9px;display:grid;grid-template-columns:34px minmax(0,1fr);
    align-items:center;gap:9px;border:0;border-radius:12px;background:transparent;color:var(--text);
    text-align:left;font:inherit;cursor:pointer;transition:background .14s ease,color .14s ease
}
.profile-shortcut-menu>a:hover,.profile-shortcut-menu>button:hover{background:rgba(255,255,255,.055)}
.profile-shortcut-menu .ic{width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:rgba(255,255,255,.045);color:var(--text-dim)}
.profile-shortcut-menu .ic svg{width:16px;height:16px}
.profile-shortcut-menu b{display:block;font-size:11.5px;font-weight:760}
.profile-shortcut-menu small{display:block;margin-top:2px;color:var(--text-faint);font-size:9.5px;line-height:1.25}
#profile-logout-btn{margin-top:3px;border-top:1px solid rgba(255,255,255,.05)!important;color:#ff9991!important}
#profile-logout-btn .ic{color:#ff9991;background:rgba(255,105,97,.08)}

/* ---------- Mobile header + right-side navigation drawer ---------- */
.mobile-nav-overlay,.mobile-nav-drawer{display:none}
@media(max-width:960px){
    :root{--mobile-header-h:58px}
    .global-tools{
        top:max(8px,env(safe-area-inset-top))!important;left:10px!important;right:10px!important;
        width:auto!important;height:48px!important;min-height:48px!important;
        display:grid!important;grid-template-columns:minmax(72px,1fr) 40px 40px 40px 40px!important;
        justify-content:stretch!important;align-items:center!important;gap:6px!important;
        padding:4px 5px!important;border:1px solid rgba(255,255,255,.075)!important;
        border-radius:17px!important;background:rgba(14,18,13,.91)!important;
        box-shadow:0 18px 42px -30px rgba(0,0,0,.82)!important;
        backdrop-filter:blur(20px)!important;-webkit-backdrop-filter:blur(20px)!important;
    }
    .global-tools .mobile-shell-brand{
        order:0!important;display:flex!important;width:auto!important;min-width:0!important;height:40px!important;
        padding:0 8px!important;align-items:center!important;justify-content:flex-start!important;overflow:hidden!important
    }
    .global-tools .mobile-shell-brand img{display:block!important;width:76px!important;height:auto!important;max-height:25px!important;object-fit:contain!important;object-position:left center!important;border-radius:0!important}
    .global-tools #city-switcher-float{order:1!important;width:40px!important}
    .global-tools #notif-bell-float{order:2!important;width:40px!important}
    .global-tools #profile-shortcut-float{order:3!important;width:40px!important}
    .global-tools .mobile-menu-trigger{
        order:4!important;display:grid!important;place-items:center!important;width:40px!important;height:40px!important;
        padding:0!important;border:1px solid rgba(255,255,255,.08)!important;border-radius:12px!important;
        background:rgba(255,255,255,.035)!important;color:var(--text-dim)!important;cursor:pointer
    }
    .global-tools .mobile-menu-trigger:hover,.global-tools .mobile-menu-trigger[aria-expanded="true"]{color:var(--accent)!important;border-color:rgba(200,255,61,.34)!important;background:rgba(200,255,61,.075)!important}
    .global-tools .mobile-menu-trigger .ic,.global-tools .mobile-menu-trigger svg{width:18px;height:18px;display:block}
    .global-tools .city-pill,.global-tools .notif-btn,.global-tools .profile-shortcut{
        width:40px!important;height:40px!important;min-height:40px!important;border-radius:12px!important;background:rgba(255,255,255,.035)!important;border-color:rgba(255,255,255,.08)!important
    }
    .global-tools .city-pill{min-width:40px!important;padding:0!important;justify-content:center!important}
    .global-tools .city-pill-name,.global-tools .city-pill-chev{display:none!important}
    .global-tools .city-pill svg{width:18px!important;height:18px!important}
    .profile-shortcut img,.profile-shortcut-initial,.profile-shortcut-icon{width:33px!important;height:33px!important;border-radius:9px!important}

    /* Old “Ещё” sheet is retired in v51. */
    .mobile-more-overlay,.mobile-more-sheet,#mobile-more-btn{display:none!important}

    .mobile-nav-overlay{
        display:block;position:fixed;inset:0;z-index:238;background:rgba(2,4,2,.65);
        opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s;backdrop-filter:blur(2px)
    }
    .mobile-nav-overlay.open{opacity:1;visibility:visible}
    .mobile-nav-drawer{
        display:flex;position:fixed;z-index:239;top:8px;right:8px;bottom:8px;
        width:min(360px,calc(100vw - 24px));flex-direction:column;overflow:hidden;
        border:1px solid rgba(255,255,255,.10);border-radius:25px;background:#151a13;color:var(--text);
        box-shadow:-28px 0 90px -36px rgba(0,0,0,.95);transform:translateX(calc(100% + 18px));
        transition:transform .28s cubic-bezier(.2,.75,.2,1)
    }
    .mobile-nav-drawer.open{transform:translateX(0)}
    .mobile-nav-head{height:70px;display:flex;align-items:center;justify-content:space-between;padding:0 16px 0 19px;border-bottom:1px solid rgba(255,255,255,.075)}
    .mobile-nav-brand{display:flex;align-items:center;width:104px}.mobile-nav-brand img{width:104px;height:auto;display:block}
    .mobile-nav-close{width:38px;height:38px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.08);border-radius:12px;background:rgba(255,255,255,.035);color:var(--text-dim);cursor:pointer}
    .mobile-nav-close svg{width:17px;height:17px}
    .mobile-nav-scroll{overflow:auto;padding:14px 12px 26px;overscroll-behavior:contain}
    .mobile-nav-group{padding:7px 0 13px}.mobile-nav-group+.mobile-nav-group{border-top:1px solid rgba(255,255,255,.055);padding-top:17px}
    .mobile-nav-group-label{padding:0 10px 8px;color:#747c70;font-size:9px;font-weight:850;letter-spacing:.14em;text-transform:uppercase}
    .mobile-nav-links{display:grid;gap:3px}
    .mobile-nav-links>a{
        min-height:48px;padding:0 10px;display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:9px;
        border-radius:13px;color:#a5ada1;font-size:12px;font-weight:680;transition:background .14s ease,color .14s ease
    }
    .mobile-nav-links>a .ic{width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:rgba(255,255,255,.035)}
    .mobile-nav-links>a .ic svg{width:17px;height:17px}
    .mobile-nav-links>a.active{background:rgba(200,255,61,.09);color:#eef4e9}.mobile-nav-links>a.active .ic{background:var(--accent);color:var(--accent-ink)}
    .mobile-nav-links>a:active{transform:scale(.985)}
    .mobile-nav-links .pro-badge{justify-self:end}

    /* Keep the bottom navigation for the five daily actions only. */
    .mobile-tabbar{grid-template-columns:repeat(5,minmax(0,1fr))!important}
    .mobile-tabbar a{min-width:0!important}

    .profile-shortcut-menu{position:fixed;top:66px;right:10px;width:min(286px,calc(100vw - 20px))}
}
@media(max-width:390px){
    .global-tools{grid-template-columns:minmax(54px,1fr) 38px 38px 38px 38px!important;gap:4px!important;left:7px!important;right:7px!important}
    .global-tools .mobile-shell-brand{padding-left:6px!important}.global-tools .mobile-shell-brand img{width:62px!important}
    .global-tools #city-switcher-float,.global-tools #notif-bell-float,.global-tools #profile-shortcut-float{width:38px!important}
    .global-tools .city-pill,.global-tools .notif-btn,.global-tools .profile-shortcut,.global-tools .mobile-menu-trigger{width:38px!important;height:38px!important;min-height:38px!important}
}

/* ---------- Clubs / courts map ---------- */
.clubs-viewbar{
    display:flex;align-items:center;justify-content:space-between;gap:18px;
    margin:2px 0 10px;padding:2px 2px 2px 4px
}
.clubs-viewbar>div:first-child{display:flex;align-items:baseline;gap:9px;min-width:0}
.clubs-view-kicker{color:var(--text-faint);font-size:9.5px;font-weight:850;letter-spacing:.12em;text-transform:uppercase;white-space:nowrap}
.clubs-viewbar b{color:var(--text-dim);font-size:10.5px;font-weight:620;white-space:nowrap}
.clubs-view-switch{display:inline-flex;gap:3px;padding:3px;border:1px solid var(--border);border-radius:13px;background:rgba(255,255,255,.025)}
.clubs-view-switch button{
    height:34px;padding:0 12px;display:inline-flex;align-items:center;gap:7px;border:0;border-radius:10px;
    background:transparent;color:var(--text-faint);font:700 10.5px/1 var(--font-body);cursor:pointer
}
.clubs-view-switch button:hover{color:var(--text);background:rgba(255,255,255,.04)}
.clubs-view-switch button.active{background:#e9eee2;color:#171b15;box-shadow:0 4px 15px -12px rgba(0,0,0,.45)}
.clubs-view-switch svg{width:14px;height:14px}

.clubs-map-layout{
    height:min(690px,calc(100vh - 170px));min-height:560px;
    display:grid;grid-template-columns:minmax(270px,330px) minmax(0,1fr);overflow:hidden;
    border:1px solid var(--border);border-radius:25px;background:#121710;box-shadow:0 26px 70px -54px rgba(0,0,0,.95)
}
.clubs-map-list{min-width:0;display:flex;flex-direction:column;border-right:1px solid var(--border);background:#141913}
.clubs-map-list-head{height:65px;flex:0 0 65px;padding:0 17px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--border)}
.clubs-map-list-head b{font-size:12px}.clubs-map-list-head span{color:var(--text-faint);font-size:9.5px;text-align:right}
.clubs-map-list-scroll{overflow:auto;padding:7px;scrollbar-width:thin}
.clubs-map-row{
    width:100%;min-height:86px;padding:11px 10px;display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:start;gap:9px;
    border:1px solid transparent;border-radius:15px;background:transparent;color:var(--text);text-align:left;font:inherit;cursor:pointer;
    transition:background .15s ease,border-color .15s ease,transform .15s ease
}
.clubs-map-row:hover{background:rgba(255,255,255,.035)}
.clubs-map-row.is-active{background:rgba(200,255,61,.07);border-color:rgba(200,255,61,.22)}
.clubs-map-row.no-geo{opacity:.45;cursor:not-allowed}
.clubs-map-row-pin{width:28px;height:28px;display:grid;place-items:center;border-radius:9px;background:rgba(255,255,255,.04);color:var(--text-faint)}
.clubs-map-row.is-active .clubs-map-row-pin{background:var(--accent);color:var(--accent-ink)}
.clubs-map-row-copy{min-width:0;display:flex;flex-direction:column}.clubs-map-row-copy b{font-size:11.5px;line-height:1.35}.clubs-map-row-copy small{margin-top:3px;color:var(--text-faint);font-size:9.5px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clubs-map-row-copy em{margin-top:7px;color:var(--text-dim);font-size:9px;font-style:normal}
.clubs-map-bookable{align-self:center;padding:5px 7px;border-radius:999px;background:rgba(200,255,61,.11);color:var(--accent);font-size:8px;font-weight:850;text-transform:uppercase;letter-spacing:.04em}

.clubs-map-stage{position:relative;min-width:0;overflow:hidden;background:#1b2119}
.clubs-map-canvas{position:absolute;inset:0;z-index:1;background:#1b2119}
.clubs-map-canvas .leaflet-tile-pane{filter:grayscale(1) invert(.88) hue-rotate(180deg) brightness(.58) contrast(1.12)}
.clubs-map-canvas .leaflet-control-attribution{background:rgba(18,23,16,.84)!important;color:#8d9588!important;font-size:8px!important}.clubs-map-canvas .leaflet-control-attribution a{color:#b5c0ad!important}
.clubs-map-canvas .leaflet-bar{border:1px solid rgba(255,255,255,.09)!important;border-radius:12px!important;box-shadow:0 9px 25px -18px rgba(0,0,0,.8)!important;overflow:hidden}
.clubs-map-canvas .leaflet-bar a{background:#151b14!important;color:#d6ddd0!important;border-bottom-color:rgba(255,255,255,.07)!important}.clubs-map-canvas .leaflet-bar a:hover{background:#20271e!important;color:var(--accent)!important}
.clubs-map-hint{position:absolute;z-index:510;left:14px;bottom:14px;height:32px;padding:0 11px;display:inline-flex;align-items:center;gap:7px;border:1px solid rgba(255,255,255,.09);border-radius:10px;background:rgba(16,21,15,.88);color:#aab2a6;font-size:9.5px;font-weight:650;backdrop-filter:blur(12px);pointer-events:none}
.clubs-map-empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:7px;color:var(--text-dim);padding:30px}.clubs-map-empty svg{color:var(--accent)}.clubs-map-empty b{font-size:13px}.clubs-map-empty span{max-width:260px;color:var(--text-faint);font-size:10.5px;line-height:1.45}

.ace-map-marker-shell{background:transparent!important;border:0!important}
.ace-map-marker{position:relative;width:42px;height:42px;display:grid;place-items:center;border:4px solid #151a13;border-radius:50% 50% 50% 14%;transform:rotate(-45deg);background:#e6ebe0;color:#151a13;box-shadow:0 7px 20px rgba(0,0,0,.45)}
.ace-map-marker b{transform:rotate(45deg);font:850 10px/1 var(--font-mono)}
.ace-map-marker.is-bookable{background:var(--accent);color:var(--accent-ink)}
.ace-map-marker i{position:absolute;left:50%;bottom:-7px;width:9px;height:4px;border-radius:50%;background:rgba(0,0,0,.36);filter:blur(2px);transform:translateX(-50%) rotate(45deg)}
.ace-map-popup .leaflet-popup-content-wrapper{padding:0!important;overflow:hidden;border:1px solid rgba(255,255,255,.10)!important;border-radius:17px!important;background:#161c14!important;color:var(--text)!important;box-shadow:0 24px 60px -30px rgba(0,0,0,.9)!important}
.ace-map-popup .leaflet-popup-content{margin:0!important;width:280px!important}.ace-map-popup .leaflet-popup-tip{background:#161c14!important;box-shadow:none!important}
.ace-map-popup-card{padding:15px}.ace-map-popup-kicker{display:block;margin-bottom:6px;color:var(--accent);font-size:8px;font-weight:850;letter-spacing:.10em;text-transform:uppercase}.ace-map-popup-card>b{display:block;font-size:13px;line-height:1.3}.ace-map-popup-card p{margin:5px 0 10px;color:var(--text-faint);font-size:9.5px;line-height:1.45}.ace-map-popup-card>div{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:11px}.ace-map-popup-card>div span{padding:5px 7px;border-radius:8px;background:rgba(255,255,255,.045);color:var(--text-dim);font-size:8.5px}.ace-map-popup-card>a{height:34px;padding:0 11px;display:flex;align-items:center;justify-content:space-between;border-radius:10px;background:var(--accent);color:var(--accent-ink);font-size:9.5px;font-weight:850}.ace-map-popup-card>a svg{width:13px;height:13px}

/* Geographic controls in admin / club CRM. */
.adm-geo-helper{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}.adm-geo-helper .btn{min-height:34px!important;height:34px!important}.adm-geo-helper small{color:var(--text-faint);font-size:9.5px;line-height:1.4}

@media(max-width:760px){
    .clubs-viewbar{align-items:center;margin-bottom:8px}.clubs-viewbar>div:first-child{display:block}.clubs-view-kicker{display:block;margin-bottom:2px}.clubs-viewbar b{font-size:9.5px}.clubs-view-switch button{padding:0 10px}.clubs-view-switch button span{display:none}
    .clubs-map-layout{height:auto;min-height:0;display:flex;flex-direction:column;border-radius:20px}
    .clubs-map-stage{order:0;height:430px;flex:0 0 430px}
    .clubs-map-list{order:1;border-right:0;border-top:1px solid var(--border)}
    .clubs-map-list-head{height:54px;flex-basis:54px}.clubs-map-list-scroll{max-height:330px}
    .clubs-map-row{min-height:78px}.clubs-map-hint{left:10px;bottom:10px}
}
@media(max-width:430px){
    .clubs-viewbar{gap:8px}.clubs-viewbar b{display:none}.clubs-view-switch{margin-left:auto}.clubs-map-stage{height:360px;flex-basis:360px}
}
/* Legacy `.global-tools button` was intentionally broad; dropdown actions are not utility pills. */
.global-tools .profile-shortcut-menu>button{
    height:auto!important;min-height:51px!important;border-radius:12px!important;padding:8px 9px!important;
    background:transparent!important;box-shadow:none!important
}
.global-tools .profile-shortcut-menu>button:hover{background:rgba(255,255,255,.055)!important}
