/* PC / Desktop web — listening hub (activated via html.whm-desktop-web) */

html.whm-desktop-web .main {
  max-width: min(1440px, calc(100vw - 272px - 2rem));
  padding: 1.75rem 2rem 7.5rem;
}

/* —— Full-bleed desktop hero —— */
html.whm-desktop-web .hero-stage.hero-global {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: end;
  min-height: min(58vh, 520px);
  margin: -1.75rem -2rem 2rem;
  padding: 3.5rem 2.5rem 2.75rem;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
  isolation: isolate;
}
html.whm-desktop-web .hero-stage.hero-global::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 80% at 85% 30%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 55%),
    radial-gradient(ellipse 55% 70% at 15% 80%, color-mix(in srgb, var(--secondary) 22%, transparent), transparent 50%),
    linear-gradient(165deg, color-mix(in srgb, var(--bg) 40%, #0a0818), var(--bg));
}
html.whm-desktop-web .hero-stage.hero-global::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 180px;
  pointer-events: none;
  mix-blend-mode: soft-light;
}
html.whm-desktop-web .hero-copy {
  max-width: 34rem;
  animation: deskHeroIn 520ms cubic-bezier(.2,.8,.2,1) both;
}
html.whm-desktop-web .brand-hero {
  font-size: clamp(3.2rem, 5.5vw, 4.8rem);
}
html.whm-desktop-web .hero-visual {
  height: min(340px, 42vh);
  justify-self: end;
  width: min(340px, 100%);
  animation: deskHeroIn 640ms 80ms cubic-bezier(.2,.8,.2,1) both;
}
html.whm-desktop-web .vinyl {
  width: 220px;
  height: 220px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent),
    0 0 80px color-mix(in srgb, var(--accent) 28%, transparent),
    0 24px 60px rgba(0, 0, 0, 0.45);
}
@keyframes deskHeroIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* —— Continue listening strip —— */
.continue-strip {
  display: none;
}
html.whm-desktop-web .continue-strip:not([hidden]) {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 12%, var(--bg-elevated)), var(--bg-elevated));
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  animation: deskHeroIn 400ms ease both;
}
.continue-art {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--secondary), var(--accent));
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.continue-meta { min-width: 0; }
.continue-meta .eyebrow { margin-bottom: 0.2rem; }
.continue-meta strong {
  display: block;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.continue-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* —— Desktop home hub (≥1280): content + sticky desk —— */
html.whm-desktop-web .home-desk-layout {
  display: block;
}
@media (min-width: 1280px) {
  html.whm-desktop-web .home-desk-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.75rem;
    align-items: start;
  }
  html.whm-desktop-web .home-desk-main { min-width: 0; }
  html.whm-desktop-web .home-desk-rail {
    position: sticky;
    top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: calc(100vh - 7.5rem);
    overflow: auto;
    padding-bottom: 0.5rem;
  }
}
.home-desk-rail { display: none; }
html.whm-desktop-web .home-desk-rail { display: flex; flex-direction: column; gap: 1rem; }
@media (max-width: 1279px) {
  html.whm-desktop-web .home-desk-rail { display: none; }
}

.desk-panel {
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.desk-panel h3 {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.15rem;
}
.desk-channel-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.desk-channel-list button {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  text-align: left;
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.desk-channel-list button:hover,
.desk-channel-list button:focus-visible {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: var(--border);
  outline: none;
}
.desk-ch-art {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--secondary), var(--accent));
  background-size: cover;
  background-position: center;
}
.desk-ch-meta { min-width: 0; }
.desk-ch-meta strong {
  display: block;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.desk-ch-meta span {
  font-size: 0.72rem;
  color: var(--muted);
}
.desk-keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.65rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}
.desk-keys kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font: 600 0.72rem/1.2 var(--font);
}

