@font-face {
  font-family: 'Albert Sans';
  src: url('./assets/fonts/AlbertSans-Regular.ttf') format('ttf');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Albert Sans';
  src: url('./assets/fonts/AlbertSans-SemiBold.ttf') format('ttf');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Albert Sans';
  src: url('./assets/fonts/AlbertSans-Bold.ttf') format('ttf');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --rq-blue: #0A43B8;
  --rq-blue-dark: #083391;
  --rq-blue-soft: #EAF0FF;
  --rq-white: #ffffff;
  --rq-bg: #F7F9FF;
  --rq-text: #17306B;
  --rq-text-soft: #5F6D99;
  --rq-line: rgba(10, 67, 184, 0.14);
  --rq-yellow: #F7C948;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 999px;

  --shadow-soft: 0 10px 28px rgba(10, 67, 184, 0.10);
  --shadow-card: 0 16px 36px rgba(10, 67, 184, 0.12);

  --content-max: 560px;
  --nav-height: 92px;
  --screen-pad-x: clamp(16px, 4vw, 24px);
  --screen-pad-top: clamp(12px, 3vw, 24px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--rq-bg);
  color: var(--rq-text);
  font-family: 'Albert Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--rq-bg);
}

/* =========================
   TOPBAR
========================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding:
    max(12px, env(safe-area-inset-top))
    var(--screen-pad-x)
    12px;
  background: linear-gradient(180deg, rgba(247, 249, 255, 0.98), rgba(247, 249, 255, 0.94));
  backdrop-filter: blur(10px);
}

.badge-live {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  min-height: 42px;
  padding: 10px 22px;
  border-radius: var(--radius-xl);
  background: #ffffff;
  color: var(--rq-text);
  font-size: clamp(14px, 3.4vw, 18px);
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-soft);
}

.topbar-title,
#screenTitle {
  margin: 0;
  text-align: center;
  color: var(--rq-text);
  font-size: clamp(18px, 5vw, 30px);
  line-height: 1.15;
  font-weight: 600;
}

/* =========================
   SCREENS
========================= */

.screens {
  flex: 1;
  width: 100%;
}

.screen {
  display: none;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding:
    var(--screen-pad-top)
    var(--screen-pad-x)
    calc(var(--nav-height) + 28px + env(safe-area-inset-bottom));
}

.screen.active {
  display: block;
}

#screen-radio,
#screen-programs {
  background: var(--rq-bg);
  color: var(--rq-text);
}

#screen-live {
  background: var(--rq-blue);
  color: #ffffff;
}

/* =========================
   RADIO SCREEN
========================= */

.hero-card {
  width: 100%;
  aspect-ratio: 16 / 7;
  margin: 18px auto 22px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #0A43B8, #1D5DEC);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
}

.hero-logo {
  width: min(72%, 320px);
  object-fit: contain;
}

.station-name {
  text-align: center;
  color: var(--rq-text);
  font-size: clamp(19px, 5vw, 30px);
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 10px;
}

.track-title {
  text-align: center;
  color: var(--rq-text);
  font-size: clamp(17px, 4.5vw, 24px);
  line-height: 1.3;
  font-weight: 600;
  margin: 0 0 10px;
  word-break: break-word;
}

.listeners {
  text-align: center;
  font-size: clamp(16px, 4vw, 20px);
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 18px;
  color: inherit;
}

/* =========================
   CONTROLS
========================= */

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 4vw, 22px);
  margin: 24px 0 22px;
  flex-wrap: nowrap;
}

