/* RANGO LIVE 24/7 – global radio dock, livestream player, PWA and "RANGO hilft" additions.
   Loaded after styles.css and v2.css; existing rules stay untouched. */
:root { --dock-space: calc(80px + env(safe-area-inset-bottom)); }

/* ---------- FLEXXRADIO dock (outside <main>, persists across pages) ---------- */
body.has-radio-dock { padding-bottom: var(--dock-space); }
.radio-dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 900;
  width: min(560px, calc(100% - 24px)); height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 14px 0 8px;
  background: #1f1811f5; border: 1px solid #c7a06b80; border-radius: 30px; box-shadow: 0 8px 34px #0009; backdrop-filter: blur(12px); color: #f9e9d0; }
.dock-play { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(#efc982, #b98742); color: #24190e; }
.dock-play svg { width: 18px; height: 18px; }
.dock-play:focus-visible, .dock-mute:focus-visible, .dock-volume:focus-visible, .dock-info:focus-visible { outline: 2px solid #f6d29b; outline-offset: 3px; }
.dock-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; color: inherit; text-decoration: none; }
.dock-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-status { font-size: 11px; letter-spacing: .3px; color: #cdb48c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-dock.is-playing:not(.is-buffering) .dock-status:before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff5a4f; margin-right: 6px; vertical-align: 0; }
.dock-mute { flex: none; width: 40px; height: 40px; }
.dock-mute svg { width: 18px; height: 18px; }
.dock-volume { width: 100px; accent-color: #d7a75c; }
.radio-dock.is-buffering .dock-play { animation: rango-pulse 1.2s ease-in-out infinite; }
@keyframes rango-pulse { 50% { opacity: .55; } }
.ai-shortcut { bottom: calc(84px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
@media (max-width: 580px) {
  .radio-dock { width: calc(100% - 16px); bottom: calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
  .dock-volume { display: none; }
  .ai-shortcut { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media print { .radio-dock { display: none; } }

/* ---------- In-site navigation ---------- */
html.is-navigating main#main { opacity: .55; transition: opacity .15s; }
main#main h1:focus { outline: none; }

/* ---------- Livestream player ---------- */
#livestream .stream-picture { height: auto; aspect-ratio: 16 / 9; }
.stream-picture > video { object-fit: contain; background: #0b0907; }
.stream-spinner { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  border: 3px solid #f6d29b38; border-top-color: #f6d29b; animation: rango-spin 1s linear infinite; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 3; }
@keyframes rango-spin { to { transform: rotate(360deg); } }
#livestream[data-state="connecting"] .stream-spinner, #livestream[data-state="reconnecting"] .stream-spinner { opacity: 1; }
#livestream[data-state="connecting"] .center-play, #livestream[data-state="reconnecting"] .center-play { opacity: 0; pointer-events: none; }
/* While live: no permanent pause symbol; it only appears briefly after interaction. */
#livestream[data-state="live"] .center-play { opacity: 0; pointer-events: none; transition: opacity .3s; }
#livestream[data-state="live"]:not(.controls-hidden) .center-play { opacity: 1; pointer-events: auto; }
#livestream .camera-label, #livestream .stream-controls, #livestream .signal-note { transition: opacity .3s; }
#livestream.controls-hidden .camera-label { opacity: 0; }
#livestream.controls-hidden .stream-picture { cursor: none; }
.stream:fullscreen.controls-hidden .stream-controls, .stream:fullscreen.controls-hidden .signal-note { opacity: 0; }
.stream:fullscreen .stream-picture { aspect-ratio: auto; }
.stream-pip svg { width: 18px; height: 18px; }
/* Phones in landscape: use the full height for the picture; the dock becomes a compact corner pill. */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --dock-space: calc(60px + env(safe-area-inset-bottom)); }
  .live-page-layout #livestream .stream-picture, #livestream .stream-picture { aspect-ratio: auto; height: calc(100dvh - 130px); }
  .radio-dock { left: auto; right: max(10px, env(safe-area-inset-right)); transform: none; width: 270px; height: 46px; bottom: calc(6px + env(safe-area-inset-bottom)); padding-right: 8px; }
  .dock-play { width: 36px; height: 36px; }
  .dock-volume { display: none; }
  .ai-shortcut { bottom: calc(60px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .stream-spinner { animation-duration: 3s; } .radio-dock.is-buffering .dock-play { animation: none; } }

/* ---------- RANGO hilft ---------- */
.help-header-button { display: inline-flex; align-items: center; gap: 7px; }
.help-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 26px; align-items: start; margin-bottom: 30px; }
.donate-card { padding: 24px; border-radius: 22px; }
.donate-card h2 { margin-top: 0; }
.donate-amounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 12px; border: 0; padding: 0; }
.donate-amounts legend { font-size: 12px; letter-spacing: 1.5px; color: #d7b37e; margin-bottom: 10px; }
.donate-amounts label { position: relative; }
.donate-amounts input { position: absolute; opacity: 0; inset: 0; }
.donate-amounts span { display: grid; place-items: center; height: 52px; border: 1px solid #c7a06b88; border-radius: 14px; font-size: 18px; font-weight: 600; cursor: pointer; background: #1d1711; }
.donate-amounts input:checked + span { background: linear-gradient(#efc982, #b98742); color: #24190e; border-color: #efc982; }
.donate-amounts input:focus-visible + span { outline: 2px solid #f6d29b; outline-offset: 3px; }
.donate-custom { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.donate-custom input { width: 140px; height: 46px; border-radius: 12px; border: 1px solid #c7a06b88; background: #1d1711; color: inherit; padding: 0 12px; font-size: 16px; }
.donate-button { display: inline-flex; align-items: center; gap: 9px; }
.donate-button svg, .help-header-button svg { width: 18px; height: 18px; }
.split-bar { display: flex; height: 18px; border-radius: 10px; overflow: hidden; margin: 12px 0 8px; border: 1px solid #c7a06b55; }
.split-bar span:first-child { flex: 9; background: linear-gradient(90deg, #8fbf6a, #6f9e4f); }
.split-bar span:last-child { flex: 1; background: #d7a75c; }
.split-legend { display: flex; justify-content: space-between; font-size: 13px; color: #e8d6b8; gap: 12px; }
.donate-result { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #2b2117; border: 1px solid #c7a06b66; font-size: 14px; }
.recipient-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 14px 0 26px; }
.recipient-card { padding: 18px; border-radius: 18px; }
.recipient-card h3 { margin: 6px 0 8px; font-size: 18px; }
.status-pill.pending { background: #3a2a1a; color: #e9c995; border: 1px solid #c7a06b66; }
.payout-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.payout-table th, .payout-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #c7a06b33; }
@media (max-width: 800px) {
  .help-hero { grid-template-columns: 1fr; }
  .donate-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Support (RANGO hilft page): two funds with 2/5/10 € or an own amount, sums confirmed by PayPal */
.support-funds { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 12px 0; }
.support-fund { padding: 18px; border-radius: 18px; }
.support-fund h3 { margin: 0 0 6px; font-size: 1.05rem; }
.support-amounts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.support-amount { min-width: 64px; min-height: 44px; justify-content: center; }
.support-thanks { padding: 10px 14px; border-radius: 14px; background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .3); }
.support-sums { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.support-sum { padding: 18px; border-radius: 18px; }
.support-sum h3 { margin: 0 0 8px; }
.support-figures { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; }
.support-figures dt { opacity: .8; }
.support-figures dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* Rangos Ausstattung: products with marked partner links */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 18px 0 28px; }
.shop-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 18px; }
.shop-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.shop-card h3 { margin: 0; }
.shop-card p { margin: 0; }
.shop-card .button { margin-top: auto; align-self: flex-start; }
.shop-cat { opacity: .75; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.shop-disclosure strong { text-transform: uppercase; letter-spacing: .06em; }
/* Laptop widths (1051–1399 px): the header fits without pushing "RANGO hilft" off screen.
   "Punkte sammeln" and "Login" show their symbol only there (their aria-labels stay). */
@media (min-width: 1051px) and (max-width: 1399px) {
  .header-actions { gap: 6px; }
  .header #rewards-chip > span:not(.rw-chip-star) { display: none; }
  .header .login-link { font-size: 0; gap: 0; padding-inline: 10px; }
  .header .login-link svg { width: 20px; height: 20px; }
}

/* Radio bar can be folded to the play button alone (RANGO WORLD 2026: the player never covers controls). */
.radio-dock .dock-fold { flex: none; width: 34px; height: 34px; margin-left: 2px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.radio-dock .dock-fold:hover, .radio-dock .dock-fold:focus-visible { background: rgba(255, 255, 255, .16); }
.radio-dock.is-folded { left: max(10px, env(safe-area-inset-left)); right: auto; transform: none; width: auto; padding: 5px; gap: 4px; }
.radio-dock.is-folded .dock-info, .radio-dock.is-folded .dock-mute, .radio-dock.is-folded .dock-volume { display: none !important; }
.radio-dock.is-folded .dock-fold span { display: inline-block; transform: rotate(180deg); }