/* —— World atlas (real geographic SVG, English labels) —— */
.world-atlas {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 280px;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 40% 30%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 50%),
    linear-gradient(160deg, var(--bg-elevated), color-mix(in srgb, var(--bg) 75%, var(--bg-elevated)));
  overflow: hidden;
}
.world-atlas .atlas-map-wrap {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, #0b1a2e 88%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.world-atlas .world-atlas-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 360px;
}
.world-atlas .atlas-ocean {
  fill: color-mix(in srgb, #12304f 70%, var(--bg));
}
.world-atlas .atlas-land,
.world-atlas .atlas-land path,
.world-atlas .atlas-region path {
  fill: color-mix(in srgb, var(--secondary) 28%, #1a2740);
  stroke: color-mix(in srgb, var(--fg) 14%, transparent);
  stroke-width: 0.35;
  transition: fill 160ms ease, filter 160ms ease;
}
.world-atlas .atlas-region {
  cursor: pointer;
}
.world-atlas .atlas-region:hover,
.world-atlas .atlas-region:focus,
.world-atlas .atlas-region:hover path,
.world-atlas .atlas-region:focus path {
  fill: color-mix(in srgb, var(--accent) 48%, #2a3f66);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 40%, transparent));
  outline: none;
}
.world-atlas .atlas-region.is-active,
.world-atlas .atlas-region.is-active path {
  fill: var(--accent);
  stroke: color-mix(in srgb, var(--accent-ink) 35%, var(--accent));
}
.world-atlas .atlas-region.is-hot,
.world-atlas .atlas-region.is-hot path {
  fill: color-mix(in srgb, var(--accent) 38%, #2a3f66);
}
.world-atlas .atlas-label {
  fill: color-mix(in srgb, var(--fg) 82%, white);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font), system-ui, sans-serif;
  pointer-events: none;
  paint-order: stroke;
  stroke: color-mix(in srgb, #0a1020 75%, transparent);
  stroke-width: 2.5px;
  stroke-linejoin: round;
}
.world-atlas .atlas-label.is-active,
.world-atlas .atlas-label.is-hot {
  fill: var(--accent-ink, #0a0814);
  stroke: color-mix(in srgb, var(--accent) 55%, transparent);
}
.world-atlas-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
html.whm-desktop-web .world-map-panel {
  grid-template-columns: 1.25fr 0.85fr;
  gap: 1.5rem;
}
html.whm-desktop-web .world-map-side {
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  max-height: 420px;
  overflow: auto;
}

/* —— Music row keyboard focus —— */
.music-row.is-kb-focus {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* —— Player grouping (desktop) —— */
@media (min-width: 981px) {
  html.whm-desktop-web .player-controls {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.2rem;
  }
  html.whm-desktop-web .player-controls::before,
  html.whm-desktop-web .player-controls::after {
    content: none;
  }
  html.whm-desktop-web .player-group-transport,
  html.whm-desktop-web .player-group-tools {
    display: contents;
  }
  html.whm-desktop-web .player .vol {
    margin-left: 0.35rem;
    padding-left: 0.45rem;
    border-left: 1px solid var(--border);
  }
  html.whm-desktop-web #btn-quality.is-on,
  html.whm-desktop-web #btn-crossfade.is-on {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  }
  html.whm-desktop-web body.quality-lossless #btn-quality {
    color: var(--accent);
  }
  html.whm-desktop-web body.quality-eco #btn-quality {
    color: #3ddc97;
  }
}

/* —— Queue dock (theme tokens, no inline emoji) —— */
.desktop-queue-panel {
  position: fixed;
  right: 18px;
  bottom: 96px;
  width: min(380px, 92vw);
  max-height: 55vh;
  overflow: auto;
  z-index: 80;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
}
.desktop-queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.desktop-queue-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.desktop-queue-hint {
  font-size: 12px;
  margin: 0 0 10px;
  color: var(--muted);
}
.desktop-queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.desktop-queue-list li {
  display: grid;
  grid-template-columns: 28px 40px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--fg) 4%, transparent);
  cursor: grab;
  border: 1px solid transparent;
}
.desktop-queue-list .q-cover {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--fg) 8%, transparent) center / cover no-repeat;
  flex-shrink: 0;
}
.desktop-queue-list li.is-current {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.desktop-queue-list li.dragging { opacity: 0.45; }
.desktop-queue-list .drag {
  opacity: 0.55;
  display: grid;
  place-items: center;
  color: var(--muted);
}
html.whm-mobile-web .desktop-queue-panel {
  left: 12px;
  right: 12px;
  width: auto;
  bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
  max-height: 48vh;
}

/* —— Shortcuts modal —— */
.desk-shortcuts-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}
.desk-shortcuts-modal[hidden] { display: none !important; }
.desk-shortcuts-card {
  width: min(440px, 100%);
  padding: 1.35rem 1.5rem 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: deskHeroIn 280ms ease both;
}
.desk-shortcuts-card h2 {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
}
.desk-shortcuts-card .desk-keys { margin-bottom: 1rem; }
.desk-shortcuts-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Hi-Fi quality pill in player meta (desktop) */
.quality-pill {
  display: none;
  margin-left: 0.45rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: middle;
}
html.whm-desktop-web .quality-pill:not([hidden]) { display: inline-block; }
html.whm-desktop-web body.quality-lossless .quality-pill {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
}
html.whm-desktop-web body.quality-eco .quality-pill {
  color: #0b2a1c;
  background: #3ddc97;
  border-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  html.whm-desktop-web .hero-copy,
  html.whm-desktop-web .hero-visual,
  html.whm-desktop-web .continue-strip:not([hidden]),
  .desk-shortcuts-card {
    animation: none !important;
  }
}
