/* Flaggenjagd (Präfix .mg-ctf-) – Besitzer: Flaggenjagd-Agent */
.mg-ctf {
  position: absolute; inset: 0; overflow: hidden; background: #14142a; color: #fff;
  touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none;
  font-family: system-ui, sans-serif;
}
.mg-ctf-stage { position: absolute; inset: 0; }
.mg-ctf-stage canvas { display: block; width: 100%; height: 100%; }
.mg-ctf-hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.mg-ctf-hidden { display: none !important; }
.mg-ctf-hud > div > span, .mg-ctf-feeditem {
  background: rgba(27, 27, 47, 0.8); border: 2px solid #1b1b2f; border-radius: 8px; padding: 3px 7px;
}

.mg-ctf-score {
  position: absolute; left: 50%; top: calc(var(--safe-top, 0px) + 6px); transform: translateX(-50%);
  display: flex; gap: 6px; align-items: center; font-weight: 900; font-size: 14px; white-space: nowrap;
}
.mg-ctf-score b { font-size: 18px; }
.mg-ctf-red { border-color: #ff4d4d !important; }
.mg-ctf-blue { border-color: #3a86ff !important; }
.mg-ctf-time { font-size: 12px; }
.mg-ctf-golden .mg-ctf-time { color: #1b1b2f; background: #ffd23f !important; animation: mg-ctf-pulse 0.8s infinite alternate; }

.mg-ctf-status, .mg-ctf-effects {
  position: absolute; left: calc(var(--safe-left, 0px) + 8px); top: calc(var(--safe-top, 0px) + 40px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-weight: 800; font-size: 12px; max-width: 40%;
}
.mg-ctf-effects { top: auto; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom, 0px) + 8px); align-items: center; }
.mg-ctf-effects span { border-color: var(--c) !important; }
.mg-ctf-team { border-color: var(--c) !important; color: var(--c); }
.mg-ctf-warn { color: #ffb347; }
.mg-ctf-good { color: #7dffb0; }

.mg-ctf-feed {
  position: absolute; left: calc(var(--safe-left, 0px) + 8px); top: 46%;
  display: flex; flex-direction: column; gap: 3px; max-width: 42%; font-size: 11px; font-weight: 700;
}
.mg-ctf-feeditem.mg-ctf-bad { border-color: #ff4d4d; }
.mg-ctf-feeditem.mg-ctf-good { border-color: #0ead69; }

.mg-ctf-minimap {
  position: absolute; right: calc(var(--safe-right, 0px) + 8px); top: calc(var(--safe-top, 0px) + 6px);
  width: 150px; height: 88px; border: 3px solid #1b1b2f; border-radius: 8px; background: #2b6fa8;
}

.mg-ctf-banner {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%); max-width: 80%; text-align: center;
  background: rgba(27, 27, 47, 0.9); border: 3px solid #ffd23f; border-radius: 12px; padding: 8px 14px;
  font-weight: 900; font-size: 16px; text-shadow: 0 2px 0 #1b1b2f;
}
.mg-ctf-banner.mg-ctf-bad { border-color: #ff4d4d; }
.mg-ctf-banner.mg-ctf-good { border-color: #0ead69; }
.mg-ctf-banner.mg-ctf-gold { border-color: #ffd23f; color: #ffd23f; }

/* Antippflächen: feste Größe, kein Hover-Effekt (Pencil-Regel) */
.mg-ctf-btn {
  pointer-events: auto; touch-action: manipulation; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 13px; color: #fff; min-height: 40px;
  background: #2d2d4a; border: 3px solid #1b1b2f; border-radius: 10px; padding: 6px 10px;
  box-shadow: 0 3px 0 #1b1b2f; text-align: left;
}
.mg-ctf-btn:active { filter: brightness(1.3); }
.mg-ctf-btn:disabled { opacity: 0.5; cursor: default; }
.mg-ctf-pings {
  position: absolute; right: calc(var(--safe-right, 0px) + 8px); bottom: calc(var(--safe-bottom, 0px) + 10px);
  display: flex; flex-direction: column; gap: 6px; width: 120px;
}
.mg-ctf-ping { background: #3b3b66; }
.mg-ctf-shop {
  position: absolute; right: calc(var(--safe-right, 0px) + 136px); bottom: calc(var(--safe-bottom, 0px) + 10px);
  display: flex; flex-direction: column; gap: 6px; width: 190px; pointer-events: auto;
  background: rgba(27, 27, 47, 0.9); border: 3px solid #ffd23f; border-radius: 12px; padding: 8px;
}
.mg-ctf-shophead { font-weight: 900; font-size: 13px; display: flex; justify-content: space-between; color: #ffd23f; }
.mg-ctf-buy { display: flex; flex-direction: column; background: #5a3fa0; }
.mg-ctf-buy small { font-size: 10px; opacity: 0.85; font-weight: 700; }

@keyframes mg-ctf-pulse { from { opacity: 1; } to { opacity: 0.7; } }

@media (max-height: 420px) {
  .mg-ctf-minimap { width: 120px; height: 70px; }
  .mg-ctf-btn { min-height: 36px; font-size: 12px; padding: 4px 8px; }
  .mg-ctf-pings { width: 108px; gap: 4px; }
  .mg-ctf-shop { right: calc(var(--safe-right, 0px) + 122px); width: 170px; }
}
