/* V133 */

:root{
  --bg:#0b0c12;
  --panel:#141524;
  --panel2:#0f1020;
  --text:#eef0ff;
  --muted:rgba(255,255,255,.7);
  --answerFontSize: 28px; /* <- HIER ändern */

  /* FINALE */
  --finalAnswerFontSize: 20px;

  --accent:#6f59ff;
  --warn:#ff3b3b;
  --ok:#3cff8a;

  --btnQ:#2f7cff;
  --btnWrong:#ff2d2d;
  --btnPlace:#6f59ff;
  --btnRevive:#2bd3a7;
  --btnEnd:#ffb020;

  --stroke:rgba(255,255,255,.15);
  --shadow:0 12px 26px rgba(0,0,0,.35);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    url("Bilder/BG.png") center center / cover no-repeat,
    radial-gradient(1200px 700px at 20% 10%, rgba(111,89,255,.18), transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(47,124,255,.14), transparent 60%),
    radial-gradient(900px 600px at 50% 90%, rgba(60,255,138,.10), transparent 60%),
    var(--bg);

  color:var(--text);
}

/* Player: niemals Scrollbars (auch während Transitions) */
body.player-view{ overflow:hidden; }
body.player-view.round-transition{
  overflow:hidden;
}

/* Legacy-Black-Fade deaktiviert (Player nutzt nur #roundFadeOverlay) */
body.player-view.round-transition::before{
  content:none;
  display:none;
}


/* Player: Round-Transition über eigenes Overlay (deterministisch via opacity-transition) */
#roundFadeOverlay{
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;

  /* wichtig: Transition statt Keyframes, damit "zurück" nie hart sein kann */
  transition: opacity 700ms ease-in-out;
}

/* an = schwarz (wird in JS für Fade-In/Fade-Out getoggelt) */
#roundFadeOverlay.is-on{
  opacity: 1;
}






a{color:inherit}
code{background:rgba(255,255,255,.06); padding:2px 6px; border-radius:8px; border:1px solid var(--stroke)}

.app{min-height:100%; display:flex; flex-direction:column}

.topbar{
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--stroke);
  background:rgba(15,16,32,.65);
  backdrop-filter: blur(8px);
  position:sticky; top:0; z-index:50;
}

.topbar-left{display:flex; align-items:center; gap:12px}
.badge{
  padding:6px 10px; border-radius:999px;
  background:rgba(111,89,255,.15);
  border:1px solid rgba(111,89,255,.35);
  font-weight:800; letter-spacing:.08em; font-size:12px;
}
.fc{
  padding:6px 10px; border-radius:999px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.06);
  font-weight:700;
}

.topbar-right{display:flex; align-items:center; gap:10px}
.open-player{
  padding:10px 12px; border-radius:12px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--stroke);
  text-decoration:none;
}

.layout{
  width:min(1400px, calc(100% - 24px));
  margin:16px auto 24px;
  display:grid;
  gap:14px;
}
.layout-mod{grid-template-columns: 1fr}
.layout-player{width:100%; margin:0; padding:0}

.panel{
  background:linear-gradient(180deg, rgba(20,21,36,.92), rgba(12,13,26,.92));
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  padding:14px 14px 16px;
  box-shadow:var(--shadow);
}
.panel h2{margin:0 0 12px; font-size:16px; letter-spacing:.02em}

.hint{margin:10px 0 0; color:var(--muted); font-size:13px}

.cams-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 1100px){ .cams-grid{grid-template-columns: repeat(2, minmax(0, 1fr));} }
@media (max-width: 720px){ .cams-grid{grid-template-columns: 1fr;} }

.cam-card{
  border:1px solid var(--stroke);
  border-radius:16px;
  padding:12px;
  background:rgba(255,255,255,.04);
}
.cam-card h3{margin:0 0 10px; font-size:14px; color:rgba(255,255,255,.9)}

.field{display:flex; flex-direction:column; gap:6px; margin:8px 0}
.field span{font-size:12px; color:var(--muted)}
.field input{
  height:38px; border-radius:12px;
  border:1px solid var(--stroke);
  background:rgba(0,0,0,.25);
  color:var(--text);
  padding:0 10px;
  outline:none;
}
.field input:focus{border-color:rgba(111,89,255,.55); box-shadow:0 0 0 3px rgba(111,89,255,.15)}
.field.small input{height:34px}

.field.checkbox{flex-direction:row; align-items:center; gap:10px}
.field.checkbox input{height:auto}

