/* ============================================================
   BabaTower — Base Styles
   Theme: bright, friendly "mobile city-builder" look
   ============================================================ */

:root {
    --bt-bg:        #f2f6fb;
    --bt-bg2:       #ffffff;
    --bt-bg3:       #eef3f9;
    --bt-border:    #e3eaf2;
    --bt-border-lit:#cfdcec;
    --bt-text:      #1f2d3d;
    --bt-muted:     #7a8aa0;
    --bt-subtle:    #a7b6c8;

    --bt-primary:      #2f80ed;
    --bt-primary-dark: #1f63c4;
    --bt-primary-light:#eaf2ff;

    --bt-gold:      #ffb020;
    --bt-gold-dim:  #e89a0c;
    --bt-green:     #27ae60;
    --bt-green-light:#e8f8ee;
    --bt-red:       #eb5757;
    --bt-red-light: #fdecec;

    --bt-radius:    8px;
    --bt-radius-sm: 6px;
    --bt-shadow:    0 2px 10px rgba(31, 45, 61, 0.07);

    /* Sidebar — same light surface as the rest of the app (no dark/light
       seam between sidebar and content), just with tighter, calmer nav
       styling than the old solid-blue bar. */
    --bt-side-bg:        var(--bt-bg2);
    --bt-side-line:      var(--bt-border);
    --bt-side-text:      var(--bt-muted);
    --bt-side-text-hi:   var(--bt-text);
    --bt-side-active-bg: var(--bt-primary-light);
    --bt-side-active-fg: var(--bt-primary-dark);
}

/* ── Ambient "you're under attack" warning — a pulsing red border
   around the whole viewport, visible on every page so a player notices
   even when they're nowhere near /babatower/war/attacks. ──────────── */
.bt-under-attack-border {
    position: fixed;
    inset: 0;
    border: 6px solid #eb5757;
    box-shadow: inset 0 0 30px rgba(235, 87, 87, 0.5);
    pointer-events: none;
    z-index: 9999;
    animation: bt-under-attack-pulse 1.6s ease-in-out infinite;
}
@keyframes bt-under-attack-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bt-bg);
    color: var(--bt-text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--bt-primary); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-weight: 800; }

/* ── Layout: sidebar | map | panel, map always visible ────── */
html, body { height: 100%; overflow: hidden; }
.bt-shell {
    display: grid;
    grid-template-columns: 230px 1fr 400px;
    height: 100vh;
    overflow: hidden;
}

.bt-topbar { display: none; }

.bt-logo {
    font-weight: 900;
    font-size: 19px;
    letter-spacing: .01em;
    padding: 18px 16px 14px;
    color: var(--bt-text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.bt-logo::before {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: var(--bt-primary);
}
.bt-logo span { color: var(--bt-primary); }

/* ── Sidebar — same light surface as the page, no dark/light seam ── */
.bt-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--bt-side-bg);
    border-right: 1px solid var(--bt-side-line);
    overflow-y: auto;
    min-height: 0;
}

.bt-cash {
    margin: 0 14px 12px;
    background: linear-gradient(135deg, var(--bt-primary) 0%, var(--bt-primary-dark) 100%);
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 800;
    color: #fff;
    font-size: 15px;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-all;
    box-shadow: 0 4px 14px rgba(47, 128, 237, 0.25);
}

.bt-nav-vertical { display: flex; flex-direction: column; flex: 1; padding: 2px 10px; gap: 1px; }
.bt-nav-vertical a {
    display: flex;
    align-items: center;
    padding: 9px 10px;
    color: var(--bt-side-text);
    font-weight: 600;
    font-size: 13.5px;
    border-radius: 9px;
    transition: background .12s ease, color .12s ease;
}
.bt-nav-vertical a:hover { background: var(--bt-bg3); color: var(--bt-side-text-hi); text-decoration: none; }
.bt-nav-vertical a.bt-nav-sub {
    padding: 5px 10px 5px 44px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--bt-subtle);
}
.bt-nav-label-short { display: none; }
.bt-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    width: 22px;
    height: 22px;
    font-size: 15px;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
}
.bt-badge-action {
    display: inline-block;
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--bt-red);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    animation: bt-pill-pulse 1.4s ease-in-out infinite;
}
.bt-badge-free {
    display: inline-block;
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--bt-gold);
    color: #1a1a1a;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    vertical-align: middle;
}
.bt-nav-vertical a.active {
    color: var(--bt-side-active-fg);
    background: var(--bt-side-active-bg);
    font-weight: 800;
}
.bt-nav-section {
    margin-top: 14px;
    padding: 10px 10px 4px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--bt-subtle);
    font-weight: 800;
}
.bt-nav-sub { font-size: 13px !important; }
.bt-nav-sub-icon { display: inline-block; margin-right: 6px; font-size: 11px; vertical-align: middle; }
a.bt-nav-bottom { margin-top: auto !important; border-top: 1px solid var(--bt-side-line); padding-top: 12px !important; border-radius: 9px 9px 0 0; }

