/* ================================================================
   GAME ROOM - Professional Mobile-First Redesign
   ================================================================ */

/* --- GAME SCREEN LAYOUT (Portrait Mobile First) --- */
#screen-game {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--room-bg, radial-gradient(circle at center, #1b1e22 0%, #0d0e12 100%));
}

/* --- COMPACT HEADER --- */
.game-header {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 100%);
    border-bottom: 1px solid rgba(255,215,0,0.08);
    flex-shrink: 0;
    z-index: 20;
    min-height: 48px;
}

.game-title-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.game-code-badge {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,215,0,0.7);
    font-family: var(--font-english);
}

.score-hud-bar {
    display: flex;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    border: 1px solid rgba(255,255,255,0.06);
}

.score-hud-item {
    display: flex;
    gap: 4px;
    align-items: center;
}

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.header-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 0;
    font-size: 12px;
}

/* --- OPPONENT PLAYER SEAT (TOP) --- */
.opponent-seat-area {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    flex-shrink: 0;
    z-index: 15;
}

/* --- PROFESSIONAL PLAYER SEAT CARD --- */
.pro-player-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 160px;
    max-width: 220px;
}

.pro-player-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.02) 100%);
    pointer-events: none;
}

.pro-player-card.is-turn {
    border-color: rgba(255,215,0,0.5);
    box-shadow: 0 0 20px rgba(255,215,0,0.15), inset 0 0 20px rgba(255,215,0,0.03);
}

.pro-player-card.is-turn::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 14px;
    background: conic-gradient(from 0deg, transparent, rgba(255,215,0,0.3), transparent, rgba(255,215,0,0.1), transparent);
    z-index: -1;
    animation: rotateBorderGlow 3s linear infinite;
}

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

.pro-player-card.is-self {
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    border-color: rgba(255,215,0,0.25);
}

.pro-player-card.is-offline {
    opacity: 0.4;
    filter: grayscale(30%);
}

/* Avatar */
.pro-avatar-ring {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.pro-avatar-ring .avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37 0%, #f5d76e 50%, #b8860b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #1a1a0e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

.pro-avatar-ring .turn-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.pro-player-card.is-turn .turn-ring {
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255,215,0,0.4);
    animation: pulseRing 1.5s ease-in-out infinite;
}

@keyframes pulseRing {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.7; }
}

/* Mic badge on avatar */
.pro-mic-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    z-index: 3;
    border: 1.5px solid #0a2e1f;
}

.pro-mic-badge.mic-on { background: #00ffaa; color: #000; }
.pro-mic-badge.mic-off { background: #ff3e3e; color: #fff; }
.pro-mic-badge.mic-offline { background: #555; color: #fff; }

/* Player info */
.pro-player-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.pro-player-name {
    font-size: 12px;
    font-weight: 700;
    color: #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pro-player-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: rgba(255,255,255,0.45);
}

/* Tiles count badge */
.pro-tiles-count {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
}

.pro-tiles-count .tile-icon {
    width: 10px;
    height: 14px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 2px;
    background: rgba(255,255,255,0.1);
}

/* Emoji bubble on player card */
.pro-emoji-float {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

/* --- TABLE / BOARD AREA --- */
.table-area {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    min-height: 0;
}

/* Premium felt texture */
.table-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 50% 50%, rgba(30, 41, 59, 0.4) 0%, transparent 70%),
        radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.01) 0%, transparent 50%);
    pointer-events: none;
}

.felt-ring {
    position: absolute;
    width: 85%;
    height: 85%;
    border: 1.5px solid rgba(255,255,255,0.03);
    border-radius: 50%;
    pointer-events: none;
}

/* Board container - centered tiles */
#board-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    flex: 1;
    max-height: 180px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 16px 24px;
    scroll-behavior: smooth;
    direction: ltr;
    z-index: 5;
    position: relative;
}

#board-container::-webkit-scrollbar { display: none; }

.board-empty-hint {
    color: rgba(255,255,255,0.25);
    font-size: 14px;
    text-align: center;
    font-weight: 600;
    direction: rtl;
    letter-spacing: 0.5px;
}

/* --- PLAYERS HUD OVERLAY (for 2v2 side players) --- */
#players-hud {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Hide old player-slot system in 1v1 */
.player-slot { display: none; }

/* --- BOTTOM PANEL: Hand + Controls --- */
.game-bottom-controls {
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 100%);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    padding: 6px 10px 10px;
    gap: 6px;
    flex-shrink: 0;
    z-index: 20;
}

.game-hud-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.hud-action-btn {
    flex: 1;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    max-width: 160px;
}

.hud-action-btn.glow {
    animation: glowPulse 1.5s infinite alternate;
}

