/* ==========================================================================
   Radio Go — Progressive Web App Stylesheet
   Zero-dependency design system matching Theme.kt & Android/iOS/TV apps
   ========================================================================== */

:root,
[data-theme="dark"] {
  --brand-pink: #FF2E74;
  --brand-orange: #FF9A1F;
  --brand-violet: #7A2BF0;
  --sponsor-amber: #FFB020;
  --cube-blue: #4D8DFF;
  --fm-green: #3DDC84;

  --primary: #FF2E74;
  --on-primary: #FFFFFF;
  --primary-container: #5A1032;
  --on-primary-container: #FFD9E3;

  --secondary: #FFB020;
  --on-secondary: #2A1145;
  --secondary-container: #3B2A55;
  --on-secondary-container: #F1E6FF;

  --tertiary: #7A2BF0;
  --bg: #0F0B15;
  --on-bg: #F4F0F8;
  --surface: #17121F;
  --on-surface: #F4F0F8;
  --surface-variant: #261F31;
  --on-surface-variant: #B1A8BD;
  --surface-container: #1D1726;
  --surface-elevated: #2D243B;
  --outline: #3A3146;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
  --backdrop-overlay: rgba(15, 11, 21, 0.78);
  --focus-ring: #FF2E74;
  color-scheme: dark;
}

[data-theme="oled"] {
  --primary: #FF2E74;
  --on-primary: #FFFFFF;
  --primary-container: #480B27;
  --on-primary-container: #FFD9E3;

  --secondary: #FFB020;
  --on-secondary: #000000;
  --secondary-container: #221A2E;
  --on-secondary-container: #F1E6FF;

  --tertiary: #7A2BF0;
  --bg: #000000;
  --on-bg: #F8F6FA;
  --surface: #07060A;
  --on-surface: #F8F6FA;
  --surface-variant: #15121C;
  --on-surface-variant: #A8A0B5;
  --surface-container: #0D0B12;
  --surface-elevated: #1C1826;
  --outline: #2B2436;
  --card-shadow: 0 10px 32px rgba(0, 0, 0, 0.85);
  --backdrop-overlay: rgba(0, 0, 0, 0.85);
  --focus-ring: #FF2E74;
  color-scheme: dark;
}

[data-theme="light"] {
  --primary: #D9165B;
  --on-primary: #FFFFFF;
  --primary-container: #FFD9E3;
  --on-primary-container: #3E001A;

  --secondary: #B87400;
  --on-secondary: #FFFFFF;
  --secondary-container: #FFE0A3;
  --on-secondary-container: #2C1700;

  --tertiary: #7A2BF0;
  --bg: #F8F6FB;
  --on-bg: #17121F;
  --surface: #FFFFFF;
  --on-surface: #17121F;
  --surface-variant: #ECE6F4;
  --on-surface-variant: #534A60;
  --surface-container: #F1ECF8;
  --surface-elevated: #FFFFFF;
  --outline: #C9C0D6;
  --card-shadow: 0 8px 24px rgba(23, 18, 31, 0.08);
  --backdrop-overlay: rgba(248, 246, 251, 0.82);
  --focus-ring: #D9165B;
  color-scheme: light;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  width: 100%;
  background-color: var(--bg);
  color: var(--on-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Smart TV D-Pad & Keyboard Focus Ring */
:focus {
  outline: none;
}

:focus-visible,
.tv-focused {
  outline: 3px solid var(--focus-ring) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 6px rgba(255, 46, 116, 0.24) !important;
  transform: scale(1.02);
  transition: transform 0.14s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.14s ease;
  z-index: 5;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--outline);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--on-surface-variant);
}

/* App Shell Layout */
.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100dvh;
  width: 100vw;
  max-width: 100vw;
  min-width: 0;
  overflow: hidden;
  overflow-x: hidden;
  background: var(--bg);
}

/* Sidebar Navigation (Desktop / Tablet / Smart TV) */
.sidebar {
  grid-row: 1 / 3;
  grid-column: 1;
  background: var(--surface);
  border-inline-end: 1px solid var(--outline);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 8px;
  z-index: 20;
  min-width: 0;
  overflow: hidden;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 18px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(255, 46, 116, 0.35);
  flex-shrink: 0;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

/* Wordmark: solid text; the gradient lives in the icon (docs/design-system.md, Branding). */
.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--on-surface);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
  text-align: left;
}

.nav-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-btn:hover {
  background: var(--surface-variant);
  color: var(--on-surface);
}

