/* ==============================================
   LiveTalk Styles
   - Room list page
   - Room page (chat, speakers, gifts, reactions)
   ============================================== */

:root {
    --live-red: #ef4444;
    --live-red-glow: rgba(239, 68, 68, 0.4);
    --live-bg: var(--bg-primary, #ffffff);
    --live-card-bg: var(--bg-secondary, #f9fafb);
    --live-border: var(--border-color, #e5e7eb);
    --live-text: var(--text-primary, #111827);
    --live-text-secondary: var(--text-secondary, #6b7280);
    --live-text-tertiary: var(--text-tertiary, #9ca3af);
    --live-accent: var(--primary-color, #6366f1);

    /* Super Chat tiers */
    --sc-basic: #3b82f6;
    --sc-basic-bg: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    --sc-premium: #f59e0b;
    --sc-premium-bg: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    --sc-ultra: #ef4444;
    --sc-ultra-bg: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

/* ========== LIVE LIST PAGE ========== */

.live-list-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

.live-list-header {
    text-align: center;
    margin-bottom: 24px;
}

.live-list-title {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 8px 0;
}

.live-list-subtitle {
    color: var(--live-text-secondary);
    font-size: 14px;
    margin: 0;
}

/* Room grid */
.live-room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.live-room-card {
    display: block;
    background: var(--live-card-bg);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--live-text);
    border: 1px solid var(--live-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.live-room-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.live-card-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: var(--live-border);
}

.live-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--live-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    animation: live-pulse 2s infinite;
}

.live-card-fee {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.live-card-body {
    padding: 12px;
}

.live-card-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-card-host {
    font-size: 12px;
    color: var(--live-text-secondary);
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-card-viewers {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--live-text-tertiary);
}

.live-card-viewers svg {
    opacity: 0.7;
}

/* Empty / Loading */
.live-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 12px;
    color: var(--live-text-tertiary);
}

.live-empty-state p {
    margin: 0;
    font-size: 16px;
}

.live-empty-hint {
    font-size: 13px !important;
}

.live-loading-state {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.live-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--live-border);
    border-top-color: var(--live-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== LIVE BADGE (pulsing) ========== */

.live-badge-pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--live-red);
    border-radius: 50%;
    animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 var(--live-red-glow); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.live-badge-small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--live-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.live-badge-small::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: live-dot-pulse 1.5s infinite;
}

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

/* ========== ROOM PAGE ========== */

.live-room-container {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: var(--live-bg);
}

/* Header */
.live-room-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--live-border);
    flex-shrink: 0;
}

.live-room-back {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--live-text);
    display: flex;
}

.live-room-header-info {
    flex: 1;
    min-width: 0;
}

.live-room-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-room-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.live-room-viewers {
    font-size: 12px;
    color: var(--live-text-secondary);
}

.live-room-viewers::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--live-text-tertiary);
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.live-room-leave-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--live-red);
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.live-room-leave-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Host info */
.live-room-host {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--live-border);
    flex-shrink: 0;
}

.live-host-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.live-host-details {
    flex: 1;
    min-width: 0;
}

.live-host-name {
    font-size: 14px;
    font-weight: 600;
    display: block;
}

.live-host-desc {
    font-size: 12px;
    color: var(--live-text-secondary);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Speaker Grid */
.live-speaker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    justify-content: center;
    flex-shrink: 0;
    min-height: 0;
}

.live-speaker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 64px;
}

.live-speaker-avatar-wrap {
    position: relative;
    width: 48px;
    height: 48px;
}

.live-speaker-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--live-border);
}

.live-speaker-level {
    position: absolute;
    inset: -3px;
    border: 2px solid var(--live-accent);
    border-radius: 50%;
    opacity: 0;
    transition: transform 0.1s, opacity 0.1s;
    pointer-events: none;
}

