/* play25 Compiled CSS */
:root { --primary-color: #862633; }
/* PLAY25 CORE CSS - Ottimizzato per WebApp Mobile */
body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background-color: transparent; /* Utile per integrazioni Iframe */
    display: flex; justify-content: center; align-items: center;
}

/* Sfondo sfocato dietro il player */
.blur-background {
    position: absolute; 
    top: -10%; 
    left: -10%; 
    width: 120%; 
    height: 120%;
    
    /* Impostazioni immagine */
    background-size: cover; 
    background-position: center center;
    background-repeat: no-repeat;
    
    /* L'effetto sfocatura */
    filter: blur(15px) brightness(0.8); /* Brightness 0.5 scurisce per far leggere i testi */
    z-index: 0;
    
    /* Transizione morbida quando cambia la canzone */
    transition: background-image 1s ease-in-out;
}

/* --- STRUTTURA VERTICALE BASE (300px) --- */
.player-container {
    position: relative; z-index: 10;
    width: 100%; /* Occupa tutto lo spazio dell'iframe... */
    max-width: 500px; /* ...MA BLOCCA L'ALLARGAMENTO A 320PX! */
    height: 300px; /* ALTEZZA FISSA RICHIESTA */
    display: flex; 
    flex-direction: column; 
    align-items: center;
    justify-content: center; /* Centra tutto il blocco */
    border-radius: 15px; 
    overflow: hidden;
    box-sizing: border-box;
    padding: 10px; /* Margine di respiro interno */
}

/* Copertina (150px) */
.artwork-box {
    width: 150px; 
    height: 150px;
    border-radius: 12px; 
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    margin-bottom: 15px; /* Distanza dai testi */
    flex-shrink: 0; /* Impedisce che si rimpicciolisca */
}
.artwork-box img {
    width: 100%; height: 100%; object-fit: cover;
}

/* Titoli (40px esatti per 2 linee) */
.track-info {
    width: 100%; 
    height: 40px; 
    text-align: center; 
    margin-bottom: 15px; /* Distanza dal tasto play */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
#player-title, #player-artist {
    height: 20px; 
    line-height: 20px; /* Centra il testo nella sua riga */
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; /* Aggiunge i puntini se è troppo lungo */
}
#player-title {
    font-size: 16px; font-weight: bold; color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.7); /* Aggiunta per leggibilità su sfondi chiari */
}
#player-artist {
    font-size: 14px; color: #bbb;
    text-shadow: 0 2px 4px rgba(0,0,0,0.7); /* Aggiunta per leggibilità su sfondi chiari */
}

/* Controlli e Tasto Play (50px) */
.controls {
    height: 50px;
    display: flex; justify-content: center; align-items: center; width: 100%;
}
.btn-play {
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--primary-color, #3498db); 
    color: #fff;
    border: none; cursor: pointer; font-size: 20px;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}
.btn-play:hover { transform: scale(1.05); }
.btn-play:active { transform: scale(0.95); }
/* =========================================
   SKIN: HORIZONTAL (WebApp Banner)
   Testi e Play centrati nello spazio a sx, Cover fissa a dx
========================================= */

.player-container {
    width: 100%;
    max-width: 768px; /* Limite massimo richiesto */
    margin: 0 auto;   /* Centra il player stesso se lo schermo è più largo di 768px */
    height: 110px !important; 
    padding: 0 !important; 
    position: relative;
    border-radius: 10px;
}

/* 1. Tasto Play (Centrato orizzontalmente rispetto allo spazio disponibile) */
.controls {
    position: absolute;
    bottom: 5px;
    width: 50px;
    height: 50px;
    margin: 0;
    /* MATEMATICA DEL CENTRAMENTO:
       Centro dello schermo: 50%
       Meno metà dello spazio occupato dalla cover (110 / 2 = 55px)
       Meno metà della larghezza del bottone stesso (50 / 2 = 25px)
       Totale da sottrarre al 50%: 80px */
    left: calc(50% - 80px);
}

/* 2. Copertina (Fissa a Destra: 0px, Centrata Verticalmente) */
.artwork-box {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100px !important; 
    height: 100px !important;
    margin: 0 !important;
    border-radius: 8px;
}

/* 3. Contenitore Testi (La Gabbia Invisibile a sinistra) */
.track-info {
    width: calc(100% - 110px); /* Prende tutto lo spazio tranne l'area della cover */
    position: absolute;
    left: 0px;    
    top: 0; 
    height: 60px; 
    margin: 0 !important;
    overflow: hidden; 
    display: block !important; 
}

/* 4. Artista (Fermo in alto e Centrato nello spazio disponibile) */
#player-artist {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%; /* Prende il 100% del .track-info */
    margin: 0;
    font-size: 13px;
    line-height: 20px;
    color: #bbb;
    text-align: center; /* Centra perfettamente rispetto allo spazio a sx */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
}

/* 5. Titolo (Fermo di base e Centrato nello spazio disponibile) */
#player-title {
    position: absolute;
    top: 30px; 
    left: 0;
    width: 100%; /* Prende il 100% del .track-info */
    margin: 0;
    font-size: 16px;
    line-height: 20px;
    font-weight: bold;
    text-align: center; /* Centra perfettamente rispetto allo spazio a sx */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
}

/* 6. CLASSE MAGICA (Animazione scorrimento) */
#player-title.is-scrolling {
    width: auto;
    overflow: visible;
    display: inline-block;
    padding-left: 100%;
    animation: scorriTitolo 15s linear infinite;
}

@keyframes scorriTitolo {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}