/* ==============================================
   LIVE ROOM - CORE LAYOUT & CONTROLS
   ============================================== */

.live-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    pointer-events: none;
}

/* iOS Capacitor: Push live header below Dynamic Island */
body.ios-app .live-header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
}

.header-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: auto;
}

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

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

.live-header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    margin: 0 16px;
    overflow: hidden;
    pointer-events: auto;
}

.live-avatars {
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 2px 4px;
}

.live-avatars::-webkit-scrollbar {
    display: none;
}

.live-avatars .participant {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-left: -8px;
    border: 2px solid rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow: visible;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Speaking player highlight + auto-center target */
.live-avatars .participant.speaking {
    border-color: var(--gold, #f3c26a);
    box-shadow: 0 0 12px var(--gold-glow, rgba(243, 194, 106, 0.5));
    transform: scale(1.15);
    z-index: 10;
}

.live-avatars .participant:first-child {
    margin-left: 0;
}

.live-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.live-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-topic-row {
    max-width: 100%;
}

.live-topic {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 260px;
    /* Limits width and triggers ellipsis */
}

.live-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff3b30;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Chat Container (Main Wrapper) */
.chat-container {
    display: none;
    flex-direction: column;
    overflow: hidden;
    height: calc(100vh - var(--top-bar-height));
    width: 100%;
    position: absolute;
    top: var(--top-bar-height);
    left: 0;
    z-index: 850;
    /* Below top-bar (900) */
    background: linear-gradient(135deg, rgba(8, 8, 12, 0.95) 0%, rgba(5, 5, 8, 0.98) 100%);
    backdrop-filter: blur(60px);
    -webkit-backdrop-filter: blur(60px);
    transition: opacity 0.3s ease;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    margin-top: 0;
}

.chat-container.active {
    display: flex;
    opacity: 1;
}

/* iOS (Capacitor): live room must be true full-screen.
   - top-bar is hidden in live room, so the default top offset creates a visible "inset card" look.
   - chatContainer also carries `.glass` which adds rounded corners + border; remove for immersive view. */
body.ios-app.in-live-room .chat-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

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

.action-bar {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: bottom center;
    max-height: 60px;
}

.action-bar.collapsed {
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    padding: 0;
    margin: 0;
    border-width: 0;
    position: absolute;
    transform: translateY(15px) scaleY(0.7);
}


.action-btn {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

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

.action-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--gold);
}

.action-btn.muted {
    color: rgba(255, 255, 255, 0.4);
}

.room-lang-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    height: 48px;
    padding: 0 36px 0 16px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.6)' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    margin-left: 4px;
}

.room-lang-select:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.room-lang-select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(243, 194, 106, 0.1);
}

.room-lang-select option {
    background-color: #1a1a1a;
    color: white;
}

/* Mic Action Button - Meeting Style */
.action-btn.mic-action {
    background: rgba(255, 255, 255, 0.05);
}

.action-btn.mic-action.speaking {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
    animation: speaking-glow 1.5s infinite;
}

.action-btn.mic-action i {
    transition: transform 0.2s;
}

.action-btn.mic-action.speaking i {
    transform: scale(1.1);
}

@keyframes speaking-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.3);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(52, 199, 89, 0);
    }
}

/* Floating toggle (mobile-only — toggles action bar visibility) */
.floating-toggle-btn {
    display: flex;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Input Row */
.input-row {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 500px;
}

.live-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 20px;
    border-radius: 24px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.live-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.live-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.send-btn-live {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(94, 234, 212, 0.3);
}

.send-btn-live:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(94, 234, 212, 0.4);
}

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

/* Creator Controls */
.creator-controls {
    margin-top: 8px;
}

.end-btn {
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #ff3b30;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.end-btn:hover {
    background: rgba(255, 59, 48, 0.25);
}

/* Audio Progress */
.audio-progress-container {
    margin-bottom: 12px;
}

/* Online Indicator */
.online-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin-left: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.online-indicator i {
    font-size: 0.75rem;
    color: #34c759;
}

