/* =========================================
   Vibe Poker Stylesheet V3.9 (Commercial UI Upgrade)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Russo+One&display=swap');

:root { --bg-dark: #0f172a; --primary: #10b981; --accent: #f59e0b; --red: #ef4444; --gold: #ffd700; --suit-s: #0f172a; --suit-h: #ef4444; --suit-c: #10b981; --suit-d: #3b82f6; --card-w: 44px; --card-h: 64px; --btn-size: 66px; --btn-chip: 52px; --avatar-sz: 54px; --font-stack: "PingFang SC", "Microsoft YaHei", "Inter", -apple-system, sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; font-family: var(--font-stack); }
body { margin: 0; background: #000; color: #fff; height: 100vh; height: 100dvh; overflow: hidden; position: fixed; width: 100%; }

/* Lobby */
#lobby-page { height: 100%; display: flex; justify-content: center; align-items: center; padding: 20px; background: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 100%); position: relative; }
#lobby-page::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: conic-gradient(from 0deg at 50% 50%, transparent, rgba(16, 185, 129, 0.05), transparent); animation: rotate-slow 20s linear infinite; pointer-events: none; }
@keyframes rotate-slow { to { transform: rotate(360deg); } }
.lobby-container { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; z-index: 10; }
.brand-header { text-align: center; margin-bottom: 5px; margin-top: -40px; }
.logo-icon { font-size: 60px; color: var(--primary); text-shadow: 0 0 40px rgba(16, 185, 129, 0.6); line-height: 1; filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3)); }
.brand-header h1 { margin: 0; font-size: 28px; letter-spacing: 6px; font-weight: 900; background: linear-gradient(to right, #fff, #cbd5e1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
.avatar-section.top-aligned { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; padding: 0 10px; }
.avatar-preview { width: 60px; height: 60px; border-radius: 16px; background: #1e293b; border: 2px solid rgba(16, 185, 129, 0.5); box-shadow: 0 0 15px rgba(16, 185, 129, 0.15); overflow: hidden; flex-shrink: 0; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-section .input-group.expanded { flex: 1; }
.avatar-section input { width: 100%; height: 60px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; font-size: 18px; font-weight: 600; color: #fff; padding: 0 20px; outline: none; transition: all 0.2s ease; }
.avatar-section input:focus { background: rgba(255, 255, 255, 0.1); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.tab-header { display: flex; background: rgba(0, 0, 0, 0.4); padding: 5px; border-radius: 40px; border: 1px solid rgba(255, 255, 255, 0.05); }
.tab-item { flex: 1; text-align: center; padding: 12px 0; border-radius: 35px; font-size: 15px; font-weight: 600; color: #94a3b8; cursor: pointer; transition: all 0.3s; }
.tab-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); transform: scale(1.02); }
.tab-item:nth-child(2).active { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4); }
.settings-card { background: rgba(20, 30, 46, 0.95); border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.05); backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); height: 360px; display: flex; flex-direction: column; justify-content: center; gap: 25px; padding: 0 24px; transition: height 0.3s ease; }
.setting-row { width: 100%; margin-bottom: 0; }
.setting-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 15px; color: #cbd5e1; font-weight: 500; letter-spacing: 0.5px; }
.setting-val { color: var(--primary); font-weight: bold; font-family: 'Courier New', monospace; font-size: 16px; display: inline-block; width: 60px; height: 20px; line-height: 20px; text-align: right; white-space: nowrap; flex-shrink: 0; }
.val-infinite { color: var(--gold); font-size: 15px; font-weight: 800; position: relative; top: -1px; }
.custom-range { -webkit-appearance: none; width: 100%; height: 20px; background: transparent; outline: none; margin: 0; cursor: pointer; display: block; }
.custom-range::-webkit-slider-runnable-track { width: 100%; height: 6px; background: #1e293b; border-radius: 3px; background-image: linear-gradient(var(--primary), var(--primary)); background-size: 0% 100%; background-repeat: no-repeat; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5); }
.custom-range::-webkit-slider-thumb { -webkit-appearance: none; height: 24px; width: 24px; border-radius: 50%; background: #fff; cursor: pointer; margin-top: -9px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); border: 2px solid #e2e8f0; position: relative; z-index: 2; }
.join-input-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.join-label { color: #94a3b8; font-size: 15px; margin-bottom: 20px; }
.big-code-input { width: 100%; font-size: 36px; letter-spacing: 10px; text-align: center; background: transparent; border: none; border-bottom: 2px solid var(--primary); color: white; padding: 10px; outline: none; font-family: monospace; font-weight: bold; transition: border-color 0.2s; }
.big-code-input:focus { border-bottom-color: var(--gold); }
.action-area { margin-top: 20px; }
.btn-primary { width: 100%; background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; border: none; padding: 18px; border-radius: 16px; font-size: 18px; font-weight: bold; cursor: pointer; box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3); transition: transform 0.1s; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; line-height: normal;}
.btn-primary:active { transform: scale(0.96); }
.btn-join { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3); }

/* Game Page */
#game-page { width: 100%; height: 100%; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 40%, #2c5e42 0%, #0f2b1d 100%); box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.8); padding-bottom: env(safe-area-inset-bottom); }
.top-bar { position: absolute; top: 0; left: 0; width: 100%; padding: 10px 16px; display: flex; justify-content: flex-end; align-items: flex-start; z-index: 5000; pointer-events: none; }
.top-actions { display: flex; gap: 8px; pointer-events: auto; }
.icon-btn { width: 32px; height: 32px; background: rgba(0, 0, 0, 0.4); border-radius: 50%; display: flex; justify-content: center; align-items: center; border: 1px solid rgba(255, 255, 255, 0.1); font-size: 18px; backdrop-filter: blur(4px); cursor: pointer; color: #ccc; transition: all 0.2s; }
.table-info { position: absolute; top: 12px; left: 16px; display: flex; flex-direction: row; align-items: center; gap: 16px; z-index: 4000; pointer-events: none; opacity: 0.85; transition: opacity 0.3s; }
.info-row { display: flex; align-items: center; position: relative; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
.info-row:not(:last-child)::after { content: ""; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); width: 1px; height: 10px; background: rgba(255, 255, 255, 0.4); }
.info-icon { font-size: 12px; margin-right: 5px; color: #ffffff !important; opacity: 0.9; }
.info-val { font-family: 'Courier New', monospace; font-size: 13px; font-weight: 700; color: #ffffff; letter-spacing: 0.5px; padding-top: 1px; }
.poker-table { position: absolute; inset: 0; pointer-events: none; }
.center-area { position: absolute; top: 25%; left: 50%; transform: translate(-50%, 0); width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; }

/* =========================================
   🔥 V9.2 商业级 UI 升级模块：右上角菜单
   ========================================= */
.menu-container { position: relative; display: flex; align-items: center; justify-content: center; }
.room-dropdown-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    min-width: 150px;
    padding: 6px 0;
    opacity: 0; visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 6000;
    backdrop-filter: blur(12px);
}
.room-dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; cursor: pointer; color: #e2e8f0; font-size: 15px; font-weight: 600;
    transition: background 0.15s;
}
.menu-item:active { background: rgba(255, 255, 255, 0.1); }
.menu-icon { font-size: 18px; color: #94a3b8; }
.menu-item.danger { color: #f87171; }
.menu-item.danger .menu-icon { color: #f87171; }
.menu-item.highlight { color: #10b981; }
.menu-item.highlight .menu-icon { color: #10b981; }
.menu-divider { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 4px 0; }

/* Pot Container */
.pot-container { display: flex; flex-direction: row; align-items: center; gap: 6px; order: 2; margin-top: 0px; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(4px); padding: 5px 16px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 100px; min-width: auto; pointer-events: none; z-index: 100; }
.pot-icon { width: 15px; height: 15px; border-radius: 50%; background: var(--gold); border: 2px dashed #b45309; display: inline-block; box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); flex-shrink: 0; }
.pot-amount { color: var(--gold); font-size: 18px; font-weight: 900; font-family: monospace; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); line-height: 1; margin-top: 1px; }

/* Board Cards */
.board-cards { display: flex; flex-direction: row; justify-content: center; gap: 2px; order: 1; margin-bottom: 12px; min-height: 64px; position: relative; pointer-events: auto; z-index: 20; }
.board-slot { width: var(--card-w); height: var(--card-h); border-radius: 5px; border: 2px dashed rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.1); }
.win-desc { display: none;margin-top: 15px; height: 24px; color: #fff; font-size: 13px; font-weight: bold; background: var(--primary); padding: 4px 12px; border-radius: 12px; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4); }
.card { width: var(--card-w); height: var(--card-h); background: #fff; border-radius: 5px; position: relative; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); overflow: hidden; font-family: 'Arial', sans-serif; user-select: none; }
.card.back { background: #1e293b; border: 2px solid #fff; background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0, rgba(255, 255, 255, 0.06) 2px, transparent 2px, transparent 6px); }
.card.suit-s { color: var(--suit-s); } .card.suit-c { color: var(--suit-c); } .card.suit-h { color: var(--suit-h); } .card.suit-d { color: var(--suit-d); }
.card-idx { position: absolute; top: 4px; left: 5px; display: flex; flex-direction: column; align-items: center; line-height: 0.9; z-index: 10; }
.card-val { font-size: 19px; font-weight: 900; letter-spacing: -1px; text-align: center; }
.card-suit-sm { font-size: 16px; margin-top: 1px; }
.card.face-card { background: #fdfdfd; }
.board-card.highlight { border: 2px solid var(--gold); box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); transform: none; z-index: 10; }
.board-card.dim { filter: brightness(0.4) grayscale(0.8); opacity: 0.7; transform: scale(0.95); }

/* Seats */
#seats-layer { position: absolute; inset: 0; pointer-events: none; z-index: 50; }
.seat-node { position: absolute; width: 90px; height: 90px; pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: left 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), top 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); transform: translateX(0); }
.seat-hero { top: auto !important; bottom: calc(220px + env(safe-area-inset-bottom)) !important; left: 50% !important; transform: translateX(-50%) !important; z-index: 200 !important; pointer-events: auto !important; display: flex !important; }
.seat-node.seat-hero.playing-mode .seat-layout { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
.seat-node.seat-hero:not(.playing-mode) .seat-layout { opacity: 1 !important; visibility: visible !important; display: flex !important; transition: opacity 0.3s ease; }
#hero-anim-anchor { position: absolute; bottom: calc(220px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: 10px; height: 10px; background: transparent; pointer-events: none; z-index: 49; visibility: visible !important; }
.seat-M1 { left: 27%; top: 4%; }
.seat-M2 { left: calc(73% - 90px); top: 4%; }
.seat-L1 { left: 5%; top: 16%; }
.seat-R1 { left: calc(95% - 90px); top: 16%; }
.seat-L2 { left: 5%; top: 32%; }
.seat-R2 { left: calc(95% - 90px); top: 32%; }
.seat-L3 { left: 5%; top: 48%; }
.seat-R3 { left: calc(95% - 90px); top: 48%; }
.seat-layout { display: flex; flex-direction: column; align-items: center; position: relative; width: 100%; height: 100%; justify-content: center; }
.seat-top-row { position: absolute; top: 50%; margin-top: -42px; width: 100%; display: flex; justify-content: center; z-index: 10; }
.seat-mid-row { position: relative; width: 54px; height: 54px; display: flex; justify-content: center; align-items: center; z-index: 5; margin-bottom: 2px; }
.seat-bot-row { position: absolute; top: 50%; margin-top: 30px; width: 100%; display: flex; justify-content: center; z-index: 10; bottom: auto; }
.seat-name { font-size: 10px; color: #fff; font-weight: bold; background: transparent; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 2px #000; }
.chip-pill { background: rgba(0, 0, 0, 0.9); color: var(--gold); font-size: 13px; font-weight: 800; font-family: 'Courier New', 'Roboto Mono', monospace; padding: 2px 10px; border-radius: 12px; border: 1px solid #444; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); white-space: nowrap; overflow: hidden; max-width: 100px; }
.avatar { flex-shrink: 0; width: 54px; height: 54px; border-radius: 50%; background: #0f172a; border: 2px solid rgba(255, 255, 255, 0.2); overflow: hidden; position: relative; z-index: 5; transition: all 0.3s; filter: brightness(1); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.active { filter: brightness(1.1); transform: scale(1.1); }
.avatar.fold { filter: grayscale(1) brightness(0.4); opacity: 0.6; }
.avatar.sitout { opacity: 0.4; }
.avatar.bankrupt { filter: grayscale(100%); opacity: 0.5; border-color: #666 !important; }
.avatar.winner { border-color: #fbbf24; box-shadow: 0 0 20px #fbbf24; z-index: 20; }
.timer-container { position: absolute; top: -4px; left: -4px; right: -4px; bottom: -4px; pointer-events: none; z-index: 10; }
.timer-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-circle-mini { fill: none; stroke: #39ff14; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 176; stroke-dashoffset: 0; transition: stroke-dashoffset 0.1s linear; }
.timer-circle-mini.urgent { stroke: #ef4444; filter: drop-shadow(0 0 5px red); }
.dealer-container { position: absolute; z-index: 40; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.dealer-icon { width: 18px; height: 18px; background: #fff; color: #000; font-size: 11px; font-weight: 900; font-family: 'Arial', sans-serif; border-radius: 50%; border: 1px solid #cbd5e1; display: flex; align-items: center; justify-content: center; padding-top: 1px; padding-left: 0.5px; line-height: 1; }
.seat-hero .dealer-container, .seat-L1 .dealer-container, .seat-L2 .dealer-container, .seat-L3 .dealer-container, .seat-M1 .dealer-container { bottom: 18px; right: 18px; top: auto; left: auto; }
.seat-R1 .dealer-container, .seat-R2 .dealer-container, .seat-R3 .dealer-container, .seat-M2 .dealer-container { bottom: 18px; left: 18px; top: auto; right: auto; }
.seat-cards-mini { position: absolute; display: flex; flex-direction: row; z-index: 100; bottom: 5px; }
.seat-cards-mini .card { width: 18px; height: 25px; border: 1px solid #fff; border-radius: 2px; margin-right: -6px; box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3); }
.seat-cards-mini .card:last-child { margin-right: 0; }
.seat-L1 .seat-cards-mini, .seat-L2 .seat-cards-mini, .seat-L3 .seat-cards-mini, .seat-M1 .seat-cards-mini { left: -20px; right: auto; transform-origin: bottom right; }
.seat-R1 .seat-cards-mini, .seat-R2 .seat-cards-mini, .seat-R3 .seat-cards-mini, .seat-M2 .seat-cards-mini { right: -20px; left: auto; transform-origin: bottom left; }
.empty-seat { width: 60px; height: 60px; border: 2px dashed rgba(255, 255, 255, 0.3); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; background: rgba(0, 0, 0, 0.2); color: #fff; opacity: 1; pointer-events: auto !important; z-index: 9999; -webkit-tap-highlight-color: transparent; outline: none; }
@media (hover: hover) { .empty-seat:not(.disabled):hover { border-color: var(--gold); background: rgba(0, 0, 0, 0.5); transform: scale(1.05); box-shadow: 0 0 10px rgba(251, 191, 36, 0.2); } }
.empty-seat:active { border-color: var(--gold); color: var(--gold); background: rgba(255, 255, 255, 0.1); transform: scale(0.95); }
.empty-seat:focus { border-color: rgba(255, 255, 255, 0.3); outline: none; }
.plus-icon { font-size: 28px; font-weight: 300; line-height: 1; color: rgba(255, 255, 255, 0.5); margin: 0; padding: 0; }
.empty-seat.disabled { opacity: 0.4; pointer-events: none; border-color: rgba(255, 255, 255, 0.1); background: transparent; transform: scale(0.9); cursor: not-allowed; }
.seat-node.disabled { opacity: 0.3; filter: grayscale(100%); cursor: not-allowed; pointer-events: none; }

/* =========================================
   🔥 V9.2 商业级 UI 升级模块：暂离与断线视觉徽章
   ========================================= */
/* 暂离状态 (Sit Out) */
.seat-node.seat-sitout .avatar { 
    filter: grayscale(1) opacity(0.6); 
    border-color: rgba(255,255,255,0.1) !important; 
}
.seat-node.seat-sitout .seat-mid-row::after {
    content: "💤 暂离"; 
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: #334155; color: #cbd5e1; font-size: 10px; font-weight: 900;
    padding: 2px 6px; border-radius: 6px; border: 1px solid #475569;
    box-shadow: 0 2px 5px rgba(0,0,0,0.8); z-index: 60; white-space: nowrap;
}

/* 断线状态 (Offline) */
.seat-node.seat-offline .avatar { 
    filter: grayscale(1) brightness(0.4); 
    border-color: rgba(239,68,68,0.4) !important; 
}
.seat-node.seat-offline .seat-mid-row::after {
    content: "🔌 断线"; 
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: #991b1b; color: #fecaca; font-size: 10px; font-weight: 900;
    padding: 2px 6px; border-radius: 6px; border: 1px solid #ef4444;
    box-shadow: 0 2px 8px rgba(239,68,68,0.8); z-index: 60; white-space: nowrap;
    animation: offline-blink 1.5s infinite;
}
@keyframes offline-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Bet Pills */
.bet-pill-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.bet-pill { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: transparent; border: none; box-shadow: none; padding: 0; z-index: 60; pointer-events: none; transition: all 0.2s; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.bet-pill-icon { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 35%, #fbbf24 36%, #d97706 44%, #78350f 45%, transparent 46%), repeating-conic-gradient(#b45309 0deg 40deg, #ffffff 40deg 60deg); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); z-index: 2; }
.bet-pill-val { color: #fff; font-family: 'Russo One', sans-serif !important; font-size: 13px; font-weight: 900; line-height: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); background: transparent; padding: 0; margin-top: 1px; }
.bet-pill.call .bet-pill-icon { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); }
.bet-pill.raise .bet-pill-icon { box-shadow: 0 0 10px rgba(16, 185, 129, 0.8); }
.bet-pill.raise .bet-pill-val { color: #34d399; }
.bet-pill.allin .bet-pill-icon { box-shadow: 0 0 15px rgba(239, 68, 68, 0.8); animation: chip-pulse 1.5s infinite; }
.bet-pill.allin .bet-pill-val { color: #ef4444; font-weight: 900; }
@keyframes chip-pulse { 0% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.5); } 50% { box-shadow: 0 0 15px rgba(239, 68, 68, 1); } 100% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.5); } }
.seat-hero .bet-pill { bottom: 240px; left: 50%; transform: translateX(-50%); top: auto; }
.seat-M1 .bet-pill, .seat-M2 .bet-pill { top: 100%; margin-top: 25px; }
.seat-L1 .bet-pill, .seat-L2 .bet-pill, .seat-L3 .bet-pill { left: 90%; top: 50%; transform: translateY(-50%); }
.seat-R1 .bet-pill, .seat-R2 .bet-pill, .seat-R3 .bet-pill { right: 90%; top: 50%; transform: translateY(-50%); left: auto; }
.seat-node.seat-hero.playing-mode .bet-pill-container { opacity: 1; pointer-events: auto; }
.seat-node.seat-hero.playing-mode .bet-pill { position: fixed !important; bottom: 80px !important; left: 50% !important; transform: translateX(-50%) !important; top: auto !important; width: auto !important; height: auto !important; padding: 3px 10px !important; z-index: 600; }
.seat-node.seat-hero.playing-mode .dealer-container { opacity: 0 !important; } 

/* Hero Immersive Mode */
#hero-area { position: absolute; bottom: 10px; left: 0; width: 100%; z-index: 150; pointer-events: none; display: none; flex-flow: column nowrap !important; align-items: center !important; justify-content: flex-end; padding-bottom: env(safe-area-inset-bottom); }
@supports (padding-bottom: env(safe-area-inset-bottom)) { #hero-area { bottom: max(10px, env(safe-area-inset-bottom)); } }
#hero-area.active { display: flex !important; opacity: 1 !important; }

/* Large Dealer Button */
.dealer-icon-large { 
    position: absolute; bottom: 98px; left: 50%; transform: translateX(66px); width: 20px; height: 20px; 
    background: #fff; color: #000; border-radius: 50%; border: 2px solid #cbd5e1; font-size: 10px; font-weight: 900; 
    display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.5); z-index: 80; pointer-events: auto; 
}

.hero-cards-row { display: flex; justify-content: center; gap: 4px; pointer-events: auto; margin-bottom: 4px; order: 1; position: relative; }
.hero-cards-row.folded { opacity: 0.7; filter: grayscale(1); transform: scale(0.9); transition: all 0.3s; }
.hero-cards-row .card { width: 58px; height: 82px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6); border-radius: 6px; }
.hero-cards-row .card-val { font-size: 24px; top: 4px; left: 5px; }
.hero-cards-row .card-suit-sm { font-size: 18px; top: 30px; left: 5px; }
.hero-chip-pill { display: inline-block; background: rgba(0, 0, 0, 0.85); border: 1px solid rgba(255, 255, 255, 0.2); padding: 4px 12px; border-radius: 20px; color: var(--gold); font-family: 'Courier New', monospace; font-size: 16px; font-weight: 800; text-align: center; pointer-events: auto; order: 2; margin-bottom: 5px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
.hero-chip-pill::before { display: none !important; }
.show-card-btn { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; background: rgba(0, 0, 0, 0.7); border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; border: 1px solid #555; pointer-events: auto; }
.hand-hint { position: absolute; bottom: 125px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.7); border: 1px solid rgba(255, 255, 255, 0.15); padding: 2px 12px; border-radius: 12px; color: var(--primary); font-size: 11px; font-weight: bold; pointer-events: none; z-index: 400; display: none; }

#controls-dock { position: absolute; bottom: 0; left: 0; width: 100%; height: auto; pointer-events: none; z-index: 800; display: none; flex-direction: column; align-items: center; padding-bottom: 149px; margin-bottom: env(safe-area-inset-bottom); }
.main-btns-row { display: flex; justify-content: center; align-items: center; gap: 25px; pointer-events: auto; margin-top: 20px; position: relative; }
.ctrl-btn { width: var(--btn-size); height: var(--btn-size); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; line-height: 1.1; box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4); transition: transform 0.1s, box-shadow 0.1s; cursor: pointer; position: relative; border: 2px solid rgba(255, 255, 255, 0.15); }
.ctrl-btn:active { transform: scale(0.95); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); }
.btn-fold { background: linear-gradient(145deg, #ef4444, #b91c1c); border-color: rgba(239, 68, 68, 0.5);transform: scale(1.05); }
.btn-raise { background: linear-gradient(145deg, #f59e0b, #d97706); border-color: rgba(245, 158, 11, 0.5); z-index: 20; transform: translateY(-18px) scale(1.1); }
.btn-fold:active { transform: scale(1.0); }
.btn-raise span { display: block; font-size: 14px !important; font-weight: 900 !important; opacity: 1; margin: 0; padding: 0; line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
#qb-val { display: block; font-size: 10px !important; opacity: 0.9; margin-top: 2px; font-weight: 700; }
.act-allin { background: linear-gradient(135deg, #ef4444, #b91c1c); border: 1px solid #f87171; animation: pulseRed 1s infinite; }
@keyframes pulseRed { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.btn-call, .act-allin { display: flex !important; flex-direction: column !important; justify-content: center !important; align-items: center !important; gap: 2px !important; padding-top: 2px !important; }
.btn-call { background: linear-gradient(145deg, #10b981, #059669); border-color: rgba(16, 185, 129, 0.5); }
#txtCall { font-size: 14px !important; font-weight: 800 !important; margin: 0 !important; z-index: 10; opacity: 1 !important; line-height: 1; }
.call-val { font-size: 13px !important; font-weight: 800 !important; font-family: 'Arial', sans-serif !important; margin: 0 !important; z-index: 10; line-height: 1; letter-spacing: 0.5px; }
.btn-timer-svg { position: absolute; top: 50%; left: 50%; width: 78px; height: 78px; z-index: 5; pointer-events: none; transform: translate(-50%, -50%) rotate(-90deg); }
.btn-timer-track { fill: none; stroke: rgba(57, 255, 20, 0.15); stroke-width: 4; stroke-linecap: round; }
.btn-timer-circle { fill: none; stroke: #39ff14; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.1s linear; filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.8)); }
.btn-timer-circle.urgent { stroke: #ef4444; filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.9)); }
.halo-row { position: absolute; bottom: 298px; left: 50%; width: 0; height: 0; overflow: visible; pointer-events: none; }
.chip-node { position: absolute; left: -26px; top: 0; width: var(--btn-chip); height: var(--btn-chip); background: rgba(20, 30, 40, 0.95); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); pointer-events: auto; cursor: pointer; transform-origin: center 420px; transition: transform 0.1s, filter 0.1s; display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; line-height: 1 !important; gap: 1px; overflow: hidden; }
.chip-node:active { border-color: var(--primary); filter: brightness(1.3); transform: scale(1.1); }
.chip-ratio { font-size: 10px; color: #94a3b8; font-weight: normal; font-family: sans-serif; margin-top: -2px; }
.chip-val-dynamic { font-size: 11px; color: var(--gold); font-weight: 800; font-family: 'Russo One', sans-serif; letter-spacing: -0.5px; }
.chip-node:nth-child(1) { transform: rotate(-22deg); } .chip-node:nth-child(2) { transform: rotate(-11deg); } .chip-node:nth-child(3) { transform: rotate(0deg); } .chip-node:nth-child(4) { transform: rotate(11deg); } .chip-node:nth-child(5) { transform: rotate(22deg); }
.raise-panel-vertical { position: absolute; left: 50%; transform: translateX(-50%);bottom: calc(150px + env(safe-area-inset-bottom)); width: 80px; height: 380px; max-height: 60vh; background: rgba(15, 23, 42, 0.95); border-radius: 40px; border: 2px solid rgba(255, 255, 255, 0.15); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 0; z-index: 6000; pointer-events: auto; backdrop-filter: blur(10px); }
.p-btn { width: 44px; height: 44px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; font-size: 20px; transition: all 0.2s; }
.confirm-btn { width: 64px; height: 64px; background: linear-gradient(135deg, #10b981, #059669); border: 2px solid rgba(255, 255, 255, 0.3); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5); margin-bottom: 5px; flex-direction: column; line-height: 1; }
.confirm-content i { font-size: 18px; margin-bottom: 0px; opacity: 0.9; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.raise-val-text { font-family: 'Courier New', monospace; font-size: 16px; font-weight: 900; color: #ffffff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.4); max-width: 60px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cancel-btn { background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.5); color: #ef4444; width: 48px; height: 48px; margin-top: 5px; }
.slider-zone { flex: none; width: 100%; height: 220px; position: relative; display: flex; align-items: center; justify-content: center; overflow: visible; }
.slider-track-bg { position: absolute; width: 12px; height: 172px; background: #020617; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9); top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.chip-slider { -webkit-appearance: none; width: 220px; height: 60px; background: transparent; transform: rotate(-90deg); margin: 0; outline: none; cursor: grab; z-index: 10; position: absolute; top: 50%; left: 50%; margin-top: -30px; margin-left: -110px; }
.chip-slider::-webkit-slider-runnable-track { background: transparent; height: 60px; border: none; }
.chip-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 48px; height: 48px; border-radius: 50%; margin-top: 6px; background: radial-gradient(circle at center, #fff 30%, #ef4444 32%, #ef4444 58%, #fff 60%, #fff 64%, #b91c1c 66%); border: 2px dashed rgba(255, 255, 255, 0.9); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6), inset 0 0 8px rgba(0, 0, 0, 0.2); transition: transform 0.1s; }
.chip-slider:active::-webkit-slider-thumb { transform: scale(1.15); box-shadow: 0 0 20px var(--gold); border-color: var(--gold); }

/* Buttons & Elements */
.big-start-btn { position: absolute; top: auto; bottom: calc(130px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 16px 40px; background: var(--primary); color: #fff; border: none; border-radius: 50px; font-size: 18px; font-weight: 900; box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4); z-index: 9999; animation: pulse 2s infinite; cursor: pointer; pointer-events: auto; }
.owner-ctrl { position: absolute; top: auto; bottom: calc(130px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); text-align: center; z-index: 3000; pointer-events: auto; }
@keyframes pulse { 0% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.05); } 100% { transform: translateX(-50%) scale(1); } }
.wait-text { font-size: 12px; color: #94a3b8; margin-top: 10px; }
.overlay-msg { position: fixed; top: 0; left: 0; width: 100%; background: #ef4444; color: #fff; text-align: center; font-size: 12px; padding: 4px; z-index: 9999; font-weight: bold; }
.toast { position: fixed; top: 15%; left: 50%; transform: translateX(-50%); background: rgba(15, 23, 42, 0.95); color: #fff; padding: 12px 24px; border-radius: 30px; z-index: 10000; display: none; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.1); font-weight: 500; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); z-index: 9000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px); pointer-events: auto; }
.modal-box { background: #1e293b; width: 85%; max-width: 320px; padding: 20px; border-radius: 16px; text-align: center; border: 1px solid rgba(255, 255, 255, 0.1); }
.modal-btns { display: flex; gap: 10px; margin-top: 20px; }
.m-btn { flex: 1; padding: 10px; border-radius: 10px; border: none; cursor: pointer; font-weight: bold; font-size: 14px; }
.m-btn.cancel { background: #334155; color: #fff; } .m-btn.confirm { background: var(--primary); color: #fff; }
.func-zone { position: absolute; bottom: 40px !important; right: 20px !important; display: flex; gap: 20px; z-index: 2000; pointer-events: auto; }
.func-zone-left { position: absolute; bottom: 40px !important; left: 20px !important; display: flex; gap: 20px; z-index: 2000; pointer-events: auto; }
.func-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(30, 41, 59, 0.8); backdrop-filter: blur(5px); border: 1px solid rgba(255, 255, 255, 0.1); display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); cursor: pointer; transition: transform 0.1s; color: #fff; position: relative; line-height: normal;}
.func-btn:active { transform: scale(0.95); background: rgba(255, 255, 255, 0.1); }
.func-btn .label { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); font-size: 9px; color: #94a3b8; white-space: nowrap; opacity: 0.8; font-family: sans-serif; }
.rebuy-btn.pulsing { animation: glowPulse 1.5s infinite; border-color: var(--gold); color: var(--gold); }
@keyframes glowPulse { 0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(251, 191, 36, 0); } 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); } }
.ledger-list { width: 100%; max-height: 300px; overflow-y: auto; margin-top: 15px; }
.ledger-row { display: flex; justify-content: space-between; padding: 10px 5px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); font-size: 13px; color: #cbd5e1; }
.ledger-row.header { font-weight: bold; color: #94a3b8; border-bottom: 2px solid rgba(255, 255, 255, 0.2); }
.ledger-row span { flex: 1; text-align: center; }
.ledger-row span:first-child { text-align: left; flex: 1.5; }
.l-name { font-weight: bold; color: #fff; } .l-val { font-family: monospace; }
.l-val.win { color: var(--primary); } .l-val.loss { color: var(--red); }

/* =========================================
   🔥 V9.2 商业级 UI 升级模块：“坐回牌桌”大按钮
   ========================================= */
.sitout-return-btn {
    position: absolute; 
    bottom: calc(110px + env(safe-area-inset-bottom)); 
    left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981, #059669);
    border: 2px solid rgba(255, 255, 255, 0.4); 
    border-radius: 40px;
    padding: 16px 40px; 
    width: 85%; max-width: 320px;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.5), inset 0 0 15px rgba(255,255,255,0.2);
    z-index: 5000; cursor: pointer; pointer-events: auto;
    animation: sitout-btn-pulse 2.5s infinite;
    transition: transform 0.1s;
}
.sitout-return-btn:active { transform: translateX(-50%) scale(0.96); }
.sitout-return-btn .btn-content { 
    display: flex; align-items: center; justify-content: center; gap: 8px; 
    color: #fff; font-size: 18px; font-weight: 900; letter-spacing: 0.5px;
}
.sitout-return-btn .btn-content i { font-size: 24px; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
@keyframes sitout-btn-pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7), 0 10px 30px rgba(16, 185, 129, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0), 0 10px 30px rgba(16, 185, 129, 0.5); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0), 0 10px 30px rgba(16, 185, 129, 0.5); }
}

/* Bubbles & Animation Layer */
.action-bubble { position: absolute; background: rgba(0, 0, 0, 0.85); border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); border-radius: 12px; padding: 3px 8px; font-size: 11px; font-weight: 700; color: #e2e8f0; white-space: nowrap; letter-spacing: 0.5px; opacity: 0; pointer-events: none; z-index: 900; }
.action-bubble.is-allin { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); background: rgba(20, 0, 0, 0.9); }
.action-bubble-container .action-bubble { top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.5); animation: bubble-stay 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
#hero-act-bubble { bottom: 98px !important; top: auto !important; left: 50% !important; margin-left: -68px !important; transform: translateX(-100%) scale(1) !important; transform-origin: center right; border-bottom-right-radius: 2px; border-bottom-left-radius: 12px; transition: opacity 0.2s, transform 0.2s; opacity: 0; pointer-events: none; z-index: 9500 !important; }
#hero-act-bubble.show { opacity: 1 !important; transform: translateX(-100%) scale(1.05) !important; }
.seat-node.seat-hero.playing-mode .action-bubble-container { display: none !important; }
@keyframes bubble-stay { 0% { opacity: 0; transform: translate(-50%, 0) scale(0.5); } 60% { opacity: 1; transform: translate(-50%, -48px) scale(1.1); } 100% { opacity: 1; transform: translate(-50%, -40px) scale(1.0); } }
.seat-M1 .action-bubble, .seat-L1 .action-bubble, .seat-L2 .action-bubble, .seat-L3 .action-bubble { animation: simple-fade-in 0.3s ease-out forwards !important; top: 10px; left: -15px; right: auto; bottom: auto; transform: none !important; transform-origin: bottom right; border-bottom-right-radius: 2px; }
.seat-M2 .action-bubble, .seat-R1 .action-bubble, .seat-R2 .action-bubble, .seat-R3 .action-bubble { animation: simple-fade-in 0.3s ease-out forwards !important; top: 10px; right: -15px; left: auto; bottom: auto; transform: none !important; transform-origin: bottom left; border-bottom-left-radius: 2px; }
@keyframes simple-fade-in { 0% { opacity: 0; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); } }

/* Animation Layer */
#anim-layer { position: fixed !important; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999 !important; display: block !important; }
.flying-chip, .flying-card { z-index: 10000 !important; visibility: visible !important; display: flex !important; }
.flying-chip { position: absolute; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 35%, #fbbf24 36%, #d97706 44%, #78350f 45%, transparent 46%), repeating-conic-gradient(#b45309 0deg 40deg, #ffffff 40deg 60deg); box-shadow: 0 4px 8px rgba(0,0,0,0.6), 0 0 10px rgba(251, 191, 36, 0.4), inset 0 1px 2px rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; will-change: transform, left, top; opacity: 0; pointer-events: none; }
.flying-chip::after { display: none; content: none; }
.emoji-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; padding: 10px; justify-items: center; }
.emoji-option { font-size: 28px; cursor: pointer; padding: 5px; transition: transform 0.1s; }
.emoji-option:active { transform: scale(0.8); }
.floating-emoji { position: fixed; font-size: 32px; z-index: 9999; pointer-events: none; animation: floatUp 2s ease-out forwards; }
@keyframes floatUp { 0% { transform: translateY(0) scale(0.5); opacity: 0; } 20% { transform: translateY(-20px) scale(1.2); opacity: 1; } 100% { transform: translateY(-80px) scale(1); opacity: 0; } }
.flying-card { position: absolute; width: 46px; height: 66px; background: #1e293b; border: 2px solid #fff; border-radius: 5px; background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0, rgba(255, 255, 255, 0.06) 2px, transparent 2px, transparent 6px); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); z-index: 9999; pointer-events: none; transform-origin: center center; will-change: transform, left, top; }
@keyframes card-flip-flash { 0% { filter: brightness(1); transform: scale(1); } 50% { filter: brightness(2); transform: scale(1.1); } 100% { filter: brightness(1); transform: scale(1); } }
.flip-anim { animation: card-flip-flash 0.3s ease-out; }

/* Pre-Actions */
#pre-action-dock { position: absolute !important; top: auto !important; bottom: calc(150px + env(safe-area-inset-bottom)); left: 50% !important; transform: translateX(-50%) !important; display: none; align-items: center; justify-content: center; gap: 20px; width: 100%; z-index: 750; pointer-events: none; padding-bottom: 0; }
.pre-circle-btn { width: 70px; height: 70px; border-radius: 50%; background: rgba(15, 23, 42, 0.6); border: 2px solid rgba(255, 255, 255, 0.15); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; pointer-events: auto; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.pre-circle-btn span { font-size: 13px; font-weight: 800; color: #94a3b8; line-height: 1.2; margin-top: 2px; }
.pre-circle-btn:active { transform: scale(0.95); }
.pre-circle-btn.fold.active { border-color: #ef4444; background: rgba(239, 68, 68, 0.15); box-shadow: 0 0 20px rgba(239, 68, 68, 0.3), inset 0 0 10px rgba(239, 68, 68, 0.1); }
.pre-circle-btn.fold.active span { color: #fca5a5; text-shadow: 0 0 5px rgba(239, 68, 68, 0.6); }
.pre-circle-btn.call.active { border-color: #10b981; background: rgba(16, 185, 129, 0.15); box-shadow: 0 0 20px rgba(16, 185, 129, 0.3), inset 0 0 10px rgba(16, 185, 129, 0.1); }
.pre-circle-btn.call.active span { color: #6ee7b7; text-shadow: 0 0 5px rgba(16, 185, 129, 0.6); }
.bet-pill.ghost { opacity: 1; z-index: 500; animation: ghost-fade-out 0.8s ease-in forwards; }
@keyframes ghost-fade-out { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(0.9); } }

/* Chat Sidebar */
.red-dot { position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; background: #ef4444; border-radius: 50%; border: 1px solid #1e293b; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); animation: dotPulse 2s infinite; z-index: 10; }
@keyframes dotPulse { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 8999; backdrop-filter: blur(2px); opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }
.chat-sidebar { position: fixed; top: 0; left: 0; height: 100%; width: 85%; max-width: 400px; background: rgba(15, 23, 42, 0.98); z-index: 9000; transform: translateX(-100%); transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1); display: flex; flex-direction: column; border-right: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6); }
.chat-sidebar.open { transform: translateX(0); }
.sidebar-header { height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; padding-top: env(safe-area-inset-top); background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.header-left { display: flex; align-items: center; gap: 8px; }
.sidebar-header h3 { margin: 0; font-size: 16px; color: #e2e8f0; font-weight: 700; }
.live-badge { font-size: 9px; background: #ef4444; color: #fff; padding: 1px 4px; border-radius: 4px; font-weight: 800; letter-spacing: 0.5px; }
#hh-sidebar .close-icon-btn, .chat-sidebar .close-icon-btn { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-size: 20px; cursor: pointer; transition: background 0.2s; }
#hh-sidebar .close-icon-btn:active, .chat-sidebar .close-icon-btn:active { background: rgba(255,255,255,0.2); }
.sidebar-history { flex: 1; min-height: 0; height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; padding: 15px; display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }
.sidebar-history::-webkit-scrollbar { width: 4px; background: transparent; }
.sidebar-history::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.chat-system-notice { text-align: center; margin: 10px 0; opacity: 0.5; }
.chat-system-notice span { font-size: 10px; color: #94a3b8; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 4px; }
.chat-row { display: flex; flex-direction: column; max-width: 88%; animation: msg-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes msg-pop { from { opacity: 0; transform: translateY(10px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.chat-row.me { align-self: flex-end; align-items: flex-end; }
.chat-row.other { align-self: flex-start; align-items: flex-start; }
.chat-name { font-size: 11px; color: #64748b; margin-bottom: 3px; margin-left: 2px; }
.chat-bubble { padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; color: #f1f5f9; word-break: break-word; position: relative; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.chat-row.me .chat-bubble { background: linear-gradient(135deg, var(--primary), #059669); color: #fff; border-bottom-right-radius: 2px; }
.chat-row.other .chat-bubble { background: #334155; border-bottom-left-radius: 2px; border: 1px solid rgba(255,255,255,0.05); }
.sidebar-input { flex-shrink: 0; padding: 12px 16px; background: rgba(15, 23, 42, 0.95); border-top: 1px solid rgba(255, 255, 255, 0.1); display: flex; gap: 10px; align-items: center; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.sidebar-input input { flex: 1; height: 42px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 21px; padding: 0 16px; color: #fff; font-size: 15px; outline: none; transition: all 0.2s; }
.sidebar-input input:focus { border-color: var(--primary); background: rgba(0, 0, 0, 0.5); box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1); }
.sidebar-input input::placeholder { color: #475569; }
.send-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); border: none; color: white; font-size: 20px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); cursor: pointer; flex-shrink: 0; transition: transform 0.1s; }
.send-btn:active { transform: scale(0.9); }
.func-btn.has-new-msg { border-color: #4ade80; color: #4ade80; animation: soft-green-pulse 2s infinite; }
@keyframes soft-green-pulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); transform: scale(1); } 70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); transform: scale(1); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); transform: scale(1); } }

/* =========================================
   Vibe Poker - Hand History V8.6
   ========================================= */
.hh-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(2px); z-index: 19999; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.hh-overlay.active { opacity: 1; pointer-events: auto; }
#hh-sidebar { background: rgba(17, 20, 29, 0.92); backdrop-filter: blur(12px); width: 85%; max-width: 450px; border-left: 1px solid rgba(255, 255, 255, 0.1); box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; position: fixed; right: -100%; top: 0; bottom: 0; transition: right 0.35s cubic-bezier(0.33, 1, 0.68, 1); z-index: 20000; }
#hh-sidebar.active { right: 0; }
.hh-meta-text-flow { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 6px 16px; background: transparent; border-bottom: 1px solid rgba(255, 255, 255, 0.02); flex-shrink: 0; }
.hh-meta-text-flow .m-item { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.hh-meta-text-flow .m-lbl { color: #475569; }
.hh-meta-text-flow .m-val { color: #94a3b8; font-family: monospace; }
.hh-meta-text-flow .m-val.pot { color: rgba(251, 191, 36, 0.8); font-weight: bold; }
.m-divider-dot { color: #334155; font-size: 10px; }
#hh-list-container { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 4px; padding-bottom: 70px; background: transparent; -webkit-overflow-scrolling: touch; }
#hh-list-container::-webkit-scrollbar { width: 4px; }
#hh-list-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.hh-grid-header, .hh-grid-row { display: grid; grid-template-columns: 50px 60px 1.2fr 1fr 1fr 55px; gap: 2px; padding: 0 2px; align-items: center; }
.hh-grid-header { color: #64748b; font-size: 11px; font-weight: 600; margin-bottom: 8px; text-align: center; }
.hh-grid-row { background: rgba(24, 27, 37, 0.65); border: 1px solid transparent; border-radius: 8px; margin-bottom: 6px; padding-top: 8px; padding-bottom: 8px; min-height: 52px; transition: background 0.2s; }
.hh-grid-row.is-me { background: rgba(30, 35, 48, 0.8); border-left: 3px solid #3b82f6; border-radius: 4px 8px 8px 4px; }
.hh-grid-row.winner { background: rgba(34, 32, 26, 0.8); border-left: 3px solid #f59e0b; border-radius: 4px 8px 8px 4px; }
.hh-grid-row.is-dead { opacity: 0.5; filter: grayscale(0.5); }
.hh-col { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; height: 100%; position: relative; }
.hh-avatar { width: 30px; height: 30px; border-radius: 50%; background: #1e293b; border: 2px solid #334155; object-fit: cover; }
.winner .hh-avatar { border-color: #fbbf24; box-shadow: 0 0 10px rgba(251,191,36,0.3); }
.hh-dealer { position: absolute; top: -4px; right: 8px; width: 12px; height: 12px; background: #fff; color: #000; border-radius: 50%; font-size: 8px; font-weight: 900; line-height: 12px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.5); z-index: 10; }
.hh-p-name { font-size: 9px; color: #cbd5e1; margin-top: 4px; width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 2px; }
.hh-card-wrap { transform: scale(0.45); transform-origin: top left; position: relative; height: 29px; width: 20px; }
.hh-card-stack, .hh-board-mini { display: flex; flex-direction: row; justify-content: center; align-items: flex-start; height: 30px; margin-bottom: 2px; }
.hh-card-stack .hh-card-wrap:not(:last-child), .hh-board-mini .hh-card-wrap:not(:last-child) { width: 11px; }
.hh-card-stack .hh-card-wrap:not(:first-child) .card, .hh-board-mini .hh-card-wrap:not(:first-child) .card { box-shadow: -3px 0 6px rgba(0, 0, 0, 0.6) !important; }
.hh-act-row { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 10px; line-height: 1; white-space: nowrap; margin-top: 2px; }
.act-name { font-weight: 600; }
.act-amt { font-family: 'Courier New', monospace; font-size: 10px; opacity: 0.9; }
.c-fold { color: #64748b; text-decoration: line-through; opacity: 0.8; }
.c-check { color: #10b981; }
.c-call { color: #60a5fa; }
.c-raise, .c-bet { color: #fbbf24; }
.c-allin { color: #ef4444; font-weight: 900; font-style: italic; }
.res-win { color: #fbbf24; font-weight: 900; font-size: 11px; font-family: monospace; letter-spacing: -0.5px; }
.res-loss { color: #64748b; font-size: 11px; font-family: monospace; }
.res-desc { font-size: 9px; color: #94a3b8; margin-top: 2px; transform: scale(0.9); }
.hh-nav-bottom { position: absolute; bottom: 0; left: 0; right: 0; height: 60px; background: rgba(15, 23, 42, 0.5); border-top: 1px solid rgba(255, 255, 255, 0.05); display: flex; justify-content: center; align-items: center; gap: 10px; padding-bottom: env(safe-area-inset-bottom); }
.hh-nav-btn { background: rgba(255,255,255,0.05); color: #e2e8f0; border: 1px solid rgba(255,255,255,0.1); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; user-select: none; transition: background 0.1s, transform 0.1s; padding: 0; outline: none; }
.hh-nav-btn:active { background: rgba(255,255,255,0.15); transform: scale(0.92); }
.hh-page-info { color: #94a3b8; font-size: 12px; font-weight: 500; min-width: 60px; text-align: center; font-variant-numeric: tabular-nums; }
.hh-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 320px; color: #64748b; opacity: 0.8; }
.hh-empty-state i { font-size: 64px; margin-bottom: 16px; color: #334155; }
.hh-empty-state .title { font-size: 16px; font-weight: bold; color: #cbd5e1; margin-bottom: 8px; }
.hh-empty-state .desc { font-size: 12px; color: #475569; }
/* =========================================
   🎯 右上角下拉菜单 UI 优化 (紧凑版)
   ========================================= */

/* 1. 强制隐藏退出按钮上面的那条横线（不管是 div 分割线还是 hr 标签） */
#room-dropdown-menu .menu-divider,
#room-dropdown-menu hr {
    display: none !important;
}
#room-dropdown-menu {
    min-width: 0 !important; /* 打破原有的最小宽度强制限制 */
    width: max-content !important; /* ✨ 核心魔法：外壳宽度完全贴合内部文字长度 */
    padding: 6px !important; /* 给整个外壳加一点紧凑的边缘留白 */
}
/* 如果横线是直接写在按钮边框上的，也一并抹除 */
#room-dropdown-menu .menu-item {
    border-top: none !important;
}

/* 2. 压缩按钮的上下间距，让排列更紧凑 */
#room-dropdown-menu .menu-item {
    /* 上下 6px 保持你刚才的紧凑感，左右从 16px 缩减到 12px */
    padding: 6px 12px !important; 
    margin-bottom: 2px !important; 
    border-radius: 6px; 
}

/* 3. 最后一个菜单项底部不需要留白 */
#room-dropdown-menu .menu-item:last-child {
    margin-bottom: 0 !important;
}

/* =========================================
   🔥 V9.5 商业级 UI：极简 Icon 圆形角标 (2点/10点方向)
   ========================================= */

/* 1. 恢复头像亮度和倒计时显示（不准变灰变暗） */
.seat-node.seat-sitout .avatar,
.seat-node.seat-offline .avatar { 
    filter: none !important; 
    opacity: 1 !important;
}

/* 2. 基础标牌样式：小巧的正圆形 Icon 角标 */
/* 2. 基础标牌样式：小巧的正圆形 Icon 角标 */
.seat-node.seat-sitout .seat-mid-row::after,
.seat-node.seat-offline .seat-mid-row::after {
    position: absolute; 
    z-index: 100; 
    width: 22px !important;       /* 加个 !important 锁死宽度 */
    height: 22px !important;      /* 锁死高度 */
    border-radius: 50% !important;/* 强制满圆角 */
    padding: 0 !important;        /* ✨ 新增：强行清零残留的内边距，杀掉椭圆 */
    line-height: 1 !important;    /* ✨ 新增：防止表情包自带的行高把圆撑拉长 */
    display: flex;       
    align-items: center;
    justify-content: center;
    font-size: 11px;     
    box-shadow: 0 2px 6px rgba(0,0,0,0.8);
    
    /* 默认位置：头像右上角 2 点钟方向 */
    top: -4px; 
    right: -4px; 
    left: auto;
    transform: none !important; 
}

/* 3. 右侧玩家镜像位置：头像左上角 10 点钟方向 */
.seat-M2.seat-sitout .seat-mid-row::after,
.seat-M2.seat-offline .seat-mid-row::after,
.seat-R1.seat-sitout .seat-mid-row::after,
.seat-R1.seat-offline .seat-mid-row::after,
.seat-R2.seat-sitout .seat-mid-row::after,
.seat-R2.seat-offline .seat-mid-row::after,
.seat-R3.seat-sitout .seat-mid-row::after,
.seat-R3.seat-offline .seat-mid-row::after {
    right: auto;
    left: -4px; /* 贴在左耳侧 */
}

/* 4. 暂离徽章：纯 Icon */
.seat-node.seat-sitout .seat-mid-row::after {
    content: "💤"; 
    background: #334155; 
    border: 1px solid rgba(255, 255, 255, 0.2) !important; /* 增加一圈暗色底描边，产生镶嵌的镂空感 */
}

/* 5. 断线徽章：纯 Icon + 呼吸闪烁 */
.seat-node.seat-offline .seat-mid-row::after {
    content: "🔌"; 
    background: #991b1b; 
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    animation: offline-pulse 1.5s infinite; /* 使用透明度呼吸，不干扰位置属性 */
}

@keyframes offline-pulse { 
    0%, 100% { opacity: 1; } 
    50% { opacity: 0.5; } 
}
/* =========================================
   🛠️ 修复：结算亮牌时，其他玩家迷你手牌数字溢出
   ========================================= */

/* 1. 调整迷你卡片内部文字容器的位置，让它贴紧左上角 */
.seat-cards-mini .card-idx {
    top: 1px !important;
    left: 2px !important;
    transform: none !important;
}

/* 2. 强行缩小卡片数字，完美适配 18px 的卡片宽度 */
.seat-cards-mini .card-val {
    font-size: 11px !important;      /* 从 19px 缩小到 11px */
    font-weight: 900 !important;
    line-height: 0.9 !important;     /* 压紧行高 */
    letter-spacing: -0.5px !important;
}

/* 3. 强行缩小卡片花色 */
.seat-cards-mini .card-suit-sm {
    font-size: 9px !important;       /* 从 16px 缩小到 9px */
    line-height: 1 !important;
    margin-top: 0 !important;
}
/* =========================================
   🎯 交互优化：将“亮牌小眼睛”移至牌面正中间
   ========================================= */

.show-card-btn {
    position: absolute !important;
    top: 50% !important;       /* 移到垂直中心 */
    left: 50% !important;      /* 移到水平中心 */
    bottom: auto !important;   /* 清除以前固定在底部的属性 */
    transform: translate(-50%, -50%) !important; /* 完美的物理居中 */
    
    width: 32px !important;    /* 稍微放大，方便手机端点击 */
    height: 32px !important;
    font-size: 16px !important;/* 图标放大 */
    
    background: rgba(15, 23, 42, 0.85) !important; /* 使用深色磨砂底，压住下方牌面的花色 */
    backdrop-filter: blur(3px) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important; /* 强烈阴影，营造悬浮感 */
    
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* 按下时的物理反馈 */
.show-card-btn:active {
    transform: translate(-50%, -50%) scale(0.85) !important;
    background: rgba(15, 23, 42, 0.95) !important;
}

/* 开启亮牌后，给绿色的眼睛加一点发光特效 */
.show-card-btn i.ri-eye-fill {
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.8));
}

/* =========================================
   ✨ V9.7 商业级 UI：全局提示弹窗 (Toast) 视觉过渡升级
   ========================================= */

.toast {
    position: fixed !important; 
    top: 12% !important; /* 上移到黄金视觉位，绝对不挡公共牌和底牌 */
    left: 50% !important; 
    
    /* 苹果级磨砂玻璃质感 */
    background: rgba(15, 23, 42, 0.85) !important; 
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    
    color: #f8fafc !important; 
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    text-align: center !important;
    white-space: nowrap !important; /* 强制单行，干练不啰嗦 */
    
    padding: 12px 28px !important; 
    border-radius: 40px !important; /* 高级胶囊形 */
    
    /* 微高光边缘与立体悬浮投影 */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.3) !important; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 0.05) !important;
    
    z-index: 10000 !important; 
    pointer-events: none !important; /* 灵魂属性：事件穿透！玩家可以隔山打牛点到弹窗后面的按钮 */
    
    /* 丝滑的果冻入场动画 */
    animation: toast-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
}

/* 覆盖原本的 overlay 红色报错横幅，让它也变得高级一点 */
.overlay-msg {
    background: rgba(239, 68, 68, 0.9) !important;
    backdrop-filter: blur(8px) !important;
    font-size: 13px !important;
    padding: 8px !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4) !important;
}

/* 定义 Q弹入场动画 */
@keyframes toast-pop {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -20px) scale(0.9); 
    }
    100% { 
        opacity: 1; 
        transform: translate(-50%, 0) scale(1); 
    }
}