:root {
    --primary-color: #FF5722;
    --dark-bg: #121212;
    --card-bg: #1E1E1E;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden; /* Evitar scroll global */
}

/* Splash Screen */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
}

#splash-screen img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* CRÍTICO: Evita que se vea borrosa o recortada */
    max-width: 800px;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: absolute;
    bottom: 50px;
}

#loading-text {
    position: absolute;
    bottom: 20px;
    color: white;
    font-size: 14px;
}

#start-btn {
    position: absolute;
    bottom: 40px;
    padding: 15px 40px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.4);
    z-index: 10000;
    transition: transform 0.2s, background-color 0.2s;
    animation: pulse 2s infinite;
}

#start-btn:active {
    transform: scale(0.95);
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 87, 34, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 87, 34, 0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* App Container */
#app-container {
    width: 100%;
    max-width: 400px;
    height: 100vh; /* Full height en móviles */
    background-color: var(--card-bg);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    position: relative;
    transition: opacity 0.3s ease;
}

@media (min-width: 450px) {
    #app-container {
        height: auto;
        min-height: 700px;
        border-radius: 20px;
        margin: 20px;
    }
}

.hidden {
    display: none !important;
}

/* Header */
header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #FF5722 0%, #FF8A65 100%);
}

.header-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid white;
}

.header-info h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.status-badge {
    background-color: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.cover-wrapper {
    width: 280px;
    height: 280px;
    margin: 20px 0;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background-color: #000;
}

#album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.track-details {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

#track-title {
    font-size: 22px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#track-artist {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 4px;
}

#track-album {
    font-size: 14px;
    color: #888;
    font-weight: 300;
}

/* Visualizer */
#visualizer-container {
    width: 100%;
    height: 60px;
    margin-bottom: 20px;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.play-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.4);
    transition: transform 0.1s, background-color 0.2s;
}

.play-button:active {
    transform: scale(0.95);
}

.play-button.playing {
    background-color: #E64A19;
}

/* Volume */
.volume-container {
    display: flex;
    align-items: center;
    width: 80%;
    max-width: 250px;
    gap: 10px;
}

.volume-icon {
    font-size: 20px;
}

input[type=range] {
    width: 100%;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Footer */
footer {
    padding: 15px;
    text-align: center;
    font-size: 12px;
    color: #666;
    background-color: rgba(0,0,0,0.1);
}