.live-speaker-host-badge {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--live-accent);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.live-speaker-name {
    font-size: 11px;
    color: var(--live-text-secondary);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* VIP Ranking - Participant Sections */
.live-participants-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.live-participants-row::-webkit-scrollbar { display: none; }

.live-host-slot,
.live-gifters-section,
.live-vip-section,
.live-others-section {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.live-gifters-section::before,
.live-vip-section::before {
    content: '';
    width: 1px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}

/* Participant avatar with rank */
.live-participant-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}
.live-participant-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
}

/* Gifter highlight */
.live-participant-avatar.is-gifter img {
    border-color: #ff69b4;
    box-shadow: 0 0 8px rgba(255,105,180,0.5);
}

/* VIP rank borders */
.live-participant-avatar.rank-1 img { border-color: #ffd700; box-shadow: 0 0 8px rgba(255,215,0,0.5); }
.live-participant-avatar.rank-2 img { border-color: #c0c0c0; box-shadow: 0 0 8px rgba(192,192,192,0.4); }
.live-participant-avatar.rank-3 img { border-color: #cd7f32; box-shadow: 0 0 8px rgba(205,127,50,0.4); }

/* Rank badge overlay on avatar */
.live-rank-badge-overlay {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Chat rank badges */
.live-rank-badge {
    display: inline-block;
    font-size: 12px;
    margin-right: 4px;
    vertical-align: middle;
}

/* Gift & Reaction Overlays */
.live-gift-overlay {
    position: absolute;
    top: 40%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.live-gift-effect {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 24px;
    font-size: 14px;
    animation: giftSlideIn 0.4s ease-out;
}

.live-gift-effect-out {
    animation: giftSlideOut 0.5s ease-in forwards;
}

.live-gift-effect-emoji {
    font-size: 28px;
}

.live-gift-effect-text {
    font-weight: 500;
}

/* Gift tier glow effects */
.live-gift-tier-diamond .live-gift-effect-emoji,
.live-gift-tier-star .live-gift-effect-emoji,
.live-gift-tier-crown .live-gift-effect-emoji {
    animation: giftBounce 0.6s ease-out;
}

.live-gift-tier-crown {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9));
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.live-gift-tier-star {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(79, 70, 229, 0.9));
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.live-gift-tier-diamond {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9));
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

@keyframes giftSlideIn {
    from { transform: translateX(-100%) scale(0.8); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes giftSlideOut {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to { transform: translateX(100%) scale(0.8); opacity: 0; }
}

@keyframes giftBounce {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Floating reactions */
.live-reaction-overlay {
    position: absolute;
    bottom: 80px;
    right: 16px;
    width: 60px;
    height: 200px;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.live-floating-reaction {
    position: absolute;
    bottom: 0;
    font-size: 24px;
    animation: floatUp 2s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-180px) scale(0.6);
        opacity: 0;
    }
}

/* ========== CHAT AREA ========== */

.live-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.live-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
}

.live-chat-msg {
    font-size: 13px;
    line-height: 1.4;
    padding: 4px 0;
    word-break: break-word;
}

.live-chat-name {
    font-weight: 600;
    margin-right: 6px;
    color: var(--live-accent);
}

.live-chat-text {
    color: var(--live-text);
}

.live-chat-system {
    text-align: center;
}

.live-chat-system-text {
    font-size: 12px;
    color: var(--live-text-tertiary);
    font-style: italic;
}

/* Gift message */
.live-chat-gift {
    background: rgba(245, 158, 11, 0.08);
    padding: 6px 10px;
    border-radius: 8px;
}

.live-chat-gift-icon {
    font-size: 16px;
}

/* Super Chat message */
.live-chat-superchat {
    border-radius: 10px;
    padding: 8px 12px;
    margin: 4px 0;
}

.live-sc-basic { background: var(--sc-basic-bg); }
.live-sc-premium { background: var(--sc-premium-bg); }
.live-sc-ultra { background: var(--sc-ultra-bg); }

.live-sc-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.live-sc-badge {
    background: var(--sc-basic);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.3px;
}

.live-sc-premium .live-sc-badge { background: var(--sc-premium); }
.live-sc-ultra .live-sc-badge { background: var(--sc-ultra); }

.live-sc-amount {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--live-text-secondary);
}

.live-sc-content {
    font-size: 14px;
    font-weight: 500;
}

/* Super Chat highlight (sticky at top of chat) */
.live-sc-highlight {
    padding: 10px 16px;
    border-radius: 0;
    animation: scSlideIn 0.4s ease-out;
    flex-shrink: 0;
}

.live-sc-highlight-basic { background: var(--sc-basic-bg); }
.live-sc-highlight-premium { background: var(--sc-premium-bg); }
.live-sc-highlight-ultra { background: var(--sc-ultra-bg); }

.live-sc-highlight-out {
    animation: scSlideOut 0.5s ease-in forwards;
}

.live-sc-highlight-name {
    font-weight: 700;
    margin-right: 8px;
}

.live-sc-highlight-text {
    font-size: 14px;
}

@keyframes scSlideIn {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scSlideOut {
    from { opacity: 1; max-height: 60px; }
    to { opacity: 0; max-height: 0; padding: 0 16px; }
}

/* ========== BOTTOM ACTION BAR ========== */

.live-action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--live-border);
    background: var(--live-bg);
    flex-shrink: 0;
    z-index: 5;
}

.live-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    background: var(--live-card-bg);
    color: var(--live-text);
}

.live-action-btn:hover {
    background: var(--live-border);
}

.live-action-mic {
    background: var(--live-accent);
    color: #fff;
}

.live-action-mic:hover {
    opacity: 0.9;
    background: var(--live-accent);
}

.live-action-mic-off {
    background: var(--live-red);
    color: #fff;
}

.live-action-mic-off:hover {
    opacity: 0.9;
    background: var(--live-red);
}

/* Chat input */
.live-chat-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--live-card-bg);
    border-radius: 20px;
    border: 1px solid var(--live-border);
    padding: 0 4px 0 14px;
    min-width: 0;
}

