/* ========================================
DEL OSCURO SUR — REPRODUCTOR
======================================== */

/* Base */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  }

body {
    min-height: 100vh;

    background:
        radial-gradient(
            ellipse at 50% 38%,
            rgba(0, 0, 0, 0.035) 0%,
            transparent 65%
        ),
        #fff;

    color: #111;
    font-family: "Trebuchet MS", Arial, sans-serif;

    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.player {
    width: min(90vw, 650px);
    margin: 0 auto;
    padding: 16px 0 24px;
}


/* Identidad de la banda */
h1 {
font-size: 14px;
font-weight: 400;
letter-spacing: 0.38em;
line-height: 1.8;
margin-bottom: 18px;
text-transform: uppercase;
transition: opacity 0.3s ease;
    text-align: center;
}

h1::after {
content: "";
display: block;
width: 28px;
height: 1px;
margin: 14px auto 0;
background: currentColor;
opacity: 0.55;
}

/* Caras A y B */
.sides {
display: flex;
justify-content: center;
gap: 18px;
margin-bottom: 25px;
}

.side {
border: none;
background: transparent;
color: #777;
font-size: 10px;
letter-spacing: 0.15em;
min-height: 44px;
padding: 10px 12px;
cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-text-fill-color: currentColor;
}

.side.active {
color: #111;
font-weight: 600;
}

.side:hover {
color: #111;
}

/* Vinilo */
.record {
position: relative;
isolation: isolate;
overflow: hidden;
width: min(72vw, 460px);
aspect-ratio: 1 / 1;
margin: 0 auto 50px;
border-radius: 50%;
background:
radial-gradient(
circle at 50% 50%,
#292929 0%,
#111 12%,
#191919 12.5%,
#101010 25%,
#191919 25.5%,
#101010 40%,
#191919 40.5%,
#101010 55%,
#191919 55.5%,
#101010 70%,
#191919 70.5%,
#101010 85%,
#191919 85.5%,
#101010 100%
);
box-shadow:
0 8px 25px rgba(0, 0, 0, 0.18),
inset 0 0 22px rgba(255, 255, 255, 0.025);
display: flex;
justify-content: center;
align-items: center;
}

/* Reflejo sutil sobre los surcos */
.record::before {
content: "";
position: absolute;
inset: 0;
border-radius: 50%;
pointer-events: none;
z-index: 1;
background: conic-gradient(
from 0deg,
transparent 0deg,
rgba(255, 255, 255, 0.04) 45deg,
transparent 90deg,
rgba(255, 255, 255, 0.02) 180deg,
transparent 270deg,
rgba(255, 255, 255, 0.04) 315deg,
transparent 360deg
);
}

/* Atmósfera del vinilo */
.record::after {
content: "";
position: absolute;
inset: -12%;
z-index: -1;
border-radius: 50%;
background: radial-gradient(
circle,
rgba(0, 0, 0, 0.045) 0%,
transparent 70%
);
pointer-events: none;
}

/* Etiqueta central */
.label {
position: relative;
z-index: 2;
width: 30%;
height: 30%;
border-radius: 50%;
overflow: hidden;
background: #111;
box-shadow: 0 0 0 1px #222;
flex-shrink: 0;
}

.label img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
transition: opacity 0.2s ease;
}

/* Lista de canciones */
.songs {
width: 100%;
margin-bottom: 35px;
}

.song {
width: 100%;
min-height: 44px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 2px;
border: none;
border-bottom: 1px solid #dedede;
background: transparent;
color: #111;
font-size: 12px;
letter-spacing: 0.12em;
cursor: pointer;
transition: opacity 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-text-fill-color: currentColor;
}

.song:active {
    color: inherit;
    background: transparent;
}

.song:focus:not(:focus-visible),
.side:focus:not(:focus-visible) {
    outline: none;
}

.song:first-child {
border-top: 1px solid #dedede;
}

.song:hover {
opacity: 0.55;
}

/* Numeración editorial */

.song span:first-child {
  min-width: 28px;
  text-align: left;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  opacity: 0.45;
  font-variant-numeric: tabular-nums;
}

.song span:nth-child(2) {
  flex: 1;
  text-align: left;
  padding-left: 8px;
  letter-spacing: 0.16em;
}

/* Identificación de la banda */

.song .song-label {
  flex: 0 0 42px;
  text-align: right;
  padding-left: 8px;
  font-size: 9px;
  letter-spacing: 0.12em;
  opacity: 0.55;
}

