/* ============================================================
   DER ZWEIKAMPF (Fabian, 26.08.)
   Links ein Held, rechts ein Held, dazwischen fallen die Items
   durch. Auf dem Handy stehen die beiden trotzdem nebeneinander –
   ein VS-Bildschirm untereinander wäre kein VS-Bildschirm.
   ============================================================ */

#spiel-vs { width: 100%; }
#vs-inhalt { width: 100%; min-width: 0; max-width: 680px; margin: 0 auto; }

/* ---------- Startbildschirm ---------- */
.vs-start { display: flex; flex-direction: column; gap: 12px; }
.vs-unter { text-align: center; color: var(--muted); margin: 4px 0 0; font-size: 17px; }
.vs-unter em { color: var(--gold-hell); font-style: normal; }
.vs-rekord { text-align: center; margin: 0; color: var(--muted); }
.vs-rekord strong { color: var(--gold-hell); font-family: "Cinzel", serif; font-size: 20px; }
.vs-neuer-rekord {
  text-align: center; margin: 0; font-family: "Cinzel", serif;
  color: #4ade80; font-size: 20px; letter-spacing: .5px;
}

.vs-schule {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--gold); border-radius: 12px; padding: 14px 16px;
}
.vs-schule-titel {
  font-family: "Cinzel", serif; color: var(--gold-hell);
  margin: 14px 0 4px; font-size: 15px; letter-spacing: .5px;
}
.vs-schule-titel:first-child { margin-top: 0; }
.vs-schule-liste { margin: 0; padding-left: 20px; }
.vs-schule-liste li { margin: 5px 0; line-height: 1.45; }
.vs-schule-satz { margin: 0; line-height: 1.5; color: var(--muted); }
.vs-schule-satz em { color: var(--gold-hell); font-style: normal; }
.vs-schule-farben {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 14px 0 2px; color: var(--muted); font-size: 15px;
}
.vs-punkt {
  display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  vertical-align: -2px; margin-right: 3px; flex: none;
}
/* Ein Legendeneintrag bleibt zusammen – sonst rutscht "wird abgewehrt"
   ohne seinen Punkt in die nächste Zeile. */
