 :root {
  color-scheme: dark;
  --bg: #050505;
  --panel: rgba(16, 16, 16, 0.92);
  --panel-strong: #0d0d0d;
  --line: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --muted: #b9b9b9;
  --blue: #e50914;
  --blue-2: #ffffff;
  --red: #e50914;
  --red-2: #ff3045;
  --gold: #ffffff;
  --green: #ffffff;
  --danger: #ff3045;
  --shadow: 0 24px 70px rgba(0,0,0,.62);
  --radius: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: "Rajdhani", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body {
  background:
    radial-gradient(circle at 15% 0%, rgba(229, 9, 20, 0.34), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #111111 0%, #050505 55%, #000000 100%);
  letter-spacing: .01em;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.035) 0, rgba(255,255,255,0) 18%, rgba(255,255,255,0) 82%, rgba(255,255,255,.02) 100%);
  mix-blend-mode: screen;
  opacity: .8;
}
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

.app-shell { width: min(100%, 1080px); margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 14px 96px; position: relative; z-index: 1; }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 16px; backdrop-filter: blur(18px); }
.brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-icon { width: 58px; height: 58px; border-radius: 14px; box-shadow: 0 16px 38px rgba(229,9,20,.32); border: 1px solid rgba(255,255,255,.18); }
.eyebrow { color: var(--text); text-transform: uppercase; letter-spacing: .22em; font-size: 12px; font-weight: 700; font-family: "Bebas Neue", Impact, sans-serif; opacity: .9; }
h1, h2, h3, p { margin: 0; }
h1 { font-family: "Bebas Neue", Impact, sans-serif; font-size: clamp(42px, 9vw, 72px); letter-spacing: .035em; line-height: .88; text-transform: uppercase; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.9), 0 0 18px rgba(229,9,20,.35); }
h2 { font-family: "Bebas Neue", Impact, sans-serif; font-size: 34px; letter-spacing: .05em; text-transform: uppercase; }
h3 { font-family: "Bebas Neue", Impact, sans-serif; font-size: 26px; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 10px; }
.muted { color: var(--muted); line-height: 1.4; font-size: 15px; font-weight: 500; }
.tagline { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: clamp(28px, 5vw, 40px); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }

.hero-card, .map-card, .panel, .profile-card, .activity-card, .admin-card {
  border: 1px solid rgba(255,255,255,.12); background: linear-gradient(145deg, rgba(20,20,20,.97), rgba(4,4,4,.95)); border-radius: 18px; box-shadow: var(--shadow);
}
.hero-card { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 20px; margin-bottom: 14px; position: relative; overflow: hidden; }
.hero-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: linear-gradient(180deg, #fff 0%, #e50914 55%, #5b0000 100%); }
.status-pill, .mini-stat { color: #ffffff; background: linear-gradient(180deg, rgba(229,9,20,.3), rgba(92,0,0,.35)); border: 1px solid rgba(255,255,255,.16); padding: 8px 12px; border-radius: 12px; white-space: nowrap; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-family: "Bebas Neue", Impact, sans-serif; }
.map-card { position: relative; overflow: hidden; padding: 12px; margin-bottom: 14px; }
.map-toolbar { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
#map { height: min(62vh, 520px); min-height: 360px; border-radius: 18px; overflow: hidden; background: #060606; border: 1px solid var(--line); }
.map-fallback { position: absolute; inset: 76px 20px 20px; display: grid; place-items: center; text-align: center; gap: 8px; padding: 24px; background: rgba(0,0,0,.92); border-radius: 18px; border: 1px dashed rgba(255,255,255,.2); }
.hidden { display: none !important; }

.primary-btn, .secondary-btn, .ghost-btn, .danger-btn { min-height: 46px; padding: 0 16px; border-radius: 10px; font-weight: 700; color: var(--text); font-family: "Bebas Neue", Impact, sans-serif; letter-spacing: .08em; text-transform: uppercase; font-size: 20px; }
.primary-btn { background: linear-gradient(180deg, #ff3747 0%, #d90416 52%, #8a000c 100%); box-shadow: 0 12px 24px rgba(229,9,20,.3), inset 0 1px 0 rgba(255,255,255,.22); }
.secondary-btn { background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06)); border: 1px solid rgba(255,255,255,.18); }
.ghost-btn { background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.05)); border: 1px solid rgba(255,255,255,.16); }
.danger-btn { background: rgba(229,9,20,.18); color: #ffffff; border: 1px solid rgba(229,9,20,.55); }
.full { width: 100%; }

.tabbar { display: grid; grid-template-columns: repeat(18, 1fr); gap: 6px; margin: 0 0 14px; padding: 6px; background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; position: sticky; top: 82px; z-index: 40; backdrop-filter: blur(20px); }
.tab-btn { color: var(--muted); background: transparent; border-radius: 10px; padding: 12px 4px; font-weight: 700; font-size: 18px; font-family: "Bebas Neue", Impact, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.tab-btn.active { color: #ffffff; background: linear-gradient(180deg, #ff2f41 0%, #c70516 58%, #7a000c 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.panel { display: none; padding: 18px; }
.active-panel { display: block; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }

.mission-list { display: grid; gap: 10px; }
.mission-card { position: relative; display: grid; gap: 12px; padding: 16px; border-radius: 14px; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.12); overflow: hidden; }
.mission-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--red); }
.mission-card.rare::before { background: var(--gold); }
.mission-card.legendary::before { background: linear-gradient(var(--red), #ffffff); }
.mission-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mission-title { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: 30px; letter-spacing: .04em; text-transform: uppercase; line-height: .95; }
.mission-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid rgba(255,255,255,.14); color: #eeeeee; background: rgba(255,255,255,.055); border-radius: 10px; padding: 5px 8px; font-size: 12px; font-weight: 700; font-family: "Bebas Neue", Impact, sans-serif; letter-spacing: .07em; text-transform: uppercase; }
.chip.gold { color: #000000; background: #ffffff; border-color: #ffffff; }
.chip.green { color: #000000; background: #ffffff; border-color: #ffffff; }
.mission-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.leaflet-container { background: #060606; }
.spawn-marker { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--red); border: 2px solid rgba(255,255,255,.86); box-shadow: 0 0 0 7px rgba(255,37,71,.16), 0 14px 30px rgba(0,0,0,.4); }
.spawn-marker span { transform: rotate(45deg); font-size: 18px; }
.player-marker { width: 28px; height: 28px; border-radius: 50%; background: #ffffff; border: 4px solid #e50914; box-shadow: 0 0 0 12px rgba(229,9,20,.20); }

.profile-card { display: grid; grid-template-columns: 112px 1fr; gap: 14px; padding: 16px; margin-bottom: 14px; }
.profile-icon { width: 112px; height: 112px; border-radius: 24px; }
.profile-copy { display: grid; gap: 8px; }
.field-label { color: var(--muted); font-size: 13px; font-weight: 700; font-family: "Bebas Neue", Impact, sans-serif; letter-spacing: .09em; text-transform: uppercase; }
.text-input { width: 100%; min-height: 48px; border-radius: 10px; border: 1px solid rgba(255,255,255,.13); background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.045)); color: var(--text); padding: 0 14px; outline: none; font-size: 18px; font-weight: 600; }
.text-input:focus { border-color: rgba(229,9,20,.86); box-shadow: 0 0 0 4px rgba(229,9,20,.18); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card { background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; font-family: "Bebas Neue", Impact, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.stat-card strong { display: block; margin-top: 3px; font-size: 28px; font-family: "Bebas Neue", Impact, sans-serif; letter-spacing: .03em; text-transform: uppercase; }
.activity-card { padding: 14px; }
.activity-log { display: grid; gap: 8px; }
.activity-item { padding: 12px; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)); border-radius: 10px; color: #f1f1f1; font-size: 16px; font-weight: 500; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 10px; }
.badge-card { min-height: 142px; display: grid; align-content: center; justify-items: center; text-align: center; gap: 8px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)); padding: 12px; }
.badge-card.locked { filter: grayscale(.9); opacity: .42; }
.badge-icon { font-size: 34px; }
.badge-name { font-weight: 700; font-family: "Bebas Neue", Impact, sans-serif; letter-spacing: .06em; text-transform: uppercase; font-size: 20px; }
.badge-desc { color: var(--muted); font-size: 12px; }

.leaderboard { display: grid; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)); }
.rank-num { font-weight: 700; color: var(--gold); font-family: "Bebas Neue", Impact, sans-serif; font-size: 24px; }
.rank-name { font-weight: 700; font-family: "Bebas Neue", Impact, sans-serif; letter-spacing: .06em; text-transform: uppercase; font-size: 22px; }
.rank-borough { color: var(--muted); font-size: 12px; }
.rank-score { font-weight: 700; font-family: "Bebas Neue", Impact, sans-serif; letter-spacing: .05em; text-transform: uppercase; font-size: 22px; }

.admin-card { padding: 16px; display: grid; gap: 10px; }
.admin-note { color: #f1f1f1; background: rgba(229,9,20,.10); border: 1px solid rgba(229,9,20,.42); border-radius: 12px; padding: 12px; line-height: 1.45; }

.mission-dialog { width: min(94vw, 560px); border: 0; border-radius: 14px; padding: 0; background: var(--panel-strong); color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.65); }
.mission-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
.dialog-content { position: relative; padding: 18px; display: grid; gap: 12px; }
.close-btn { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.08); color: var(--text); font-size: 24px; }
.challenge-box { display: grid; gap: 10px; margin-top: 12px; }
.answer-grid { display: grid; gap: 8px; }
.answer-btn { text-align: left; min-height: 48px; border-radius: 10px; color: var(--text); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); padding: 10px 12px; font-weight: 600; font-size: 17px; }
.toast { position: fixed; left: 50%; right: auto; bottom: 24px; z-index: 200; width: min(calc(100vw - 28px), 560px); transform: translate(-50%, 130%); transition: transform .24s ease, opacity .24s ease; opacity: 0; color: #ffffff; background: linear-gradient(180deg, #1c1c1c 0%, #0a0a0a 100%); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 14px 18px; font-weight: 700; font-family: "Bebas Neue", Impact, sans-serif; letter-spacing: .06em; font-size: 22px; box-shadow: 0 14px 40px rgba(0,0,0,.36); text-align: center; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }


select.text-input,
select.text-input option {
  background: #0a0a0a;
  color: #fff;
}

.section-head h2,
.mission-title,
.rank-name,
.badge-name,
.tab-btn,
.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.status-pill,
.mini-stat {
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.city-feed .activity-item,
.collectible-item,
.borough-row {
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.1);
}

@media (max-width: 680px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .hero-card { grid-template-columns: 1fr; }
  .map-toolbar { grid-template-columns: 1fr; }
  #map { height: 52vh; min-height: 330px; }
  .tabbar { top: 78px; overflow-x: auto; grid-template-columns: repeat(18, minmax(94px, 1fr)); }
  .profile-card { grid-template-columns: 1fr; }
  .profile-icon { width: 96px; height: 96px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .mission-actions { grid-template-columns: 1fr; }
  .brand-icon { width: 52px; height: 52px; }
  h1 { font-size: clamp(34px, 10vw, 52px); }
  h2 { font-size: 28px; }
  .primary-btn, .secondary-btn, .ghost-btn, .danger-btn { font-size: 17px; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); width: min(calc(100vw - 20px), 520px); font-size: 14px; }
}

@media (min-width: 681px) {
  .toast { top: 104px; bottom: auto; left: 50%; transform: translate(-50%, -140%); width: min(calc(100vw - 48px), 620px); }
  .toast.show { transform: translate(-50%, 0); }
}

/* ------------------------------------------------------------------
   Leaflet local fallback / hard fix
   This keeps the map tiles locked into their absolute tile grid even
   when the external Leaflet CSS file is blocked, slow, or cached badly.
------------------------------------------------------------------- */
.leaflet-container {
  position: relative !important;
  overflow: hidden !important;
  -webkit-tap-highlight-color: transparent;
  background: #060606;
  outline: 0;
}
.leaflet-container a { color: #ff3045; }
.leaflet-container img,
.leaflet-container svg {
  max-width: none !important;
  max-height: none !important;
}
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute !important;
  left: 0;
  top: 0;
}
.leaflet-tile {
  width: 256px;
  height: 256px;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  visibility: inherit;
  user-select: none;
  -webkit-user-drag: none;
}
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane,
.leaflet-pane,
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane,
.leaflet-tooltip-pane,
.leaflet-popup-pane {
  position: absolute !important;
  left: 0;
  top: 0;
}
.leaflet-map-pane {
  z-index: 400;
  width: 100%;
  height: 100%;
}
.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}
.leaflet-control-container .leaflet-top { top: 0; }
.leaflet-control-container .leaflet-right { right: 0; }
.leaflet-control-container .leaflet-bottom { bottom: 0; }
.leaflet-control-container .leaflet-left { left: 0; }
.leaflet-control { position: relative; z-index: 1000; pointer-events: auto; float: left; clear: both; }
.leaflet-right .leaflet-control { float: right; margin-right: 10px; }
.leaflet-left .leaflet-control { margin-left: 10px; }
.leaflet-top .leaflet-control { margin-top: 10px; }
.leaflet-bottom .leaflet-control { margin-bottom: 10px; }
 .leaflet-control-zoom a {
  display: block;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  text-decoration: none;
  color: #f4f8ff;
  background: rgba(12, 12, 12, .96);
  border: 1px solid rgba(255,255,255,.16);
  font-weight: 900;
}
.leaflet-control-zoom-in { border-radius: 10px 10px 0 0; }
.leaflet-control-zoom-out { border-radius: 0 0 10px 10px; }
.leaflet-popup { position: absolute; text-align: center; margin-bottom: 20px; }
.leaflet-popup-content-wrapper {
  padding: 8px;
  text-align: left;
  border-radius: 12px;
  background: #0d0d0d;
  color: #f4f8ff;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.14);
}
.leaflet-popup-content { margin: 6px 8px; line-height: 1.35; }
.leaflet-popup-tip-container { width: 40px; height: 20px; position: absolute; left: 50%; margin-left: -20px; overflow: hidden; pointer-events: none; }
.leaflet-popup-tip { width: 14px; height: 14px; padding: 1px; margin: -8px auto 0; transform: rotate(45deg); background: #0d0d0d; }
.leaflet-container .leaflet-marker-icon,
.leaflet-container .leaflet-marker-shadow { display: block; }

/* Toronto Identity v3 additions */
.tabbar { grid-template-columns: repeat(18, 1fr); }
.mission-card { position: relative; overflow: hidden; }
.mission-card::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 90% 12%, rgba(229,9,20,.16), transparent 22%); opacity: .75; }
.mission-card.rare { border-color: rgba(255,255,255,.34); box-shadow: 0 16px 42px rgba(229, 9, 20, .14); }
.mission-card.legendary { border-color: rgba(255,255,255,.70); box-shadow: 0 18px 60px rgba(229, 9, 20, .22); }
.chip.green { color: #06101d; background: var(--green); border-color: rgba(78,226,154,.45); }
.spawn-marker.rare { background: linear-gradient(135deg, #e50914, #ffffff); box-shadow: 0 0 0 8px rgba(229,9,20,.22), 0 18px 36px rgba(0,0,0,.45); }
.spawn-marker.legendary { background: linear-gradient(135deg, #ffffff, #e50914); box-shadow: 0 0 0 10px rgba(255,255,255,.18), 0 0 34px rgba(229,9,20,.36), 0 18px 36px rgba(0,0,0,.45); }
.city-feed { display: grid; gap: 10px; }
.feed-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.055); border: 1px solid var(--line); }
.feed-dot { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: #e50914; box-shadow: 0 0 0 6px rgba(229,9,20,.18); }
.feed-item strong { color: #ffffff; font-size: 12px; font-weight: 950; }
.feed-item p { margin-top: 2px; color: #f1f1f1; line-height: 1.4; }
.borough-war { display: grid; gap: 10px; }
.borough-row { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.045); }
.borough-row.home { border-color: rgba(229,9,20,.58); background: rgba(229,9,20,.13); }
.borough-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.borough-label span { color: #f1f1f1; font-weight: 900; }
.borough-label strong { color: var(--gold); white-space: nowrap; }
.borough-bar { height: 9px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.borough-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e50914, #ffffff); min-width: 6%; }
.collectible-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: 10px; }
.collectible-card { min-height: 86px; display: grid; align-content: center; justify-items: center; gap: 6px; text-align: center; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.22); }
.collectible-card span { font-size: 28px; }
.collectible-card strong { font-size: 12px; line-height: 1.25; }
.leader-callout { padding: 12px; margin-bottom: 8px; border-radius: 16px; background: rgba(229,9,20,.12); border: 1px solid rgba(229,9,20,.44); color: #f1f1f1; font-weight: 850; }
.leader-callout strong { color: var(--gold); }
#titleStat, #homeEndsStat { font-size: clamp(16px, 3vw, 22px); line-height: 1.05; }
.toast { position: fixed; left: 50%; right: auto; bottom: 24px; z-index: 200; width: min(calc(100vw - 28px), 560px); transform: translate(-50%, 130%); transition: transform .24s ease, opacity .24s ease; opacity: 0; color: #ffffff; background: linear-gradient(180deg, #1c1c1c 0%, #0a0a0a 100%); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 14px 18px; font-weight: 700; font-family: "Bebas Neue", Impact, sans-serif; letter-spacing: .06em; font-size: 22px; box-shadow: 0 14px 40px rgba(0,0,0,.36); text-align: center; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (min-width: 681px) {
  .toast { top: 104px; bottom: auto; left: 50%; transform: translate(-50%, -140%); width: min(calc(100vw - 48px), 620px); }
  .toast.show { transform: translate(-50%, 0); }
}

@media (max-width: 680px) {
  .tabbar { grid-template-columns: repeat(9, minmax(78px, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); width: min(calc(100vw - 20px), 520px); font-size: 14px; }
}




/* Weird Toronto Drops */
.textarea-input {
  min-height: 94px;
  resize: vertical;
  padding-top: 12px;
  line-height: 1.35;
}
.file-input { padding-top: 10px; }
.weird-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 14px;
  margin-bottom: 14px;
}
.weird-submit-card,
.weird-rules-card,
.weird-section-card {
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(145deg, rgba(18,18,18,.94), rgba(0,0,0,.86));
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 9px;
  position: relative;
  overflow: hidden;
}
.weird-submit-card::before,
.weird-rules-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, #fff, #e50914 48%, #111);
}
.rule-list { display: grid; gap: 8px; margin-top: 6px; }
.rule-list span {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.11);
  color: #f2f2f2;
  font-weight: 600;
}
.weird-list { display: grid; gap: 12px; }
.weird-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  position: relative;
  overflow: hidden;
}
.weird-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 92% 12%, rgba(255,255,255,.11), transparent 22%), radial-gradient(circle at 12% 90%, rgba(229,9,20,.18), transparent 26%);
}
.weird-card.pending { border-style: dashed; border-color: rgba(255,255,255,.34); }
.weird-card > * { position: relative; z-index: 1; }
.weird-photo {
  width: 100%;
  min-height: 148px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: #050505;
  box-shadow: 0 18px 34px rgba(0,0,0,.28);
}
.weird-photo.small { min-height: 100px; }
.weird-photo.placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(229,9,20,.24), transparent 44%),
    linear-gradient(145deg, #111, #030303);
}
.weird-photo.placeholder span { font-size: 54px; }
.weird-photo.placeholder small {
  color: #fff;
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.weird-copy { display: grid; align-content: start; gap: 8px; }
.weird-actions { grid-template-columns: 1fr 1fr 1fr; }
.weird-marker {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px 12px 12px 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #ffffff, #e50914 55%, #111);
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 0 0 8px rgba(255,255,255,.11), 0 0 28px rgba(229,9,20,.34), 0 18px 34px rgba(0,0,0,.45);
}
.weird-marker span { transform: rotate(45deg); font-size: 19px; }

@media (max-width: 760px) {
  .weird-layout { grid-template-columns: 1fr; }
  .weird-card { grid-template-columns: 1fr; }
  .weird-photo { max-height: 260px; }
  .weird-actions { grid-template-columns: 1fr; }
}

/* Red / White / Black identity patch */
.topbar { background: linear-gradient(180deg, rgba(0,0,0,.92), rgba(0,0,0,.58)); border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-icon, .profile-icon { background: #000; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 12px 30px rgba(229,9,20,.32); }
.eyebrow { color: #ffffff; text-shadow: 0 0 14px rgba(229,9,20,.72); }
h1 { text-shadow: 0 3px 0 rgba(229,9,20,.45), 0 18px 40px rgba(0,0,0,.7); }
.hero-card, .map-card, .panel, .profile-card, .activity-card, .admin-card { border-color: rgba(255,255,255,.15); background: linear-gradient(145deg, rgba(18,18,18,.96), rgba(0,0,0,.90)); }
.map-card::before, .panel::before { content: ''; position: absolute; pointer-events: none; inset: 0; border-radius: inherit; background: linear-gradient(90deg, rgba(229,9,20,.28), transparent 22%, transparent 78%, rgba(255,255,255,.06)); opacity: .45; }
.panel { position: relative; overflow: hidden; }
.primary-btn { border: 1px solid rgba(255,255,255,.22); }
.secondary-btn, .ghost-btn { color: #ffffff; }
.secondary-btn:hover, .ghost-btn:hover, .tab-btn:hover, .answer-btn:hover { border-color: rgba(229,9,20,.7); background: rgba(229,9,20,.16); }
.tabbar { background: rgba(0,0,0,.68); border-color: rgba(255,255,255,.16); box-shadow: 0 10px 34px rgba(0,0,0,.38); }
.tab-btn.active { color: #ffffff; background: linear-gradient(135deg, #e50914, #b3000b); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 10px 24px rgba(229,9,20,.25); }
.mission-card, .stat-card, .badge-card, .rank-row, .feed-item, .borough-row, .collectible-card, .activity-item { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.13); }
.chip { background: rgba(0,0,0,.38); color: #f4f4f4; border-color: rgba(255,255,255,.20); }
.chip.gold, .chip.green { color: #000000; background: #ffffff; border-color: #ffffff; }
.rank-num, .leader-callout strong, .borough-label strong { color: #ffffff; text-shadow: 0 0 12px rgba(229,9,20,.7); }
.toast { color: #ffffff; background: linear-gradient(135deg, #e50914, #9c0009); border: 1px solid rgba(255,255,255,.24); }
 .leaflet-control-zoom a { color: #fff; background: rgba(0,0,0,.92); border-color: rgba(255,255,255,.25); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #090909; color: #ffffff; }

/* Fix dropdown/readability for city/borough select */
.text-input,
select.text-input {
  background-color: #070707;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.25);
  caret-color: #ffffff;
}
select.text-input {
  color-scheme: dark;
  appearance: auto;
  -webkit-appearance: menulist;
  accent-color: #e50914;
}
select.text-input option,
select.text-input optgroup {
  background-color: #050505;
  color: #ffffff;
}
select.text-input option:checked,
select.text-input option:hover {
  background-color: #e50914;
  color: #ffffff;
}
.text-input::placeholder { color: rgba(255,255,255,.52); }


/* Toronto Events + Traffic Watch */
.event-control-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(145deg, rgba(18,18,18,.94), rgba(0,0,0,.86));
  border-radius: 14px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.event-control-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, #fff, #e50914 52%, #111);
}
.event-control-card > * { position: relative; z-index: 1; }
.event-list { display: grid; gap: 12px; }
.event-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  position: relative;
  overflow: hidden;
}
.event-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 92% 14%, rgba(229,9,20,.22), transparent 22%);
}
.event-card > * { position: relative; z-index: 1; }
.event-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff, #e50914 60%, #111);
  border: 1px solid rgba(255,255,255,.24);
  font-size: 34px;
  box-shadow: 0 16px 34px rgba(0,0,0,.34);
}
.event-copy { display: grid; gap: 8px; }
.event-marker {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #111, #e50914 55%, #fff);
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 0 0 8px rgba(229,9,20,.17), 0 0 28px rgba(255,255,255,.18), 0 18px 34px rgba(0,0,0,.45);
}
.event-marker span { transform: rotate(45deg); font-size: 20px; }
@media (max-width: 760px) {
  .event-control-card { grid-template-columns: 1fr; }
  .event-card { grid-template-columns: 1fr; }
  .event-icon { width: 58px; height: 58px; font-size: 28px; }
}


/* Legendary Sightings */
.sighting-layout .weird-submit-card::before,
.sighting-rules-card::before {
  background: linear-gradient(180deg, #ffffff, #e50914 35%, #ffffff 70%, #111);
}
.sighting-list { display: grid; gap: 12px; }
.sighting-card { border-color: rgba(255,255,255,.22); }
.sighting-card.approved {
  border-color: rgba(255,255,255,.34);
  box-shadow: 0 18px 48px rgba(229,9,20,.20);
}
.sighting-card.approved::after {
  background: radial-gradient(circle at 90% 10%, rgba(255,255,255,.18), transparent 20%), radial-gradient(circle at 12% 88%, rgba(229,9,20,.30), transparent 28%);
}
.sighting-photo.placeholder {
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.20), transparent 34%),
    radial-gradient(circle at 50% 60%, rgba(229,9,20,.28), transparent 48%),
    linear-gradient(145deg, #141414, #030303);
}
.sighting-marker {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #ffffff 0%, #e50914 48%, #050505 100%);
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 0 0 9px rgba(255,255,255,.10), 0 0 34px rgba(229,9,20,.42), 0 18px 34px rgba(0,0,0,.50);
}
.sighting-marker span { transform: rotate(45deg); font-size: 21px; }
@media (max-width: 760px) {
  .sighting-card .weird-actions { grid-template-columns: 1fr; }
}


/* =======================
   V11 Bare Slang Social City Patch
======================= */
.daily-card,
.v11-card {
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(145deg, rgba(22,22,22,.98), rgba(5,5,5,.94));
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.daily-card::before,
.v11-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #fff, #e50914 55%, #580008);
}
.daily-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}
.daily-actions {
  display: grid;
  gap: 8px;
  min-width: 210px;
}
.v11-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.crew-card,
.share-card,
.lore-card,
.sponsor-card,
.heat-item,
.wall-card {
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  border-radius: 12px;
  padding: 12px;
}
.crew-card strong,
.share-card strong,
.lore-card strong,
.sponsor-card strong,
.heat-item strong,
.wall-card strong {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 24px;
  line-height: 1;
}
.crew-card .big-stat {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 54px;
  line-height: .95;
  color: #fff;
  text-shadow: 0 0 18px rgba(229,9,20,.28);
}
.takeover-board,
.heat-list,
.lore-grid,
.share-stack,
.weird-wall,
#sponsorList {
  display: grid;
  gap: 10px;
}
.takeover-row {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,.045);
}
.takeover-row.home {
  border-color: rgba(229,9,20,.7);
  box-shadow: 0 0 0 1px rgba(229,9,20,.2) inset;
}
.takeover-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-size: 20px;
}
.takeover-bar,
.heat-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  margin-top: 8px;
}
.takeover-bar span,
.heat-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e50914, #fff);
}
.heat-item {
  display: grid;
  gap: 8px;
}
.wall-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
}
.wall-thumb {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 20%, rgba(229,9,20,.55), transparent 38%), #111;
  display: grid;
  place-items: center;
  font-size: 36px;
  overflow: hidden;
}
.wall-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wall-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.wall-reactions span {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  color: #eee;
}
.lore-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.lore-card.locked {
  opacity: .45;
  filter: grayscale(.8);
}
.share-card {
  background:
    radial-gradient(circle at 12% 10%, rgba(229,9,20,.4), transparent 30%),
    linear-gradient(135deg, #111 0%, #050505 60%, #240005 100%);
  min-height: 150px;
}
.share-card .share-title {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 38px;
  letter-spacing: .06em;
  line-height: .92;
  text-transform: uppercase;
}
.share-card .share-footer {
  margin-top: 14px;
  color: #aaa;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sponsor-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 12px;
}
.sponsor-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(229,9,20,.28), rgba(255,255,255,.08));
  font-size: 26px;
}
.mini-red {
  color: #fff;
  background: rgba(229,9,20,.22);
  border: 1px solid rgba(229,9,20,.45);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}