/* Duración del tema */

.song .song-duration {
  flex: 0 0 42px;
  text-align: right;
  padding-left: 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  opacity: 0.65;
}

/* Canción seleccionada */

.song.active {
  opacity: 1;
  font-weight: 600;
}

.song.active span:first-child {
  opacity: 1;
}

.song.active span:first-child::before {
  content: "↗";
  display: inline-block;
  font-size: 11px;
  margin-right: 9px;
  vertical-align: baseline;
}
.song span:nth-child(2) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song .song-label {
    flex-basis: 36px;
    font-size: 8px;
}

.song .song-duration {
    flex-basis: 38px;
    font-size: 10px;
}
/* Controles */
.controls {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 8px;
}

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

.transport-controls button {
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
width: 38px;
height: 38px;
flex: 0 0 38px;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid currentColor;
border-radius: 50%;
background: transparent;
color: inherit;
    -webkit-text-fill-color: currentColor;
cursor: pointer;
font-family: inherit;
font-size: 10px;
    line-height: 1;
    padding: 0;
transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.transport-controls svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: currentColor;
    pointer-events: none;
}

.transport-controls button:hover {
background: #111;
color: #fff;
}

.transport-controls button:focus-visible,
.side:focus-visible,
.song:focus-visible,
.web-entry:focus-visible,
.progress:focus-visible {
outline: 2px solid currentColor;
outline-offset: 3px;
}

#stopButton { opacity: 0.75; }
#stopButton:hover { opacity: 1; }

.progress {
--track-color: #ddd;
--progress: 0%;
-webkit-appearance: none;
appearance: none;
flex: 1;
min-width: 0;
height: 24px;
border: 0;
background:
    linear-gradient(
        to right,
        currentColor 0%,
        currentColor var(--progress),
        var(--track-color) var(--progress),
        var(--track-color) 100%
    ) center / 100% 2px no-repeat;
cursor: pointer;
touch-action: pan-y;
}

.progress::-webkit-slider-runnable-track {
height: 24px;
background: transparent;
}

.progress::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 12px;
height: 12px;
margin-top: 6px;
border: 0;
border-radius: 50%;
background: currentColor;
}

.progress::-moz-range-track {
height: 24px;
border: 0;
background: transparent;
}

.progress::-moz-range-progress {
height: 2px;
background: transparent;
}

.progress::-moz-range-thumb {
width: 12px;
height: 12px;
border: 0;
border-radius: 50%;
background: currentColor;
}

.progress:disabled {
cursor: default;
opacity: 0.45;
}

#time {
width: 40px;
font-size: 11px;
text-align: right;
font-variant-numeric: tabular-nums;
}

.playback-status {
min-height: 1.4em;
margin: 0 0 12px;
color: #666;
font-size: 11px;
line-height: 1.4;
}

