:root {
  --bg: #0b1120;
  --bg-elevated: #111827;
  --card: rgba(30, 41, 59, 0.72);
  --card-solid: #1e293b;
  --border: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --gold: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.16);
  --accent: #38bdf8;
  --green: #10b981;
  --danger: #ef4444;
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top right, #1e293b 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 18px 40px;
}

.container-narrow {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 14px 96px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand h1 {
  font-size: clamp(1.25rem, 2.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.live-pill.offline {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--card-solid);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: #273449;
  border-color: rgba(148, 163, 184, 0.35);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border-color: transparent;
  color: #0b1120;
  font-weight: 800;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24, #f97316);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.82rem;
  border-radius: 9px;
}

.card {
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* Leader Hero */
.leader-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 28px 26px;
  margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(30, 41, 59, 0.92) 55%, rgba(15, 23, 42, 0.96) 100%);
  border: 1px solid rgba(245, 158, 11, 0.42);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.leader-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.leader-content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.leader-name {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  display: flex;
  align-items: center;
  gap: 14px;
}

.leader-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 18px currentColor;
}

.leader-sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.leader-metric {
  text-align: right;
}

.leader-liters {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 900;
  color: #fbbf24;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.leader-drinks {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.drink-pill {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.84rem;
  color: #e2e8f0;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .leader-metric {
    text-align: left;
  }
}

.section-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Leaderboard */
.team-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-row {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  transition: transform 0.2s ease, border-color 0.25s ease, background 0.25s ease;
}

.team-row.rank-1 {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.11), rgba(15, 23, 42, 0.68));
}

.team-row.flash {
  animation: rowFlash 1.1s ease;
}

@keyframes rowFlash {
  0% { transform: scale(1.015); border-color: #34d399; box-shadow: 0 0 24px rgba(16, 185, 129, 0.35); }
  100% { transform: scale(1); }
}

.team-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.team-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  flex-shrink: 0;
}

