/* ═══════════════════════════════════════════════════════════════════
   BigTimeFM — Mobile (iOS & Android, Capacitor)
   Apple-Music-Stil: fixer Kopf (Eyebrow + großer Titel) · scrollende
   Tab-Inhalte · schwebende Player-Pill · fixe Tab-Bar unten.
   Baut auf den Design-Tokens aus style.css auf → Light/Dark inklusive.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. Vollbild & Scroll-Verhalten ───────────────────────────────── */

html.ios-app {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

html.ios-app body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  font-size: 15px;
  /* Kein Doppeltipp-Zoom / kein Pinch-Zoom — App-Verhalten statt Webseite */
  touch-action: manipulation;
}

/* Liquid-Glass-Hintergrund: fixes Markenbild hinter allem, darüber ein
   Scrim für Lesbarkeit. Die geblurrten Panels/Leisten schweben darüber. */
.ios-app body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url('assets/background_smartphone.png') center center / cover no-repeat;
}

.ios-app body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(8, 8, 12, 0.45), rgba(8, 8, 12, 0.72));
}

/* Helles Theme: hellerer Scrim, damit das Bild durchscheint ohne zu blenden */
html.ios-app[data-theme="light"] body::after {
  background: linear-gradient(180deg, rgba(246, 242, 236, 0.55), rgba(246, 242, 236, 0.78));
}

@media (prefers-color-scheme: light) {
  html.ios-app:not([data-theme="dark"]):not([data-theme="light"]) body::after {
    background: linear-gradient(180deg, rgba(246, 242, 236, 0.55), rgba(246, 242, 236, 0.78));
  }
}

/* Etwas mehr Transparenz auf Mobile → echtes „liquid glass" über dem Bild */
html.ios-app { --surface: rgba(20, 20, 26, 0.52); --surface-strong: rgba(14, 14, 18, 0.7); }
html.ios-app[data-theme="light"] { --surface: rgba(255, 255, 255, 0.55); --surface-strong: rgba(255, 255, 255, 0.72); }
@media (prefers-color-scheme: light) {
  html.ios-app:not([data-theme="dark"]):not([data-theme="light"]) { --surface: rgba(255, 255, 255, 0.55); --surface-strong: rgba(255, 255, 255, 0.72); }
}

html.ios-app .app-shell {
  display: block;
  height: 100vh;
  height: 100dvh;
  padding: 0;
}

/* ── 2. Kopfbereich: fixiert, Safe-Area-bewusst (Dynamic Island) ──── */

.ios-app .app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 18px 10px;
  background: var(--surface-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

.ios-app #page-title {
  font-size: 30px;
}

/* ── 3. Tab-Inhalte: scrollen unter Kopf, Pill und Tab-Bar ────────── */

.ios-app .app-feed {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(env(safe-area-inset-top, 0px) + 96px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px + 64px + 8px + 60px + 18px);
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

.ios-app .tab-view {
  gap: 12px;
}

.ios-app .panel {
  width: 100%;
  min-width: 0;
}

/* ── 4. Buttons & Formulare: Touch-freundlich (≥ 44 px) ───────────── */

.ios-app .orange-btn,
.ios-app .toggle-btn,
.ios-app .twitch-btn {
  min-height: 48px;
  font-size: 15px;
  border-radius: 14px;
}

.ios-app .menu-link {
  min-height: 46px;
  font-size: 15px;
}

.ios-app .theme-btn {
  min-width: 48px;
  height: 32px;
  font-size: 13px;
}

.ios-app .wb-input,
.ios-app .wb-select,
.ios-app .wb-textarea {
  font-size: 16px;               /* < 16 px löst iOS-Auto-Zoom aus */
  min-height: 44px;
}

.ios-app .wb-submit {
  min-height: 52px;
  font-size: 16px;
  border-radius: 14px;
}

.ios-app .wb-rec-btn {
  min-height: 44px;
  padding: 10px 16px;
}

/* ── 5. Player-Pill: schwebt über der Tab-Bar-Kapsel ──────────────── */

.ios-app .player-bar {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px + 64px + 8px);
  z-index: 100;
  border-radius: 18px;
  padding: 8px 10px;
  min-height: 60px;
  cursor: pointer;
}

