/* URR Chat - Apple Design UI & Fluid Layout */
.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    width: 100%;
    max-width: 100vw;
    background: var(--bg);
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    position: relative;
    z-index: 20;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

.chat-header .brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.chat-tools {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex-shrink: 1;
}

.chat-tools .online-count {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: var(--glass-highlight);
    border: 1px solid var(--border);
    transition: transform var(--transition-fast), background-color var(--transition), color var(--transition), border-color var(--transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.chat-tools .online-count:hover {
    color: var(--text);
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.chat-tools .online-count:active {
    transform: scale(0.95);
}

.chat-tools .me {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.chat-layout {
    display: grid;
    grid-template-columns: 1fr;
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.chat-sidebar {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    padding: 1rem 0.8rem;
}

.chat-sidebar h3 {
    margin: 0.4rem 0.5rem 0.7rem;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.room-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.room-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: transform var(--transition-fast), background-color var(--transition), border-color var(--transition);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.room-item:hover {
    background: var(--glass-highlight);
}

.room-item:active {
    transform: scale(0.97);
}

.room-item.active {
    background: var(--primary-light);
    border-color: rgba(255, 15, 56, 0.4);
    color: var(--text);
    font-weight: 600;
    box-shadow: inset 0 0 12px rgba(255, 15, 56, 0.15);
}

.chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.chat-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.2rem 1.4rem;
    min-height: 0;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    min-width: 0;
}

/* Fluid Message Animation (Apple Principle 4) */
@keyframes msgAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.msg {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    transition: background-color var(--transition);
    animation: msgAppear 0.3s var(--ease-spring);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.msg:hover {
    background: var(--glass-highlight);
}

.msg .avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.msg .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msg .body {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.msg .head {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 0.2rem;
    min-width: 0;
}

.msg .username {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.msg .role {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--bg-3);
    color: var(--muted);
    letter-spacing: 0.02em;
}

.msg .role.editor {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
}

.msg .role.dj, .role.dj {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.msg .role.moderator {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.15);
}

.msg .role.admin {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
}

.msg .role.owner {
    color: #f472b6;
    background: rgba(244, 114, 182, 0.15);
}

/* Animated Role Icon Badges (Gold Contour & Apple Spring Motion) */
.staff-role-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.3rem;
    font-size: 0.92rem;
    line-height: 1;
    padding: 0.15rem 0.28rem;
    border-radius: 7px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.25) 0%, rgba(212, 175, 55, 0.08) 100%);
    border: 1px solid #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.45), inset 0 0 4px rgba(255, 215, 0, 0.3);
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.7));
    user-select: none;
    vertical-align: middle;
}

/* 0. Owner Radioactive Glow & Spin */
@keyframes ownerRadioactiveGlow {
    0% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 4px #fbbf24) drop-shadow(0 0 8px #f59e0b);
        box-shadow: 0 0 8px rgba(251, 191, 36, 0.6), inset 0 0 4px rgba(255, 215, 0, 0.4);
    }
    50% {
        transform: scale(1.25) rotate(180deg);
        filter: drop-shadow(0 0 12px #ffe566) drop-shadow(0 0 20px #fbbf24) drop-shadow(0 0 25px #f59e0b);
        box-shadow: 0 0 18px rgba(251, 191, 36, 0.95), inset 0 0 8px rgba(255, 215, 0, 0.7);
    }
    100% {
        transform: scale(1) rotate(360deg);
        filter: drop-shadow(0 0 4px #fbbf24) drop-shadow(0 0 8px #f59e0b);
        box-shadow: 0 0 8px rgba(251, 191, 36, 0.6), inset 0 0 4px rgba(255, 215, 0, 0.4);
    }
}
.staff-role-icon.role-owner {
    border-color: #fbbf24;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.35) 0%, rgba(245, 158, 11, 0.12) 100%);
    animation: ownerRadioactiveGlow 3s infinite linear;
}

/* 1. Admin Star Glow & Rotation */
@keyframes adminStarGlow {
    0% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 3px #ffd700) drop-shadow(0 0 6px #ffae00);
        box-shadow: 0 0 6px rgba(255, 215, 0, 0.45), inset 0 0 3px rgba(255, 215, 0, 0.3);
    }
    50% {
        transform: scale(1.22) rotate(15deg);
        filter: drop-shadow(0 0 9px #ffe566) drop-shadow(0 0 16px #ffd700);
        box-shadow: 0 0 14px rgba(255, 215, 0, 0.85), inset 0 0 7px rgba(255, 215, 0, 0.5);
    }
    100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 3px #ffd700) drop-shadow(0 0 6px #ffae00);
        box-shadow: 0 0 6px rgba(255, 215, 0, 0.45), inset 0 0 3px rgba(255, 215, 0, 0.3);
    }
}
.staff-role-icon.role-admin {
    animation: adminStarGlow 2.2s infinite var(--ease-spring);
}

/* 2. DJ Headphones Pulse & Bounce */
@keyframes djBeatBounce {
    0%, 100% {
        transform: scale(1) translateY(0) rotate(0deg);
        filter: drop-shadow(0 0 3px #ffd700);
        box-shadow: 0 0 6px rgba(255, 215, 0, 0.45);
    }
    25% {
        transform: scale(1.18) translateY(-2px) rotate(-8deg);
        filter: drop-shadow(0 0 9px #ffe566);
        box-shadow: 0 0 12px rgba(255, 215, 0, 0.75);
    }
    50% {
        transform: scale(1.05) translateY(0) rotate(0deg);
        filter: drop-shadow(0 0 4px #ffd700);
    }
    75% {
        transform: scale(1.18) translateY(-2px) rotate(8deg);
        filter: drop-shadow(0 0 9px #ffe566);
        box-shadow: 0 0 12px rgba(255, 215, 0, 0.75);
    }
}
.staff-role-icon.role-dj {
    animation: djBeatBounce 1.3s infinite ease-in-out;
}

/* 3. Locutor Mic Wave Pulse */
@keyframes micWavePulse {
    0%, 100% {
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 0 3px #ffd700);
        box-shadow: 0 0 6px rgba(255, 215, 0, 0.45);
    }
    40% {
        transform: scale(1.2) translateY(-1px);
        filter: drop-shadow(0 0 10px #ffd700) drop-shadow(0 0 16px rgba(255, 215, 0, 0.9));
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.85), inset 0 0 6px rgba(255, 215, 0, 0.4);
    }
    60% {
        transform: scale(1.1) translateY(0);
        filter: drop-shadow(0 0 6px #ffe566);
    }
}
.staff-role-icon.role-locutor {
    animation: micWavePulse 1.7s infinite var(--ease-spring);
}

/* 4. Moderator Search Scan */
@keyframes modSearchScan {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 3px #ffd700);
        box-shadow: 0 0 6px rgba(255, 215, 0, 0.45);
    }
    30% {
        transform: scale(1.18) rotate(-18deg) translateX(-1px);
        filter: drop-shadow(0 0 9px #ffe566);
        box-shadow: 0 0 12px rgba(255, 215, 0, 0.75);
    }
    70% {
        transform: scale(1.18) rotate(18deg) translateX(1px);
        filter: drop-shadow(0 0 9px #ffe566);
        box-shadow: 0 0 12px rgba(255, 215, 0, 0.75);
    }
}
.staff-role-icon.role-moderator {
    animation: modSearchScan 2.4s infinite ease-in-out;
}

/* 5. Featured User Shiny Star Pulse */
@keyframes featuredStarPulse {
    0%, 100% {
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 0 4px #38bdf8) drop-shadow(0 0 8px #818cf8);
        box-shadow: 0 0 8px rgba(56, 189, 248, 0.5), inset 0 0 4px rgba(56, 189, 248, 0.3);
    }
    50% {
        transform: scale(1.15) translateY(-1px);
        filter: drop-shadow(0 0 10px #38bdf8) drop-shadow(0 0 18px #c084fc);
        box-shadow: 0 0 14px rgba(56, 189, 248, 0.85), inset 0 0 7px rgba(192, 132, 252, 0.5);
    }
}
.staff-role-icon.role-featured {
    border-color: #38bdf8;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.28) 0%, rgba(129, 140, 248, 0.12) 100%);
    animation: featuredStarPulse 2s infinite ease-in-out;
    color: #e0f2fe;
    font-weight: 700;
}
.msg .role.featured {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

/* User Country Flag */
.user-flag {
    display: inline-block;
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    margin-right: 0.35rem;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.msg .time {
    color: var(--muted);
    font-size: 0.78rem;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.msg-menu-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    line-height: 1;
    padding: 0.25rem 0.55rem;
    border-radius: 8px;
    cursor: pointer;
    transition: color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.msg:hover .msg-menu-btn, .msg-menu-btn:hover {
    color: var(--text);
    background: var(--glass-highlight);
    border-color: rgba(255, 255, 255, 0.25);
}

.msg-menu-btn:active {
    transform: scale(0.92);
}

.msg.deleted .content {
    color: var(--muted);
    font-style: italic;
}

.reply-block {
    border-left: 3px solid var(--primary);
    padding: 0.3rem 0.6rem;
    margin: 0.25rem 0 0.4rem;
    background: var(--primary-light);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--muted);
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.reply-block a {
    word-break: break-all;
    overflow-wrap: anywhere;
}

.msg-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 14px;
    background: var(--bg-2);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    width: fit-content;
    max-width: 100%;
    flex-wrap: wrap;
    animation: panelPopIn 0.2s var(--ease-spring);
    z-index: 15;
}

.msg-actions[hidden] {
    display: none !important;
}

.msg-actions button {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 9px;
    padding: 0.35rem 0.75rem;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.msg-actions button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.msg-actions button:active {
    transform: scale(0.94);
}

.load-more {
    text-align: center;
    padding: 0.75rem;
}

.reply-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    color: var(--muted);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.composer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    min-width: 0;
}

.composer-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.composer-top #guestName {
    flex: 1;
    min-width: 0;
    max-width: 240px;
}

.composer-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--glass-highlight);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    user-select: none;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.composer-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff0f38 0%, #d90429 100%);
    color: #ffffff !important;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(255, 15, 56, 0.35);
    white-space: nowrap;
    transition: all 0.2s ease;
    margin-left: auto;
}

.composer-auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 15, 56, 0.55);
    color: #ffffff !important;
    text-decoration: none;
}

/* Staff Song Requests Bell Button */
.sr-bell-btn {
    position: relative;
    padding: 0.35rem 0.55rem;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.sr-bell-btn:hover {
    background: var(--glass-highlight);
}

.sr-bell-btn:active {
    transform: scale(0.92);
}

/* Swinging animation WITHOUT glowing border */
@keyframes srBellSwing {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(18deg); }
    30% { transform: rotate(-16deg); }
    45% { transform: rotate(12deg); }
    60% { transform: rotate(-8deg); }
    75% { transform: rotate(4deg); }
}

.sr-bell-icon {
    display: inline-block;
}

.sr-bell-icon.sr-bell-swing {
    animation: srBellSwing 1.8s infinite ease-in-out;
    transform-origin: top center;
}

/* Notification badge */
.sr-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--primary, #ff0f38);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    border: 2px solid var(--bg);
    box-sizing: border-box;
}

/* Song Requests Popover Panel */
.sr-bell-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 1rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.75rem;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    width: 330px;
    max-width: calc(100vw - 2rem);
    max-height: 380px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 60;
    animation: panelPopIn 0.22s var(--ease-bounce);
    overflow-x: hidden;
    box-sizing: border-box;
}

.sr-bell-panel[hidden] {
    display: none !important;
}

.sr-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.sr-panel-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    max-height: 300px;
    padding-right: 0.2rem;
}

.sr-panel-item {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sr-panel-item .sr-song-info {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

.sr-panel-item .sr-song-meta {
    font-size: 0.76rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sr-panel-item .sr-actions {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.sr-panel-item .sr-actions button {
    flex: 1;
    padding: 0.35rem 0.5rem;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-3);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.sr-panel-item .sr-actions button.btn-played {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
}

.sr-panel-item .sr-actions button.btn-played:hover {
    background: rgba(16, 185, 129, 0.35);
}

.sr-panel-item .sr-actions button.btn-reject {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}

.sr-panel-item .sr-actions button.btn-reject:hover {
    background: rgba(245, 158, 11, 0.35);
}

.sr-panel-item .sr-actions button.btn-delete {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    flex: 0 0 auto;
    padding: 0.35rem 0.6rem;
}

.sr-panel-item .sr-actions button.btn-delete:hover {
    background: rgba(239, 68, 68, 0.35);
}

.composer-bottom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.composer-bottom input[type=text], .composer-top input[type=text] {
    flex: 1;
    min-width: 0;
}

.composer.disabled {
    color: var(--muted);
    padding: 1rem;
}

/* Apple Popover Panel - Spatial Entrance & Bounce Easing */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes panelPopIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Apple Design Custom Notice & Dialog Modals */
.custom-notice-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    animation: fadeIn 0.2s ease-out;
}

.custom-notice-card {
    width: 100%;
    max-width: 380px;
    text-align: center;
    padding: 1.6rem 1.4rem;
    border-radius: 22px;
    background: var(--glass-bg, rgba(18, 18, 22, 0.92));
    backdrop-filter: var(--glass-blur, blur(24px) saturate(180%));
    -webkit-backdrop-filter: var(--glass-blur, blur(24px) saturate(180%));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
    animation: panelPopIn 0.25s var(--ease-bounce);
    box-sizing: border-box;
}

.emoji-panel[hidden], .gif-panel[hidden] {
    display: none !important;
}

.emoji-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 1rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 0.6rem;
    box-shadow: var(--shadow);
    width: 290px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.2rem;
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
    transform-origin: bottom left;
    animation: panelPopIn 0.25s var(--ease-bounce);
}

.emoji-panel button {
    background: transparent;
    border: 0;
    font-size: 1.3rem;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.15s var(--ease-bounce), background-color 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.emoji-panel button:hover {
    background: var(--glass-highlight);
    transform: scale(1.25);
}

.emoji-panel button:active {
    transform: scale(0.9);
}

/* Apple Popover GIF Panel */
.gif-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 1rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.75rem;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
    width: 340px;
    max-width: calc(100vw - 2rem);
    height: 460px;
    max-height: calc(75vh - 80px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    z-index: 50;
    transform-origin: bottom left;
    animation: panelPopIn 0.25s var(--ease-bounce);
    overflow-x: hidden;
}

.gif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    flex-shrink: 0;
}

.gif-tabs {
    display: flex;
    gap: 0.3rem;
    background: var(--bg-2);
    padding: 0.2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.gif-tab-btn {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gif-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 15, 56, 0.35);
}

.gif-search-input {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    outline: none;
    width: 100%;
    box-sizing: border-box;
    flex: 0 0 auto !important;
    height: 38px !important;
    max-height: 38px !important;
}

.gif-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 15, 56, 0.25);
}

.gif-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: max-content;
    align-content: start;
    gap: 0.6rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.2rem;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.gif-grid::-webkit-scrollbar {
    width: 5px;
}

.gif-grid::-webkit-scrollbar-track {
    background: transparent;
}

.gif-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
}

.gif-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45);
}