/* Action Button Indicators (Likes/Dislikes) */
.action-btn span {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--gold);
    color: black;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.action-btn span:empty {
    display: none;
}


/* Participant Drawer */
.participant-drawer {
    position: absolute;
    top: 100px;
    right: 20px;
    bottom: calc(100px + env(safe-area-inset-bottom));
    width: 320px;
    background: rgba(15, 15, 20, 0.8);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    flex-direction: column;
    z-index: 1001;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.participant-drawer.active {
    display: flex;
    transform: translateX(0);
}

.drawer-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.drawer-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
}

.drawer-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

.participant-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    transition: background 0.2s;
    cursor: pointer;
}

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

.participant-item .item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.participant-item .item-info {
    flex: 1;
}

.participant-item .item-name {
    display: block;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.participant-item .item-role {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

.participant-item .item-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.participant-item:hover .item-actions {
    opacity: 1;
}

.participant-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
}

.participant-action-btn:hover {
    background: var(--gold);
    color: black;
}.clickable-avatar { cursor: pointer; transition: transform 0.2s; } .clickable-avatar:hover { transform: scale(1.05); }
/* ==============================================
   LIVE ROOM - CHAT & LYRICS SYSTEM
   ============================================== */

/* Messages Container - Apple Music Lyrics Style */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 30vh 32px 25vh;
    /* Large vertical padding to center first/last items */
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Fade mask at top and bottom */
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

.messages-container::-webkit-scrollbar {
    display: none;
}

/* Live Lyrics Line - Apple Music Style */
.live-lyrics-line {
    text-align: left;
    padding: 16px 24px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0.5;
    transform: scale(0.95);
    border-left: 3px solid transparent;
}

.live-lyrics-line:hover {
    opacity: 0.75;
    background: rgba(255, 255, 255, 0.03);
}

.live-lyrics-line.active {
    opacity: 1;
    transform: scale(1);
    background: linear-gradient(135deg, rgba(243, 194, 106, 0.12) 0%, rgba(243, 194, 106, 0.03) 100%);
    border-left: 4px solid var(--gold);
    padding-left: 20px;
}

.live-lyrics-line.user-line {
    opacity: 1;
    text-align: right;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(236, 72, 153, 0.08) 100%);
    border-left: none;
    border-right: 4px solid var(--purple);
    padding-right: 20px;
    padding-left: 24px;
}

.live-lyrics-meta {
    display: block;
    font-size: 0.85rem;
    color: var(--gold);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-lyrics-meta .avatar-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    overflow: hidden;
}

.live-lyrics-line.user-line .live-lyrics-meta {
    color: var(--purple);
}

