/* ============================================================
   dashboard2.css — Homescreen „Bühne“ (js/screens/dashboard2.js)

   Leitidee nach Pauls Rückmeldung („überladen, zu viel“): EIN
   Grün. Oben die satte Fando-Bühne wie bei Login und Shop – sie
   trägt Kopf, Gruß und die Kennzahlen als Glas-Scorecard. Darunter
   rollt EINE weiße Fläche mit großem Radius über die Bühne; die
   Sektionen darin sind ruhige Zeilen mit Overline-Köpfen, keine
   Karten-Stapel. Keine 3D-Optik, kein Parallax.
   ============================================================ */

.dash5 { min-height: 100%; display: flex; flex-direction: column; background: var(--surface); }

/* ---------------- Grüne Bühne ---------------- */
.d5-hero {
  position: relative; overflow: hidden; color: #fff;
  padding: calc(var(--safe-top) + 14px) 20px 46px;
  background: linear-gradient(150deg, #5aa233 0%, #43811f 60%, #356a1b 100%);
}
/* Stille Ring-Deko wie am Login – Wiedererkennung statt Dekor-Lärm. */
.d5-hero::after {
  content: ""; position: absolute; right: -70px; top: -60px; width: 210px; height: 210px;
  border-radius: 50%; border: 34px solid rgba(255, 255, 255, 0.07);
}
.d5-hero::before {
  content: ""; position: absolute; right: 66px; bottom: -30px; width: 110px; height: 110px;
  border-radius: 50%; border: 18px solid rgba(255, 255, 255, 0.06);
}
.d5-hero > * { position: relative; z-index: 1; }

.d5-top { display: flex; justify-content: space-between; align-items: center; }
.d5-ol {
  font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.75);
}
/* App-Name direkt unter der Marke: nur minimal größer, dicht dran. */
.d5-app { font-size: var(--fs-md); font-weight: var(--fw-bold); line-height: 1.15; }
.d5-ib {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.14); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.d5-ib .avatar { --sz: 40px; }
.d5-chip {
  height: 40px; padding: 0 13px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.14); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  font-weight: var(--fw-bold); font-size: var(--fs-sm);
}
.d5-greet {
  margin-top: 16px;
  font-size: var(--fs-3xl); font-weight: var(--fw-black);
  letter-spacing: var(--tracking-tight); line-height: 1.05;
}
/* „Servus,“ gedämpft, der Name voll – wie im alten Kopf, nur auf Grün. */
.d5-greet .hi { color: rgba(255, 255, 255, 0.68); font-weight: var(--fw-semibold); }

/* Glas-Scorecard: eine Zeile Kennzahlen + eine Status-Zeile.
   Rang führt, Ziffern in Weiß, Trennlinien hauchdünn. */