@keyframes glowPulse {
    0% { border-color: rgba(0,255,170,0.3); box-shadow: 0 0 4px rgba(0,255,170,0.15); }
    100% { border-color: #00ffaa; box-shadow: 0 0 12px rgba(0,255,170,0.4); }
}

/* Hand container */
#hand-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 100px;
    max-height: 120px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 4px 4px;
    direction: ltr;
    gap: 2px;
}

#hand-container::-webkit-scrollbar { display: none; }

/* Domino tiles - Mobile optimized */
.domino-tile.hand-tile {
    width: 44px;
    height: 88px;
    flex-direction: column;
    margin: 0 1px;
    flex-shrink: 0;
}

.domino-tile.hand-tile .pip {
    width: 6px;
    height: 6px;
}

.domino-tile.horizontal {
    width: 56px;
    height: 28px;
}

.domino-tile.vertical {
    width: 28px;
    height: 56px;
}

.domino-tile.horizontal .pip,
.domino-tile.vertical .pip {
    width: 4px;
    height: 4px;
}

/* --- SOCIAL DRAWER (Collapsed by default on mobile) --- */
.social-drawer {
    display: none;
}

/* Emoji bar floats above hand */
.floating-emoji-bar {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
}

.floating-emoji-bar .emoji-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.floating-emoji-bar .emoji-btn:active {
    transform: scale(1.2);
    background: rgba(255,255,255,0.1);
}

/* === PROFESSIONAL WIN/LOSS RESULT CARD === */
.result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 16px;
}

.result-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.result-card {
    width: 100%;
    max-width: 340px;
    border-radius: 20px;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.result-overlay.active .result-card {
    transform: scale(1) translateY(0);
}

/* Win card */
.result-card.win-card {
    background: linear-gradient(165deg, #1a3a2a 0%, #0d1f16 60%, #0a1810 100%);
    border: 1px solid rgba(0,255,170,0.2);
}

.result-card.win-card .result-header {
    background: linear-gradient(135deg, rgba(0,255,170,0.12) 0%, rgba(255,215,0,0.08) 100%);
    border-bottom: 1px solid rgba(0,255,170,0.1);
}

/* Loss card */
.result-card.loss-card {
    background: linear-gradient(165deg, #2a1a1a 0%, #1f0d0d 60%, #180a0a 100%);
    border: 1px solid rgba(255,62,62,0.2);
}

.result-card.loss-card .result-header {
    background: linear-gradient(135deg, rgba(255,62,62,0.12) 0%, rgba(255,100,100,0.05) 100%);
    border-bottom: 1px solid rgba(255,62,62,0.1);
}

/* Result header */
.result-header {
    padding: 24px 20px;
    text-align: center;
    position: relative;
}

.result-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
}

.win-card .result-icon {
    background: linear-gradient(135deg, rgba(0,255,170,0.2) 0%, rgba(255,215,0,0.15) 100%);
    box-shadow: 0 0 30px rgba(0,255,170,0.2);
    border: 1px solid rgba(0,255,170,0.3);
}

.loss-card .result-icon {
    background: linear-gradient(135deg, rgba(255,62,62,0.2) 0%, rgba(255,100,100,0.1) 100%);
    box-shadow: 0 0 30px rgba(255,62,62,0.15);
    border: 1px solid rgba(255,62,62,0.3);
}

.result-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}

.win-card .result-title { color: #00ffaa; }
.loss-card .result-title { color: #ff6b6b; }

.result-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
}

/* Result body */
.result-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Score comparison row */
.result-score-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
}

.result-score-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.result-score-player .rs-name {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}

.result-score-player .rs-score {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-english);
}

.win-card .result-score-player:first-child .rs-score { color: #00ffaa; }
.loss-card .result-score-player:first-child .rs-score { color: #ff6b6b; }
.result-score-player:last-child .rs-score { color: rgba(255,255,255,0.6); }

.result-vs-divider {
    font-size: 12px;
    font-weight: 800;
    color: rgba(255,255,255,0.2);
    text-transform: uppercase;
}

/* Rewards row */
.result-rewards {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.reward-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}

.reward-chip.gold-chip {
    background: rgba(255,215,0,0.08);
    border: 1px solid rgba(255,215,0,0.15);
    color: #ffd700;
}

.reward-chip.xp-chip {
    background: rgba(0,255,170,0.06);
    border: 1px solid rgba(0,255,170,0.12);
    color: #00ffaa;
}

/* Result footer / buttons */
.result-footer {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-footer .glass-btn {
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
}

/* === TURN INDICATOR OVERLAY === */
.turn-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    z-index: 12;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.turn-indicator.visible {
    opacity: 1;
    animation: fadeInOut 2s ease forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

.turn-indicator.your-turn {
    background: rgba(0,255,170,0.15);
    border: 1px solid rgba(0,255,170,0.3);
    color: #00ffaa;
}

.turn-indicator.opponent-turn {
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.2);
    color: rgba(255,215,0,0.8);
}

/* === VICTORY PARTICLES EFFECT === */
.victory-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 250;
    overflow: hidden;
}

.v-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: particleFall linear forwards;
}

@keyframes particleFall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* === DEFEAT VIGNETTE EFFECT === */
.defeat-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 199;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(255,0,0,0.08) 100%);
    opacity: 0;
    animation: defeatPulse 1s ease forwards;
}