@media (max-width: 680px) {
  .daily-card,
  .v11-grid,
  .sponsor-card,
  .wall-card {
    grid-template-columns: 1fr;
  }
  .daily-actions {
    min-width: 0;
  }
  .wall-thumb {
    width: 100%;
    height: 160px;
  }
}


/* =======================
   V12 Social Map / Hype Pins Patch
======================= */
.v12-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.v12-card {
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(145deg, rgba(22,22,22,.98), rgba(5,5,5,.94));
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.v12-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #fff, #e50914 55%, #580008);
}
.profile-social-card {
  display: grid;
  gap: 10px;
}
.profile-social-top {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
}
.profile-avatar,
.social-avatar {
  width: 74px;
  height: 74px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 28% 18%, rgba(229,9,20,.65), transparent 38%), #111;
  border: 1px solid rgba(255,255,255,.14);
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 34px;
  letter-spacing: .04em;
}
.social-list,
.hype-list {
  display: grid;
  gap: 10px;
}
.social-row,
.hype-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
}
.social-row strong,
.hype-row strong {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 22px;
  line-height: 1;
}
.social-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.social-actions button {
  min-height: 34px;
  font-size: 16px;
  padding: 0 10px;
}
.chat-log {
  display: grid;
  gap: 8px;
  min-height: 170px;
  max-height: 280px;
  overflow: auto;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.28);
  margin-bottom: 10px;
}
.chat-msg {
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}
.chat-msg.mine {
  background: rgba(229,9,20,.18);
  border-color: rgba(229,9,20,.35);
}
.chat-msg strong {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-size: 17px;
}
.chat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.hype-marker {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(180deg, #fff 0%, #ff3045 35%, #e50914 100%);
  border: 2px solid rgba(255,255,255,.92);
  box-shadow: 0 0 0 10px rgba(229,9,20,.20), 0 18px 38px rgba(0,0,0,.55);
}
.hype-marker span {
  transform: rotate(45deg);
  font-size: 21px;
}
.hype-level {
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 20px;
  color: #fff;
}
.hype-meter {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
  margin-top: 7px;
}
.hype-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #e50914, #fff);
}
.privacy-pill {
  display: inline-flex;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.privacy-pill.ghost {
  background: rgba(229,9,20,.22);
  border-color: rgba(229,9,20,.48);
}
@media (max-width: 680px) {
  .v12-grid,
  .social-row,
  .hype-row,
  .chat-row {
    grid-template-columns: 1fr;
  }
  .social-actions {
    justify-content: stretch;
  }
  .social-actions button {
    flex: 1;
  }
}


/* =======================
   V13 Live API Connected Patch
======================= */
.hero-status-stack {
  display: grid;
  gap: 8px;
  justify-items: end;
}
.api-pill {
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.055));
}
.api-pill.online {
  border-color: rgba(255,255,255,.38);
  background: linear-gradient(180deg, rgba(229,9,20,.38), rgba(80,0,0,.3));
}
.api-pill.offline {
  border-color: rgba(229,9,20,.5);
  background: rgba(229,9,20,.16);
}
@media (max-width: 680px) {
  .hero-status-stack {
    justify-items: start;
  }
}


