/*
 * Makplay Home — refined library-first layout
 * Kept separate from the playback and page logic so the visual system can
 * evolve without touching Home composition, navigation, or MediaSession.
 */
.home-view {
  position: relative;
  isolation: isolate;
}

.home-view::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -24px;
  left: -18px;
  right: -18px;
  height: 390px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 12% 14%, rgba(55, 186, 137, .105), transparent 52%),
    radial-gradient(ellipse at 88% 0%, rgba(89, 110, 190, .055), transparent 44%);
}

.topbar {
  gap: 12px;
  margin-bottom: 2px;
}

.brand-avatar {
  width: 52px;
  height: 52px;
  font-size: 28px;
}

.icon-button {
  width: 44px;
  height: 44px;
  font-size: 21px;
}

.home-view .filter-row {
  gap: 8px;
  padding: 11px 0 4px;
  margin: 0;
  overscroll-behavior-x: contain;
}

.home-view .filter-chip {
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  color: rgba(255, 255, 255, .78);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.home-view .filter-chip.active {
  border-color: rgba(157, 255, 220, .58);
  background: linear-gradient(135deg, #a1f4d4, #53d9ab);
  color: #062219;
  box-shadow: 0 5px 18px rgba(74, 224, 169, .14);
}

.home-view .filter-chip:active {
  transform: scale(.97);
}

.home-view .filter-chip.disabled {
  opacity: .44;
}

.home-view .hero-copy {
  padding: 19px 0 17px;
}

.home-view .hero-copy .eyebrow {
  font-size: 10px;
  letter-spacing: .19em;
}

.home-view .hero-copy h1 {
  margin-top: 7px;
  font-size: clamp(34px, 8vw, 42px);
  font-weight: 760;
  line-height: 1.04;
  letter-spacing: -.055em;
}

.home-view .hero-copy p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.home-quick-access {
  margin: 2px 0 29px;
}

.home-quick-heading {
  margin-bottom: 11px;
}

.home-quick-heading h3 {
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -.04em;
  line-height: 1.25;
}

.home-quick-grid {
  gap: 9px;
}

.home-quick-tile {
  min-height: 74px;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025)),
    rgba(20, 23, 25, .68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
  transition:
    background .2s ease,
    border-color .2s ease,
    transform .2s cubic-bezier(.2, .75, .25, 1);
  -webkit-tap-highlight-color: transparent;
}

.home-quick-tile:hover {
  border-color: rgba(255, 255, 255, .14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .095), rgba(255, 255, 255, .035)),
    rgba(20, 23, 25, .76);
}

.home-quick-tile:active {
  transform: scale(.985);
}

.home-quick-art {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, .07);
}

.home-quick-liked {
  font-size: 25px;
}

.home-quick-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.home-quick-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-quick-copy small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 450;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-sections {
  gap: 33px;
  padding-top: 3px;
}

.home-view .section-heading {
  align-items: center;
  margin-bottom: 11px;
}

.home-view .section-heading h3 {
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -.04em;
  line-height: 1.25;
}