.gif-panel .gif-item {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: block;
    position: relative;
    width: 100%;
    height: 125px;
    min-height: 125px;
    overflow: hidden;
    transition: transform 0.18s var(--ease-bounce), border-color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.gif-panel .gif-item:hover {
    border-color: var(--primary);
    transform: scale(1.03);
    box-shadow: 0 4px 14px rgba(255, 15, 56, 0.4);
    z-index: 2;
}

.gif-panel .gif-item:active {
    transform: scale(0.96);
}

.gif-panel .gif-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 9px;
}

.gif-panel .gif-item span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    color: #ffffff;
    font-size: 0.65rem;
    padding: 0.5rem 0.35rem 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.gif-panel .gif-item:hover span {
    opacity: 1;
}

/* Responsive Layout */
@media (max-width: 720px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }
    .chat-sidebar {
        display: none;
    }
    .emoji-panel {
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(100% + 8px);
        width: auto;
        max-height: 320px;
        z-index: 50;
    }
    .gif-panel {
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(100% + 8px);
        width: auto;
        height: 60vh;
        max-height: 480px;
        z-index: 50;
    }
    .sr-bell-panel {
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(100% + 8px);
        width: auto;
        max-width: none;
        max-height: 360px;
        z-index: 60;
    }
}

@media (max-width: 600px) {
    .chat-header {
        padding: 0.5rem 0.75rem;
    }
    .chat-header .brand-name {
        font-size: 0.95rem;
        white-space: nowrap;
    }
    .chat-tools {
        gap: 0.35rem;
    }
    .chat-tools .btn-ghost, .chat-tools .btn-primary, .chat-tools .btn-song-req {
        padding: 0.35rem 0.55rem;
        font-size: 0.78rem;
        white-space: nowrap;
    }
    .chat-tools .online-count {
        font-size: 0.75rem;
        white-space: nowrap;
    }
    .chat-tools .me {
        display: none;
    }
    .chat-scroll {
        padding: 0.75rem 0.75rem;
    }
    .msg {
        padding: 0.5rem 0.6rem;
        gap: 0.5rem;
    }
    .composer {
        padding: 0.6rem 0.65rem;
        gap: 0.4rem;
    }
    .composer input[type=text] {
        padding: 0.5rem 0.65rem;
        font-size: 0.88rem;
    }
    .composer button {
        padding: 0.4rem 0.6rem;
        font-size: 0.82rem;
    }
}

