/* Web map (D-250, D-262): full-height map in the site's night-blue and gold theme, with floating panels. */
.worldmap { padding: 88px 10px 10px; }
.worldmap__empty { padding: clamp(6rem, 16vh, 9rem) 0 6rem; text-align: center; }
.worldmap__frame { position: relative; height: calc(100vh - 98px); height: calc(100dvh - 98px); border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(246, 237, 214, .14); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.worldmap__canvas { position: absolute; inset: 0; background: var(--bg); }
.worldmap__offline { margin: 0 0 8px; padding: .55rem 1rem; border-radius: 10px; background: rgba(217, 168, 64, .15);
  border: 1px solid rgba(241, 201, 106, .45); color: var(--gold-light); font-size: .9rem; text-align: center; }
.worldmap__offline:not([hidden]) + .worldmap__frame { height: calc(100vh - 98px - 46px); height: calc(100dvh - 98px - 46px); }
.worldmap__status { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 800; padding: .5rem 1rem;
  border-radius: 10px; background: rgba(12, 26, 48, .92); color: var(--text); font-size: .85rem; }

/* Panels and chips */
.map-chips { position: absolute; top: 10px; left: 56px; z-index: 800; display: flex; gap: 6px; flex-wrap: wrap; }
.map-chip, .map-panel { background: rgba(12, 26, 48, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(246, 237, 214, .14); border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); color: var(--text); }
.map-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.map-chip strong { color: var(--gold-light); font-weight: 600; }
.map-dot { width: 8px; height: 8px; border-radius: 50%; background: #f1c96a; box-shadow: 0 0 6px currentColor; }
.map-dot.is-live { background: #5fd28a; }
.map-dot.is-off { background: #ef6b73; }
.map-panel { position: absolute; z-index: 800; right: 10px; width: 270px; display: flex; flex-direction: column; overflow: hidden; }
.map-panel--players { top: 10px; max-height: calc(50% - 20px); }
.map-panel--nations { bottom: 10px; max-height: calc(50% - 20px); }
.map-panel__title { margin: 0; padding: 10px 12px 8px; font: 13px var(--font-display); text-transform: uppercase; letter-spacing: .05em;
  color: var(--cream); display: flex; align-items: center; gap: 8px; }
.map-panel__empty { margin: 0; padding: 4px 12px 12px; color: var(--muted); font-size: 13px; }
.map-badge { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--gold); color: #08111f; font: 600 10px var(--font-body);
  letter-spacing: .03em; text-transform: none; }
.map-list { list-style: none; margin: 0; padding: 0 6px 8px; overflow-y: auto; }
.map-list li { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.map-list li:hover, .map-list li.is-active { background: rgba(246, 237, 214, .07); }
.map-list li.is-active { box-shadow: inset 2px 0 0 var(--gold); }
.map-list__main { min-width: 0; flex: 1; }
.map-list__name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-list__sub { display: block; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-list__flag { width: 26px; height: 17px; object-fit: cover; border-radius: 2px; flex: none; }
.map-switch { display: flex; align-items: center; gap: 8px; padding: 0 12px 8px; font-size: 13px; cursor: pointer; user-select: none; }
.map-switch input { position: absolute; opacity: 0; pointer-events: none; }
.map-switch__track { position: relative; width: 30px; height: 17px; border-radius: 999px; background: rgba(246, 237, 214, .18); transition: background .2s; flex: none; }
.map-switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--cream); transition: transform .2s; }
.map-switch input:checked + .map-switch__track { background: var(--gold); }
.map-switch input:checked + .map-switch__track::after { transform: translateX(13px); }
.map-switch input:focus-visible + .map-switch__track { outline: 2px solid var(--gold-light); outline-offset: 2px; }

/* Heads: the front render cropped on the face (75 % of the side, from 3 % of the top) */
.head { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: #10203a;
  display: grid; place-items: center; color: var(--cream); font: 600 13px var(--font-body); }
.head img { position: absolute; width: 133.3%; height: 133.3%; max-width: none; left: -16.7%; top: -4%; object-fit: cover; }

/* Map content */
.map-tile { display: block; width: 100%; height: 100%; border: 0; }
.leaflet-container { font-family: var(--font-body); background: var(--bg); }
.map-label { pointer-events: none; white-space: nowrap; text-align: center; transform: translate(-50%, -50%); font: 14px var(--font-display);
  text-transform: uppercase; letter-spacing: .08em; color: #fff; text-shadow: 0 0 3px #000, 0 0 6px #000, 0 0 10px var(--halo, #000); }
.map-label__star { color: var(--gold-light); margin-right: 3px; }
.map-capital { color: var(--gold-light); font-size: 18px; line-height: 1; text-shadow: 0 0 3px #000, 0 0 6px #000; transform: translate(-50%, -50%); }
.map-names-off .map-label { display: none; }

.map-player { position: relative; width: 36px; height: 36px; transform: translate(-50%, -50%); transition: transform .15s; }
.map-player:hover { transform: translate(-50%, -50%) scale(1.15); }
.map-player .head { width: 36px; height: 36px; border: 3px solid var(--ring, var(--cream)); box-shadow: 0 2px 8px rgba(0, 0, 0, .6); font-size: 15px; }
.map-player__arrow { position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -27px 0 0 -5px; border: 5px solid transparent;
  border-bottom: 8px solid var(--ring, var(--cream)); transform-origin: 5px 27px; filter: drop-shadow(0 0 2px #000); }
.map-player__name { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 600 11px var(--font-body);
  color: #fff; text-shadow: 0 0 3px #000, 0 0 5px #000; }
.map-far .map-player { transform: translate(-50%, -50%) scale(.8); }
.map-far .map-player__name { display: none; }

/* Popups and zoom buttons in the site colors */
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #10203a; color: var(--text); border: 1px solid rgba(246, 237, 214, .14);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.leaflet-popup-content-wrapper { border-radius: 10px; }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.map-pop { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.map-pop .head { width: 44px; height: 44px; border: 2px solid var(--ring, var(--cream)); font-size: 18px; }
.map-pop__flag { height: 26px; width: auto; border-radius: 3px; }
.map-pop__name { margin: 0; font: 16px var(--font-display); color: var(--cream); }
.map-pop table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.map-pop td { padding: 2px 0; }
.map-pop td:first-child { color: var(--muted); padding-right: 12px; }
.map-pop td:last-child { text-align: right; }
.map-pop a { color: var(--gold-light); font-weight: 600; }
.leaflet-bar a, .leaflet-bar a:hover { background: rgba(12, 26, 48, .92); color: var(--cream); border-bottom-color: rgba(246, 237, 214, .14); }
.leaflet-bar a:hover { color: var(--gold-light); }
.leaflet-bar { border: 1px solid rgba(246, 237, 214, .14) !important; border-radius: 10px !important; overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, .3) !important; }

/* Phones: no coordinates, players at the bottom over the full width, no Nations panel */
@media (max-width: 699px) {
  .worldmap { padding: 80px 6px 6px; }
  .map-chips { left: 52px; }
  .map-chip--coords, .map-panel--nations { display: none; }
  .map-panel--players { top: auto; bottom: 6px; left: 6px; right: 6px; width: auto; max-height: 34%; }
}