.cam-controls{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:8px;
  margin-top:8px;
}
.cam-controls .checkbox{grid-column: 1 / -1; margin-top:4px}

.teams-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 900px){ .teams-grid{grid-template-columns: 1fr;} }

.team-card{
  border:1px solid var(--stroke);
  border-radius:16px;
  padding:12px;
  background:rgba(255,255,255,.04);
}
.team-head{display:flex; gap:10px; align-items:center; justify-content:space-between}
.team-tag{
  padding:6px 10px; border-radius:999px;
  font-weight:900; letter-spacing:.06em; font-size:12px;
  border:1px solid var(--stroke);
}
.team-tag.teamA{background:rgba(47,124,255,.18); border-color:rgba(47,124,255,.45)}
.team-tag.teamB{background:rgba(60,255,138,.12); border-color:rgba(60,255,138,.35)}

.team-row{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-top:10px;
}
.lives{display:flex; align-items:center; gap:10px}
.lives .lbl{color:var(--muted); font-size:12px}
.lives .val{min-width:22px; text-align:center; font-weight:900; font-size:18px}
.points{min-width:220px}

.btn-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
}

/* Moderator: Buttons sicher nebeneinander (falls irgendwo ein Override greift) */
#moderatorView .btn-grid{
  display:grid !important;
  grid-auto-flow: row;
}

/* Rundensteuerung: Buttons bewusst untereinander */
.btn-grid--stack{
  grid-template-columns: 1fr !important;
}


@media (max-width: 1050px){ .btn-grid{grid-template-columns: repeat(3, minmax(0, 1fr));} }
@media (max-width: 760px){ .btn-grid{grid-template-columns: repeat(2, minmax(0, 1fr));} }

.btn{
  height:46px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  color:var(--text);
  font-weight:900;
  letter-spacing:.02em;
  cursor:pointer;
  user-select:none;
  transition: transform .08s ease, filter .12s ease, background .12s ease;
}
.btn:hover{filter:brightness(1.1)}
.btn:active{transform: translateY(1px)}
.btn[disabled]{opacity:.45; filter: grayscale(1); cursor: default; pointer-events:none;}


.btn-small{height:34px; border-radius:12px; padding:0 12px; font-weight:900}
.btn-secondary{background:rgba(255,255,255,.06)}

.btn-question{background:rgba(47,124,255,.22); border-color:rgba(47,124,255,.55)}
.btn-wrong{background:rgba(255,45,45,.22); border-color:rgba(255,45,45,.55)}
.btn-place{background:rgba(111,89,255,.22); border-color:rgba(111,89,255,.55)}
.btn-revive{background:rgba(43,211,167,.18); border-color:rgba(43,211,167,.45)}
.btn-end{background:rgba(255,176,32,.18); border-color:rgba(255,176,32,.45)}
.btn-danger{
  background: rgba(255,45,45,.18);
  border-color: rgba(255,45,45,.45);
}


.smallrow{display:flex; gap:16px; margin-top:10px; flex-wrap:wrap}
.statusline{color:var(--muted); font-size:13px}

/* PLAYER STAGE */
.stage{width:100%; min-height:calc(100vh - 60px); padding:18px 18px 16px}
.stage-top{display:flex; justify-content:space-between; align-items:flex-end; gap:12px}
.stage-title{
  font-size:34px; font-weight:1000; letter-spacing:.04em;
  text-shadow: 0 10px 20px rgba(0,0,0,.45);
}
.stage-fc{
  font-size:18px; font-weight:900;
  padding:10px 14px; border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--stroke);
}

.stage-mid{display:grid; grid-template-columns: 1fr; gap:14px; margin-top:14px}

.board{
  position:relative;
  border-radius:26px;
  border:1px solid rgba(255,255,255,.18);
  background: radial-gradient(800px 400px at 50% 0%, rgba(111,89,255,.18), transparent 65%),
              linear-gradient(180deg, rgba(20,21,36,.85), rgba(10,10,18,.85));
  box-shadow: 0 22px 55px rgba(0,0,0,.45);
  padding:18px 18px 22px;
  overflow:hidden;
}

.question{
  font-size:26px;
  font-weight:900;
  text-align:center;
  margin:6px 0 16px;
  opacity:.95;
  text-shadow: 0 10px 18px rgba(0,0,0,.45);
  min-height: 34px;
}

.answers{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 900px){ .answers{grid-template-columns: 1fr;} }