.live-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    padding: 8px 0;
    outline: none;
    color: var(--live-text);
    min-width: 0;
}

.live-chat-input::placeholder {
    color: var(--live-text-tertiary);
}

.live-chat-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--live-accent);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.live-chat-send:hover {
    opacity: 0.85;
}

/* Reaction picker */
.live-reaction-picker {
    position: absolute;
    bottom: 68px;
    right: 16px;
    display: flex;
    gap: 4px;
    background: var(--live-bg);
    border: 1px solid var(--live-border);
    border-radius: 24px;
    padding: 6px 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.live-reaction-emoji {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: background 0.15s, transform 0.15s;
    line-height: 1;
}

.live-reaction-emoji:hover {
    background: var(--live-card-bg);
    transform: scale(1.2);
}

/* ========== MODALS ========== */

.live-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease-out;
}

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

.live-modal {
    background: var(--live-bg);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.live-modal-sm {
    max-height: 40vh;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.live-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--live-border);
}

.live-modal-header h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}

.live-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--live-text-secondary);
    padding: 4px;
    display: flex;
}

.live-modal-body {
    padding: 16px 20px;
}

.live-modal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--live-border);
}

.live-modal-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--live-text-secondary);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.live-modal-tab.active {
    color: var(--live-accent);
    border-bottom-color: var(--live-accent);
}

/* Gift Grid */
.live-gift-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 16px 20px;
}

.live-gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: var(--live-card-bg);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}

.live-gift-item:hover {
    border-color: var(--live-accent);
}

.live-gift-item.selected {
    border-color: var(--live-accent);
    background: rgba(99, 102, 241, 0.08);
}

.live-gift-item:active {
    transform: scale(0.95);
}

.live-gift-emoji {
    font-size: 28px;
    line-height: 1;
}

.live-gift-name {
    font-size: 11px;
    color: var(--live-text-secondary);
}

.live-gift-price {
    font-size: 11px;
    font-weight: 600;
    color: var(--live-accent);
}

/* Super Chat Form */
.live-superchat-form {
    padding: 16px 20px;
}