.nav-btn.active {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.nav-btn.active svg {
  color: var(--primary);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--outline);
}

.sidebar-pill-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-variant);
  color: var(--on-surface);
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.sidebar-pill-btn:hover {
  background: var(--surface-elevated);
}

.sidebar-pill-btn.install-cta {
  background: linear-gradient(135deg, rgba(255, 154, 31, 0.18), rgba(255, 46, 116, 0.22));
  border: 1px solid rgba(255, 46, 116, 0.4);
}

/* Main Content Area */
.main-view,
.main-content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 28px 40px;
  scroll-behavior: smooth;
}

.view-container,
.view {
  max-width: 1360px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Top Home Header */
.home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.greeting-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* "RADIO GO" eyebrow: only on compact widths, where there is no sidebar wordmark. */
.brand-eyebrow {
  display: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}

.greeting-title {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Header pill: labelled action at every width (docs/design-system.md, Buttons). */
.header-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--surface-variant);
  color: var(--on-surface);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

/* 48px touch target around the 40px pill. */
.header-pill::before {
  content: "";
  position: absolute;
  inset: -4px 0;
}

.header-pill:hover {
  background: var(--surface-elevated);
}

.header-pill svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--surface-variant);
  color: var(--on-surface);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.15s ease, transform 0.12s ease;
}

.action-chip:hover {
  background: var(--surface-elevated);
}

.action-chip.primary-tint {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.action-chip svg {
  width: 20px;
  height: 20px;
}

/* Hero Banner */
.hero-card {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  min-height: 216px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  align-items: stretch;
  background: linear-gradient(135deg, #2B133D 0%, #4A153B 55%, #1F1633 100%);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-card:hover {
  transform: translateY(-2px);
}

.hero-backdrop {
  position: absolute;
  inset: -24px;
  background-size: cover;
  background-position: center;
  filter: blur(36px) saturate(1.4) brightness(0.45);
  transform: scale(1.12);
  z-index: 0;
  pointer-events: none;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 11, 21, 0.86) 0%, rgba(15, 11, 21, 0.58) 60%, rgba(15, 11, 21, 0.35) 100%);
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.hero-art-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-art-wrap img.main-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-art-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid rgba(15, 11, 21, 0.9);
  background: #17121F;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.hero-info,
.hero-text {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: #FFFFFF;
}

/* Eyebrow above the station name: "Continue listening", "Now playing" or "Featured". */
.hero-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.78);
}

/* Always rendered and one badge tall, so the hero keeps its height whether
   the station has Sponsored/HD badges or not. */
.hero-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-height: 22px;
}

/* Badges: one pill component everywhere (docs/design-system.md, Badges). */
.live-pill,
.sponsored-badge,
.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.live-pill {
  background: rgba(255, 46, 116, 0.18);
  color: var(--primary);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseDot 1.4s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Sponsored is an ad disclosure: the one solid badge, #FFB020 in every theme. */
.sponsored-badge {
  background: #FFB020;
  color: #0F0B15;
}

/* HD and FM are acronyms, so they stay uppercase; Sponsored and Live are sentence case. */
.quality-badge {
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Over artwork (hero, full player) the neutral badge needs a translucent fill to stay readable. */
.hero-badges .quality-badge,
.player-meta-pills .quality-badge,
#playerBadges .quality-badge {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-song,
.hero-sub {
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.78);
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Play sits under the text at every width, so it is always in the first viewport. */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.hero-play-btn {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(255, 46, 116, 0.45);
  transition: transform 0.14s ease, filter 0.14s ease;
}

.hero-play-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.08);
}

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

.hero-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}

.hero-link-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hero-link-btn svg {
  width: 20px;
  height: 20px;
}

.icon-circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.12s ease;
}

.icon-circle-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.icon-circle-btn.active-fav {
  color: var(--sponsor-amber);
}

/* Section Headers & Horizontal Rails */
.rail-section,
.station-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-title-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 8px 0 0;
  border-radius: 10px;
  color: var(--on-bg);
  text-align: left;
}

.section-title-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-title-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--on-surface-variant);
}

.section-title-btn:hover svg {
  color: var(--primary);
}