.playback-status[data-state="error"] { color: #a22b24; }
body.side-b .playback-status { color: #bbb; }
body.side-b .playback-status[data-state="error"] { color: #ffaaa4; }

/* Mensaje de auriculares */
.headphones {
width: fit-content;
max-width: 100%;
margin: 12px auto 28px;
padding: 10px 15px;
border: 1px solid rgba(162, 43, 36, 0.32);
border-radius: 4px;
background: rgba(162, 43, 36, 0.07);
color: #333;
font-size: clamp(11px, 2vw, 12px);
font-weight: 600;
letter-spacing: 0.01em;
line-height: 1.6;
text-align: center;
}

.headphones-icon {
display: inline-block;
width: 22px;
height: 22px;
margin: 0 0.35em;
color: #a22b24;
vertical-align: middle;
}

.headphones-icon path,
.headphones-icon rect {
fill: none;
stroke: currentColor;
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 1.8;
}

/* Acceso preparado para la web principal */
.web-entry {
display: flex;
align-items: center;
justify-content: center;
width: fit-content;
margin: 0 auto;
gap: 18px;
min-height: 48px;
padding: 13px 22px;
border: 1px solid #a22b24;
border-radius: 3px;
background: #a22b24;
box-shadow: 0 7px 18px rgba(162, 43, 36, 0.2);
color: #fff;
font: inherit;
font-size: 10px;
font-weight: 700;
letter-spacing: 0.16em;
cursor: pointer;
text-decoration: none;
color: #fff;
}

.web-entry-arrow {
font-size: 16px;
line-height: 1;
}

.web-entry-note {
display: block;
margin-top: 8px;
color: #777;
font-size: 8px;
letter-spacing: 0.2em;
text-align: center;
}

.player-footer {
display: flex;
flex-direction: column;
align-items: center;
gap: 7px;
margin-top: 20px;
color: #777;
font-size: 9px;
letter-spacing: 0.1em;
line-height: 1.6;
text-align: center;
}

.player-footer a {
color: #555;
text-decoration: underline;
text-decoration-color: rgba(162, 43, 36, 0.45);
text-underline-offset: 3px;
}

.player-footer a:hover,
.player-footer a:focus-visible {
color: #a22b24;
}

/* ========================================
CARA B — ESTILO OSCURO
======================================== */

body.side-b {
background:
radial-gradient(
ellipse at 50% 38%,
rgba(255, 255, 255, 0.045) 0%,
transparent 65%
),
#111;
color: #fff;
}

body.side-b h1 {
color: #fff;
}

body.side-b .side {
color: #777;
}

body.side-b .side.active,
body.side-b .side:hover {
color: #fff;
}

body.side-b .record {
background:
radial-gradient(
circle at center,
#444 0 5%,
#333 5.5%,
#3a3a3a 6%,
#333 20%,
#3a3a3a 20.5%,
#333 21%,
#3a3a3a 35%,
#333 35.5%,
#3a3a3a 50%,
#333 50.5%,
#3a3a3a 65%,
#333 65.5%,
#3a3a3a 80%,
#333 80.5%,
#3a3a3a 100%
);
box-shadow: 0 8px 30px rgba(255, 255, 255, 0.12);
}

body.side-b .record::after {
background: radial-gradient(
circle,
rgba(255, 255, 255, 0.045) 0%,
transparent 70%
);
}

body.side-b .song {
color: #fff;
border-color: #333;
}

body.side-b .song.active {
color: #fff;
}

body.side-b #playButton {
background: transparent;
color: #fff;
border-color: #fff;
}

body.side-b .transport-controls button {
    color: #fff;
    border-color: #fff;
}

body.side-b .transport-controls button:hover {
    background: #fff;
    color: #111;
}

body.side-b #playButton:hover {
background: #fff;
color: #111;
}

body.side-b .progress {
--track-color: #333;
color: #fff;
}

body.side-b #time {
color: #fff;
}

body.side-b .headphones {
border-color: rgba(255, 116, 104, 0.42);
background: rgba(255, 255, 255, 0.055);
color: #e5e5e5;
}

body.side-b .headphones-icon {
color: #ff8178;
}

body.side-b .web-entry {
border-color: #e45148;
background: #b6332a;
box-shadow: 0 7px 20px rgba(230, 70, 60, 0.25);
}

body.side-b .player-footer {
color: #999;
}

body.side-b .player-footer a {
color: #ccc;
text-decoration-color: rgba(255, 116, 104, 0.6);
}

body.side-b .player-footer a:hover,
body.side-b .player-footer a:focus-visible {
color: #ff8178;
}

/* Mostrar solamente las canciones de la cara seleccionada */
.side-b-songs {
display: none;
}

body.side-b .side-a-songs {
display: none;
}

body.side-b .side-b-songs {
display: block;
}

/* ========================================
DISEÑO PARA CELULARES
======================================== */

@media (max-width: 500px) {
body {
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 20px;
}

.player {
    width: 88vw;
    max-width: 420px;
}

h1 {
    font-size: 13px;
    margin-bottom: 10px;
}

.album-title {
    min-height: 18px;
    margin-top: 2px;
    margin-bottom: 12px;
}
.record {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    position: relative;
    overflow: hidden;

    background:
        repeating-radial-gradient(
            circle at center,
            #111 0px,
            #171717 2px,
            #0a0a0a 4px,
            #1c1c1c 5px,
            #101010 7px
        );

    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.25),
        0 12px 28px rgba(0, 0, 0, 0.18),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);

    transform: rotate(0deg);
}

/* Reflejo sutil sobre la superficie */
.record::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;

    background:
        conic-gradient(
            from 210deg,
            transparent 0deg,
            rgba(255, 255, 255, 0.025) 45deg,
            rgba(255, 255, 255, 0.12) 90deg,
            transparent 145deg,
            rgba(255, 255, 255, 0.035) 220deg,
            transparent 300deg
        );

    mix-blend-mode: screen;
}