.ios-app #cover-img {
  width: 44px;
  height: 44px;
}

.ios-app #current-title { font-size: 14px; }
.ios-app #current-dj    { font-size: 11px; }

/* Platz fürs Voting in der Leiste: dekorativen Equalizer dort ausblenden */
.ios-app .player-bar .eq { display: none; }

.ios-app .pb-btn {
  width: 42px;
  height: 42px;
}

.ios-app .pb-btn .btn-icon {
  width: 16px;
  height: 16px;
}

/* ── 6. Tab-Bar: schwebende Liquid-Glass-Kapsel ───────────────────── */

.ios-app #tab-bar {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 99;
  height: 64px;
  border-radius: 32px;
  overflow: hidden;
  box-sizing: border-box;
}

/* ── 7. Trackliste: Sheet fast im Vollbild ────────────────────────── */

.ios-app .tl-overlay {
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 14px
           calc(env(safe-area-inset-bottom, 0px) + 16px);
}

.ios-app .tl-sheet {
  width: 100%;
  height: 100%;
}

.ios-app .tl-close {
  width: 44px;
  height: 44px;
  font-size: 20px;
}

/* ── 8. Vollbild-Player (Spotify-Stil) ────────────────────────────── */

.ios-app #player-overlay.open {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 50% at 50% -8%, rgba(255, 138, 0, 0.2), transparent 60%);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 22px
           calc(env(safe-area-inset-bottom, 0px) + 26px);
  box-sizing: border-box;
  animation: po-slide-up 0.28s ease;
}

@keyframes po-slide-up {
  from { transform: translateY(28px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.ios-app .po-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}

.ios-app .po-icon-btn {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.ios-app .po-icon-btn .btn-icon {
  width: 18px;
  height: 18px;
  margin: 0;
}

.ios-app .po-header-title {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Großes Cover (Tipp → Trackliste), vertikal zentriert */
.ios-app #po-cover {
  width: min(78vw, 340px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  margin: auto;
  box-shadow: 0 14px 48px rgba(255, 138, 0, 0.18), 0 10px 36px rgba(0, 0, 0, 0.6);
  background: var(--field);
  cursor: pointer;
}

.ios-app .po-info {
  margin-top: 26px;
  min-width: 0;
}

.ios-app #po-title {
  font-size: 21px;
  font-weight: 750;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ios-app #po-dj {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ios-app .po-controls {
  display: flex;
  gap: 14px;
  margin-top: 20px;
}

.ios-app .po-controls .ctrl-btn {
  flex: 1;
  min-height: 58px;
  border-radius: 16px;
  font-size: 20px;
}

/* Nächste Sendung (inkl. DJ) unten im Player */
.ios-app .po-next {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ios-app .po-next-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.ios-app #po-next {
  font-size: 14px;
  color: var(--text);
}

/* ── 9. Schriftgrößen für Mobile ──────────────────────────────────── */

.ios-app .panel-title { font-size: 11px; }

.ios-app .sp-show   { font-size: 14px; }
.ios-app .sp-dj     { font-size: 12px; }
.ios-app .sp-time   { font-size: 12px; }
.ios-app .tl-title  { font-size: 14px; }
.ios-app .tl-artist { font-size: 12px; }
.ios-app #next-show { font-size: 14px; }

/* ── BigTimeFM Junior (Tab) ─────────────────────────────────────────── */
.junior-now { text-align: center; }
.junior-cover {
  width: 130px; height: 130px; border-radius: 18px; object-fit: cover;
  background: var(--field); box-shadow: var(--glow-soft);
}
.junior-title { font-weight: 700; font-size: 17px; margin-top: 12px; }
.junior-dj { color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.junior-listeners { color: var(--accent); font-size: 13px; font-weight: 700; margin-top: 4px; }
.junior-play-btn {
  margin-top: 16px; padding: 12px 22px; border: none; cursor: pointer;
  border-radius: var(--radius-btn); font: inherit; font-weight: 700;
  background: var(--accent); color: var(--bg); box-shadow: var(--glow-soft);
}
.junior-play-btn:active { transform: translateY(1px); }
