/* busfahrer.css — Styles für "Busfahrer" (Ride the Bus).
   Phase 1 nutzt die Spielkarten-Optik aus ht.css (nur kleiner skaliert).
   Phase 2 ist die animierte Pyramide (Deal-Fly-in + 3D-Flip). */

/* ---------- Phase 1: Rate-Runde ---------- */
.bf-stage .bf-steps {
  display: flex; justify-content: center; gap: 8px; margin: 4px 0 10px;
}
.bf-stage .bf-steps i {
  width: 12px; height: 12px; border-radius: 999px;
  background: rgba(27, 53, 86, 0.18);
  box-shadow: inset 0 0 0 2px rgba(27, 53, 86, 0.25);
  transition: transform .2s ease, background .2s ease;
}
.bf-stage .bf-steps i.done { background: var(--accent); box-shadow: inset 0 0 0 2px var(--bar-ink); }
.bf-stage .bf-steps i.now  { transform: scale(1.35); background: var(--accent); box-shadow: 0 0 0 3px rgba(255, 207, 63, 0.5), inset 0 0 0 2px var(--bar-ink); }

.bf-question {
  font-family: var(--font-ui);
  font-size: 19px; font-weight: 800; letter-spacing: -0.2px;
  color: var(--ink);
  margin: 2px 0 6px;
}

/* Karten in Phase 1 kompakter als bei Höher/Tiefer (bis zu 5 nebeneinander). */
.bf-cards .playing-card,
.bf-cards .pc-flip { width: 78px; height: 114px; margin: 0 4px; }
.bf-cards .pc-flip { perspective: 700px; }
.bf-cards .pc-value { font-size: 34px; }
.bf-cards .pc-suit-big { margin-top: 2px; }
.bf-cards .pc-corner-tl, .bf-cards .pc-corner-br { font-size: 12px; }
/* Rückseite in der (kleineren) Rate-Karte voll & unbeschnitten zeigen (contain). */
.bf-cards .playing-card.back img { width: 100% !important; height: 100% !important; object-fit: contain; }

/* Rot / Schwarz-Buttons — der ROT-Button ist auch wirklich ROT (nicht das
   gold-aliaste --sp-red, sondern das echte Kartenrot). */
.btn.bf-red {
  background: var(--card-red); color: #fff; border-color: var(--bar-ink);
}
.btn.bf-red:hover { background: #b81b23; }
.btn.bf-black {
  background: #23324a; color: #fff; border-color: var(--bar-ink);
}
/* ROT & SCHWARZ gleich groß (unabhängig von der Textlänge) — je halbe Reihe. */
.bf-btns .btn.bf-red, .bf-btns .btn.bf-black { flex: 1 1 0; min-width: 0; }
/* Symbol-Buttons (Farbe raten): vier gleich große Karten-Chips. */
.bf-btns.bf-suits { gap: 10px; }
.btn.bf-suit {
  min-width: 60px; padding: 12px 0; display: inline-flex; justify-content: center;
}
.btn.bf-suit svg { display: block; }
.bf-rule { font-size: 13px; color: rgba(27, 53, 86, 0.7); }

/* ---------- Phase 2: Pyramide ---------- */
.bf-pyramid-stage .bf-title { margin-top: 2px; }
.bf-pyramid {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin: 14px 0 6px;
}
.bf-row { display: flex; align-items: center; gap: 8px; }
.bf-row-val {
  display: inline-flex; align-items: center; gap: 2px;
  font-family: var(--font-ui); font-size: 12px; font-weight: 800;
  color: rgba(27, 53, 86, 0.7); min-width: 30px; justify-content: flex-end;
}
.bf-row-val svg { display: block; }
.bf-row-cards { display: flex; gap: 6px; }

/* Ein Pyramiden-Slot: fester Kartenrahmen, Inhalt dreht in 3D. */
.bf-slot {
  width: 62px; height: 88px;
  perspective: 700px;
  animation: bfDeal .5s cubic-bezier(.2, .9, .3, 1.2) both;
  animation-delay: calc(var(--i) * 55ms);   /* gestaffelter Deal von unten nach oben */
}
@keyframes bfDeal {
  from { opacity: 0; transform: translateY(-46px) scale(.5) rotate(-10deg); }
  to   { opacity: 1; transform: none; }
}
.bf-card-flip {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.2, .7, .3, 1);
}
.bf-card-flip.flipped { transform: rotateY(180deg); }
.bf-face {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  border-radius: 10px; overflow: hidden;
  border: 2.5px solid var(--bar-ink);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  display: flex; align-items: center; justify-content: center;
}
/* Rückseite = das fertige Bild cards_back.webp (eigener Rahmen + Ecken). Kein
   Gold-Deckel, kein Tinte-Rand, keine Ziernaht dahinter → saubere runde Ecken. */