@keyframes defeatPulse {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* === RESPONSIVE ADJUSTMENTS === */
@media screen and (max-height: 700px) {
    .pro-player-card { padding: 6px 10px; min-width: 140px; }
    .pro-avatar-ring, .pro-avatar-ring .avatar-circle { width: 34px; height: 34px; font-size: 13px; }
    #hand-container { min-height: 85px; max-height: 100px; }
    .domino-tile.hand-tile { width: 38px; height: 76px; }
    .domino-tile.hand-tile .pip { width: 5px; height: 5px; }
    .result-header { padding: 16px; }
    .result-icon { width: 44px; height: 44px; font-size: 20px; }
    .result-title { font-size: 18px; }
}

@media screen and (max-height: 600px) {
    .game-header { min-height: 40px; padding: 4px 10px; }
    .opponent-seat-area { padding: 4px 12px; }
    .pro-player-card { padding: 4px 8px; min-width: 120px; gap: 6px; }
    .pro-avatar-ring, .pro-avatar-ring .avatar-circle { width: 28px; height: 28px; font-size: 11px; }
    #board-container { padding: 8px 16px; }
    .domino-tile.horizontal { width: 46px; height: 23px; }
    .domino-tile.vertical { width: 23px; height: 46px; }
    .domino-tile.horizontal .pip, .domino-tile.vertical .pip { width: 3px; height: 3px; }
    .game-bottom-controls { padding: 4px 8px 6px; gap: 4px; }
    #hand-container { min-height: 72px; max-height: 85px; }
    .domino-tile.hand-tile { width: 34px; height: 68px; }
    .domino-tile.hand-tile .pip { width: 4px; height: 4px; }
}

/* ================================================================
   SLIDING CHAT PANEL / BOTTOM SHEET
   ================================================================ */
.chat-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.chat-panel-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.chat-panel-sheet {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(180deg, #181a1f 0%, #101114 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
    padding: 16px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 80vh;
}

.chat-panel-overlay.active .chat-panel-sheet {
    transform: translateY(0);
}

.chat-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #ffd700;
}

.chat-panel-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.chat-emojis-section, .chat-phrases-section, .chat-messages-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: right;
}

/* Emojis */
.reaction-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
}

.reaction-bar::-webkit-scrollbar { display: none; }

.reaction-bar .emoji-btn {
    font-size: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.reaction-bar .emoji-btn:active {
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.1);
}

/* Quick Phrases */
.phrases-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 100px;
    overflow-y: auto;
}

.quick-phrase-tag {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.15);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-phrase-tag:active {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-1px);
}

/* Messages log */
.messages-log {
    height: 150px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    font-size: 11px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 80%;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 10px;
    border-radius: 0 10px 10px 10px;
}

.chat-message.self {
    align-self: flex-end;
    align-items: flex-end;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 10px 0 10px 10px;
}

.chat-sender {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    font-size: 9px;
    margin-bottom: 2px;
}

.chat-message.self .chat-sender {
    color: #ffd700;
}

.chat-text {
    color: #fff;
    word-break: break-all;
}

/* Input Row */
.chat-input-row {
    display: flex;
    gap: 8px;
}

.chat-input-row input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 12px;
}

.chat-input-row input:focus {
    border-color: #ffd700;
    outline: none;
}

/* ================================================================
   FLOATING CHAT BUBBLE OVER PLAYER CARD
   ================================================================ */
.pro-chat-bubble {
    position: absolute;
    bottom: 52px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 17, 20, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.35);
    color: #fff;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    z-index: 100;
    pointer-events: none;
    animation: popChatBubble 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.pro-chat-bubble::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: rgba(16, 17, 20, 0.95) transparent;
}

.pro-chat-bubble.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s ease;
}

@keyframes popChatBubble {
    from { opacity: 0; transform: translateX(-50%) scale(0.8) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}

/* ================================================================
   SPEAKING AUDIO WAVE INDICATORS
   ================================================================ */
.pro-avatar-ring.speaking::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2.5px solid #ffd700;
    animation: speakRipple 0.8s ease-out infinite;
    z-index: 1;
}

@keyframes speakRipple {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.35); opacity: 0; }
}