.rank-1 .rank-badge {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

.team-title {
  font-weight: 700;
  font-size: 1.08rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-numbers {
  text-align: right;
  flex-shrink: 0;
}

.team-liters {
  font-weight: 800;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.team-count {
  font-size: 0.8rem;
  color: var(--muted);
}

.bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 4px;
}

/* Side Column */
.side-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.qr-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.qr-box {
  background: #ffffff;
  padding: 10px;
  border-radius: 14px;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-box img {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-info h3 {
  font-size: 1.05rem;
  margin-bottom: 5px;
}

.qr-info p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.qr-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: #38bdf8;
  word-break: break-all;
}

/* Feed */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.feed-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.feed-emoji {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.feed-text strong {
  font-weight: 700;
}

.feed-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.feed-amount {
  font-weight: 800;
  color: #fbbf24;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.stat-val {
  font-size: 1.45rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat-lbl {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tracker Mobile UI */
.team-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.team-pick-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.team-pick-btn:active {
  transform: scale(0.98);
}

.drink-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.drink-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 2px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.14s ease;
}

.drink-btn .emoji {
  font-size: 2rem;
  line-height: 1;
}

.drink-btn .label {
  font-weight: 700;
  font-size: 0.94rem;
}

.drink-btn.selected {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.16);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.size-btn {
  flex: 1;
  min-width: 78px;
  padding: 12px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 2px solid var(--border);
  color: var(--text);
  font-weight: 800;
  font-size: 0.98rem;
  cursor: pointer;
}

.size-btn.selected {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.submit-big {
  width: 100%;
  padding: 17px 20px;
  font-size: 1.08rem;
  border-radius: 16px;
  margin-top: 8px;
}

/* Forms */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  font-size: 0.96rem;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
}

.inline-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(120%);
  width: calc(100% - 28px);
  max-width: 480px;
  background: #0f172a;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 100;
  transition: transform 0.25s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.6);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 20px 10px;
  font-size: 0.94rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.hidden {
  display: none !important;
}

/* Subtle ghost button for TV/public header */
.btn-ghost {
  background: rgba(30, 41, 59, 0.42);
  border-color: rgba(148, 163, 184, 0.16);
  color: var(--muted);
  opacity: 0.72;
}

.btn-ghost:hover {
  opacity: 1;
  color: var(--text);
  background: rgba(39, 52, 73, 0.85);
}

/* Public 100vh Screen-Fit Layout */
.public-container {
  max-width: 1460px;
  margin: 0 auto;
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.public-container .topbar {
  margin-bottom: 0;
  flex-shrink: 0;
}

.public-container .leader-hero {
  margin-bottom: 0;
  padding: 18px 24px;
  border-radius: 20px;
  flex-shrink: 0;
}

.public-container .leader-badge {
  margin-bottom: 10px;
  padding: 5px 11px;
  font-size: 0.76rem;
}

.public-container .leader-name {
  font-size: clamp(1.85rem, 3.8vw, 3rem);
}

.public-container .leader-liters {
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
}

.public-container .leader-sub {
  margin-top: 6px;
  font-size: 0.94rem;
}

.public-container .pill-row {
  margin-top: 10px;
}

.public-container .dashboard-grid {
  grid-template-columns: 1.45fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.public-container .board-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
}

.public-container .section-title {
  margin-bottom: 12px;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.public-container .team-list {
  gap: 10px;
}

.public-container .team-row {
  padding: 12px 15px;
}

.public-container .feed-list {
  gap: 8px;
}

.public-container .feed-item {
  padding: 9px 12px;
  font-size: 0.88rem;
}

.public-container .stats-strip {
  margin-top: 0;
  gap: 14px;
  flex-shrink: 0;
}

.public-container .stat-box {
  padding: 11px 16px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.public-container .stat-val {
  font-size: 1.35rem;
}

/* Desktop / TV: exakt 1 Bildschirmhöhe ohne abgeschnittenes Ende */
@media (min-width: 901px) {
  body.public-screen {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .public-container {
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
  }

  .public-container .dashboard-grid {
    flex: 1;
    min-height: 0;
  }

  .public-container .board-card {
    min-height: 0;
    overflow: hidden;
  }

  .public-container .scroll-pane {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
  }

  .public-container .scroll-pane::-webkit-scrollbar {
    width: 6px;
  }

  .public-container .scroll-pane::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.28);
    border-radius: 999px;
  }
}

/* Kompaktere Darstellung für flache Displays (z. B. 720p Beamer / 13" Laptops) */
@media (min-width: 901px) and (max-height: 820px) {
  .public-container {
    padding: 10px 18px 12px;
    gap: 10px;
  }

  .public-container .leader-hero {
    padding: 13px 20px;
  }

  .public-container .leader-name {
    font-size: clamp(1.55rem, 3vw, 2.35rem);
  }

  .public-container .leader-liters {
    font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  }

  .public-container .team-row {
    padding: 9px 13px;
  }

  .public-container .feed-item {
    padding: 7px 10px;
    font-size: 0.84rem;
  }

  .public-container .stat-box {
    padding: 8px 12px;
  }

  .public-container .stat-val {
    font-size: 1.2rem;
  }
}

@media (max-width: 900px) {
  .public-container {
    padding: 14px 12px 24px;
  }

  .public-container .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .public-container .stat-box {
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
}

/* Admin private QR Card */
.admin-qr-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-qr-wrap .qr-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* === Aktiver Sound-Button === */
.btn-ghost-active {
  opacity: 1;
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.14);
}

/* === Top-3 Podium Styling === */
.team-row {
  position: relative;
  overflow: hidden;
}

.team-row.rank-2 {
  border-color: rgba(203, 213, 225, 0.34);
  background: linear-gradient(90deg, rgba(203, 213, 225, 0.08), rgba(15, 23, 42, 0.68));
}

.rank-2 .rank-badge {
  background: rgba(203, 213, 225, 0.18);
  color: #e2e8f0;
}

.team-row.rank-3 {
  border-color: rgba(217, 119, 6, 0.36);
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.09), rgba(15, 23, 42, 0.68));
}

.rank-3 .rank-badge {
  background: rgba(217, 119, 6, 0.2);
  color: #fb923c;
}

/* === Rank-Delta Badges (▲ / ▼) === */
.rank-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  animation: deltaPop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.rank-delta.up {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.28);
}

.rank-delta.down {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.42);
}

@keyframes deltaPop {
  0% { opacity: 0; transform: scale(0.55) translateY(5px); }
  70% { opacity: 1; transform: scale(1.12) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* === Top-3 Aufstiegs- & Abstiegs-Animationen (ohne transform-Konflikt zu FLIP) === */
.team-row.podium-up {
  animation: podiumRiseGlow 2.4s ease;
}

.team-row.podium-crown-up {
  animation: crownRiseGlow 3s ease;
}

.team-row.podium-down {
  animation: podiumDropPulse 1.6s ease;
}

.team-row.podium-up::after,
.team-row.podium-crown-up::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 15%,
    rgba(255, 255, 255, 0.26) 48%,
    rgba(251, 191, 36, 0.32) 55%,
    transparent 85%
  );
  transform: translateX(-120%);
  animation: sheenSweep 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  pointer-events: none;
}

@keyframes sheenSweep {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(130%); }
}

@keyframes podiumRiseGlow {
  0% {
    border-color: #34d399;
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.5), 0 0 28px rgba(16, 185, 129, 0.45);
  }
  55% {
    border-color: rgba(52, 211, 153, 0.65);
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.24);
  }
  100% {
    box-shadow: none;
  }
}