.bf-face.bf-back {
  transform: rotateY(0deg);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.bf-face.bf-back::before { display: none; }
.bf-face.bf-back img { width: 100%; height: 100%; object-fit: contain; }
.bf-face.bf-front { transform: rotateY(180deg); background: #fdf7ea; }

.bf-pc {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--bar-ink); font-family: 'Bangers', sans-serif;
}
.bf-pc-tl {
  position: absolute; top: 3px; left: 5px;
  display: flex; flex-direction: column; align-items: center;
  font-size: 12px; line-height: 1;
}
.bf-pc-tl svg { display: block; }
.bf-pc-suit { font-size: 0; }
.bf-pc-suit svg { display: block; }
/* Rote Karten (Herz/Karo): Rang + Symbol rot — Symbol erbt currentColor. */
.bf-pc.red { color: var(--card-red); }

/* Handkarten-Übersicht (öffentlich) unter der Pyramide. */
.bf-hands { margin: 10px auto 0; max-width: 320px; display: flex; flex-direction: column; gap: 6px; }
.bf-hand-row {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.5); border-radius: 12px; padding: 5px 8px;
}
.bf-hand-av {
  width: 26px; height: 26px; border-radius: 999px; object-fit: cover;
  border: 2px solid var(--bar-ink); background: var(--sp-avatar-bg); flex: 0 0 auto;
}
.bf-hand-name {
  font-family: var(--font-ui); font-size: 12px; font-weight: 800;
  color: var(--ink); flex: 0 0 auto; min-width: 54px;
}
.bf-hand-cards { display: flex; flex-wrap: wrap; gap: 4px; }
.bf-hand-card {
  display: inline-flex; align-items: center; gap: 1px;
  font-family: var(--font-ui); font-size: 12px; font-weight: 800;
  color: var(--bar-ink);
  background: #fdf7ea; border: 2px solid var(--bar-ink); border-radius: 6px;
  padding: 1px 5px;
}
.bf-hand-card svg { display: block; }
.bf-hand-card.red { color: var(--card-red); }
/* Neue Regel: passende Handkarte wird beim Aufdecken ABGELEGT — sie leuchtet kurz
   gold auf und fliegt dann nach oben aus der Hand. */
.bf-hand-card.bf-removing { animation: bfRemove .5s cubic-bezier(.5, -0.2, .8, .7) forwards; pointer-events: none; }
@keyframes bfRemove {
  0%   { transform: scale(1);    background: var(--accent); color: var(--bar-ink); }
  30%  { transform: scale(1.25); background: var(--accent); }
  100% { transform: translateY(-34px) scale(.3) rotate(12deg); opacity: 0; }
}

.bf-prog { font-size: 13px; opacity: 0.85; margin-left: 4px; }

/* Solo-Finale: Busfahrer-Kopf etwas hervorheben. */
.bf-solo-header .turn-game { color: var(--sp-red); font-weight: 800; }
.bf-driver-count {
  margin-top: 6px;
  display: inline-block;
  font-family: var(--font-ui); font-size: 12px; font-weight: 800;
  color: var(--bar-ink);
  background: var(--accent);
  border: 2px solid var(--bar-ink);
  border-radius: 999px; padding: 2px 12px;
}

@media (prefers-reduced-motion: reduce) {
  .bf-slot { animation: none; }
  .bf-card-flip { transition: none; }
  .bf-hand-card.bf-removing { animation: none; opacity: 0; }
}