.circle-btn {
  appearance: none;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.circle-btn:hover {
  transform: translateY(-1px);
}

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

.circle-btn.secondary {
  width: clamp(56px, 16vw, 72px);
  height: clamp(56px, 16vw, 72px);
  background: #ffffff;
  border: 1px solid var(--rq-line);
  box-shadow: var(--shadow-soft);
}

.circle-btn.primary {
  width: clamp(94px, 25vw, 120px);
  height: clamp(94px, 25vw, 120px);
  background: linear-gradient(180deg, var(--rq-blue) 0%, var(--rq-blue-dark) 100%);
  box-shadow: 0 18px 34px rgba(10, 67, 184, 0.22);
  position: relative;
}

.circle-btn.primary::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.control-icon {
  width: clamp(22px, 6vw, 28px);
  height: clamp(22px, 6vw, 28px);
  object-fit: contain;
}

.control-icon--primary {
  width: clamp(34px, 8vw, 42px);
  height: clamp(34px, 8vw, 42px);
}

/* =========================
   VOLUME
========================= */

.volume-wrap {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 26px 1fr 26px;
  align-items: center;
  gap: 10px;
}

.vol-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vol-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

#radioVolume {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: #D8E3FF;
  outline: none;
}

#radioVolume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--rq-blue);
  border: 3px solid #ffffff;
  box-shadow: 0 3px 10px rgba(10, 67, 184, 0.20);
  cursor: pointer;
}

#radioVolume::-moz-range-thumb {
  width: 19px;
  height: 19px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--rq-blue);
  box-shadow: 0 3px 10px rgba(10, 67, 184, 0.20);
  cursor: pointer;
}

/* =========================
   LIVE SCREEN
========================= */

.live-headline {
  text-align: center;
  color: #ffffff;
  font-size: clamp(20px, 5.4vw, 30px);
  line-height: 1.15;
  font-weight: 600;
  margin: 2px 0 18px;
}

.video-shell {
  width: 100%;
  margin: 0 auto 18px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, #0C47C6, #0A43B8);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
}

.livebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.livebar-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(14px, 3.6vw, 18px);
  font-weight: 600;
  color: #ffffff;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rq-yellow);
  flex: 0 0 auto;
}

.live-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 44px;
  font-size: clamp(14px, 3.4vw, 16px);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
}

.live-btn:hover {
  transform: translateY(-1px);
}

.live-btn.live {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.live-btn.behind {
  background: var(--rq-yellow);
  color: #111111;
}

.live-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  object-fit: cover;
}

.live-controls {
  display: none !important;
}

/* =========================
   PROGRAMS
========================= */

.programs-title {
  text-align: center;
  color: var(--rq-text);
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 18px;
}

.programs-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.program-row {
  appearance: none;
  width: 100%;
  min-height: 64px;
  border: 2px solid rgba(10, 67, 184, 0.18);
  border-radius: 16px;
  background: #ffffff;
  color: var(--rq-text);
  font-size: clamp(17px, 4.2vw, 22px);
  line-height: 1.2;
  font-weight: 600;
  padding: 16px 18px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(10, 67, 184, 0.06);
  cursor: pointer;
}

.program-row.active {
  border-color: var(--rq-blue);
  box-shadow: 0 12px 26px rgba(10, 67, 184, 0.12);
}

/* =========================
   BOTTOM NAV
========================= */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 8px;
  padding:
    10px
    12px
    calc(10px + env(safe-area-inset-bottom));
  min-height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, var(--rq-blue) 0%, var(--rq-blue-dark) 100%);
  box-shadow: 0 -8px 24px rgba(10, 67, 184, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.nav-item {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 10px 6px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  overflow: hidden;
  cursor: pointer;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.nav-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.nav-label {
  display: block;
  color: #ffffff;
  font-size: clamp(12px, 3vw, 14px);
  line-height: 1.1;
  font-weight: 600;
  white-space: nowrap;
}

/* =========================
   SMALL DEVICES
========================= */

@media (max-width: 390px) {
  :root {
    --nav-height: 84px;
  }

  .badge-live {
    min-width: 112px;
    min-height: 38px;
    padding: 9px 18px;
  }

  .topbar-title,
  #screenTitle {
    font-size: clamp(17px, 4.8vw, 24px);
  }

  .circle-btn.secondary {
    width: 54px;
    height: 54px;
  }

  .circle-btn.primary {
    width: 92px;
    height: 92px;
  }

  .program-row {
    min-height: 58px;
    font-size: 16px;
  }

  .nav-label {
    font-size: 11px;
  }
}

@media (min-width: 768px) {
  :root {
    --content-max: 620px;
  }
}