/*
 * Mastertcape Performance Guard Balanced v1.2.0
 * Normaler Neon-Modus bleibt in Ruhe.
 * Nur .mtc-balanced-lite wird entschärft.
 */

/* Sanfte Basisoptimierung, ohne Optik zu zerstören */
.mtc-tiles,
.mtc-tile,
.mtc-spritpreise,
[class*="sprit"],
[class*="smard"] {
  content-visibility: auto;
  contain-intrinsic-size: 360px;
}

/* Alte harte Modi neutralisieren, falls noch im Cache/LocalStorage vorhanden */
html:not(.mtc-balanced-lite).mtc-hard-lite *,
html:not(.mtc-balanced-lite).mtc-performance-guard * {
  animation: revert !important;
  transition: revert !important;
}

/* BALANCED LITE: weniger teuer, aber nicht tot */
html.mtc-balanced-lite .mtc-card,
html.mtc-balanced-lite .mtc-ai-tile__btn,
html.mtc-balanced-lite .mtc-ai-drop,
html.mtc-balanced-lite .mtc-tile,
html.mtc-balanced-lite .rbki-plugin .rbki-chatcard,
html.mtc-balanced-lite .rbki-plugin .rbki-out {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  text-shadow: none !important;
}

/* Schatten nur reduzieren, nicht komplett killen */
html.mtc-balanced-lite .mtc-card,
html.mtc-balanced-lite .mtc-ai-tile__btn,
html.mtc-balanced-lite .mtc-ai-drop,
html.mtc-balanced-lite .mtc-tile,
html.mtc-balanced-lite .rbki-plugin .rbki-chatcard {
  box-shadow: 0 8px 22px rgba(0,0,0,.34) !important;
}

/* Große Hintergrundwolken raus, aber Grunddesign bleibt dunkel/neonartig */
html.mtc-balanced-lite .mtc-card,
html.mtc-balanced-lite .mtc-ai-tile__btn,
html.mtc-balanced-lite .mtc-ai-drop,
html.mtc-balanced-lite .mtc-tile,
html.mtc-balanced-lite .rbki-plugin .rbki-chatcard,
html.mtc-balanced-lite .rbki-plugin .rbki-out {
  background-image: none !important;
}

/* Ruhige Flächen */
html.mtc-balanced-lite .mtc-card,
html.mtc-balanced-lite .rbki-plugin .rbki-chatcard {
  background: rgba(7,10,22,.96) !important;
}

html.mtc-balanced-lite .mtc-ai-tile__btn,
html.mtc-balanced-lite .mtc-ai-drop,
html.mtc-balanced-lite .mtc-tile {
  background: rgba(10,16,34,.94) !important;
}

/* Hover-Bewegung aus, Farben dürfen bleiben */
html.mtc-balanced-lite .mtc-ai-tile__btn:hover,
html.mtc-balanced-lite .mtc-tile:hover,
html.mtc-balanced-lite .rbki-plugin .rbki-btn:hover {
  transform: none !important;
}

/*
 * WICHTIG: Ticker darf laufen.
 * Wir stoppen Ticker-Animationen NICHT mehr.
 * Nur Schatten/Blur im Ticker werden reduziert.
 */
html.mtc-balanced-lite [class*="ticker"],
html.mtc-balanced-lite [id*="ticker"] {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  text-shadow: none !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.25) !important;
}

/* Ticker-Animationen explizit erlauben, falls alte harte CSS-Regeln noch im Cache sind */
html.mtc-balanced-lite [class*="ticker"] *,
html.mtc-balanced-lite [id*="ticker"] * {
  animation-play-state: running !important;
}

/* Spritpreisbereich nur etwas begrenzen */
html.mtc-balanced-lite [class*="sprit"],
html.mtc-balanced-lite .mtc-spritpreise {
  max-height: 760px;
  overflow: auto;
}

/* Chatbereich etwas begrenzen */
html.mtc-balanced-lite .rbki-plugin .rbki-out {
  max-height: 620px !important;
  overflow: auto !important;
}

/* Normale Elemente: keine globale Animationsbremse mehr. Nur bekannte schwere FX-Klassen */
html.mtc-balanced-lite [class*="glow"]:not([class*="ticker"]),
html.mtc-balanced-lite [class*="neon"]:not([class*="ticker"]),
html.mtc-balanced-lite [class*="fx"]:not([class*="ticker"]) {
  text-shadow: none !important;
  filter: none !important;
}

/* Button unten rechts */
.mtc-balanced-lite-toggle {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 99998;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(5,8,18,.86);
  color: rgba(255,255,255,.9);
  padding: 8px 10px;
  font: 800 11px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  cursor: pointer;
}

html.mtc-balanced-lite .mtc-balanced-lite-toggle {
  border-color: rgba(91,255,155,.45);
}

/* Reduced Motion: keine globale Vollbremsung, damit Ticker nicht stirbt */
@media (prefers-reduced-motion: reduce) {
  html.mtc-balanced-lite .mtc-card,
  html.mtc-balanced-lite .mtc-ai-tile__btn,
  html.mtc-balanced-lite .mtc-ai-drop,
  html.mtc-balanced-lite .mtc-tile,
  html.mtc-balanced-lite .rbki-plugin .rbki-chatcard,
  html.mtc-balanced-lite .rbki-plugin .rbki-out {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    background-image: none !important;
  }
}
