/* Battle for Lebanon — frontend styles. Scoped under .bfl-app-root so it
   never leaks into the rest of the WordPress theme. */

.bfl-app-root{
  --parchment:#F1E9D8; --parchment-dark:#E5D8BC; --parchment-line:#D8C9A6;
  --ink:#2B2620; --ink-soft:#6b6255;
  --cedar:#2F5233; --cedar-dark:#1f3823;
  --flagred:#A8322D; --gold:#C79A3E; --gold-bright:#dfae56;
  --stone:#B9AE95; --teal:#3E7C7C; --plum:#6B4C6B; --ochre:#8a6b2b; --slate:#51606B;
  --on-accent:#F5EFE0;
  --radius-s:6px; --radius-m:12px; --radius-l:20px;

  /* map geography colours — stay constant across UI themes, like a real map */
  --bfl-ocean-a:#6FC6EA; --bfl-ocean-b:#296E9C;
  --bfl-title-scale:1; --bfl-text-scale:1; --bfl-muni-title-scale:1;
  --bfl-font-heading:'Fraunces', serif; --bfl-font-body:'Inter', sans-serif; --bfl-font-mono:'JetBrains Mono', monospace;
  --bfl-land:#9BCB74; --bfl-land-deep:#83B75E; --bfl-land-line:#D9A63E;

  box-sizing:border-box; font-family:var(--bfl-font-body); color:var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(199,154,62,0.12), transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(47,82,51,0.12), transparent 45%),
    repeating-linear-gradient(135deg, rgba(0,0,0,0.015) 0 2px, transparent 2px 26px),
    var(--parchment);
  min-height:100dvh; display:flex; flex-direction:column; overflow:hidden;
  position:relative;
}
.bfl-app-root.bfl-fullscreen{ position:fixed; inset:0; z-index:99999; height:100dvh; }
.bfl-app-root *{ box-sizing:border-box; min-width:0; }
.bfl-app-root h1,.bfl-app-root h2,.bfl-app-root h3{ font-family:var(--bfl-font-heading); margin:0; }
.bfl-app-root .mono{ font-family:var(--bfl-font-mono); }
.bfl-app-root p, .bfl-app-root span, .bfl-app-root div{ overflow-wrap:anywhere; }
.bfl-app-root button, .bfl-app-root input, .bfl-app-root textarea{ overflow-wrap:normal; }

.bfl-app-root[data-theme="midnight"]{
  --bfl-ocean-a:#123049; --bfl-ocean-b:#03080F;
  --parchment:#161C19; --parchment-dark:#1E2622; --parchment-line:#33403A;
  --ink:#EDE8DA; --ink-soft:#A6AFA6;
  --cedar:#4C9A5C; --cedar-dark:#0F1613;
  --flagred:#E2685D; --gold:#E7BD66; --gold-bright:#F4D48A;
  --stone:#6C776D; --teal:#5FC2BA; --plum:#C093C0; --ochre:#D9AC59; --slate:#8FA0AC;
  --on-accent:#F5EFE0;
}
.bfl-app-root[data-theme="mediterranean"]{
  --parchment:#F3F7F8; --parchment-dark:#E3EEF0; --parchment-line:#C9DEE2;
  --ink:#173A45; --ink-soft:#54747D;
  --cedar:#1E7A73; --cedar-dark:#0F3A3E;
  --flagred:#C4453B; --gold:#E0A63E; --gold-bright:#F0C468;
  --stone:#9FBAC0; --teal:#2D8FA6; --plum:#7C6A9E; --ochre:#B7862E; --slate:#4E6E88;
  --on-accent:#F3F7F8;
}
.bfl-app-root[data-theme="sunset"]{
  --parchment:#FBEFE4; --parchment-dark:#F3DCC7; --parchment-line:#E4BE9C;
  --ink:#3B2418; --ink-soft:#83604A;
  --cedar:#B0562F; --cedar-dark:#5B2A18;
  --flagred:#9C2B4E; --gold:#D98F2B; --gold-bright:#EAAE4E;
  --stone:#C99E76; --teal:#4C7A82; --plum:#8A4368; --ochre:#A8672B; --slate:#6E5062;
  --on-accent:#FBEFE4;
}
.bfl-app-root[data-theme="obsidian"]{
  --bfl-ocean-a:#123049; --bfl-ocean-b:#03080F;
  --parchment:#0E0F10; --parchment-dark:#17191A; --parchment-line:#2A2D2E;
  --ink:#EDEDEA; --ink-soft:#9BA1A0;
  --cedar:#3FA35A; --cedar-dark:#07100B;
  --flagred:#E2544A; --gold:#D9B054; --gold-bright:#EFCB7C;
  --stone:#5B6060; --teal:#4FB4B0; --plum:#B48CC7; --ochre:#CDA24F; --slate:#7C8A96;
  --on-accent:#F2F2EE;
}
.bfl-app-root[data-theme="bloodmoon"]{
  --bfl-ocean-a:#123049; --bfl-ocean-b:#03080F;
  --parchment:#170E0D; --parchment-dark:#211413; --parchment-line:#3A2320;
  --ink:#F2E4DE; --ink-soft:#B08A83;
  --cedar:#6E8F55; --cedar-dark:#120B0A;
  --flagred:#E1483A; --gold:#D98A3E; --gold-bright:#F0AE63;
  --stone:#5C3E3A; --teal:#4C8E86; --plum:#9C4E72; --ochre:#C97A34; --slate:#75585A;
  --on-accent:#F5EAE3;
}
.bfl-app-root[data-theme="deepbekaa"]{
  --bfl-ocean-a:#123049; --bfl-ocean-b:#03080F;
  --parchment:#12121C; --parchment-dark:#1B1B29; --parchment-line:#33334A;
  --ink:#E7E4F2; --ink-soft:#9C97B8;
  --cedar:#4F8F6E; --cedar-dark:#0B0B14;
  --flagred:#D65E6E; --gold:#D3A65E; --gold-bright:#E9C583;
  --stone:#4B4A66; --teal:#5A9BC4; --plum:#A97FD1; --ochre:#C79459; --slate:#6E71A0;
  --on-accent:#EDEBF7;
}