.live-lyrics-text {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.live-lyrics-line.active .live-lyrics-text {
    color: #fff;
    text-shadow: 0 0 30px rgba(243, 194, 106, 0.4);
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 16px;
    max-width: 85%;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message .avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.message .bubble {
    padding: 16px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    position: relative;
    transition: all 0.3s ease;
}

.message.user .bubble {
    background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
    border: none;
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.2);
}

.message .sender {
    font-size: 0.8rem;
    color: var(--gold);
    margin-bottom: 6px;
    font-weight: 700;
}

.message .content {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Live Mode Sentence Highlighting (Apple Podcast Style) */
.message .content .sentence {
    display: inline;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 2px 4px;
    border-radius: 6px;
    margin: 0 1px;
}

.message .content .sentence.active {
    color: var(--gold);
    text-shadow: 0 0 20px rgba(243, 194, 106, 0.5);
    background: rgba(243, 194, 106, 0.1);
    font-weight: 600;
}

/* Text Toggle Logic */
.messages-container.hidden-text .bubble,
.messages-container.hidden-text .live-lyrics-line {
    opacity: 0 !important;
    filter: blur(8px);
    pointer-events: none;
    transform: scale(0.95);
}

.messages-container.hidden-text .message.user .bubble,
.messages-container.hidden-text .live-lyrics-line.user-line {
    opacity: 1 !important;
    filter: none;
}

/* ==============================================
   PREMIUM FLOATING CONTROLS
   ============================================== */

.live-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    z-index: 9999;
}

.mic-hint {
    background: rgba(243, 194, 106, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(243, 194, 106, 0.2);
    color: var(--gold);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    animation: fadeInDown 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Current Subtitle in Control Bar */
.live-current-subtitle {
    width: 100%;
    max-width: 600px;
    min-height: 44px;
    padding: 10px 20px;
    margin-bottom: 12px;
    background: rgba(243, 194, 106, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(243, 194, 106, 0.2);
    border-radius: 16px;
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    display: none;
    /* Injected via JS when active */
    animation: slideUpFade 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.live-current-subtitle:empty {
    display: none !important;
}

/* AI Avatar Overlay — Premium Podcast Studio Mode */
.live-avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(243, 194, 106, 0.03) 0%, transparent 60%);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.live-avatar-overlay.hidden {
    opacity: 0;
    transform: scale(0.92);
    display: none !important;
}

/* Inner Box Container — Matches Replay Mode .album-art */
.live-album-art {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, #333, #111);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    gap: 16px;
    pointer-events: auto;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Layout shift for non-subtitle mode when vote panel is open */
body.hidden-text:has(#game-vote-panel:not(.hidden)) .live-album-art {
    transform: translateY(-15vh) scale(0.85);
}

/* Individual Avatar Card */
.live-avatar-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 12px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.live-avatar-item .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background-color: rgba(20, 20, 30, 0.95);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.06);
    border: 3px solid rgba(255, 255, 255, 0.08);
    animation: avatarBreathing 4s ease-in-out infinite;
    transition: border-color 0.4s ease, box-shadow 0.6s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Character Name Label */
.live-avatar-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.3s ease;
    pointer-events: none;
}

/* Speaking State — Golden Glow + Ring Pulse + Bounce-In Scale */
.live-avatar-item.speaking .avatar-img {
    border-color: rgba(243, 194, 106, 0.7);
    box-shadow:
        0 0 0 4px rgba(243, 194, 106, 0.25),
        0 0 30px rgba(243, 194, 106, 0.2),
        0 0 60px rgba(243, 194, 106, 0.08),
        0 20px 50px rgba(0, 0, 0, 0.5);
    animation: speakingPulse 2s ease-in-out infinite, speakingBounceIn 0.6s ease-out forwards;
}

/* Crimson Pulse for Wolf Night Channel */
.wolf-channel-active .live-avatar-item.speaking .avatar-img {
    border-color: rgba(220, 38, 38, 0.7);
    box-shadow:
        0 0 0 4px rgba(220, 38, 38, 0.25),
        0 0 30px rgba(220, 38, 38, 0.2),
        0 0 60px rgba(220, 38, 38, 0.08),
        0 20px 50px rgba(0, 0, 0, 0.5);
    animation: wolfSpeakingPulse 2s ease-in-out infinite, speakingBounceIn 0.6s ease-out forwards;
}

.live-avatar-item.speaking .live-avatar-name {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 12px rgba(243, 194, 106, 0.3), 0 2px 8px rgba(0, 0, 0, 0.6);
}

.wolf-channel-active .live-avatar-item.speaking .live-avatar-name {
    text-shadow: 0 0 12px rgba(220, 38, 38, 0.5), 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Non-speaking Avatars — Dim when at least one is speaking */
.live-album-art:has(.live-avatar-item.speaking) .live-avatar-item:not(.speaking) {
    opacity: 0.5;
    transform: scale(0.95);
}

.live-album-art:has(.live-avatar-item.speaking) .live-avatar-item:not(.speaking) .avatar-img {
    border-color: rgba(255, 255, 255, 0.04);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    animation: none;
}

.live-album-art:has(.live-avatar-item.speaking) .live-avatar-item:not(.speaking) .live-avatar-name {
    color: rgba(255, 255, 255, 0.3);
}

/* Subtle Breathing Animation (idle) */
@keyframes avatarBreathing {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.015);
    }
}

/* Speaking Pulse Animation */
@keyframes speakingPulse {

    0%,
    100% {
        box-shadow:
            0 0 0 4px rgba(243, 194, 106, 0.25),
            0 0 30px rgba(243, 194, 106, 0.2),
            0 0 60px rgba(243, 194, 106, 0.08),
            0 20px 50px rgba(0, 0, 0, 0.5);
    }

    50% {
        box-shadow:
            0 0 0 6px rgba(243, 194, 106, 0.35),
            0 0 40px rgba(243, 194, 106, 0.25),
            0 0 80px rgba(243, 194, 106, 0.12),
            0 20px 50px rgba(0, 0, 0, 0.5);
    }
}

/* Wolf Speaking Pulse Animation */
@keyframes wolfSpeakingPulse {
    0%,
    100% {
        box-shadow:
            0 0 0 4px rgba(220, 38, 38, 0.25),
            0 0 30px rgba(220, 38, 38, 0.2),
            0 0 60px rgba(220, 38, 38, 0.08),
            0 20px 50px rgba(0, 0, 0, 0.5);
    }

    50% {
        box-shadow:
            0 0 0 6px rgba(220, 38, 38, 0.35),
            0 0 40px rgba(220, 38, 38, 0.25),
            0 0 80px rgba(220, 38, 38, 0.12),
            0 20px 50px rgba(0, 0, 0, 0.5);
    }
}

/* Bounce-In Scale for Speaker Activation */
@keyframes speakingBounceIn {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1.04);
    }
}