.slot{
  border-radius:18px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  overflow:hidden;
  transform: translateY(0);
}
.slot.hidden{display:none}

.slot-inner{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 14px;
  min-height:58px;
}
.slot-num{
  display:none;
}

.slot-txt{font-weight:900; font-size:18px; opacity:.96}

.slot.revealed{
  animation: popIn .18s ease-out both;
  background: rgba(111,89,255,.12);
  border-color: rgba(111,89,255,.45);
}
@keyframes popIn{
  from{transform:scale(.985); filter:brightness(.9)}
  to{transform:scale(1); filter:brightness(1)}
}

.strikes{
  position:absolute;
  right:14px;
  top:14px;
  display:flex;
  gap:8px;
}
.strike{
  width:48px; height:48px;
  border-radius:16px;
  display:flex; align-items:center; justify-content:center;
  font-weight:1000; font-size:26px;
  border:1px solid rgba(255,45,45,.35);
  background:rgba(255,45,45,.10);
  opacity:.15;
  transform: scale(.95);
}
.strike.on{
  opacity:1;
  animation: strikePop .16s ease-out both;
}
@keyframes strikePop{
  from{transform:scale(.85)}
  to{transform:scale(1)}
}

.final-banner{
  position:absolute;
  left:50%;
  top:12px;
  transform: translateX(-50%);
  padding:10px 16px;
  border-radius:999px;
  font-weight:1000;
  letter-spacing:.12em;
  background:rgba(255,176,32,.14);
  border:1px solid rgba(255,176,32,.45);
  z-index: 60;
  pointer-events:none;
}


.scorebar{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
.team{
  border-radius:18px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.22);
  padding:12px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  transition: opacity .45s ease, filter .45s ease;
}

/* Finale: Team-Dim (Scorebar) */
.team.team-dim{
  opacity: .55;
  filter: grayscale(1) brightness(.9);
}


.team .name{font-weight:1000; font-size:18px}
.team .meta{display:flex; align-items:center; gap:14px}
.team .points span{
  font-weight:1000; font-size:26px;
  padding:6px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06);
}
.lives .heart{
  display:inline-flex;
  width:18px; height:18px;
  margin-left:6px;
  border-radius:6px;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.18);
}
.lives .heart.on{background:rgba(255,45,45,.16); border-color:rgba(255,45,45,.35)}

.cams-stage{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap:10px;
  margin-top:14px;
}
@media (max-width: 1100px){ .cams-stage{grid-template-columns: repeat(3, minmax(0, 1fr));} }
@media (max-width: 760px){ .cams-stage{grid-template-columns: repeat(2, minmax(0, 1fr));} }

.camframe{
  position:relative;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.16);
  overflow:hidden;
  background:rgba(0,0,0,.25);
  height:160px;
  box-shadow: 0 18px 38px rgba(0,0,0,.35);
}

/* Finale: Team-Dim (Cams) */
.camframe.team-dim .camwrap{
  opacity: 1;
  filter: grayscale(1) brightness(.5);
}

.camwrap{
  position:absolute;
  inset:0;
  transform: translate(0px, 0px) scale(1);
  transform-origin:center;
}
.camwrap iframe{
  width:100%;
  height:100%;
  border:0;
  background:transparent;
}
.camwrap video{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.camlabel{
  display:none !important;
}


/* =========================
   PLAYER TAB – Pixel-Overlay Layout
   ========================= */
body.player-view .stage-top,
body.player-view .stage-mid{
  display:none;
}
/* Spieler-Tab: Moderator-Panels (Rundensteuerung / Cams-Einstellungen / Teams-Einstellungen) komplett entfernen */
body.player-view #moderatorView{
  display:none !important;
}


/* Spieler-Tab: alles was zur Moderator-UI gehört (Topbar) ausblenden */
body.player-view .topbar{
  display:none !important;
}


/* Cams: werden per JS absolut positioniert (PLAYER_LAYOUT) */
body.player-view .cams-stage{
  position:absolute;
  inset:0;
  display:block;
  margin:0;
  gap:0;
}

/* Camframe default überschreiben (JS setzt w/h/top/left) */
body.player-view .camframe{
  box-shadow:none;
  border-radius:18px;
  overflow:hidden;

  /* langsamer Übergang fürs Ausgrauen/Abdunkeln (KEINE Transparenz) */
  transition: filter 3s ease;
}



/* Overlay Layer (Bilder + Textboxen) */
.player-overlay{
  position:absolute;
  inset:0;
  z-index:20;
  pointer-events:none;
}