/* Song Request Button & Modal UI */
.btn-song-req {
    background: linear-gradient(135deg, #ff0f38, #b91c1c);
    color: #ffffff;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 4px 14px rgba(255, 15, 56, 0.4);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-song-req:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 6px 20px rgba(255, 15, 56, 0.6);
    filter: brightness(1.1);
}

.btn-song-req:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(255, 15, 56, 0.3);
}

/* Modal Dialog */
.modal-backdrop[hidden] {
    display: none !important;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalPopIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(15px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-card {
    background: var(--bg-1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg, 16px);
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    box-sizing: border-box;
    animation: modalPopIn 0.25s var(--ease-spring);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.modal-close:hover {
    color: var(--text);
    background: var(--glass-highlight);
}

.modal-card .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}

.modal-card .form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

.modal-card .form-group input {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius, 10px);
    padding: 0.65rem 0.85rem;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.modal-card .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 15, 56, 0.25);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

/* Online Users Modal List Items */
.online-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.online-user-item:hover {
    background: var(--glass-highlight);
    border-color: rgba(255, 255, 255, 0.15);
}

.online-user-item .u-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.online-user-item .u-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.online-user-item .u-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-user-item .u-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    flex-shrink: 0;
}

/* Message Reactions UI */
.reactions-bar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
    position: relative;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.reaction-pill:hover {
    background: var(--bg-3);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.06);
}