.vs-farbe { display: inline-flex; align-items: center; white-space: nowrap; }
.vs-punkt.gut { background: #4ade80; }
.vs-punkt.neutral { background: #f0c96c; }
.vs-punkt.schlecht { background: #e04b3a; }

/* ---------- Countdown ---------- */
.vs-countdown {
  display: flex; align-items: center; justify-content: center; min-height: 340px;
}
.vs-zahl {
  font-family: "Cinzel", serif; font-weight: 800; font-size: 124px;
  color: var(--gold-hell); text-shadow: 0 0 40px rgba(240, 201, 108, .5);
  animation: vsZahl .75s ease-out;
}
@keyframes vsZahl {
  0% { opacity: 0; transform: scale(2.2); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: .25; transform: scale(.86); }
}

/* ---------- Leiste ---------- */
.vs-leiste { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.vs-gold { flex: none; display: inline-flex; align-items: center; gap: 5px; }
.vs-gold strong {
  font-family: "Cinzel", serif; color: var(--gold-hell); font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.vs-muenze { width: 18px; height: 18px; object-fit: contain; }
.vs-gold strong.waechst { animation: vsGold .6s ease-out; }
@keyframes vsGold {
  0% { transform: scale(1); } 40% { transform: scale(1.35); color: #fff3d0; }
  100% { transform: scale(1); }
}
.vs-uhr-huelle {
  flex: 1; height: 8px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, .08); border: 1px solid var(--line);
}
.vs-uhr {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-hell));
  transition: width .12s linear;
}
.vs-uhr.knapp { background: linear-gradient(90deg, #a8342a, #e04b3a); }
.vs-sek { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.vs-sek strong { color: var(--text); font-family: "Cinzel", serif; }

/* ---------- Die Arena ---------- */
.vs-arena {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(96px, 132px) 1fr;
  gap: 6px;
  align-items: stretch;
  min-height: 340px;
}

.vs-held {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 6px 10px;
  border-radius: 14px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(10, 200, 185, .10), transparent 70%),
    linear-gradient(180deg, var(--panel), var(--bg-1));
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.vs-held.anvisiert {
  border-color: var(--gold-hell);
  box-shadow: 0 0 0 2px rgba(240, 201, 108, .35), 0 0 26px rgba(240, 201, 108, .25);
  transform: translateY(-3px);
}
.vs-held.wehrt-ab { animation: vsWehrt .42s ease-out; }
@keyframes vsWehrt {
  0%, 100% { transform: translateX(0); border-color: var(--line); }
  20% { transform: translateX(-7px); border-color: #e04b3a; }
  50% { transform: translateX(6px); border-color: #e04b3a; }
  80% { transform: translateX(-3px); }
}
.vs-held.kommt-rein.links { animation: vsReinLinks .5s cubic-bezier(.2, 1.3, .4, 1); }
.vs-held.kommt-rein.rechts { animation: vsReinRechts .5s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes vsReinLinks {
  0% { transform: translateX(-130%); opacity: 0; } 100% { transform: none; opacity: 1; }
}
@keyframes vsReinRechts {
  0% { transform: translateX(130%); opacity: 0; } 100% { transform: none; opacity: 1; }
}
.vs-held.stuermt.links { animation: vsSturmLinks .55s ease-out; }
.vs-held.stuermt.rechts { animation: vsSturmRechts .55s ease-out; }
@keyframes vsSturmLinks {
  0% { transform: none; } 28% { transform: translateX(26px) scale(1.04); }
  100% { transform: none; }
}
@keyframes vsSturmRechts {
  0% { transform: none; } 28% { transform: translateX(-26px) scale(1.04); }
  100% { transform: none; }
}
.vs-held.fliegt-raus.links { animation: vsRausLinks .6s ease-in forwards; }
.vs-held.fliegt-raus.rechts { animation: vsRausRechts .6s ease-in forwards; }
@keyframes vsRausLinks {
  0% { transform: none; opacity: 1; }
  100% { transform: translateX(-150%) rotate(-16deg); opacity: 0; }
}
@keyframes vsRausRechts {
  0% { transform: none; opacity: 1; }
  100% { transform: translateX(150%) rotate(16deg); opacity: 0; }
}

/* Die Splitter-Anzeige über dem Kopf – Fabians wichtigster Zusatz:
   man soll die ganze Zeit sehen, was dieser Held gerade wert ist. */
.vs-splitter {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px 2px 4px; border-radius: 99px;
  background: rgba(5, 11, 22, .72); border: 1px solid var(--line);
  color: var(--muted); font-size: 14px; line-height: 1.4;
}
.vs-splitter-bild { width: 17px; height: 17px; object-fit: contain; opacity: .55; }
.vs-splitter strong {
  font-family: "Cinzel", serif; font-variant-numeric: tabular-nums;
}
.vs-splitter.hat {
  border-color: rgba(10, 200, 185, .55); color: var(--text);
  box-shadow: 0 0 16px rgba(10, 200, 185, .25);
}
.vs-splitter.hat .vs-splitter-bild { opacity: 1; }
.vs-splitter.hat strong { color: var(--teal); }
.vs-splitter.waechst { animation: vsSplitterWaechst .7s ease-out; }
@keyframes vsSplitterWaechst {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); box-shadow: 0 0 26px rgba(10, 200, 185, .6); }
  100% { transform: scale(1); }
}

.vs-bild {
  display: block; width: 100%; max-width: 150px;
  aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-0);
}
.vs-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vs-held.links .vs-bild img { transform: scaleX(-1); }   /* schaut zur Mitte */
.vs-kein-bild {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-family: "Cinzel", serif;
  font-size: 34px; color: var(--gold); background: var(--panel-2);
}
.vs-name {
  font-family: "Cinzel", serif; font-size: 16px; color: var(--gold-hell);
  text-align: center; line-height: 1.15; text-wrap: balance;
}
.vs-rolle { color: var(--muted); font-size: 13px; margin-top: -3px; }

.vs-slots { display: flex; gap: 5px; margin-top: 2px; }
.vs-slot {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px dashed var(--line); background: rgba(255, 255, 255, .03);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.vs-slot.voll { border-style: solid; animation: vsSlot .4s cubic-bezier(.2, 1.4, .4, 1); }
.vs-slot.voll.gut { border-color: #4ade80; box-shadow: 0 0 12px rgba(74, 222, 128, .35); }
.vs-slot.voll.neutral { border-color: #f0c96c; box-shadow: 0 0 12px rgba(240, 201, 108, .3); }
.vs-slot img { width: 100%; height: 100%; object-fit: contain; }
@keyframes vsSlot {
  0% { transform: scale(.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; }
}

/* ---------- Die Fallbahn ---------- */
.vs-bahn {
  position: relative;
  overflow: visible;
  /* Muss über BEIDEN Helden liegen: Als mittleres Geschwister läge das
     fliegende Item sonst hinter dem rechten Helden. */
  z-index: 4;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(10, 200, 185, .07), transparent 45%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 26px);
  border-left: 1px solid rgba(30, 58, 95, .6);
  border-right: 1px solid rgba(30, 58, 95, .6);
}
/* Das VS steht blass hinter der Bahn – es macht aus zwei nebeneinander
   stehenden Portraits erst einen Zweikampf. */
.vs-bahn::before {
  content: "VS";
  position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14px;
  font-family: "Cinzel", serif; font-weight: 800;
  font-size: clamp(38px, 11vw, 58px); letter-spacing: 2px;
  color: rgba(240, 201, 108, .19);
  text-shadow: 0 0 30px rgba(240, 201, 108, .12);
  pointer-events: none;
}

.vs-item {
  position: absolute; top: 0; left: 50%; z-index: 1;
  width: 92px; padding: 6px 4px 7px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text); font: inherit; cursor: grab;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .45);
  touch-action: none; user-select: none; -webkit-user-select: none;
  will-change: transform;
}
.vs-item-bild {
  width: 44px; height: 44px; border-radius: 8px; overflow: hidden;
  background: var(--bg-0); display: flex; align-items: center; justify-content: center;
}
.vs-item-bild img { width: 100%; height: 100%; object-fit: contain; }
.vs-item-name {
  font-size: 11px; line-height: 1.15; text-align: center; color: var(--muted);
  max-width: 88px; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.vs-item.gepackt {
  cursor: grabbing; border-color: var(--gold-hell); z-index: 6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 22px rgba(240, 201, 108, .3);
}
.vs-item.in-hand {
  border-color: var(--gold-hell); animation: vsHand 1.1s ease-in-out infinite;
}
@keyframes vsHand {
  0%, 100% { box-shadow: 0 6px 22px rgba(0, 0, 0, .45), 0 0 0 rgba(240, 201, 108, 0); }
  50% { box-shadow: 0 6px 22px rgba(0, 0, 0, .45), 0 0 24px rgba(240, 201, 108, .55); }
}
.vs-item.angenommen { animation: vsWeg .3s ease-in forwards; }
.vs-item.angenommen.gut { border-color: #4ade80; }
.vs-item.angenommen.neutral { border-color: #f0c96c; }
.vs-item.abgewehrt { border-color: #e04b3a; animation: vsAbgewehrt .34s ease-in forwards; }
.vs-item.weg { opacity: 0; }
/* Nur Deckkraft und Helligkeit: Das transform steht am Element selbst
   und trägt die Flugposition – eine Keyframe darf es nicht überschreiben,
   sonst springt das Item beim Ablegen zurück nach oben. */
@keyframes vsWeg {
  0% { opacity: 1; filter: none; }
  35% { opacity: 1; filter: brightness(1.7); }
  100% { opacity: 0; filter: brightness(1.7); }
}
@keyframes vsAbgewehrt {
  0% { opacity: 1; } 30% { opacity: 1; filter: brightness(1.6) saturate(.4); }
  100% { opacity: 0; }
}

/* ---------- Hinweiszeile ---------- */
.vs-hinweis {
  min-height: 46px; margin: 10px 0 0; padding: 7px 10px;
  border-radius: 10px; background: rgba(255, 255, 255, .03);
  border: 1px solid transparent;
  font-size: 15px; line-height: 1.35; color: var(--muted);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.vs-hinweis strong { color: var(--text); }
.vs-hinweis.gut { border-color: rgba(74, 222, 128, .4); }
.vs-hinweis.neutral { border-color: rgba(240, 201, 108, .4); }
.vs-hinweis.schlecht { border-color: rgba(224, 75, 58, .45); }
.vs-hinweis.verpasst { border-color: rgba(240, 201, 108, .25); font-style: italic; }
.vs-hinweis.sieg {
  border-color: rgba(10, 200, 185, .45); color: var(--text);
  background: rgba(10, 200, 185, .07);
}

/* ---------- Schlussbildschirm ---------- */
.vs-ende { display: flex; flex-direction: column; gap: 12px; }
.vs-ende-zahl { text-align: center; margin: 6px 0 0; color: var(--muted); font-size: 17px; }
.vs-ende-zahl strong {
  display: block; font-family: "Cinzel", serif; font-size: 46px;
  color: var(--gold-hell); line-height: 1.1;
}
.vs-ende-gold {
  text-align: center; margin: -6px 0 0; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

.vs-beute {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--teal); border-radius: 12px; padding: 12px 14px;
}
.vs-beute-titel {
  font-family: "Cinzel", serif; color: var(--gold-hell);
  margin: 0 0 10px; font-size: 15px; line-height: 1.3;
}
.vs-beute-zeile { display: flex; align-items: center; gap: 14px; }
.vs-beute-zeile > div { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.vs-beute-menge { font-family: "Cinzel", serif; font-size: 22px; color: var(--teal); }
.vs-beute-stand { color: var(--muted); font-size: 15px; }
.vs-beute-balken {
  display: block; height: 7px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, .08); margin-top: 3px;
}
.vs-beute-balken span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--teal), #7ee8dd);
}
.vs-beute-frei { margin: 10px 0 0; color: #4ade80; }
.vs-beute-leer {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
  color: var(--muted); line-height: 1.45;
}

.vs-abschnitt {
  font-family: "Cinzel", serif; color: var(--gold-hell);
  margin: 8px 0 -4px; font-size: 15px; letter-spacing: .5px;
}
.vs-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.vs-liste li {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px;
}
.vs-liste-bild {
  width: 40px; height: 40px; border-radius: 8px; overflow: hidden; flex: none;
  background: var(--bg-0);
}
.vs-liste-bild img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.vs-liste li strong { color: var(--gold-hell); }
.vs-liste li small { display: block; color: var(--muted); font-size: 14px; margin-top: 1px; }

.vs-lernliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.vs-lernliste li {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 7px 10px; border-radius: 10px; line-height: 1.4; font-size: 15px;
  background: rgba(255, 255, 255, .03); border-left: 3px solid var(--line);
}
.vs-lernliste li .vs-punkt { margin-top: 5px; }
.vs-lernliste li > span:last-child { flex: 1; min-width: 0; }
.vs-lernliste li.gut { border-left-color: #4ade80; }
.vs-lernliste li.neutral { border-left-color: #f0c96c; }
.vs-lernliste li strong { color: var(--text); }

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 420px) {
  .vs-arena { grid-template-columns: 1fr minmax(84px, 104px) 1fr; gap: 4px; min-height: 300px; }
  .vs-item { width: 80px; }
  .vs-item-bild { width: 38px; height: 38px; }
  .vs-item-name { max-width: 76px; }
  .vs-slot { width: 29px; height: 29px; }
  .vs-name { font-size: 15px; }
  .vs-splitter { font-size: 13px; padding: 1px 7px 1px 3px; }
}

/* Wer keine Bewegung mag, bekommt trotzdem alles zu sehen –
   nur ohne Flug. */
@media (prefers-reduced-motion: reduce) {
  .vs-held.kommt-rein.links, .vs-held.kommt-rein.rechts,
  .vs-held.stuermt.links, .vs-held.stuermt.rechts,
  .vs-item.in-hand, .vs-zahl { animation: none; }
  .vs-held.fliegt-raus.links, .vs-held.fliegt-raus.rechts {
    animation: none; opacity: 0;
  }
}


/* ---------- Bestenliste: längste Serie mit EINEM Helden ---------- */
/* Fabian (26.08.): "Im normalen Spiel sollte es eine Rekordliste geben,
   wie viele Helden man in a row mit einem besiegt hat." */
.vs-besten {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--gold); border-radius: 12px; padding: 10px 12px;
}
.vs-besten-titel {
  font-family: "Cinzel", serif; color: var(--gold-hell);
  margin: 0 0 8px; font-size: 15px; letter-spacing: .5px;
}
.vs-besten-liste {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.vs-besten-liste li {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 8px; border-radius: 9px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid transparent;
}
.vs-besten-liste li.frisch {
  border-color: rgba(74, 222, 128, .5); background: rgba(74, 222, 128, .08);
}
.vs-besten-platz {
  flex: none; width: 20px; text-align: center;
  font-family: "Cinzel", serif; color: var(--gold); font-size: 15px;
}
.vs-besten-bild {
  flex: none; width: 34px; height: 34px; border-radius: 7px;
  overflow: hidden; background: var(--bg-0);
}
.vs-besten-bild img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
}
.vs-besten-wer { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vs-besten-wer strong { color: var(--text); font-size: 15px; }
.vs-besten-wer small { color: var(--muted); font-size: 12.5px; }
.vs-besten-zahl {
  flex: none; text-align: right; font-family: "Cinzel", serif;
  color: var(--gold-hell); font-size: 20px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.vs-besten-zahl small {
  display: block; font-family: inherit; font-size: 11px;
  color: var(--muted); letter-spacing: .2px;
}

.vs-serie { text-align: center; margin: -4px 0 0; color: var(--muted); }
.vs-serie strong { color: var(--gold-hell); }

/* Die Beute-Zeile trägt jetzt das Anzeigebild */
.vs-beute-zeile .pz { width: 86px; flex: none; }
.vs-beute-teile { color: #4ade80; font-size: 13.5px; margin-top: 2px; }

/* ---------- Die Serie (Wertung im Hauptmenü) ---------- */
/* Fabian (26.08.): Gold und Splitter gehören in den Collector. Hier zählt
   stattdessen, wie viele Items man hintereinander richtig gesetzt hat. */
.vs-seriezahl { gap: 4px; }
.vs-serie-zeichen { font-size: 15px; opacity: .55; line-height: 1; }
.vs-seriezahl.laeuft .vs-serie-zeichen { opacity: 1; }
.vs-seriezahl.laeuft strong {
  color: #4ade80; text-shadow: 0 0 14px rgba(74, 222, 128, .45);
}
.vs-serie-weg { color: #e04b3a; }

/* ---------- Wertesymbole am fallenden Item (Richard, 28.08.) ---------- */
/* "Bei den Quiz außerhalb des Collector-Modus auch alle Symbole von
   Items und so zu haben wäre nice." Klein gehalten: Das Item fällt, man
   hat eine Sekunde – die Symbole sollen den Blick führen, nicht die
   Karte vollstellen. */
.vs-item-werte {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
  margin-top: 3px;
}
.vs-item-werte .stat-chip.nur-symbol { padding: 0; background: none; border: 0; }
.vs-item-werte .wert-symbol { width: 17px; height: 17px; display: block; }
/* Das Item-Bild in der Meldung darunter */
.vs-sag-bild { display: inline-block; vertical-align: -6px; margin-right: 5px; }
.vs-sag-bild img { width: 22px; height: 22px; border-radius: 5px; }