@keyframes crownRiseGlow {
  0% {
    border-color: #fde047;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.7), 0 0 38px rgba(245, 158, 11, 0.65);
  }
  60% {
    border-color: #fbbf24;
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.35);
  }
  100% {
    box-shadow: none;
  }
}

@keyframes podiumDropPulse {
  0% {
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.25);
  }
  100% {
    box-shadow: none;
  }
}

/* === Leader Hero Takeover-Effekt === */
.leader-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 255, 255, 0.24) 48%,
    rgba(251, 191, 36, 0.35) 54%,
    transparent 82%
  );
  transform: translateX(-130%);
  pointer-events: none;
}

.leader-hero.leader-takeover {
  animation: heroTakeoverPulse 2.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.leader-hero.leader-takeover::after {
  animation: sheenSweep 1.25s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}

@keyframes heroTakeoverPulse {
  0% {
    transform: scale(0.985);
    border-color: #fde047;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.65), 0 0 65px rgba(245, 158, 11, 0.6);
  }
  30% {
    transform: scale(1.015);
    border-color: #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.45), 0 24px 60px rgba(245, 158, 11, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  }
}

/* === Fullscreen Canvas für Konfetti === */
.fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 250;
}

/* === Spitzenreiter-Wechsel Spotlight-Overlay === */
.leader-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at center, rgba(11, 17, 32, 0.58) 0%, rgba(11, 17, 32, 0.84) 100%);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 220;
  transition: opacity 0.38s ease, visibility 0.38s ease;
}

.leader-overlay.show {
  opacity: 1;
  visibility: visible;
}

.leader-overlay-card {
  --team-accent: #f59e0b;
  position: relative;
  overflow: hidden;
  text-align: center;
  max-width: 680px;
  width: 100%;
  padding: 36px 32px 34px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
  border: 2px solid var(--team-accent);
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.4),
    0 0 70px color-mix(in srgb, var(--team-accent) 45%, transparent),
    0 28px 70px rgba(0, 0, 0, 0.65);
  transform: scale(0.76) translateY(28px);
  transition: transform 0.5s cubic-bezier(0.18, 1.15, 0.32, 1);
}

.leader-overlay.show .leader-overlay-card {
  transform: scale(1) translateY(0);
}

.leader-overlay.show .leader-overlay-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 255, 255, 0.2) 48%,
    rgba(251, 191, 36, 0.28) 54%,
    transparent 80%
  );
  transform: translateX(-130%);
  animation: sheenSweep 1.3s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}

.overlay-crown {
  font-size: clamp(3rem, 7vw, 4.4rem);
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 22px rgba(251, 191, 36, 0.75));
}

.leader-overlay.show .overlay-crown {
  animation: crownBounce 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes crownBounce {
  0% { transform: scale(0.2) rotate(-25deg) translateY(-30px); }
  55% { transform: scale(1.22) rotate(8deg) translateY(0); }
  80% { transform: scale(0.94) rotate(-4deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.overlay-kicker {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.overlay-team-name {
  font-size: clamp(2.1rem, 6vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.06;
  color: #ffffff;
  text-shadow: 0 4px 28px color-mix(in srgb, var(--team-accent) 60%, transparent);
  margin-bottom: 8px;
}

.overlay-sub {
  font-size: clamp(0.98rem, 2vw, 1.18rem);
  color: #cbd5e1;
  margin-bottom: 16px;
}

.overlay-liters {
  display: inline-block;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 900;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
  padding: 6px 20px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

/* === Top-3-Wechsel Banner === */
.podium-banner {
  --team-accent: #38bdf8;
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(560px, calc(100vw - 28px));
  padding: 13px 20px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--team-accent);
  box-shadow:
    0 16px 44px rgba(0, 0, 0, 0.55),
    0 0 32px color-mix(in srgb, var(--team-accent) 32%, transparent);
  z-index: 210;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1.15, 0.36, 1), opacity 0.3s ease;
}

.podium-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.podium-banner-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.podium-banner-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #f8fafc;
}

.podium-banner-sub {
  font-size: 0.84rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .fx-canvas { display: none; }
  .leader-overlay-card,
  .podium-banner,
  .team-row {
    animation: none !important;
    transition: none !important;
  }
}