/* ── Player identity + legend, anchored at the bottom of the sidebar ── */
.bt-player-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 14px;
    padding: 12px 0;
    border-top: 1px solid var(--bt-side-line);
    font-size: 13px;
    color: var(--bt-text);
    font-weight: 700;
}
.bt-legend { padding: 0 18px 14px; font-size: 12px; color: var(--bt-side-text); }
.bt-legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bt-legend-dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--bt-bg2); box-shadow: 0 0 0 1px var(--bt-border); }
.bt-legend-dot-multi { background: conic-gradient(#eb5757 0 25%, #2f80ed 25% 50%, #f2c94c 50% 75%, #9b51e0 75% 100%); }


/* ── Map (center column) ───────────────────────────────── */
.bt-map-wrap { position: relative; width: 100%; height: 100vh; }
#bt-map { width: 100%; height: 100vh; background: #cfe3f5; }

/* ── Building avatar markers (shown over ownership circles) ─ */
.bt-map-avatar-wrap { background: transparent; border: none; }
.bt-map-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
    cursor: pointer;
}
.bt-map-avatar img.bt-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ── Admin: drag anywhere inside a region's square to move it ─ */
.bt-region-drag-rect { cursor: grab; }
.bt-region-drag-rect:active { cursor: grabbing; }

/* ── Admin: corner handles to resize a region's square ────────── */
.bt-region-resize-icon { background: transparent; border: none; }
.bt-region-resize-handle {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #fff;
    border: 2px solid #d4af37;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

/* ── Live "attack in transit" marker on the map ─────────────
   Plain SVG circle markers (L.circleMarker), not emoji divIcons — no
   font-rendering dependency, no icon-anchor math, and no risk of a CSS
   transform animation fighting Leaflet's own positioning transform
   (which is exactly what made an earlier divIcon version invisible). ── */
.bt-travel-marker {
    filter: drop-shadow(0 0 3px rgba(235, 87, 87, 0.8));
}
.bt-travel-label {
    background: rgba(20, 22, 28, 0.9);
    border: 1px solid #eb5757;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.bt-travel-label::before { display: none; }

/* ── Building "kartvizit" ad image shown in map popups ───── */
.bt-popup-ad-image {
    display: block;
    max-width: 220px;
    width: 100%;
    border-radius: var(--bt-radius-sm);
    margin-top: 6px;
}

/* ── News ticker (overlaid on top of the map) ──────────── */
.bt-news-ticker {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(20, 30, 48, 0.85);
    color: #fff;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(2px);
}
.bt-news-ticker-icon { flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
.bt-news-ticker-track { flex: 1; overflow: hidden; white-space: nowrap; }
.bt-news-ticker-content { display: inline-flex; animation: bt-ticker-scroll var(--bt-ticker-duration, 30s) linear infinite; }
.bt-news-ticker:hover .bt-news-ticker-content { animation-play-state: paused; }
.bt-news-ticker-group { display: inline-flex; flex-shrink: 0; }
.bt-news-ticker-item { display: inline-block; padding-right: 48px; }
.bt-news-ticker-item strong { color: var(--bt-gold); }
@keyframes bt-ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ── Auction ticker (overlaid at the bottom of the map) ──── */
.bt-auction-ticker {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(20, 30, 48, 0.85);
    color: #fff;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(2px);
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.5s ease, opacity 0.5s ease;
}
.bt-auction-ticker.bt-auction-ticker-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.bt-auction-ticker-icon { flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
.bt-auction-ticker-track { flex: 1; overflow: hidden; white-space: nowrap; }
.bt-auction-ticker-content { display: inline-flex; animation: bt-ticker-scroll var(--bt-ticker-duration, 30s) linear infinite; }
.bt-auction-ticker:hover .bt-auction-ticker-content { animation-play-state: paused; }
.bt-auction-ticker-group { display: inline-flex; flex-shrink: 0; }
.bt-auction-ticker-item {
    display: inline-block;
    padding-right: 48px;
    color: #fff;
    text-decoration: none;
}
.bt-auction-ticker-item:hover { text-decoration: underline; }
.bt-auction-ticker-item strong { color: var(--bt-gold); }

/* ── Right content panel ────────────────────────────────── */
.bt-panel {
    background: var(--bt-bg);
    border-left: 1px solid var(--bt-border);
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
}
.bt-panel h1 {
    font-size: 19px;
    margin: 0 0 8px;
    color: var(--bt-text);
    display: flex;
    align-items: center;
    gap: 4px;
}
.bt-panel h2 { font-size: 15px; margin: 0 0 8px; color: var(--bt-text); }

/* ── Wide overlay panel: floats over the map for content that ──
   needs more horizontal room (e.g. leaderboard) ────────────── */
@media (min-width: 901px) {
    .bt-shell-overlay-panel { grid-template-columns: 230px 1fr 0; }
    .bt-shell-overlay-panel .bt-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(95vw, 1100px);
        z-index: 1500;
        box-shadow: -8px 0 24px rgba(0,0,0,0.18);
        border-left: 1px solid var(--bt-border);
    }
}

/* ── Sticky header block at the top of the right panel ────── */
@media (min-width: 901px) {
    .bt-panel-sticky {
        position: sticky;
        top: -20px;
        z-index: 5;
        background: var(--bt-bg);
        margin: -20px -20px 0;
        padding: 20px 20px 8px;
    }
}

/* ── Meta row: compact pill chips for key facts ───────────── */
.bt-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.bt-meta-chip {
    background: var(--bt-bg3);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-sm);
    padding: 4px 9px;
    font-size: 12px;
    color: var(--bt-muted);
    white-space: nowrap;
}
.bt-meta-chip strong { color: var(--bt-text); }
.bt-meta-row-nowrap { flex-wrap: nowrap; overflow-x: auto; }
.bt-meta-row-nowrap .bt-meta-chip { font-size: 11px; padding: 3px 7px; flex-shrink: 0; }

/* ── Recruit-unit panel (inside a building's "Birlik Eğit" details) ── */
.bt-recruit-form {
    background: var(--bt-bg3);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    padding: 12px;
}
.bt-recruit-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.bt-recruit-field { display: flex; flex-direction: column; gap: 4px; }
.bt-recruit-field-tier { flex: 1 1 auto; min-width: 0; }
.bt-recruit-field-count { flex: 0 0 80px; }
.bt-recruit-field-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--bt-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.bt-recruit-form select.bt-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237a8aa0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.bt-recruit-form .bt-recruit-stats,
.bt-recruit-form .bt-recruit-preview { margin-bottom: 10px; }
.bt-recruit-form .bt-recruit-preview:last-child { margin-bottom: 0; }
.bt-recruit-submit { margin-bottom: 10px; }

/* ── Cards ──────────────────────────────────────────────── */
.bt-card {
    background: var(--bt-bg2);
    border: 1px solid var(--bt-border);
    box-shadow: var(--bt-shadow);
    border-radius: var(--bt-radius);
    padding: 12px 14px;
    margin-bottom: 10px;
    overflow: hidden;
}
.bt-card h2, .bt-card h3 { margin-top: 0; margin-bottom: 6px; }
.bt-card p { margin: 0 0 8px; }
.bt-card p:last-child { margin-bottom: 0; }
.bt-card-compact { padding: 10px 12px; }
.bt-card-compact .bt-alert { margin-bottom: 0; }

/* ── Facility card title + "ℹ️" info icon ────────────────────
   Keeps the upgrade button itself short ("⬆️ Yükselt (cost ₺)") by
   moving the duration/effect breakdown into a shared modal (see
   facilities/index.php) instead of cramming it all into the button
   text. The modal itself lives entirely in that page's own <style>/
   <script>, since nowhere else uses it. */
.bt-facility-title-row { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.bt-facility-title-row h2 { margin: 0; }

/* ── Admin: pending building-ad review grid ────────────────── */
.bt-ad-review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.bt-ad-review-card {
    background: var(--bt-bg2);
    border: 1px solid var(--bt-border);
    box-shadow: var(--bt-shadow);
    border-radius: var(--bt-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.bt-ad-review-image {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
    background: var(--bt-bg3);
}
.bt-ad-review-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.bt-ad-review-body h2 { margin: 0; font-size: 14px; }
.bt-ad-review-actions { display: flex; gap: 8px; margin-top: auto; }
.bt-ad-review-image-clickable { cursor: zoom-in; }
.bt-ad-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.bt-ad-lightbox-modal { max-width: min(90vw, 900px); }
.bt-ad-lightbox-image { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: var(--bt-radius-sm); }

/* ── Plot price box (map page) ─────────────────────────────── */
.bt-price-box {
    overflow-wrap: anywhere;
    word-break: break-all;
    padding: 8px 10px;
    margin-bottom: 10px;
}
.bt-price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}
.bt-price-label {
    font-weight: 700;
}
.bt-price-value {
    font-weight: 700;
    font-size: 1em;
    line-height: 1.3;
}

.bt-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.bt-stat {
    background: var(--bt-bg2);
    border: 1px solid var(--bt-border);
    box-shadow: var(--bt-shadow);
    border-radius: var(--bt-radius);
    padding: 8px 10px;
    text-align: center;
}
.bt-stat .bt-stat-value { font-size: 16px; font-weight: 900; color: var(--bt-primary); word-break: break-word; }
.bt-stat .bt-stat-label { font-size: 10px; color: var(--bt-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; font-weight: 700; }

/* ── Icon buttons & inline forms (e.g. building rename) ───── */
.bt-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--bt-border-lit);
    background: var(--bt-bg2);
    border-radius: var(--bt-radius-sm);
    font-size: 13px;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 4px;
    flex-shrink: 0;
}
.bt-icon-btn:hover { background: var(--bt-bg3); }
.bt-icon-btn-disabled { opacity: 0.3; cursor: default; pointer-events: none; }
.bt-building-nav-header { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.bt-inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 10px 0 16px;
}
.bt-inline-form .bt-input { flex: 1; }

/* ── Choice grids (avatar / circle color pickers) ─────────── */
.bt-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
}
.bt-choice {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bt-border);
    border-radius: var(--bt-radius-sm);
    background: var(--bt-bg3);
    padding: 8px;
    cursor: pointer;
    transition: border-color .1s ease, background .1s ease;
}
.bt-choice > input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.bt-choice:hover { border-color: var(--bt-border-lit); }
.bt-choice-active,
.bt-choice-active:hover { border-color: var(--bt-primary); background: var(--bt-primary-light); }
.bt-choice-emoji { font-size: 22px; line-height: 1; }
.bt-choice-color { padding: 6px; }
.bt-choice-swatch {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: var(--bt-radius-sm);
    border: 1px solid rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}
.bt-choice-swatch-custom {
    background: repeating-conic-gradient(#ddd 0% 25%, #fff 0% 50%) 0 0 / 10px 10px;
}
.bt-choice-swatch-custom #bt-custom-color-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0;
}

/* ── Avatar upload ─────────────────────────────────────────── */
.bt-avatar-current {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.bt-avatar-preview {
    width: 56px;
    height: 56px;
    border-radius: var(--bt-radius);
    background: var(--bt-bg3);
    border: 1px solid var(--bt-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    overflow: hidden;
}
.bt-avatar-img {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: cover;
    vertical-align: middle;
}
.bt-avatar-preview .bt-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 0;
}
.bt-avatar-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Tables (wrapped so they scroll instead of overflowing) ── */
.bt-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bt-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
.bt-table th, .bt-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--bt-border); white-space: nowrap; }
.bt-table th { color: var(--bt-muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.bt-table th a { color: inherit; text-decoration: none; }
.bt-table th a:hover { color: var(--bt-text); }
.bt-row-highlight { background: rgba(212, 175, 55, 0.12); }

/* ── Buttons ────────────────────────────────────────────── */
.bt-btn {
    display: inline-block;
    background: linear-gradient(180deg, #ffc94d 0%, var(--bt-gold) 100%);
    color: #5a3c00;
    border: none;
    border-radius: var(--bt-radius-sm);
    padding: 11px 22px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 2px 0 var(--bt-gold-dim);
    transition: transform .05s ease;
}
.bt-btn:hover { background: linear-gradient(180deg, #ffd56e 0%, #ffc233 100%); text-decoration: none; }
.bt-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--bt-gold-dim); }
.bt-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.bt-btn-block { display: block; width: 100%; }
.bt-btn-secondary {
    background: var(--bt-bg3);
    color: var(--bt-primary-dark);
    border: 1px solid var(--bt-border-lit);
    box-shadow: none;
}
.bt-btn-secondary:hover { background: var(--bt-primary-light); }
.bt-btn-danger {
    background: linear-gradient(180deg, #ff7b6e 0%, #d8392c 100%);
    color: #fff;
    box-shadow: 0 2px 0 #a4271d;
}
.bt-btn-danger:hover { background: linear-gradient(180deg, #ff9489 0%, #e8483a 100%); }
.bt-btn-sm { padding: 7px 14px; font-size: 12px; }
.bt-btn-xs { padding: 2px 6px; font-size: 10px; line-height: 1.2; }
.bt-btn-icon {
    padding: 3px 6px;
    font-size: 12px;
    line-height: 1.2;
    background: rgba(255,255,255,0.55);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.bt-btn-icon:hover { background: rgba(255,255,255,0.8); }

/* ── Forms ──────────────────────────────────────────────── */
.bt-form-group { margin-bottom: 10px; }
.bt-label { display: block; font-size: 13px; color: var(--bt-muted); margin-bottom: 6px; font-weight: 700; }
.bt-input {
    width: 100%;
    background: var(--bt-bg3);
    border: 1px solid var(--bt-border-lit);
    border-radius: var(--bt-radius);
    color: var(--bt-text);
    padding: 11px 12px;
    font-size: 14px;
}
.bt-input:focus { outline: none; border-color: var(--bt-primary); background: #fff; }

/* ── Auth pages ─────────────────────────────────────────── */
.bt-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, var(--bt-primary) 0%, #6fb1f0 100%);
}
.bt-auth-box {
    background: var(--bt-bg2);
    border-radius: var(--bt-radius);
    box-shadow: 0 10px 40px rgba(31,45,61,0.25);
    padding: 32px;
    width: 100%;
    max-width: 420px;
}
.bt-auth-logo { font-size: 30px; font-weight: 900; text-align: center; margin-bottom: 4px; color: var(--bt-text); }
.bt-auth-logo span { color: var(--bt-gold); }
.bt-auth-subtitle { text-align: center; color: var(--bt-muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 24px; font-weight: 700; }

.bt-alert { border-radius: var(--bt-radius); padding: 9px 12px; font-size: 12.5px; margin-bottom: 8px; font-weight: 600; line-height: 1.45; }
.bt-alert-danger  { background: var(--bt-red-light);  border: 1px solid #f8c9c9; color: #c0392b; }
.bt-alert-info    { background: var(--bt-primary-light); border: 1px solid #cfe0fb; color: var(--bt-primary-dark); }
.bt-alert-warning { background: #fff6e6; border: 1px solid #ffe1ad; color: #946200; }
.bt-alert-success { background: var(--bt-green-light); border: 1px solid #bdeccf; color: #1e8449; }

.bt-divider { border: none; border-top: 1px solid var(--bt-border); margin: 20px 0; }
.bt-text-center { text-align: center; }
.bt-small { font-size: 13px; color: var(--bt-muted); }

/* ── Renovation tier badges ─────────────────────────────── */
.bt-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--bt-radius-sm);
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
}
.bt-tier-badge-rent { font-weight: 600; font-size: 11px; opacity: 0.85; }
.bt-tier-1 { background: #9aa6b2; }              /* Temel */
.bt-tier-2 { background: #8d6e52; }              /* Ekonomik */
.bt-tier-3 { background: #4f9bf2; }              /* Standart */
.bt-tier-4 { background: #5e6bf2; }              /* Konforlu */
.bt-tier-5 { background: #9b59d9; }              /* Premium */
.bt-tier-6 { background: linear-gradient(135deg,#f6c453,#e8a020); color:#5a3c00; } /* Altın */
.bt-tier-7 { background: linear-gradient(135deg,#ff8a8a,#ff5f6d); }                /* Lüks */

.bt-upgrade-arrow { color: var(--bt-subtle); font-weight: 900; }

/* ── Floor cards (building detail) ─────────────────────── */
.bt-floor-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid var(--bt-border);
}
.bt-floor-card:last-child { border-bottom: none; }
.bt-floor-card .bt-floor-num {
    font-weight: 900;
    font-size: 13px;
    color: var(--bt-primary-dark);
    min-width: 50px;
}
.bt-floor-card .bt-floor-mid { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.bt-floor-tier-image {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.bt-floor-card .bt-floor-rent { font-size: 11px; color: var(--bt-green); font-weight: 800; }
.bt-floor-card .bt-floor-upgrade { font-size: 11px; color: var(--bt-gold-dim); font-weight: 800; }
.bt-floor-card .bt-floor-actions { margin-left: auto; text-align: right; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }

/* ── Building cards (dashboard "Binalarım") ────────────── */
.bt-bcard { padding: 8px 0; border-bottom: 1px solid var(--bt-border); font-size: 11px; }
.bt-bcard:last-child { border-bottom: none; }
.bt-bcard-header { display: flex; align-items: center; gap: 8px; }
.bt-bcard-name { font-weight: 900; font-size: 11px; color: var(--bt-primary-dark); }
.bt-map-focus-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.bt-map-focus-link:hover { color: var(--bt-primary); }
.bt-bcard-header .bt-btn { margin-left: auto; }
.bt-bcard-mid { font-size: 11px; color: var(--bt-muted); margin-top: 3px; }
.bt-bcard-upgrade-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; }
.bt-bcard .bt-floor-rent,
.bt-bcard .bt-floor-upgrade { font-size: 11px; }
.bt-bcard-collapsed { display: flex; align-items: center; gap: 8px; }
.bt-bcard-collapsed .bt-bcard-name { flex: 1; }
.bt-bcard-collapsed .bt-floor-rent { color: var(--bt-muted); font-weight: 700; }

/* Active build/renovation countdown — needs to jump out of the building
   list at a glance, not blend into the same muted gold as its label. */
.bt-bcard .bt-upgrade-countdown {
    color: #d8392c;
    font-weight: 800;
    font-family: var(--bt-font-mono, monospace);
    animation: bt-countdown-pulse 1.4s ease-in-out infinite;
}
@keyframes bt-countdown-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.bt-status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}
.bt-status-pill-auction { background: #fff6e6; color: #946200; border: 1px solid #ffe1ad; }
.bt-status-pill-sale { background: var(--bt-green-light); color: #1e8449; border: 1px solid #bdeccf; }
.bt-status-pill-danger {
    background: #ffe2de;
    color: #a4271d;
    border: 1px solid #ffb3a8;
    animation: bt-pill-pulse 1.4s ease-in-out infinite;
}
@keyframes bt-pill-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(216, 57, 44, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(216, 57, 44, 0); }
}

/* ── Lottery number picker ─────────────────────────────── */
.bt-lotto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
    gap: 4px;
    margin-top: 8px;
}
.bt-lotto-num {
    aspect-ratio: 1 / 1;
    border: 1px solid var(--bt-border);
    border-radius: 6px;
    background: #fff;
    font-weight: 800;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bt-lotto-num.selected {
    background: var(--bt-gold);
    color: #fff;
    border-color: var(--bt-gold);
}
.bt-lotto-stake { margin-top: 10px; }
.bt-lotto-stake input[type="range"] { width: 100%; margin-top: 4px; accent-color: var(--bt-gold); }

/* ── Lottery history — winners' ticket numbers, matched ones highlighted ── */
.bt-lotto-winner-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}
.bt-lotto-winner-row + .bt-lotto-winner-row { border-top: 1px dashed var(--bt-border); margin-top: 4px; }
.bt-lotto-num-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    border-radius: 5px;
    border: 1px solid var(--bt-border);
    background: #fff;
    color: var(--bt-muted);
    font-weight: 700;
    font-size: 11px;
}
.bt-lotto-num-chip-hit {
    background: var(--bt-gold);
    color: #fff;
    border-color: var(--bt-gold-dim);
}
.bt-lotto-winner-meta { font-size: 12px; color: var(--bt-text); }

/* ── Building list filter + pagination ─────────────────── */
.bt-bfilter-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bt-bfilter-row .bt-input { width: auto; flex: 1 1 120px; padding: 6px 8px; font-size: 12px; }
.bt-bfilter-line { display: flex; flex-wrap: nowrap; gap: 6px; width: 100%; }
.bt-bfilter-line .bt-input { flex: 1 1 50%; min-width: 0; }
.bt-bpagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.bt-floor-card .bt-floor-actions .bt-cost { display: block; font-size: 12px; color: var(--bt-text); }
.bt-floor-card .bt-floor-actions .bt-cost strong { color: var(--bt-primary-dark); }

/* ── Map placeholder bits ───────────────────────────────── */
.bt-map-toggle {
    display: none;
}

/* ════════════════════════════════════════════════════════
   Admin panel
   ════════════════════════════════════════════════════════ */
.bt-admin-body { background: var(--bt-bg); overflow: visible; height: auto; }
html:has(.bt-admin-body) { overflow: auto; height: auto; }

/* ── Admin: left-sidebar layout ─────────────────────────── */
.bt-admin-shell-2 {
    min-height: 100vh;
}
.bt-admin-sidebar {
    background: linear-gradient(180deg, var(--bt-primary) 0%, var(--bt-primary-dark) 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 230px;
    height: 100vh;
    overflow-y: auto;
}
.bt-admin-sidebar .bt-logo { padding: 18px 18px 2px; }
.bt-admin-sidebar-tag {
    margin: 0 18px 14px;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    font-weight: 700;
}
.bt-admin-nav-vertical { display: flex; flex-direction: column; flex: 1; padding: 6px 0; }
.bt-admin-nav-vertical a {
    display: block;
    padding: 11px 18px;
    color: rgba(255,255,255,0.85);
    font-weight: 700;
    font-size: 14px;
}
.bt-admin-nav-vertical a:hover { background: rgba(255,255,255,0.10); text-decoration: none; }
.bt-admin-nav-vertical a.active {
    color: #fff;
    background: rgba(255,255,255,0.18);
    border-left: 4px solid var(--bt-gold);
    padding-left: 14px;
}
.bt-admin-nav-vertical .bt-nav-bottom {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.bt-admin-content { padding: 16px 20px 48px; max-width: 1100px; margin-left: 230px; }
.bt-admin-content h1 { font-size: 19px; margin: 0 0 12px; }

@media (max-width: 900px) {
    .bt-admin-sidebar { position: static; width: auto; height: auto; overflow-y: visible; padding-bottom: 6px; }
    .bt-admin-content { padding: 12px; margin-left: 0; }
}

/* Admin cards are denser than the player-facing UI. */
.bt-admin-content .bt-card {
    padding: 10px 12px;
    margin-bottom: 10px;
}
.bt-admin-content .bt-card h2 { font-size: 14px; }
.bt-admin-content .bt-card > .bt-small { margin-top: -4px; }

.bt-subheading {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--bt-muted);
    margin: 10px 0 4px;
    padding-top: 8px;
    border-top: 1px solid var(--bt-border);
}

/* ── Sticky region map + collapsible region cards ──────────── */
.bt-admin-map-card {
    position: sticky;
    top: 8px;
    z-index: 5;
}

/* Keep cards from scrolling under the sticky map when jumped to. */
.bt-region-card { scroll-margin-top: 360px; }

.bt-region-card { padding: 0; }
.bt-region-card > form { padding: 10px 12px; }
.bt-region-summary {
    cursor: pointer;
    list-style: none;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.bt-region-summary::-webkit-details-marker { display: none; }
.bt-region-summary::before {
    content: '▶';
    font-size: 10px;
    color: var(--bt-muted);
    transition: transform .15s ease;
}
.bt-region-card[open] > .bt-region-summary::before { transform: rotate(90deg); }
.bt-region-card[open] > .bt-region-summary { border-bottom: 1px solid var(--bt-border); }

@media (max-width: 900px) {
    .bt-admin-map-card { position: static; }
    .bt-region-card { scroll-margin-top: 12px; }
}

/* ── Settings hub — a card per category instead of one giant list ── */
.bt-settings-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.bt-settings-hub-card {
    display: block;
    text-decoration: none;
    color: var(--bt-text);
    transition: box-shadow 0.15s, transform 0.15s;
}
.bt-settings-hub-card:hover { box-shadow: var(--bt-shadow); transform: translateY(-1px); }
.bt-settings-hub-card-label { font-weight: 800; font-size: 15px; margin-bottom: 4px; }

.bt-admin-table-wrap { overflow-x: auto; }
.bt-admin-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.bt-admin-table th, .bt-admin-table td { padding: 6px 8px; border-bottom: 1px solid var(--bt-border); text-align: left; vertical-align: middle; }
.bt-admin-table th { color: var(--bt-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.bt-admin-table input[type="number"],
.bt-admin-table input[type="text"] {
    width: 100px;
    padding: 5px 7px;
    border: 1px solid var(--bt-border-lit);
    border-radius: 8px;
    background: var(--bt-bg3);
    font-size: 13px;
}
.bt-admin-table input[type="text"].bt-wide { width: 160px; }
.bt-admin-table-section td {
    padding-top: 14px;
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bt-primary-dark);
    border-bottom: 2px solid var(--bt-border-lit);
}

/* ── Unit tier badges — own color space, decoupled from the unrelated
   renovation-tier badges (.bt-tier-N), which only had 7 colors defined
   and is keyed by a completely different id sequence. Grouped by role:
   reds = attackers, blues = defenders, ambers = transports. ── */
.bt-unit-tier-1 { background: #f4a09a; color: #5a1a14; }   /* Çete Üyesi */
.bt-unit-tier-2 { background: #ef7b6e; color: #fff; }      /* Kabadayı */
.bt-unit-tier-3 { background: linear-gradient(135deg,#e85c4a,#c0392b); color: #fff; } /* Özel Tim */
.bt-unit-tier-4 { background: #9ec1f4; color: #0d2b54; }   /* Koruma */
.bt-unit-tier-5 { background: #5e9bef; color: #fff; }      /* Bodyguard */
.bt-unit-tier-6 { background: linear-gradient(135deg,#2f80ed,#1f63c4); color: #fff; } /* VIP Koruma */
.bt-unit-tier-7 { background: #f6d58a; color: #5a3c00; }   /* Kamyonet */
.bt-unit-tier-8 { background: #e8b54a; color: #4a3000; }   /* Kamyon */
.bt-unit-tier-9 { background: linear-gradient(135deg,#d9a020,#a87a10); color: #fff; } /* Tır */

/* Compact tier-economy table embedded in region cards */
.bt-admin-table-compact { min-width: 0; }
.bt-admin-table-compact th, .bt-admin-table-compact td { padding: 4px 6px; }
.bt-admin-table-compact input[type="number"] { width: 90px; padding: 4px 6px; font-size: 12px; }

.bt-tier-image-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.bt-tier-image-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--bt-border-lit);
}
.bt-tier-image-cell input[type="file"] {
    font-size: 11px;
    max-width: 140px;
}

/* ── Settings rows: 2-column grid on wide screens ──────────── */
.bt-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 24px;
}
@media (min-width: 760px) {
    .bt-settings-grid { grid-template-columns: 1fr 1fr; }
    .bt-settings-grid .bt-settings-row.bt-span-2 { grid-column: 1 / -1; }
}
/* A <button> placed directly inside a settings grid (e.g. a form's
   submit button, not wrapped in a .bt-settings-row) is a grid item like
   any other and stretches to fill its whole cell by default — turning a
   modest .bt-btn-sm into a giant full-width block. Grid items other than
   row wrappers should size to their own content instead. */
.bt-settings-grid > button,
.bt-settings-grid > a.bt-btn {
    justify-self: start;
    grid-column: 1 / -1;
}

.bt-settings-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--bt-border);
}
.bt-settings-row:last-child { border-bottom: none; }
.bt-settings-row .bt-settings-label { flex: 1 1 160px; }
.bt-settings-row .bt-settings-label strong { display: block; font-size: 13px; }
.bt-settings-row .bt-settings-label span { font-size: 11px; color: var(--bt-muted); }
.bt-settings-row .bt-settings-input { flex: 0 0 130px; }
.bt-settings-row .bt-settings-input input[type="text"],
.bt-settings-row .bt-settings-input input[type="number"] {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--bt-border-lit);
    border-radius: var(--bt-radius);
    background: var(--bt-bg3);
    font-size: 13px;
}

/* lat/lng pair + pick button */
.bt-settings-row .bt-settings-input-pair {
    flex: 1 1 320px;
    display: flex;
    gap: 6px;
    align-items: center;
}
.bt-settings-row .bt-settings-input-pair input { flex: 1 1 90px; min-width: 0; }
.bt-settings-row .bt-settings-input-pair .bt-btn { flex-shrink: 0; }

/* radius slider + number + unit */
.bt-settings-row .bt-settings-input-slider {
    flex: 1 1 320px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.bt-settings-row .bt-settings-input-slider input[type="range"] { flex: 1 1 auto; }
.bt-settings-row .bt-settings-input-slider input[type="number"] { flex: 0 0 90px; }

@media (max-width: 700px) {
    .bt-settings-row .bt-settings-input { flex-basis: 100%; }
}

/* ── Region cards: tighter rows to fit more on screen ──────── */
.bt-region-card .bt-settings-grid { column-gap: 14px; }
.bt-region-card .bt-settings-row { gap: 6px; padding: 3px 0; }
.bt-region-card .bt-settings-row .bt-settings-label strong { font-size: 12px; }
.bt-region-card .bt-settings-row .bt-settings-label span { font-size: 10px; }
.bt-region-card .bt-settings-row .bt-settings-input input[type="text"],
.bt-region-card .bt-settings-row .bt-settings-input input[type="number"] { padding: 4px 8px; font-size: 12px; }

/* On wide screens, fit 4 simple fields per row in region cards */
@media (min-width: 1100px) {
    .bt-region-card .bt-settings-grid { grid-template-columns: repeat(4, 1fr); }
    .bt-region-card .bt-settings-grid .bt-settings-row.bt-span-2 { grid-column: 1 / -1; }
    .bt-region-card .bt-settings-row:has(.bt-settings-input-pair),
    .bt-region-card .bt-settings-row:has(.bt-settings-input-slider) { grid-column: span 2; }
    .bt-region-card .bt-settings-row .bt-settings-label { flex: 0 0 auto; }
    .bt-region-card .bt-settings-row .bt-settings-input { flex: 1 1 auto; }
}

.bt-region-pick-active { background: var(--bt-gold); border-color: var(--bt-gold); color: #5a3c00; }

/* ════════════════════════════════════════════════════════
   Mobile layout: map on top, panel below, sidebar -> bottom nav
   ════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    html, body { overflow: visible; }

    .bt-shell {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .bt-topbar {
        order: 0;
        position: sticky;
        top: 0;
        z-index: 1001;
        display: flex;
        align-items: center;
        gap: 6px;
        overflow-x: auto;
        white-space: nowrap;
        background: var(--bt-bg2);
        border-bottom: 1px solid var(--bt-border);
        padding: 8px 10px;
        flex-shrink: 0;
    }
    .bt-topbar-item {
        flex-shrink: 0;
        background: var(--bt-bg3);
        border: 1px solid var(--bt-border);
        border-radius: var(--bt-radius-sm);
        padding: 4px 9px;
        font-size: 12.5px;
        font-weight: 700;
        color: var(--bt-text);
    }
    .bt-topbar-cash { color: var(--bt-primary-dark); border-color: #cfe0fb; background: var(--bt-primary-light); }
    .bt-topbar-highlight { color: #1e8449; border-color: #bdeccf; background: var(--bt-green-light); }
    .bt-topbar-collect-form { display: flex; flex-shrink: 0; }
    .bt-topbar-collect {
        font-family: inherit;
        cursor: pointer;
        animation: bt-topbar-collect-pulse 1.8s ease-in-out infinite;
    }
    .bt-topbar-collect:active { transform: scale(0.96); }
    @keyframes bt-topbar-collect-pulse {
        0%, 100% { box-shadow: 0 0 0 0 rgba(189, 236, 207, 0.7); }
        50% { box-shadow: 0 0 0 4px rgba(189, 236, 207, 0); }
    }

    .bt-map-wrap {
        order: 1;
        height: 42vh;
        min-height: 240px;
        flex-shrink: 0;
    }
    #bt-map {
        height: 100%;
    }

    .bt-panel {
        order: 2;
        border-left: none;
        border-top: 1px solid var(--bt-border);
        padding-bottom: 100px; /* leave room for floating bottom nav */
        overflow-y: visible;
        height: auto;
    }

    .bt-sidebar {
        order: 3;
        position: fixed;
        bottom: 10px; left: 10px; right: 10px;
        flex-direction: row;
        height: 64px;
        z-index: 1000;
        background: var(--bt-side-bg);
        border: 1px solid var(--bt-side-line);
        border-radius: 18px;
        box-shadow: 0 8px 24px rgba(31, 45, 61, 0.16);
        overflow: visible;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .bt-sidebar .bt-logo,
    .bt-sidebar .bt-cash,
    .bt-sidebar .bt-player-name,
    .bt-sidebar .bt-nav-section,
    .bt-sidebar .bt-nav-sub,
    .bt-sidebar .bt-legend {
        display: none;
    }
    .bt-nav-vertical {
        flex-direction: row;
        width: 100%;
        padding: 6px;
        gap: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .bt-nav-vertical::-webkit-scrollbar { display: none; }
    .bt-nav-vertical a.bt-nav-sub { display: none; }
    .bt-nav-vertical a {
        flex: 0 0 auto;
        min-width: 64px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        text-align: center;
        padding: 6px 8px;
        border-radius: 12px;
        scroll-snap-align: start;
    }
    .bt-nav-vertical .bt-nav-icon { margin-right: 0; width: auto; height: auto; font-size: 18px; }
    .bt-nav-vertical .bt-nav-label { font-size: 9.5px; font-weight: 700; line-height: 1; white-space: nowrap; }
    .bt-nav-vertical .bt-nav-label-full { display: none; }
    .bt-nav-vertical .bt-nav-label-short { display: block; }
    .bt-nav-vertical .bt-badge-free { display: none; }
    .bt-nav-vertical .bt-badge-action {
        position: absolute;
        top: 2px;
        right: 6px;
        margin-left: 0;
    }
    .bt-nav-vertical a { position: relative; }
    .bt-nav-vertical a.active { background: var(--bt-side-active-bg); }
    .bt-nav-bottom { margin-top: 0 !important; border-top: none !important; padding-top: 6px !important; border-radius: 12px !important; }

    .bt-stats-grid { grid-template-columns: repeat(2, 1fr); }

    .bt-floor-card .bt-floor-actions { margin-left: 0; width: 100%; text-align: left; }

    .bt-chat-widget { bottom: 92px; right: 12px; }
    .bt-chat-panel { width: calc(100vw - 24px); height: 60vh; }
}

/* ── Floating live chat widget ──────────────────────────── */
.bt-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    font-family: inherit;
}
.bt-chat-toggle {
    position: relative;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: var(--bt-primary);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    box-shadow: var(--bt-shadow);
}
.bt-chat-toggle:hover { background: var(--bt-primary-dark); }
.bt-chat-badge {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--bt-red);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}
.bt-chat-panel[hidden] { display: none; }
.bt-chat-panel {
    position: absolute;
    bottom: 64px;
    right: 0;
    width: 320px;
    height: 420px;
    max-height: 70vh;
    background: var(--bt-bg2);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    box-shadow: var(--bt-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.bt-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bt-primary);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
}
.bt-chat-close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
}
.bt-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bt-chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.bt-chat-msg-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bt-bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    overflow: hidden;
}
.bt-chat-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bt-chat-msg-body { min-width: 0; }
.bt-chat-msg-meta {
    font-size: 11px;
    color: var(--bt-muted);
    margin-bottom: 2px;
}
.bt-chat-msg-meta strong { color: var(--bt-text); }
.bt-chat-msg-text {
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    background: var(--bt-bg3);
    border-radius: var(--bt-radius-sm);
    padding: 6px 10px;
    display: inline-block;
}
.bt-chat-msg-mine .bt-chat-msg-text { background: var(--bt-primary-light); }
.bt-chat-input-row {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--bt-border);
}
.bt-chat-input {
    flex: 1;
    border: 1px solid var(--bt-border-lit);
    border-radius: var(--bt-radius-sm);
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
}
.bt-chat-send {
    border: none;
    border-radius: var(--bt-radius-sm);
    background: var(--bt-primary);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 14px;
    cursor: pointer;
}
.bt-chat-send:hover { background: var(--bt-primary-dark); }

/* ── Building purchase offers ───────────────────────────── */
.bt-offer-box { font-size: 12.5px; }
.bt-offer-status { margin-bottom: 6px; }
.bt-offer-form { display: flex; gap: 6px; }
.bt-offer-input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--bt-border-lit);
    border-radius: var(--bt-radius-sm);
    padding: 5px 8px;
    font-size: 12.5px;
    font-family: inherit;
}
.bt-offer-submit {
    border: none;
    border-radius: var(--bt-radius-sm);
    background: var(--bt-primary);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
    white-space: nowrap;
}
.bt-offer-submit:hover { background: var(--bt-primary-dark); }
.bt-offer-submit:disabled { opacity: .6; cursor: not-allowed; }
.bt-offer-result { margin-top: 6px; font-size: 12px; }

.bt-war-popup-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.bt-war-popup-btn {
    display: inline-block;
    background: var(--bt-bg3);
    color: var(--bt-text);
    border: 1px solid var(--bt-border-lit);
    border-radius: var(--bt-radius-sm);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    text-decoration: none;
}
.bt-war-popup-btn:hover { background: var(--bt-primary-light); text-decoration: none; }
.bt-locked { color: var(--bt-muted); font-weight: 600; }

.bt-offer-row {
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-sm);
    padding: 8px 10px;
    margin-bottom: 8px;
}
.bt-offer-row:last-child { margin-bottom: 0; }
.bt-offer-row-meta { margin-bottom: 6px; font-size: 13px; }
.bt-offer-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bt-offer-actions form { display: flex; gap: 6px; align-items: center; }
.bt-offer-actions .bt-input { width: 140px; }

/* ── Auctions ────────────────────────────────────────────── */
.bt-auction-row {
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-sm);
    padding: 10px 12px;
    margin-bottom: 10px;
}
.bt-auction-row:last-child { margin-bottom: 0; }
.bt-auction-row h3 { margin: 0 0 6px; font-size: 14px; }
.bt-auction-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}
.bt-auction-badge-forced { background: var(--bt-red-light); color: #c0392b; }
.bt-auction-badge-player { background: var(--bt-primary-light); color: var(--bt-primary-dark); }
.bt-auction-badge-sale { background: var(--bt-green-light); color: var(--bt-green); }
.bt-auction-countdown { font-weight: 700; }
.bt-auction-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.bt-auction-form .bt-input { padding: 6px 8px; font-size: 12px; }
.bt-auction-form .bt-auction-price { width: 100%; }
.bt-auction-form-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bt-auction-form-row .bt-input { width: 100px; }

/* ── Modal overlay (e.g. lottery history, shown over the map) ─ */
.bt-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.bt-modal-overlay[hidden] { display: none; }
.bt-modal {
    background: var(--bt-bg2);
    border-radius: var(--bt-radius);
    box-shadow: var(--bt-shadow);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.bt-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bt-border);
    background: var(--bt-bg3);
}
.bt-modal-header h2 { margin: 0; font-size: 16px; }
.bt-modal-close {
    border: none;
    background: var(--bt-bg2);
    color: var(--bt-text);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid var(--bt-border);
}
.bt-modal-close:hover { background: var(--bt-red-light); color: #c0392b; border-color: var(--bt-red-light); }
.bt-modal-body {
    padding: 12px 16px;
    overflow-y: auto;
}
.bt-modal-body .bt-card-compact:last-child { margin-bottom: 0; }
.bt-modal-body .bt-table { font-size: 10px; min-width: 0; }
.bt-modal-body .bt-table th, .bt-modal-body .bt-table td { padding: 4px 6px; white-space: normal; }
.bt-modal-body .bt-table th { font-size: 9px; }
.bt-modal-body .bt-table td:nth-child(2) { white-space: nowrap; }

@media (max-width: 600px) {
    .bt-modal-overlay { padding: 0; align-items: stretch; }
    .bt-modal { max-width: none; width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
    .bt-modal-body .bt-table { font-size: 9.5px; }
    .bt-modal-body .bt-table th { font-size: 8.5px; }
    .bt-modal-body .bt-table th, .bt-modal-body .bt-table td { padding: 4px 5px; }
}

.bt-map-wrap.bt-map-hidden { display: none !important; }

@media (max-width: 900px) {
    .bt-map-wrap.bt-map-hidden-mobile { display: none; }
}