.home-view .section-heading button {
  flex: 0 0 auto;
  padding: 7px 0 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.home-view .carousel {
  gap: 13px;
  padding: 3px 2px 9px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.home-view .card {
  flex-basis: min(174px, 46vw);
  width: min(174px, 46vw);
  max-width: min(174px, 46vw);
}

.home-view .art-card {
  border-radius: 18px;
  box-shadow: 0 12px 27px rgba(0, 0, 0, .22);
}

.home-view .card-type {
  margin-top: 10px;
  font-size: 9px;
  letter-spacing: .13em;
}

.home-view .card-title {
  margin-top: 5px;
  font-size: 14px;
  font-weight: 680;
  line-height: 1.3;
}

.home-view .card-subtitle {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
}

.home-view .small-card {
  flex-basis: min(244px, 70vw);
  gap: 10px;
  padding: 9px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.home-view .small-card img {
  width: 64px;
  height: 64px;
  border-radius: 13px;
}

.home-view .small-card .card-title {
  font-size: 13px;
}

.home-view .small-card .card-subtitle {
  font-size: 10px;
}

/* The player and tab bar form one dock, with a clear breathing gap. */
.bottom-nav {
  bottom: calc(10px + var(--safe-bottom));
  width: min(calc(100% - 28px), 620px);
  gap: 5px;
  padding: 6px 7px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 23px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .025)),
    rgba(12, 15, 20, .86);
  backdrop-filter: blur(26px) saturate(145%);
  -webkit-backdrop-filter: blur(26px) saturate(145%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    0 12px 34px rgba(0, 0, 0, .3);
}

.nav-item {
  min-height: 53px;
  border-radius: 17px;
  gap: 3px;
}

.nav-item span {
  font-size: 21px;
}

.nav-item small {
  font-size: 10px;
  font-weight: 580;
  line-height: 1.2;
}

.nav-item.active {
  background: rgba(255, 255, 255, .075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}

.mini-player {
  bottom: calc(87px + var(--safe-bottom));
  width: min(calc(100% - 28px), 620px);
  min-height: 72px;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 21px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .025) 48%, rgba(109, 255, 202, .035)),
    rgba(13, 16, 20, .88);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .15),
    0 12px 36px rgba(0, 0, 0, .36);
}

.mini-art-frame {
  width: 51px;
  height: 51px;
  flex-basis: 51px;
  border-radius: 15px;
}

.mini-art-frame img {
  border-radius: 11px;
}

.mini-open {
  gap: 9px;
}

.mini-title {
  font-size: 13px;
  font-weight: 680;
}

.mini-artist {
  font-size: 11px;
}

.player-icon {
  min-width: 38px;
  min-height: 38px;
}

