/* Eigene Klassen haben "g-", weil das Karten-SVG globale Klassen wie .building und .floor mitbringt. */
:root {
  --bg: #101416;
  --panel: #171d20;
  --raised: #20282c;
  --line: #2d373c;
  --text: #e6e9e7;
  --muted: #98a5a6;
  --open: #62d58a;
  --need: #f2b84b;
  --maybe: #f08a4b;
  --old: #8b9294;
  --transit: #62b5f0;
  --boss: #ef5d5d;
  --loot: #f4d56a;
  --key: #c897f5;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  height: 100dvh;
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Seitenleiste */
.g-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.g-head { padding: 18px 18px 12px; }
.g-head h1 { margin: 0; font: 700 36px/1.1 Bahnschrift, "Segoe UI", sans-serif; }
.g-brand { display: block; width: fit-content; margin-bottom: 6px; }
.g-brand img { display: block; height: 48px; max-width: 100%; }
.g-choice-logo { display: block; height: 88px; max-width: 100%; margin: 4px auto 18px; }
/* Kopf der Map-Auswahl mittig unter dem Logo */
#map-choice .g-kicker, #map-choice #map-choice-title { text-align: center; }
.g-maps { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; }
.g-maps a {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.g-maps a:hover { color: var(--text); background: var(--raised); }
.g-maps a.is-on { color: var(--bg); background: var(--text); border-color: var(--text); }
.g-kicker { margin: 0; color: var(--muted); font-size: 12px; }
.g-meta { margin: 4px 0 12px; color: var(--muted); }

.g-segment { display: flex; gap: 4px; }
.g-segment button {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--raised);
}
.g-segment button.is-on { background: var(--text); color: var(--bg); }

#search {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
}

.g-tabs { display: flex; padding: 0 10px; border-bottom: 1px solid var(--line); }
.g-tabs button {
  flex: auto;
  padding: 9px 4px;
  white-space: nowrap;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
}
.g-tabs button.is-on { color: var(--text); border-bottom-color: var(--loot); }

.g-panel { flex: 1; overflow-y: auto; padding: 6px 10px 18px; }
.g-panel h2 { margin: 16px 8px 4px; font-size: 13px; color: var(--muted); }
.g-panel p { margin: 6px 8px; color: var(--muted); }

.g-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 5px;
  background: none;
  text-align: left;
}
.g-row:hover, .g-row:focus-visible { background: var(--raised); }
.g-row b, .g-row small { display: block; }
.g-row small { color: var(--muted); }

.g-check { display: flex; align-items: center; gap: 10px; padding: 6px 8px; cursor: pointer; }
.g-check input { margin: 0; }
.g-check output { margin-left: auto; color: var(--muted); }