/* ---------- Glassmorphism utility (Leonida-style floating panels) ---------- */
.bfl-glass{
  background: color-mix(in srgb, var(--parchment-dark) 72%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border:1px solid color-mix(in srgb, var(--parchment-line) 70%, transparent);
  box-shadow:0 14px 34px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.06);
}
.bfl-app-root[data-theme="cedar"] .bfl-glass,
.bfl-app-root[data-theme="mediterranean"] .bfl-glass,
.bfl-app-root[data-theme="sunset"] .bfl-glass{
  box-shadow:0 14px 34px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* ---------- Header ---------- */
.bfl-hdr{ flex:none; display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px 16px; margin:12px 12px 0; border-radius:18px; flex-wrap:wrap; position:relative; z-index:2000; }
.bfl-hdr__brand{ display:flex; align-items:center; gap:10px; min-width:0; flex:1 1 auto; overflow:hidden; }
.bfl-hdr__brand > div{ min-width:0; overflow:hidden; }
.bfl-hdr__mark{ width:36px; height:36px; border-radius:50%; background:linear-gradient(150deg, var(--gold-bright), var(--gold)); color:var(--cedar-dark);
  display:flex; align-items:center; justify-content:center; font-size:17px; flex:none;
  box-shadow:0 0 0 3px rgba(199,154,62,0.22), 0 0 14px rgba(199,154,62,0.4); }
.bfl-hdr__title{ color:var(--ink); font-size:calc(16px * var(--bfl-title-scale)); letter-spacing:0.07em; font-weight:700;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:100%; }
.bfl-hdr__tag{ margin:1px 0 0; color:var(--ink-soft); font-size:11px; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; max-width:100%; }
@media (max-width:520px){ .bfl-hdr__tag{ display:none; } }
.bfl-hdr__nav{ display:flex; gap:4px; background:rgba(0,0,0,0.12); padding:4px; border-radius:999px; }
.bfl-navlink{ background:none; border:none; color:var(--ink-soft); font-size:13px; padding:7px 14px;
  border-radius:999px; cursor:pointer; font-weight:600; white-space:nowrap; transition:background .15s ease, color .15s ease; }
.bfl-navlink--active{ background:var(--gold); color:var(--cedar-dark); box-shadow:0 2px 10px rgba(199,154,62,0.4); }
.bfl-hdr__actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.bfl-wallet{ display:flex; align-items:center; gap:6px; background:rgba(0,0,0,0.12);
  border:1px solid color-mix(in srgb, var(--parchment-line) 60%, transparent); color:var(--ink); padding:7px 12px; border-radius:999px; font-size:12.5px; font-weight:600; white-space:nowrap; }
.bfl-wallet .mono{ font-size:13px; color:var(--gold-bright); }
.bfl-icon-btn{ width:34px; height:34px; border-radius:50%; border:1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  background:color-mix(in srgb, var(--ink) 8%, transparent); color:var(--ink); font-size:15px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; flex:none; position:relative;
  transition:background .15s ease, transform .15s ease; }
.bfl-icon-btn:hover{ background:color-mix(in srgb, var(--ink) 16%, transparent); transform:translateY(-1px) rotate(-4deg); }

.bfl-btn{ font-weight:700; font-size:13px; border-radius:999px; border:none; padding:8px 15px; cursor:pointer;
  transition:transform .14s ease, filter .14s ease, box-shadow .14s ease; white-space:nowrap; position:relative; }
.bfl-btn:hover{ filter:brightness(1.08); transform:translateY(-1px); }
.bfl-btn:active{ transform:translateY(0) scale(0.97); }
.bfl-btn--gold{ background:linear-gradient(180deg, var(--gold-bright), var(--gold)); color:var(--cedar-dark);
  box-shadow:0 3px 0 rgba(0,0,0,0.15), 0 6px 16px rgba(199,154,62,0.35); overflow:hidden; }
.bfl-btn--gold::after{ content:''; position:absolute; inset:0; background:linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.55) 50%, transparent 60%);
  background-size:220% 100%; background-position:120% 0; transition:background-position .6s ease; pointer-events:none; }
.bfl-btn--gold:hover::after{ background-position:-20% 0; }
.bfl-btn--cedar{ background:var(--cedar);
  background:linear-gradient(180deg, color-mix(in srgb, var(--cedar) 115%, white), var(--cedar)); color:var(--on-accent);
  box-shadow:0 3px 0 rgba(0,0,0,0.18), 0 6px 14px rgba(47,82,51,0.3); }
.bfl-btn--danger{ background:var(--flagred); color:var(--on-accent); box-shadow:0 3px 0 rgba(0,0,0,0.18); }
.bfl-btn--ghost{ background:transparent; border:1.5px solid var(--stone); color:var(--ink-soft); }
.bfl-btn--ghost:hover{ border-color:var(--ink-soft); transform:translateY(-1px); }
.bfl-btn--small{ padding:6px 11px; font-size:11.5px; }
.bfl-btn--full{ width:100%; }
.bfl-btn[disabled]{ opacity:0.4; cursor:not-allowed; transform:none !important; box-shadow:none !important; }

.bfl-popover{ position:absolute; top:calc(100% + 8px); right:0; border-radius:var(--radius-m); padding:10px;
  display:none; z-index:2100; min-width:180px; }
.bfl-popover.is-open{ display:block; }
.bfl-theme-opt{ display:flex; align-items:center; gap:9px; padding:8px 9px; border-radius:var(--radius-s);
  cursor:pointer; font-size:12.5px; font-weight:600; color:var(--ink); }
.bfl-theme-opt:hover{ background:color-mix(in srgb, var(--ink) 8%, transparent); }
.bfl-theme-opt.is-active{ background:color-mix(in srgb, var(--gold) 20%, transparent); }
.bfl-theme-swatch{ width:20px; height:20px; border-radius:50%; flex:none; border:1.5px solid rgba(0,0,0,0.15); }
.bfl-popover-divider{ height:1px; background:var(--parchment-line); margin:6px 2px; }

/* ---------- Main shell: full-bleed map with floating glass panels ---------- */
.bfl-main{ flex:1; position:relative; overflow:hidden; margin:12px; border-radius:20px; min-height:0; }

#bfl-map{ position:absolute; inset:0; border-radius:20px;
  background:
    radial-gradient(ellipse at 32% 25%, rgba(255,255,255,0.16) 0%, transparent 30%),
    radial-gradient(ellipse at 32% 25%, transparent 45%, rgba(0,0,0,0.14) 100%),
    radial-gradient(ellipse at 32% 25%, var(--bfl-ocean-a), var(--bfl-ocean-b) 75%); }

/* bottom-left floating card: sector title, breadcrumb, legend — collapsible */
.bfl-map-info{ position:absolute; bottom:14px; left:14px; z-index:300; max-width:360px; width:calc(100% - 28px);
  border-radius:16px; display:flex; flex-direction:column; }
.bfl-map-info.bfl-attention{ animation:bflPanelAttention 1.5s ease; }
@keyframes bflPanelAttention{
  0%{ box-shadow:0 0 0 0 rgba(199,154,62,0); transform:scale(1); }
  15%{ box-shadow:0 0 0 6px rgba(199,154,62,0.5); transform:scale(1.02); }
  40%{ box-shadow:0 0 0 2px rgba(199,154,62,0.3); transform:scale(1); }
  70%{ box-shadow:0 0 0 6px rgba(199,154,62,0.35); }
  100%{ box-shadow:0 0 0 0 rgba(199,154,62,0); }
}
.bfl-map-info__toggle{ display:flex; align-items:center; gap:10px; padding:12px 14px; cursor:pointer; background:none; border:none;
  width:100%; text-align:left; color:var(--ink); font-family:inherit; }
