:root {
    --primary-color: #ffffff;
    --text-color: #ffffff;
    --accent-color: #00d2ff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: #0f2027;
    /* Fallback */
    /* User requested background with transparency (30% visibility = 70% overlay) */
    background-image: linear-gradient(rgba(15, 32, 39, 0.7), rgba(15, 32, 39, 0.7)), url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    /* Enable vertical scroll for TS3 content */
    overflow-x: hidden;
}

/* Animated Background - Disabled for Image Background */
.background-animation {
    display: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: move 20s infinite alternate;
}

.c1 {
    width: 300px;
    height: 300px;
    background: #3a7bd5;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.c2 {
    width: 400px;
    height: 400px;
    background: #00d2ff;
    bottom: 10%;
    right: 10%;
    animation-delay: -5s;
}

.c3 {
    width: 250px;
    height: 250px;
    background: #928DAB;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes move {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    /* Allow growth */
    height: auto;
    /* Remove fixed height */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* Glassmorphism Classes */
.glass-header,
.glass-panel,
.glass-footer,
.start-overlay .overlay-content {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

/* Header */
.glass-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 15px;
    margin-bottom: 20px;
}

.logo {
    width: 50px;
    height: auto;
}

.title-group h1 {
    font-size: 1.2rem;
    font-weight: 700;
}

.title-group p {
    font-size: 0.8rem;
    opacity: 0.8;
}

.icon-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

/* Main Player Card */
.player-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    margin-bottom: 20px;
    text-align: center;
}

.ts3-viewer {
    width: 100%;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    overflow-x: auto;
}

.ts3-viewer h3 {
    margin-bottom: 15px;
    color: #00d2ff;
}

.visualizer-container {
    width: 100%;
    height: 150px;
    margin-bottom: 30px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas#audioVisualizer {
    width: 100%;
    height: 100%;
}

.status-overlay {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.status-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.track-info {
    margin-bottom: 40px;
}

.track-info h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.track-info #songTitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: #ffcc00;
    /* Highlight color for song title */
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.track-info p {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.control-btn.primary {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
    background: linear-gradient(135deg, #00d2ff, #3a7bd5);
}

.control-btn.primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.4);
}

.control-btn.primary:active {
    transform: scale(0.95);
}

.control-btn.secondary {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Volume Slider */
.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 200px;
    margin-top: 20px;
}

.volume-container i {
    font-size: 1rem;
    width: 20px;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* Footer */
.glass-footer {
    padding: 15px;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Overlay for Autoplay Policy */
.start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: rgba(15, 32, 39, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s;
}

.start-overlay.active {
    visibility: visible;
    opacity: 1;
}

.start-overlay .overlay-content {
    padding: 40px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.start-overlay i {
    margin-bottom: 20px;
    color: #00d2ff;
}

.pulse-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(0, 210, 255, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 210, 255, 0);
    }
}

/* Responsive */
@media (min-width: 481px) {
    .app-container {
        justify-content: center;
        max-width: 800px;
        flex-direction: row;
        flex-wrap: wrap;
        align-content: center;
        gap: 30px;
        height: auto;
        min-height: 100vh;
    }

    .glass-header {
        width: 100%;
        margin-bottom: 0;
    }

    .player-card {
        width: 100%;
    }

    .glass-footer {
        width: 100%;
    }
}