.d5-score {
  margin-top: 18px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.d5-srow { display: flex; align-items: stretch; padding: 13px 6px; }
.d5-stat {
  flex: 1; min-width: 0; text-align: center;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.d5-stat + .d5-stat { border-left: 1px solid rgba(255, 255, 255, 0.16); }
.d5-stat b { font-size: var(--fs-xl); font-weight: var(--fw-black); line-height: 1.05; font-variant-numeric: tabular-nums; }
.d5-stat.rank b { font-size: 26px; }
.d5-stat .sl {
  font-size: 9px; font-weight: var(--fw-bold);
  letter-spacing: 0.09em; text-transform: uppercase; color: rgba(255, 255, 255, 0.68);
}
.d5-form { display: flex; align-items: center; justify-content: center; gap: 5px; height: calc(var(--fs-xl) * 1.05); }
.d5-form .fd { width: 9px; height: 9px; border-radius: 50%; background: #fff; font-style: normal; }
.d5-form .fd.l { background: rgba(255, 255, 255, 0.34); }

.d5-goal {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px 12px; border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.d5-goal .l {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
}
.d5-goal .l .icon { flex: none; }
.d5-goal .r { margin-left: auto; white-space: nowrap; font-size: var(--fs-sm); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.d5-goal .bar { flex-basis: 100%; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.d5-goal .bar i { display: block; height: 100%; border-radius: 99px; background: #fff; transform-origin: left; }

/* ---------------- Weiße Fläche ---------------- */
.d5-sheet {
  flex: 1; position: relative; z-index: 2;
  background: var(--surface); border-radius: 26px 26px 0 0;
  margin-top: -26px; padding: 4px 16px 8px;
  box-shadow: 0 -12px 30px rgba(35, 37, 37, 0.12);
}
.d5-sec { margin-top: 4px; }
.d5-sec .section-head { margin: 22px 2px 12px; }

/* ---------------- Bilanz-Zeile --------------------------------
   Zwei farbige Bereiche (Breite = Sieg-Verhältnis), bewusst
   schlank: flache Farben, keine Schatten, feine Fuge. Kam vom
   Homescreen und wohnt jetzt im Profil (Modifier .pf). */
.d4-wlbar { display: flex; gap: 2px; height: 30px; margin: 12px 2px 0; }
.d4-wlbar.pf { height: 26px; margin: 14px auto 0; width: 66%; align-self: center; }
.d4-wlbar .w, .d4-wlbar .l {
  flex-basis: 0; min-width: 0; display: flex; align-items: center; overflow: hidden;
  font-size: var(--fs-xs); font-weight: var(--fw-bold); white-space: nowrap;
}
/* Die Farbsprache der App: Siege grün (wie „Bin da“), Ndl. grau –
   Niederlagen sind hier nirgends rot. */
.d4-wlbar .w { background: var(--fando-600); color: #fff; border-radius: 99px 4px 4px 99px; justify-content: flex-start; padding-left: 12px; }
.d4-wlbar .l { background: var(--stone-200); color: var(--ink-600); border-radius: 4px 99px 99px 4px; justify-content: flex-end; padding-right: 12px; }
/* Steht nur eine Seite (0 Ndl., 0 Siege oder noch kein Spiel):
   volle Rundung, Beschriftung links. */
.d4-wlbar .w.only, .d4-wlbar .l.only { flex-grow: 1; border-radius: 99px; justify-content: flex-start; padding: 0 12px; }
.d4-wlbar .l.only { color: var(--text-muted); }
.d4-wlbar span { display: inline-flex; align-items: center; gap: 4px; }
.d4-wlbar .icon { width: 12px; height: 12px; }
.d4-wlbar i { font-style: normal; font-variant-numeric: tabular-nums; }

/* ---------------- Schwebende Aktionsleiste ---------------- */
.d4-sentinel { height: 1px; }
.d4-dock { position: sticky; top: 0; z-index: 10; padding: 14px 0 4px; }
.d4-dock::before {
  content: ""; position: absolute; inset: 0 -16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  opacity: 0; transition: opacity var(--dur-2);
}
/* Kein weißer Container: jeder Knopf steht frei und trägt seinen
   eigenen weichen Schatten (reine Tiefenstaffelung). */
.d4-dock .bar { position: relative; display: flex; gap: 10px; align-items: center; }
.d4-dock.pinned { padding: calc(var(--safe-top) + 8px) 0 8px; }
.d4-dock.pinned::before { opacity: 1; }
.d4-cta {
  flex: 1; height: 50px; border-radius: var(--r-pill); border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: linear-gradient(135deg, #5aa233, #3f7620);
  color: #fff; font-size: var(--fs-md); font-weight: var(--fw-bold);
  box-shadow: 0 8px 18px rgba(53, 106, 27, 0.30);
}
.d4-cta:active { background: var(--fando-600); }
/* Die Acht bleibt schwarz (sie IST die schwarze Kugel), der Pokal
   sitzt als grünes Icon im weißen Kreis. */
.d4-side {
  flex: none; width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: var(--ink-800); border: 0; color: #fff;
  box-shadow: 0 8px 18px rgba(35, 37, 37, 0.26);
}
.d4-side.light {
  background: #fff; color: var(--fando-700);
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(35, 37, 37, 0.16);
}
/* Die Acht als flache Scheibe – bewusst ohne Kugel-Glanz */
.d4-eight {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--ink-800); font-size: 13px; font-weight: var(--fw-black);
  font-style: normal; line-height: 1;
}
/* Geteilte Modus-Kugeln flach ziehen */
.dash5 .mode-ball { background: var(--ball, #1c1d1d); box-shadow: none; }

/* ---------------- Sektion: Im Lokal ---------------- */
.d4-lokal-line { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 2px; }
.d4-pulse { position: relative; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--fando); margin: 0 3px; }
.d4-pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--fando); animation: pulse-ring 2s var(--ease-out) infinite;
}
.d4-pulse.idle { background: var(--stone-300); }
.d4-pulse.idle::after { display: none; }
.dash5 .presence-faces .avatar { box-shadow: 0 0 0 2px var(--surface); }
.dash5 .pr-avatar.is-coming { opacity: 0.55; }
.d4-lokal-line .d4-sm { flex: none; }
.d4-lokal-cta { display: flex; gap: 8px; margin-top: 11px; padding: 0 2px; }
.d4-sm {
  height: 36px; padding: 0 15px; border-radius: var(--r-pill); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  background: var(--fando); border: 1px solid var(--fando); color: #fff;
}
.d4-sm.ghost { background: none; border-color: var(--border-strong); color: var(--text); }
.d4-sm.slim { background: none; border-color: transparent; color: var(--text-muted); padding: 0 8px; }

/* Laufende Spiele: weiße Karten-Zeilen wie das Spotlight */
.d4-live {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  margin-top: 10px; padding: 11px 13px; color: inherit; font: inherit;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-xs); border-radius: 14px;
}
/* Spiele ANDERER: sattes Grün mit weißem Text – das eigene bleibt weiß. */
.d4-live.other {
  background: linear-gradient(135deg, #5aa233, #3f7620);
  border: 0; color: #fff;
  box-shadow: 0 6px 16px rgba(53, 106, 27, 0.24);
}
.d4-live.other .caption { color: rgba(255, 255, 255, 0.85); }
.d4-live.other .score i { color: rgba(255, 255, 255, 0.75); }
.d4-live.other .badge-green { background: rgba(255, 255, 255, 0.22); color: #fff; }
/* Auf der grünen Zeile ginge das fando-grüne Tisch-Symbol unter. */
.d4-live.other .table-chip .icon-sm { color: #fff; }
.d4-live .score { font-weight: var(--fw-bold); font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.d4-live .score i { font-style: normal; color: var(--text-subtle); }

/* ---------------- „Für dich“: Schnapp-Karten ---------------- */
.d4-car {
  display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 8px;
  scrollbar-width: none;
}
.d4-car::-webkit-scrollbar { display: none; }
.d4-cc {
  flex: 0 0 78%; scroll-snap-align: center; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; overflow: hidden; padding: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow-xs);
}
/* Kopfzeilen kräftig: sattes Grün, Kronen-Karten dunkel mit Gold */
.d4-cc .hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 14px; background: var(--fando-600);
}
.d4-cc .hd .k {
  font-size: 10px; font-weight: var(--fw-black); letter-spacing: 0.1em;
  text-transform: uppercase; color: #fff;
}
.d4-cc .hd .badge { background: rgba(255, 255, 255, 0.22); color: #fff; }
.d4-cc.gold .hd { background: var(--ink-800); }
.d4-cc.gold .hd .k { color: var(--gold); }
.d4-cc.gold .hd .badge { background: rgba(255, 255, 255, 0.16); color: var(--gold-pale); }
.d4-cc.stone .hd { background: var(--stone-200); }
.d4-cc.stone .hd .k { color: var(--ink-600); }
.d4-cc.stone .hd .badge { background: #fff; color: var(--text-muted); }
.d4-cc .bd { display: flex; align-items: center; gap: 11px; padding: 12px 14px; min-width: 0; }
.d4-cc .bd .avatar { --sz: 40px; }
.d4-cc.more {
  flex-basis: 42%; align-items: center; justify-content: center; gap: 8px; padding: 14px;
  background: linear-gradient(150deg, #5aa233, #3f7620); border: 0; color: #fff;
  font-size: var(--fs-sm); font-weight: var(--fw-bold); text-align: center;
}
.d4-dots { display: flex; justify-content: center; gap: 5px; margin-top: 6px; }
.d4-dots span { width: 6px; height: 6px; border-radius: 99px; background: var(--stone-300); transition: width var(--dur-2) var(--ease-standard), background var(--dur-2); }
.d4-dots span.on { width: 18px; background: var(--fando); }

/* ---------------- Spotlight als leise Zeile ----------------
   Der Ton (green/gold/red/dust) lebt nur noch im Icon-Plättchen –
   die Zeile selbst ist eine eingelassene Fläche, kein Vollton. */
.d5-spot {
  width: 100%; text-align: left; cursor: default;
  display: flex; align-items: center; gap: 12px;
  margin-top: 22px; padding: 13px 14px;
  border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-xs);
  color: inherit; font: inherit;
}
button.d5-spot { cursor: pointer; }
.d5-spot .sic { flex: none; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; }
.d5-spot .sic.green { background: var(--fando-100); color: var(--fando-700); }
.d5-spot .overline { color: var(--fando-700); }
.d5-spot .sic.red { background: var(--danger-tint); color: var(--danger); }
.d5-spot .sic.dust { background: var(--stone-200); color: var(--stone-600); }
.d5-spot .sic.gold { background: var(--ink-800); color: var(--gold); }
.d5-spot .btn { background: var(--surface); }

/* ---------------- Sektion: Aktivität ---------------- */
.d4-act {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 11px 2px; background: none; border: 0; font: inherit; color: inherit; cursor: pointer;
}
.d4-act + .d4-act { border-top: 1px solid var(--stone-100); }
.d4-act .activity-dot { flex: none; }
.d4-act .when { font-variant-numeric: tabular-nums; }

/* ============================================================
   Bewegung — Bühne zuerst, dann rollt die Fläche nach; Sektionen
   steigen beim Erscheinen ein (nur .first, Live-Updates still).
   ============================================================ */
@keyframes d4-rise { from { opacity: 0; transform: translateY(20px) scale(0.985); } }

.dash5.first [data-reveal]:not(.in) { opacity: 0; }
.dash5.first [data-reveal].in { animation: d4-rise var(--dur-4) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 80ms); }

/* Bühnen-Einzug: Kopf, Gruß, Scorecard nacheinander */
.dash5.first .d5-top { animation: fade-down var(--dur-3) var(--ease-out) both; }
.dash5.first .d5-greet { animation: fade-up var(--dur-4) var(--ease-out) 90ms both; }
.dash5.first .d5-score { animation: fade-up var(--dur-4) var(--ease-out) 180ms both; }
.dash5.first .d5-stat { animation: fade-in var(--dur-3) var(--ease-out) both; }
.dash5.first .d5-stat:nth-child(1) { animation-delay: 280ms; }
.dash5.first .d5-stat:nth-child(2) { animation-delay: 350ms; }
.dash5.first .d5-stat:nth-child(3) { animation-delay: 420ms; }
.dash5.first .d5-stat:nth-child(4) { animation-delay: 490ms; }
.dash5.first .d5-form .fd { animation: pop-in var(--dur-4) var(--ease-spring) both; animation-delay: calc(520ms + var(--i, 0) * 45ms); }
.dash5.first .d5-goal { animation: fade-in var(--dur-3) var(--ease-out) 560ms both; }
.dash5.first .d5-goal .bar i { animation: grow-bar 700ms var(--ease-out) 680ms both; }

/* Die weiße Fläche rollt kurz nach der Bühne hoch */
.dash5.first .d5-sheet { animation: d4-rise var(--dur-5, 480ms) var(--ease-out) 120ms both; }
.dash5.first .d4-dock .bar { animation: scale-in var(--dur-4) var(--ease-spring) 260ms both; }

/* Die Bilanz-Hälften schieben sich im Profil von beiden Seiten zusammen */
.d4-wlbar.pf { overflow: hidden; }
.d4-wlbar.pf .w { animation: d4-wl-left 550ms var(--ease-out) 200ms both; }
.d4-wlbar.pf .l { animation: d4-wl-right 550ms var(--ease-out) 200ms both; }
@keyframes d4-wl-left { from { transform: translateX(-102%); opacity: 0.4; } }
@keyframes d4-wl-right { from { transform: translateX(102%); opacity: 0.4; } }

/* Schnapp-Karten treten nacheinander von rechts an */
.dash5.first .d4-fyi.in .d4-cc { animation: slide-in-right var(--dur-4) var(--ease-out) both; animation-delay: calc(120ms + var(--i, 0) * 75ms); }
.dash5.first .d4-fyi.in .d4-dots { animation: fade-in var(--dur-3) var(--ease-out) 600ms both; }

.dash5.first .d4-acts.in .d4-act { animation: fade-up var(--dur-3) var(--ease-out) both; animation-delay: calc(100ms + var(--i, 0) * 60ms); }
