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

:root {
    --primary: #4fc3f7;
    --primary-dark: #0288d1;
    --primary-glow: rgba(79, 195, 247, 0.4);
    --bg: #0a0a14;
    --surface: #12122a;
    --surface-light: #1e1e3a;
    --text: #e8e8f0;
    --text-muted: #7777aa;
    --left-color: #2196f3;
    --left-glow: rgba(33, 150, 243, 0.3);
    --right-color: #ff9800;
    --right-glow: rgba(255, 152, 0, 0.3);
}

.hidden {
    display: none !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    direction: rtl;
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(79, 195, 247, 0.08) 0%, transparent 60%);
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 20px 0 30px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    direction: ltr;
}

.logo-number {
    font-size: 72px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    text-shadow: 0 0 40px var(--primary-glow), 0 0 80px rgba(79, 195, 247, 0.2);
}

.logo-text {
    font-size: 42px;
    font-weight: 700;
    color: var(--text);
}

.tagline {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 18px;
    font-style: italic;
}

/* Main */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Side picker */
.side-picker {
    text-align: center;
}

.side-picker h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text);
}

.side-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.side-btn {
    background: var(--surface);
    border: 2px solid var(--surface-light);
    border-radius: 16px;
    padding: 24px 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 240px;
    min-width: 160px;
}

.side-btn:hover {
    transform: translateY(-3px);
}

.side-btn .side-icon {
    font-size: 40px;
}

.side-btn .side-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.left-btn:hover,
.left-btn.active {
    border-color: var(--left-color);
    box-shadow: 0 0 25px var(--left-glow), inset 0 0 25px var(--left-glow);
}

.left-btn.active .side-label {
    color: var(--left-color);
}

.right-btn:hover,
.right-btn.active {
    border-color: var(--right-color);
    box-shadow: 0 0 25px var(--right-glow), inset 0 0 25px var(--right-glow);
}

.right-btn.active .side-label {
    color: var(--right-color);
}

/* Player */
.player-section.hidden {
    display: none !important;
}

.now-playing {
    text-align: center;
    margin-bottom: 16px;
    font-size: 15px;
    color: var(--text-muted);
    min-height: 24px;
    letter-spacing: 0.5px;
}

.now-playing span {
    animation: fadeIn 0.3s ease;
}

.player {
    width: 300px;
    margin: 0 auto;
    background: linear-gradient(145deg, var(--surface), var(--surface-light));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 32px 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Waveform bars */
.waveform {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: flex-end;
    justify-content: space-evenly;
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.waveform.active {
    opacity: 0.4;
}

.waveform-bar {
    flex: 1;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
    transition: height 0.15s ease;
}

/* Player core — ring + button */
.player-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    z-index: 1;
}

.ring-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-ring {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--surface-light);
    stroke-width: 4;
}

.ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 389.56;
    stroke-dashoffset: 389.56;
    transition: stroke-dashoffset 0.3s linear;
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at 40% 35%, #4fc3f7, var(--primary-dark));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow:
        0 4px 20px var(--primary-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.play-btn:hover {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow:
        0 6px 30px var(--primary-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.play-btn:active {
    transform: translate(-50%, -50%) scale(0.96);
}

.play-btn .icon-play {
    margin-right: -3px;
}

/* Time display */
.time-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    direction: ltr;
    z-index: 1;
}

.time-sep {
    opacity: 0.4;
}

/* Loading spinner */
.loading-spinner {
    position: absolute;
    width: 44px;
    height: 44px;
    border: 3px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Countdown */
.countdown-section {
    text-align: center;
    padding: 0 0 20px 0;
}

.last-update {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 16px;
}

.countdown-section h3 {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 400;
}

.countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    direction: ltr;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    min-width: 80px;
    text-align: center;
    text-shadow: 0 0 20px var(--primary-glow);
}

.countdown-separator {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
    align-self: flex-start;
    animation: blink 1s step-end infinite;
}

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

/* Error message */
.error-msg {
    text-align: center;
    color: #e57373;
    font-size: 14px;
    padding: 8px;
    animation: fadeIn 0.3s ease;
    z-index: 1;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0 10px;
    border-top: 1px solid var(--surface-light);
    margin-top: auto;
}

footer h6 {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

footer p {
    color: var(--text-muted);
    font-size: 14px;
}

.disclaimer {
    margin-top: 6px;
    font-size: 12px !important;
    font-style: italic;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Responsive */
@media (max-width: 500px) {
    .logo-number { font-size: 52px; }
    .logo-text { font-size: 32px; }
    .player { padding: 24px 16px 20px; }
    .ring-container { width: 100px; height: 100px; }
    .progress-ring { width: 100px; height: 100px; }
    .play-btn { width: 72px; height: 72px; }
    .countdown-value { font-size: 36px; }
    .countdown-separator { font-size: 36px; }
    .side-btn { padding: 18px 20px; }
}