.g-credit { padding: 8px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.g-credit a { color: inherit; }

/* Symbole */
.g-icon {
  --c: var(--old);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #0b0e0f;
  border-radius: 5px;
  background: var(--c);
  color: #0b0e0f;
  font: 700 14px/1 "Segoe UI Symbol", "Segoe UI", sans-serif;
}
.g-open { --c: var(--open); }
.g-need { --c: var(--need); }
.g-maybe { --c: var(--maybe); }
.g-transit { --c: var(--transit); }
.g-boss { --c: var(--boss); border-radius: 50%; }
.g-spot { --c: var(--loot); border-radius: 50%; }
/* S-Tier: größer, goldener Verlauf, leuchtet und pulsiert, damit es sich klar von A/B abhebt */
.g-spot.g-tier-S {
  position: relative;
  scale: 1.3;
  border-color: #3a2a00;
  background: radial-gradient(circle at 35% 30%, #fff6c4, #ffd23a 45%, #e59a00);
  box-shadow: 0 0 0 2px #fff3b0, 0 0 12px 3px #ffc21acc, 0 0 26px 8px #ffb30066;
  font-weight: 900;
  z-index: 1;
}
.leaflet-marker-icon .g-spot.g-tier-S::after { /* Puls nur auf der Karte, nicht in Listen */
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid #ffd23a;
  border-radius: 50%;
  animation: g-s-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes g-s-pulse { from { opacity: .9; scale: 1; } to { opacity: 0; scale: 1.9; } }
@media (prefers-reduced-motion: reduce) { .leaflet-marker-icon .g-spot.g-tier-S::after { animation: none; opacity: .6; } }
/* A und B etwas zurücknehmen, damit der Abstand zu S deutlich ist */
.g-spot.g-tier-B { --c: #d9c27a; }
/* Schlüssel-Tür: nur ein lila Schlüssel mit dunkler Kontur, kein Kreis (vom User gewählt, Variante B) */
.g-key {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%230b0e0f' stroke-width='5.2'%3E%3Ccircle cx='8' cy='8' r='4.2'/%3E%3Cpath d='M11 11 L20 20 M16.5 16.5 L19 14 M18.5 18.5 L21 16'/%3E%3C/g%3E%3Cg stroke='%23c897f5' stroke-width='2.6'%3E%3Ccircle cx='8' cy='8' r='4.2'/%3E%3Cpath d='M11 11 L20 20 M16.5 16.5 L19 14 M18.5 18.5 L21 16'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 1px #000);
}
.g-lever { --c: var(--need); border-radius: 50%; }
.g-valuable { --c: var(--loot); width: 13px; height: 13px; border-radius: 2px; transform: rotate(45deg); }
.g-box { --c: #b9c5c9; width: 11px; height: 11px; border-radius: 2px; }
.g-weapons { --c: #f08a4b; }
.g-tech { --c: #62b5f0; }
.g-med { --c: #ff7474; }
.g-stash { --c: #9bdc5a; }
.g-card-small { max-width: 200px; }
/* Hinweis im Hover statt Vorschaubild, das Bild öffnet sich beim Klick */
.g-photo-hint { margin-top: 8px; color: var(--muted); font-size: 12px; }
.g-photo-hint::before { content: '▣ '; color: var(--loot); }
.g-stash-photo { display: block; width: 180px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 4px; margin-bottom: 6px; }
.g-stash-route { width: 13px; height: 13px; border-width: 2px; box-shadow: 0 0 0 1.5px #9bdc5a88, 0 0 6px #9bdc5a99; }
.g-safe { --c: #ff9fd0; width: 14px; height: 14px; border-radius: 2px; }
.g-loose { --c: #8fb8a0; width: 9px; height: 9px; border-radius: 50%; }
/* Spawns: Spieler-Figur (Kopf + Schultern, vom User gewählt), nicht mit den runden Routenpunkten zu verwechseln.
   Die Form ist eine Maske, die Farbe kommt aus --c (PMC lila, Scav grün, Gegner rot). */
.g-spawn {
  --c: #b9a4ff;
  position: relative;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 0;
  background: none;
  filter: drop-shadow(0 0 1px #0b0e0f) drop-shadow(0 0 1px #0b0e0f) drop-shadow(0 0 .5px #0b0e0f);
}
.g-spawn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='7' r='4.6'/%3E%3Cpath d='M3.5 22 C3.5 15.8 7.3 12.8 12 12.8 C16.7 12.8 20.5 15.8 20.5 22 Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='7' r='4.6'/%3E%3Cpath d='M3.5 22 C3.5 15.8 7.3 12.8 12 12.8 C16.7 12.8 20.5 15.8 20.5 22 Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.g-spawn-scav { --c: #c5d989; }
.g-spawn-threat, .is-threat .g-spawn { --c: #ff4f5e; }
.is-threat .g-spawn { filter: drop-shadow(0 0 1px #0b0e0f) drop-shadow(0 0 4px #ff4f5e) drop-shadow(0 0 4px #ff4f5e); }
.g-spawn-big { width: 26px; height: 26px; }
.g-marker:hover .g-spawn, .g-marker.is-hot .g-spawn {
  outline: none;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 2px #fff);
}
.g-danger { --c: var(--boss); }

/* Karte */
.g-stage { position: relative; min-width: 0; min-height: 0; }
#map { height: 100%; background: var(--bg); font: inherit; }

.g-marker { display: grid; place-items: center; }
.g-marker:hover .g-icon, .g-marker.is-hot .g-icon { outline: 3px solid #fff; }
.g-marker.is-off-floor { opacity: .2 !important; }

.g-name {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 4px;
  border-radius: 3px;
  background: #0b0e0fcc;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
}
.g-name.at-top { top: auto; bottom: 100%; }
.g-name.at-right { top: 50%; left: 100%; transform: translate(4px, -50%); }
.g-name.at-left { top: 50%; left: auto; right: 100%; transform: translate(-4px, -50%); }
.g-name.is-hidden, .g-place span.is-hidden { visibility: hidden; }
#map.is-far .g-name, #map.is-tiny .g-place { display: none; }

.g-place { pointer-events: none; }
.g-place span {
  position: absolute;
  transform: translate(calc(-50% + var(--shift-x, 0px)), calc(-50% + var(--shift, 0px)));
  color: #fff;
  font: 600 13px Bahnschrift, "Segoe UI", sans-serif;
  text-shadow: 0 0 3px #000, 0 1px 2px #000;
  white-space: nowrap;
}

.leaflet-tooltip.g-tip,
.g-pop .leaflet-popup-content-wrapper,
.g-pop .leaflet-popup-tip {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}
.leaflet-tooltip.g-tip { width: 290px; padding: 10px 12px; white-space: normal; font: inherit; }
.leaflet-tooltip.g-tip::before { display: none; }
.g-pop .leaflet-popup-content { margin: 12px 14px; font: inherit; }

.g-card h3 { margin: 0; font-size: 16px; }
.g-card .g-sub { color: var(--muted); font-size: 12px; }
.g-card p { margin: 7px 0 0; }
.g-card ul { margin: 6px 0 0; padding: 0; list-style: none; }
.g-card li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; border-top: 1px solid var(--line); }
.g-card .g-warn { color: var(--need); }
.g-card .g-note { color: var(--muted); font-size: 11px; }

/* Ingame-Bilder */
.g-photos { display: grid; gap: 4px; margin: -2px -4px 8px; }
.g-photos.is-many { grid-template-columns: 1fr 1fr; }
.g-photos.is-many .g-photo:first-child { grid-column: 1 / -1; }
.g-photo {
  display: block;
  width: 100%;
  max-height: 200px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: var(--raised);
  cursor: zoom-in;
}
.g-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.g-photo-credit { margin: -4px 0 8px; color: var(--muted); font-size: 11px; }
.g-photo-credit b { color: var(--need); font-weight: 600; }
.g-place.has-photo span { pointer-events: auto; cursor: pointer; text-decoration: underline dotted 1px; text-underline-offset: 3px; }

.g-lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 24px 64px;
  background: #050708f2;
}
.g-lightbox figure { display: grid; gap: 8px; max-width: 100%; max-height: 100%; margin: 0; }
.g-lightbox img { display: block; max-width: 100%; max-height: calc(100dvh - 90px); margin: auto; object-fit: contain; }
.g-lightbox figcaption { color: var(--muted); font-size: 13px; text-align: center; }
.g-lightbox figcaption a { color: var(--text); }
.g-lightbox figcaption b { color: var(--need); font-weight: 600; }
.g-lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  font-size: 24px;
}
.g-lightbox button:hover { background: var(--raised); }
.g-lb-close { top: 16px; right: 16px; }
.g-lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.g-lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 760px) { .g-lightbox { padding: 60px 8px; } .g-lb-prev, .g-lb-next { top: auto; bottom: 12px; transform: none; } }

/* Raid-Planung */
[hidden] { display: none !important; }
.g-icon { font-style: normal; }
.g-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.g-new { padding: 6px 11px; border: 0; border-radius: 5px; background: var(--loot); color: var(--bg); font-weight: 600; }

.g-intro {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  padding: 16px;
  overflow-y: auto;
  background: #0b0e0fd9;
}
.g-intro-box { width: 620px; max-width: 100%; margin: auto; }
.g-intro-box h2 { margin: 4px 0 20px; font: 700 36px/1.15 Bahnschrift, "Segoe UI", sans-serif; }
.g-intro-box p { color: var(--muted); }
.g-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g-choice {
  --c: var(--transit);
  padding: 24px 20px;
  border: 2px solid var(--c);
  border-radius: 8px;
  background: var(--panel);
  text-align: left;
}
.g-choice-scav { --c: var(--open); }
.g-choice:hover, .g-choice:focus-visible { background: var(--raised); }
.g-choice b { display: block; margin-bottom: 6px; color: var(--c); font: 700 32px Bahnschrift, "Segoe UI", sans-serif; }
.g-link { padding: 0; border: 0; background: none; color: var(--muted); text-decoration: underline; }

#map-choice { background: var(--bg); } /* noch keine Map geladen: dahinter wäre nur eine leere Seite */
#map-choice .g-intro-box { width: 920px; }
#map-choice .g-cover-credit { font-size: 11px; }
.g-map-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.g-map-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.g-map-card:hover, .g-map-card:focus-visible {
  border-color: var(--loot);
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px #0008;
}
/* 16:9 wie die Ingame-Screenshots, die als Cover dienen */
.g-map-pic { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0b0e0f; }
.g-map-pic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.g-map-card:hover .g-map-pic img, .g-map-card:focus-visible .g-map-pic img { transform: scale(1.05); }
.g-map-pic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, #171d20e6); }
.g-map-last {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 3px 9px;
  border-radius: 12px;
  background: var(--loot);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
}
/* Schwierigkeit als Eck-Lasche oben rechts, bündig mit der Kartenecke (die Karte schneidet die Rundung) */
.g-map-level {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 11px;
  border-radius: 0 0 0 10px;
  color: #0b0e0f;
  font: 700 12px/1 Bahnschrift, "Segoe UI", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: -1px 1px 6px #0009;
}
.g-map-level i { display: flex; align-items: flex-end; gap: 2px; height: 11px; }
.g-map-level i b { width: 3px; border-radius: 1px; background: currentColor; opacity: .25; }
.g-map-level i b:nth-child(1) { height: 5px; }
.g-map-level i b:nth-child(2) { height: 8px; }
.g-map-level i b:nth-child(3) { height: 11px; }
.g-map-level.is-easy { background: var(--open); }
.g-map-level.is-medium { background: var(--need); }
.g-map-level.is-hard { background: var(--boss); }
.g-map-level.is-easy i b:nth-child(-n+1),
.g-map-level.is-medium i b:nth-child(-n+2),
.g-map-level.is-hard i b { opacity: 1; }
.g-map-body { display: grid; align-content: start; gap: 6px; padding: 4px 18px 16px; margin-top: -26px; position: relative; }
.g-map-body b { font: 700 28px/1.1 Bahnschrift, "Segoe UI", sans-serif; text-shadow: 0 1px 4px #000; }
.g-map-text { color: var(--muted); }
.g-map-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.g-map-chips span { padding: 2px 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); font-size: 12px; }
.g-map-bosses { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.g-map-bosses small, .g-map-bosses .is-none { color: var(--muted); font-size: 12px; }
.g-map-bosses .is-boss { padding: 2px 9px; border: 1px solid #ef5d5d66; border-radius: 12px; background: #ef5d5d1a; color: #ffb0b0; font-size: 12px; }
@media (max-width: 640px) { .g-map-cards { grid-template-columns: 1fr; } }

.g-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 16px;
  width: max-content;
  max-width: calc(100% - 120px);
  padding: 10px 14px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}
.g-banner b, .g-banner small { display: block; }
.g-banner b { font-size: 17px; }
.g-banner small { color: var(--muted); }
.g-banner button, .g-from button {
  flex: none;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--raised);
}
.is-picking .g-floors { display: none; }
.is-picking #map { cursor: crosshair; }

.g-step b {
  display: grid;
  place-items: center;
  flex: none;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: 2px solid #071014;
  border-radius: 13px;
  background: #48d6ff;
  color: #071014;
  font: 700 13px/1 "Segoe UI", sans-serif;
}
.g-step { display: flex; align-items: center; justify-content: center; }
.g-step:hover b, .g-step.is-hot b { outline: 3px solid #fff; }
.g-step-start b { background: #fff; }
.g-step-exit b { background: var(--open); }
.g-step-lever b { background: var(--need); }
.g-route-loot { --c: #48d6ff; border-radius: 50%; }
.g-route-exit { --c: var(--open); border-radius: 50%; }
.g-route-lever { --c: var(--need); border-radius: 50%; }

.g-pad { padding: 4px 8px; }
.g-plan { display: grid; gap: 10px; padding: 10px 8px; }
.g-plan label { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
.g-plan select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.g-from { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.g-from b, .g-from small { display: block; }
.g-from small { color: var(--muted); }
.g-total { display: flex; align-items: baseline; justify-content: space-between; padding: 8px; border-top: 1px solid var(--line); }
.g-total b { font-size: 22px; }
.g-total span { color: var(--muted); }
.g-panel p.g-warn { color: var(--need); }

@media (max-width: 520px) {
  .g-choices { grid-template-columns: 1fr; }
  .g-banner { left: 52px; right: 8px; top: 8px; width: auto; max-width: none; gap: 8px; padding: 6px 8px; transform: none; }
  .g-banner b { font-size: 14px; }
  .g-banner small { font-size: 11px; }
}

.g-key-box {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  max-width: calc(100% - 250px);
  padding: 6px 10px;
  border-radius: 4px;
  background: #0b0e0fd9;
}
.g-key-box label, .g-key-box span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.g-key-box label { cursor: pointer; }
.g-key-box input { margin: 0; }
.g-key-box .g-icon { width: 14px; height: 14px; }
.g-key-box .g-tier-key { gap: 3px; }
.g-key-box .g-tier-key .g-icon { width: 17px; height: 17px; border-width: 1.5px; font-size: 10px; }
.g-key-box .g-tier-key .g-icon:last-of-type { margin-right: 4px; }
.g-key-box .g-tier-key .g-tier-S { scale: 1.1; margin-right: 3px; box-shadow: 0 0 0 1px #fff3b0, 0 0 8px 2px #ffc21acc; }
.g-key-box .g-tier-key .g-tier-S::after { display: none; }
.is-picking .g-key-box { display: none; }
#map.is-tiny .g-icon { transform: scale(0.72); }

/* Stockwerke */
.g-floors { position: absolute; top: 12px; right: 12px; z-index: 1000; }
.g-floors button { white-space: nowrap; }
.g-rotate {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1000;
  display: grid;
  justify-items: center;
  gap: 4px;
  pointer-events: none;
}
.g-compass { display: flex; align-items: center; gap: 4px; }
.g-compass button {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #0b0e0fd9;
  pointer-events: auto;
}
.g-compass button:hover { background: var(--raised); }
.g-turn { width: 36px; height: 36px; font-size: 20px; }
.g-dial { width: 84px; height: 84px; cursor: grab; touch-action: none; }
.g-dial svg { display: block; width: 100%; height: 100%; }
.g-dial text {
  fill: var(--text);
  font: 700 15px "Segoe UI", sans-serif;
  text-anchor: middle;
  dominant-baseline: central;
}
.g-dial text[data-dir="N"] { fill: var(--boss); }
.g-dial { color: var(--text); }
.g-turn-hint { padding: 1px 6px; border-radius: 3px; background: #0b0e0fcc; color: var(--muted); }
#map.is-turning, #map.is-turning .leaflet-interactive { cursor: grabbing; }
#map.is-turning .leaflet-tooltip { display: none; }
/* Grundebene (meist Ground_Level, bei Factory Ground_Floor) bekommt in app.js die Klasse is-base */
.g-svg > svg > g:not(.is-base) { display: none; }
.g-svg > svg > g.is-shown { display: inline; }
.g-svg.has-floor > svg > .is-base { opacity: .3; }
/* Grundrisse (Zimmer, Flure) erst beim Heranzoomen, siehe updateInterior() */
.g-svg.show-interior > svg > g.is-interior { display: inline; }
/* Boden leicht durchscheinend, damit die Gebäudefarbe (z. B. Big Red) durchkommt; Wände und Zimmer bleiben klar */
.g-svg .is-interior .floor { fill-opacity: .72; }
/* Stromleitungen aus der Kartengrafik: wurden für Wege gehalten, deshalb ausgeblendet (Masten bleiben) */
.g-svg [id="Powerlines"] { display: none; }

/* Objekte in Ingame-Farben (guide.decor). SVG-Einheiten sind etwa 1 m, daher dünne Konturen. */
.g-svg .d-part { stroke: #0d1117; stroke-width: .18; stroke-linejoin: round; }
.g-svg .d-silo { fill: url(#d-silo); stroke: #3b2416; stroke-width: .3; }
.g-svg .d-boiler { fill: url(#d-boiler); stroke: #2e1510; stroke-width: .3; }
.g-svg .d-forklift { fill: #f2c230; stroke: #2a2006; stroke-width: .3; }
.g-svg .d-container-blue { fill: #35608f; stroke: #1b3350; }
.g-svg .d-container-red { fill: #8c3b30; stroke: #4a1d17; }
.g-svg .d-container-green { fill: #4c6e45; stroke: #263a22; }
.g-svg .d-crate { fill: #6b5a43; stroke: #3a3024; }
.g-svg .d-machine { fill: #4d5a66; stroke: #262e36; }
.g-svg .d-open-plazas .cement { fill: url(#d-plaza); stroke: #9db7b5; stroke-width: .8; stroke-dasharray: 3 2; }
.g-svg .d-open-plazas .cement .d-plaza-keep { fill: #c6c2c2; stroke: none; }
.g-svg .d-city-plazas .cement { fill: url(#d-plaza-city); }
.g-svg.d-muted-stairs .stairs { fill: #a7adb3; }
.g-svg.d-muted-stairs .d-stair-v { fill: url(#d-stairs-v); stroke: #2b3036; stroke-width: .15; }
.g-svg.d-muted-stairs .d-stair-h { fill: url(#d-stairs-h); stroke: #2b3036; stroke-width: .15; }
/* Gebäude und Fahrzeuge der Außen-Maps, Farben angelehnt an das Spiel (gedämpft, damit Beschriftungen lesbar bleiben) */
.g-svg .d-brick-red { fill: #8a3e30; stroke: #4a1f17; }
.g-svg .d-brick { fill: #7a5240; stroke: #3f2a20; }
.g-svg .d-concrete { fill: #7f8485; stroke: #3d4243; }
.g-svg .d-plaster { fill: #a8986f; stroke: #554b33; }
.g-svg .d-metal { fill: #4f6a78; stroke: #26343c; }
.g-svg .d-wood { fill: #6e4e2c; stroke: #382714; }
.g-svg .d-glass { fill: #3e5f7a; stroke: #1d2f3e; }
.g-svg .d-white { fill: #c3c0b6; stroke: #5e5c55; }
.g-svg .d-military { fill: #5b6a3c; stroke: #2c341c; }
.g-svg .d-oli { fill: #d0782a; stroke: #5a3210; }
.g-svg .d-basin { fill: url(#d-basin); stroke: #3d4243; stroke-width: .5; }
.g-svg .d-lighthouse { fill: url(#d-lighthouse); stroke: #5e1e16; stroke-width: .5; }
/* Außen-Maps sind größer, Konturen etwas kräftiger als in der Factory-Halle */
.g-svg .d-silo, .g-svg [class*="d-container"] { stroke-width: .4; }
.g-svg .d-idea { fill: #2f5f9e; stroke: #152c4a; }

/* Legende der Linien aus der Grundkarte (Leiste unten auf der Karte), Farben wie im Karten-SVG */
.g-line { display: block; flex: none; width: 20px; height: 0; }
.g-line-rail { border-top: 3px dashed #914833; }
.g-line-dirt { border-top: 5px solid #946d3e; border-radius: 3px; }
.g-line-fence { border-top: 1.5px solid #c4e3c3; }

@media (max-width: 760px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-rows: 48dvh minmax(0, 1fr); }
  .g-stage { grid-row: 1; }
  .g-side { grid-row: 2; border-right: 0; overflow-y: auto; }
  .g-head { padding: 8px 12px; }
  .g-head h1 { font-size: 22px; }
  .g-kicker, .g-meta { display: none; }
  .g-panel { flex: none; overflow: visible; }
  .g-floors { left: 52px; right: 8px; top: 8px; flex-wrap: wrap; }
  .g-floors button { padding: 3px 6px; font-size: 12px; }
  .g-turn-hint { display: none; }
  .g-rotate { right: 6px; bottom: 6px; }
  .g-dial { width: 58px; height: 58px; }
  .g-turn { width: 30px; height: 30px; }
  .g-key-box { left: 6px; bottom: 6px; max-width: calc(100% - 148px); font-size: 11px; gap: 2px 10px; }
}