.reaction-pill:active {
    transform: scale(0.92);
}

.reaction-pill.user-reacted {
    background: var(--primary-light);
    border-color: rgba(255, 15, 56, 0.45);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(255, 15, 56, 0.25);
}

.reaction-picker-popup {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 6px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.25rem 0.45rem;
    display: flex;
    gap: 0.2rem;
    box-shadow: var(--shadow);
    z-index: 60;
    animation: panelPopIn 0.2s var(--ease-bounce);
}

.reaction-picker-popup button {
    background: transparent;
    border: 0;
    font-size: 1.15rem;
    padding: 0.2rem 0.35rem;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.15s var(--ease-bounce), background-color 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.reaction-picker-popup button:hover {
    transform: scale(1.3);
    background: var(--glass-highlight);
}

.reaction-picker-popup button:active {
    transform: scale(0.9);
}

/* User Mentions (@) */
.user-mention {
    display: inline-block;
    background: rgba(109, 40, 217, 0.22);
    color: #a78bfa;
    font-weight: 600;
    padding: 0.08rem 0.42rem;
    border-radius: 6px;
    border: 1px solid rgba(167, 139, 250, 0.35);
    cursor: pointer;
    transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    user-select: text;
    vertical-align: baseline;
    line-height: 1.3;
}

.user-mention:hover {
    background: rgba(109, 40, 217, 0.4);
    border-color: rgba(167, 139, 250, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.3);
}

.user-mention:active {
    transform: scale(0.96);
}

.user-mention.is-me {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(239, 68, 68, 0.3));
    color: #fde047;
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

/* Autocomplete Mention Suggestions Dropdown */
.mention-suggestions-popup {
    position: absolute;
    bottom: 100%;
    left: 1rem;
    margin-bottom: 8px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    max-height: 210px;
    overflow-y: auto;
    z-index: 120;
    min-width: 220px;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    animation: panelPopIn 0.2s var(--ease-bounce);
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.mention-item:hover, .mention-item.active {
    background: var(--glass-highlight);
}

.mention-item .m-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.mention-item .m-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.mention-item .m-role {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--muted);
    margin-left: auto;
}

/* Desktop / Mobile Header Tools */
.desktop-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--glass-highlight);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    font-size: 1.25rem;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: transform var(--transition-fast), background-color var(--transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:hover {
    background: var(--bg-2);
}

.mobile-menu-btn:active {
    transform: scale(0.92);
}

.mobile-menu-drawer {
    position: fixed;
    top: 56px;
    right: 0.75rem;
    left: auto;
    width: 310px;
    max-width: calc(100vw - 1.5rem);
    background: var(--glass-bg, rgba(15, 23, 42, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
    z-index: 100;
    padding: 1.25rem;
    animation: panelPopIn 0.22s var(--ease-bounce);
    box-sizing: border-box;
}

.mobile-menu-drawer[hidden] {
    display: none !important;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-user-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.25rem 0 0.5rem 0;
}

.m-avatar-wrapper {
    position: relative;
    margin-bottom: 0.65rem;
}

.m-avatar-wrapper .m-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary, #ff0f38);
    box-shadow: 0 0 20px rgba(255, 15, 56, 0.5), 0 8px 24px rgba(255, 15, 56, 0.35);
    transition: transform 0.2s ease;
}

.m-avatar-wrapper .m-avatar:hover {
    transform: scale(1.05);
}

.m-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.m-username {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text, #ffffff);
    letter-spacing: 0.3px;
}

.m-role-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 15, 56, 0.15);
    color: #ff5c77;
    border: 1px solid rgba(255, 15, 56, 0.3);
    text-transform: capitalize;
}