/* Luz ambiental muy tenue */
.record::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;

    background:
        radial-gradient(
            circle at 35% 28%,
            rgba(255, 255, 255, 0.07),
            transparent 38%
        ),
        radial-gradient(
            circle at center,
            transparent 55%,
            rgba(0, 0, 0, 0.4) 100%
        );
}
.sides {
    gap: 24px;
    margin-bottom: 22px;
}

.side {
    border: none;
    background: transparent;
    color: #777;
    font-size: 10px;
    letter-spacing: 0.15em;
    padding: 8px 5px;
    cursor: pointer;
}

.side.active {
    color: #111;
    font-weight: 600;
}

.song {
    min-height: 44px;
    padding: 13px 2px;
    font-size: 12px;
}

.controls {
    display: flex;
    gap: clamp(4px, 1.5vw, 8px);
}

.transport-controls {
    justify-content: flex-start;
    gap: clamp(4px, 1.3vw, 8px);
}

.transport-controls button {
    width: clamp(36px, 10vw, 42px);
    height: clamp(36px, 10vw, 42px);
    flex-basis: clamp(36px, 10vw, 42px);
}

.progress {
    flex: 1 1 auto;
    min-width: 48px;
    height: 28px;
}

#time {
    flex: 0 0 42px;
    width: 42px;
    font-size: 11px;
}

.headphones {
    line-height: 1.6;
    margin-bottom: 24px;
}

.web-entry {
    width: min(100%, 320px);
}

}

@media (max-width: 320px) {
    .controls,
    .transport-controls {
        gap: 4px;
    }

    .transport-controls button {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .progress { min-width: 40px; }

    #time {
        flex-basis: 36px;
        width: 36px;
    }
}

/* Reducir movimiento si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
.record {
animation-duration: 8s;
}

.label img,
h1,
#playButton,
.transport-controls button,
.song {
    transition: none;
}

.record,
.tonearm {
    animation: none !important;
    transition: none !important;
}
}
/* Título del álbum */

.album-title {
min-height: 18px;
margin-top: 8px;
margin-bottom: 24px;
font-size: 10px;
font-weight: 400;
letter-spacing: 0.28em;
line-height: 1.8;
text-align: center;
color: #777;
text-transform: uppercase;
transition: color 0.3s ease;
}

/* Adaptación a la cara B */
body.side-b .album-title {
color: #aaa;
}


/* ========================================
   DOS — BRAZO HI-FI DEL TOCADISCOS
======================================== */

.turntable {
    width: min(72vw, 460px);
    margin: 12px auto 20px;
    position: relative;
}


.turntable .record {
    position: relative;
    width: 100%;
    margin: 0;
}

/* Conjunto completo del brazo */
.tonearm {
    position: absolute;
    z-index: 5;
    top: 5%;
    right: 8%;
    width: 25%;
    height: 38%;

    pointer-events: none;

    transform: rotate(0deg);
    transform-origin: 85% 10%;

    filter: drop-shadow(2px 3px 3px rgba(0, 0, 0, 0.22));

    transition:
        transform 1s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.4s ease;
}

/* Base del mecanismo */
.tonearm-pivot {
    position: absolute;
    top: 3%;
    right: 7%;

    width: 19%;
    aspect-ratio: 1;
    border-radius: 50%;

    background:
        radial-gradient(
            circle at 30% 25%,
            #ffffff 0%,
            #e1e1e1 7%,
            #b4b4b4 19%,
            #858585 37%,
            #555555 58%,
            #303030 78%,
            #171717 100%
        );

    border: 1px solid #555;

    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.8),
        inset 0 -2px 3px rgba(0, 0, 0, 0.5);

    z-index: 4;
}

/* Centro de la articulación */
.tonearm-pivot::after {
    content: "";

    position: absolute;
    top: 35%;
    left: 35%;

    width: 30%;
    height: 30%;

    border-radius: 50%;
    border: 1px solid rgba(30, 30, 30, 0.8);

    background:
        radial-gradient(
            circle at 30% 25%,
            #f4f4f4 0%,
            #b1b1b1 25%,
            #666666 60%,
            #292929 100%
        );

    box-shadow:
        0 0 2px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

/* Tubo de aluminio */
.tonearm-arm {
    position: absolute;
    top: 11%;
    right: 13%;

    width: 5px;
    height: 98%;

    border-radius: 4px;

    background:
        linear-gradient(
            90deg,
            #242424 0%,
            #4a4a4a 12%,
            #858585 28%,
            #eeeeee 43%,
            #c5c5c5 51%,
            #858585 69%,
            #454545 86%,
            #252525 100%
        );

    border: 0.3px solid rgba(255, 255, 255, 0.25);

    box-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.35),
        -1px 0 1px rgba(255, 255, 255, 0.15);

    transform: rotate(-25deg);
    transform-origin: top center;

    z-index: 2;
}