/* =========================
   Schätzmodus: Spieler-Eingabe (interaktiv)
   Position/Größe wird über PLAYER_LAYOUT.boxes (script.js) gesetzt.
   ========================= */
.sch-input{
  position:absolute;
  z-index:200;
  pointer-events:auto; /* obwohl .player-overlay pointer-events:none hat */

  display:flex;
  align-items:stretch;
  gap:10px;

  padding:10px;
  border-radius:16px;
  background: rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.18);
  box-shadow: 0 18px 38px rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
}

.sch-input__field{
  flex: 1 1 auto;
  min-width: 0;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(15,16,32,.65);
  color: var(--text);
  padding: 10px 12px;
  font-size: 18px;
  outline: none;
}

.sch-input__field::placeholder{ color: rgba(255,255,255,.55); }

.sch-input__btn{
  white-space: nowrap;
}


.overlay-img{
  position:absolute;
  display:block;
  pointer-events:none;
  z-index:5;
}

/* Mark-Overlays sollen über den restlichen Overlays/Boxen liegen */
.mark-img{
  z-index:30;
}


/* ÜBER ALLEM: aktiver Spieler + Wechsel-FX */
#overlay-activeplayer,
#overlay-switch{
  position:absolute;
  inset:0;
  z-index:100;
  opacity:0;
  transition: opacity 0.6s ease;
  pointer-events:none;
}


/* Sichtbar-Status */
#overlay-activeplayer.is-visible,
#overlay-switch.is-visible{
  opacity: 1;
}




.obox{
  position:absolute;
  border:2px solid rgba(255,255,255,.45);
  background: rgba(0,0,0,.12);
  border-radius:14px;
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-weight:1000;
  z-index:10;
}

.obox::before{
  content: attr(data-name);
  position:absolute;
  left:10px;
  top:-20px;
  font-size:12px;
  font-weight:1000;
  letter-spacing:.06em;
  color: rgba(255,255,255,.85);
  text-shadow: 0 6px 14px rgba(0,0,0,.55);
}

.obox .obox-txt{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;

  /* Text-Schatten für ALLE Overlay-Texte */
  text-shadow:
    0 2px 4px rgba(0,0,0,.65),
    0 6px 14px rgba(0,0,0,.35);
}

/* Frage */
#BOX_QUESTION .obox-txt{
  font-size:40px;
  font-weight:1000;
  color: var(--text);
  text-shadow:
    0 4px 10px rgba(0,0,0,.45);
}

/* Team-Namen */
#BOX_TEAM_A .obox-txt,
#BOX_TEAM_B .obox-txt{
  font-size:40px;
  font-weight:1000;
  color: var(--text);
  text-shadow:
    0 4px 10px rgba(0,0,0,.45);
}

/* =========================
   Spielernamen: Gradient + Außenkontur + Schatten (3 Layer)
   ========================= */

/* Spielernamen – robust: Gradient-Füllung vorne, Kontur dahinter, Schatten ganz hinten */
#BOX_P1 .obox-txt,
#BOX_P2 .obox-txt,
#BOX_P3 .obox-txt,
#BOX_P4 .obox-txt{
  color: #4882fb;
  position: relative;
  width: 100%;
  height: 100%;
  display:flex;
  align-items:center;
  justify-content:center;

  font-size:28px;
  font-weight:1000;

  /* wichtig: eigener Stacking-Context, damit z-index garantiert korrekt ist */
  isolation: isolate;

  text-shadow: none;
  z-index: 0;
}

/* Schatten – ganz hinten */
#BOX_P1 .obox-txt::after,
#BOX_P2 .obox-txt::after,
#BOX_P3 .obox-txt::after,
#BOX_P4 .obox-txt::after{
  content: attr(data-text);
  position: absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;

  color: transparent;

  text-shadow:
    3px 4px 6px rgba(0,0,0,.65),
    3px 10px 24px rgba(0,0,0,.35);

  z-index: -2;
}

/* Kontur – zwischen Schatten und Füllung */
body.player-view #BOX_P1 .obox-txt::before,
body.player-view #BOX_P2 .obox-txt::before,
body.player-view #BOX_P3 .obox-txt::before,
body.player-view #BOX_P4 .obox-txt::before{
  content: attr(data-text);
  position: absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;

  text-shadow:
    -3px -3px 0 #eef0ff,
     0px -3px 0 #eef0ff,
     3px -3px 0 #eef0ff,
    -3px  0px 0 #eef0ff,
     3px  0px 0 #eef0ff,
    -3px  3px 0 #eef0ff,
     0px  3px 0 #eef0ff,
     3px  3px 0 #eef0ff;

  z-index: -1;
}