/* =======================
   V14 Real Accounts Patch
======================= */
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.account-card,
.account-live-card {
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(145deg, rgba(22,22,22,.98), rgba(5,5,5,.94));
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 9px;
  position: relative;
  overflow: hidden;
}
.account-card::before,
.account-live-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #fff, #e50914 55%, #580008);
}
.account-live-card {
  margin-top: 12px;
  min-height: 118px;
}
.account-live-card strong {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 26px;
  line-height: 1;
}
@media (max-width: 680px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}


/* =======================
   V14.1 Clean Grouped Navigation Patch
======================= */
.tabbar.nav-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  margin: 0 0 14px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.022));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  position: sticky;
  top: 82px;
  z-index: 40;
  backdrop-filter: blur(20px);
  overflow: visible;
}

.nav-group {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: rgba(0,0,0,.22);
}

.nav-group-label {
  display: block;
  color: #ffffff;
  opacity: .78;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1;
  padding-left: 2px;
}

.nav-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tabbar.nav-groups .tab-btn {
  flex: 1 1 auto;
  min-width: 72px;
  min-height: 38px;
  padding: 8px 10px;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tabbar.nav-groups .tab-btn.active {
  color: #ffffff;
  background: linear-gradient(180deg, #ff2f41 0%, #c70516 58%, #7a000c 100%);
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 10px 24px rgba(229,9,20,.22), inset 0 1px 0 rgba(255,255,255,.18);
}

.tabbar.nav-groups .admin-tab {
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
}

@media (max-width: 980px) {
  .tabbar.nav-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    top: 78px;
  }
}

@media (max-width: 680px) {
  .tabbar.nav-groups {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
  }

  .tabbar.nav-groups::-webkit-scrollbar {
    height: 0;
  }

  .nav-group {
    min-width: min(82vw, 330px);
    scroll-snap-align: start;
  }

  .tabbar.nav-groups .tab-btn {
    min-width: 74px;
    font-size: 15px;
  }
}


/* =======================
   V15 Real Profiles / Leaderboard / Password UX
======================= */
.password-wrap {
  position: relative;
  display: grid;
}
.password-wrap .password-input {
  padding-right: 54px;
}
.password-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 40px;
  height: 36px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  color: #fff;
  font-size: 17px;
}
.password-eye.active {
  background: linear-gradient(180deg, #ff2f41 0%, #c70516 58%, #7a000c 100%);
}
.remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  cursor: pointer;
  color: #eee;
  font-weight: 700;
}
.remember-row input {
  display: none;
}
.remember-switch {
  width: 46px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.09);
  position: relative;
  flex: 0 0 auto;
}
.remember-switch::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
}
.remember-row input:checked + .remember-switch {
  background: linear-gradient(180deg, #ff2f41 0%, #c70516 58%, #7a000c 100%);
}
.remember-row input:checked + .remember-switch::after {
  transform: translateX(21px);
}
.tiny-note {
  font-size: 12px;
}
.profile-public-preview {
  margin-bottom: 14px;
}
.public-card,
.public-profile-card {
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 18% 10%, rgba(229,9,20,.28), transparent 32%),
    linear-gradient(145deg, rgba(22,22,22,.98), rgba(5,5,5,.94));
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.public-card::before,
.public-profile-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #fff, #e50914 55%, #580008);
}
.public-card-top {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 12px;
}
.profile-badge-avatar {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ff2f41, #7a000c);
  border: 1px solid rgba(255,255,255,.18);
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 34px;
  letter-spacing: .04em;
  box-shadow: 0 14px 30px rgba(229,9,20,.22);
}
.public-card-name {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 32px;
  line-height: .95;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.profile-stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.profile-stat-strip span,
.leader-actions .mini-stat {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  color: #eee;
  font-weight: 800;
}
.leader-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.public-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.public-profile-card strong {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 25px;
  line-height: 1;
}
.public-profile-card .profile-badge-avatar {
  width: 54px;
  height: 54px;
  font-size: 26px;
}


/* =======================
   V15.1 Profile Pictures Patch
======================= */
.avatar-upload-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: start;
}
.avatar-upload-actions {
  display: grid;
  gap: 8px;
}
.file-input {
  padding: 9px 10px;
}
.large-avatar {
  width: 112px !important;
  height: 112px !important;
  font-size: 40px !important;
  border-radius: 20px !important;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.large-avatar img,
.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-badge-avatar.has-image {
  padding: 0;
  background: #111;
}
.public-profile-card .profile-badge-avatar.has-image,
.public-card .profile-badge-avatar.has-image {
  box-shadow: 0 14px 30px rgba(229,9,20,.18);
}
@media (max-width: 680px) {
  .avatar-upload-row {
    grid-template-columns: 1fr;
  }
}


/* =======================
   V16 Weather Vibes Patch
======================= */
.weather-vibe-card {
  display: grid;
  gap: 14px;
}
.weather-vibe-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.weather-temp-lockup {
  min-width: 128px;
  display: grid;
  justify-items: end;
  gap: 2px;
}
.weather-temp-lockup strong {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(48px, 9vw, 76px);
  line-height: .85;
  letter-spacing: .03em;
  color: #fff;
  text-shadow: 0 2px 0 #000, 0 0 24px rgba(229,9,20,.36);
}
.weather-temp-lockup span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.weather-vibe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.weather-vibe-meta span {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: #eee;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.weather-vibe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.weather-vibe-card.hot {
  background:
    radial-gradient(circle at 80% 10%, rgba(255,255,255,.15), transparent 26%),
    radial-gradient(circle at 12% 15%, rgba(229,9,20,.42), transparent 32%),
    linear-gradient(145deg, rgba(22,22,22,.98), rgba(5,5,5,.94));
}
.weather-vibe-card.rain {
  background:
    radial-gradient(circle at 18% 12%, rgba(140,140,140,.22), transparent 36%),
    linear-gradient(145deg, rgba(18,18,18,.98), rgba(5,5,5,.94));
}
.weather-vibe-card.cold {
  background:
    radial-gradient(circle at 80% 10%, rgba(255,255,255,.22), transparent 30%),
    radial-gradient(circle at 10% 10%, rgba(160,160,160,.18), transparent 32%),
    linear-gradient(145deg, rgba(22,22,22,.98), rgba(5,5,5,.94));
}
.weather-vibe-card.wind {
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.12), transparent 24%),
    linear-gradient(145deg, rgba(22,22,22,.98), rgba(5,5,5,.94));
}
@media (max-width: 680px) {
  .weather-vibe-main {
    grid-template-columns: 1fr;
  }
  .weather-temp-lockup {
    justify-items: start;
  }
  .weather-vibe-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}