/* Hover state on avatars */
.live-avatar-item:hover .avatar-img {
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.04);
}

.live-avatar-item:hover .live-avatar-name {
    color: #fff;
}/* ==============================================
   COMPONENTS - SHARED UI PRIMITIVES
   ============================================== */

.character-card {
    flex: 0 0 auto;
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.7;
}

.character-card:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.character-card.selected {
    opacity: 1;
    transform: scale(1.05);
}

.character-card .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.character-card.selected .avatar {
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.character-card .char-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.character-card.selected .char-name {
    color: var(--cyan);
    font-weight: 500;
}

/* ==============================================
   AVATAR ASSETS
   ============================================== */

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

.room-category .avatar-img {
    width: 18px;
    height: 18px;
    margin-right: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message .avatar .avatar-img {
    border-radius: 12px;
}

.participant .avatar-img {
    border-radius: 50%;
}

/* User Profile & Auth Primitives */
.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile-zone {
    position: relative;
}

.btn-login {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 12px 4px 4px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #151518;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 140px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 1001;
}

.dropdown-item {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* Modal Overlay & Base */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    /* Controlled by JS */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.premium-select-sm {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.4)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 28px !important;
}

.room-stats {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

.stat-item.duration {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item.duration i {
    font-size: 0.7rem;
    color: var(--cyan);
    opacity: 0.8;
}

.stat-item i {
    font-size: 0.8rem;
}

.room-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.4);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
}

.room-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.room-action-btn:active {
    transform: translateY(0);
}

.share-btn:hover {
    color: #10b981;
}

/* Like/Dislike/Save */
.like-btn:hover {
    color: var(--gold);
}

.dislike-btn:hover {
    color: #f43f5e;
}

.save-btn:hover {
    color: #3b82f6;
}

/* Share Modal & Grid */
.share-modal-compact {
    max-width: 360px;
    width: 90%;
    padding: 24px !important;
    border-radius: 28px !important;
}

/* Unmute Indicator (YouTube Style) */
.unmute-indicator {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(243, 194, 106, 0.95);
    color: #000;
    padding: 10px 24px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 5000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    animation: slideInDown 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.unmute-indicator:hover {
    transform: translateX(-50%) scale(1.05);
}

.unmute-indicator.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.autoplay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: white;
    font-weight: 600;
}

.play-pulse-btn {
    width: 80px;
    height: 80px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: black;
    box-shadow: 0 0 20px rgba(184, 134, 11, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(184, 134, 11, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(184, 134, 11, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(184, 134, 11, 0);
    }
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px 0 10px;
}

.social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 8px;
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.social-btn i {
    font-size: 1.4rem;
    transition: transform 0.2s;
}

.social-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: transform 0.2s;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    color: white;
}

.social-btn:hover i {
    transform: scale(1.1);
}

/* Social Platform Colors */
.social-btn.wechat:hover {
    color: #07C160;
    border-color: #07C160;
}

.social-btn.whatsapp:hover {
    color: #25D366;
    border-color: #25D366;
}

.social-btn.discord:hover {
    color: #5865F2;
    border-color: #5865F2;
}

.social-btn.youtube:hover {
    color: #FF0000;
    border-color: #FF0000;
}

.social-btn.x-twitter:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.social-btn.facebook:hover {
    color: #1877F2;
    border-color: #1877F2;
}

.social-btn.linkedin:hover {
    color: #0A66C2;
    border-color: #0A66C2;
}

.social-btn.reddit:hover {
    color: #FF4500;
    border-color: #FF4500;
}

.social-btn.pinterest:hover {
    color: #BD081C;
    border-color: #BD081C;
}

.social-btn.redbook:hover {
    color: #FF2442;
    border-color: #FF2442;
}

.social-btn.email:hover {
    color: #EA4335;
    border-color: #EA4335;
}

.social-btn.copy:hover {
    color: var(--gold);
    border-color: var(--gold);
}

/* Replay Player Interactions */
.player-interactions {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
    padding-bottom: 20px;
}

.player-action-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-action-btn:hover {
    color: white;
    transform: scale(1.1);
}

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

#playerShareBtn:hover {
    color: #10b981;
}

#playerLikeBtn:hover {
    color: var(--gold);
}

#playerDislikeBtn:hover {
    color: #f43f5e;
}

