:root {
    --bg-color: #e0e0e0;
    --shadow-light: #ffffff;
    --shadow-dark: #bebebe;
    --text-main: #444;
    --text-dim: #777;
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', -apple-system, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Ajuste para móviles */
    min-height: -webkit-fill-available; 
    min-height: 100vh;
    margin: 0;
    padding: 20px 0; /* Espacio extra para que no se pegue arriba/abajo */
}

.player-container {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 40px;
    box-shadow: 20px 20px 60px var(--shadow-dark), 
                -20px -20px 60px var(--shadow-light);
    width: 90%;      /* Fluido en móviles */
    max-width: 380px; /* Tamaño fijo en PC */
    margin: 20px;
    box-sizing: border-box; /* Asegura que el padding no rompa el ancho */
}

.now-playing { text-align: center; margin-bottom: 2rem; }

.album-art {
    width: 45vw;
    height: 45vw;
    max-width: 180px;
    max-height: 180px;
    background: var(--bg-color);
    border-radius: 30px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 12px 12px 24px var(--shadow-dark), 
                -12px -12px 24px var(--shadow-light);
}

h2 { font-size: 1.2rem; color: var(--text-main); margin: 10px 0 5px; }
p { font-size: 0.9rem; color: var(--text-dim); margin: 0; }

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-bottom: 2.5rem;
}

button {
    border: none;
    background: var(--bg-color);
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent; /* Quita el cuadro azul al tocar en móviles */
}

.btn-main {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    font-size: 1.4rem;
    box-shadow: 8px 8px 16px var(--shadow-dark), 
                -8px -8px 16px var(--shadow-light);
}

.btn-secondary {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 5px 5px 10px var(--shadow-dark), 
                -5px -5px 10px var(--shadow-light);
}

/* Interacción activa común para PC y móvil */
button:active {
    box-shadow: inset 5px 5px 10px var(--shadow-dark), 
                inset -5px -5px 10px var(--shadow-light);
    transform: scale(0.95);
}

/* Solo aplica hover en dispositivos que tienen ratón */
@media (hover: hover) {
    li:hover {
        color: #000;
        background: #e8e8e8;
    }
}

.playlist-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
}

ul {
    list-style: none;
    padding: 0;
    max-height: 180px;
    overflow-y: auto;
    /* Scrollbar más fina para móviles */
    scrollbar-width: thin;
}

li {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
    background: var(--bg-color);
    box-shadow: 3px 3px 6px var(--shadow-dark), 
                -3px -3px 6px var(--shadow-light);
    -webkit-tap-highlight-color: transparent;
}

li.active {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), 
                inset -3px -3px 6px var(--shadow-light);
    color: var(--text-dim);
}

.progress-container, .volume-container {
    margin: 1.5rem 0;
    padding: 0 10px;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    color: var(--text-dim);
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 8px;
}

/* Inputs de rango con soporte móvil */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: var(--bg-color);
    border-radius: 10px;
    box-shadow: inset 4px 4px 8px var(--shadow-dark), 
                inset -4px -4px 8px var(--shadow-light);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--bg-color);
    margin-top: -5px; 
    box-shadow: 3px 3px 6px var(--shadow-dark), 
                -3px -3px 6px var(--shadow-light);
}

.search-container {
    display: flex;
    align-items: center;
    padding: 12px 15px; /* Un poco más de espacio táctil */
    margin-bottom: 1.5rem;
    background: var(--bg-color);
    border-radius: 15px;
    box-shadow: inset 4px 4px 8px var(--shadow-dark), 
                inset -4px -4px 8px var(--shadow-light);
}

#search-input {
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-main);
    width: 100%;
    font-size: 1rem; /* Aumentado a 1rem para evitar zoom automático en iOS */
}

/* Ajustes para pantallas muy pequeñas (iPhone SE, etc.) */
@media (max-width: 360px) {
    .player-container {
        padding: 1.2rem;
    }
    .controls {
        gap: 15px;
    }
    .btn-main {
        width: 60px;
        height: 60px;
    }
    .btn-secondary {
        width: 45px;
        height: 45px;
    }
}