/* =======================
   V17 Borough Invasions + Coffee Cup Rims Patch
======================= */
.v17-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.v17-card {
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 14% 12%, rgba(229,9,20,.22), transparent 32%),
    linear-gradient(145deg, rgba(22,22,22,.98), rgba(5,5,5,.94));
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.v17-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #fff, #e50914 55%, #580008);
}
.invasion-list,
.battle-board,
.rim-shop,
.coffee-receipts,
.rims-wallet {
  display: grid;
  gap: 10px;
}
.invasion-card,
.battle-card,
.rim-shop-card,
.coffee-receipt-card,
.rims-balance-card {
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
  border-radius: 12px;
  padding: 12px;
}
.invasion-card strong,
.battle-card strong,
.rim-shop-card strong,
.coffee-receipt-card strong,
.rims-balance-card strong {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 25px;
  line-height: 1;
}
.invasion-meter,
.battle-meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  margin-top: 8px;
}
.invasion-meter span,
.battle-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e50914, #ffffff);
}
.rims-big {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(56px, 10vw, 88px);
  line-height: .88;
  letter-spacing: .04em;
  color: #fff;
  text-shadow: 0 2px 0 #000, 0 0 28px rgba(229,9,20,.35);
}
.rims-coin {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 25%, #fff 0%, #ffd9d9 12%, #e50914 34%, #70000a 72%, #140000 100%);
  border: 2px solid rgba(255,255,255,.65);
  box-shadow: 0 0 0 6px rgba(229,9,20,.12), 0 18px 36px rgba(0,0,0,.45);
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 25px;
  color: #fff;
}
.coffee-preview {
  min-height: 120px;
  border: 1px dashed rgba(255,255,255,.2);
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: rgba(0,0,0,.22);
}
.coffee-preview img {
  width: 100%;
  max-height: 210px;
  object-fit: cover;
}
.file-input {
  padding: 12px;
  height: auto;
}
.rim-shop-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 10px;
  align-items: center;
}
.rim-price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.invasion-marker {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(180deg, #fff 0%, #ff3045 35%, #e50914 100%);
  border: 2px solid rgba(255,255,255,.92);
  box-shadow: 0 0 0 10px rgba(229,9,20,.20), 0 18px 38px rgba(0,0,0,.55);
}
.invasion-marker span {
  transform: rotate(45deg);
  font-size: 21px;
}
@media (max-width: 680px) {
  .v17-grid,
  .rim-shop-card {
    grid-template-columns: 1fr;
  }
}


/* =======================
   V18 Real Weird Ting Uploads
======================= */
.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}
.reaction-chip {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-family: "Rajdhani", sans-serif;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}
.reaction-chip:hover {
  border-color: rgba(229,9,20,.55);
  background: rgba(229,9,20,.16);
}
.weird-card .danger-btn {
  min-height: 38px;
}


