:root {
    --bg-primary: #f0f4ff;
    --bg-secondary: #e8edf8;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f0ff;
    --accent: #7c5cfc;
    --accent-light: #a78bfa;
    --accent-pink: #e879a8;
    --accent-bg: rgba(124, 92, 252, 0.08);
    --accent-bg-strong: rgba(124, 92, 252, 0.15);
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --progress-track: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 20px rgba(124, 92, 252, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 16px;
}

.container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 32px;
}

/* Header */
.header {
    text-align: center;
    padding: 28px 0 12px;
}

.header-icon {
    font-size: 44px;
    line-height: 1;
    margin-bottom: 10px;
    color: var(--accent);
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.header-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Cards */
.now-playing,
.timer-section,
.playlist-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--accent);
    font-size: 15px;
}

/* Now Playing */
.now-playing-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.track-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

/* Progress Bar */
.progress-wrapper {
    width: 100%;
    padding: 8px 0;
}

.progress-bar {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--progress-track);
    outline: none;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(124, 92, 252, 0.15);
    transition: transform 0.15s, box-shadow 0.15s;
}

.progress-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(124, 92, 252, 0.2);
}

.progress-bar::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 0 4px rgba(124, 92, 252, 0.15);
}

.progress-bar::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: var(--progress-track);
}

/* Time */
.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

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

.btn-control,
.btn-play {
    border: none;
    background: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-control {
    font-size: 22px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
}

.btn-control:hover {
    color: var(--accent);
    background: var(--accent-bg);
    transform: scale(1.05);
}

.btn-play {
    font-size: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.btn-play:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(124, 92, 252, 0.3);
}

.btn-play.playing {
    animation: pulse-glow 2.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 20px rgba(124, 92, 252, 0.2); }
    50% { box-shadow: 0 4px 32px rgba(124, 92, 252, 0.4); }
}

/* Secondary Controls */
.secondary-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.btn-repeat {
    border: none;
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-repeat:hover {
    background: var(--accent-bg);
}

.btn-repeat.active {
    color: var(--accent);
    background: var(--accent-bg-strong);
}

.btn-repeat i {
    font-size: 14px;
}

.repeat-one-badge {
    display: none;
    font-size: 9px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    line-height: 14px;
    text-align: center;
    margin-left: -4px;
}

.btn-repeat.repeat-one .repeat-one-badge {
    display: inline-block;
}

/* Volume */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 160px;
}

.volume-btn {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.volume-btn:hover {
    color: var(--accent);
}

.volume-bar {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--progress-track);
    outline: none;
    cursor: pointer;
}

.volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
}

.volume-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
}

.volume-bar::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: var(--progress-track);
}

/* Timer */
.timer-inputs {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.timer-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.timer-input-group input {
    width: 64px;
    height: 48px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text);
    font-size: 22px;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.timer-input-group input:focus {
    border-color: var(--accent);
}

.timer-input-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.timer-colon {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-muted);
    padding-bottom: 24px;
}

.btn-timer-start {
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    padding: 0 20px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-timer-start:hover {
    background: var(--accent-light);
    transform: scale(1.02);
}

.timer-running {
    text-align: center;
}

.timer-countdown {
    font-size: 42px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    margin-bottom: 4px;
}

.timer-remaining-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.btn-timer-cancel {
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-timer-cancel:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

.timer-ended {
    text-align: center;
    color: #16a34a;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
}

.timer-ended i {
    margin-right: 4px;
}

/* Playlist */
.playlist {
    list-style: none;
}

.playlist li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.playlist li:hover {
    background: var(--bg-card-hover);
}

.playlist li.active {
    background: var(--accent-bg);
}

.track-number {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

.playlist li.active .track-number {
    background: var(--accent);
    color: #fff;
}

.track-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.playlist li.active .track-name {
    color: var(--accent);
    font-weight: 600;
}

.track-icon {
    color: var(--text-muted);
    font-size: 13px;
}

.playlist li.active .track-icon {
    color: var(--accent);
}

.equalizer {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 18px;
}

.playlist li.active.playing .equalizer {
    display: flex;
}

.playlist li.active.playing .track-number {
    display: none;
}

.eq-bar {
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    animation: eq 0.8s ease-in-out infinite;
}

.eq-bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.eq-bar:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.eq-bar:nth-child(3) { height: 40%; animation-delay: 0.4s; }
.eq-bar:nth-child(4) { height: 80%; animation-delay: 0.1s; }

@keyframes eq {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}

/* Responsive */
@media (max-width: 400px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }

    .timer-inputs {
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn-timer-start {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
        justify-content: center;
    }
}