/* Frage: Füllung vorne, Kontur dahinter, Schatten ganz hinten */
#BOX_QUESTION .obox-txt{
  color: #4882fb;
  position: relative;
  width: 100%;
  height: 100%;
  display:flex;
  align-items:center;
  justify-content:center;

  font-weight:1000;

  /* wichtig: eigener Stacking-Context, damit z-index garantiert korrekt ist */
  isolation: isolate;

  text-shadow: none;
  z-index: 0;
}

/* Schatten – ganz hinten */
#BOX_QUESTION .obox-txt::after{
  content: attr(data-text);
  position: absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;

  color: transparent;
  -webkit-text-fill-color: transparent;

  text-shadow:
    3px 4px 6px rgba(0,0,0,.65),
    3px 10px 24px rgba(0,0,0,.35);

  z-index: -2;
}

/* Kontur – zwischen Schatten und Füllung */
#BOX_QUESTION .obox-txt::before{
  content: attr(data-text);
  position: absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;

  color: transparent;
  -webkit-text-fill-color: transparent;

  text-shadow:
    -3px -3px 0 #eef0ff,
     0px -3px 0 #eef0ff,
     3px -3px 0 #eef0ff,
    -3px  0px 0 #eef0ff,
     3px  0px 0 #eef0ff,
    -3px  3px 0 #eef0ff,
     0px  3px 0 #eef0ff,
     3px  3px 0 #eef0ff;

  z-index: -1;
}

body.player-view .obox-answer .obox-txt{
  font-size: var(--answerFontSize) !important;
}
.obox-votes .obox-txt{font-size:22px}
#BOX_TOTAL_A .obox-txt, #BOX_TOTAL_B .obox-txt{font-size:40px}

/* FINAL: separate Antwort-/Stimmen-Felder (pixelgenau über PLAYER_LAYOUT.boxes) */
body.player-view .obox-final-answer .obox-txt{
  font-size: var(--finalAnswerFontSize);
  line-height: 1.15;
}

.obox-final-votes .obox-txt{
  font-size:22px;
  text-align:center;
}


/* Spieler-Tab: Debug-Umrandungen + Bezeichnungen der Overlay-Kästchen ausblenden */
body.player-view .player-overlay .obox{
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.player-view .player-overlay .obox::before{
  display: none !important;
  content: none !important;
}


/* =========================
   Spielmechanik – FX / States
   ========================= */
body.player-view .camframe.disqualified{
  filter: grayscale(1) brightness(.65);
}


/* Moderator: bereits genutzte Plätze */
.is-disabled{
  opacity: .45;
  filter: grayscale(1);
}

/* ÜBER ALLEM: aktiver Spieler + Switch-FX */
#overlay-activeplayer,
#overlay-switch{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  z-index:9999;
  display:none; /* wird per JS aktiviert */
  pointer-events:none;
}


/* Life Overlays: L1-L3 + R1-R3 auf eigenen Ebenen */
#overlay-life{ z-index: 30; }

#overlay-lifeL1{ z-index: 994; display:none; }
#overlay-lifeL2{ z-index: 995; display:none; }
#overlay-lifeL3{ z-index: 996; display:none; }

#overlay-lifeR1{ z-index: 997; display:none; }
#overlay-lifeR2{ z-index: 998; display:none; }
#overlay-lifeR3{ z-index: 999; display:none; }


/* Voltoball Greenscreen Canvas */
.volto-canvas{
  position:absolute;
  z-index: 1500;
  display:none;
  pointer-events:none;
}
.volto-video{ display:none; }

/* Falsch: rotes Monitor-Flicker (Player-View) */
@keyframes wrongFlash {
  0%   { opacity: 0; }
  15%  { opacity: .55; }
  40%  { opacity: .15; }
  65%  { opacity: .45; }
  100% { opacity: 0; }
}

body.player-view.wrong-flash::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 0, 0, 0.55);
  animation: wrongFlash 520ms ease-out both;
  z-index: 20000; /* über allem */
}