.mobile-menu-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.2rem 0;
}

.mobile-menu-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.1rem;
}

.mobile-theme-toggle-row {
    display: flex;
    gap: 0.5rem;
}

.mobile-theme-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text, #ffffff);
    transition: all 0.2s ease;
}

.mobile-theme-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mobile-theme-btn.active {
    background: var(--primary, #ff0f38) !important;
    color: #ffffff !important;
    border-color: var(--primary, #ff0f38) !important;
    box-shadow: 0 4px 14px rgba(255, 15, 56, 0.4) !important;
}

.mobile-menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text, #ffffff);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-link:hover {
    background: rgba(255, 15, 56, 0.12);
    border-color: rgba(255, 15, 56, 0.3);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(255, 15, 56, 0.2);
    transform: translateY(-1px);
}

.mobile-menu-link:active {
    transform: scale(0.98);
}

.mobile-menu-link.admin-link {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.06);
    border-color: rgba(56, 189, 248, 0.2);
}

.mobile-menu-link.admin-link:hover {
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.mobile-menu-link.danger-link {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.06);
    border-color: rgba(255, 77, 77, 0.2);
}

.mobile-menu-link.danger-link:hover {
    background: rgba(255, 77, 77, 0.16);
    border-color: rgba(255, 77, 77, 0.4);
    box-shadow: 0 4px 14px rgba(255, 77, 77, 0.25);
}

