/* AFR Radio v1.2.0 · Radio view (station-style now playing) + desktop app title bar. Premium black & gold. */

/* ---------- desktop app title bar: drag the window by the top bar ---------- */
.ar-bar { -webkit-app-region: drag; app-region: drag; }
.ar-bar a, .ar-bar button, .ar-bar input { -webkit-app-region: no-drag; app-region: no-drag; }
@media (display-mode: window-controls-overlay) {
  .ar-bar { min-height: env(titlebar-area-height, 40px); padding-top: 6px; padding-left: max(14px, env(titlebar-area-x, 0px)); padding-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw) + 10px); }
}

/* ---------- view switch button ---------- */
.ar-view { min-height: 44px; padding: 0 14px; }
.ar-view svg { width: 18px; height: 18px; }
@media (max-width: 480px) { .ar-view span { display: none; } .ar-view { padding: 0 12px; } }

/* ---------- radio face (only in Radio view) ---------- */
.ar-radio { display: none; }
html.ar-view-radio .ar-radio { display: flex; }
html.ar-view-radio #afrEntertainmentCenter,
html.ar-view-radio #afrDockPlayer,
html.ar-view-radio .afr-dock,
html.ar-view-radio .ar-banner { display: none !important; }
html.ar-view-radio .ar-foot { padding: 6px 12px calc(10px + env(safe-area-inset-bottom, 0px)); font-size: .72rem; }
html.ar-view-radio body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
html.ar-view-radio #arMain { flex: 1; display: flex; }

.ar-radio {
  --art: min(72vw, 40vh, 340px);
  flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 2.2vh, 18px);
  width: 100%; max-width: 520px; margin: 0 auto; padding: clamp(12px, 3vh, 28px) 18px clamp(12px, 2vh, 20px); box-sizing: border-box;
  position: relative; text-align: center;
}
html.ar-view-radio #arMain { background: radial-gradient(120% 70% at 50% 0%, rgba(212,175,55,.18), rgba(5,5,5,0) 60%), radial-gradient(90% 60% at 50% 100%, rgba(212,175,55,.08), rgba(5,5,5,0) 70%); }

.ar-station { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.ar-live { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,0,.4); color: var(--g2); font: 800 .7rem Inter, sans-serif; letter-spacing: .2em; }
.ar-live i { width: 8px; height: 8px; border-radius: 50%; background: #6b6b6b; box-shadow: none; }
.ar-playing .ar-live i { background: #ff4b3e; box-shadow: 0 0 10px #ff4b3e; animation: arPulse 1.6s ease-in-out infinite; }
.ar-freq { color: var(--mut); font: 700 .72rem Inter, sans-serif; letter-spacing: .22em; }

.ar-art { position: relative; width: var(--art); height: var(--art); border-radius: 22px; padding: 4px; background: linear-gradient(145deg, var(--g2), #6e5717 45%, var(--g)); box-shadow: 0 18px 50px rgba(0,0,0,.7), 0 0 60px rgba(212,175,55,.18); }
.ar-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; display: block; background: #0b0b0b; }
.ar-art img.ar-logo-art { object-fit: contain; padding: 12%; box-sizing: border-box; background: radial-gradient(circle at 50% 40%, #1a1408, #050505 70%); }
.ar-eqbars { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 4px; height: 22px; padding: 5px 9px; border-radius: 999px; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .3s; }
.ar-eqbars i { width: 4px; height: 30%; background: var(--g2); border-radius: 2px; }
.ar-playing .ar-eqbars { opacity: 1; }
.ar-playing .ar-eqbars i { animation: arEq 1s ease-in-out infinite; }
.ar-eqbars i:nth-child(2) { animation-delay: -.3s !important; } .ar-eqbars i:nth-child(3) { animation-delay: -.6s !important; } .ar-eqbars i:nth-child(4) { animation-delay: -.15s !important; } .ar-eqbars i:nth-child(5) { animation-delay: -.45s !important; }

.ar-meta { width: 100%; min-width: 0; }
.ar-meta h2 { margin: 0; color: #fff; font: 800 clamp(1.1rem, 2.6vh + .4rem, 1.5rem) Inter, sans-serif; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ar-meta p { margin: 4px 0 0; color: var(--g2); font: 600 .92rem Inter, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ar-seek, .ar-vol { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--mut); font: 600 .78rem Inter, sans-serif; font-variant-numeric: tabular-nums; }
.ar-seek span { min-width: 38px; }
.ar-vol svg { width: 18px; height: 18px; flex: none; fill: var(--mut); }
.ar-range { --p: 0%; flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--g2) var(--p), rgba(255,255,255,.14) var(--p)); outline: none; cursor: pointer; margin: 10px 0; }
.ar-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--g2); border: 3px solid #050505; box-shadow: 0 0 0 1px var(--g); }
.ar-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--g2); border: 3px solid #050505; }
.ar-range:focus-visible { outline: 3px solid var(--g2); outline-offset: 4px; }

.ar-ctrls { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 18px); }
.ar-ic { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 0; background: transparent; color: #f5f0e1; cursor: pointer; }
.ar-ic svg { width: 26px; height: 26px; fill: currentColor; }
.ar-ic.ar-sm svg { width: 20px; height: 20px; }
.ar-ic:hover { color: var(--g2); background: rgba(255,255,255,.05); }
.ar-ic[aria-pressed="true"] { color: var(--g2); background: rgba(212,175,55,.14); }
.ar-ic:focus-visible, .ar-chip:focus-visible { outline: 3px solid var(--g2); outline-offset: 2px; }
.ar-play { width: 76px; height: 76px; background: linear-gradient(135deg, var(--g2), var(--g)); color: #050505; box-shadow: 0 10px 30px rgba(212,175,55,.35); }
.ar-play:hover { color: #050505; background: linear-gradient(135deg, #fff1b0, var(--g2)); transform: scale(1.04); }
.ar-play svg { width: 34px; height: 34px; }
.ar-play .ar-i-pause, .ar-play.is-playing .ar-i-play { display: none; }
.ar-play.is-playing .ar-i-pause { display: block; }

.ar-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ar-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: #f5f0e1; font: 700 .85rem Inter, sans-serif; cursor: pointer; }
.ar-chip:hover { border-color: var(--g2); color: var(--g2); }
.ar-chip svg { width: 16px; height: 16px; fill: currentColor; }
.ar-chip.ar-chip-gold { border-color: var(--g2); color: var(--g2); }

.ar-loading .ar-ctrls, .ar-loading .ar-seek { opacity: .55; }

/* short or wide windows: art beside the controls */
@media (max-height: 600px) and (min-width: 640px) {
  .ar-radio { max-width: 900px; display: grid !important; grid-template-columns: auto 1fr; grid-template-areas: "station station" "art meta" "art seek" "art ctrls" "art vol" "art chips"; column-gap: 28px; align-items: center; justify-items: stretch; --art: min(56vh, 300px); text-align: left; }
  .ar-station { grid-area: station; } .ar-art { grid-area: art; } .ar-meta { grid-area: meta; } .ar-seek { grid-area: seek; } .ar-ctrls { grid-area: ctrls; justify-content: flex-start; } .ar-vol { grid-area: vol; } .ar-chips { grid-area: chips; justify-content: flex-start; }
}
@media (max-height: 520px) and (max-width: 639px) { .ar-radio { --art: min(40vh, 60vw); } .ar-chips { display: none; } }

@keyframes arEq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
@keyframes arPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ar-playing .ar-eqbars i, .ar-playing .ar-live i { animation: none; } .ar-playing .ar-eqbars i { height: 70%; } .ar-play:hover { transform: none; } }