.see-all-btn {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 10px;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.see-all-btn:hover {
  background: var(--surface-variant);
}

.rail-scroll {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
}

/* Station Card: filled tile with the name inside (docs/design-system.md, Station card).
   The tile gives transparent and non-square logos the same footprint and gives
   the focus ring a stable shape. */
.station-card {
  width: 176px;
  max-width: 176px;
  min-width: 0;
  flex-shrink: 0;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface-container);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  position: relative;
  scroll-snap-align: start;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.station-card:hover {
  background: var(--surface-variant);
}

.station-card.is-playing {
  box-shadow: 0 0 0 2px rgba(255, 46, 116, 0.6);
}

.card-art-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Logos are fitted, never cropped or stretched. */
.card-art-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fallback-monogram {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 2.4rem;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.player-artwork-shell .fallback-monogram {
  font-size: 5rem;
}

.mini-art .fallback-monogram,
.row-art .fallback-monogram {
  font-size: 1.1rem;
}

.card-rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 8px;
}

.card-sponsor-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  background: #FFB020;
  color: #0F0B15;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  border-radius: 6px;
}

.card-playing-eq {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--primary);
  color: #FFFFFF;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 0 4px 4px;
}

.card-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--on-surface);
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-subtitle,
.card-sub {
  font-size: 0.78rem;
  color: var(--on-surface-variant);
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Now-playing lines stay muted: pink is reserved for actions (docs/design-system.md). */
.card-subtitle.live-song,
.card-sub.live-song {
  color: var(--on-surface-variant);
}

/* Genre Cards & Country Cards */
.genre-rail-card,
.genre-grid-card {
  position: relative;
  border-radius: 16px;
  padding: 16px;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  transition: transform 0.14s ease, filter 0.14s ease;
}

.genre-rail-card {
  width: 156px;
  height: 84px;
  flex-shrink: 0;
}

.genre-grid-card {
  height: 92px;
}

.genre-rail-card:hover,
.genre-grid-card:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.genre-card-deco {
  position: absolute;
  right: -12px;
  top: -12px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.country-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--outline);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.country-card.rail-item {
  width: 176px;
  flex-shrink: 0;
}

.country-card:hover {
  background: var(--surface-variant);
  transform: translateY(-2px);
}

/* Flags: square flag-icons artwork, same on every device (docs/design-system.md). */
.country-flag {
  display: inline-flex;
  flex-shrink: 0;
}

.flag {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--outline);
  vertical-align: middle;
}

.flag-world,
.flag-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.flag-world svg {
  width: 24px;
  height: 24px;
}

.setting-desc .flag {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-right: 6px;
}

.smart-tv-mode .country-flag .flag {
  width: 64px;
  height: 64px;
  border-radius: 12px;
}

.country-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.country-name {
  font-size: 0.94rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-sub {
  font-size: 0.76rem;
  color: var(--on-surface-variant);
}

/* Browse View */
.search-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-variant);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 12px 20px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-input-box:focus-within {
  border-color: var(--primary);
  background: var(--surface);
}

.search-input-box svg {
  width: 22px;
  height: 22px;
  color: var(--on-surface-variant);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  font-size: 1.05rem;
  color: var(--on-surface);
  outline: none;
}

.search-input::placeholder {
  color: var(--on-surface-variant);
}

.filter-chips-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--outline);
  color: var(--on-surface-variant);
  transition: all 0.15s ease;
}

.filter-chip.selected {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: var(--primary);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.chart-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--surface-variant);
  color: var(--on-surface);
  font-weight: 700;
  font-size: 1rem;
  text-align: left;
  transition: transform 0.14s ease, background 0.14s ease;
}

.chart-card:hover {
  transform: translateY(-2px);
  background: var(--surface-elevated);
}

.chart-card svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
  flex-shrink: 0;
}

.region-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--surface-variant);
  color: var(--on-surface);
  font-weight: 600;
  font-size: 0.92rem;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.12s ease;
}

.region-chip:hover {
  background: var(--surface-elevated);
  transform: translateY(-1px);
}

.region-chip svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
}

.genres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 12px;
}

.countries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

/* Station Row List (Search, Drilldown, Library) */
.station-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.station-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid transparent;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.station-row:hover {
  background: var(--surface-container);
  border-color: var(--outline);
}

.station-row.is-playing {
  background: var(--surface-container);
  border-color: var(--primary);
}

.row-rank {
  width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--on-surface-variant);
  flex-shrink: 0;
}

.row-art {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
}

.row-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-info {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.row-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.row-title {
  font-weight: 700;
  font-size: 1rem;
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-sub {
  font-size: 0.84rem;
  color: var(--on-surface-variant);
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-sub.live-song {
  color: var(--on-surface-variant);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
  transition: background 0.14s ease, color 0.14s ease;
}

.icon-btn:hover {
  background: var(--surface-variant);
  color: var(--on-surface);
}

.icon-btn.fav-active {
  color: var(--sponsor-amber);
}

/* Library Tabs & Grids */
.tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--outline);
  padding-bottom: 10px;
}

.tab-pill {
  padding: 9px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--on-surface-variant);
  transition: all 0.15s ease;
}

