:root {
    --primary-color: #6e8efb;
    --secondary-color: #a777e3;
    --bg-color: #0f0c29;
    --card-bg: rgba(255, 255, 255, 0.1);
    --text-color: #ffffff;
    --btn-hover: rgba(255, 255, 255, 0.2);
}

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

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    /* Remove overflow: hidden to allow scrolling on small screens if needed */
    color: var(--text-color);
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.background-anim {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(110, 142, 251, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(167, 119, 227, 0.4) 0%, transparent 50%);
}

.player-card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    width: 380px;
    max-width: 90%;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    text-align: center;
    transition: transform 0.3s ease;
}

@media (max-width: 480px) {
    .player-card {
        width: 95%;
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 14px 20px; /* Larger touch target */
        font-size: 1.1rem;
    }

    .icon-music {
        font-size: 2.5rem;
    }
}

.player-card:hover {
    transform: translateY(-5px);
}

.header {
    margin-bottom: 1.5rem;
}

.icon-music {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

h1 {
    font-weight: 600;
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
    background: linear-gradient(to right, #fff, #ccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    font-weight: 300;
    font-size: 0.9rem;
    opacity: 0.8;
}

.visualizer-container {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mode-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.5);
    position: relative;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: scale(1.1);
}

.mode-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 15px rgba(110, 142, 251, 0.6);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.play-btn {
    background: linear-gradient(135deg, rgba(110, 142, 251, 0.8), rgba(167, 119, 227, 0.8));
    box-shadow: 0 4px 15px rgba(110, 142, 251, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.play-btn:hover {
    box-shadow: 0 6px 20px rgba(110, 142, 251, 0.4);
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(110, 142, 251, 1), rgba(167, 119, 227, 1));
}

.play-btn:active {
    transform: translateY(0);
}

.play-btn.active-song {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    box-shadow: 0 0 15px rgba(0, 198, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 198, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 198, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 198, 255, 0); }
}

.stop-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
}

.stop-btn:hover {
    background: rgba(255, 87, 87, 0.2);
    border-color: rgba(255, 87, 87, 0.5);
    color: #ff6b6b;
}

.status-bar {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-icp {
    position: fixed;
    bottom: 10px;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    z-index: 10;
}

.footer-icp a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-icp a:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
}