.mobile-menu-link.primary-link {
    background: var(--primary, #ff0f38);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(255, 15, 56, 0.4);
}

@media (max-width: 768px) {
    .desktop-tools {
        display: none !important;
    }
    .mobile-menu-btn {
        display: inline-flex !important;
    }
}

/* ==========================================================================
   Floating Radio Player Widget (Bottom Right Popup)
   ========================================================================== */
.radio-floating-widget {
    position: fixed;
    bottom: 84px;
    right: 18px;
    z-index: 99;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

.radio-floating-widget * {
    pointer-events: auto;
}

/* Compact Floating Button */
.radio-trigger-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg, rgba(18, 18, 22, 0.88));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    transition: all 0.25s var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.radio-trigger-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary, #ff0f38);
    box-shadow: 0 10px 28px rgba(255, 15, 56, 0.4);
}

.radio-trigger-btn:active {
    transform: scale(0.94);
}

.radio-trigger-btn .radio-icon {
    font-size: 1.35rem;
    transition: transform 0.2s ease;
}

.radio-trigger-btn.is-playing {
    background: linear-gradient(135deg, rgba(255, 15, 56, 0.9), rgba(185, 28, 28, 0.9));
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 15, 56, 0.6), 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: radioPulse 2s infinite ease-in-out;
}

