/* Fassung 2: Schleier, Spiel-HUD und Twitch-Rahmen mit Kommentaren */
body { min-height: 1900vh; }
.kopf { z-index: 5; }
.spur { transition: opacity .2s; }

/* ---------- Schleier: Tauchgang und Blitz an den Portalen ---------- */
.schleier { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; background: #1560b8; }
.schleier.blitz { z-index: 2; background: #9a3cff; }

/* ---------- Spiel-HUD im Minecraft-Akt ---------- */
.spielhud {
  position: fixed; left: 50%; bottom: 58px; transform: translateX(-50%);
  width: min(420px, 78vw);
  z-index: 3; pointer-events: none;
  opacity: 0; transition: opacity .25s;
}
.spielhud.an { opacity: 1; }
.herzen { display: flex; gap: 3px; margin-bottom: 6px; }
.herzen i {
  width: 16px; height: 14px; display: block;
  background:
    linear-gradient(#ff3b4f, #ff3b4f) 2px 0 / 4px 2px no-repeat, linear-gradient(#ff3b4f, #ff3b4f) 10px 0 / 4px 2px no-repeat,
    linear-gradient(#ff3b4f, #ff3b4f) 0 2px / 16px 4px no-repeat, linear-gradient(#ff3b4f, #ff3b4f) 2px 6px / 12px 2px no-repeat,
    linear-gradient(#ff3b4f, #ff3b4f) 4px 8px / 8px 2px no-repeat, linear-gradient(#ff3b4f, #ff3b4f) 6px 10px / 4px 2px no-repeat;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .55));
}
.herzen i.leer { filter: grayscale(1) brightness(.35) drop-shadow(0 2px 0 rgba(0, 0, 0, .55)); }
.xp { display: flex; align-items: center; gap: 10px; }
.xp-stufe {
  min-width: 26px; text-align: center;
  font: 900 20px/1 "Courier New", monospace; color: #c8ff3c;
  text-shadow: 2px 2px 0 #1c2a00, -1px -1px 0 #1c2a00;
}
.xp-balken { flex: 1; height: 12px; background: #10140a; border: 2px solid #05070a; box-shadow: 0 0 0 2px rgba(255, 255, 255, .18); }
.xp-balken div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, #a6f02a 0 14px, #86cc1a 14px 16px); transition: width .15s; }
.meldung { position: relative; height: 76px; margin-bottom: 10px; }
.meldung-karte {
  position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 10px);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 16px; background: rgba(20, 20, 24, .86); border: 3px solid #f2f2f2; outline: 3px solid #1a1a1e;
  opacity: 0; transition: opacity .2s, transform .2s;
}
.meldung-karte.an { opacity: 1; transform: translate(-50%, 0); }
.meldung-karte canvas { display: block; image-rendering: pixelated; max-width: 62vw; height: auto; }

/* ---------- Twitch-Rahmen mit Kommentaren: fährt mit dem Scrollen herein ---------- */
.rahmen { --r: 0; --seite: clamp(170px, 19vw, 290px); position: fixed; inset: 0; z-index: 3; pointer-events: none; visibility: hidden; color: #efe9ff; overflow: hidden; }
.rahmen.an { visibility: visible; }
.rahmen > div { position: absolute; background: #0b0814; }
.rahmen-oben { top: 0; left: 0; right: 0; height: 54px; transform: translateY(calc((var(--r) - 1) * 100%)); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid rgba(163, 91, 255, .35); }
.rahmen-links { top: 0; bottom: 0; left: 0; width: var(--seite); transform: translateX(calc((var(--r) - 1) * 100%)); border-right: 1px solid rgba(163, 91, 255, .35); }
.rahmen-rechts { top: 0; bottom: 0; right: 0; width: var(--seite); transform: translateX(calc((1 - var(--r)) * 100%)); border-left: 1px solid rgba(163, 91, 255, .35); }
.rahmen-unten { left: 0; right: 0; bottom: 0; height: 112px; transform: translateY(calc((1 - var(--r)) * 100%)); border-top: 1px solid rgba(163, 91, 255, .35); }
.rahmen-live { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 6px; background: #e91e3c; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .08em; }
.rahmen-live i { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.chat { display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 70px 16px 128px; overflow: hidden; }
.chat h2 { margin: 0 0 auto; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(239, 233, 255, .55); font-weight: 700; }
.chat-zeile { margin: 0; font-size: 14px; line-height: 1.35; opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; overflow-wrap: anywhere; }
.chat-zeile.an { opacity: 1; transform: none; }
.chat-zeile b { font-weight: 700; margin-right: 2px; }
#chatUnten { display: none; }
.rahmen.an ~ .ziel { bottom: 26px; }
.rahmen.an ~ .ziel .ziel-notiz { display: none; }

@media (max-width: 760px) {
  .rahmen { --seite: 10px; }
  .rahmen-links .chat-zeile, .rahmen-rechts .chat-zeile, .rahmen-links h2, .rahmen-rechts h2 { display: none; }
  .rahmen-links, .rahmen-rechts { padding: 0; }
  .rahmen-unten { height: 40vh; }
  #chatUnten { display: flex; height: 100%; padding: 14px 18px 96px; gap: 7px; }
  .chat-zeile { font-size: 13.5px; }
  .rahmen-oben { height: 50px; }
  .spielhud { bottom: 50px; }
}

/* ---------- Ton-Knopf ---------- */
.ton {
  position: fixed; top: 56px; left: 20px; z-index: 6;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  border: 1px solid var(--rand); background: var(--flaeche); color: var(--text);
  font: 600 13px var(--schrift); cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ton::before { content: "♪"; margin-right: 6px; }
.ton.an { background: linear-gradient(135deg, #7c3aed, #a35bff); color: #fff; border-color: rgba(255, 255, 255, .35); }
.ton:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
@media (max-width: 760px) { .ton { top: 50px; left: 12px; font-size: 12px; padding: 6px 12px 6px 10px; } }
