/* Map route owns the viewport; only the expanded bottom sheet can scroll. */
body.geo-active {
  overflow: hidden;
  height: 100dvh;
  overscroll-behavior: none;
}
.geo-active .game-topbar,
.geo-active .player-bar {
  display: none;
}
.geo-active .game-shell {
  max-width: none;
  padding: 0;
}
.geo-active #game-stage {
  position: fixed;
  inset: 0 0 115px;
  padding: 0;
  animation: none;
  overflow: hidden;
}
.geo-active .geo-layout {
  display: block;
  position: absolute;
  inset: 0;
}
.geo-active .geo-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: radial-gradient(ellipse at 45% 45%, #152c3e, #091a2b);
}
.geo-active .geo-countries path {
  fill: #28424f;
  stroke: #849caa;
  stroke-width: 0.8;
}
.geo-active .geo-states path {
  stroke: #8298a5;
  stroke-width: 0.7;
}
.geo-active .geo-toolbar {
  position: absolute;
  left: 18px;
  top: max(14px, env(safe-area-inset-top));
  z-index: 5;
  width: min(430px, calc(100% - 92px));
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  margin: 0;
  pointer-events: none;
}
.geo-toolbar > * {
  pointer-events: auto;
}
.geo-back {
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #5a8099;
  border-radius: 15px;
  background: #122a40ec;
  box-shadow: 0 5px 18px #0004;
  color: #e1f7ff;
  font-size: 24px;
}
.geo-active .geo-toolbar .search {
  width: 100%;
  height: 46px;
  min-height: 46px;
  min-width: 0;
  background: #122a40ef;
  border: 1px solid #5a8099;
  border-radius: 15px;
  box-shadow: 0 5px 18px #0004;
  font-size: 14px;
  padding: 0 14px;
}
.geo-active .geo-presets {
  grid-column: 2;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #102a3fed;
  border: 1px solid #486a80;
  box-shadow: 0 4px 14px #0003;
}
.geo-active .geo-presets button {
  flex: 1;
  min-height: 32px;
  padding: 0 9px;
  font-size: 11px;
  border: 0;
  background: transparent;
  border-radius: 8px;
}
.geo-presets button[aria-pressed="true"] {
  background: #397a9b;
  color: #fff;
}
.geo-active .geo-zoom {
  left: auto;
  right: 14px;
  top: max(14px, env(safe-area-inset-top));
  gap: 0;
  overflow: hidden;
  border: 1px solid #5a8099;
  border-radius: 14px;
  box-shadow: 0 5px 18px #0005;
}
.geo-active .geo-zoom button {
  width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: #122a40ec;
}
.geo-active .geo-zoom button + button {
  border-top: 1px solid #46637b;
}
.geo-active .geo-sidebar {
  position: absolute;
  z-index: 6;
  left: 18px;
  bottom: 16px;
  width: 360px;
  max-width: calc(100% - 36px);
  height: 64px;
  max-height: calc(100% - 124px);
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #10263bea;
  border: 1px solid #56758c;
  box-shadow: 0 10px 35px #0006;
  backdrop-filter: blur(18px);
  transition: height 0.22s ease;
}
.geo-active .geo-sidebar[data-state="selected"] {
  height: 240px;
}
.geo-active .geo-sidebar[data-state="expanded"] {
  height: 65%;
}
.geo-sheet-handle {
  height: 62px;
  min-height: 62px;
  display: flex;
  align-items: center;
  position: relative;
  gap: 8px;
  width: 100%;
  border: 0;
  padding: 16px 24px 0;
  background: none;
  color: #f0f8ff;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  touch-action: none;
}
.geo-grabber {
  position: absolute;
  top: 9px;
  left: calc(50% - 18px);
  width: 36px;
  height: 4px;
  background: #91a8bd88;
  border-radius: 9px;
}
.geo-sheet-handle small {
  color: #9edaff;
  font-size: 12px;
  margin-left: 6px;
}
.geo-sheet-chevron {
  margin-left: auto;
  font-size: 21px;
  color: #97cfe9;
}
[data-state="expanded"] .geo-sheet-chevron {
  transform: rotate(180deg);
}
.geo-sheet-body {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  min-height: 0;
  flex: 1;
  padding: 0 20px 18px;
}
[data-state="collapsed"] .geo-sheet-body {
  visibility: hidden;
}
.geo-active .geo-sidebar[data-state="selected"] .geo-results-head,
.geo-active .geo-sidebar[data-state="selected"] #geo-results {
  display: none;
}
.geo-active #geo-results {
  overflow: visible;
  min-height: 0;
}
.geo-sheet-close {
  display: none;
  position: absolute;
  right: 15px;
  top: 68px;
  z-index: 2;
  background: #23435a;
  color: #dbefff;
  border: 0;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 23px;
  cursor: pointer;
}
.geo-active .geo-sidebar[data-state="selected"] .geo-sheet-close {
  display: block;
}
.geo-active .geo-selected {
  padding-right: 28px;
  gap: 12px;
}
.geo-active .geo-selected h2 {
  font-size: 17px;
  margin: 0 0 5px;
}
.geo-active .geo-selected img {
  width: 42px;
  height: 42px;
}
.geo-active .geo-league {
  margin: 10px 0;
  font-size: 11px;
}
.geo-active .geo-sidebar .button {
  min-height: 42px;
  border-radius: 12px;
}
.geo-active .geo-city {
  color: #c0d0da;
  font-size: 10px;
  transform: translate(5px, 22px);
}
.geo-active .geo-pin {
  width: 40px;
  height: 40px;
  border-width: 2px;
  background: #102b42f5;
  box-shadow: 0 5px 12px #0007;
}
.geo-active .geo-pin.selected {
  box-shadow:
    0 0 0 7px #ffc06b33,
    0 6px 18px var(--nexus-color-0008);
  transform: translate(-50%, -50%) scale(1.12);
}
.geo-active .geo-location-note {
  position: absolute;
  right: 14px;
  bottom: 28px;
  font-size: 9px;
  color: #aec2d2;
  pointer-events: none;
  text-shadow: 0 1px 4px #000;
}
.geo-active .geo-credit {
  bottom: 7px;
  right: 10px;
}
@media (max-width: 800px) {
  .geo-active #game-stage {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .geo-active .geo-toolbar {
    left: 10px;
    top: max(10px, env(safe-area-inset-top));
    width: calc(100% - 72px);
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 7px;
  }
  .geo-active .geo-toolbar .search {
    font-size: 12px;
    padding: 0 10px;
  }
  .geo-back {
    font-size: 22px;
  }
  .geo-active .geo-zoom {
    right: 9px;
    top: max(10px, env(safe-area-inset-top));
  }
  .geo-active .geo-zoom button {
    width: 40px;
  }
  .geo-active .geo-presets {
    grid-column: 1/-1;
    width: auto;
  }
  .geo-active .geo-presets button {
    font-size: 10px;
    min-height: 30px;
    padding: 0 8px;
  }
  .geo-active .geo-sidebar {
    left: 8px;
    bottom: 6px;
    width: calc(100% - 16px);
    max-width: none;
    border-radius: 22px;
    height: 62px;
    max-height: calc(100% - 112px);
  }
  .geo-active .geo-sidebar[data-state="selected"] {
    height: 232px;
  }
  .geo-active .geo-sidebar[data-state="expanded"] {
    height: 68%;
  }
  .geo-active .geo-location-note {
    bottom: 77px;
    right: 12px;
  }
  .geo-active .geo-credit {
    bottom: 92px;
    right: 9px;
  }
  .geo-active .geo-pin {
    width: 36px;
    height: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .geo-active .geo-sidebar {
    transition: none;
  }
}