/* Round-Switch Transition (Runde beenden / Schätzmodus beenden) */
@keyframes roundTransition {
  0%   { opacity: 0; transform: translateY(10px) scale(.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Blau-Flash (kein Blur) + verhindert harte Sprünge */
@keyframes roundFlashBlue {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  100% { opacity: 0; }
}
body:not(.player-view).round-transition::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(72, 143, 251, 0.28); /* #488FFB aus deinem Screenshot */
  animation: roundFlashBlue 520ms ease-out both;
  z-index: 19999; /* über Stage/Board, unter Winner-Overlay */
}



body:not(.player-view).round-transition .player-overlay,
body:not(.player-view).round-transition #stage,
body:not(.player-view).round-transition #board{
  animation: roundTransition 420ms cubic-bezier(.2,.8,.2,1) both;
}



/* Finale Stimmanzahl: kurzer Pop */
@keyframes votePop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.28); }
  100% { transform: scale(1); }
}
.vote-pop {
  animation: votePop 360ms ease-out both;
  transform-origin: center center;
}

/* Frage: kurzer Pop (für FINAL-FRAGE) */
@keyframes questionPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}
.q-pop {
  animation: questionPop 340ms ease-out both;
  transform-origin: center center;
}


/* Schätzfrage: Bild zwischen Overlay-Count (5/6/7/Finale) und Textboxen */
#overlay-schaetz{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  z-index:8;      /* overlay-count ist z-index:5, .obox ist z-index:10 */
  display:none;
  pointer-events:none;
}

/* Schätz-Textboxen */
.obox-schaetz{
  z-index: 20; /* über dem Schaetz.png */
}

/* Schätzmodus: 2 Zeilen sauber anzeigen */
.obox-schaetz .obox-txt{
  white-space: pre-line;
  line-height: 1.08;
}



/* Optional: etwas größere Schrift für Schätzmodus */
#SCH_TEAM_A .obox-txt, #SCH_TEAM_B .obox-txt{ font-size: 24px; }
#SCH_TIPP_A .obox-txt, #SCH_TIPP_B .obox-txt{ font-size: 32px; }
#SCH_DIFF_A .obox-txt, #SCH_DIFF_B .obox-txt{ font-size: 32px; }
#SCH_ANTWORT_LABEL .obox-txt{ font-size: 32px; }
#SCH_WAHR .obox-txt{ font-size: 32px; }

/* Vergleich < = >: über D/E, mittig, auffällig */
#SCH_CMP{
  z-index: 30; /* über den anderen Schätz-Boxen */
}
#SCH_CMP .obox-txt{
  font-size: 44px;
  font-weight: 1000;
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height: 1;
}


/* Schätzmodus – Teamname */
.sch-team{
  font-size: 24px;
  font-weight: 700;
}

/* Schätzmodus – Tipp */
.sch-tipp{
  font-size: 32px;
  font-weight: 1000;
}

/* Reserviert immer Platz für die zweite Zeile, damit nichts "springt" */
.sch-tipp:empty::before{
  content: "\00a0"; /* non-breaking space */
}


/* Moderator: Grid für Schätz-Controls */
.schaetz-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 760px){
  .schaetz-grid{ grid-template-columns: 1fr; }
}

/* Schätzfrage: Teamname + Tipp untereinander */
#SCH_TEAM_A .obox-txt,
#SCH_TEAM_B .obox-txt{
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.sch-team,
.sch-tipp{
  line-height: 0.4;
}

#SCH_DIFF_LABEL .obox-txt{
  font-size: 24px;
  font-weight: 700;
}

.sch-answer-label{
  font-size: 24px;
  font-weight: 700;
}

.sch-answer-value{
  font-size: 32px;
  font-weight: 1000;
}

#SCH_WAHR .obox-txt{
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0;
}

/* Differenz-Werte */
#SCH_DIFF_A .obox-txt,
#SCH_DIFF_B .obox-txt{
  line-height: 0.4;
}


#SCH_WAHR .obox-txt{
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0;
}

.sch-answer-label{
  line-height: 1.08;
  margin: 0;
}

.sch-answer-value{
  line-height: 1.4;
  margin: 0;
}

/* =========================
   MODERATOR – Finale
   ========================= */
.final-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
}

.final-row{
  display:grid;

  /* Ziel: Alles passt in 1 Zeile.
     Frage bleibt breit, Inputs/Dropdowns werden auf ~2/3 reduziert.
     (funktioniert jetzt schon mit 4 Spalten UND später mit 5 Spalten, wenn du 2 Dropdowns hast) */
  grid-template-columns: 1.35fr repeat(4, 0.66fr);

  gap:8px;
  align-items:end;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  padding:8px;
  background:rgba(255,255,255,.04);
}

