/* Delad zonkarta (/zon + Räder) – Components/Shared/Zones/ZoneWorldMap.razor + wwwroot/zone-world.js.
   Samma bildspråk som /zon (mörkblå) med räd-rött/guld för mål. Endast CSS, inga bibliotek. */
.zw { position: relative; --zw-blue: #42a5f5; --zw-red: #e5533f; --zw-gold: #e8c15a; --zw-gold-hi: #ffdf8a; --zw-green: #52d273;
  --zw-ink: #0d1117; --zw-line: rgba(66, 165, 245, .22); }
.zw-map { width: 100%; background: #1a2332; position: relative; border-radius: inherit; }
.zw-loading { position: absolute; inset: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 40%, #13233a, #0d1117 70%); color: #78909c; font-size: 13px; }
.zw-loading .zw-radar { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--zw-line); position: relative; overflow: hidden;
  background: repeating-radial-gradient(circle, transparent 0 10px, rgba(66,165,245,.12) 10px 11px); }
.zw-loading .zw-radar::after { content: ""; position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(66,165,245,.55), transparent 28%);
  animation: zw-spin 1.6s linear infinite; }
@keyframes zw-spin { to { transform: rotate(360deg); } }

/* Teckenförklaring */
.zw-legend { position: absolute; left: 10px; bottom: 10px; z-index: 450; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; max-width: calc(100% - 120px); }
.zw-legend span { background: rgba(13, 17, 23, .82); border: 1px solid var(--zw-line); color: #cfd8dc; font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; backdrop-filter: blur(4px); }
.zw-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.zw-legend .you i { background: #1976d2; box-shadow: 0 0 0 2px rgba(25,118,210,.35); }
.zw-legend .enemy i { background: var(--zw-red); }
.zw-legend .gang i { background: var(--zw-green); }

/* Pins */
.zw-pin-wrap { background: none; border: 0; }
.zw-pin { display: flex; align-items: center; gap: 5px; justify-content: center; margin: 0 auto; width: max-content; max-width: 150px;
  padding: 3px 4px 3px 9px; border-radius: 999px; font: 800 11px/1.2 'Roboto', sans-serif; letter-spacing: .02em; color: #fff; position: relative;
  background: linear-gradient(180deg, #ef6a55, #b8352a); box-shadow: 0 2px 10px rgba(229, 83, 63, .55), inset 0 1px 0 rgba(255,255,255,.25);
  text-shadow: 0 1px 2px rgba(0,0,0,.6); transition: transform .15s; cursor: pointer; }
.zw-pin.gang { background: linear-gradient(180deg, #5fd889, #23874a); box-shadow: 0 2px 10px rgba(82, 210, 115, .45), inset 0 1px 0 rgba(255,255,255,.25); }
.zw-pin-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zw-pin-lv { background: rgba(0,0,0,.35); border-radius: 999px; padding: 1px 6px; font-size: 10px; }
.zw-pin .zw-dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--zw-green); border: 2px solid #0d1117;
  box-shadow: 0 0 0 0 rgba(82,210,115,.7); animation: zw-online 1.8s infinite; }
@keyframes zw-online { 70% { box-shadow: 0 0 0 7px rgba(82,210,115,0); } 100% { box-shadow: 0 0 0 0 rgba(82,210,115,0); } }
.zw-pin-tip { width: 0; height: 0; margin: 0 auto; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid #b8352a; }
.zw-pin.gang + .zw-pin-tip { border-top-color: #23874a; }
.zw-pin-wrap:hover .zw-pin { transform: translateY(-2px) scale(1.04); }
.zw-pin.sel { background: linear-gradient(180deg, var(--zw-gold-hi), var(--zw-gold)); color: #1a1206; text-shadow: none;
  box-shadow: 0 0 0 3px rgba(232,193,90,.35), 0 4px 16px rgba(232,193,90,.6); transform: scale(1.08); }
.zw-pin.sel + .zw-pin-tip { border-top-color: var(--zw-gold); }
.zw-zone.sel { animation: zw-sel 1.6s ease-in-out infinite; }
@keyframes zw-sel { 50% { stroke-opacity: .45; } }

/* Popup */
.zw-popup .leaflet-popup-content-wrapper { background: linear-gradient(160deg, #111a27, #0d1117 70%); color: #e8f5e9; border-radius: 14px;
  border: 1px solid rgba(229, 83, 63, .45); box-shadow: 0 10px 30px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.4); padding: 0; }
.zw-popup .leaflet-popup-content { margin: 0; min-width: 250px; }
.zw-popup .leaflet-popup-tip { background: #0f1621; border: 1px solid rgba(229, 83, 63, .45); }
.zw-popup a.leaflet-popup-close-button { color: #78909c; top: 6px; right: 6px; }
.zw-pop { padding: 12px 12px 10px; font-family: 'Roboto', sans-serif; }
.zw-pop.gang { --acc: var(--zw-green); } .zw-pop.enemy { --acc: var(--zw-red); }
.zw-pop-head { display: flex; gap: 10px; align-items: center; padding-right: 16px; }
.zw-pop-av { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.12), rgba(0,0,0,.2)); border: 1px solid var(--acc); box-shadow: 0 0 12px color-mix(in srgb, var(--acc) 40%, transparent); }
.zw-pop-id { min-width: 0; }
.zw-pop-name { font-weight: 900; font-size: 15px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zw-tag { color: var(--zw-gold); font-weight: 700; font-size: 12px; }
.zw-pop-sub { font-size: 12px; color: #90a4ae; margin-top: 1px; }
.zw-on { color: var(--zw-green); font-weight: 700; }
.zw-pop-meta { display: flex; flex-wrap: wrap; gap: 4px; margin: 9px 0 10px; }
.zw-pop-meta span { font-size: 11px; color: #b0bec5; background: rgba(66,165,245,.08); border: 1px solid rgba(66,165,245,.18); border-radius: 999px; padding: 2px 7px; }
.zw-pop-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.zw-act { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.zw-btn { font: 700 13px/1 'Oswald', 'Roboto', sans-serif; letter-spacing: .08em; text-transform: uppercase; border: 0; border-radius: 9px; cursor: pointer;
  padding: 10px 6px; color: #fff; transition: transform .12s, filter .12s; min-height: 38px; }
.zw-btn.raid { background: linear-gradient(180deg, #e0503f, #c0392b); box-shadow: 0 3px 0 #4a0f0d; }
.zw-btn.attack { background: linear-gradient(180deg, var(--zw-gold-hi), var(--zw-gold)); color: #1a1206; box-shadow: 0 3px 0 #7a5d18; }
.zw-btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.zw-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.zw-btn:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.6); box-shadow: none; }
.zw-why { color: #f28b82; font-size: 10.5px; line-height: 1.25; text-align: center; }
.zw-meta { color: #c9b98f; font-size: 10.5px; text-align: center; font-weight: 700; }
.zw-pop-prof { display: block; text-align: right; margin-top: 8px; font-size: 11.5px; color: var(--zw-blue); text-decoration: none; }
.zw-pop-prof:hover { text-decoration: underline; }

/* Mål-ark under kartan (befintliga RÅNA/ATTACKERA/DÖDA-komponenten från /profile) */
.zw-sheet { position: relative; margin-top: 10px; background: linear-gradient(160deg, #111a27, #0d1117 70%); border: 1px solid rgba(229, 83, 63, .4);
  border-radius: 14px; padding: 12px 14px; animation: zw-up .22s ease-out; }
@keyframes zw-up { from { opacity: 0; transform: translateY(8px); } }
.zw-sheet-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.zw-sheet-head .n { font-weight: 900; color: #fff; font-size: 16px; }
.zw-sheet-head .s { color: #90a4ae; font-size: 12px; }
.zw-sheet-head .sp { flex: 1; }
.zw-sheet-btn { font: 700 12px/1 'Oswald', 'Roboto', sans-serif; letter-spacing: .08em; text-transform: uppercase; border-radius: 8px; padding: 8px 12px; cursor: pointer;
  border: 1px solid rgba(66,165,245,.35); background: rgba(66,165,245,.1); color: #cfe8ff; text-decoration: none; }
.zw-sheet-btn.raid { background: linear-gradient(180deg, #e0503f, #c0392b); border-color: transparent; color: #fff; }
.zw-sheet-btn:disabled { opacity: .4; cursor: not-allowed; }
.zw-sheet .pa-box { margin-top: 10px; }

.zw-cluster { padding: 12px 12px 10px; }
.zw-cl-head { font-size: 12px; font-weight: 800; letter-spacing: .3px; color: #ffd27a; margin-bottom: 8px; }
.zw-cl-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.zw-cl-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 8px 10px;
  border-radius: 10px; border: 1px solid rgba(229, 83, 63, .45); background: rgba(229, 83, 63, .08); color: #e8f5e9; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.zw-cl-item.gang { border-color: rgba(82, 210, 115, .45); background: rgba(82, 210, 115, .08); }
.zw-cl-item:hover, .zw-cl-item:focus-visible { filter: brightness(1.2); outline: none; }
.zw-cl-item .lv { color: #9fb3c8; font-size: 11px; white-space: nowrap; }

@media (max-width: 640px) {
  .zw-legend { left: 6px; bottom: 6px; max-width: calc(100% - 90px); }
  .zw-legend span { font-size: 10px; padding: 2px 6px; }
  .zw-pin { max-width: 110px; font-size: 10px; }
  .zw-popup .leaflet-popup-content { min-width: 230px; }
}
@media (prefers-reduced-motion: reduce) {
  .zw-pin .zw-dot, .zw-zone.sel, .zw-loading .zw-radar::after, .zw-sheet { animation: none; }
}

/* Räder-sidan: kartan i planeringspanelen */
.rd-geo { border-radius: 12px; overflow: hidden; border: 1px solid var(--rd-line, rgba(232,193,90,.22)); box-shadow: inset 0 0 40px rgba(0,0,0,.6); }
.rd-geo + .zw-sheet, .rd-geo .zw-sheet { font-family: 'Roboto', sans-serif; letter-spacing: 0; }