/* Contrapeso trasero del brazo */
.tonearm-arm::before {
    content: "";

    position: absolute;
    top: -5%;
    left: 50%;

    width: 9px;
    height: 15px;

    border-radius: 4px;

    background:
        linear-gradient(
            90deg,
            #292929 0%,
            #666666 22%,
            #bdbdbd 42%,
            #858585 62%,
            #303030 100%
        );

    border: 1px solid #444;

    box-shadow:
        1px 2px 3px rgba(0, 0, 0, 0.35);

    transform: translateX(-50%);
}

/* Cápsula fonográfica */
.tonearm-head {
    position: absolute;
    left: 50%;
    bottom: -2px;

    width: 14px;
    height: 19px;

    border: 1px solid #242424;
    border-radius: 3px 3px 4px 4px;

    background:
        linear-gradient(
            90deg,
            #151515 0%,
            #343434 18%,
            #777777 42%,
            #454545 63%,
            #202020 100%
        );

    box-shadow:
        1px 2px 3px rgba(0, 0, 0, 0.45),
        inset 0 1px 1px rgba(255, 255, 255, 0.25);

    transform: translateX(-50%) rotate(25deg);

    z-index: 3;
}

/* Púa */
.tonearm-needle {
    position: absolute;
    left: 50%;
    bottom: -4px;

    width: 1px;
    height: 6px;

    background:
        linear-gradient(
            90deg,
            #444444,
            #e0e0e0,
            #555555
        );

    box-shadow:
        0 1px 1px rgba(0, 0, 0, 0.4);

    transform: translateX(-50%);
}

/* Posición de reposo */
.tonearm {
    --track-angle: 0deg;
    --song-angle: 8deg;

    transform: rotate(0deg);
    transform-origin: 85% 10%;

    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Brazo sobre el disco */
.tonearm.is-playing {
    transform: rotate(calc(var(--song-angle, 8deg) + var(--track-angle, 0deg)));
    transition: transform 0.4s linear;
}

/* ========================================
   DOS — DETALLES MECÁNICOS DEL BRAZO
======================================== */

/* Anillo exterior de la articulación */
.tonearm-pivot {
    outline: 2px solid rgba(75, 75, 75, 0.22);
    outline-offset: 2px;
}

/* Contrapeso cilíndrico en la parte superior */
.tonearm-arm::before {
    content: "";
    position: absolute;

    top: -3%;
    left: 50%;

    width: 9px;
    height: 15px;

    border: 1px solid #444;
    border-radius: 4px;

    background:
        linear-gradient(
            90deg,
            #252525 0%,
            #666 20%,
            #d0d0d0 42%,
            #858585 62%,
            #303030 100%
        );

    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.35);

    transform: translateX(-50%);
}

/* Pequeño portacápsulas */
.tonearm-head::before {
    content: "";
    position: absolute;

    top: -5px;
    left: 50%;

    width: 7px;
    height: 5px;

    border-radius: 2px 2px 0 0;

    background:
        linear-gradient(
            90deg,
            #222,
            #aaa 45%,
            #444
        );

    transform: translateX(-50%);
}

/* Reflejo sobre el cabezal */
.tonearm-head::after {
    content: "";
    position: absolute;

    top: 3px;
    left: 2px;

    width: 2px;
    height: 8px;

    border-radius: 2px;

    background: rgba(255, 255, 255, 0.22);
}
/* Lista de temas: estética editorial */
.song {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.13);
    transition:
        background 0.2s ease,
        color 0.2s ease,
        padding-left 0.2s ease;
}

/* Transición sutil al pasar el cursor */
.song:hover {
    background: rgba(0, 0, 0, 0.035);
}

/* Cara B: adaptamos los detalles al fondo oscuro */
body.side-b .song {
    border-bottom-color: rgba(255, 255, 255, 0.18);
}

body.side-b .song:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Respeta a quienes prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .song {
        transition: none;
    }
}