@keyframes radioPulse {
    0%, 100% { box-shadow: 0 0 18px rgba(255, 15, 56, 0.5), 0 8px 24px rgba(0, 0, 0, 0.5); }
    50% { box-shadow: 0 0 28px rgba(255, 15, 56, 0.85), 0 12px 30px rgba(0, 0, 0, 0.6); }
}

/* Sound Wave Animation inside Trigger Button */
.radio-waves-animation {
    position: absolute;
    bottom: 5px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 10px;
}

.radio-waves-animation .wave-bar {
    width: 2px;
    height: 100%;
    background: #ffffff;
    border-radius: 2px;
    animation: waveBounce 0.8s infinite ease-in-out alternate;
}

.radio-waves-animation .wave-bar:nth-child(1) { animation-delay: 0.1s; }
.radio-waves-animation .wave-bar:nth-child(2) { animation-delay: 0.3s; }
.radio-waves-animation .wave-bar:nth-child(3) { animation-delay: 0.5s; }

@keyframes waveBounce {
    0% { height: 3px; }
    100% { height: 10px; }
}

/* Expanded Popup Card */
.radio-popup-card {
    width: 280px;
    background: var(--glass-bg, rgba(18, 18, 24, 0.94));
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15));
    border-radius: 18px;
    padding: 1rem;
    margin-bottom: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: panelPopIn 0.22s var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
    transform-origin: bottom right;
    box-sizing: border-box;
}

.radio-popup-card[hidden] {
    display: none !important;
}

.radio-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.radio-station-info {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.radio-live-badge {
    font-size: 0.65rem;
    font-weight: 800;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
    letter-spacing: 0.5px;
    animation: liveBadgeGlow 1.5s infinite alternate;
}

@keyframes liveBadgeGlow {
    0% { opacity: 0.8; }
    100% { opacity: 1; text-shadow: 0 0 8px rgba(239, 68, 68, 0.8); }
}

.radio-title-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.radio-close-btn {
    background: transparent;
    border: none;
    color: var(--muted, #94a3b8);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.radio-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.radio-popup-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Main Play / Stop Toggle Button */
.radio-main-toggle {
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary, #ff0f38) 0%, #b91c1c 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 15, 56, 0.4);
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.radio-main-toggle:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 15, 56, 0.55);
}

.radio-main-toggle:active {
    transform: scale(0.97);
}

.radio-main-toggle.is-playing {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.radio-main-toggle.is-playing:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.radio-toggle-icon {
    font-size: 1rem;
}

.radio-toggle-text {
    letter-spacing: 0.5px;
}

/* Volume Bar */
.radio-volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.4rem 0.6rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.radio-mute-btn {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.1rem;
    line-height: 1;
    transition: transform 0.15s ease;
}

.radio-mute-btn:hover {
    transform: scale(1.15);
}

.radio-volume-slider {
    flex: 1;
    accent-color: var(--primary, #ff0f38);
    height: 4px;
    border-radius: 2px;
    cursor: pointer;
}

/* Equalizer Visualizer */
.radio-visualizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 14px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.radio-visualizer.active {
    opacity: 1;
}

.radio-visualizer .v-bar {
    width: 3px;
    height: 3px;
    background: var(--primary, #ff0f38);
    border-radius: 2px;
    transition: height 0.15s ease;
}

.radio-visualizer.active .v-bar {
    animation: eqAnim 0.7s infinite ease-in-out alternate;
}

.radio-visualizer.active .v-bar:nth-child(1) { animation-delay: 0.05s; }
.radio-visualizer.active .v-bar:nth-child(2) { animation-delay: 0.25s; }
.radio-visualizer.active .v-bar:nth-child(3) { animation-delay: 0.45s; }
.radio-visualizer.active .v-bar:nth-child(4) { animation-delay: 0.15s; }
.radio-visualizer.active .v-bar:nth-child(5) { animation-delay: 0.35s; }

@keyframes eqAnim {
    0% { height: 3px; }
    100% { height: 14px; }
}

@media (max-width: 600px) {
    .radio-floating-widget {
        bottom: 74px;
        right: 12px;
    }
    .radio-popup-card {
        width: calc(100vw - 24px);
        max-width: 300px;
    }
}