#playerSaveBtn:hover {
    color: #3b82f6;
}

.player-action-btn.active {
    opacity: 1;
}

/* Room More Menu */
.room-more-menu {
    position: fixed;
    /* Matches JS */
    background: rgba(25, 25, 30, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 6px;
    z-index: 1000;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: max-content;
    animation: menu-slide-up 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes menu-slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.room-more-item {
    background: none;
    border: none;
    color: white;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    width: 120px;
    text-align: left;
}

.room-more-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.room-more-item i {
    width: 16px;
    text-align: center;
    opacity: 0.7;
}

.room-action-btn.more-btn {
    opacity: 0.6;
}

.room-action-btn.more-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}/* ==============================================
   MODALS & OVERLAYS
   - Settings & Create Room Overlay
   - Login & Auth Modals
   - Social Share Modal
   ============================================== */

/* Base Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top, 20px)) 20px max(20px, env(safe-area-inset-bottom, 20px)) 20px;
    animation: fadeIn 0.3s ease;
}

.create-room-modal {
    max-width: 600px;
}

.modal-content {
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

/* iOS: Ensure modal content clears the bottom tab bar */
body.ios-app .settings-overlay .modal-content {
    max-height: calc(90vh - 60px);
    padding-bottom: 20px;
}

.settings-card {
    width: 100%;
    max-width: 500px;
    padding: 32px;
    border-radius: 32px;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8);
}

.modal-header h3 {
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: var(--gold);
    font-weight: 800;
    text-align: center;
}