.tab-pill:hover {
  background: var(--surface-variant);
  color: var(--on-surface);
}

.tab-pill.active {
  background: var(--primary);
  color: var(--on-primary);
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 14px;
}

.favorites-grid .station-card {
  width: 100%;
  max-width: 100%;
}

.song-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--outline);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.song-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--surface-variant);
  color: var(--on-surface);
  transition: background 0.14s ease;
}

.mini-link-btn:hover {
  background: var(--surface-elevated);
}

.mini-link-btn.spotify {
  color: #1ED760;
}

.mini-link-btn.ytmusic {
  color: #FF4E45;
}

/* Settings Rows */
.settings-group-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-top: 10px;
  margin-bottom: 6px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--outline);
  cursor: pointer;
  transition: background 0.14s ease;
  text-align: left;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row:hover {
  background: var(--surface-container);
}

.setting-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
  flex-shrink: 0;
}

.setting-text {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.setting-title {
  font-weight: 700;
  font-size: 1rem;
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setting-desc {
  font-size: 0.85rem;
  color: var(--on-surface-variant);
  margin-top: 2px;
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setting-select {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-variant);
  border: 1px solid var(--outline);
  color: var(--on-surface);
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 220px;
  flex-shrink: 0;
  cursor: pointer;
}

/* Toggle Switch */
.switch {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-variant);
  border: 1px solid var(--outline);
  position: relative;
  transition: background 0.18s ease;
  flex-shrink: 0;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--on-surface-variant);
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1), background 0.18s ease;
}

.switch.on {
  background: var(--primary);
  border-color: var(--primary);
}

.switch.on::after {
  transform: translateX(20px);
  background: #FFFFFF;
}

/* Docked MiniPlayer */
.mini-player {
  grid-column: 2;
  grid-row: 2;
  background: var(--surface-container);
  border-top: 1px solid var(--outline);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 25;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.28);
}

.mini-player.hidden {
  display: none;
}

.mini-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  flex: 1;
  cursor: pointer;
}

.mini-art {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-variant);
  position: relative;
}

.mini-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-meta,
.mini-info {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.mini-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.mini-title {
  font-weight: 700;
  font-size: 0.98rem;
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-sub {
  font-size: 0.82rem;
  color: var(--on-surface-variant);
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-sub.live-song {
  color: var(--on-surface-variant);
}

.mini-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.play-fab-sm {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(255, 46, 116, 0.4);
}

.mini-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 125px;
  margin-left: 6px;
}

input[type="range"].slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-variant);
  outline: none;
}

input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

/* Fullscreen Now Playing Overlay */
.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #0F0B15;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.26s cubic-bezier(0.2, 0, 0, 1), opacity 0.22s ease;
}

.player-overlay.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.player-backdrop {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(55px) saturate(1.5) brightness(0.38);
  transform: scale(1.15);
  z-index: 0;
}

.player-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 11, 21, 0.35) 0%, rgba(15, 11, 21, 0.88) 100%);
  z-index: 1;
}

.player-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 28px 32px;
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.player-top-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.player-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-center,
.player-body {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 42px;
  align-items: center;
  margin: auto 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.player-artwork-shell {
  position: relative;
  width: 320px;
  height: 320px;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.player-artwork-shell img.main-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-station-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  background: #17121F;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.player-details,
.player-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-station-name,
.player-title {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-song-box,
.player-song-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 1.05rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.player-song-box span,
.player-song {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-meta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.player-transport {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 8px;
}

.transport-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s ease, background 0.14s ease;
}

.transport-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

.transport-play-lg {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--brand-pink);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(255, 46, 116, 0.55);
  transition: transform 0.14s ease, background 0.14s ease;
}

.transport-play-lg:hover {
  transform: scale(1.06);
  background: #ff4382;
}

.player-volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 340px;
  margin-top: 6px;
}

/* Mobile Bottom Nav */
.bottom-nav {
  display: none;
  background: var(--surface);
  border-top: 1px solid var(--outline);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
  z-index: 30;
}

/* Same as the Android navigation bar: icon in a pill indicator when active. */
.bottom-nav-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 2px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--on-surface-variant);
}

