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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 2rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    width: 150px;
    height: 150px;
    margin-bottom: 0.75rem;
}

@media (max-width: 480px) {
    .logo {
        width: 280px;
        height: 280px;
    }
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ── Stream cards ── */
.streams {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stream-card {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    transition: all 0.25s ease;
    overflow: hidden;
}

/* Top row: name + play button */
.stream-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stream-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stream-name {
    font-size: 1.15rem;
    font-weight: 600;
}

/* Live dot */
.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #475569;
    flex-shrink: 0;
    transition: background 0.3s;
}

.stream-card.live .live-dot {
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e88;
    animation: pulse 1.5s ease-in-out infinite;
}

.stream-card.playing .live-dot {
    background: #ef4444;
    box-shadow: 0 0 6px #ef444488;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.8); }
}

/* Play / Stop button */
.play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #334155;
    color: #64748b;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

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

.play-btn .icon-stop { display: none; }
.play-btn .icon-play { display: block; }

.stream-card.live .play-btn {
    background: #3b82f6;
    color: #fff;
    cursor: pointer;
}

.stream-card.live .play-btn:hover {
    background: #2563eb;
    transform: scale(1.08);
}

.stream-card.playing .play-btn {
    background: #ef4444;
    color: #fff;
    cursor: pointer;
}

.stream-card.playing .play-btn:hover {
    background: #dc2626;
    transform: scale(1.08);
}

.stream-card.playing .play-btn .icon-play { display: none; }
.stream-card.playing .play-btn .icon-stop { display: block; }

/* Bottom row: status + volume */
.stream-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    transition: all 0.25s ease;
    overflow: hidden;
}

.stream-card.live .stream-bottom,
.stream-card.buffering .stream-bottom,
.stream-card.playing .stream-bottom {
    margin-top: 0.75rem;
    max-height: 40px;
    opacity: 1;
}

.stream-status {
    font-size: 0.8rem;
    color: #64748b;
    flex-shrink: 0;
}

.stream-card.live .stream-status {
    color: #22c55e;
}

.stream-card.playing .stream-status {
    color: #ef4444;
}

/* Volume */
.volume-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}

.stream-card.playing .volume-wrap {
    opacity: 1;
    pointer-events: auto;
}

.volume-icon {
    width: 16px;
    height: 16px;
    color: #94a3b8;
    flex-shrink: 0;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 5px;
    border-radius: 3px;
    background: #334155;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
}

/* Buffering state */
.stream-card.buffering {
    border-color: #f59e0b88;
}

.stream-card.buffering .live-dot {
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b88;
    animation: none;
}

.stream-card.buffering .play-btn {
    background: #f59e0b;
    color: #fff;
    cursor: pointer;
    animation: spin 1s linear infinite;
}

.stream-card.buffering .play-btn .icon-play { display: none; }
.stream-card.buffering .play-btn .icon-stop { display: block; }

.stream-card.buffering .stream-status {
    color: #f59e0b;
}

.stream-card.buffering .volume-wrap {
    opacity: 0;
    pointer-events: none;
}

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

/* Offline state */
.stream-card.offline {
    opacity: 0.5;
}

.stream-card.offline .stream-name {
    color: #64748b;
}

/* Active card highlight */
.stream-card.playing {
    border-color: #ef4444;
    background: #1e293b;
}

.stream-card.live {
    border-color: #22c55e44;
}
