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

:root {
    --primary: #2D6B4A;
    --primary-dark: #1B4D3A;
    --secondary: #B89B5E;
    --accent-blue: #4A90D9;
    --bg-dark: #0F2318;
    --bg-card: #162E22;
    --bg-card-hover: #1E3A2A;
    --text-primary: #E8F0E0;
    --text-secondary: #8BA87A;
    --text-muted: #5A7A5A;
    --success: #4CAF50;
    --warning: #F39C12;
    --danger: #E74C3C;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

button {
    font-family: inherit;
}

[hidden] {
    display: none !important;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: min(100%, 420px);
    padding: 36px;
    background: rgba(22, 46, 34, 0.94);
    border: 1px solid rgba(184, 155, 94, 0.35);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.login-logo {
    display: block;
    width: 88px;
    height: 88px;
    object-fit: contain;
    margin: 0 auto 14px;
}

.login-kicker,
.admin-kicker {
    color: var(--secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-card h1 {
    margin: 6px 0 8px;
    text-align: center;
    font-size: 1.75rem;
}

.login-description,
.login-hint {
    color: var(--text-secondary);
    line-height: 1.5;
}

.login-description {
    margin-bottom: 24px;
    text-align: center;
}

.login-card label {
    display: block;
    margin: 14px 0 7px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-card input {
    width: 100%;
    padding: 12px;
    color: var(--text-primary);
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
}

.login-error {
    min-height: 1.25rem;
    margin-top: 12px;
    color: var(--danger);
    font-size: 0.9rem;
}

.login-btn,
.logout-btn {
    cursor: pointer;
    border: 0;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.login-btn {
    width: 100%;
    margin-top: 8px;
    padding: 13px;
    color: #102417;
    background: var(--secondary);
}

.login-hint {
    margin-top: 18px;
    font-size: 0.78rem;
}

.account-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.logout-btn {
    padding: 8px 12px;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.admin-card {
    margin-bottom: 24px;
    padding: 22px;
    background: rgba(184, 155, 94, 0.1);
    border: 1px solid rgba(184, 155, 94, 0.32);
    border-radius: var(--radius);
}

.admin-header {
    margin-bottom: 18px;
}

.admin-card h2 {
    margin: 4px 0 6px;
    font-size: 1.2rem;
}

.admin-card p:not(.admin-kicker) {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.upload-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 14px;
    align-items: end;
}

.upload-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.upload-field select,
.upload-field input[type="file"] {
    width: 100%;
    color: var(--text-primary);
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 10px;
}

.upload-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    padding: 14px;
    border: 2px dashed rgba(184, 155, 94, 0.35);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--transition);
}

.upload-dropzone:hover {
    border-color: var(--secondary);
}

.upload-dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.upload-dropzone-text {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.upload-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-status {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.upload-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upload-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.upload-progress-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.upload-results {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
}

.upload-results:empty {
    display: none;
}

.upload-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
}

.upload-result-item.success {
    color: var(--success);
}

.upload-result-item.error {
    color: var(--danger);
}

.admin-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 24px 0;
}

.music-manager-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.music-manager-count {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: auto;
}

.music-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 8px;
}

.music-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    transition: var(--transition);
}

.music-list-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.music-list-item.selected {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.music-list-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--danger);
}

.music-list-item-info {
    flex: 1;
    min-width: 0;
}

.music-list-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-list-item-artist {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.music-list-item-category {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(45, 107, 74, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(184, 155, 94, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: contain;
    border: 2px solid var(--primary);
    padding: 2px;
    background: var(--bg-card);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    background: linear-gradient(135deg, var(--secondary), var(--text-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.inactive {
    background: var(--text-muted);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Player Card */
.player-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.player-main {
    display: flex;
    gap: 28px;
    align-items: center;
    flex-wrap: wrap;
}

.album-art {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    overflow: hidden;
    position: relative;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-art .placeholder-icon {
    opacity: 0.3;
}

.player-info {
    flex: 1;
    min-width: 200px;
}

.track-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.track-artist {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.track-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
    transition: width 0.2s linear;
    width: 0%;
    pointer-events: none;
}

.progress-bar:hover {
    height: 6px;
}

.progress-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.control-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.2rem;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

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

.control-btn:focus-visible,
.btn-speak:focus-visible,
.repeat-btn:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.control-btn.play-btn {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    font-size: 1.5rem;
    box-shadow: 0 4px 16px rgba(45, 107, 74, 0.4);
}

.control-btn.play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(45, 107, 74, 0.5);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.volume-icon {
    color: var(--text-muted);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.volume-slider {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--bg-card);
}

/* Announcer Section */
.announcer-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.announcer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.announcer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.announcer-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
}

.announcer-status.speaking {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.announcer-status.idle {
    color: var(--text-muted);
}

.announcer-status.paused {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning);
}

.announcer-status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.announcer-status.speaking .announcer-status-indicator,
.announcer-status.paused .announcer-status-indicator {
    animation: pulse 0.6s infinite;
}

.announcer-textarea {
    width: 100%;
    min-height: 80px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 14px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
    margin-bottom: 12px;
    line-height: 1.5;
}

.announcer-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(45, 107, 74, 0.08);
    box-shadow: 0 0 0 3px rgba(45, 107, 74, 0.2);
}

.announcer-textarea::placeholder {
    color: var(--text-muted);
}

.announcer-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.announcer-voice-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.announcer-voice-select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    min-width: 140px;
}

.announcer-voice-select:focus {
    outline: none;
    border-color: var(--primary);
}

.announcer-voice-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.tts-mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    padding: 8px 14px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tts-mode-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.tts-mode-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    transition: var(--transition);
}

.tts-mode-indicator.active {
    background: var(--primary);
    color: white;
}

.tts-mode-indicator.inactive {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.announcer-repeats {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.announcer-repeats label {
    margin-right: 4px;
    white-space: nowrap;
}

.repeat-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    line-height: 1;
}

.repeat-btn:hover {
    background: var(--primary);
    color: white;
}

.repeat-btn:active {
    transform: scale(0.9);
}

.repeat-value {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
}

.btn-speak {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: white;
}

.btn-speak.speak {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.btn-speak.speak:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(45, 107, 74, 0.4);
}

.btn-speak.stop {
    background: var(--danger);
}

.btn-speak.stop:hover {
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
}

.btn-speak:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.announcer-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.announcer-volume input[type="range"] {
    width: 80px;
}

.announcer-volume input[type="range"]::-webkit-slider-thumb {
    background: var(--secondary);
}

.announcer-volume input[type="range"]::-moz-range-thumb {
    background: var(--secondary);
}

/* Queue / Upcoming */
.queue-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px 28px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 24px;
}

.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.queue-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.queue-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 10px;
    border-radius: 10px;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
    cursor: default;
}

.queue-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.queue-item.active {
    background: rgba(45, 107, 74, 0.12);
    border-left: 3px solid var(--primary);
    padding-left: 9px;
}

.queue-item-index {
    width: 24px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.queue-item-info {
    flex: 1;
    min-width: 0;
}

.queue-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-artist {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.queue-item-duration {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .player-main {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .album-art {
        width: 140px;
        height: 140px;
        margin: 0 auto;
    }

    .track-title {
        font-size: 1.3rem;
    }

    .player-controls {
        justify-content: center;
    }

    .volume-control {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .volume-slider {
        width: 120px;
    }

    .announcer-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .announcer-voice-group {
        flex-direction: column;
        align-items: stretch;
    }

    .announcer-voice-select {
        width: 100%;
    }

    .tts-mode-btn {
        justify-content: center;
    }

    .announcer-volume {
        margin-left: 0;
        justify-content: center;
    }

    .announcer-textarea {
        min-height: 60px;
    }

    .player-card {
        padding: 20px;
    }

    .announcer-card {
        padding: 20px;
    }

    .header-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .album-art {
        width: 100px;
        height: 100px;
    }

    .track-title {
        font-size: 1.1rem;
    }

    .control-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .control-btn.play-btn {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
}

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.player-card,
.announcer-card,
.queue-card {
    animation: fadeIn 0.4s ease-out;
}

.announcer-card {
    animation-delay: 0.1s;
}

.queue-card {
    animation-delay: 0.2s;
}

/* Error toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
    color: var(--text-primary);
    font-size: 0.9rem;
    max-width: 360px;
    z-index: 100;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.error {
    border-color: var(--danger);
}

.toast.success {
    border-color: var(--success);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Painel de Ouvintes Conectados e Controle Remoto (Admin)
   ========================================================================== */

.admin-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.listeners-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    margin-left: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    vertical-align: middle;
}

.listeners-quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-action {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--secondary);
    transform: translateY(-1px);
}

.listeners-section {
    margin-top: 20px;
}

.listeners-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
}

.listeners-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.7;
}

.listeners-empty p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.listeners-empty-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 420px;
}

.listeners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.listener-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.listener-card:hover {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(184, 155, 94, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.listener-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.listener-user-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.listener-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-dark);
    border: 1px solid var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.listener-name-box {
    display: flex;
    flex-direction: column;
}

.listener-username {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.listener-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.listener-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.listener-status-tag.playing {
    background: rgba(76, 175, 80, 0.2);
    color: #81C784;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.listener-status-tag.paused {
    background: rgba(243, 156, 18, 0.2);
    color: #F8C471;
    border: 1px solid rgba(243, 156, 18, 0.4);
}

.listener-status-tag.stopped {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.listener-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.listener-status-tag.playing .listener-status-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.listener-status-tag.paused .listener-status-dot {
    background: var(--warning);
}

.listener-status-tag.stopped .listener-status-dot {
    background: var(--text-muted);
}

.listener-track-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.listener-track-cover {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.listener-track-info {
    flex: 1;
    min-width: 0;
}

.listener-track-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listener-track-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listener-progress-area {
    margin-top: 6px;
}

.listener-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.listener-progress-fill {
    height: 100%;
    background: var(--secondary);
    width: 0%;
    transition: width 0.3s ease;
}

.listener-progress-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.listener-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.listener-ctrl-btn {
    flex: 1;
    min-width: 38px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.listener-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--secondary);
}

.listener-ctrl-btn.btn-play-pause {
    background: var(--primary);
    border-color: rgba(255, 255, 255, 0.25);
}

.listener-ctrl-btn.btn-play-pause:hover {
    background: var(--primary-dark);
}

.listener-ctrl-btn.btn-announce {
    background: rgba(184, 155, 94, 0.18);
    border-color: rgba(184, 155, 94, 0.4);
    color: #FFE6A8;
}

.listener-ctrl-btn.btn-announce:hover {
    background: rgba(184, 155, 94, 0.35);
}

/* Modals */
.radio-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.radio-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.radio-modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 540px);
    max-height: 80vh;
    background: var(--bg-card);
    border: 1px solid rgba(184, 155, 94, 0.4);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

.radio-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.radio-modal-header h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.radio-modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 6px;
    transition: var(--transition);
}

.radio-modal-close:hover {
    color: #fff;
}

.radio-modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.radio-modal-search {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.radio-modal-search:focus {
    outline: none;
    border-color: var(--secondary);
}

.radio-modal-list {
    flex: 1;
    overflow-y: auto;
    max-height: 380px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.radio-modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.radio-modal-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--secondary);
}

.radio-modal-item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.radio-modal-item-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.radio-modal-item-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.target-announce-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    gap: 12px;
    flex-wrap: wrap;
}