/* damit Inputs/Selects in Grid-Spalten nicht "rausdrücken" */
.final-row > *{ min-width:0; }
.final-row input,
.final-row select{ width:100%; }


.final-q{
  font-weight:900;
  opacity:.95;
  font-size:13px;
  line-height:1.25;
}

.final-actions{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
  margin-top:12px;
}


@media (max-width: 900px){
  .final-actions{ grid-template-columns: 1fr; }
}


/* =========================
   PLAYER – Finale Anzeige
   ========================= */
.final-stage{
  position:absolute;
  inset:0;
  z-index: 40; /* über Overlay-Count/FullLife, unter activeplayer/switch */
  display:block;
  pointer-events:none;
}

.final-box.is-hidden{ opacity:0; }


.final-col{
  display:grid;
  grid-template-rows: repeat(6, auto);
  gap:14px;
}

.final-item{
  display:flex;
  align-items:center;
  gap:14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.22);
  padding:12px 14px;
  min-height:58px;
}

.final-item .final-n{
  width:34px; height:34px;
  border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  font-weight:1000;
  background:rgba(111,89,255,.22);
  border:1px solid rgba(111,89,255,.55);
  flex:0 0 auto;
}

.final-item .final-txt{
  font-weight:1000;
  font-size:68px;
  flex:1 1 auto;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.final-item .final-votes{
  font-weight:1000;
  font-size:62px;
  padding:6px 10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06);
  min-width:64px;
  text-align:center;
  flex:0 0 auto;
}

.final-item.is-hidden .final-txt{ opacity:.0; }
.final-item.is-hidden .final-votes{ opacity:.0; }

/* Team A „weiter links“: leicht engerer Padding (Feintuning möglich) */
.final-col-a{ padding-right: 24px; }
.final-col-b{ padding-left: 24px; }

/* =========================
   PLAYER – Winner Overlay
   ========================= */
.final-winner{
  position:fixed;
  inset:0;
  z-index: 25000;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.55);
}

/* WICHTIG: hidden muss IMMER gewinnen, sonst ist das Overlay sofort sichtbar */
.final-winner[hidden]{
  display:none !important;
}


.final-winner-card{
  width: min(720px, calc(100vw - 80px));

  border-radius:26px;
  border:1px solid rgba(255,255,255,.18);
  background: radial-gradient(900px 480px at 50% 0%, rgba(111,89,255,.22), transparent 65%),
              linear-gradient(180deg, rgba(20,21,36,.92), rgba(10,10,18,.92));
  box-shadow: 0 22px 55px rgba(0,0,0,.55);
  padding:22px 22px 20px;
}

.final-winner-title{
  font-size:34px;
  font-weight:1000;
  letter-spacing:.06em;
  text-align:center;
  margin-bottom:14px;
}

.final-winner-body{
  font-size:18px;
  line-height:1.45;
  white-space:pre-line;
}



/* =========================
   GLOBAL ROUND TRANSITION
   ========================= */

.round-transition {
  animation: roundFade .32s ease-out both;
}