/* The map spans the entire display, including wide desktop viewports. */
body:has(#geo-map) .game-shell { max-width: none; margin: 0; }
body:has(#geo-map) #game-stage {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  margin: 0;
  box-sizing: border-box;
  animation: none;
}
body:has(#geo-map) .geo-layout { position: absolute; inset: 0; display: block; overflow: hidden; }
body:has(#geo-map) .geo-map { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: #091a2b88; }
body:has(#geo-map) .geo-countries path { fill: #28424fec; stroke: #849caaaa; }
body:has(#geo-map) .geo-states path { stroke: #8298a58c; }

/* A stack communicates several clans without overlapping independent logos. */
.geo-active .geo-pin.geo-pin-cluster{
  overflow:visible;isolation:isolate;
  box-shadow:0 0 0 3px #071522,0 0 0 5px #64bce080,0 5px 16px #0009;
}
.geo-active .geo-pin.geo-pin-cluster b{
  position:absolute;right:-9px;top:-9px;min-width:22px;height:22px;
  padding:0 4px;display:grid;place-items:center;border-radius:50%;
  background:#153a55;color:#fff;border:2px solid #a3e5ff;
  font-size:11px;font-weight:900;box-shadow:0 2px 5px #0009;
}

.geo-active .geo-pin.geo-pin-cluster{border-radius:11px;border-color:#a8e8ff;box-shadow:4px -4px 0 -1px #24465d,4px -4px 0 1px #80bdd3,8px -8px 0 -1px #193248,8px -8px 0 1px #608ba5,0 5px 15px #0009}
.geo-active .geo-pin.geo-pin-cluster b{background:linear-gradient(#ffe59c,#b97519);border-color:#ffedb5;color:#392306;text-shadow:0 1px #fff5}
.geo-fan-origin{position:absolute;width:9px;height:9px;border-radius:50%;background:#ffe2a1;box-shadow:0 0 12px #ffcc68;transform:translate(-50%,-50%);pointer-events:none}
.geo-fan-line{position:absolute;height:1px;background:linear-gradient(90deg,#ffdc8b99,#8fe4ff88);transform-origin:left center;pointer-events:none}
.geo-active .geo-pin.geo-fan-crest{border-radius:12px;border-color:#a8e8ff;background:linear-gradient(145deg,#305d78,#10283e);animation:crest-unfold .3s ease-out both;animation-delay:var(--fan-delay,0ms)}
.geo-active .geo-pin.geo-fan-crest.selected{border-color:#ffe19a;box-shadow:0 0 0 3px #ffd07035,0 0 20px #e5b85366}
@keyframes crest-unfold{from{opacity:0;scale:.65}to{opacity:1;scale:1}}
@media(prefers-reduced-motion:reduce){.geo-active .geo-pin.geo-fan-crest{animation:none}}
