  :root {
    --ink: #f6ede1;
    --ink-dim: rgba(246, 237, 225, 0.62);
    --gold: #f2bf6a;
    --copper: #d98a52;
    --panel: rgba(14, 10, 7, 0.9);
    --line: rgba(242, 191, 106, 0.2);
    --line-strong: rgba(242, 191, 106, 0.55);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
    --player-bottom: 22px;
    --player-h: 82px;
  }

  [hidden] { display: none !important; }

  * { box-sizing: border-box; }

  html, body {
    margin: 0;
    height: 100%;
    background: #050403;
    overflow: hidden;
    color: var(--ink);
    font-family: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-user-select: none;
    user-select: none;
    overscroll-behavior: none;
  }

  button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }
  :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

  #scene-canvas {
    position: fixed;
    inset: 0;
    display: block;
    cursor: grab;
    touch-action: none;
  }
  #scene-canvas:active { cursor: grabbing; }

  /* ---------- Título ---------- */
  #title {
    position: fixed;
    top: calc(24px + var(--safe-t));
    left: calc(28px + var(--safe-l));
    z-index: 20;
    pointer-events: none;
  }
  #title h1 {
    margin: 0;
    font-size: clamp(26px, 3.2vw, 42px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
  }
  #title p {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--ink-dim);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  }

  /* ---------- Botones superiores ---------- */
  .top-actions {
    position: fixed;
    top: calc(22px + var(--safe-t));
    right: calc(24px + var(--safe-r));
    z-index: 50;
    display: flex;
    gap: 8px;
  }
  .btn {
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
  }
  .btn:hover { border-color: var(--line-strong); color: var(--gold); }
  .btn.icon { width: 40px; padding: 0; justify-content: center; }
  .btn svg { flex-shrink: 0; }

  /* ---------- Etiquetas de los planetas ---------- */
  #labels {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    overflow: clip;
  }
  /* Botones enfocables (teclado). Sin text-shadow: se mueven cada frame; una píldora sutil da legibilidad */
  .orb-label {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    padding: 2px 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(8, 6, 4, 0.5);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-dim);
    white-space: nowrap;
    pointer-events: none;
    will-change: transform;
    transition: color 0.25s, opacity 0.25s;
  }
  .orb-label.current { color: var(--gold); font-weight: 700; }
  .orb-label.hover { color: #fff; }

  /* ---------- Ayuda ---------- */
  #hint {
    position: fixed;
    left: calc(28px + var(--safe-l));
    bottom: calc(var(--player-bottom) + var(--player-h) + 14px + var(--safe-b));
    z-index: 15;
    font-size: 13px;
    color: var(--ink-dim);
    pointer-events: none;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
    transition: opacity 0.8s;
  }
  #hint.gone { opacity: 0; }

  /* ---------- Portada de entrada ---------- */
  #intro {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(ellipse at 50% 50%, rgba(5, 4, 3, 0.55) 0%, rgba(5, 4, 3, 0.94) 72%);
    transition: opacity 1s var(--ease), visibility 1s;
  }
  #intro.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
  #intro.instant { transition: none; }
  .intro-no3d { margin: 20px 0 0; font-size: 17px; line-height: 1.5; color: var(--gold); max-width: 44ch; }
  body.no-3d .intro-copy { display: none; }
  .intro-inner { width: min(520px, 100%); }
  .intro-artist { margin: 0 0 14px; font-size: 15px; color: var(--gold); font-weight: 500; }
  #intro h2 {
    margin: 0;
    font-size: clamp(44px, 9vw, 88px);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.035em;
  }
  .intro-copy { margin: 20px 0 0; font-size: 17px; line-height: 1.5; color: var(--ink-dim); max-width: 44ch; }
  .intro-actions { margin-top: 32px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
  .primary {
    height: 50px;
    padding: 0 26px;
    border: 0;
    border-radius: 12px;
    background: var(--gold);
    color: #170e07;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, opacity 0.3s;
  }
  .primary:hover:not(:disabled) { background: #ffd48a; }
  .primary:disabled { opacity: 0.45; cursor: default; }
  .link-btn {
    background: none;
    border: 0;
    padding: 6px 0;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(246, 237, 225, 0.35);
    text-underline-offset: 5px;
    transition: color 0.2s, opacity 0.3s;
  }
  .link-btn:hover:not(:disabled) { color: var(--gold); }
  .link-btn:disabled { opacity: 0.45; cursor: default; }
  .intro-load { margin-top: 30px; height: 2px; width: 100%; background: rgba(246, 237, 225, 0.1); overflow: hidden; transition: opacity 0.5s; }
  .intro-load.done { opacity: 0; }
  .intro-load span { display: block; height: 100%; width: 0%; background: var(--gold); transition: width 0.25s ease-out; }

  /* ---------- Lista de canciones ---------- */
  #tracklist-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 360px;
    max-width: 90vw;
    z-index: 90;
    display: flex;
    flex-direction: column;
    background: rgba(12, 9, 6, 0.96);
    border-right: 1px solid var(--line);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.45s var(--ease), visibility 0.45s;
    box-shadow: 16px 0 40px rgba(0, 0, 0, 0.6);
  }
  #tracklist-drawer.open { transform: translateX(0); visibility: visible; }
  .drawer-header {
    padding: calc(26px + var(--safe-t)) 22px 18px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }
  .drawer-header h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
  .drawer-header p { margin: 4px 0 0; font-size: 13px; color: var(--ink-dim); }
  .tracks-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; margin: 0; list-style: none; padding: 12px 12px calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 4px; }
  .track-item {
    display: flex;
    align-items: center;
    gap: 4px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s;
  }
  .track-item:hover { background: rgba(242, 191, 106, 0.07); }
  .track-item.active { background: rgba(242, 191, 106, 0.12); border-color: var(--line-strong); }
  .track-card {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .track-card:focus-visible { outline-offset: -2px; }
  .track-planet {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .track-info { flex: 1; min-width: 0; }
  .track-title { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .track-tag { display: block; margin-top: 3px; font-size: 13px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .track-meta { font-size: 13px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }

  /* ---------- Reproductor Cápsula de Cristal Líquido ---------- */
  #player {
    position: fixed;
    left: 50%;
    bottom: calc(var(--player-bottom) + var(--safe-b));
    transform: translateX(-50%);
    width: min(940px, calc(100% - 32px));
    height: 82px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 18px 0 14px;
    border-radius: 999px;
    
    /* Vidrio oscuro casi opaco (sin backdrop-filter: el canvas se redibuja cada frame) */
    background:
      radial-gradient(160px 70px at 0% 50%, rgba(245, 166, 35, 0.16), transparent 70%),
      radial-gradient(160px 70px at 100% 50%, rgba(130, 200, 255, 0.11), transparent 70%),
      linear-gradient(180deg, rgba(62, 52, 44, 0.96) 0%, rgba(26, 20, 15, 0.96) 22%, rgba(11, 8, 6, 0.97) 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-top: 1.5px solid rgba(255, 255, 255, 0.4);
    box-shadow:
      0 18px 44px rgba(0, 0, 0, 0.65),
      inset 0 1px 2px rgba(255, 255, 255, 0.35);
  }

  /* Sección Izquierda: Icono relieve, Título y Badges */
  .hud-capsule-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-shrink: 0;
  }
  .hud-equalizer {
    width: 34px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-shrink: 0;
  }
  .hud-equalizer span {
    display: block;
    width: 4px;
    height: 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffe29a, #f5a623);
    box-shadow: 0 0 8px rgba(245, 166, 35, 0.65);
    transform: scaleY(0.22);
    transform-origin: center;
    transition: transform 0.12s ease-out;
  }
  .hud-track-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    min-width: 0;
  }
  .hud-tagline {
    display: block;
    max-width: 170px;
    font-size: 11px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hud-tagline.is-status { color: var(--gold); }
  .hud-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
  }
  .hud-stream-badges {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.10);
  }
  .hud-badge-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    text-decoration: none;
    transition: transform 0.18s, filter 0.18s;
  }
  .hud-badge-btn::after { content: ''; position: absolute; inset: -11px; }
  .hud-badge-btn:hover {
    transform: scale(1.15);
    filter: brightness(1.2);
  }
  .hud-badge-btn.yt {
    background: #ff0000;
    color: #fff;
  }
  .hud-badge-btn.sp {
    background: #1ed760;
    color: #050403;
  }

  /* Sección Central: Controles y Línea de Tiempo */
  .hud-capsule-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    max-width: 440px;
    min-width: 0;
  }
  .hud-controls-row {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .hud-ctrl-btn {
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    position: relative;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.18s, transform 0.15s;
  }
  .hud-ctrl-btn::after { content: ''; position: absolute; inset: -8px; }
  .hud-ctrl-btn:hover {
    color: #fff;
    transform: scale(1.14);
  }
  .hud-ctrl-btn:active {
    transform: scale(0.92);
  }
  .hud-play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: radial-gradient(circle at 35% 30%, #ffdf87 0%, #f5a623 60%, #cc7704 100%);
    color: #120b05;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
      0 0 18px rgba(245, 166, 35, 0.7),
      inset 0 1px 1px rgba(255, 255, 255, 0.85);
    transition: transform 0.18s var(--ease), box-shadow 0.2s, filter 0.2s;
  }
  .hud-play-btn:hover {
    transform: scale(1.08);
    filter: brightness(1.08);
    box-shadow:
      0 0 26px rgba(245, 166, 35, 0.9),
      inset 0 1px 1px #fff;
  }
  .hud-play-btn:active {
    transform: scale(0.96);
  }

  .hud-timeline-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
  }
  .hud-progress-wrap {
    flex: 1;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
  }
  .hud-progress-wrap::before { content: ''; position: absolute; inset: -14px 0; }
  .hud-progress-track {
    position: relative;
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    overflow: visible;
  }
  .hud-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #f5a623, #ffcf66);
    border-radius: 999px;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 0.25s linear;
  }
  .hud-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffdf87;
    box-shadow: 0 0 8px rgba(245, 166, 35, 0.9);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.1s, left 0.25s linear;
  }
  .hud-progress-wrap:hover .hud-progress-thumb {
    transform: translate(-50%, -50%) scale(1.25);
  }

  /* Sección Derecha: Volumen Cápsula y Vista General */
  .hud-capsule-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }
  .hud-volume-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  .hud-vol-btn {
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.18s;
  }
  .hud-vol-btn:hover { color: #fff; }
  .hud-vol-wrap {
    width: 60px;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
  }
  .hud-vol-wrap::before { content: ''; position: absolute; inset: -14px 0; }
  .hud-vol-track {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    position: relative;
    overflow: hidden;
  }
  .hud-vol-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 80%;
    background: linear-gradient(90deg, #f5a623, #ffcf66);
    border-radius: 999px;
  }
  .hud-overview-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
  }
  .hud-video-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
  }
  .hud-video-btn[hidden] { display: none; }
  .hud-video-btn::after { content: ''; position: absolute; inset: -5px 0; }
  .hud-video-btn:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.25); color: #fff; }
  @media (max-width: 720px), (max-height: 500px), (pointer: coarse) {
    .hud-video-btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
    .hud-video-btn span { display: none; }
  }
  .hud-overview-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
  }

  .track-access-row { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; flex-shrink: 0; }
  .track-access-row:empty { display: none; }
  .track-access {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    color: var(--ink-dim);
    background: rgba(246, 237, 225, 0.05);
    border: 1px solid rgba(246, 237, 225, 0.12);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s, color 0.2s;
  }
  .track-access::after { content: ''; position: absolute; inset: -8px -3px; }
  .track-access.spotify svg { color: #1ed760; }
  .track-access.youtube svg { color: #ff3d3d; }
  .track-access:hover { transform: scale(1.1); border-color: var(--line-strong); color: var(--gold); }
  .track-access.spotify:hover { background: rgba(30, 215, 96, 0.15); border-color: rgba(30, 215, 96, 0.5); }
  .track-access.youtube:hover { background: rgba(255, 61, 61, 0.14); border-color: rgba(255, 61, 61, 0.5); }

  /* ---------- Video (YouTube): visible, >=200x200 y sin nada por encima del iframe ---------- */
  :root { --vp-head: 44px; }

  .video-panel {
    position: fixed;
    z-index: 45;
    overflow: hidden;
    border-radius: 18px;
    background: #0b0805;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-top: 1.5px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
    visibility: hidden;
    opacity: 0;
    transform: translateY(14px) scale(0.985);
    transition: opacity 0.22s ease, transform 0.22s var(--ease), visibility 0s linear 0.22s;
  }
  .video-panel.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.22s ease, transform 0.22s var(--ease), visibility 0s;
  }
  .video-bar {
    height: var(--vp-head);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 6px 0 16px;
    background: linear-gradient(180deg, rgba(62, 52, 44, 0.96), rgba(26, 20, 15, 0.96));
  }
  .video-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
  .video-title { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .video-notice { display: none; font-size: 11px; line-height: 1.15; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .video-notice.on { display: block; }
  .video-yt-link, .video-solo-btn {
    height: var(--vp-head);
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: rgba(255, 255, 255, 0.82);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.18s;
  }
  .video-yt-link svg { color: #ff3d3d; }
  .video-yt-link:hover, .video-solo-btn:hover { color: var(--gold); }
  .video-solo-btn[hidden] { display: none; }
  .video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 200px; background: #000; }
  .video-frame[hidden] { display: none; }
  .video-frame .video-mount, .video-frame iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
  .video-fail {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    text-align: center;
    background: #0b0805;
  }
  .video-fail[hidden] { display: none; }
  .video-fail p { margin: 0; font-size: 16px; font-weight: 700; }
  .video-fail-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
  .video-fail .btn { height: 44px; }

  /* Computadora: ventana flotante en la esquina inferior derecha, sobre la cápsula.
     La escena 3D es la protagonista: sin viñeta y sin ocultar nada. */
  .video-panel[data-layout="dock"] {
    right: calc(20px + var(--safe-r));
    bottom: calc(var(--player-bottom) + var(--player-h) + 14px + var(--safe-b));
    width: clamp(360px, 26vw, 440px);
  }

  /* Modo compacto (celular / tablet): encima de la cápsula */
  .video-panel[data-layout="compact"] {
    left: 0;
    right: 0;
    margin-inline: auto;
    width: min(520px, calc(100vw - 24px - var(--safe-l) - var(--safe-r)));
    bottom: calc(var(--player-bottom) + var(--player-h) + 8px + var(--safe-b));
  }
  @media (max-width: 520px) {
    .video-yt-link span { display: none; }
    .video-yt-link { width: 44px; padding: 0; justify-content: center; }
  }
  @media (min-width: 721px) {
    .video-panel[data-layout="compact"] {
      left: auto;
      right: max(calc(16px + var(--safe-r)), calc((100vw - 940px) / 2));
      margin-inline: 0;
      width: clamp(320px, calc(100vw - 392px), 420px);
      bottom: calc(var(--player-bottom) + var(--player-h) + 10px + var(--safe-b));
    }
  }
  @media (max-height: 500px) and (orientation: landscape) {
    .video-panel { --vp-head: 40px; }
    .video-panel[data-layout="compact"] {
      left: auto;
      right: calc(12px + var(--safe-r));
      margin-inline: 0;
      width: 320px;
      bottom: calc(var(--player-bottom) + var(--player-h) + 8px + var(--safe-b));
    }
  }

  .top-view-btn { display: none; }

  /* ---------- Sin WebGL: lista de canciones + reproductor sobre fondo estático ---------- */
  body.no-3d { background: radial-gradient(ellipse at 50% 18%, #3a2410 0%, #150e08 48%, #050403 100%) fixed; }
  body.no-3d #scene-canvas, body.no-3d #labels, body.no-3d #hint, body.no-3d #pause-toggle,
  body.no-3d #tracklist-toggle-btn, body.no-3d #drawer-close-btn, body.no-3d .top-view-btn,
  body.no-3d .hud-overview-pill { display: none; }
  body.no-3d #tracklist-drawer {
    left: 50%;
    width: min(560px, 100%);
    max-width: 100%;
    top: calc(84px + var(--safe-t));
    bottom: var(--stack-h, 0px);
    transform: translateX(-50%);
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  body.no-3d .drawer-header { padding-top: 8px; }

  /* Tablets estrechas: la cápsula cede espacio al centro */
  @media (max-width: 900px) {
    .hud-tagline { max-width: 130px; }
    .hud-controls-row { gap: 10px; }
  }

  /* ---------- Móvil (ancho) ---------- */
  @media (max-width: 720px) {
    #title {
      top: calc(14px + var(--safe-t));
      left: calc(16px + var(--safe-l));
      max-width: calc(100vw - 250px);
    }
    #title h1 {
      font-size: clamp(18px, 4.4vw, 24px);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    #title p { font-size: 12px; margin-top: 3px; }
    .top-actions { top: calc(10px + var(--safe-t)); right: calc(12px + var(--safe-r)); gap: 6px; }
    .btn { height: 44px; padding: 0 12px; font-size: 13px; }
    .btn.icon { width: 44px; padding: 0; }
    .orb-label { font-size: 12px; }
  }

  /* ---------- Móvil vertical: reproductor apilado, video encima ---------- */
  @media (max-width: 720px) and (min-height: 501px) {
    :root { --player-bottom: 8px; }
    .top-view-btn { display: inline-flex; width: 44px; padding: 0; justify-content: center; }
    .top-view-btn span { display: none; }
    #hint { left: calc(18px + var(--safe-l)); font-size: 12px; max-width: 75vw; }
    #player {
      width: min(520px, calc(100vw - 24px - var(--safe-l) - var(--safe-r)));
      height: auto;
      padding: 10px 12px 11px;
      border-radius: 24px;
      flex-direction: column;
      gap: 8px;
    }
    .hud-capsule-left { width: 100%; min-width: 0; min-height: 44px; justify-content: flex-start; gap: 10px; padding-right: 100px; }
    .hud-equalizer { width: 28px; height: 34px; gap: 2px; }
    .hud-equalizer span { width: 3px; }
    .hud-track-meta { flex: 1; }
    .hud-title { max-width: 100%; font-size: 14px; }
    .hud-tagline { display: none; max-width: 100%; }
    .hud-tagline.is-status { display: block; }
    .hud-capsule-center { width: 100%; max-width: 100%; }
    .hud-controls-row { width: 100%; justify-content: space-between; gap: 4px; }
    .hud-ctrl-btn { width: 44px; height: 44px; }
    .hud-ctrl-btn::after { inset: 0; }
    .hud-play-btn { width: 48px; height: 48px; }
    /* Derecha: solo silenciar (el volumen fino se deja a los botones del teléfono) */
    .hud-capsule-right { position: absolute; top: 8px; right: 8px; }
    .hud-volume-pill { padding: 0; height: 44px; background: none; border: 0; }
    .hud-vol-btn { width: 44px; height: 44px; }
    .hud-vol-wrap, .hud-overview-pill { display: none; }
    .hud-timeline-row { gap: 8px; font-size: 10px; }
    #tracklist-drawer { bottom: var(--stack-h, 0px); }
  }

  @media (max-width: 480px) {
    #title { max-width: calc(100vw - 232px); }
    #title h1 { font-size: 16px; }
    #title p { display: none; }
    #tracklist-toggle-btn span { display: none; }
    #tracklist-toggle-btn { padding: 0; width: 44px; justify-content: center; }
    #backToHomeBtn { padding: 0 10px; }
    .top-actions { gap: 4px; }
  }

  /* ---------- Móvil horizontal (poca altura): reproductor compacto en una sola fila ---------- */
  @media (max-height: 500px) and (orientation: landscape) {
    :root { --player-bottom: 8px; --player-h: 64px; }
    #title { top: calc(10px + var(--safe-t)); max-width: calc(100vw - 340px); }
    #title h1 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #title p { display: none; }
    .top-actions { top: calc(8px + var(--safe-t)); }
    .btn { height: 44px; }
    #hint { display: none; }
    #player {
      width: min(760px, calc(100vw - 24px - var(--safe-l) - var(--safe-r)));
      height: 64px;
      padding: 0 12px 0 10px;
      gap: 10px;
    }
    .hud-equalizer, .hud-stream-badges { display: none; }
    .hud-title { max-width: 110px; }
    .hud-tagline { display: none; }
    .hud-tagline.is-status { display: block; max-width: 110px; }
    .hud-capsule-center { gap: 0; }
    .hud-play-btn { width: 40px; height: 40px; }
    .hud-timeline-row { font-size: 10px; }
    .hud-progress-wrap { height: 14px; }
    .hud-volume-pill, .hud-overview-pill { height: 34px; }
    .hud-vol-btn { position: relative; }
    .hud-vol-btn::after { content: ''; position: absolute; inset: -8px; }
  }

  @media (prefers-reduced-motion: reduce) {
    #tracklist-drawer, #intro { transition-duration: 0.01s; }
    :root { transition: none; }
    .video-panel, .video-panel.is-open { transition-duration: 0.01s; transform: none; }
    .hud-progress-bar, .hud-progress-thumb { transition: none; }
    .hud-equalizer.playing span { transform: scaleY(0.6); transition: none; }
    .intro-load span { width: 100%; transition: none; }
  }