.mini-play {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

/* Keep the last shelf scrollable above both fixed controls while a song plays. */
@supports selector(.app-shell:has(#miniPlayer:not(.view-hidden))) {
  .app-shell:has(#miniPlayer:not(.view-hidden)) {
    padding-bottom: calc(196px + var(--safe-bottom));
  }
}

@media (max-width: 420px) {
  .topbar {
    gap: 10px;
  }

  .brand-avatar {
    width: 50px;
    height: 50px;
  }

  .home-view .hero-copy {
    padding-top: 17px;
  }

  .home-quick-grid {
    gap: 8px;
  }

  .home-quick-tile {
    min-height: 68px;
    gap: 7px;
    padding: 6px;
    border-radius: 14px;
  }

  .home-quick-art {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 11px;
  }

  .home-quick-copy strong {
    font-size: 12px;
  }

  .home-quick-copy small {
    font-size: 10px;
  }

  .home-view .card {
    flex-basis: min(166px, 45vw);
    width: min(166px, 45vw);
    max-width: min(166px, 45vw);
  }

  .mini-player {
    min-height: 68px;
    padding: 6px 8px;
    border-radius: 19px;
  }

  .mini-art-frame {
    width: 47px;
    height: 47px;
    flex-basis: 47px;
  }

  .mini-play {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-quick-tile,
  .home-view .art-card img,
  .nav-item,
  .mini-player {
    animation: none !important;
    transition: none !important;
  }
}


/* ── Makplay Home v2: black editorial discovery layout ─────────────────── */
:root {
  --home-black: #050505;
  --home-surface: #101010;
  --home-surface-raised: #171717;
  --home-line: rgba(255,255,255,.09);
  --home-accent: #7cf0c1;
}
html, body { background: var(--home-black); }
body {
  background: #050505;
}
.ambient {
  background: #050505 !important;
}
.ambient::after,
.ambient-orb,
.ambient-noise { display: none !important; }

.app-shell {
  background: #050505;
}

/* The home page uses a denser editorial rhythm; other views keep their styles. */
.home-view {
  --home-gutter: clamp(16px, 4.2vw, 28px);
  padding-bottom: 8px;
}
.home-view::before { display: none; }
.home-view .filter-row {
  padding: 12px 0 2px;
  gap: 9px;
}
.home-view .filter-chip {
  min-height: 35px;
  padding: 8px 15px;
  font-size: 12px;
  border-radius: 999px;
  background: #111;
  border-color: rgba(255,255,255,.09);
  color: rgba(255,255,255,.7);
}
.home-view .filter-chip.active {
  color: #06140e;
  border-color: #7cf0c1;
  background: #7cf0c1;
  box-shadow: none;
}
.home-view .hero-copy {
  padding: 20px 0 13px;
}
.home-view .hero-copy .eyebrow {
  font-size: 9px;
  letter-spacing: .2em;
  color: rgba(255,255,255,.43);
}
.home-view .hero-copy h1 {
  margin-top: 5px;
  font-size: clamp(27px, 6vw, 34px);
  font-weight: 760;
  letter-spacing: -.055em;
}
.home-view .hero-copy p {
  margin-top: 5px;
  font-size: 13px;
  color: rgba(255,255,255,.52);
}

/* Feature card is injected by the Home renderer and uses existing track data. */
.home-featured {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(112px, .92fr);
  align-items: center;
  gap: 14px;
  min-height: 190px;
  margin: 8px 0 25px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 23px;
  background: linear-gradient(130deg, #191919 0%, #101010 55%, #080808 100%);
}
.home-featured::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, rgba(255,255,255,.055), transparent 46%);
}
.home-featured-copy, .home-featured-art-wrap { position: relative; z-index: 1; min-width: 0; }
.home-featured-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: #91e9c8;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.home-featured-label::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.home-featured-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  font-size: clamp(19px, 4.8vw, 25px);
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: 1.08;
}
.home-featured-subtitle {
  overflow: hidden;
  margin-top: 7px;
  color: rgba(255,255,255,.58);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-featured-actions { display: flex; gap: 8px; margin-top: 15px; }
.home-featured-play, .home-featured-open {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 35px; padding: 0 13px; border-radius: 999px;
  font-size: 11px; font-weight: 750; cursor: pointer;
}
.home-featured-play {
  border: 0; color: #06140e; background: #7cf0c1;
}
.home-featured-open {
  border: 1px solid rgba(255,255,255,.13);
  color: rgba(255,255,255,.86); background: rgba(255,255,255,.045);
}
.home-featured-art-wrap { justify-self: end; width: min(100%, 158px); }
.home-featured-art {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 17px;
  box-shadow: 0 14px 35px rgba(0,0,0,.5);
}
.home-featured-art-fallback {
  display:grid; place-items:center; aspect-ratio:1; border-radius:17px;
  background:#242424; color:rgba(255,255,255,.3); font-size:38px;
}
.home-featured-caption {
  margin-top: 7px; color:rgba(255,255,255,.42); font-size:9px;
  text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

/* Shortcuts become a compact library grid with predictable sizing. */
.home-quick-access {
  margin: 0 0 27px;
}
.home-quick-heading { margin-bottom: 10px; }
.home-quick-heading h3 {
  font-size: 17px; font-weight: 740; letter-spacing: -.035em;
}
.home-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.home-quick-tile {
  min-width: 0;
  min-height: 66px;
  padding: 7px;
  gap: 9px;
  border-radius: 14px;
  background: #121212;
  border-color: rgba(255,255,255,.075);
  box-shadow: none;
}
.home-quick-art {
  width: 48px; height: 48px; flex-basis: 48px;
  border-radius: 10px;
}
.home-quick-copy { gap: 3px; }
.home-quick-copy strong { font-size: 11px; font-weight: 700; }
.home-quick-copy small { font-size: 9px; color: rgba(255,255,255,.48); }

.home-sections {
  display: grid;
  gap: 27px;
  padding-top: 0;
}
.home-view .section-heading {
  margin-bottom: 10px;
}
.home-view .section-heading h3 {
  font-size: 17px;
  font-weight: 740;
  letter-spacing: -.035em;
}
.home-view .section-heading button {
  font-size: 10px;
  color: rgba(255,255,255,.48);
}
.home-view .carousel {
  gap: 11px;
  padding: 2px 1px 7px;
}
.home-view .card {
  flex-basis: min(152px, 41vw);
  width: min(152px, 41vw);
  max-width: min(152px, 41vw);
}
.home-view .art-card {
  border-radius: 15px;
  border-color: rgba(255,255,255,.08);
  box-shadow: none;
}
.home-view .card-title { font-size: 12px; }
.home-view .card-subtitle { font-size: 10px; color: rgba(255,255,255,.48); }
.home-view .card-type { font-size: 8px; color: rgba(255,255,255,.38); }
.home-view .small-card {
  flex-basis: min(225px, 68vw);
  border-radius: 15px;
  padding: 8px;
  background: #111;
  border-color: rgba(255,255,255,.075);
  box-shadow: none;
}
.home-view .small-card img { width: 54px; height: 54px; border-radius: 11px; }

/* Playback dock stays visually separated from content on every screen size. */
.mini-player {
  bottom: calc(91px + var(--safe-bottom));
  background: rgba(17,17,17,.96);
  border-color: rgba(255,255,255,.13);
  box-shadow: 0 12px 35px rgba(0,0,0,.52);
}
.mini-player::before, .mini-player::after { display: none; }
.bottom-nav {
  background: rgba(14,14,14,.97);
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 10px 35px rgba(0,0,0,.55);
}
.nav-item.active { background: rgba(255,255,255,.065); }

@media (min-width: 620px) {
  .home-featured { min-height: 230px; padding: 22px; }
  .home-featured-art-wrap { width: 190px; }
  .home-view .card { flex-basis: 176px; width:176px; max-width:176px; }
}
@media (max-width: 380px) {
  .home-featured { grid-template-columns: minmax(0,1fr) 112px; gap:10px; padding:13px; min-height:164px; }
  .home-featured-title { font-size:19px; }
  .home-featured-art-wrap { width:112px; }
  .home-featured-actions { gap:6px; }
  .home-featured-play, .home-featured-open { min-height:32px; padding:0 10px; font-size:10px; }
}


/* ── Multi-artist discovery rail ───────────────────────────────────────── */
.home-artists-root {
  margin: 0 0 27px;
}
.home-artists-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.home-artists-heading h3 {
  color: #f5f5f5;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -.04em;
}
.home-artists-more {
  flex: 0 0 auto;
  padding: 6px 0 6px 12px;
  color: #68dc96;
  font-size: 13px;
  font-weight: 730;
}
.home-artist-carousel {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 2px 10px;
  margin: 0;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.home-artist-carousel::-webkit-scrollbar { display: none; }
.home-artist-card {
  display: flex;
  flex: 0 0 108px;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  gap: 9px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #f5f5f5;
  background: transparent;
  text-align: center;
  scroll-snap-align: start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.home-artist-art {
  display: block;
  width: 106px;
  height: 106px;
  overflow: hidden;
  border-radius: 50%;
  background: #181818;
  box-shadow: 0 0 0 3px #252525;
}
.home-artist-portrait {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #181818;
}
.home-artist-placeholder {
  display: grid;
  place-items: center;
  color: #a9a9a9;
  font-size: 35px;
  font-weight: 730;
  letter-spacing: -.04em;
}
.home-artist-name {
  display: block;
  width: 100%;
  overflow: hidden;
  color: #ededed;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-artist-card:active .home-artist-art {
  transform: scale(.97);
}
.home-artist-card:focus-visible,
.home-artists-more:focus-visible {
  outline: 2px solid #68dc96;
  outline-offset: 4px;
}
@media (max-width: 420px) {
  .home-artist-carousel { gap: 15px; }
  .home-artist-card { flex-basis: 99px; }
  .home-artist-art { width: 96px; height: 96px; }
  .home-artist-name { font-size: 11px; }
}


.home-explore-artist-grid {
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
}
.home-explore-artist-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 4px 12px;
  border: 0;
  color: #f1f1f1;
  background: transparent;
  text-align: center;
  cursor: pointer;
}
.home-explore-artist-art {
  display: grid;
  place-items: center;
  width: min(100%, 112px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #181818;
  box-shadow: 0 0 0 3px #252525;
}
.home-explore-artist-art img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.home-explore-artist-placeholder {
  color: #aaa;
  font-size: 34px;
  font-weight: 750;
}
.home-explore-artist-card strong {
  width: 100%;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-explore-artist-card:focus-visible {
  outline: 2px solid #68dc96;
  outline-offset: 5px;
}