.bottom-nav-btn span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav-btn svg {
  width: 56px;
  height: 32px;
  padding: 4px 16px;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.bottom-nav-btn.active {
  color: var(--on-surface);
}

.bottom-nav-btn.active svg {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: var(--surface);
  color: var(--on-surface);
  border: 1px solid var(--outline);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--outline);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--outline);
}

.field-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--on-surface-variant);
  margin-bottom: 4px;
  display: block;
}

.text-input,
.text-area {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--surface-variant);
  border: 1px solid var(--outline);
  color: var(--on-surface);
  font-size: 0.95rem;
}

.text-input:focus,
.text-area:focus {
  border-color: var(--primary);
  outline: none;
}

.btn {
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 0.14s ease, background 0.14s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-tonal {
  background: var(--surface-variant);
  color: var(--on-surface);
}

.btn-danger {
  background: rgba(255, 59, 48, 0.18);
  color: #FF5B52;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface-elevated);
  color: var(--on-surface);
  border: 1px solid var(--outline);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Spinner & Empty States */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-box {
  padding: 48px 24px;
  text-align: center;
  color: var(--on-surface-variant);
  background: var(--surface);
  border: 1px dashed var(--outline);
  border-radius: 20px;
}

/* Responsive Breakpoints */
@media (max-width: 767px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto auto;
  }

  .sidebar {
    display: none;
  }

  .main-view {
    grid-column: 1;
    grid-row: 1;
    padding: 16px 16px 28px;
  }

  .mini-player {
    grid-column: 1;
    grid-row: 2;
    padding: 8px 12px;
  }

  .mini-volume {
    display: none;
  }

  .bottom-nav {
    display: flex;
    grid-column: 1;
    grid-row: 3;
  }

  .brand-eyebrow {
    display: block;
  }

  .greeting-title {
    font-size: 1.75rem;
  }

  /* Compact header: the labelled pills get their own row under the greeting and
     scroll sideways when they do not fit; they never wrap or truncate. */
  .home-topbar {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 12px;
  }

  .topbar-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 4px 16px;
  }

  .topbar-actions::-webkit-scrollbar {
    display: none;
  }

  .station-card {
    width: 156px;
    max-width: 156px;
  }

  /* Compact mini player: art, title, star, play. Prev/next start at medium width. */
  #miniPrevBtn,
  #miniNextBtn,
  #miniExpandBtn {
    display: none;
  }

  .hero-title {
    font-size: 1.375rem;
  }

  /* Website shrinks to an icon so it stays on the play button's row. */
  .hero-actions {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .hero-link-btn {
    width: 48px;
    padding: 0;
    justify-content: center;
  }

  .hero-link-btn span {
    display: none;
  }

  /* Mini player keeps SPONSORED (required) but drops HD so the name has room. */
  #miniBadges .quality-badge {
    display: none;
  }

  .hero-content {
    padding: 18px;
    gap: 16px;
  }

  .hero-art-wrap {
    width: 96px;
    height: 96px;
    border-radius: 16px;
  }


  .player-center {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
    justify-items: center;
  }

  .player-artwork-shell {
    width: min(260px, 68vw);
    height: min(260px, 68vw);
  }

  .player-details {
    align-items: center;
  }

  .player-station-name {
    font-size: 1.65rem;
  }
}

/* ==========================================================================
   Smart TV layout (LG webOS, Samsung Tizen). smarttv-remote.js adds
   .smart-tv-mode to <html>. Same rules as the Android TV app
   (docs/design-system.md): collapsed icon rail that opens when focus enters it,
   type at 1.5x, 48px overscan-safe gutters, a strong focus ring, no hover.
   ========================================================================== */
html.smart-tv-mode {
  font-size: 24px;
}

.smart-tv-mode body {
  font-size: 24px;
}

.smart-tv-mode .app-shell {
  grid-template-columns: 120px minmax(0, 1fr);
}

.smart-tv-mode .sidebar {
  width: 120px;
  padding: 48px 20px;
  gap: 12px;
  overflow: visible;
  transition: width 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease;
}

.smart-tv-mode .sidebar:focus-within {
  width: 340px;
  box-shadow: 24px 0 48px rgba(0, 0, 0, 0.55);
  z-index: 40;
}

.smart-tv-mode .brand-header {
  padding: 0 4px 32px;
  justify-content: flex-start;
}

.smart-tv-mode .brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
}

.smart-tv-mode .brand-title,
.smart-tv-mode .nav-btn span {
  display: none;
  white-space: nowrap;
}

