/* ============================================================
   Rokola Media — Jukebox del inicio
   ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.jb {
  --label: #D0D600;
  position: relative; min-height: 100svh; padding: 0; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 1fr auto;
  grid-template-areas: "now deck" "select select";
  background: #0d0c0d;
}

/* ---------- Video de fondo ---------- */
.jb-stage { position: absolute; inset: 0; z-index: -2; }
.jb-bg {
  position: absolute; inset: -60px; background: center / cover no-repeat;
  filter: blur(46px) saturate(1.3) brightness(.55); transform: scale(1.1);
  opacity: 0; transition: opacity .6s;
}
.jb-bg.show { opacity: 1; }
.jb-vid {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .45s ease; max-width: none;
}
.jb-vid.on { opacity: 1; }
.jb-vid.fit-contain { object-fit: contain; }
.jb-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(13,12,13,.55) 0%, rgba(13,12,13,0) 18%),
    linear-gradient(0deg, rgba(13,12,13,.88) 0%, rgba(13,12,13,.4) 20%, rgba(13,12,13,0) 40%),
    linear-gradient(90deg, rgba(13,12,13,.4) 0%, rgba(13,12,13,0) 38%);
}

/* ---------- Ahora suena ---------- */
.jb-now {
  grid-area: now; align-self: end; padding: 120px 0 26px var(--gut); max-width: 760px;
}
.jb-tag { font-size: 12px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: rgba(232,232,232,.7); margin-bottom: 14px; }
.jb-code { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.jb-code b { color: var(--lima); font-weight: 700; }
.jb-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; margin-right: 4px; }
.jb-eq i { width: 3px; height: 30%; background: var(--lima); border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.jb-eq i:nth-child(2) { animation-delay: -.3s; } .jb-eq i:nth-child(3) { animation-delay: -.6s; } .jb-eq i:nth-child(4) { animation-delay: -.15s; }
.jb.paused .jb-eq i, .jb.scratch .jb-eq i { animation-play-state: paused; }
.jb:not(.loud) .jb-eq i { animation-duration: 2.2s; opacity: .7; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.jb-title {
  font-size: clamp(44px, 6.4vw, 96px); font-weight: 700; letter-spacing: -.035em; line-height: .95;
  margin: 10px 0 12px; text-shadow: 0 4px 40px rgba(0,0,0,.35);
}
.jb-title.swap { animation: titleIn .55s var(--ease) both; }
@keyframes titleIn { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.jb-meta { color: var(--soft); font-size: 16px; }
.jb-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.jb-actions [hidden] { display: none; }
.jb-sound .ico {
  width: 16px; height: 16px; display: inline-block; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3z'/%3E%3Cpath d='M16 8.5a5 5 0 0 1 0 7M19 5.5a9 9 0 0 1 0 13' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3z'/%3E%3Cpath d='M16 8.5a5 5 0 0 1 0 7M19 5.5a9 9 0 0 1 0 13' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.jb:not(.loud) .jb-sound { animation: nudge 2.6s ease-in-out 2.5s infinite; }
@keyframes nudge { 0%, 86%, 100% { transform: none; } 90% { transform: translateY(-3px) scale(1.03); } 95% { transform: translateY(0) scale(.99); } }
.jb.loud .jb-sound { background: transparent; color: var(--lima); border-color: var(--lima); }

/* ---------- Tocadiscos ---------- */
.jb-deck { grid-area: deck; align-self: center; padding: 110px var(--gut) 20px 0; }
.jb-turntable { position: relative; width: clamp(260px, 30vw, 440px); aspect-ratio: 1; }
.jb-vinyl {
  position: absolute; inset: 0; border-radius: 50%; border: 0; padding: 0; background: none;
  cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,.55));
}
.jb.scratch .jb-vinyl { cursor: grabbing; }
.jb-disc {
  position: absolute; inset: 3%; border-radius: 50%; display: block; will-change: transform;
  background: radial-gradient(circle, #1a1a1a 0 31%, #0b0b0b 31.5% 100%);
}
.jb-grooves {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-radial-gradient(circle, rgba(255,255,255,.035) 0 1px, transparent 1px 3px),
    radial-gradient(circle, transparent 0 33%, rgba(255,255,255,.05) 33.4% 34%, transparent 34.5% 62%, rgba(255,255,255,.05) 62.3% 62.8%, transparent 63.2% 97%, rgba(255,255,255,.12) 97.5% 100%);
}
.jb-sheen {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 20deg, transparent 0 8%, rgba(255,255,255,.16) 12%, transparent 18% 50%, rgba(255,255,255,.12) 62%, transparent 68%);
  mix-blend-mode: screen;
}
.jb-label {
  position: absolute; inset: 33.5%; border-radius: 50%; background: var(--label);
  display: grid; place-items: center; transition: background .5s;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.25), inset 0 0 0 9px rgba(255,255,255,.08);
}
.jb-label img { width: 42%; height: auto; opacity: .95; }
.jb[data-side="A"] .jb-label img, .jb[data-side="C"] .jb-label img { filter: invert(1) brightness(.12); }
.jb-label b { position: absolute; bottom: 14%; font-size: clamp(11px, 1vw, 14px); font-weight: 700; letter-spacing: .14em; color: #141314; }
.jb[data-side="B"] .jb-label b { color: #fff; }
.jb-label::after { content: ""; position: absolute; width: 7%; aspect-ratio: 1; border-radius: 50%; background: #0d0c0d; }
.jb-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.jb-ring circle { fill: none; stroke: var(--lima); stroke-width: .6; stroke-dasharray: 100; stroke-dashoffset: 100; stroke-linecap: round; opacity: .9; transition: stroke-dashoffset .25s linear; }
.jb-arm {
  position: absolute; top: -9%; right: -14%; width: 30%; height: auto; pointer-events: none;
  transform-origin: 75% 11.5%; transform: rotate(4deg); transition: transform .5s var(--ease);
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.5));
}
.jb.lift .jb-arm, .jb.paused .jb-arm { transform: rotate(-14deg); }
.arm-base { fill: #262425; stroke: rgba(255,255,255,.15); }
.arm-pivot { fill: var(--lima); }
.arm-rod { fill: none; stroke: #cfcfcf; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.arm-head { fill: #E8E8E8; }
.jb-hint {
  position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%); white-space: nowrap;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: rgba(232,232,232,.65);
  transition: opacity .5s;
}
.jb-hint::before { content: "↻ "; color: var(--lima); }
.jb-hint.gone { opacity: 0; }

/* ---------- Vinilo en reposo: semitransparente y corrido al borde ---------- */
.jb-turntable { transition: opacity .55s var(--ease), transform .7s var(--ease); }
.jb-hint { transition: opacity .5s; }
.jb:not(.awake) .jb-turntable { opacity: .3; transform: translateX(24%) scale(.9); }
.jb:not(.awake) .jb-hint { opacity: 0; }
.jb:not(.awake) .jb-ring circle { opacity: .5; }
@media (hover: hover) {
  .jb-deck:hover .jb-turntable, .jb-deck:focus-within .jb-turntable { opacity: 1; transform: none; }
  .jb-deck:hover .jb-hint { opacity: 1; }
}
.jb.scratch .jb-turntable { opacity: 1; transform: none; }

/* ---------- Selector (tira de discos) ---------- */
.jb-select { grid-area: select; padding: 0 0 22px; min-width: 0; }
.jb-sides { display: flex; align-items: center; gap: 6px; padding: 0 var(--gut) 12px; }
.jb-sides button {
  border: 1px solid var(--line-strong); background: rgba(13,12,13,.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--soft);
  transition: background .25s, color .25s, border-color .25s;
}
.jb-sides button b { color: var(--lima); margin-right: 4px; }
.jb-sides button[aria-selected="true"] { background: var(--text); color: #141314; border-color: var(--text); }
.jb-sides button[aria-selected="true"] b { color: var(--violet); }
.jb-keys { margin-left: auto; font-size: 12px; color: rgba(232,232,232,.5); letter-spacing: .06em; }
.jb-strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px var(--gut) 6px; scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.jb-strip::-webkit-scrollbar { display: none; }
.jb-card {
  flex: 0 0 auto; width: 232px; display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center;
  padding: 8px 12px 8px 8px; border-radius: 14px; border: 1px solid var(--line); text-align: left; cursor: pointer;
  background: rgba(20,19,20,.62); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  position: relative; overflow: hidden; scroll-snap-align: center;
  transition: border-color .25s, background .25s, transform .25s var(--ease);
}
.jb-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.jb-card .th { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #000; }
.jb-card .th img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.jb-card:hover .th img { transform: scale(1.08); }
.jb-card .tx { display: grid; line-height: 1.25; min-width: 0; }
.jb-card .tx b { font-size: 12px; letter-spacing: .14em; color: var(--lima); }
.jb-card .tx span { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-card .tx small { font-size: 12px; color: var(--muted); }
.jb-card .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.jb-card .bar i { display: block; height: 100%; background: var(--lima); transform-origin: left; transform: scaleX(0); }
.jb-card:not(.on) .bar i { transform: scaleX(0) !important; }
.jb-card.on { border-color: var(--lima); background: rgba(30,30,30,.82); }
.jb-card[data-side="B"].on .tx b { color: #b18cff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .jb-turntable { width: clamp(240px, 30vw, 360px); }
}
@media (max-width: 820px) {
  .jb { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; grid-template-areas: "now" "select"; }
  .jb-deck { position: absolute; z-index: 2; top: calc(78px + env(safe-area-inset-top)); right: 14px; padding: 0; }
  .jb-turntable { width: 124px; }
  .jb:not(.awake) .jb-turntable { opacity: .5; transform: translateX(34%) scale(.92); }
  .jb-hint { display: none; }
  .jb-arm { width: 30%; top: -7%; right: -7%; }
  .jb-now { padding: 0 var(--gut) 14px; }
  .jb-title { font-size: clamp(38px, 11vw, 60px); margin: 8px 0 8px; }
  .jb-meta { font-size: 14px; }
  .jb-code { font-size: 12px; letter-spacing: .12em; }
  .jb-tag { display: none; }
  .jb-keys { display: none; }
  .jb-actions { gap: 10px; margin-top: 18px; }
  .jb-vid.fit-contain { object-fit: cover; }
  .jb-bg.show { opacity: 0; }
  .jb-select { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .jb-sides { gap: 6px; padding-bottom: 10px; }
  .jb-sides button { padding: 6px 12px; font-size: 12.5px; }
  .jb-strip { gap: 8px; }
  .jb-card { width: 178px; grid-template-columns: 48px 1fr; gap: 10px; padding: 7px 10px 7px 7px; border-radius: 12px; }
  .jb-card .th { width: 48px; height: 48px; border-radius: 8px; }
  .jb-card .tx span { font-size: 14px; }
  .jb-shade { background: linear-gradient(180deg, rgba(13,12,13,.5) 0%, rgba(13,12,13,0) 20%), linear-gradient(0deg, rgba(13,12,13,.94) 0%, rgba(13,12,13,.55) 32%, rgba(13,12,13,0) 56%); }
  .jb-sound .long { display: none; }
}
@media (min-width: 821px) { .jb-sound .short { display: none; } }
@media (max-width: 820px) and (max-height: 700px) {
  .jb-title { font-size: clamp(34px, 10vw, 48px); }
  .jb-actions { margin-top: 12px; }
  .jb-actions .btn { padding: 10px 16px; }
  .jb-turntable { width: 104px; }
}
@media (max-width: 560px) {
  .jb-actions .btn { padding: 12px 18px; font-size: 13px; }
  .jb-actions #jbFullYt, .jb-actions #jbFullLink { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .jb-title.swap, .jb:not(.loud) .jb-sound, .jb-eq i { animation: none; }
}