.live-superchat-tiers {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.live-superchat-tier {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: var(--live-card-bg);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.live-superchat-tier.active {
    border-color: var(--sc-basic);
}

.live-superchat-tier[data-tier="premium"].active {
    border-color: var(--sc-premium);
}

.live-superchat-tier[data-tier="ultra"].active {
    border-color: var(--sc-ultra);
}

.live-sc-tier-name {
    font-size: 13px;
    font-weight: 600;
}

.live-sc-tier-price {
    font-size: 12px;
    color: var(--live-text-secondary);
}

.live-superchat-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--live-border);
    border-radius: 10px;
    font-size: 14px;
    resize: none;
    outline: none;
    background: var(--live-card-bg);
    color: var(--live-text);
    box-sizing: border-box;
}

.live-superchat-input:focus {
    border-color: var(--live-accent);
}

.live-superchat-send {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: var(--live-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.live-superchat-send:hover {
    opacity: 0.9;
}

/* ========== TOAST ========== */

.live-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.live-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== RESPONSIVE ========== */

@media (max-width: 480px) {
    .live-room-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .live-gift-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        padding: 12px 16px;
    }

    .live-gift-emoji {
        font-size: 24px;
    }

    .live-gift-item {
        padding: 10px 4px;
    }

    .live-speaker-grid {
        gap: 8px;
        padding: 8px 12px;
    }

    .live-speaker-item {
        width: 56px;
    }

    .live-speaker-avatar {
        width: 40px;
        height: 40px;
    }

    .live-speaker-avatar-wrap {
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 768px) {
    .live-room-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .live-modal {
        border-radius: 20px;
        margin: auto;
        max-height: 60vh;
    }

    .live-modal-overlay {
        align-items: center;
        padding: 20px;
    }
}

/* === Phase 2: Audio Level Glow === */
.live-speaker-level {
    box-shadow: 0 0 8px 2px var(--live-accent);
}
@keyframes speakerGlow {
    0%, 100% { box-shadow: 0 0 8px 2px var(--live-accent); }
    50% { box-shadow: 0 0 14px 4px var(--live-accent); }
}

/* === Phase 2: Raise Hand Button === */
.live-action-raise-hand {
    font-size: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
}
.live-action-raise-hand:hover {
    background: rgba(255,255,255,0.1);
}
.live-action-raise-hand.active {
    background: rgba(255, 193, 7, 0.3);
    animation: raiseHandPulse 1.5s infinite;
}
@keyframes raiseHandPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* === Phase 2: Mic Request Badge === */
.live-mic-request-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f44336;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* === Phase 2: Mic Request List === */
.live-mic-request-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.live-mic-req-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.live-mic-req-name {
    flex: 1;
    font-size: 14px;
}
.live-mic-req-approve {
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
}
.live-mic-req-deny {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
}

/* === Phase 2: Gift Combo === */
.live-gift-combo {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 8px rgba(255,215,0,0.8);
    animation: comboBounce 0.4s ease-out;
}
@keyframes comboBounce {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

/* Gift Tier Styles */
.live-gift-tier-rose {
    background: linear-gradient(135deg, rgba(255,182,193,0.3), rgba(255,105,180,0.2));
    box-shadow: 0 0 12px rgba(255,105,180,0.4);
}
.live-gift-tier-diamond {
    box-shadow: 0 0 20px rgba(185,242,255,0.6);
}
.live-gift-tier-star {
    box-shadow: 0 0 20px rgba(255,215,0,0.6);
}
.live-gift-tier-crown {
    box-shadow: 0 0 24px rgba(255,215,0,0.8);
    animation: giftShake 0.3s ease-in-out;
}
@keyframes giftShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* === Phase 2: Category Filter === */
.live-category-filter {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.live-category-filter::-webkit-scrollbar { display: none; }
.live-category-chip {
    flex-shrink: 0;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--live-border);
    background: transparent;
    color: var(--live-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.live-category-chip:hover {
    border-color: var(--live-accent);
    color: var(--live-accent);
}
.live-category-chip.active {
    background: var(--live-accent);
    border-color: var(--live-accent);
    color: white;
}
.live-card-category {
    font-size: 14px;
    margin-right: 4px;
}

/* === Phase 2: Mic Requests Modal === */
.live-modal-content {
    background: var(--live-bg, #1a1a2e);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 16px;
}

/* ========== PHASE 3-4: Timer ========== */

.live-room-timer {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    color: var(--live-text);
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
}
.live-room-timer.warning {
    color: var(--live-red);
    animation: pulse 1s infinite;
}
.live-extend-btn {
    background: var(--live-accent);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.live-extend-btn:hover { opacity: 0.85; }
.live-extend-btn:disabled,
.live-extend-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.live-end-btn {
    background: var(--live-red);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.live-end-btn:hover { opacity: 0.85; }

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

/* ========== PHASE 3-4: VIP ========== */

.live-chat-vip .live-chat-name {
    color: #FFD700 !important;
    font-weight: bold;
}
.live-vip-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
    margin-right: 4px;
}
.live-speaker-vip {
    border: 2px solid #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* ========== PHASE 3-4: Recording Indicator ========== */

.live-rec-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--live-red);
    font-size: 11px;
    font-weight: bold;
}
.live-rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live-red);
    animation: recPulse 1.5s infinite;
}
@keyframes recPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ========== PHASE 3-4: Entry Consent ========== */

.live-consent-notice {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.entry-consent-dialog {
    background: var(--live-bg);
    border: 1px solid var(--live-border);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 420px;
    width: 90%;
    color: var(--live-text);
}
.entry-consent-title {
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 20px 0;
}
.entry-checks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.entry-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}
.entry-check-row.pending {
    background: rgba(128,128,128,0.08);
    color: var(--live-text-muted);
}
.entry-check-row.ok {
    background: rgba(76,175,80,0.08);
    color: #2e7d32;
}
.entry-check-row.fail {
    background: rgba(244,67,54,0.08);
    color: #c62828;
}
.entry-check-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.entry-check-row.pending .entry-check-icon::after { content: '...'; font-size: 10px; }
.entry-check-row.ok .entry-check-icon { background: rgba(76,175,80,0.15); }
.entry-check-row.ok .entry-check-icon::after { content: '\2713'; color: #2e7d32; font-size: 13px; font-weight: bold; }
.entry-check-row.fail .entry-check-icon { background: rgba(244,67,54,0.15); }
.entry-check-row.fail .entry-check-icon::after { content: '\2717'; color: #c62828; font-size: 13px; font-weight: bold; }
.entry-check-label {
    flex: 1;
}
.entry-divider {
    border: none;
    border-top: 1px solid var(--live-border);
    margin: 14px 0;
}
.entry-guidelines {
    text-align: left;
}
.entry-guideline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--live-text-muted);
}
.entry-guideline-item svg {
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.5;
}
.entry-agree-note {
    font-size: 12px;
    color: var(--live-text-muted);
    opacity: 0.6;
    text-align: center;
    margin: 8px 0 0;
}
.entry-buttons {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.entry-btn-agree {
    width: 100%;
    padding: 13px;
    background: var(--live-accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.entry-btn-agree:hover { opacity: 0.9; }
.entry-btn-settings {
    width: 100%;
    padding: 13px;
    background: var(--live-accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}
.entry-btn-leave {
    width: 100%;
    padding: 10px;
    background: transparent;
    color: var(--live-text-muted);
    border: none;
    font-size: 14px;
    cursor: pointer;
}
.entry-btn-leave:hover { text-decoration: underline; }

/* ========== PHASE 3-4: Mic Purchase ========== */

.live-mic-tiers {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 16px 20px;
}
.live-mic-tier-card {
    background: var(--live-card-bg);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    min-width: 80px;
}
.live-mic-tier-card:hover {
    border-color: var(--live-accent);
    transform: translateY(-2px);
}
.live-mic-tier-card:active {
    transform: scale(0.95);
}
.tier-duration {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
}
.tier-price {
    font-size: 14px;
    color: var(--live-accent);
    font-weight: 600;
}
.live-mic-timer {
    font-size: 12px;
    color: var(--live-accent);
    font-weight: bold;
}

/* ========== PHASE 3-4: Quiz ========== */

.live-quiz-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.live-quiz-question {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 24px;
    text-align: center;
}
.live-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 400px;
}
.live-quiz-option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 14px 20px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: left;
}
.live-quiz-option:hover:not(.disabled) {
    border-color: var(--live-accent);
    background: rgba(99, 102, 241, 0.2);
}
.live-quiz-option.correct {
    border-color: #44BB44;
    background: rgba(68, 187, 68, 0.2);
}
.live-quiz-option.wrong {
    border-color: var(--live-red);
    background: rgba(239, 68, 68, 0.2);
}
.live-quiz-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.live-quiz-timer-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--live-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 16px;
}
.live-quiz-result {
    text-align: center;
    color: #fff;
}
.live-quiz-scores {
    margin-top: 16px;
    font-size: 14px;
}
.live-quiz-settings {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 12px 0;
    flex-wrap: wrap;
}
.live-quiz-settings label {
    font-size: 13px;
    color: var(--live-text-secondary);
}
.live-quiz-settings select {
    padding: 8px;
    border-radius: 6px;
    background: var(--live-card-bg);
    color: var(--live-text);
    border: 1px solid var(--live-border);
    font-size: 13px;
}

/* ========== PHASE 3-4: Roulette ========== */

.live-roulette-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.live-roulette-prize {
    font-size: 18px;
    color: #FFD700;
    margin-bottom: 16px;
    font-weight: 600;
}
.live-roulette-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
}
.live-roulette-wheel {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 4px solid #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.05);
}
.live-roulette-wheel.spinning {
    animation: rouletteSpin 3s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes rouletteSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(1800deg); }
}
.live-roulette-winner {
    text-align: center;
    color: #FFD700;
    font-size: 24px;
    font-weight: bold;
    animation: winnerPop 0.5s ease-out;
}
@keyframes winnerPop {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* ========== PHASE 3-4: Chat Bubbles ========== */

.bubble-star .live-chat-text {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 12px;
    padding: 4px 10px;
    color: #000;
}
.bubble-heart .live-chat-text {
    background: linear-gradient(135deg, #FF6B9D 0%, #FF4444 100%);
    border-radius: 12px;
    padding: 4px 10px;
    color: #fff;
}
.bubble-diamond .live-chat-text {
    background: linear-gradient(135deg, #4FC3F7 0%, #AB47BC 100%);
    border-radius: 12px;
    padding: 4px 10px;
    color: #fff;
}

/* ========== PHASE 3-4: Name Colors ========== */

.live-name-rainbow {
    background: linear-gradient(90deg, #FF0000, #FF7F00, #FFFF00, #00FF00, #0000FF, #4B0082, #8B00FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

/* ========== PHASE 3-4: Entrance Effects ========== */

.live-entrance-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 800;
}
@keyframes entranceFire {
    0% { opacity: 0; transform: translateY(100%); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-20%); }
}
@keyframes entranceStars {
    0% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(0.8); }
}
@keyframes entranceCrown {
    0% { opacity: 0; transform: translateY(-100%) scale(0); }
    50% { opacity: 1; transform: translateY(0) scale(1.2); }
    100% { opacity: 0; transform: translateY(50%) scale(0.8); }
}

/* ========== PHASE 3-4: Input ========== */

.live-input {
    width: 100%;
    padding: 10px 12px;
    margin: 6px 0;
    border: 1px solid var(--live-border);
    border-radius: 8px;
    background: var(--live-card-bg);
    color: var(--live-text);
    font-size: 14px;
    box-sizing: border-box;
}
.live-input:focus {
    border-color: var(--live-accent);
    outline: none;
}