/* =======================
   V18.1 Weird Ting Image Display Fix
======================= */
.weird-card {
  align-items: start;
}

.weird-card .weird-photo:not(.placeholder) {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 420px;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  background: #050505;
}

.weird-card .weird-photo.small:not(.placeholder) {
  max-height: 260px;
}

.weird-image-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(229,9,20,.16), transparent 40%),
    #050505;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 18px 34px rgba(0,0,0,.28);
}

.weird-image-wrap .weird-photo {
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

@media (max-width: 680px) {
  .weird-card .weird-photo:not(.placeholder) {
    max-height: 520px;
  }
}


/* =======================
   V19 Real GPS Check-ins + Borough Boundaries
======================= */
.v19-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.v19-card {
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 18% 10%, rgba(229,9,20,.22), transparent 32%),
    linear-gradient(145deg, rgba(22,22,22,.98), rgba(5,5,5,.94));
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.v19-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #fff, #e50914 55%, #580008);
}
.gps-live-card,
.gps-history-list {
  display: grid;
  gap: 9px;
}
.gps-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.045);
  border-radius: 12px;
  padding: 9px 10px;
}
.gps-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.gps-row strong {
  color: #fff;
  text-align: right;
}
.gps-history-item {
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.045);
  border-radius: 12px;
  padding: 10px;
}
.gps-history-item strong {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 22px;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
}
@media (max-width: 680px) {
  .v19-grid {
    grid-template-columns: 1fr;
  }
  .gps-row {
    display: grid;
  }
  .gps-row strong {
    text-align: left;
  }
}


/* =======================
   V20 Real Hype Pin Engine
======================= */
.hype-row.real-hype {
  border-color: rgba(229,9,20,.38);
  background:
    radial-gradient(circle at 12% 18%, rgba(229,9,20,.24), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
}
.hype-source-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  color: #fff;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.hype-history-list {
  display: grid;
  gap: 10px;
}
.hype-history-item {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.045);
  border-radius: 12px;
  padding: 10px 12px;
}
.hype-history-item strong {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 23px;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
}
.hype-marker.real {
  animation: hypePulse 1.45s infinite;
}
@keyframes hypePulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(229,9,20,.0)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 14px rgba(229,9,20,.65)); transform: scale(1.06); }
}