.bfl-map-info__toggle-icon{ width:26px; height:26px; border-radius:50%; background:var(--gold); color:var(--cedar-dark);
  display:flex; align-items:center; justify-content:center; flex:none; font-size:13px; }
.bfl-map-info__toggle-title{ font-size:calc(13.5px * var(--bfl-title-scale)); font-weight:700; flex:1; min-width:0; }
.bfl-map-info__chevron{ color:var(--ink-soft); font-size:11px; transition:transform .2s ease; flex:none; }
.bfl-map-info.is-collapsed .bfl-map-info__chevron{ transform:rotate(180deg); }
.bfl-map-info__body{ padding:0 16px 14px; display:flex; flex-direction:column; gap:8px; overflow:hidden;
  max-height:400px; transition:max-height .25s ease, opacity .2s ease; opacity:1; }
.bfl-map-info.is-collapsed .bfl-map-info__body{ max-height:0; opacity:0; padding-top:0; padding-bottom:0; }
.bfl-map-panel__head{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; flex-wrap:wrap; flex:none; }
.bfl-map-panel__head h2{ font-size:15px; font-weight:600; }
.bfl-legend-text{ margin:2px 0 0; color:var(--ink-soft); font-size:calc(11.5px * var(--bfl-text-scale)); }
.bfl-map-hint{ font-size:10px; color:var(--ink-soft); font-weight:600; opacity:0.8; }
@media (max-width:640px){ .bfl-map-hint{ display:none; } }
@media (max-width:640px){ .bfl-map-panel__head h2{ font-size:14px; } .bfl-legend-text{ font-size:11px; } }
.bfl-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex:none; flex-wrap:wrap; }
.bfl-breadcrumb{ font-size:calc(12.5px * var(--bfl-text-scale)); font-weight:700; color:var(--ink-soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.bfl-breadcrumb b{ color:var(--ink); }
.bfl-back-btn{ display:none; } .bfl-back-btn.is-visible{ display:inline-flex; align-items:center; gap:6px; }

.bfl-app-root .leaflet-container{ background:transparent; font-family:var(--bfl-font-body); }
.bfl-app-root .leaflet-control-zoom a{ background:var(--parchment-dark) !important; color:var(--ink) !important; border-color:var(--parchment-line) !important; }
.bfl-app-root .leaflet-control-zoom a:hover{ background:var(--gold) !important; }
.bfl-app-root .leaflet-control-attribution{ background:rgba(241,233,216,0.85) !important; font-size:9px !important; color:var(--ink-soft) !important; }
.bfl-muni-label{ background:transparent !important; color:#fff !important; border:none !important;
  box-shadow:none !important; padding:0 !important; pointer-events:none; opacity:0.85; transition:opacity .2s ease; }
.bfl-label-scale{ display:inline-flex; align-items:center; gap:4px; transform-origin:center;
  transition:transform .16s cubic-bezier(.2,.8,.2,1); will-change:transform;
  background:rgba(20,17,12,0.78); border:1px solid rgba(255,255,255,0.15);
  font-size:11px; font-weight:600; padding:3px 7px; border-radius:5px;
  box-shadow:0 2px 6px rgba(0,0,0,0.35); letter-spacing:0.01em; white-space:nowrap; }
.bfl-muni-label__flag{ display:inline-flex; align-items:center; line-height:1; }
.bfl-muni-label::before{ display:none !important; }
.bfl-muni-label--selected{ opacity:1 !important; z-index:9999 !important; }
.bfl-muni-label--selected .bfl-label-scale{ background:var(--gold); color:var(--cedar-dark);
  font-size:12.5px; font-weight:800; padding:5px 12px;
  box-shadow:0 0 0 3px rgba(255,255,255,0.65), 0 4px 16px rgba(0,0,0,0.4); }

.bfl-territory{ cursor:pointer; transition:filter .15s ease; }
.bfl-territory:hover{ filter:brightness(1.1) drop-shadow(0 0 6px rgba(199,154,62,0.45)); }
.bfl-territory--dimmed{ transition:fill-opacity .25s ease; }
.bfl-territory--unclaimed{ filter:drop-shadow(0 0 1.5px rgba(255,255,255,0.55)); }
.bfl-territory--unclaimed:hover{ filter:drop-shadow(0 0 1.5px rgba(255,255,255,0.55)) brightness(1.1) drop-shadow(0 0 6px rgba(255,255,255,0.5)); }
.bfl-territory--contested{ animation:bflPulse 2.2s ease-in-out infinite; }
@keyframes bflPulse{ 0%,100%{ fill-opacity:0.45; } 50%{ fill-opacity:0.68; } }
.bfl-territory--selected{ animation:bflSelectGlow 1.6s ease-in-out infinite; }
@keyframes bflSelectGlow{
  0%,100%{ filter:drop-shadow(0 0 6px rgba(255,255,255,1)) drop-shadow(0 0 20px rgba(255,255,255,0.7)) drop-shadow(0 0 38px rgba(255,255,255,0.4)); }
  50%{ filter:drop-shadow(0 0 14px rgba(255,255,255,1)) drop-shadow(0 0 34px rgba(255,255,255,0.9)) drop-shadow(0 0 56px rgba(255,255,255,0.55)); }
}

.bfl-sector-marker{ display:flex; flex-direction:column; align-items:center; transform:translate(-50%,-50%); transition:opacity .25s ease; }
.bfl-marker-scale{ display:flex; flex-direction:column; align-items:center; transform-origin:center;
  transition:transform .18s cubic-bezier(.2,.8,.2,1); will-change:transform; }
.bfl-sector-marker.is-dimmed{ opacity:0.5; }
.bfl-sector-marker.is-current{ display:none; }
.bfl-flag-badge__name{ margin-top:2px; font-size:10px; font-weight:700; color:#fff; text-shadow:0 1px 3px rgba(0,0,0,0.7);
  background:rgba(0,0,0,0.35); padding:1px 6px; border-radius:5px; white-space:nowrap; }
.bfl-flag-badge__lead-icon{ font-size:15px; line-height:1; display:inline-flex; align-items:center; vertical-align:-3px; }
.bfl-flag-badge__lead-icon .bfl-flagicon{ width:18px; height:18px; }

/* leading-sector pin: the flag is the whole point, so it's the visual centre.
   The circular crop lives on the inner __flag element only — the outer pin
   stays overflow-visible so the count badge and crown can sit outside the
   circle without being clipped. */
.bfl-lead-pin{ position:relative; width:40px; height:40px; }
.bfl-lead-pin__flag{ width:100%; height:100%; border-radius:50%; background:var(--lead-color, #2F5233);
  display:flex; align-items:center; justify-content:center; font-size:21px; line-height:1; overflow:hidden;
  border:3px solid rgba(255,255,255,0.9); box-sizing:border-box;
  box-shadow:0 5px 16px rgba(0,0,0,0.4), 0 0 0 5px color-mix(in srgb, var(--lead-color, #2F5233) 30%, transparent); }
.bfl-lead-pin__flag .bfl-flagicon{ width:100% !important; height:100% !important; border-radius:0 !important; box-shadow:none !important; }
.bfl-lead-pin__count{ position:absolute; bottom:-7px; right:-9px; background:#1a1610; color:#ffffff; font-size:10px; font-weight:800;
  padding:2px 7px; border-radius:999px; border:1.5px solid rgba(255,255,255,0.85); white-space:nowrap; }
.bfl-lead-pin__crown{ position:absolute; top:-15px; left:50%; transform:translateX(-50%); font-size:17px;
  filter:drop-shadow(0 2px 3px rgba(0,0,0,0.45)); }

.bfl-flag-badge{ display:flex; align-items:center; justify-content:center; gap:3px; font-size:11px; font-weight:700;
  padding:2px 7px; border-radius:999px; white-space:nowrap; border:1.5px solid rgba(255,255,255,0.75);
  box-shadow:0 2px 6px rgba(0,0,0,0.3); transform-origin:center;
  animation:bflBadgePop .32s cubic-bezier(.34,1.56,.64,1); animation-fill-mode:forwards; }
@keyframes bflBadgePop{ 0%{ transform:scale(0.5); opacity:0; } 100%{ transform:scale(1); opacity:1; } }
.bfl-flag-badge--unclaimed{ background:var(--parchment); color:var(--ink-soft); border:1.5px dashed var(--gold); }
.bfl-flag-badge--contested{ background:var(--flagred); color:#fff; }
.bfl-flag-badge--crown{ box-shadow:0 0 0 3px rgba(199,154,62,0.6), 0 0 14px rgba(199,154,62,0.55), 0 2px 6px rgba(0,0,0,0.3); }
.bfl-flagicon{ display:inline-block; width:16px; height:16px; border-radius:5px; background-size:cover; background-position:center;
  background-color:rgba(255,255,255,0.9); vertical-align:-3px; box-shadow:0 0 0 1px rgba(255,255,255,0.35), 0 1px 3px rgba(0,0,0,0.35); flex:none; }

.bfl-legend-strip{ display:flex; gap:8px 12px; flex:none; overflow-x:auto; padding-top:6px; border-top:1px solid color-mix(in srgb, var(--parchment-line) 70%, transparent); }
.bfl-legend-item{ display:flex; align-items:center; gap:5px; font-size:11px; color:var(--ink-soft); font-weight:600; white-space:nowrap; flex:none; }
.bfl-legend-dot{ width:9px; height:9px; border-radius:3px; flex:none; }

.bfl-avatar-img{ border-radius:50% !important; background-size:cover !important; background-position:center !important;
  background-repeat:no-repeat !important; box-shadow:inset 0 0 0 2px rgba(0,0,0,0.08); display:inline-block; }
.bfl-avatar-emoji{ border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; flex:none; }

/* ---------- Side panel: floating glass column on desktop ---------- */
.bfl-side{
  position:absolute; top:14px; right:14px; bottom:14px; width:360px; z-index:400;
  overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:14px;
  border-radius:18px;
}
.bfl-side .bfl-card{ background:transparent; border:1px solid color-mix(in srgb, var(--parchment-line) 60%, transparent); box-shadow:none; }
.bfl-side .bfl-card::before{ display:none; }

.bfl-sheet-handle{ display:none; }

@media (max-width:900px){
  .bfl-main{ margin:8px; border-radius:16px; }
  .bfl-map-info{ bottom:78px; }
  .bfl-side{
    top:auto; left:0; right:0; bottom:0; width:100%; border-radius:18px 18px 0 0;
    max-height:64px; overflow:hidden; -webkit-overflow-scrolling:touch;
    transition:max-height .3s cubic-bezier(.2,.8,.2,1);
    padding:0 12px 14px; gap:10px;
  }
  .bfl-side.is-expanded{ max-height:76vh; overflow-y:auto; }
  .bfl-sheet-handle{
    display:flex; align-items:center; justify-content:space-between; gap:8px;
    position:sticky; top:0; cursor:pointer;
    padding:10px 2px 8px; margin:0 -12px; padding-left:12px; padding-right:12px;
    border-radius:18px 18px 0 0; z-index:1; backdrop-filter:blur(18px);
  }
  .bfl-sheet-handle__bar{ position:absolute; left:50%; top:6px; transform:translateX(-50%); width:36px; height:4px; border-radius:999px; background:var(--stone); opacity:0.6; }
  .bfl-sheet-handle__label{ font-size:12.5px; font-weight:700; color:var(--ink); margin-top:8px; display:flex; align-items:center; gap:6px; }
  .bfl-sheet-handle__chevron{ margin-top:8px; color:var(--ink-soft); font-size:12px; transition:transform .25s ease; }
  .bfl-side.is-expanded .bfl-sheet-handle__chevron{ transform:rotate(180deg); }
  .bfl-map-info{ max-width:calc(100% - 28px); }
}
.bfl-card{ background:color-mix(in srgb, var(--parchment-dark) 55%, transparent); border:1px solid color-mix(in srgb, var(--parchment-line) 55%, transparent); border-radius:var(--radius-l);
  padding:16px 18px; position:relative; overflow:hidden; box-shadow:0 1px 0 rgba(255,255,255,0.15) inset; }
.bfl-card::before{ content:''; position:absolute; top:0; left:16px; right:16px; height:2px;
  background:linear-gradient(90deg, transparent, var(--gold), transparent); opacity:0.6; }
.bfl-card h3{ font-size:calc(14.5px * var(--bfl-title-scale)); font-weight:600; letter-spacing:0.01em; }

.bfl-profiles-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.bfl-profile-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.bfl-chip-wrap{ display:flex; align-items:center; gap:2px; background:var(--parchment); border-radius:999px; border:2px solid transparent; padding:2px; transition:box-shadow .15s ease, border-color .15s ease; }
.bfl-chip-wrap.is-active{ border-color:var(--gold); box-shadow:0 0 0 3px rgba(199,154,62,0.2); }
.bfl-chip{ display:flex; align-items:center; gap:6px; padding:3px 8px 3px 3px; border-radius:999px; background:none; border:none; cursor:pointer; font-size:12px; font-weight:700; color:var(--ink); max-width:180px; }
.bfl-chip-name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bfl-chip-members{ font-size:9px; font-weight:700; background:var(--cedar-dark); color:var(--gold-bright); padding:1px 6px; border-radius:999px; margin-left:2px; }
.bfl-chip-edit{ width:20px; height:20px; border-radius:50%; border:none; background:rgba(0,0,0,0.07); cursor:pointer; font-size:10px;
  display:flex; align-items:center; justify-content:center; color:var(--ink-soft); flex:none; margin-right:2px; }
.bfl-chip-edit:hover{ background:rgba(0,0,0,0.14); color:var(--ink); }

.bfl-detail{ min-height:180px; }
.bfl-empty{ color:var(--ink-soft); font-size:calc(13px * var(--bfl-text-scale)); padding:8px 0 4px; line-height:1.5; }
.bfl-back-link{ background:none; border:none; color:var(--teal); font-size:11px; font-weight:700; cursor:pointer; padding:0 0 8px; }
.bfl-detail-head{ display:flex; align-items:baseline; justify-content:space-between; gap:8px; margin-bottom:2px; }
.bfl-detail-region{ font-size:calc(10.5px * var(--bfl-text-scale)); color:var(--ink-soft); font-weight:600; text-transform:uppercase; letter-spacing:0.05em; margin-bottom:12px; overflow-wrap:break-word; }
.bfl-detail-head{ min-width:0; }
.bfl-detail-head h3{ overflow-wrap:break-word; font-size:calc(1.7em * var(--bfl-muni-title-scale, 1)); line-height:1.1; }
.bfl-status{ display:inline-block; font-size:10px; font-weight:700; padding:3px 9px; border-radius:999px; margin-bottom:12px; }
.bfl-status--unclaimed{ background:rgba(199,154,62,0.18); color:var(--ochre); }
.bfl-status--contested{ background:rgba(168,50,45,0.14); color:var(--flagred); }
.bfl-status--held{ background:rgba(47,82,51,0.14); color:var(--cedar); }
.bfl-status--crown{ background:rgba(199,154,62,0.22); color:var(--ochre); }

.bfl-progress-track{ height:7px; border-radius:999px; background:var(--parchment); border:1px solid var(--parchment-line); overflow:hidden; margin:3px 0 10px; }
.bfl-progress-fill{ height:100%; border-radius:999px; transition:width .4s cubic-bezier(.2,.8,.2,1); box-shadow:0 0 8px rgba(0,0,0,0.15) inset; }
.bfl-progress-label{ font-size:10.5px; color:var(--ink-soft); font-weight:600; margin-bottom:3px; }

.bfl-owner-row{ display:flex; align-items:center; gap:10px; padding:7px 0; border-top:1px solid var(--parchment-line); }
.bfl-owner-row:first-of-type{ border-top:none; }
.bfl-owner-row > div:not(.bfl-owner-flags){ min-width:0; flex:1; }
.bfl-owner-name{ font-size:13px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bfl-owner-flags{ margin-left:auto; font-size:12.5px; font-weight:700; flex:none; white-space:nowrap; }
.bfl-owner-bio{ font-size:calc(11px * var(--bfl-text-scale)); color:var(--ink-soft); margin:1px 0 0; }
.bfl-owner-link{ font-size:10.5px; color:var(--teal); text-decoration:none; font-weight:600; }

/* municipality owner card: square logo above the name/bio, more breathing room */
.bfl-owner-card{ padding:12px 0; border-top:1px solid var(--parchment-line); }
.bfl-owner-card:first-of-type{ border-top:none; }
.bfl-owner-card__media{ display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.bfl-owner-card__count{ font-size:12px; font-weight:700; color:var(--ink); background:color-mix(in srgb, var(--ink) 8%, transparent);
  padding:4px 11px; border-radius:999px; white-space:nowrap; }
.bfl-owner-card .bfl-owner-name{ font-size:calc(14.5px * var(--bfl-title-scale)); margin-bottom:3px; white-space:normal; }
.bfl-owner-card .bfl-owner-bio{ font-size:calc(11.5px * var(--bfl-text-scale)); line-height:1.4; }
.bfl-owner-card .bfl-owner-link{ display:inline-block; margin-top:3px; }
.bfl-owner-sub{ font-size:10.5px; color:var(--ink-soft); }
.bfl-leading-tag{ color:var(--gold-bright); background:var(--cedar-dark); padding:1px 6px; border-radius:999px; font-size:9px; font-weight:700; box-shadow:0 0 8px rgba(199,154,62,0.4); }

.bfl-claim-box{ margin-top:14px; padding:14px; border-radius:14px;
  background:color-mix(in srgb, var(--ink) 5%, transparent); border:1px solid color-mix(in srgb, var(--parchment-line) 60%, transparent); }
.bfl-claim-label{ font-size:calc(11px * var(--bfl-text-scale)); color:var(--ink-soft); font-weight:600; margin-bottom:8px; display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.bfl-claim-label b{ display:inline-flex; align-items:center; gap:5px; font-size:12.5px; }
.bfl-claim-need{ font-size:11px; color:var(--flagred); font-weight:700; margin-bottom:8px; }
.bfl-stepper{ display:flex; align-items:center; gap:9px; margin-bottom:9px; }
.bfl-stepper button{ width:28px; height:28px; border-radius:50%; border:1.5px solid var(--stone); background:var(--parchment);
  font-size:16px; font-weight:700; cursor:pointer; color:var(--ink); padding:0; line-height:1;
  display:flex; align-items:center; justify-content:center; flex:none; transition:background .15s ease, transform .1s ease; }
.bfl-stepper button:hover:not(:disabled){ background:var(--parchment-line); }
.bfl-stepper button:active:not(:disabled){ transform:scale(0.92); }
.bfl-stepper__count{ font-size:15px; font-weight:700; width:22px; text-align:center; flex:none; }
.bfl-history-toggle{ background:none; border:none; color:var(--teal); font-size:11.5px; font-weight:700; cursor:pointer; padding:9px 0 0; }
.bfl-history-list{ list-style:none; margin:8px 0 0; padding:0; display:none; }
.bfl-history-list.is-open{ display:block; }
.bfl-history-list li{ font-size:11px; color:var(--ink-soft); padding:5px 0; border-top:1px solid var(--parchment-line); }
.bfl-history-list li b{ color:var(--ink); }

.bfl-muni-hint{ display:flex; align-items:center; gap:8px; margin-top:12px; padding-top:12px; border-top:1px dashed var(--parchment-line); font-size:11.5px; color:var(--ink-soft); font-weight:600; }

.bfl-activity-list{ list-style:none; margin:10px 0 0; padding:0; display:flex; flex-direction:column; gap:10px; }
.bfl-activity-list li{ display:flex; gap:8px; font-size:calc(12px * var(--bfl-text-scale)); align-items:flex-start; }
.bfl-activity-dot{ width:7px; height:7px; border-radius:50%; margin-top:5px; flex:none; background:var(--cedar); }
.bfl-activity-time{ display:block; color:var(--ink-soft); font-size:10px; margin-top:1px; }

/* ---------- Leaderboard ---------- */
.bfl-leaderboard{ flex:1; overflow-y:auto; padding:24px; display:none; margin:0 12px 12px; border-radius:20px; }
@media (max-width:900px){ .bfl-leaderboard{ margin:0 8px 8px; padding:18px 16px; } }
.bfl-lb-head{ max-width:760px; margin:0 auto 16px; }
.bfl-lb-head h2{ font-size:calc(20px * var(--bfl-title-scale)); }
.bfl-lb-head p{ color:var(--ink-soft); font-size:13px; margin:4px 0 0; }
.bfl-lb-points{ display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
.bfl-lb-point-chip{ background:var(--parchment-dark); border:1px solid var(--parchment-line); border-radius:999px; padding:6px 13px; font-size:11.5px; font-weight:600; color:var(--ink-soft); }
.bfl-lb-point-chip b{ color:var(--ink); }
.bfl-lb-table{ max-width:760px; margin:0 auto; display:flex; flex-direction:column; gap:8px; }
.bfl-lb-row{ display:flex; align-items:center; gap:12px; background:color-mix(in srgb, var(--parchment-dark) 55%, transparent); border:1px solid color-mix(in srgb, var(--parchment-line) 55%, transparent); border-radius:var(--radius-m); padding:12px 16px; flex-wrap:wrap; transition:transform .15s ease; }
.bfl-lb-row:hover{ transform:translateX(2px); }
.bfl-lb-rank{ font-weight:700; font-size:14px; color:var(--ink-soft); width:26px; flex:none; font-family:var(--bfl-font-mono); }
.bfl-lb-rank--1{ color:var(--gold); text-shadow:0 0 12px rgba(199,154,62,0.6); }
.bfl-lb-name{ font-weight:700; font-size:13.5px; flex:1 1 120px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bfl-lb-name small{ display:block; font-weight:500; color:var(--ink-soft); font-size:10.5px; }
.bfl-lb-stats{ display:flex; gap:14px; font-size:11px; color:var(--ink-soft); font-family:var(--bfl-font-mono); flex:none; }
.bfl-lb-score{ font-weight:700; font-size:15px; color:var(--cedar); font-family:var(--bfl-font-mono); flex:none; }
@media (max-width:480px){ .bfl-lb-stats{ order:3; width:100%; justify-content:flex-start; margin-top:4px; } }

/* ---------- Modals ---------- */
.bfl-modal-backdrop{ position:fixed; inset:0; background:rgba(20,17,12,0.55); display:none; align-items:center; justify-content:center; padding:16px; z-index:100000; }
.bfl-modal-backdrop.is-open{ display:flex; }
.bfl-modal{ background:var(--parchment); border-radius:var(--radius-l); padding:22px; max-width:460px; width:100%; border:1px solid var(--parchment-line);
  max-height:88vh; overflow-y:auto; color:var(--ink); box-shadow:0 24px 60px rgba(0,0,0,0.35); animation:bflModalIn .22s cubic-bezier(.2,.8,.2,1); }
@keyframes bflModalIn{ 0%{ transform:translateY(14px) scale(0.98); opacity:0; } 100%{ transform:translateY(0) scale(1); opacity:1; } }
.bfl-modal h3{ font-size:calc(17px * var(--bfl-title-scale)); margin-bottom:4px; }
.bfl-modal h4{ font-size:12.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-soft); margin:18px 0 8px; }
.bfl-modal .bfl-sub{ color:var(--ink-soft); font-size:12.5px; margin:0 0 16px; }
.bfl-pkg-list{ display:flex; flex-direction:column; gap:9px; margin-bottom:14px; }
.bfl-pkg{ display:flex; align-items:center; justify-content:space-between; border:1.5px solid var(--parchment-line); border-radius:var(--radius-m); padding:11px 13px; background:var(--parchment-dark); }
.bfl-pkg__note{ font-size:10.5px; color:var(--ink-soft); }
.bfl-field{ margin-bottom:11px; }
.bfl-field label{ display:block; font-size:11.5px; font-weight:700; color:var(--ink-soft); margin-bottom:5px; }
.bfl-field input, .bfl-field textarea{ width:100%; padding:8px 10px; border-radius:var(--radius-s); border:1.5px solid var(--parchment-line); font-size:13px; background:#fff; resize:vertical; color:var(--ink); }
.bfl-mode-toggle{ display:flex; gap:6px; margin-bottom:12px; background:var(--parchment-dark); padding:4px; border-radius:999px; }
.bfl-mode-toggle button{ flex:1; border:none; background:none; padding:8px 0; border-radius:999px; font-size:12px; font-weight:700;
  font-family:inherit; cursor:pointer; color:var(--ink-soft); line-height:1; display:flex; align-items:center; justify-content:center;
  text-align:center; }
.bfl-mode-toggle button.is-active{ background:var(--parchment); color:var(--ink); box-shadow:0 1px 4px rgba(0,0,0,0.12); }
.bfl-swatch-grid{ display:flex; gap:7px; flex-wrap:wrap; }
.bfl-swatch-grid button{ width:28px; height:28px; border-radius:50%; border:2px solid transparent; cursor:pointer; padding:0; }
.bfl-swatch-grid button.is-selected{ border-color:var(--ink); }
.bfl-custom-color-row{ display:flex; align-items:center; gap:9px; margin-top:8px; }
.bfl-custom-color-swatch{ position:relative; width:30px; height:30px; border-radius:50%; flex:none; cursor:pointer;
  border:2px solid var(--parchment-line); overflow:hidden; display:block; }
.bfl-custom-color-swatch input[type=color]{ position:absolute; top:-6px; left:-6px; width:calc(100% + 12px); height:calc(100% + 12px);
  border:none; padding:0; margin:0; cursor:pointer; opacity:0; }
.bfl-custom-color-row span{ font-size:11px; color:var(--ink-soft); font-weight:600; }
.bfl-emoji-pick{ display:flex; gap:7px; flex-wrap:wrap; }
.bfl-emoji-pick button{ width:32px; height:32px; border-radius:50%; border:2px solid var(--parchment-line); background:#fff; font-size:14px; cursor:pointer; }
.bfl-emoji-pick button.is-selected{ border-color:var(--ink); }
.bfl-upload-zone{ border:1.5px dashed var(--parchment-line); border-radius:var(--radius-m); padding:16px; text-align:center; background:var(--parchment-dark); cursor:pointer; }
.bfl-upload-zone p{ font-size:11.5px; color:var(--ink-soft); margin:6px 0 0; }
.bfl-upload-preview{ display:flex; align-items:center; gap:10px; margin-top:10px; }
.bfl-upload-preview img{ width:44px; height:44px; border-radius:50%; object-fit:cover; border:2px solid var(--parchment-line); }
.bfl-upload-error{ color:var(--flagred); font-size:11px; font-weight:600; margin-top:6px; }
.bfl-modal-actions{ display:flex; gap:9px; margin-top:6px; }
.bfl-modal-note{ font-size:10.5px; color:var(--ink-soft); margin-top:12px; line-height:1.5; }
.bfl-invite-box{ background:var(--parchment-dark); border:1px dashed var(--parchment-line); border-radius:var(--radius-m); padding:9px 12px; display:flex; align-items:center; gap:8px; margin-bottom:14px; }
.bfl-invite-box code{ flex:1; font-family:var(--bfl-font-mono); font-size:10.5px; color:var(--ink-soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bfl-member-row{ display:flex; align-items:center; gap:10px; padding:8px 0; border-top:1px solid var(--parchment-line); }
.bfl-member-row:first-of-type{ border-top:none; }
.bfl-member-avatar{ width:26px; height:26px; border-radius:50%; background:var(--parchment); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:var(--ink-soft); flex:none; }
.bfl-member-name{ font-size:12.5px; font-weight:700; flex:1; min-width:0; }
.bfl-member-role{ font-size:9.5px; font-weight:700; padding:2px 7px; border-radius:999px; background:var(--parchment); color:var(--ink-soft); margin-right:6px; }
.bfl-member-role--owner{ background:rgba(199,154,62,0.22); color:var(--ochre); }
.bfl-member-remove{ background:none; border:none; color:var(--flagred); font-size:11px; font-weight:700; cursor:pointer; flex:none; }
.bfl-add-member-row{ display:flex; gap:8px; margin-top:12px; }
.bfl-add-member-row input{ flex:1; }
.bfl-toggle-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:11px; }
.bfl-settings-section{ border-top:1px dashed var(--parchment-line); padding-top:12px; margin-top:14px; }
.bfl-settings-section:first-of-type{ border-top:none; padding-top:0; margin-top:0; }
.bfl-settings-danger{ background:rgba(168,50,45,0.06); border:1px solid rgba(168,50,45,0.25); border-radius:var(--radius-m); padding:12px; }
.bfl-settings-danger .bfl-btn{ margin-top:8px; }
.bfl-login-gate{ background:var(--parchment-dark); border:1px dashed var(--parchment-line); border-radius:var(--radius-m); padding:12px; font-size:12px; color:var(--ink-soft); margin-bottom:12px; }
.bfl-login-gate a{ color:var(--teal); font-weight:700; text-decoration:none; }

.bfl-toast{ position:fixed; bottom:18px; left:50%; transform:translateX(-50%) translateY(12px); background:var(--cedar-dark);
  color:var(--on-accent); padding:11px 18px; border-radius:999px; font-size:12.5px; font-weight:600; opacity:0;
  pointer-events:none; transition:all .25s ease; z-index:100001; box-shadow:0 8px 24px rgba(0,0,0,0.25); text-align:center; max-width:90vw; }
.bfl-toast.is-open{ opacity:1; transform:translateX(-50%) translateY(0); }

/* ---------- Municipality popup (desktop) ---------- */
.bfl-muni-popup{ position:absolute; z-index:800; width:340px; max-width:88vw; }
.bfl-muni-popup__inner{ border-radius:16px; overflow:hidden; display:flex; flex-direction:column;
  max-height:min(70vh, 520px); padding-top:14px; position:relative;
  background:color-mix(in srgb, var(--parchment-dark) 96%, transparent) !important; }
.bfl-popup-tabs{ display:flex; gap:6px; padding:0 18px 10px; flex:none; border-bottom:1px solid color-mix(in srgb, var(--parchment-line) 60%, transparent); }
.bfl-popup-tabs button{ background:none; border:none; font-size:12px; font-weight:700; color:var(--ink-soft); cursor:pointer;
  padding:6px 4px; border-bottom:2px solid transparent; }
.bfl-popup-tabs button.is-active{ color:var(--ink); border-bottom-color:var(--gold); }
.bfl-popup-scroll{ overflow-y:auto; padding:14px 18px 18px; flex:1; min-height:0;
  scrollbar-width:none; -ms-overflow-style:none; }
.bfl-popup-scroll::-webkit-scrollbar{ display:none; }
.bfl-popup-close{ position:absolute; top:10px; right:10px; width:24px; height:24px; border-radius:50%; border:none;
  background:color-mix(in srgb, var(--ink) 10%, transparent); color:var(--ink-soft); cursor:pointer; font-size:12px;
  display:flex; align-items:center; justify-content:center; z-index:2; }
.bfl-popup-close:hover{ background:color-mix(in srgb, var(--ink) 20%, transparent); color:var(--ink); }
.bfl-popup-tail{ position:absolute; bottom:-5px; left:50%; width:10px; height:10px;
  background:color-mix(in srgb, var(--parchment-dark) 96%, transparent);
  border-right:1px solid color-mix(in srgb, var(--parchment-line) 70%, transparent);
  border-bottom:1px solid color-mix(in srgb, var(--parchment-line) 70%, transparent);
  transform:translateX(-50%) rotate(45deg); border-radius:0 0 3px 0; backdrop-filter:blur(18px); pointer-events:none; }
.bfl-muni-popup--flip .bfl-popup-tail{ bottom:auto; top:-5px;
  border-right:none; border-bottom:none;
  border-left:1px solid color-mix(in srgb, var(--parchment-line) 70%, transparent);
  border-top:1px solid color-mix(in srgb, var(--parchment-line) 70%, transparent);
  border-radius:3px 0 0 0; }
@media (max-width:900px){ .bfl-muni-popup{ display:none !important; } }

/* ---------- No visible scrollbars anywhere — drag to scroll instead ---------- */
.bfl-side, .bfl-legend-strip, .bfl-leaderboard, .bfl-modal, .bfl-history-list{
  scrollbar-width:none; -ms-overflow-style:none;
}
.bfl-side::-webkit-scrollbar, .bfl-legend-strip::-webkit-scrollbar, .bfl-leaderboard::-webkit-scrollbar,
.bfl-modal::-webkit-scrollbar, .bfl-history-list::-webkit-scrollbar{
  display:none;
}
.bfl-dragscroll{ cursor:grab; }
.bfl-dragscroll.is-dragging, .bfl-side.is-dragging, .bfl-popup-scroll.is-dragging{ cursor:grabbing; user-select:none; }

/* ---------- Active profile badge (header) ---------- */
.bfl-active-profile{ display:flex; align-items:center; gap:6px; background:color-mix(in srgb, var(--ink) 8%, transparent);
  border:1px solid color-mix(in srgb, var(--ink) 14%, transparent); border-radius:999px; padding:5px 12px 5px 5px;
  cursor:pointer; font-family:inherit; transition:background .15s ease; }
.bfl-active-profile:hover{ background:color-mix(in srgb, var(--ink) 16%, transparent); }
.bfl-active-profile__name{ font-size:12.5px; font-weight:700; color:var(--ink); max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bfl-active-profile__shield{ font-size:12px; line-height:1; }

/* ---------- Shoreline glow (real coastline, dissolved from the sectors) ---------- */
.bfl-coastline-glow{ mix-blend-mode:overlay; pointer-events:none; }

/* ---------- Theme grid inside Settings modal ---------- */
.bfl-theme-grid{ display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.bfl-theme-grid .bfl-theme-opt{ border:1px solid transparent; }
.bfl-theme-grid .bfl-theme-opt.is-active{ border-color:var(--gold); background:color-mix(in srgb, var(--gold) 15%, transparent); }

/* ---------- Activity ticker ---------- */
.bfl-ticker{ flex:none; margin:8px 12px 0; padding:8px 14px; border-radius:14px;
  display:flex; align-items:center; gap:12px; overflow:hidden; }
.bfl-ticker__label{ font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.06em;
  color:var(--gold); flex:none; white-space:nowrap; }
@media (max-width:640px){ .bfl-ticker__label{ display:none; } }
.bfl-ticker__track{ flex:1; overflow:hidden; white-space:nowrap; position:relative; min-width:0; }
.bfl-ticker__content{ display:inline-block; padding-left:100%; animation:bflTickerScroll 68s linear infinite; }
@keyframes bflTickerScroll{ from{ transform:translateX(0); } to{ transform:translateX(-50%); } }
.bfl-ticker__item{ font-size:12px; font-weight:600; color:var(--ink); }
.bfl-ticker__time{ color:var(--ink-soft); font-weight:500; margin-left:4px; font-size:10.5px; }
.bfl-ticker__sep{ color:var(--ink-soft); margin:0 12px; opacity:0.5; }
.bfl-ticker__close{ flex:none; width:22px; height:22px; border-radius:50%; border:none;
  background:color-mix(in srgb, var(--ink) 10%, transparent); color:var(--ink-soft); cursor:pointer;
  font-size:10px; display:flex; align-items:center; justify-content:center; }
.bfl-ticker__close:hover{ background:color-mix(in srgb, var(--ink) 20%, transparent); color:var(--ink); }

/* ---------- Toggle switch ---------- */
.bfl-switch{ position:relative; display:inline-block; width:38px; height:22px; flex:none; }
.bfl-switch input{ opacity:0; width:0; height:0; }
.bfl-switch-track{ position:absolute; inset:0; background:var(--stone); border-radius:999px; cursor:pointer; transition:background .15s ease; }
.bfl-switch-track::before{ content:''; position:absolute; width:16px; height:16px; left:3px; top:3px; background:#fff; border-radius:50%; transition:transform .15s ease; }
.bfl-switch input:checked + .bfl-switch-track{ background:var(--cedar); }
.bfl-switch input:checked + .bfl-switch-track::before{ transform:translateX(16px); }
.bfl-toggle-row label{ font-size:12.5px; font-weight:700; color:var(--ink); }
.bfl-toggle-row p{ font-size:11px; color:var(--ink-soft); margin:2px 0 0; }

/* ---------- Municipality search ---------- */
.bfl-search-pop{ width:280px; padding:12px; }
.bfl-search-pop input{ width:100%; padding:9px 12px; border-radius:999px; border:1.5px solid var(--parchment-line);
  font-size:13px; font-family:inherit; background:#fff; color:var(--ink); }
.bfl-search-results{ margin-top:8px; max-height:280px; overflow-y:auto; display:flex; flex-direction:column; gap:4px;
  scrollbar-width:none; -ms-overflow-style:none; }
.bfl-search-results::-webkit-scrollbar{ display:none; }
.bfl-search-result{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 10px;
  border-radius:10px; border:none; background:none; cursor:pointer; text-align:left; font-family:inherit; }
.bfl-search-result:hover{ background:color-mix(in srgb, var(--ink) 8%, transparent); }
.bfl-search-result__name{ font-size:13px; font-weight:700; color:var(--ink); }
.bfl-search-result__sector{ font-size:10.5px; color:var(--ink-soft); font-weight:600; white-space:nowrap; }
.bfl-search-empty{ font-size:12px; color:var(--ink-soft); padding:8px 10px; }

/* ---------- Mobile: drop the expensive filter-based glows ----------
   drop-shadow() filters are cheap for a handful of shapes but add up fast
   across dense sectors (Akkar alone has 170 municipalities) on weaker
   mobile GPUs, so the fancy glow is desktop-only; mobile keeps the plain
   high-contrast stroke, which does the same visibility job for free. */
@media (max-width:900px){
  .bfl-territory--unclaimed{ filter:none; }
  .bfl-territory--unclaimed:hover{ filter:brightness(1.1); }
  .bfl-territory--selected{ animation:none; filter:drop-shadow(0 0 5px rgba(255,255,255,0.95)); }
  .bfl-territory:hover{ filter:brightness(1.1); }
}

/* ---------- Leading-territory banner: never subtle ---------- */
.bfl-map-info--leading{
  background:color-mix(in srgb, var(--leading-color, var(--gold)) 55%, var(--parchment-dark) 45%) !important;
  backdrop-filter:blur(18px) saturate(160%) !important;
  border:2px solid var(--leading-color, var(--gold)) !important;
  box-shadow:0 0 0 3px color-mix(in srgb, var(--leading-color, var(--gold)) 40%, transparent), 0 14px 34px rgba(0,0,0,0.4) !important;
}
.bfl-map-info--leading .bfl-map-info__toggle-title{ color:#ffffff; text-shadow:0 1px 3px rgba(0,0,0,0.4); }
.bfl-map-info__lead-tag{ display:none; font-size:10px; font-weight:800; color:#fff; background:rgba(0,0,0,0.28);
  padding:2px 8px; border-radius:999px; margin-left:6px; white-space:nowrap; letter-spacing:0.02em; }
.bfl-map-info--leading .bfl-map-info__lead-tag{ display:inline-block; }

/* ---------- Footer credit (optional, admin-set) ---------- */
.bfl-footer-credit{ flex:none; text-align:center; font-size:10.5px; color:var(--ink-soft);
  padding:6px 12px; opacity:0.7; }
