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

:root {
    --bg: #0a0a0a;
    --surface: #161616;
    --red: #e30613;
    --red-hover: #ff1a2a;
    --text: #f0f0f0;
    --text-dim: #888;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    text-align: center;
}

/* Logo / Title */
.logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--red);
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
    font-weight: 400;
}

/* Now Playing */
.now-playing {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border-radius: var(--radius);
    min-height: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

.now-playing-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--red);
    font-weight: 600;
}

.now-playing-title {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    transition: opacity 0.3s;
}

.now-playing-title.updating {
    opacity: 0.4;
}

/* Play Button */
.play-btn {
    margin-top: 2rem;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--red);
    background: transparent;
    color: var(--red);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.1s;
}

.play-btn:hover {
    background: var(--red);
    color: var(--bg);
}

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

.play-btn svg {
    width: 36px;
    height: 36px;
}

.play-btn .icon-play {
    margin-left: 3px; /* optical center for triangle */
}

/* Loading spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.icon-loading {
    animation: spin 1s linear infinite;
}

/* Quality Selector */
.quality-selector {
    margin-top: 1.5rem;
    display: flex;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #333;
}

.quality-btn {
    flex: 1;
    padding: 0.55rem 0.25rem;
    border: none;
    background: var(--surface);
    color: var(--text-dim);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    line-height: 1;
}

.quality-btn + .quality-btn {
    border-left: 1px solid #333;
}

.quality-btn:hover {
    background: #222;
    color: var(--text);
}

.quality-btn.active {
    background: var(--red);
    color: #fff;
}

.quality-btn .bitrate {
    font-size: 0.6rem;
    font-weight: 400;
    opacity: 0.7;
}

.quality-btn.active .bitrate {
    opacity: 0.9;
}

/* Status */
.status {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    min-height: 1.2em;
    transition: color 0.3s;
}

.status.error {
    color: var(--red);
}

/* Responsive */
@media (max-width: 480px) {
    .player {
        padding: 2rem 1.25rem;
    }

    .logo {
        font-size: 1.6rem;
    }

    .play-btn {
        width: 70px;
        height: 70px;
    }

    .play-btn svg {
        width: 30px;
        height: 30px;
    }

    .quality-btn {
        padding: 0.5rem 0.15rem;
        font-size: 0.65rem;
    }
}
