/* =========================================================
   gpr PWA / mobile
   Desktop (styles.css) blijft leidend boven 960px.
   ========================================================= */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

/* ---------- homepage mobile polish ---------- */
@media (max-width: 960px) {
  .site-nav {
    padding-left: max(1.2rem, var(--safe-left));
    padding-right: max(1.2rem, var(--safe-right));
    padding-top: max(0.75rem, var(--safe-top));
  }

  .section {
    padding-left: max(1.2rem, var(--safe-left));
    padding-right: max(1.2rem, var(--safe-right));
  }

  .hero {
    padding-left: max(1.2rem, var(--safe-left));
    padding-right: max(1.2rem, var(--safe-right));
    min-height: 100svh;
    min-height: 100dvh;
  }

  .cta-band {
    margin-left: max(1rem, var(--safe-left));
    margin-right: max(1rem, var(--safe-right));
  }

  .site-footer {
    padding-bottom: max(2rem, calc(var(--safe-bottom) + 1.25rem));
    padding-left: max(1.2rem, var(--safe-left));
    padding-right: max(1.2rem, var(--safe-right));
  }

  .btn,
  .nav-cta,
  .stream-btn,
  .play-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

@media (max-width: 640px) {
  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .now-title {
    font-size: clamp(2.6rem, 12vw, 3.6rem);
  }
}

/* =========================================================
   PLAYER — full mobile redesign (phone + PWA)
   ========================================================= */
@media (max-width: 960px) {
  html,
  body.listen-page {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: #0b0b0b;
  }

  body.listen-page {
    min-height: 100svh;
    min-height: 100dvh;
  }

  .listen-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100svh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    grid-template-columns: none;
  }

  /* Sidebar → fixed bottom dock */
  .listen-side {
    order: 2;
    position: relative;
    z-index: 30;
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.55rem;
    margin: 0;
    padding: 0.7rem max(0.85rem, var(--safe-left)) max(0.7rem, calc(var(--safe-bottom) + 0.45rem)) max(0.85rem, var(--safe-right));
    background: rgba(10, 10, 10, 0.96);
    border: none;
    border-top: 1px solid rgba(231, 230, 225, 0.1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .listen-brand,
  .listen-side .back-link {
    display: none !important;
  }

  .stream-list {
    display: flex;
    flex-direction: row;
    gap: 0.55rem;
    width: 100%;
  }

  .stream-btn {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    padding: 0.7rem 0.55rem;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    gap: 0.3rem;
    border-radius: 1rem;
    background: rgba(231, 230, 225, 0.05);
    border: 1px solid transparent;
    transform: none !important;
  }

  .stream-btn:hover {
    transform: none;
    background: rgba(231, 230, 225, 0.08);
  }

  .stream-btn.is-active {
    background: rgba(234, 54, 14, 0.2);
    border-color: rgba(234, 54, 14, 0.55);
  }

  .stream-btn img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .stream-btn strong {
    font-size: 0.82rem;
    line-height: 1.1;
  }

  .stream-btn small {
    display: none;
  }

  /* Main stage */
  .listen-main {
    order: 1;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    overflow: hidden;
  }

  .listen-bg {
    opacity: 0.18;
    filter: saturate(1.05) brightness(0.7);
  }

  .listen-mobile-bar {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    padding: max(0.55rem, var(--safe-top)) max(0.85rem, var(--safe-right)) 0.35rem max(0.85rem, var(--safe-left));
  }

  .listen-mobile-back {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: #e7e6e1;
    background: rgba(231, 230, 225, 0.08);
    text-decoration: none;
  }

  .listen-mobile-logo {
    height: 1.55rem;
    width: auto;
    margin: 0 auto;
    display: block;
  }

  .listen-mobile-spacer {
    width: 44px;
    height: 44px;
  }

  .player-stage {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.35rem 1.25rem 1rem;
    gap: 0;
  }

  .cover-wrap {
    width: min(58vw, 240px);
    margin: 0 auto 1.1rem;
    flex: 0 0 auto;
  }

  .cover-wrap::before {
    inset: -10%;
    opacity: 0.85;
  }

  .cover-art {
    border-radius: 1.35rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  }

  .player-stage.is-playing .cover-art {
    border-radius: 50%;
  }

  .stream-kicker {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: lowercase;
    opacity: 0.55;
    margin: 0 0 0.35rem !important;
    font-family: var(--font-body, Outfit, sans-serif) !important;
  }

  .now-playing {
    font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
    font-size: clamp(1.25rem, 5.6vw, 1.7rem) !important;
    font-weight: 800 !important;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: #fff !important;
    margin: 0 0 1.35rem !important;
    max-width: 18ch;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
  }

  .player-controls {
    gap: 0.85rem;
    margin: 0;
  }

  .play-btn {
    width: 78px;
    height: 78px;
  }

  .play-btn svg {
    width: 30px;
    height: 30px;
  }

  .volume-row {
    display: none; /* hardware volume op telefoon */
  }

  .viz {
    height: 28px;
    margin-top: 1rem;
    opacity: 0.45;
  }

  .status-line {
    margin-top: 0.75rem;
    font-size: 0.86rem;
    opacity: 0.55;
  }

  .proxy-hint {
    margin-top: 0.85rem;
    padding: 0.75rem 0.85rem;
    font-size: 0.8rem;
    max-width: 320px;
  }

  #player-audio {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }
}

/* Extra compacte phones */
@media (max-width: 960px) and (max-height: 720px) {
  .cover-wrap {
    width: min(42vw, 170px);
    margin-bottom: 0.75rem;
  }

  .now-playing {
    margin-bottom: 0.9rem !important;
    font-size: 1.15rem !important;
    min-height: 2.2em;
  }

  .play-btn {
    width: 68px;
    height: 68px;
  }

  .viz {
    display: none;
  }
}

/* Standalone / installed app */
@media (display-mode: standalone), (display-mode: fullscreen) {
  body {
    -webkit-user-select: none;
    user-select: none;
  }

  body::before {
    opacity: 0.025;
  }
}

html.pwa-standalone,
html.pwa-standalone body {
  overscroll-behavior: none;
}

/* Install tip — homepage/mobile only, never over player critically */
.pwa-install-tip {
  display: none;
}

@media (max-width: 960px) {
  body:not(.listen-page) .pwa-install-tip {
    display: none;
    position: fixed;
    left: max(1rem, var(--safe-left));
    right: max(1rem, var(--safe-right));
    bottom: max(1rem, calc(var(--safe-bottom) + 0.75rem));
    z-index: 80;
    background: rgba(20, 20, 20, 0.95);
    color: #e7e6e1;
    border: 1px solid rgba(234, 54, 14, 0.35);
    border-radius: 1.15rem;
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    line-height: 1.35;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  body:not(.listen-page) .pwa-install-tip.is-visible {
    display: block;
  }

  .pwa-install-tip strong {
    color: #ff4a22;
  }

  .pwa-install-tip button {
    margin-top: 0.65rem;
    background: #ea360e;
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-weight: 700;
  }
}

html.pwa-standalone .pwa-install-tip,
body.listen-page .pwa-install-tip {
  display: none !important;
}