.modal-close-icon {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.modal-close-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.form-group label span.guest-counter {
    font-size: 0.8rem;
    color: var(--gold);
    font-weight: normal;
    background: rgba(243, 194, 106, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.form-group input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 18px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.form-group input[type="text"]:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
}

.topic-input-wrapper {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.topic-input-wrapper textarea {
    flex: 1;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 18px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
    resize: none;
    min-height: 56px;
    max-height: 140px;
    line-height: 1.5;
    overflow-y: auto;
}

.topic-input-wrapper textarea:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
}

.topic-input-wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

.topic-url-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    padding-left: 4px;
    transition: color 0.2s;
}

.topic-url-hint i {
    font-size: 0.7rem;
    color: var(--cyan, #5eead4);
    opacity: 0.6;
}

.topic-input-wrapper textarea.has-url {
    border-color: var(--cyan, #5eead4);
    background: rgba(94, 234, 212, 0.05);
}

.topic-input-wrapper .btn-text-action {
    margin-top: 12px;
}

.btn-text-action {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.btn-text-action:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.btn-text-action i {
    font-size: 1.2rem;
}

.modal-footer {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.modal-footer button {
    flex: 1;
}

/* Character Selection Grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    margin-bottom: 12px;
}

.char-select-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.char-select-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.char-select-card.selected {
    background: rgba(243, 194, 106, 0.15);
    border-color: var(--gold);
}

.char-select-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.char-select-card.selected .char-select-avatar {
    border-color: var(--gold);
}

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

.char-select-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.char-select-card.selected .char-select-name {
    color: var(--gold);
    font-weight: 700;
}

/* Social Share Modal */
.social-btn-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--gold);
}

.social-btn i {
    font-size: 1.5rem;
}

.social-btn .fa-x-twitter {
    color: #fff;
}

.social-btn .fa-whatsapp {
    color: #25D366;
}

.social-btn .fa-weixin {
    color: #07C160;
}

.social-btn .fa-link {
    color: var(--gold);
}

/* Creation Mode Switcher (within room creation modal) */
.creation-mode-switcher {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 16px;
}

.mode-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mode-tab.active {
    background: var(--gold);
    color: #1a1a1a;
    box-shadow: 0 4px 15px var(--gold-glow);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- Premium Confirmation Modal Redesign --- */
.confirm-modal-premium {
    max-width: 420px;
    padding: 0;
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    background: linear-gradient(135deg, rgba(25, 25, 25, 0.8) 0%, rgba(15, 15, 15, 0.95) 100%);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    position: relative;
}

.modal-body-premium {
    padding: 48px 40px 32px;
    text-align: center;
}

.confirm-icon-glow {
    width: 80px;
    height: 80px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    font-size: 2.8rem;
    color: var(--gold);
    background: rgba(255, 191, 0, 0.08);
    position: relative;
    box-shadow: inset 0 0 20px rgba(255, 191, 0, 0.05);
}

.confirm-icon-glow::after {
    content: '';
    position: absolute;
    inset: -10px;
    background: var(--gold);
    opacity: 0.15;
    filter: blur(25px);
    border-radius: 50%;
    z-index: -1;
}

/* Danger Variant - Sophisticated Sunset/Crimson */
.confirm-modal-premium.danger .confirm-icon-glow {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.06);
    box-shadow: inset 0 0 20px rgba(255, 107, 107, 0.03);
}

.confirm-modal-premium.danger .confirm-icon-glow::after {
    background: #ff6b6b;
    opacity: 0.1;
}

.premium-modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.premium-modal-msg {
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    font-size: 1.05rem;
    margin-bottom: 0;
}

.confirm-actions-premium {
    padding: 24px 32px 32px;
    display: flex;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.confirm-actions-premium button {
    flex: 1;
    height: 54px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-secondary-premium {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary-premium:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.btn-primary-premium {
    background: var(--gold);
    color: #000000;
    border: none;
    box-shadow: 0 10px 20px -5px rgba(255, 191, 0, 0.3);
}

.btn-primary-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -8px rgba(255, 191, 0, 0.45);
    filter: brightness(1.1);
}

.confirm-modal-premium.danger .btn-primary-premium {
    background: linear-gradient(135deg, #ff6b6b 0%, var(--danger) 100%);
    color: #ffffff;
    box-shadow: 0 10px 20px -5px rgba(238, 82, 83, 0.25);
}

.confirm-modal-premium.danger .btn-primary-premium:hover {
    box-shadow: 0 15px 30px -8px rgba(238, 82, 83, 0.4);
}

/* Animations */
@keyframes premiumModalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.confirm-modal-premium {
    animation: premiumModalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}#replayActions { pointer-events: auto; }