.smart-tv-mode .sidebar:focus-within .brand-title,
.smart-tv-mode .sidebar:focus-within .nav-btn span {
  display: inline;
}

.smart-tv-mode .nav-btn {
  min-height: 72px;
  padding: 0 22px;
  gap: 20px;
  border-radius: 999px;
}

.smart-tv-mode .nav-btn svg {
  width: 36px;
  height: 36px;
}

.smart-tv-mode .sidebar-footer,
.smart-tv-mode .mini-volume,
.smart-tv-mode .bottom-nav,
.smart-tv-mode .brand-eyebrow {
  display: none !important;
}

.smart-tv-mode .main-view {
  padding: 48px 64px 48px 48px;
  scroll-padding: 48px 0;
  /* Instant scroll: focus must land on screen at once on TV browsers. */
  scroll-behavior: auto;
}

.smart-tv-mode .rail-scroll {
  scroll-padding: 0 48px;
}

.smart-tv-mode .view-container {
  max-width: none;
  gap: 40px;
}

.smart-tv-mode .rail-scroll {
  gap: 24px;
  padding: 16px 16px 20px;
}

.smart-tv-mode .mini-player {
  min-height: 112px;
  padding: 16px 48px;
}

.smart-tv-mode .mini-art {
  width: 72px;
  height: 72px;
}

.smart-tv-mode .play-fab-sm {
  width: 72px;
  height: 72px;
}

.smart-tv-mode .mini-controls .icon-btn {
  width: 64px;
  height: 64px;
}

.smart-tv-mode .mini-controls svg {
  width: 32px;
  height: 32px;
}

.smart-tv-mode .station-card {
  width: 280px;
  max-width: 280px;
  padding: 12px;
  border-radius: 20px;
}

.smart-tv-mode .card-art-box {
  border-radius: 14px;
}

.smart-tv-mode .fallback-monogram {
  font-size: 2.6rem;
}

.smart-tv-mode .hero-card {
  border-radius: 32px;
}

.smart-tv-mode .hero-content {
  padding: 40px 48px;
  gap: 40px;
}

.smart-tv-mode .hero-art-wrap {
  width: 240px;
  height: 240px;
  border-radius: 28px;
}

.smart-tv-mode .hero-play-btn {
  width: 96px;
  height: 96px;
}

.smart-tv-mode .hero-play-btn svg {
  width: 44px;
  height: 44px;
}

.smart-tv-mode .live-pill,
.smart-tv-mode .sponsored-badge,
.smart-tv-mode .quality-badge,
.smart-tv-mode .card-sponsor-pill {
  height: 30px;
  padding: 0 12px;
}

.smart-tv-mode .card-rank-badge {
  min-width: 36px;
  height: 36px;
}

.smart-tv-mode .header-pill {
  height: 64px;
  padding: 0 28px;
  gap: 14px;
  border-radius: 18px;
}

.smart-tv-mode .header-pill svg {
  width: 30px;
  height: 30px;
}

/* TV: the focused header pill fills with primary. */
.smart-tv-mode .header-pill:focus-visible,
.smart-tv-mode .header-pill.tv-focused {
  background: var(--primary);
  color: var(--on-primary);
  outline: none !important;
  transform: none;
}

.smart-tv-mode .action-chip {
  min-height: 72px;
  padding: 0 28px;
}

.smart-tv-mode .action-chip svg {
  width: 32px;
  height: 32px;
}

.smart-tv-mode .genre-rail-card {
  width: 260px;
  height: 130px;
}

/* No hover on a remote: only focus moves things. */
.smart-tv-mode .station-card:hover,
.smart-tv-mode .hero-card:hover,
.smart-tv-mode .hero-play-btn:hover {
  transform: none;
}

.smart-tv-mode :focus-visible,
.smart-tv-mode .tv-focused {
  outline: 4px solid var(--focus-ring) !important;
  outline-offset: 4px !important;
  box-shadow: none !important;
  transform: scale(1.06);
}

/* Focus ring sits on the tile, not the art (docs/design-system.md, Station card). */
.smart-tv-mode .station-card:focus-visible,
.smart-tv-mode .station-card.tv-focused {
  outline: 3px solid var(--focus-ring) !important;
  outline-offset: 3px !important;
  background: var(--surface-variant);
  transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  :focus-visible,
  .tv-focused,
  .smart-tv-mode :focus-visible,
  .smart-tv-mode .tv-focused,
  .smart-tv-mode .station-card:focus-visible,
  .smart-tv-mode .station-card.tv-focused {
    transform: none !important;
  }
}