@keyframes roundFade {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Ambient Light Shift beim Rundenwechsel */
.board.round-transition::before {
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(
    800px 400px at 50% -10%,
    rgba(111,89,255,.22),
    transparent 70%
  );
  animation: lightSweep .32s ease-out both;
  pointer-events:none;
}

@keyframes lightSweep {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Gewinner-Puls */
.winner-pulse {
  animation: winnerPulse 2s ease-in-out infinite;
}



/* =========================
   PLAYER – Winner Overlay
   ========================= */
.final-winner{
  position:fixed;
  inset:0;
  z-index: 25000;
  display:flex;
  align-items:center;
  justify-content:center;

  /* KEIN Blur – Cams bleiben scharf sichtbar */
  background: rgba(0,0,0,.42);
}

/* WICHTIG: hidden muss IMMER gewinnen, sonst ist das Overlay sofort sichtbar */
.final-winner[hidden]{
  display:none !important;
}

.final-winner-card{
  width: min(720px, calc(100vw - 80px));

  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(180deg, rgba(20,21,36,.92), rgba(12,13,26,.92));
  box-shadow: 0 26px 70px rgba(0,0,0,.55);
  padding: 22px 22px 20px;

  transform: translateY(10px);
  opacity: 0;
  animation: winnerIn .22s ease-out both;
}

@keyframes winnerIn{
  from { transform: translateY(16px) scale(.985); opacity: 0; }
  to   { transform: translateY(0)   scale(1);     opacity: 1; }
}

.final-winner-title{
  font-size: 34px;
  font-weight: 1000;
  letter-spacing: .10em;
  text-align: center;
  margin-bottom: 14px;
  text-shadow: 0 14px 30px rgba(0,0,0,.45);
}

/* Puls nur, wenn es wirklich einen Sieger gibt */
.final-winner-title.winner-pulse{
  animation: winnerPulse 1.25s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes winnerPulse{
  0%, 100% { transform: scale(1);   filter: brightness(1); }
  50%      { transform: scale(1.04); filter: brightness(1.12); }
}

.final-winner-body{
  display: grid;
  gap: 14px;
}

.final-winner-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 16px;

  padding: 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
}

.final-winner-row.is-winner{
  border-color: rgba(111,89,255,.55);
  background: rgba(111,89,255,.12);
  box-shadow: 0 0 0 1px rgba(111,89,255,.18) inset;
}

.final-winner-left{
  display:flex;
  flex-direction:column;
  gap: 4px;
  min-width: 0;
}

.final-winner-team{
  font-weight: 1000;
  font-size: 22px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.final-winner-players{
  font-weight: 900;
  font-size: 15px;
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.final-winner-points{
  font-weight: 1000;
  font-size: 28px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  white-space: nowrap;
}

.final-winner-vs{
  text-align:center;
  font-weight: 1000;
  letter-spacing: .18em;
  opacity: .65;
  padding: 2px 0;
}


/* =========================
   PLAYER – Konfetti
   ========================= */
.confetti-layer{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index: 22000;
  overflow:hidden;
}

.confetti-piece{
  position:absolute;
  top:0;
  width:10px;
  height:14px;
  border-radius:3px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
  animation-name: confettiFall;
  animation-timing-function: linear;
  animation-iteration-count: 1;
  will-change: transform, opacity;
}

@keyframes confettiFall{
  0%   { transform: translateY(-12vh) translateX(0) rotate(0deg); opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(112vh) translateX(var(--driftX, 0vw)) rotate(900deg); opacity: 0; }
}



/* =========================
   MODERATOR – Stoppuhr
   ========================= */
.mod-stopwatch-row{
  margin-top:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.22);
}
.mod-stopwatch-label{
  font-weight:900;
  opacity:.85;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:12px;
}
.mod-stopwatch{
  font-variant-numeric: tabular-nums;
  font-weight:1000;
  font-size:22px;
  color:#ffffff;
  text-shadow: 0 10px 18px rgba(0,0,0,.45);
}
.mod-stopwatch.over60{
  color: #ff3b3b;
}

/* =========================
   MODERATOR – Timer Row
   ========================= */
.mod-timer-row{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  background:rgba(255,255,255,.04);
}
.mod-timer-label{
  font-weight:900;
  opacity:.95;
}
.mod-timer-btns{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* =========================
   PLAYER – Countdown Overlay (in Camframe umgehängt)
   ========================= */
.countdown-overlay{
  position:absolute;
  top: 12px;
  right: 15px;
  left: auto;
  bottom: auto;
  transform: none;

  z-index: 25000;            /* über Cam-Inhalt/Label */
  pointer-events:none;
  opacity: 1;
  transition: opacity 420ms ease;
}

/* P2 + P4: Timer etwas höher (y - 16px) */
.camframe[data-cam="p2"] .countdown-overlay,
.camframe[data-cam="p4"] .countdown-overlay{
  transform: translateY(+16px);
}


.countdown-overlay.is-hidden{
  opacity: 0;
}

.countdown-overlay.is-fadeout{
  opacity: 0;
}


/* Moderator-Cam (Finale) */
.camframe[data-cam="mod"] .countdown-overlay.is-final{
  top: auto;
  right: auto;
  left: 50%;
  bottom: 18px; /* 14px + 20px */
  transform: translateX(-50%);
}


/* Normal (Teilnehmer) etwas kleiner */
.countdown-value{
  font-weight: 1000;
  font-size: 28px;
  line-height: 1;
  color: #ffffff;
  text-shadow:
    0 6px 18px rgba(0,0,0,.55),
    0 2px 0 rgba(0,0,0,.35);
  padding: 10px 18px;
  border-radius: 16px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.16);
}

.countdown-value.is-urgency{
  color: var(--warn);
}

/* Finale: in Moderator-Cam größer */
.countdown-overlay.is-final .countdown-value{
  font-size: 42px;
  padding: 12px 22px;
  border-radius: 18px;
}
