        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: #1a1a2e;
            color: #eee;
            min-height: 100vh;
        }
        .hidden { display: none !important; }

        /* ===== LOGIN PAGE ===== */
        .login-page .container {
            max-width: 480px;
            margin: 0 auto;
            padding: 20px 16px;
        }
        .login-page h1 {
            text-align: center;
            font-size: 20px;
            color: #eee;
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 2px solid #c0392b;
        }
        .form-group { margin-bottom: 14px; }
        .form-group label {
            display: block; font-size: 13px; color: #999;
            margin-bottom: 4px; font-weight: 500;
        }
        .form-group input {
            width: 100%; padding: 10px 12px;
            border: 1px solid #444; border-radius: 8px;
            font-size: 14px; background: #2a2a3e; color: #eee;
        }
        .form-group input:focus {
            outline: none; border-color: #c0392b;
            box-shadow: 0 0 0 3px rgba(192,57,43,0.2);
        }
        .btn-login {
            width: 100%; padding: 12px;
            background: #c0392b; color: #fff; border: none;
            border-radius: 8px; font-size: 16px; font-weight: 600;
            cursor: pointer; margin-top: 8px;
        }
        .btn-login:hover { background: #a93226; }
        .btn-login:disabled { background: #555; cursor: not-allowed; }
        .section-title {
            font-size: 14px; font-weight: 600; color: #ccc;
            margin: 20px 0 8px; padding-bottom: 4px;
            border-bottom: 1px solid #333;
        }
        .request-info {
            background: #2a2a3e; border: 1px solid #444;
            border-radius: 8px; padding: 12px; margin-top: 8px;
        }
        .request-info pre, .response-box pre {
            font-size: 12px; white-space: pre-wrap; word-break: break-all;
            font-family: 'SF Mono', Monaco, Consolas, monospace; line-height: 1.5;
        }
        .request-info pre { color: #ccc; }
        .response-area { margin-top: 16px; }
        .response-box {
            background: #1e1e1e; border-radius: 8px; padding: 14px;
            min-height: 80px; max-height: 400px; overflow-y: auto;
        }
        .response-box pre { font-size: 13px; color: #4ec9b0; }
        .response-box.error pre { color: #f44747; }
        .response-box.loading pre { color: #dcdcaa; }
        .status-badge {
            display: inline-block; padding: 2px 8px; border-radius: 4px;
            font-size: 12px; font-weight: 500; margin-left: 8px;
        }
        .status-badge.success { background: #1b4332; color: #52b788; }
        .status-badge.error { background: #3d1212; color: #f44747; }
        .status-badge.loading { background: #3d3000; color: #f5c542; }

        /* ===== MAIN PAGE ===== */
        .main-page { background: #2b2b4e; min-height: 100vh; }
        .top-nav {
            display: flex; align-items: center; justify-content: space-between;
            padding: 10px 16px; background: #2b2b4e;
            border-bottom: 1px solid rgba(255,255,255,0.08);
            position: sticky; top: 0; z-index: 100;
        }
        .top-nav-left span {
            font-size: 16px; font-weight: 600; color: #eee;
            border-bottom: 2px solid #ff4d6a; padding-bottom: 4px;
        }
        .search-bar {
            flex: 1; max-width: 200px; margin: 0 12px;
            padding: 6px 12px; background: #363660; border: none;
            border-radius: 16px; font-size: 13px; color: #999; outline: none;
        }
        .top-nav-right { display: flex; gap: 14px; }
        .top-nav-right span { font-size: 12px; color: #999; cursor: pointer; }

        /* Banner carousel */
        .banner-carousel {
            position: relative; width: calc(100% - 16px); margin: 8px auto 0;
            overflow: hidden; border-radius: 12px;
            touch-action: pan-y;
            min-height: 120px;
        }
        .banner-slides {
            display: flex; transition: transform 0.4s ease;
            width: 100%;
        }
        .banner-slide {
            min-width: 100%; position: relative;
        }
        .banner-slide img {
            width: 100%; display: block;
        }
        .banner-dots {
            position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
            display: flex; gap: 6px; z-index: 2;
        }
        .banner-dot {
            width: 8px; height: 8px; border-radius: 50%;
            background: rgba(255,255,255,0.4); transition: all 0.3s;
            cursor: pointer;
        }
        .banner-dot.active {
            background: #fff; width: 20px; border-radius: 4px;
        }
        .banner-arrow {
            position: absolute; top: 50%; transform: translateY(-50%);
            width: 28px; height: 28px; border-radius: 50%;
            background: rgba(0,0,0,0.35); color: #fff; border: none;
            font-size: 14px; cursor: pointer; z-index: 3;
            display: none; align-items: center; justify-content: center;
        }
        .banner-arrow-left { left: 8px; }
        .banner-arrow-right { right: 8px; }
        /* PC: show arrows, responsive banner */
        @media (min-width: 600px) {
            .banner-carousel { max-height: none; }
            .banner-arrow { display: flex; }
        }

        /* Section title */
        .section-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 14px 16px 8px;
        }
        .section-header-left {
            display: flex; align-items: center; gap: 8px;
        }
        .section-header-left .fire-icon {
            font-size: 20px;
        }
        .section-header-left .section-title-text {
            font-size: 16px; font-weight: 700; color: #fff;
        }
        .section-header-right {
            display: flex; align-items: center; gap: 4px;
            padding: 4px 14px; background: rgba(255,255,255,0.1);
            border-radius: 16px; cursor: pointer;
        }
        .section-header-right span {
            font-size: 12px; color: #aaa;
        }

        .tab-bar {
            display: flex; padding: 10px 16px; gap: 20px;
            border-bottom: none; align-items: center;
        }
        .live-tags-bar {
            display: flex; padding: 6px 16px 12px; gap: 8px;
            border-bottom: none;
            overflow-x: auto; white-space: nowrap;
            -webkit-overflow-scrolling: touch;
        }
        .live-tags-bar::-webkit-scrollbar { display: none; }
        .live-tag-item {
            padding: 6px 18px; border-radius: 18px;
            font-size: 13px; cursor: pointer;
            border: 1px solid rgba(255,255,255,0.15);
            background: transparent; color: #aaa;
            flex-shrink: 0; font-weight: 500;
        }
        .live-tag-item.active {
            background: #ff4d6a; color: #fff;
            border-color: #ff4d6a;
        }
        .tab-bar span {
            font-size: 16px; color: #eee; font-weight: 600;
            position: relative;
        }
        .tab-bar span::after {
            content: ''; position: absolute; bottom: -10px;
            left: 50%; transform: translateX(-50%);
            width: 20px; height: 3px; background: #ff4d6a; border-radius: 2px;
        }
        .btn-refresh {
            padding: 4px 14px;
            background: #ff4d6a; color: #fff; border: none;
            border-radius: 14px; font-size: 12px; cursor: pointer;
            font-weight: 500;
        }
        .tab-bar-right {
            margin-left: auto; display: flex; gap: 8px; align-items: center;
        }
        .btn-refresh:hover { background: #e8456a; }
        .btn-refresh:active { transform: scale(0.96); }

        /* Stream grid */
        .stream-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 8px; padding: 0 10px 16px;
        }
        @media (min-width: 600px) {
            .stream-grid { grid-template-columns: repeat(auto-fill, 200px); }
        }
        .stream-card {
            border-radius: 10px; overflow: hidden;
            background: #363660; cursor: pointer;
        }
        /* ===== Live Notice (直播预告) — horizontal scroller at top of live list ===== */
        .live-notice-section { padding: 10px 10px 6px; }
        .live-notice-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 2px 2px 8px;
        }
        .live-notice-title {
            display: inline-flex; align-items: center; gap: 6px;
            color: #fff; font-size: 14px; font-weight: 700;
        }
        .live-notice-title-icon { color: #d4a76a; }
        .live-notice-count { color: #888; font-size: 12px; }
        .live-notice-scroll {
            display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
            scroll-snap-type: x proximity;
            -webkit-overflow-scrolling: touch;
            padding-bottom: 4px;
        }
        .live-notice-scroll::-webkit-scrollbar { height: 0; }
        .live-notice-scroll .stream-card {
            flex: 0 0 calc((100% - 8px) / 2);
            scroll-snap-align: start;
            max-width: 200px;
        }
        @media (min-width: 600px) {
            .live-notice-scroll .stream-card { flex-basis: 200px; }
        }
        .live-notice-scroll .stream-thumb::after,
        .live-notice-grid .stream-thumb::after {
            content: ''; position: absolute; inset: 0;
            background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 100%);
            z-index: 1; pointer-events: none;
        }
        .live-notice-content-tag {
            position: absolute; top: 6px; left: 6px; z-index: 3;
            max-width: calc(100% - 12px);
            background: rgba(0,0,0,0.6); color: #fff;
            font-size: 11px; font-weight: 600;
            padding: 3px 8px; border-radius: 10px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .live-notice-center {
            position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
            text-align: center; z-index: 3; padding: 0 8px;
        }
        .live-notice-center .notice-label {
            color: #fff; font-size: 14px; font-weight: 800;
            text-shadow: 0 2px 6px rgba(0,0,0,0.7);
            letter-spacing: 1px;
        }
        .live-notice-center .notice-time {
            margin-top: 4px;
            color: #ffd76a; font-size: 13px; font-weight: 700;
            text-shadow: 0 2px 6px rgba(0,0,0,0.8);
            white-space: nowrap;
        }
        .live-notice-bottom {
            position: absolute; bottom: 6px; left: 6px; right: 6px; z-index: 3;
            display: flex; align-items: center; gap: 6px;
            background: rgba(0,0,0,0.45);
            padding: 3px 6px; border-radius: 10px;
            max-width: calc(100% - 12px);
        }
        .live-notice-bottom .notice-flag { font-size: 14px; line-height: 1; }
        .live-notice-bottom .notice-nick {
            color: #fff; font-size: 12px; font-weight: 600;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            flex: 1; min-width: 0;
        }
        .stream-card:active { transform: scale(0.98); }
        .stream-thumb {
            position: relative; width: 100%; padding-top: 100%;
            overflow: hidden; background: linear-gradient(135deg, #3a3a6e, #2b2b4e);
        }
        .stream-thumb > img:first-child {
            position: absolute; top: 0; left: 0;
            width: 100%; height: 100%; object-fit: cover;
        }
        .stream-nickname {
            position: absolute; bottom: 34px; left: 6px; right: 6px;
            color: #fff; font-size: 14px; font-weight: 600;
            text-shadow: 0 1px 3px rgba(0,0,0,0.7);
            display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
            white-space: normal; word-break: break-word; overflow: hidden;
            line-height: 1.25; max-height: 2.5em; z-index: 2;
        }
        .stream-flag {
            position: absolute; bottom: 6px; left: 6px;
            font-size: 20px; z-index: 2;
            width: 24px; height: 24px; line-height: 24px; text-align: center;
            border-radius: 50%; overflow: hidden; background: rgba(0,0,0,0.3);
        }
        .stream-game-icon {
            position: absolute; top: 6px; left: 6px;
            width: 32px; height: 32px; border-radius: 6px; z-index: 2;
            object-fit: contain;
        }
        .stream-viewers {
            position: absolute; bottom: 6px; right: 6px;
            background: rgba(0,0,0,0.5); color: #fff; font-size: 10px;
            padding: 2px 6px; border-radius: 4px; z-index: 2;
        }
        .stream-info { padding: 8px 10px; }
        .stream-info .name {
            font-size: 13px; font-weight: 500; color: #eee;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .stream-meta {
            display: flex; align-items: center; gap: 6px; margin-top: 4px;
        }
        .stream-meta .location { font-size: 11px; color: #999; }

        /* Load more */
        .load-more-wrap {
            text-align: center; padding: 16px;
        }
        .btn-load-more {
            padding: 10px 32px; background: #ff4d6a; color: #fff;
            border: none; border-radius: 20px; font-size: 14px;
            cursor: pointer; font-weight: 500;
        }
        .btn-load-more:disabled { background: #ccc; cursor: not-allowed; }
        .no-more { color: #666; font-size: 13px; padding: 16px; text-align: center; }

        /* Debug — set display:flex to re-enable D button */
        .debug-toggle {
            position: fixed; bottom: 20px; right: 20px;
            width: 48px; height: 48px; border-radius: 50%;
            background: #007aff; color: #fff; border: none;
            font-size: 20px; cursor: pointer;
            box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 200;
            display: none; align-items: center; justify-content: center;
        }
        .debug-panel {
            position: fixed; bottom: 80px; right: 16px; left: 16px;
            max-height: 50vh; background: #1e1e1e; border-radius: 12px;
            padding: 14px; overflow-y: auto; z-index: 200;
            box-shadow: 0 8px 24px rgba(0,0,0,0.3);
        }
        .debug-panel pre {
            font-size: 12px; color: #4ec9b0; white-space: pre-wrap;
            word-break: break-all; font-family: 'SF Mono', Monaco, Consolas, monospace;
            line-height: 1.6;
        }
        .debug-panel .debug-title {
            color: #dcdcaa; font-size: 13px; font-weight: 600;
            margin-bottom: 8px; display: flex; justify-content: space-between;
        }
        .debug-panel .debug-title span { color: #999; font-size: 11px; cursor: pointer; }

        /* ===== PLAY TOGETHER (一起玩) TOP TABS ===== */
        .top-level-tabs {
            display: flex; align-items: center; background: #2b2b4e; padding: 0 16px;
        }
        .top-level-tabs .top-tabs-left {
            display: flex; align-items: center; gap: 20px; flex: 1;
        }
        .top-level-tabs .top-tab {
            padding: 12px 0 10px; font-size: 16px; font-weight: 700; color: rgba(255,255,255,0.45);
            cursor: pointer; position: relative; border: none; background: none;
            -webkit-tap-highlight-color: transparent; white-space: nowrap; outline: none;
        }
        .top-level-tabs .top-tab.active { color: #fff; font-size: 18px; }
        .top-level-tabs .top-tab.active::after {
            content: ''; position: absolute; bottom: 0; left: 0;
            width: 24px; height: 3px; background: #2ecc71; border-radius: 2px;
        }
        .top-level-tabs .top-tab-go-live {
            display: flex; align-items: center; gap: 4px; padding: 6px 14px;
            background: linear-gradient(135deg, #d4a76a, #c9963a); color: #fff; border: none;
            border-radius: 16px; font-size: 13px; cursor: pointer; font-weight: 600;
            white-space: nowrap;
        }
        .top-level-tabs .top-tab-go-live:active { transform: scale(0.96); }
        /* Play Together page */
        #tabContentPlayTogether {
            padding: 0; text-align: left; background: #2b2b4e;
        }
        .pt-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 14px 16px 8px;
        }
        .pt-header-left { display: flex; align-items: center; gap: 8px; }
        .pt-header-left .fire-icon { font-size: 20px; }
        .pt-header-left .section-title-text { font-size: 16px; font-weight: 700; color: #fff; }
        .btn-pt-create {
            padding: 6px 16px; background: #ff4d6a; color: #fff; border: none;
            border-radius: 16px; font-size: 13px; cursor: pointer; font-weight: 600;
        }
        .btn-pt-create:active { transform: scale(0.96); }
        /* Play Together Create Room Modal */
        .pt-create-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6); z-index: 300;
            display: none; align-items: flex-end; justify-content: center;
        }
        .pt-create-overlay.show { display: flex; }
        .pt-create-modal {
            background: #1e1e3a; border-radius: 16px 16px 0 0; padding: 20px;
            width: 100%; max-width: 500px; max-height: 85vh; overflow-y: auto;
            color: #fff;
        }
        .pt-create-modal h3 { margin: 0 0 16px; font-size: 18px; text-align: center; }
        .pt-bg-label { font-size: 13px; color: #aaa; margin-bottom: 8px; }
        .pt-bg-grid {
            display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
            margin-bottom: 16px;
        }
        .pt-bg-item {
            border-radius: 8px; overflow: hidden; cursor: pointer;
            border: 2px solid transparent; position: relative;
            aspect-ratio: 9/16;
        }
        .pt-bg-item.selected { border-color: #ff4d6a; }
        .pt-bg-item img {
            width: 100%; height: 100%; object-fit: cover; display: block;
        }
        .pt-bg-item .pt-bg-check {
            display: none; position: absolute; top: 4px; right: 4px;
            width: 20px; height: 20px; border-radius: 50%; background: #ff4d6a;
            color: #fff; font-size: 12px; align-items: center; justify-content: center;
        }
        .pt-bg-item.selected .pt-bg-check { display: flex; }
        .pt-create-btns {
            display: flex; gap: 12px; margin-top: 16px;
        }
        .pt-create-btns button {
            flex: 1; padding: 12px; border-radius: 10px; font-size: 15px;
            font-weight: 600; cursor: pointer; border: none;
        }
        .pt-btn-cancel { background: #333; color: #aaa; }
        .pt-btn-confirm { background: #ff4d6a; color: #fff; }
        .pt-btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; }
        /* Play Together Room Cards */
        .pt-card {
            border-radius: 14px; position: relative; overflow: hidden;
            cursor: pointer; border: 2px solid rgba(255,255,255,0.15);
            width: 100%; padding-top: 100%;
        }
        .pt-card-inner {
            position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            display: flex; flex-direction: column; justify-content: space-between;
            padding: 12px;
        }
        .pt-card-top { display: flex; flex-direction: column; align-items: flex-start; }
        .pt-card-game-icon {
            width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
            border: 2px solid rgba(255,255,255,0.4); background: rgba(255,255,255,0.3);
        }
        .pt-card-nickname {
            font-size: 16px; font-weight: 700; color: #222; margin-top: 8px;
            text-shadow: 0 1px 2px rgba(255,255,255,0.3); word-break: break-all;
            max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .pt-card-bottom {
            display: flex; align-items: center; justify-content: space-between;
        }
        .pt-card-bottom-left {
            display: flex; align-items: center; gap: 6px;
        }
        .pt-card-avatar-wrap {
            display: flex; align-items: center; gap: 0; position: relative;
        }
        .pt-card-avatar {
            width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
            border: 2px solid rgba(255,255,255,0.5);
        }
        .pt-card-gender {
            position: absolute; bottom: -2px; right: -6px; width: 22px; height: 22px;
            border-radius: 50%; display: flex; align-items: center; justify-content: center;
            font-size: 12px; color: #fff; border: 2px solid #fff; overflow: hidden;
        }
        .pt-card-gender img { width: 100%; height: 100%; object-fit: contain; }
        .gender-icon { display: inline-block; vertical-align: middle; }
        .pt-card-viewers {
            display: flex; align-items: center; gap: 3px; font-size: 14px;
            color: #555; font-weight: 600; margin-left: 2px;
        }
        .pt-card-viewers svg { width: 18px; height: 18px; fill: #888; }

        /* ===== BOTTOM NAV BAR ===== */
        .bottom-nav {
            position: fixed; bottom: 0; left: 0; right: 0;
            height: 64px; background: linear-gradient(180deg, #252540 0%, #1a1a2e 100%);
            display: flex; align-items: flex-end; justify-content: space-around;
            padding-bottom: 8px; z-index: 150;
            border-top: 1px solid #333;
            box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
        }
        .bottom-nav .nav-item {
            display: flex; flex-direction: column; align-items: center;
            gap: 2px; cursor: pointer; flex: 1; padding-top: 6px;
            -webkit-tap-highlight-color: transparent;
        }
        .bottom-nav .nav-item .nav-icon { font-size: 22px; line-height: 1; }
        .bottom-nav .nav-item .nav-label { font-size: 11px; color: #888; font-weight: 500; }
        .bottom-nav .nav-item.active .nav-label { color: #ff4d6a; }
        .bottom-nav .nav-item.active .nav-icon { filter: none; }
        /* Center raised live button */
        .bottom-nav .nav-item.nav-center {
            position: relative; margin-top: -22px;
        }
        .bottom-nav .nav-item.nav-center .nav-icon-wrap {
            width: 56px; height: 56px; border-radius: 50%;
            background: linear-gradient(135deg, #ff4d6a, #ff6b8a);
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 4px 16px rgba(255,77,106,0.4);
            border: 3px solid #1a1a2e;
        }
        .bottom-nav .nav-item.nav-center .nav-icon-wrap .nav-icon {
            font-size: 28px; filter: none;
        }
        /* Main page content area needs bottom padding for nav bar */
        .main-page { padding-bottom: 72px; }
        .tab-content-page { display: none; padding: 20px 16px; color: #999; text-align: center; min-height: 40vh; }
        .tab-content-page.active { display: block; }
        .tab-content-placeholder { padding-top: 60px; font-size: 15px; }
        .tab-content-placeholder .placeholder-icon { font-size: 48px; margin-bottom: 12px; }

        /* ===== USER PROFILE OVERLAY ===== */
        .user-profile-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: #1a1a2e; z-index: 9000; overflow-y: auto; }
        .user-profile-header { display: flex; align-items: center; padding: 12px 16px; background: #2b2b4e; position: sticky; top: 0; z-index: 10; }
        .user-profile-back { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; padding: 0 8px; }
        .user-profile-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; color: #fff; }
        .user-profile-body { padding: 16px; }
        .user-profile-info { display: flex; align-items: center; gap: 14px; }
        .user-profile-avatar { width: 64px; height: 64px; border-radius: 50%; border: 2px solid #363660; object-fit: cover; background: #363660; }
        .user-profile-details { flex: 1; }
        .user-profile-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .user-profile-nickname { font-size: 18px; font-weight: 700; color: #fff; }
        .user-profile-gender { font-size: 12px; padding: 2px 6px; border-radius: 10px; }
        .user-profile-gender.male { background: rgba(59,130,246,0.2); color: #60a5fa; }
        .user-profile-gender.female { background: rgba(236,72,153,0.2); color: #f472b6; }
        .user-profile-follow-btn { padding: 4px 14px; border-radius: 14px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; text-align: center; transition: all 0.2s; white-space: nowrap; }
        .user-profile-follow-btn.not-followed { background: linear-gradient(135deg, #a855f7, #ff4d6a); color: #fff; }
        .user-profile-follow-btn.already-followed { background: rgba(255,255,255,0.1); color: #999; border: 1px solid rgba(255,255,255,0.2); }

        /* ===== MINE (我的) PAGE ===== */
        .mine-page { background: #1a1a2e; min-height: calc(100vh - 72px); padding: 0; overflow-y: auto; }
        .mine-profile-section { position: relative; background: #1e1e3a; padding: 16px; }
        .mine-profile-header { display: flex; align-items: center; gap: 14px; position: relative; }
        .mine-avatar-wrap { flex-shrink: 0; }
        .mine-avatar { width: 60px; height: 60px; border-radius: 50%; border: 2px solid #363660; object-fit: cover; background: #363660; }
        .mine-user-info { flex: 1; }
        .mine-nickname-row { display: flex; align-items: center; gap: 6px; }
        .mine-nickname { font-size: 16px; font-weight: 700; color: #fff; }
        .mine-gender-icon { font-size: 12px; padding: 2px 5px; border-radius: 10px; }
        .mine-gender-icon.male { background: rgba(59,130,246,0.2); color: #60a5fa; }
        .mine-gender-icon.female { background: rgba(236,72,153,0.2); color: #f472b6; }
        .mine-gender-label { font-size: 11px; color: #888; margin-top: 2px; }
        .mine-stats { display: flex; gap: 24px; margin-top: 8px; }
        .mine-stat-item { text-align: center; cursor: pointer; }
        .mine-stat-item:active { opacity: 0.7; }
        .mine-stat-label { font-size: 11px; color: #999; }
        .mine-stat-value { font-size: 16px; font-weight: 700; color: #fff; margin-top: 1px; }
        .mine-chip-badge { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; background: #252545; border-radius: 18px; padding: 7px 14px; }
        .mine-chip-badge img { width: 18px; height: 18px; }
        .mine-chip-label { font-size: 11px; color: #999; }
        .mine-chip-value { font-size: 17px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
        .mine-action-btns { margin-top: 16px; }
        .mine-action-btn { display: flex; align-items: center; padding: 14px 16px; background: #252545; border-radius: 12px; margin-bottom: 8px; cursor: pointer; border: none; width: 100%; }
        .mine-action-btn:active { background: #2d2d55; }
        .mine-action-btn .btn-icon { font-size: 18px; margin-right: 10px; }
        .mine-action-btn .btn-text { flex: 1; text-align: left; font-size: 14px; color: #fff; font-weight: 500; }
        .mine-action-btn .btn-arrow { color: #666; font-size: 16px; }
        .mine-content-section { margin-top: 12px; background: #1e1e3a; border-radius: 14px; min-height: 200px; overflow: hidden; }
        .mine-content-tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,0.08); }
        .mine-content-tab { flex: 1; text-align: center; padding: 12px 0; font-size: 15px; color: #888; cursor: pointer; position: relative; font-weight: 500; background: none; border: none; }
        .mine-content-tab.active { color: #fff; font-weight: 700; }
        .mine-content-tab.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 3px; background: #ff4d6a; border-radius: 2px; }
        .mine-photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 8px 10px; }
        .mine-photo-item { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 4px; background: #252545; }
        .mine-photo-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; display: block; }
        .mine-photo-add { display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px dashed #555; background: #1e1e3a; }
        .mine-photo-add:active { background: #252545; }
        .mine-photo-add .add-icon { font-size: 28px; color: #888; }
        .mine-photo-delete { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; background: rgba(0,0,0,0.65); border: none; border-radius: 50%; color: #fff; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; line-height: 1; }
        .mine-photo-delete:active { background: rgba(255,0,0,0.7); }
        /* Photo Viewer (fullscreen swipe) */
        .photo-viewer-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.95); z-index: 9998; display: flex; align-items: center; justify-content: center; flex-direction: column; }
        .photo-viewer-close { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,0.15); border: none; color: #fff; font-size: 22px; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; z-index: 9999; display: flex; align-items: center; justify-content: center; }
        .photo-viewer-container { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
        .photo-viewer-container img { max-width: 90%; max-height: 80vh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
        .photo-viewer-counter { position: absolute; bottom: 24px; color: rgba(255,255,255,0.6); font-size: 14px; }
        .photo-viewer-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1); border: none; color: #fff; font-size: 28px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 9999; }
        .photo-viewer-arrow.left { left: 10px; }
        .photo-viewer-arrow.right { right: 10px; }
        .mine-dynamics-feed { padding: 0 12px 12px; }
        /* Publish entry card at top of 我的 > 动态 feed. Dashed border box with a
           large + sign, tappable to open the publish flow. */
        .mine-dyn-publish-entry {
            display: flex; align-items: center; justify-content: center;
            gap: 8px; padding: 18px 12px; margin: 12px 0;
            border: 2px dashed rgba(212, 167, 106, 0.5);
            border-radius: 12px; background: rgba(212, 167, 106, 0.06);
            color: #d4a76a; font-size: 14px; font-weight: 600;
            cursor: pointer; -webkit-tap-highlight-color: transparent;
        }
        .mine-dyn-publish-entry:active { transform: scale(0.99); opacity: 0.85; }
        .mine-dyn-publish-entry .mine-dyn-publish-plus {
            width: 28px; height: 28px; border-radius: 50%;
            background: #d4a76a; color: #fff;
            display: flex; align-items: center; justify-content: center;
            font-size: 22px; font-weight: 700; line-height: 1;
        }
        .mine-empty { text-align: center; color: #666; padding: 40px 0; font-size: 14px; }

        /* ===== MERGED DYNAMICS+FRIENDS PAGE ===== */
        .merged-dynamics-page { background: #2b2b4e; min-height: calc(100vh - 72px); }
        .merged-top-tabs {
            display: flex; justify-content: center; gap: 32px;
            padding: 14px 16px 0; background: #2b2b4e;
        }
        .merged-top-tab {
            font-size: 16px; color: rgba(255,255,255,0.5); padding: 8px 4px 12px;
            cursor: pointer; position: relative; font-weight: 500;
            transition: color 0.2s;
        }
        .merged-top-tab.active {
            color: #fff; font-weight: 700;
        }
        .merged-top-tab.active::after {
            content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
            width: 28px; height: 3px; border-radius: 2px;
            background: linear-gradient(90deg, #6c5ce7, #ff6b9d);
        }
        .merged-sub-content { position: relative; }

        /* ===== FRIENDS PAGE ===== */
        .friends-tabs {
            display: flex; justify-content: space-around; padding: 16px 16px 0;
            border-bottom: 1px solid rgba(255,255,255,0.08);
        }
        .friends-tab-item {
            font-size: 15px; color: #888; padding: 8px 0 12px;
            cursor: pointer; position: relative; font-weight: 500;
        }
        .friends-tab-item.active {
            color: #ff4d6a; font-weight: 700;
        }
        .friends-tab-item.active::after {
            content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
            width: 24px; height: 3px; background: #ff4d6a; border-radius: 2px;
        }
        .friends-list { padding: 0; }
        .friend-item {
            display: flex; align-items: center; padding: 14px 16px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .friend-avatar {
            width: 50px; height: 50px; border-radius: 50%; object-fit: cover;
            background: #363660; flex-shrink: 0;
        }
        .friend-info { flex: 1; margin-left: 12px; min-width: 0; }
        .friend-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
        .friend-nickname {
            font-size: 15px; color: #fff; font-weight: 600;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .friend-age-badge {
            display: inline-flex; align-items: center; gap: 3px;
            padding: 1px 8px; border-radius: 10px; font-size: 12px;
            background: rgba(255,100,150,0.2); color: #ff6b9d;
        }
        .friend-age-badge.male {
            background: rgba(100,150,255,0.2); color: #6b9dff;
        }
        .friend-location {
            font-size: 12px; color: #888;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .friend-action { flex-shrink: 0; margin-left: 12px; }
        .btn-followed, .btn-follow-back {
            padding: 8px 24px; border: none; border-radius: 20px;
            font-size: 13px; font-weight: 600; cursor: pointer;
        }
        .btn-followed {
            background: linear-gradient(135deg, #ff4d6a, #ff6b8a);
            color: #fff;
        }
        .btn-follow-back {
            background: linear-gradient(135deg, #ff6b4a, #ff8a6b);
            color: #fff;
        }
        .friends-empty {
            text-align: center; padding: 60px 20px; color: #666; font-size: 14px;
        }
        /* Unfollow confirm dialog */
        .confirm-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5); z-index: 9999;
            display: flex; align-items: center; justify-content: center;
        }
        .confirm-dialog {
            background: #fff; border-radius: 14px; width: 80%; max-width: 320px;
            overflow: hidden; text-align: center;
        }
        .confirm-dialog .confirm-msg {
            padding: 24px 20px 20px; font-size: 16px; color: #333;
        }
        .confirm-dialog .confirm-msg strong { font-weight: 700; }
        .confirm-dialog .confirm-btns {
            display: flex; border-top: 1px solid #eee;
        }
        .confirm-dialog .confirm-btns span {
            flex: 1; padding: 14px 0; font-size: 16px; cursor: pointer;
        }
        .confirm-dialog .confirm-btns .confirm-cancel { color: #333; }
        .confirm-dialog .confirm-btns .confirm-ok { color: #ff4d6a; font-weight: 600; border-left: 1px solid #eee; }
        /* Mutual follow popup */
        .mutual-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.7); z-index: 9999;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
        }
        .mutual-avatars {
            display: flex; align-items: center; gap: 0; margin-bottom: 20px;
        }
        .mutual-avatars img {
            width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
            border: 3px solid #fff;
        }
        .mutual-arrow {
            width: 36px; height: 36px; border-radius: 50%; background: #ff6b4a;
            display: flex; align-items: center; justify-content: center;
            margin: 0 -10px; z-index: 1; font-size: 18px; color: #fff;
        }
        .mutual-title {
            font-size: 24px; color: #fff; font-weight: 700; margin-bottom: 8px;
        }
        .mutual-subtitle {
            font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 30px;
        }
        .mutual-chat-btn {
            display: block; width: 80%; max-width: 320px; padding: 16px 0;
            background: linear-gradient(135deg, #ff6b4a, #ff4d6a);
            color: #fff; font-size: 18px; font-weight: 700; text-align: center;
            border: none; border-radius: 12px; cursor: pointer; margin-bottom: 20px;
        }
        .mutual-close {
            width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.5);
            background: transparent; color: rgba(255,255,255,0.7); font-size: 20px;
            display: flex; align-items: center; justify-content: center; cursor: pointer;
        }

        /* ===== DYNAMICS PAGE ===== */
        .dynamics-page { background: #000; min-height: calc(100vh - 72px); position: relative; }
        .merged-sub-content .dynamics-tabs { background: #2b2b4e; }
        .merged-sub-content .dynamics-feed { background: #2b2b4e; }
        .dynamics-tabs {
            display: flex; gap: 12px; padding: 16px 16px 12px; align-items: center;
        }
        .dynamics-refresh-btn {
            margin-left: auto; background: none; border: 1px solid rgba(255,255,255,0.3);
            color: rgba(255,255,255,0.6); border-radius: 20px; padding: 4px 14px;
            font-size: 13px; cursor: pointer; white-space: nowrap;
        }
        .dynamics-refresh-btn:hover { border-color: #d4a76a; color: #d4a76a; }
        .dynamics-tab-item {
            padding: 6px 18px; border: 1px solid rgba(255,255,255,0.3); border-radius: 20px;
            font-size: 14px; color: rgba(255,255,255,0.6); cursor: pointer;
            background: transparent; font-weight: 500;
        }
        .dynamics-tab-item.active {
            border-color: #d4a76a; color: #d4a76a;
        }
        .dynamics-feed { padding: 0 12px 80px; }

        /* ===== Schedule (节目单 / Live Preview) ===== */
        /* Dark theme, matches rest of the app (#1a1a2e background, #2b2b4e cards,
           gold #d4a76a and pink #ff4d6a accents). */
        .schedule-page { background: #1a1a2e; min-height: 100vh; padding-bottom: 80px !important; }
        .schedule-header {
            display: flex; align-items: center; justify-content: space-between; gap: 10px;
            padding: 12px 16px; border-bottom: 1px solid #2a2a4a; flex-wrap: wrap;
        }
        .schedule-header-title {
            color: #eee; font-size: 16px; font-weight: 600;
        }
        .schedule-date-picker {
            display: inline-flex; align-items: center; gap: 6px;
            background: #2b2b4e; border: 1px solid #3a3a6e; border-radius: 16px;
            padding: 5px 10px; color: #eee; font-size: 13px; cursor: pointer;
            -webkit-tap-highlight-color: transparent;
        }
        .schedule-date-picker input[type="date"] {
            background: transparent; color: #eee; border: none; outline: none;
            font-size: 13px; font-family: inherit;
            color-scheme: dark;
            min-width: 120px;
        }
        .schedule-date-picker .schedule-date-icon { color: #d4a76a; }
        .schedule-date-reset {
            background: transparent; border: none; color: #d4a76a;
            font-size: 12px; cursor: pointer; padding: 2px 6px;
        }
        .schedule-refresh-btn {
            padding: 6px 14px; border-radius: 16px; font-size: 13px;
            background: transparent; color: rgba(255,255,255,0.6);
            border: 1px solid rgba(255,255,255,0.3); cursor: pointer;
        }
        .schedule-refresh-btn:hover { border-color: #d4a76a; color: #d4a76a; }
        .schedule-list { padding: 12px; }
        .schedule-card {
            background: #2b2b4e;
            border: 1px solid #3a3a6e;
            border-radius: 14px; padding: 14px; margin-bottom: 12px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.35);
            cursor: pointer; position: relative; overflow: hidden;
        }
        .schedule-card:active { transform: scale(0.99); }
        .schedule-card-top {
            display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px;
        }
        .schedule-card-texts { flex: 1; min-width: 0; }
        .schedule-live-badge {
            display: inline-flex; align-items: center; gap: 4px;
            background: linear-gradient(135deg, #ff4d6a, #ff6b8a);
            color: #fff; font-size: 11px; font-weight: 700;
            padding: 3px 10px; border-radius: 10px;
        }
        .schedule-live-badge::before {
            content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff;
        }
        .schedule-live-subtitle {
            display: inline-block; margin-left: 8px;
            color: #d4a76a; font-size: 12px; font-weight: 600; vertical-align: middle;
        }
        .schedule-title {
            margin: 8px 0 0;
            color: #fff; font-size: 18px; font-weight: 700;
            line-height: 1.35;
            word-break: break-word;
        }
        .schedule-cover-wrap {
            position: relative; width: 110px; height: 110px; flex-shrink: 0;
            border-radius: 12px; overflow: hidden;
            background: linear-gradient(135deg, #3a3a6e, #2b2b4e);
        }
        .schedule-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
        .schedule-rows {
            background: #232340;
            border-radius: 12px; padding: 4px 12px;
        }
        .schedule-row {
            display: flex; align-items: center; gap: 10px;
            padding: 10px 0;
            border-bottom: 1px dashed rgba(255,255,255,0.08);
        }
        .schedule-row:last-child { border-bottom: none; }
        .schedule-row-icon {
            width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
            font-size: 14px;
        }
        .schedule-row-icon.content { background: rgba(155, 107, 255, 0.18); color: #b592ff; }
        .schedule-row-icon.time    { background: rgba(255, 77, 106, 0.18); color: #ff6b8a; }
        .schedule-row-icon.user    { background: rgba(212, 167, 106, 0.18); color: #d4a76a; }
        .schedule-row-icon.country { background: rgba(61, 192, 106, 0.18); color: #4fd28a; }
        .schedule-row-label {
            color: #ccc; font-size: 13px; font-weight: 600; flex-shrink: 0;
            min-width: 62px;
        }
        .schedule-row-value {
            color: #eee; font-size: 13px; flex: 1;
            display: flex; align-items: center; gap: 6px; min-width: 0;
            word-break: break-word;
        }
        .schedule-row-value.time { color: #ff8fa5; font-weight: 700; }
        .schedule-row-value .schedule-avatar {
            width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
            background: #363660; flex-shrink: 0;
        }
        .schedule-row-value .schedule-country-flag-emoji {
            font-size: 18px; line-height: 1; flex-shrink: 0;
        }
        .schedule-empty, .schedule-load-more {
            text-align: center; padding: 24px; color: #888; font-size: 14px;
        }
        .schedule-load-more button {
            padding: 8px 24px; border-radius: 20px; background: transparent;
            color: #d4a76a; border: 1px solid rgba(212,167,106,0.5);
            font-size: 14px; cursor: pointer;
        }
        @media (min-width: 769px) {
            .schedule-list { max-width: 900px; margin: 0 auto; padding: 16px; }
            .schedule-title { font-size: 20px; }
            .schedule-cover-wrap { width: 140px; height: 140px; }
        }
        .post-card {
            background: #1a1a2e; border-radius: 12px; margin-bottom: 12px;
            overflow: hidden;
        }
        .post-header {
            display: flex; align-items: center; padding: 14px 14px 10px;
        }
        .post-avatar {
            width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
            background: #363660; flex-shrink: 0;
        }
        .post-user-info { flex: 1; margin-left: 10px; min-width: 0; }
        .post-nickname {
            font-size: 15px; color: #d4a76a; font-weight: 600;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .post-time { font-size: 12px; color: #888; margin-top: 2px; }
        .post-hi-btn {
            width: 40px; height: 40px; flex-shrink: 0; cursor: pointer;
            background: none; border: none; font-size: 28px; margin-left: 8px;
        }
        .post-delete-btn {
            background: none; border: none; color: #d4a76a; font-size: 13px;
            cursor: pointer; margin-left: 8px; flex-shrink: 0; padding: 4px 8px;
        }
        .post-title {
            padding: 0 14px 8px; font-size: 14px; color: #eee;
        }
        .post-images {
            padding: 0 14px; display: grid; gap: 3px; max-width: 390px;
        }
        .post-images.img-count-1 { grid-template-columns: 1fr; max-width: 210px; }
        .post-images.img-count-2 { grid-template-columns: 1fr 1fr; max-width: 300px; }
        .post-images.img-count-3 { grid-template-columns: 1fr 1fr 1fr; max-width: 360px; }
        .post-images.img-count-4 { grid-template-columns: 1fr 1fr; max-width: 300px; }
        .post-images.img-count-5,
        .post-images.img-count-6 { grid-template-columns: 1fr 1fr 1fr; max-width: 360px; }
        .post-images.img-count-7,
        .post-images.img-count-8,
        .post-images.img-count-9 { grid-template-columns: 1fr 1fr 1fr; max-width: 460px; }
        .post-images .post-media-item {
            position: relative; overflow: hidden; border-radius: 4px; cursor: pointer;
            background: #222;
        }
        .post-images .post-media-item img {
            width: 100%; aspect-ratio: 1; border-radius: 4px; display: block;
            object-fit: cover; background: #222;
        }
        .post-images.img-count-1 .post-media-item img { aspect-ratio: 1; max-height: 210px; }
        .post-media-item .video-play-icon {
            position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
            width: 36px; height: 36px; background: rgba(0,0,0,0.5); border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            pointer-events: none;
        }
        .post-media-item .video-play-icon::after {
            content: ''; width: 0; height: 0;
            border-style: solid; border-width: 8px 0 8px 14px;
            border-color: transparent transparent transparent #fff;
            margin-left: 2px;
        }
        /* ===== Image Viewer Overlay ===== */
        .img-viewer-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.95); z-index: 9999;
            display: flex; align-items: center; justify-content: center;
            flex-direction: column;
        }
        .img-viewer-overlay img {
            max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 4px;
            user-select: none; -webkit-user-select: none;
        }
        .img-viewer-close {
            position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
            background: rgba(255,255,255,0.15); border: none; border-radius: 50%;
            color: #fff; font-size: 22px; cursor: pointer; z-index: 10;
            display: flex; align-items: center; justify-content: center;
        }
        .img-viewer-counter {
            color: rgba(255,255,255,0.7); font-size: 14px; margin-top: 12px;
        }
        .img-viewer-prev, .img-viewer-next {
            position: absolute; top: 50%; transform: translateY(-50%);
            width: 44px; height: 44px; background: rgba(255,255,255,0.12);
            border: none; border-radius: 50%; color: #fff; font-size: 22px;
            cursor: pointer; display: flex; align-items: center; justify-content: center;
        }
        .img-viewer-prev { left: 12px; }
        .img-viewer-next { right: 12px; }
        .post-footer {
            display: flex; justify-content: flex-end; align-items: center;
            padding: 12px 14px; gap: 20px;
        }
        .post-action-btn {
            display: flex; align-items: center; gap: 4px;
            background: none; border: none; color: #888; font-size: 14px; cursor: pointer;
        }
        .post-action-btn .action-icon { font-size: 18px; }
        .post-action-btn.liked .action-icon { color: #ff4d6a; }
        .dynamics-fab {
            position: fixed; bottom: 90px; right: 20px; width: 56px; height: 56px;
            border-radius: 50%; border: none; cursor: pointer;
            background: linear-gradient(135deg, #7b68ee, #9b59b6);
            color: #fff; font-size: 13px; font-weight: 700;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            box-shadow: 0 4px 16px rgba(123,104,238,0.4); z-index: 50;
        }
        .dynamics-fab .fab-icon { font-size: 20px; line-height: 1; }
        .dynamics-fab .fab-text { font-size: 10px; margin-top: 1px; }
        .dynamics-empty {
            text-align: center; padding: 60px 20px; color: #888; font-size: 14px;
        }
        .dynamics-load-more {
            text-align: center; padding: 16px;
        }
        .dynamics-load-more button {
            padding: 8px 32px; background: #363660; color: #ccc;
            border: none; border-radius: 20px; font-size: 13px; cursor: pointer;
        }

        /* ===== POST DETAIL PAGE ===== */
        .post-detail-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: #1a1a2e; z-index: 9997; display: flex; flex-direction: column;
            overflow: hidden;
        }
        .post-detail-header {
            display: flex; align-items: center; padding: 14px 16px;
            border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; background: #1e1e3a;
        }
        .post-detail-back {
            background: none; border: none; font-size: 24px; cursor: pointer;
            color: #fff; padding: 0 8px 0 0; line-height: 1;
        }
        .post-detail-title {
            flex: 1; text-align: center; font-size: 17px; font-weight: 600; color: #fff;
            margin-right: 32px;
        }
        .post-detail-body {
            flex: 1; overflow-y: auto; padding-bottom: 70px;
        }
        .post-detail-author {
            display: flex; align-items: center; padding: 16px 16px 12px;
        }
        .post-detail-avatar {
            width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
            background: #363660; flex-shrink: 0;
        }
        .post-detail-author-info { flex: 1; margin-left: 10px; }
        .post-detail-nickname { font-size: 16px; color: #fff; font-weight: 600; }
        .post-detail-time { font-size: 12px; color: #888; margin-top: 2px; }
        .post-detail-content { padding: 0 16px 12px; font-size: 15px; color: #ddd; line-height: 1.6; }
        .post-detail-images {
            padding: 0 16px; display: grid; gap: 3px; max-width: 390px;
        }
        .post-detail-images.img-count-1 { grid-template-columns: 1fr; max-width: 210px; }
        .post-detail-images.img-count-2 { grid-template-columns: 1fr 1fr; max-width: 300px; }
        .post-detail-images.img-count-3 { grid-template-columns: 1fr 1fr 1fr; max-width: 360px; }
        .post-detail-images.img-count-4 { grid-template-columns: 1fr 1fr; max-width: 300px; }
        .post-detail-images.img-count-5,
        .post-detail-images.img-count-6 { grid-template-columns: 1fr 1fr 1fr; max-width: 360px; }
        .post-detail-images.img-count-7,
        .post-detail-images.img-count-8,
        .post-detail-images.img-count-9 { grid-template-columns: 1fr 1fr 1fr; max-width: 460px; }
        .post-detail-images .pd-media-item {
            position: relative; overflow: hidden; border-radius: 4px; cursor: pointer;
            background: #252545;
        }
        .post-detail-images .pd-media-item img {
            width: 100%; aspect-ratio: 1; border-radius: 4px; display: block;
            object-fit: cover; background: #252545;
        }
        .post-detail-images.img-count-1 .pd-media-item img { aspect-ratio: 1; max-height: 210px; }
        .post-detail-images .pd-media-item .video-play-icon {
            position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
            width: 36px; height: 36px; background: rgba(0,0,0,0.5); border-radius: 50%;
            display: flex; align-items: center; justify-content: center; pointer-events: none;
        }
        .post-detail-images .pd-media-item .video-play-icon::after {
            content: ''; width: 0; height: 0;
            border-style: solid; border-width: 8px 0 8px 14px;
            border-color: transparent transparent transparent #fff; margin-left: 2px;
        }
        .post-detail-footer {
            display: flex; justify-content: flex-end; align-items: center;
            padding: 12px 16px; gap: 24px; border-bottom: 1px solid rgba(255,255,255,0.08);
        }
        .post-detail-footer .pd-action-btn {
            display: flex; align-items: center; gap: 6px;
            background: none; border: none; color: #999; font-size: 15px; cursor: pointer;
        }
        .post-detail-footer .pd-action-btn .pd-icon { font-size: 20px; }
        .post-detail-footer .pd-action-btn.liked .pd-icon { color: #ff4d6a; }
        .post-detail-comments-section { padding: 16px; }
        .post-detail-comments-title {
            font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 16px;
        }
        .comment-item {
            display: flex; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
        }
        .comment-avatar {
            width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
            background: #363660; flex-shrink: 0;
        }
        .comment-body { flex: 1; margin-left: 10px; }
        .comment-header {
            display: flex; align-items: baseline; justify-content: space-between;
        }
        .comment-nickname { font-size: 14px; font-weight: 600; color: #ddd; }
        .comment-meta { font-size: 12px; color: #888; }
        .comment-reply-btn {
            font-size: 13px; color: #7b68ee; background: none; border: none;
            cursor: pointer; padding: 0;
        }
        .comment-text { font-size: 14px; color: #ccc; margin-top: 6px; line-height: 1.5; }
        .post-detail-input-bar {
            position: absolute; bottom: 0; left: 0; right: 0;
            display: flex; align-items: center; padding: 10px 12px;
            background: #1e1e3a; border-top: 1px solid rgba(255,255,255,0.08); gap: 8px;
        }
        .post-detail-input-bar input {
            flex: 1; height: 40px; border: 1px solid rgba(255,255,255,0.1); border-radius: 20px;
            padding: 0 16px; font-size: 14px; background: #252545; outline: none;
            color: #fff;
        }
        .post-detail-input-bar input::placeholder { color: #666; }
        .post-detail-send-btn {
            height: 40px; padding: 0 20px; border: none; border-radius: 20px;
            background: linear-gradient(135deg, #7b68ee, #9b59b6);
            color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
            flex-shrink: 0;
        }
        .post-detail-send-btn:disabled {
            opacity: 0.5; cursor: not-allowed;
        }
        .comments-empty {
            text-align: center; padding: 40px 20px; color: #666; font-size: 14px;
        }
        .comment-delete-btn {
            font-size: 12px; color: #ff4d6a; background: none; border: 1px solid #ff4d6a;
            border-radius: 12px; padding: 2px 10px; cursor: pointer; flex-shrink: 0;
            margin-left: 8px;
        }

        /* ===== EXPENSE RECORDS (消费明细) ===== */
        .expense-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: #1a1a2e; z-index: 9997; display: flex; flex-direction: column;
            overflow: hidden;
        }
        .expense-header {
            display: flex; align-items: center; padding: 14px 16px;
            border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; background: #1e1e3a;
        }
        .expense-back {
            background: none; border: none; font-size: 24px; cursor: pointer;
            color: #fff; padding: 0 8px 0 0; line-height: 1;
        }
        .expense-title {
            flex: 1; text-align: center; font-size: 17px; font-weight: 600; color: #fff;
            margin-right: 32px;
        }
        .expense-filter {
            display: flex; align-items: center; padding: 12px 16px; gap: 10px;
            background: #1e1e3a; border-bottom: 1px solid rgba(255,255,255,0.06);
        }
        .expense-filter-btn {
            padding: 6px 16px; border-radius: 18px; font-size: 13px; font-weight: 500;
            border: 1px solid rgba(255,255,255,0.15); background: transparent; color: #999;
            cursor: pointer; white-space: nowrap;
        }
        .expense-filter-btn.active {
            background: linear-gradient(135deg, #7b68ee, #9b59b6); border-color: transparent; color: #fff;
        }
        .expense-filter-select {
            padding: 6px 12px; border-radius: 18px; font-size: 13px;
            border: 1px solid rgba(255,255,255,0.15); background: #252545; color: #ddd;
            cursor: pointer; outline: none; appearance: auto;
        }
        .expense-body {
            flex: 1; overflow-y: auto; padding: 12px 16px;
        }
        .expense-item {
            display: flex; align-items: center; padding: 14px 16px;
            background: #1e1e3a; border-radius: 12px; margin-bottom: 10px;
        }
        .expense-item-icon {
            width: 40px; height: 40px; border-radius: 50%; background: #252545;
            display: flex; align-items: center; justify-content: center; font-size: 20px;
            flex-shrink: 0;
        }
        .expense-item-info {
            flex: 1; margin-left: 12px;
        }
        .expense-item-title {
            font-size: 15px; font-weight: 500; color: #fff;
        }
        .expense-item-time {
            font-size: 12px; color: #888; margin-top: 3px;
        }
        .expense-item-amount {
            font-size: 16px; font-weight: 700; flex-shrink: 0; margin-left: 12px;
        }
        .expense-item-amount.negative { color: #ff4d6a; }
        .expense-item-amount.positive { color: #4ade80; }
        .expense-empty {
            text-align: center; color: #666; padding: 60px 0; font-size: 14px;
        }
        .expense-loading {
            text-align: center; color: #888; padding: 40px 0; font-size: 14px;
        }

        /* ===== PUBLISH OVERLAY ===== */
        .publish-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: #fff; z-index: 9998; display: flex; flex-direction: column;
            overflow-y: auto;
        }
        .publish-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 14px 16px; border-bottom: 1px solid #eee; flex-shrink: 0;
        }
        .publish-cancel {
            background: none; border: none; font-size: 16px; color: #333; cursor: pointer;
        }
        .publish-submit-btn {
            background: linear-gradient(135deg, #7b68ee, #9b59b6); color: #fff;
            border: none; border-radius: 20px; padding: 8px 24px; font-size: 15px;
            font-weight: 600; cursor: pointer;
        }
        .publish-submit-btn:disabled {
            opacity: 0.5; cursor: not-allowed;
        }
        .publish-body { flex: 1; padding: 16px; }
        .publish-textarea {
            width: 100%; min-height: 120px; border: none; outline: none;
            font-size: 16px; color: #333; resize: none; padding: 0;
            font-family: inherit; line-height: 1.6;
        }
        .publish-textarea::placeholder { color: #999; }
        .publish-media-grid {
            display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
            margin-top: 16px; max-width: 360px;
        }
        .publish-media-item {
            position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
            background: #f5f5f5;
        }
        .publish-media-item img, .publish-media-item video {
            width: 100%; height: 100%; object-fit: cover; display: block;
        }
        .publish-media-remove {
            position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
            background: rgba(0,0,0,0.5); border: none; border-radius: 50%;
            color: #fff; font-size: 14px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
        }
        .publish-add-btn {
            aspect-ratio: 1; border-radius: 8px; background: #f0f0f0;
            border: none; cursor: pointer; display: flex; align-items: center;
            justify-content: center; font-size: 32px; color: #ccc;
        }
        .publish-add-btn:hover { background: #e8e8e8; }
        .publish-location {
            display: flex; align-items: center; gap: 6px; margin-top: 24px;
            padding-top: 16px; border-top: 1px solid #eee; color: #333; font-size: 14px;
        }
        .publish-location-icon { font-size: 18px; }
        .publish-progress {
            position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
            background: rgba(0,0,0,0.8); color: #fff; padding: 16px 32px;
            border-radius: 12px; font-size: 14px; z-index: 99999;
            display: flex; align-items: center; gap: 10px;
        }
        .publish-spinner {
            width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3);
            border-top-color: #fff; border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* Speaking animation for mic seats (liveType=4 voice room) */
        @keyframes ptSpeakingPulse {
            0% { box-shadow: 0 0 0 0 rgba(0,200,100,0.6); }
            50% { box-shadow: 0 0 0 6px rgba(0,200,100,0.15); }
            100% { box-shadow: 0 0 0 0 rgba(0,200,100,0); }
        }
        .pt-seat-speaking {
            animation: ptSpeakingPulse 1.2s ease-in-out infinite;
            border-radius: 50%;
            border: 2px solid #00c864 !important;
        }

        /* ===== LIVE ROOM PAGE ===== */
        .live-room-page {
            background: #000; color: #fff;
            display: flex; flex-direction: column; overflow: hidden;
            position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 200;
        }
        /* Desktop: side by side */
        .live-room-body {
            display: flex; flex: 1; min-height: 0; height: 100vh;
        }
        .live-video-area {
            flex: 3; position: relative; background: #000;
            display: flex; align-items: center; justify-content: center;
            min-width: 0; overflow: hidden; min-height: 0;
        }
        .live-video-area > img {
            width: 100%; height: 100%; object-fit: cover;
        }
        .live-video-placeholder {
            color: #666; font-size: 14px; text-align: center;
        }
        .live-top-bar {
            position: absolute; top: 0; left: 0; right: 0;
            display: flex; justify-content: space-between; align-items: center;
            padding: 12px 16px;
            /* z-index 250 sits above running game panels (200) so the exit X is
               always tappable, but below gift/seat/game-select overlays (260). */
            z-index: 250;
            padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
            background: linear-gradient(rgba(0,0,0,0.6), transparent);
        }
        .live-host-info {
            display: flex; align-items: center; gap: 4px;
        }
        .live-host-avatar {
            width: 40px; height: 40px; border-radius: 50%;
            object-fit: cover; border: 2px solid rgba(255,255,255,0.3);
        }
        .live-host-name {
            font-size: 14px; font-weight: 600; color: #fff;
            text-shadow: 0 1px 3px rgba(0,0,0,0.5);
            max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block;
        }
        .live-top-right {
            display: flex; align-items: center; gap: 6px;
        }
        .live-viewers-count {
            font-size: 13px; color: #fff; background: rgba(255,255,255,0.15);
            padding: 4px 10px; border-radius: 14px;
            display: flex; align-items: center; gap: 3px;
        }
        .live-viewers-count .viewers-icon {
            width: 16px; height: 16px; vertical-align: middle;
        }
        /* Top 3 Gift Ranking Avatars */
        .gift-rank-top3 {
            display: flex; align-items: center; gap: 0px;
            margin-right: 0;
        }
        .gift-rank-top3 .rank-avatar-wrap {
            position: relative; width: 30px; height: 30px;
            margin-left: -6px; cursor: pointer;
        }
        .gift-rank-top3 .rank-avatar-wrap:first-child {
            margin-left: 0;
        }
        .gift-rank-top3 .rank-avatar-inner {
            position: relative; width: 30px; height: 30px;
            display: flex; align-items: center; justify-content: center;
        }
        .gift-rank-top3 .rank-avatar-img {
            width: 22px; height: 22px; border-radius: 50%;
            object-fit: cover; position: absolute;
            top: 50%; left: 50%; transform: translate(-50%, -50%);
            z-index: 1;
        }
        .gift-rank-top3 .rank-frame {
            position: absolute; top: 0; left: 0;
            width: 30px; height: 30px;
            z-index: 2; pointer-events: none;
        }
        .gift-rank-top3 .rank-frame img {
            width: 100%; height: 100%; display: block;
        }
        .btn-exit-room {
            width: 32px; height: 32px; border-radius: 50%;
            background: rgba(255,255,255,0.2); border: none;
            color: #fff; font-size: 18px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
        }
        .btn-exit-room:hover { background: rgba(255,77,106,0.8); }

        /* Swipe room transition (mobile only) - quick content fade */
        .live-room-page .live-room-body {
            transition: opacity 0.18s ease;
        }
        .live-room-page.swipe-fade-out .live-room-body {
            opacity: 0;
        }
        .btn-live-follow {
            padding: 4px 12px; border-radius: 14px; font-size: 12px; font-weight: 600;
            background: linear-gradient(135deg, #ff6a88, #a855f7); border: none; color: #fff;
            cursor: pointer; white-space: nowrap; margin-left: 2px;
        }
        .btn-live-follow:hover { opacity: 0.85; }
        .btn-live-follow.followed {
            background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4);
        }
        .btn-live-data {
            padding: 4px 10px; border-radius: 14px; font-size: 12px;
            background: rgba(255,255,255,0.2); border: none; color: #fff;
            cursor: pointer; white-space: nowrap;
        }
        .btn-live-data:hover { background: rgba(255,255,255,0.35); }

        /* Live Data Panel */
        .live-data-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6); z-index: 500;
            display: flex; align-items: center; justify-content: center;
        }
        .live-data-panel {
            background: #1a1a1a; border-radius: 12px; width: 380px; max-width: 92vw;
            height: 70vh; max-height: 70vh; display: flex; flex-direction: column; overflow: hidden;
            border: 1px solid #333;
        }
        .live-data-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 16px 20px; border-bottom: 1px solid #333;
        }
        .live-data-header h3 { margin: 0; font-size: 16px; color: #fff; }
        .live-data-header .close-btn {
            background: none; border: none; color: #999; font-size: 22px; cursor: pointer;
        }
        .live-data-body { overflow-y: auto; padding: 16px 20px; flex: 1; }
        .live-data-section-title {
            font-size: 14px; font-weight: 600; color: #d4a76a;
            margin-bottom: 12px; padding-left: 8px;
            border-left: 3px solid #d4a76a;
        }
        .live-data-grid {
            display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
            background: #252525; border-radius: 8px; padding: 16px; margin-bottom: 20px;
        }
        .live-data-item { text-align: center; }
        .live-data-item .label { font-size: 12px; color: #999; margin-bottom: 4px; }
        .live-data-item .value { font-size: 20px; font-weight: 700; color: #fff; }
        .live-record-item {
            background: #252525; border-radius: 8px; padding: 14px; margin-bottom: 10px;
            border-left: 3px solid #d4a76a;
        }
        .live-record-item .record-time {
            font-size: 13px; color: #d4a76a; font-weight: 600; margin-bottom: 8px;
        }
        .live-record-item .record-row {
            display: flex; justify-content: space-between;
            font-size: 12px; color: #ccc; padding: 2px 0;
        }
        .live-record-item .record-row .rlabel { color: #999; }
        .btn-load-more-records {
            width: 100%; padding: 10px; background: #333; border: none;
            color: #ccc; border-radius: 8px; cursor: pointer; font-size: 13px;
            margin-top: 8px;
        }
        .btn-load-more-records:hover { background: #444; }

        /* Chat area */
        .live-chat-area {
            flex: 2; background: #1a1a1a;
            display: flex; flex-direction: column;
            border-left: 1px solid #333;
            min-width: 0; position: relative;
        }
        .chat-tabs {
            display: flex; border-bottom: 1px solid #333;
            padding: 0;
        }
        .chat-tabs span {
            flex: 1; text-align: center; padding: 12px 0;
            font-size: 14px; color: #999; cursor: pointer;
            border-bottom: 2px solid transparent;
        }
        .chat-tabs span.active {
            color: #fff; border-bottom-color: #ff4d6a;
        }
        .chat-messages {
            flex: 1; overflow-y: auto; padding: 12px;
            min-height: 200px;
        }
        .chat-msg {
            margin-bottom: 10px; font-size: 13px; line-height: 1.5;
        }
        .chat-msg .chat-user { color: #e0943a; font-weight: 600; margin-right: 6px; }
        .chat-msg .chat-text { color: #ddd; }
        .chat-msg.system { color: #f59e0b; font-size: 12px; }
        .chat-msg.bet-msg { background: rgba(180,130,70,0.35); border-radius: 12px; padding: 4px 10px; margin-bottom: 6px; display: block; width: fit-content; }
        .chat-msg.win-msg { background: linear-gradient(135deg, rgba(255,165,0,0.4), rgba(255,100,50,0.3)); border-radius: 12px; padding: 4px 10px; margin-bottom: 6px; display: block; width: fit-content; }
        .chat-msg .chat-bet-tag { background: #b48246; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-right: 6px; }
        .chat-msg .chat-win-tag { background: #ff4d6a; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-right: 6px; }
        .live-notice-bar {
            background: none; font-size: 13px; font-weight: 600;
            padding: 8px 12px; display: none;
            border-bottom: 1px solid #333;
        }
        .live-notice-bar .notice-label {
            color: #ff4d6a; margin-right: 6px;
        }
        .live-notice-bar .notice-text {
            color: #54D7E2;
        }
        .btn-notice {
            background: none; border: none; font-size: 20px;
            cursor: pointer; padding: 4px 6px; line-height: 1;
            display: none !important;
        }
        .btn-beauty {
            background: rgba(0,0,0,0.4); border: none; font-size: 14px;
            cursor: pointer; padding: 4px 10px; line-height: 1;
            display: none; color: #fff; border-radius: 14px;
            margin-right: 6px; white-space: nowrap;
        }
        .btn-beauty.active { background: rgba(255,105,180,0.6); }
        /* Beauty Settings Panel */
        .beauty-panel-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6); z-index: 500;
            display: none; align-items: flex-end; justify-content: center;
        }
        .beauty-panel-overlay.show { display: flex; }
        .beauty-panel {
            background: #1a1a2e; border-radius: 16px 16px 0 0; width: 100%; max-width: 500px;
            padding: 20px 16px 28px; animation: slideUp 0.25s ease-out;
        }
        .beauty-panel-header {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 16px;
        }
        .beauty-panel-header h3 {
            margin: 0; font-size: 16px; color: #fff; font-weight: 600;
        }
        .beauty-panel-close {
            background: none; border: none; color: #999; font-size: 22px; cursor: pointer;
        }
        .beauty-toggle-row {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 18px; padding: 0 4px;
        }
        .beauty-toggle-label { font-size: 14px; color: #ccc; }
        .beauty-toggle-switch {
            position: relative; width: 44px; height: 24px; cursor: pointer;
        }
        .beauty-toggle-switch input { opacity: 0; width: 0; height: 0; }
        .beauty-toggle-slider {
            position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            background: #444; border-radius: 12px; transition: 0.3s;
        }
        .beauty-toggle-slider:before {
            content: ''; position: absolute; width: 18px; height: 18px;
            left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.3s;
        }
        .beauty-toggle-switch input:checked + .beauty-toggle-slider { background: #ff69b4; }
        .beauty-toggle-switch input:checked + .beauty-toggle-slider:before { transform: translateX(20px); }
        .beauty-slider-group { margin-bottom: 14px; padding: 0 4px; }
        .beauty-slider-label {
            display: flex; justify-content: space-between; align-items: center;
            font-size: 13px; color: #bbb; margin-bottom: 6px;
        }
        .beauty-slider-label .beauty-val { color: #ff69b4; font-weight: 600; min-width: 28px; text-align: right; }
        .beauty-slider-group input[type=range] {
            -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
            border-radius: 2px; background: #333; outline: none;
        }
        .beauty-slider-group input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none; appearance: none; width: 18px; height: 18px;
            border-radius: 50%; background: #ff69b4; cursor: pointer; border: 2px solid #fff;
        }
        .beauty-slider-group input[type=range]::-moz-range-thumb {
            width: 18px; height: 18px; border-radius: 50%; background: #ff69b4;
            cursor: pointer; border: 2px solid #fff;
        }
        .beauty-reset-btn {
            display: block; margin: 8px auto 0; padding: 8px 28px; border-radius: 20px;
            background: #333; color: #ccc; border: 1px solid #555; font-size: 13px;
            cursor: pointer;
        }
        .beauty-reset-btn:active { background: #444; }
        /* Exchange Prompt Popup */
        .exchange-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.7); z-index: 600;
            display: none; align-items: center; justify-content: center;
        }
        .exchange-overlay.show { display: flex; }
        .exchange-popup {
            width: 340px; max-width: 90vw; border-radius: 20px; overflow: hidden;
            background: linear-gradient(135deg, #2d1b4e 0%, #1a0a3e 40%, #3b1a5e 100%);
            border: 2px solid #c8944a; box-shadow: 0 0 40px rgba(200,148,74,0.4);
            animation: exchangePopIn 0.4s ease-out; position: relative;
        }
        @keyframes exchangePopIn { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
        .exchange-header {
            text-align: center; padding: 22px 16px 10px; position: relative;
        }
        .exchange-header h2 {
            margin: 0; font-size: 28px; font-weight: 800; color: #ffd700;
            text-shadow: 0 2px 8px rgba(255,215,0,0.5);
        }
        .exchange-header .exchange-subtitle {
            display: inline-block; margin-top: 6px; padding: 3px 20px;
            background: linear-gradient(90deg, transparent, rgba(200,148,74,0.3), transparent);
            border: 1px solid #c8944a; border-radius: 12px;
            font-size: 13px; color: #daa520; letter-spacing: 2px;
        }
        .exchange-body { padding: 10px 16px 16px; }
        .exchange-row {
            display: flex; align-items: center; gap: 12px;
            background: linear-gradient(135deg, rgba(200,148,74,0.15), rgba(200,148,74,0.05));
            border: 1px solid rgba(200,148,74,0.4); border-radius: 12px;
            padding: 12px 14px; margin-bottom: 10px;
        }
        .exchange-row:last-child { margin-bottom: 0; }
        .exchange-row-icon { font-size: 32px; flex-shrink: 0; }
        .exchange-row-text { flex: 1; }
        .exchange-row-text .ex-label { font-size: 13px; color: #ccc; }
        .exchange-row-text .ex-value {
            font-size: 22px; font-weight: 800; color: #ffd700;
            text-shadow: 0 1px 4px rgba(255,215,0,0.4);
        }
        .exchange-row-text .ex-value .ex-unit { font-size: 14px; font-weight: 400; color: #daa520; margin-left: 2px; }
        .exchange-row-text .ex-desc { font-size: 11px; color: #aaa; margin-top: 2px; }
        .exchange-footer { padding: 10px 16px 22px; text-align: center; }
        .exchange-btn-ok {
            display: inline-block; padding: 12px 60px; border: none; border-radius: 25px;
            background: linear-gradient(135deg, #c8944a, #e6b85c, #c8944a);
            color: #1a0a3e; font-size: 20px; font-weight: 800; cursor: pointer;
            box-shadow: 0 4px 15px rgba(200,148,74,0.5); letter-spacing: 4px;
        }
        .exchange-btn-ok:active { transform: scale(0.95); }
        /* Confetti particles */
        .exchange-confetti { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; overflow: hidden; }
        .exchange-confetti span {
            position: absolute; width: 8px; height: 8px; border-radius: 50%;
            animation: confettiFall 2s linear infinite;
        }
        @keyframes confettiFall {
            0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
            100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
        }
        /* Flash Exchange Panel */
        .flash-exchange-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.7); z-index: 650;
            display: none; align-items: center; justify-content: center;
        }
        .flash-exchange-overlay.show { display: flex; }
        .flash-exchange-panel {
            width: 340px; max-width: 90vw; border-radius: 16px; overflow: hidden;
            background: linear-gradient(135deg, #1a1a3e 0%, #252550 50%, #1a1a3e 100%);
            border: 1px solid rgba(200,148,74,0.3);
            box-shadow: 0 8px 32px rgba(0,0,0,0.5);
            animation: exchangePopIn 0.3s ease-out;
        }
        .flash-exchange-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
        }
        .flash-exchange-header .fe-title {
            font-size: 16px; font-weight: 700; color: #ffd700;
        }
        .flash-exchange-header .fe-close {
            width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,0.1);
            border: none; color: #999; font-size: 18px; cursor: pointer;
            display: flex; align-items: center; justify-content: center; line-height: 1;
        }
        .flash-exchange-header .fe-close:active { background: rgba(255,255,255,0.2); }
        .flash-exchange-body { padding: 16px; }
        .fe-card {
            background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
            border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
        }
        .fe-card-label { font-size: 12px; color: #999; margin-bottom: 6px; }
        .fe-card-row { display: flex; align-items: center; gap: 10px; }
        .fe-card-type {
            display: flex; align-items: center; gap: 6px;
            padding: 6px 12px; border-radius: 20px;
            background: rgba(200,148,74,0.15); border: 1px solid rgba(200,148,74,0.3);
            font-size: 14px; font-weight: 600; color: #ffd700; white-space: nowrap;
        }
        .fe-card-type img { width: 18px; height: 18px; }
        .fe-card-input {
            flex: 1; background: transparent; border: none; outline: none;
            color: #fff; font-size: 20px; font-weight: 700; text-align: right;
            min-width: 0; -moz-appearance: textfield;
        }
        .fe-card-input::-webkit-outer-spin-button,
        .fe-card-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        .fe-card-input::placeholder { color: #555; font-weight: 400; font-size: 16px; }
        .fe-card-balance { font-size: 11px; color: #777; margin-top: 6px; text-align: right; }
        .fe-swap-btn-wrap { display: flex; justify-content: center; margin: -4px 0; position: relative; z-index: 1; }
        .fe-swap-btn {
            width: 36px; height: 36px; border-radius: 50%;
            background: linear-gradient(135deg, #c8944a, #e6b85c);
            border: 2px solid #1a1a3e; color: #1a1a3e; font-size: 18px; font-weight: 700;
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            transition: transform 0.3s;
        }
        .fe-swap-btn:active { transform: rotate(180deg); }
        .fe-rate-info {
            margin-top: 12px; padding: 10px 14px;
            background: rgba(255,255,255,0.03); border-radius: 10px;
            font-size: 12px; color: #888; line-height: 1.8;
        }
        .fe-rate-info .fe-rate-line { display: flex; justify-content: space-between; }
        .fe-submit-btn {
            display: block; width: 100%; margin-top: 14px; padding: 12px 0;
            border: none; border-radius: 25px;
            background: linear-gradient(135deg, #c8944a, #e6b85c, #c8944a);
            color: #1a0a3e; font-size: 16px; font-weight: 700; cursor: pointer;
            letter-spacing: 2px;
        }
        .fe-submit-btn:active { opacity: 0.85; transform: scale(0.98); }
        .fe-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .mine-flash-exchange-btn {
            color: #ffd700; font-size: 12px; font-weight: 600; cursor: pointer;
            padding: 4px 10px; border-radius: 12px;
            background: rgba(200,148,74,0.15); border: 1px solid rgba(200,148,74,0.3);
            white-space: nowrap; display: inline-block;
            text-align: center; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
        }
        .mine-flash-exchange-btn:active { opacity: 0.7; }
        .notice-modal-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6); z-index: 500;
            display: flex; align-items: center; justify-content: center;
        }
        .notice-modal {
            background: #1a1a1a; border-radius: 12px; width: 320px; max-width: 90vw;
            padding: 20px; border: 1px solid #333;
        }
        .notice-modal h3 { margin: 0 0 14px; font-size: 16px; color: #fff; }
        .notice-modal textarea {
            width: 100%; height: 80px; background: #333; border: 1px solid #444;
            border-radius: 8px; color: #fff; font-size: 14px; padding: 10px;
            resize: none; outline: none; box-sizing: border-box;
        }
        .notice-modal textarea:focus { border-color: #54D7E2; }
        .notice-modal-btns {
            display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px;
        }
        .notice-modal-btns button {
            padding: 8px 20px; border-radius: 20px; border: none;
            font-size: 13px; cursor: pointer; font-weight: 500;
        }
        .notice-modal-btns .btn-cancel { background: #333; color: #ccc; }
        .notice-modal-btns .btn-confirm { background: #54D7E2; color: #fff; }
        /* User action popup (host clicks username) */
        .user-action-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5); z-index: 510;
            display: flex; align-items: center; justify-content: center;
        }
        .user-action-popup {
            background: #1a1a1a; border-radius: 12px; width: 260px; max-width: 85vw;
            padding: 20px; border: 1px solid #333; text-align: center;
        }
        .user-action-popup .popup-nick {
            font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 16px;
        }
        .user-action-popup .popup-btns {
            display: flex; flex-direction: column; gap: 10px;
        }
        .user-action-popup .popup-btns button {
            padding: 10px; border-radius: 8px; border: none;
            font-size: 14px; cursor: pointer; font-weight: 500;
        }
        .user-action-popup .btn-mute { background: #ff4d6a; color: #fff; }
        .user-action-popup .btn-blacklist { background: #ff4d6a; color: #fff; }
        .user-action-popup .btn-popup-cancel { background: #222; color: #999; margin-top: 4px; }
        .chat-msg .chat-user.clickable { cursor: pointer; }
        .chat-msg .chat-user.clickable:hover { text-decoration: underline; }
        .chat-input-bar {
            display: flex; padding: 8px 12px; gap: 8px;
            border-top: 1px solid #333; background: #222;
            align-items: center;
        }
        .chat-input-bar input {
            flex: 1; min-width: 0; padding: 8px 12px; border-radius: 20px;
            border: 1px solid #444; background: #333; color: #fff;
            font-size: 13px; outline: none;
        }
        .chat-input-bar input::placeholder { color: #777; }
        .chat-input-bar input:focus { border-color: #ff4d6a; }
        .chat-input-bar .btn-send {
            padding: 8px 16px; border-radius: 20px;
            background: #ff4d6a; color: #fff; border: none;
            font-size: 13px; cursor: pointer; font-weight: 500;
            flex-shrink: 0;
        }

        /* Online users list */
        .online-users-list { flex: 1; overflow-y: auto; padding: 12px; display: none; }
        .online-user-item {
            display: flex; align-items: center; gap: 10px;
            padding: 8px 0; border-bottom: 1px solid #333;
        }
        .online-user-item img {
            width: 36px; height: 36px; border-radius: 50%;
            object-fit: cover; border: 1px solid #555; flex-shrink: 0;
        }
        .online-user-avatar-wrap {
            position: relative; width: 36px; height: 36px; flex-shrink: 0;
        }
        .online-user-avatar-wrap img {
            width: 36px; height: 36px; border-radius: 50%;
            object-fit: cover; border: 1px solid #555;
        }
        .mute-badge {
            position: absolute; bottom: -2px; right: -2px;
            width: 16px; height: 16px; border-radius: 50%;
            background: #ff4d6a; display: flex; align-items: center;
            justify-content: center; font-size: 9px; line-height: 1;
            border: 1.5px solid #1a1a2e;
        }
        .online-user-item .online-user-nick {
            font-size: 14px; color: #eee; font-weight: 500;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .online-user-item .online-user-id {
            font-size: 11px; color: #888; margin-top: 2px;
        }

        /* Gift Ranking */
        .ranking-list { flex: 1; overflow-y: auto; padding: 0; display: none; }
        .ranking-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 10px 16px 6px; font-size: 13px; color: #b8a0e8; font-weight: 600;
        }
        .ranking-item {
            display: flex; align-items: center; padding: 10px 16px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .ranking-rank {
            width: 24px; font-size: 14px; font-weight: 700; color: #b8a0e8;
            text-align: center; flex-shrink: 0;
        }
        .ranking-rank.top1 { color: #ffd700; }
        .ranking-rank.top2 { color: #c0c0c0; }
        .ranking-rank.top3 { color: #cd7f32; }
        .ranking-avatar {
            width: 44px; height: 44px; border-radius: 50%;
            object-fit: cover; margin: 0 12px; flex-shrink: 0;
            border: 2px solid rgba(255,255,255,0.1);
        }
        .ranking-info { flex: 1; min-width: 0; }
        .ranking-nick {
            font-size: 14px; color: #eee; font-weight: 500;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            display: flex; align-items: center; gap: 6px;
        }
        .ranking-gender {
            display: inline-flex; width: 18px; height: 18px;
            align-items: center; justify-content: center;
            flex-shrink: 0; vertical-align: middle;
        }
        .ranking-gender img { width: 100%; height: 100%; object-fit: contain; }
        .ranking-gender.male { }
        .ranking-gender.female { }
        .ranking-coin {
            font-size: 14px; color: #b8a0e8; font-weight: 600;
            flex-shrink: 0; margin-left: 12px;
        }

        /* Create Live Modal */
        .create-live-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6); z-index: 500;
            display: none; align-items: center; justify-content: center;
        }
        .create-live-overlay.show { display: flex; }
        .create-live-modal {
            background: #1e1e2e; border-radius: 16px; width: 88%; max-width: 380px;
            padding: 24px 20px; color: #eee;
        }
        .create-live-modal h3 {
            text-align: center; font-size: 17px; margin-bottom: 20px; color: #fff;
        }
        .create-live-modal .cl-info {
            font-size: 13px; color: #999; text-align: center; margin-bottom: 20px;
            line-height: 1.6;
        }
        .create-live-modal .cl-btns {
            display: flex; gap: 12px; justify-content: center;
        }
        .create-live-modal .cl-btns button {
            padding: 10px 28px; border-radius: 20px; border: none;
            font-size: 14px; font-weight: 600; cursor: pointer;
        }
        .cl-btn-cancel { background: #444; color: #ccc; }
        .cl-btn-confirm { background: #ff4d6a; color: #fff; }
        .cl-btn-confirm:disabled { background: #666; cursor: not-allowed; }
        /* Game Picker in Create Live */
        .cl-game-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 14px; color: #ccc; }
        .cl-game-row .cl-game-label { white-space: nowrap; }
        .cl-game-selected { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .cl-game-selected .cl-game-chip { position: relative; display: inline-flex; align-items: center; background: #2a2a3e; border-radius: 10px; padding: 4px 8px; border: 2px solid #6c5ce7; }
        .cl-game-selected .cl-game-chip img { width: 36px; height: 36px; border-radius: 6px; }
        .cl-game-selected .cl-game-chip .cl-game-remove { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; background: #ff4d6a; color: #fff; border-radius: 50%; font-size: 12px; line-height: 18px; text-align: center; cursor: pointer; }
        /* `添加 +` button inside create-live / create-PT modal. Enlarged hit
           area so mobile taps land reliably (was 6px/14px padding, ~30×70px
           which is below the recommended 44×44 touch target). */
        .cl-game-add-btn {
            background: #6c5ce7; color: #fff; border: none; border-radius: 10px;
            padding: 10px 20px; font-size: 14px; font-weight: 600;
            cursor: pointer; white-space: nowrap; min-height: 40px;
            -webkit-tap-highlight-color: rgba(255,255,255,0.25);
            touch-action: manipulation;
        }
        .cl-game-add-btn:active { background: #5a4bc7; transform: scale(0.97); }
        .game-picker-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 600; display: none; align-items: center; justify-content: center; }
        .game-picker-overlay.show { display: flex; }
        .game-picker-modal { background: #1e1e2e; border-radius: 16px; width: 85%; max-width: 360px; padding: 20px; color: #eee; }
        .game-picker-modal h4 { text-align: center; margin-bottom: 16px; font-size: 16px; }
        .game-picker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
        .game-picker-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; padding: 8px 4px; border-radius: 10px; background: #fff; }
        .game-picker-item img { width: 52px; height: 52px; border-radius: 8px; }
        .game-picker-item span { font-size: 11px; color: #333; margin-top: 4px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70px; }
        .btn-go-live {
            padding: 4px 14px; background: #ff4d6a; color: #fff;
            border: none; border-radius: 14px; font-size: 12px;
            cursor: pointer; font-weight: 500;
            display: none;
        }

        /* Ranking Page Header (full screen inline) */
        .ranking-page-header {
            display: flex; align-items: center; padding: 14px 16px;
            background: linear-gradient(135deg, #ff6b8a, #ff4d6a);
            position: sticky; top: 0; z-index: 10;
        }
        .ranking-page-back {
            font-size: 28px; color: #fff; cursor: pointer;
            background: none; border: none; padding: 0 8px;
            -webkit-tap-highlight-color: transparent;
        }
        .ranking-page-title {
            flex: 1; text-align: center; font-size: 17px;
            font-weight: 700; color: #fff;
        }
        /* Dark ranking page body */
        #tabContentRanking {
            background: #2b2b4e;
        }
        #tabContentRanking .anchor-rank-tabs {
            background: #2b2b4e;
            padding: 12px 16px 0;
        }
        #tabContentRanking .anchor-rank-tabs span {
            color: #aaa;
        }
        #tabContentRanking .anchor-rank-tabs span.active {
            background: #ff4d6a; color: #fff;
        }
        #tabContentRanking .anchor-rank-podium {
            background: #2b2b4e;
        }
        #tabContentRanking .anchor-rank-list {
            background: #363660;
        }

        /* Anchor Ranking Modal (keep for backward compat) */
        .anchor-rank-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6); z-index: 500;
            display: none; align-items: center; justify-content: center;
        }
        .anchor-rank-overlay.show { display: flex; }
        .anchor-rank-modal {
            background: #fff; border-radius: 16px; width: 92%; max-width: 420px;
            height: 520px; display: flex; flex-direction: column;
            overflow: hidden;
        }
        .anchor-rank-header {
            display: flex; align-items: center; padding: 14px 16px;
            border-bottom: 1px solid #eee; position: relative;
        }
        .anchor-rank-back {
            font-size: 22px; color: #333; cursor: pointer;
            background: none; border: none; padding: 0 8px;
        }
        .anchor-rank-title {
            flex: 1; text-align: center; font-size: 17px;
            font-weight: 700; color: #333;
        }
        .anchor-rank-tabs {
            display: flex; padding: 12px 16px 0; gap: 0; flex-shrink: 0;
        }
        .anchor-rank-tabs span {
            flex: 1; text-align: center; padding: 8px 0;
            font-size: 14px; color: #999; cursor: pointer;
            border-radius: 20px; transition: all 0.2s;
        }
        .anchor-rank-tabs span.active {
            background: #333; color: #fff; font-weight: 600;
        }
        .anchor-rank-podium {
            display: flex; justify-content: center; align-items: flex-end;
            padding: 24px 10px 16px; gap: 12px;
            flex-shrink: 0;
        }
        .podium-card.second, .podium-card.third {
            margin-top: 20px;
        }
        .podium-card {
            display: flex; flex-direction: column; align-items: center;
            width: 30%; padding: 16px 6px 12px;
            background: transparent; border-radius: 14px;
            position: relative;
        }
        .podium-card.first { order: 2; }
        .podium-card.second { order: 1; }
        .podium-card.third { order: 3; }
        .podium-avatar-wrap {
            position: relative; margin-bottom: 8px;
        }
        /* Crown badge above avatar */
        .podium-crown {
            position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
            font-size: 24px; z-index: 2; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
        }
        .podium-card.first .podium-crown { font-size: 30px; top: -22px; }
        /* Rank number badge below avatar */
        .podium-rank-badge {
            position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
            width: 22px; height: 22px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 12px; font-weight: 800; color: #fff;
            z-index: 3; border: 2px solid #2b2b4e;
        }
        .podium-rank-badge.rank-1 { background: linear-gradient(135deg, #ffd700, #f0a500); width: 26px; height: 26px; font-size: 14px; bottom: -10px; }
        .podium-rank-badge.rank-2 { background: linear-gradient(135deg, #c0c0c0, #8a8a8a); }
        .podium-rank-badge.rank-3 { background: linear-gradient(135deg, #cd7f32, #a0622a); }
        .podium-avatar {
            width: 64px; height: 64px; border-radius: 50%;
            object-fit: cover; border: 3px solid #ddd;
        }
        .podium-card.first .podium-avatar { width: 76px; height: 76px; border: 4px solid #ffd700; box-shadow: 0 0 16px rgba(255,215,0,0.5); }
        .podium-card.second .podium-avatar { border-color: #c0c0c0; box-shadow: 0 0 12px rgba(192,192,192,0.4); }
        .podium-card.third .podium-avatar { border-color: #cd7f32; box-shadow: 0 0 12px rgba(205,127,50,0.4); }
        .podium-nick {
            font-size: 12px; color: #fff; font-weight: 600;
            text-align: center; max-width: 100%;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .podium-coin {
            display: flex; align-items: center; gap: 3px;
            font-size: 12px; color: #f5a623; font-weight: 700; margin-top: 4px;
        }
        .podium-coin-icon {
            width: 16px; height: 16px; border-radius: 50%;
            background: #f5a623; color: #fff; font-size: 9px;
            display: flex; align-items: center; justify-content: center;
            font-weight: 700;
        }
        .anchor-rank-list {
            flex: 1; overflow-y: auto; padding: 0;
            min-height: 0;
        }
        .anchor-rank-item {
            display: flex; align-items: center; padding: 14px 16px;
            border-bottom: 1px solid rgba(255,255,255,0.08);
        }
        /* Crown with number for rank 4+ */
        .rank-crown-wrap {
            position: relative; width: 40px; height: 44px; flex-shrink: 0;
            display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
        }
        .rank-crown-icon {
            font-size: 18px; line-height: 1; margin-bottom: -2px;
        }
        .rank-crown-num {
            font-size: 16px; font-weight: 800; color: #aaa;
            line-height: 1;
        }
        .anchor-rank-num {
            width: 28px; font-size: 16px; font-weight: 700; color: #fff;
            text-align: center; flex-shrink: 0;
        }
        /* Circular avatar with colored ring and dot */
        .rank-avatar-wrap {
            position: relative; margin: 0 12px; flex-shrink: 0;
        }
        .anchor-rank-avatar {
            width: 48px; height: 48px; border-radius: 50%;
            object-fit: cover; flex-shrink: 0;
            border: 3px solid #7ecfcf;
        }
        /* Alternating ring colors */
        .rank-ring-cyan .anchor-rank-avatar { border-color: #7ecfcf; }
        .rank-ring-gray .anchor-rank-avatar { border-color: #a0a0c0; }
        .rank-ring-pink .anchor-rank-avatar { border-color: #e0a0b0; }
        .anchor-rank-nick {
            flex: 1; font-size: 14px; color: #fff; font-weight: 500;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .anchor-rank-coin-val {
            display: flex; align-items: center; gap: 3px;
            font-size: 14px; color: #f5a623; font-weight: 700;
            flex-shrink: 0;
        }

        /* Gift panel */
        /* z-index intentionally above the running game panels (game overlays
           are z-index 200 on mobile / 70 on PC). Gift/apply-seat/game-picker
           popups triggered from the bottom bar must float ABOVE any currently
           open game panel so the user can interact with them. */
        .gift-panel-overlay {
            position: absolute; bottom: 0; left: 0; right: 0; top: 0;
            background: rgba(0,0,0,0.4); z-index: 260;
            display: none;
        }
        .gift-panel {
            position: absolute; bottom: 0; left: 0; right: 0;
            background: #1e1e2e; border-radius: 16px 16px 0 0;
            padding: 16px; max-height: 50vh; z-index: 261;
            display: flex; flex-direction: column;
            animation: slideUp 0.2s ease-out;
        }
        @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
        .gift-panel-header {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 12px;
        }
        .gift-panel-header span { color: #eee; font-size: 15px; font-weight: 600; }
        .gift-panel-close {
            color: #999; font-size: 20px; cursor: pointer;
            background: none; border: none; padding: 0 4px;
        }
        .gift-grid {
            display: grid; grid-template-columns: repeat(4, 1fr);
            gap: 12px; overflow-y: auto; flex: 1; min-height: 0;
            padding-bottom: 8px;
        }
        .gift-item {
            display: flex; flex-direction: column; align-items: center;
            cursor: pointer; padding: 8px 4px; border-radius: 10px;
            transition: background 0.15s;
        }
        .gift-item:hover { background: rgba(255,255,255,0.08); }
        .gift-item:active { background: rgba(255,77,106,0.2); }
        .gift-item.selected { background: rgba(255,77,106,0.25); border: 1px solid #ff4d6a; }
        .gift-item img { width: 48px; height: 48px; object-fit: contain; }
        .gift-item .gift-title { font-size: 11px; color: #ccc; margin-top: 4px; text-align: center; }
        .gift-item .gift-coin {
            font-size: 10px; color: #f5c542; margin-top: 2px;
            display: flex; align-items: center; gap: 2px;
        }
        .btn-gift, .btn-game {
            background: none !important; border: none !important; font-size: 22px;
            cursor: pointer; padding: 4px 8px; line-height: 1; flex-shrink: 0;
        }
        /* Host func panel base styles live in host-func-panel.css.
           Mobile/immersive overrides remain in the media queries below. */
        .btn-host-func {
            background: none !important; border: none !important; font-size: 22px;
            cursor: pointer; padding: 4px 8px; line-height: 1; flex-shrink: 0;
            display: none;
        }
        .btn-host-func img {
            width: 28px; height: 28px;
        }
        /* Ensure ZEGO video elements fill container without black bars */
        #zegoRemoteVideo video {
            width: 100% !important; height: 100% !important; object-fit: cover !important;
        }
        /* Game picker (the popup you see after tapping the game button in
           the bottom bar -- NOT the running game panels bac/dt/sb/rl). Must
           float above a currently running game panel. */
        .game-panel-overlay {
            display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            background: transparent; z-index: 260;
        }
        .game-panel {
            position: absolute; bottom: 50px; left: 0; right: 0;
            background: #2a2a3e; border-radius: 16px 16px 0 0;
            padding: 16px; max-height: 50vh; display: flex; flex-direction: column;
            z-index: 261;
        }
        .game-panel-header {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 12px;
        }
        .game-panel-header span { color: #eee; font-size: 15px; font-weight: 600; }
        .game-panel-close {
            background: none; border: none; color: #aaa; font-size: 22px; cursor: pointer;
        }
        .game-grid {
            display: grid; grid-template-columns: repeat(4, 1fr);
            gap: 12px; overflow-y: auto; flex: 1; min-height: 0;
            padding-bottom: 8px;
        }
        .game-item {
            display: flex; flex-direction: column; align-items: center;
            cursor: pointer; padding: 8px 4px; border-radius: 10px;
            transition: background 0.15s;
        }
        .game-item:hover { background: rgba(255,255,255,0.08); }
        .game-item:active { background: rgba(84,215,226,0.2); }
        .game-item img { width: 64px; height: 64px; object-fit: contain; border-radius: 50%; border: 2px solid rgba(212,167,106,0.4); }
        .game-item .game-name { font-size: 11px; color: #ccc; margin-top: 6px; text-align: center; }

        /* Mobile: stack video + chat */
        @media (max-width: 768px) {
            .live-room-body { flex-direction: column; }
            .live-video-area { flex: none; height: 45vh; }
            .live-chat-area {
                flex: 1; border-left: none;
                border-top: 1px solid #333;
            }
        }

        /* ===== Immersive Mode Toggle Button (mobile only) ===== */
        .btn-immersive-toggle {
            display: none; /* hidden on desktop */
        }
        @media (max-width: 768px) {
            .btn-immersive-toggle {
                display: flex; position: fixed; right: 12px; z-index: 100;
                bottom: calc(56px + env(safe-area-inset-bottom, 8px));
                width: 36px; height: 36px; border-radius: 50%;
                background: rgba(0,0,0,0.5); border: 1.5px solid rgba(255,255,255,0.3);
                color: #fff; font-size: 18px; cursor: pointer;
                align-items: center; justify-content: center;
                backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
                transition: background 0.2s;
            }
            .btn-immersive-toggle:active { background: rgba(255,255,255,0.2); }
            .btn-immersive-toggle svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
        }

        /* ===== Immersive Mode Styles (mobile only) ===== */
        @media (max-width: 768px) {
            .live-room-page.immersive-mode .live-room-body {
                flex-direction: column; position: relative; height: 100vh; overflow: hidden;
            }
            .live-room-page.immersive-mode .live-video-area {
                flex: none; height: 100vh; height: 100dvh; width: 100%; position: fixed;
                top: 0; left: 0; right: 0; bottom: 0; z-index: 1;
            }
            .live-room-page.immersive-mode .live-top-bar {
                position: fixed; top: 0; left: 0; right: 0; z-index: 250;
                background: none; padding: 6px 10px;
                padding-top: calc(env(safe-area-inset-top, 0px) + 6px);
            }
            .live-room-page.immersive-mode .live-host-info {
                background: rgba(0,0,0,0.4); border-radius: 20px; padding: 4px 10px 4px 4px;
            }
            .live-room-page.immersive-mode .live-host-avatar {
                width: 32px; height: 32px;
            }
            .live-room-page.immersive-mode .live-host-name {
                font-size: 13px;
            }
            .live-room-page.immersive-mode .live-top-right {
                gap: 4px;
            }
            .live-room-page.immersive-mode .live-viewers-count {
                background: rgba(0,0,0,0.4); font-size: 12px; padding: 4px 10px;
                cursor: pointer;
            }
            .imm-rank-tab.active {
                color: #333 !important; border-bottom-color: #6c5ce7 !important;
            }
            .live-room-page.immersive-mode .btn-exit-room {
                width: 28px; height: 28px; font-size: 16px;
                background: rgba(0,0,0,0.4);
            }
            .live-room-page.immersive-mode .live-chat-area {
                position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
                background: transparent; border-top: none;
                height: auto; max-height: 50vh;
                display: flex; flex-direction: column; justify-content: flex-end;
                pointer-events: none;
                overflow: hidden;
            }
            .live-room-page.immersive-mode .chat-tabs { display: none; }
            .live-room-page.immersive-mode .live-notice-bar { display: none !important; }
            .live-room-page.immersive-mode .online-users-list { display: none !important; }
            .live-room-page.immersive-mode .ranking-list { display: none !important; }
            .live-room-page.immersive-mode .gift-panel-overlay {
                pointer-events: auto; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 260;
            }
            .live-room-page.immersive-mode .game-panel-overlay {
                pointer-events: auto; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 260;
            }
            .live-room-page.immersive-mode .host-func-panel-overlay {
                pointer-events: auto; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 260;
            }
            .live-room-page.immersive-mode .host-func-panel {
                max-height: 50vh;
                /* Lift above fixed chat-input-bar so the popup doesn't cover
                   the input row and send button. Same offset used for game
                   panels. */
                bottom: calc(52px + env(safe-area-inset-bottom, 8px)) !important;
            }
            /* Non-immersive mobile: host-func-panel renders at the bottom of
               .live-chat-area. Lift it above the chat-input-bar as well. */
            .live-room-page:not(.immersive-mode) .host-func-panel {
                bottom: calc(52px + env(safe-area-inset-bottom, 8px));
            }
            /* Mobile: game panel overlays fixed fullscreen so games cover the viewport.
               Wrapper is pointer-events:none so the area outside the panel lets
               clicks pass through to the top bar (exit X), mic seats, etc.; only
               the .{game}-panel itself opts back into pointer-events:auto. */
            .bac-panel-overlay,
            .dt-panel-overlay,
            .sb-panel-overlay,
            .rl-panel-overlay,
            .ts-panel-overlay,
            .xd-panel-overlay {
                position: fixed !important; top: 0; left: 0; right: 0; bottom: 0; z-index: 200;
                pointer-events: none;
            }
            .bac-panel-overlay .bac-panel,
            .dt-panel-overlay .dt-panel,
            .sb-panel-overlay .sb-panel,
            .rl-panel-overlay .rl-panel,
            .ts-panel-overlay .ts-panel,
            .xd-panel-overlay .xd-panel {
                pointer-events: auto;
            }
            /* liveType=4 (Play Together, .pt-mode) renders games as a centered
               modal on mobile. Video live rooms (liveType=2) keep the panel
               anchored to the bottom of the viewport, like a slide-up sheet.
               Animation is disabled here because the base .bac-panel keyframes
               animate transform from translateY(100%) → translateY(0), which
               would override the translateY(-50%) centering and cause the
               panel to briefly render at the bottom of the viewport before
               snapping to the middle. */
            .live-room-page.pt-mode .bac-panel-overlay,
            .live-room-page.pt-mode .dt-panel-overlay,
            .live-room-page.pt-mode .sb-panel-overlay,
            .live-room-page.pt-mode .rl-panel-overlay,
            .live-room-page.pt-mode .ts-panel-overlay,
            .live-room-page.pt-mode .xd-panel-overlay {
                top: 185px !important;
            }
            .live-room-page.pt-mode .bac-panel,
            .live-room-page.pt-mode .dt-panel,
            .live-room-page.pt-mode .sb-panel,
            .live-room-page.pt-mode .rl-panel,
            .live-room-page.pt-mode .ts-panel,
            .live-room-page.pt-mode .xd-panel {
                position: absolute !important;
                top: 0 !important;
                bottom: auto !important;
                left: 0; right: 0;
                transform: none;
                max-height: calc(100vh - 185px - 52px) !important; height: auto !important;
                overflow-y: auto;
                border-radius: 0 !important;
                animation: none !important;
                pointer-events: auto;
            }
            /* Let clicks OUTSIDE the centered panel pass through to the mic
               seats / video area behind. Without this the fullscreen overlay
               wrapper (pointer-events: auto + transparent bg) would swallow
               every tap, so 上/下麦 stops working while a game is open. */
            .live-room-page.pt-mode .bac-panel-overlay,
            .live-room-page.pt-mode .dt-panel-overlay,
            .live-room-page.pt-mode .sb-panel-overlay,
            .live-room-page.pt-mode .rl-panel-overlay,
            .live-room-page.pt-mode .ts-panel-overlay,
            .live-room-page.pt-mode .xd-panel-overlay {
                pointer-events: none;
            }
            @keyframes ptPanelFadeIn {
                from { opacity: 0; transform: translateY(-50%) scale(0.96); }
                to   { opacity: 1; transform: translateY(-50%) scale(1); }
            }
            /* liveType=2 video live room: lift the game panel above the fixed
               chat-input-bar so the panel's chip bar / send button doesn't
               overlap the input field at the very bottom of the screen. */
            .live-room-page:not(.pt-mode) .bac-panel,
            .live-room-page:not(.pt-mode) .dt-panel,
            .live-room-page:not(.pt-mode) .sb-panel,
            .live-room-page:not(.pt-mode) .rl-panel,
            .live-room-page:not(.pt-mode) .ts-panel,
            .live-room-page:not(.pt-mode) .xd-panel {
                bottom: calc(52px + env(safe-area-inset-bottom, 8px)) !important;
            }
            .live-room-page.immersive-mode .gift-panel {
                max-height: 50vh;
            }
            .live-room-page.immersive-mode .game-panel {
                max-height: 50vh;
            }
            .live-room-page.immersive-mode .chat-messages {
                pointer-events: auto;
                background: transparent; padding: 8px 12px;
                /* Extend messages up to roughly screen middle and fade out the
                   top so older lines disappear before they hit the host info.
                   Bottom margin clears the fixed chat-input-bar so the latest
                   messages are not hidden behind the input. */
                max-height: 40vh; min-height: 0; flex: none;
                margin-bottom: calc(52px + env(safe-area-inset-bottom, 8px));
                overflow-y: auto;
                mask-image: linear-gradient(transparent 0%, black 40%);
                -webkit-mask-image: linear-gradient(transparent 0%, black 40%);
                display: block !important;
            }
            .live-room-page.immersive-mode .chat-msg {
                background: rgba(0,0,0,0.35); border-radius: 6px;
                padding: 4px 8px; margin-bottom: 4px; font-size: 12px;
                display: block; max-width: 75%; width: fit-content;
                backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
                clear: both;
            }
            .live-room-page.immersive-mode .chat-msg.system {
                background: rgba(0,0,0,0.45); color: #f5c542;
            }
            .live-room-page.immersive-mode .chat-input-bar {
                pointer-events: auto;
                background: rgba(0,0,0,0.6); border-top: none;
                padding: 8px 12px; gap: 8px;
                padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
                align-items: center;
                display: flex !important;
                position: fixed; bottom: 0; left: 0; right: 0;
                z-index: 210;
            }
            .live-room-page.immersive-mode .chat-input-bar input {
                background: rgba(255,255,255,0.15); border: none;
                border-radius: 20px; padding: 8px 14px; font-size: 13px;
                color: #fff; flex: 1;
                backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
            }
            .live-room-page.immersive-mode .chat-input-bar input::placeholder { color: rgba(255,255,255,0.5); }
            .live-room-page.immersive-mode .chat-input-bar .btn-send {
                background: rgba(255,255,255,0.15); padding: 8px 16px; font-size: 13px;
                border: none; cursor: pointer; border-radius: 20px; color: #fff;
                backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
            }
            /* Game result overlay position in immersive mode */
            .live-room-page.immersive-mode #gameResultOverlay {
                top: 70px !important;
                left: 12px !important;
            }
            /* Game floating icons on the right side */
            .immersive-game-floats {
                display: none;
            }
            .live-room-page.immersive-mode .immersive-game-floats {
                display: none;
            }
            .immersive-game-float-item {
                width: 52px; height: 52px; border-radius: 50%;
                border: 2px solid rgba(212,167,106,0.6); overflow: hidden;
                cursor: pointer; background: rgba(0,0,0,0.3);
                backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
            }
            .immersive-game-float-item img {
                width: 100%; height: 100%; object-fit: cover;
            }
            .immersive-game-float-dots {
                display: flex; gap: 3px; justify-content: center; margin-top: 2px;
            }
            .immersive-game-float-dot {
                width: 5px; height: 5px; border-radius: 50%;
            }
            /* Immersive toggle button repositioned in immersive mode */
            .live-room-page.immersive-mode .btn-immersive-toggle {
                bottom: 62px; right: 12px; z-index: 100;
                background: rgba(0,0,0,0.4);
            }
        }

        /* PC (>= 769px): the game panel lives at the bottom of .live-chat-area
           via `position: absolute; bottom: 0`. Without an offset, the panel
           covers the .chat-input-bar row at the very bottom of the chat
           column. Lift the panel by the input bar height so users can still
           see / use the chat input while a game is open. Applies to every
           liveType on desktop (PC doesn't distinguish pt-mode).

           The wrapper .{game}-panel-overlay still stretches top:0 -> bottom:0
           over .live-chat-area, so even with the panel itself lifted the
           transparent overlay was silently swallowing clicks on the chat
           input row below. Set pointer-events:none on the overlay and
           pointer-events:auto on the panel so only the panel area captures
           input, and clicks on the chat-input-bar (and anything else in the
           chat column outside the panel) reach their real targets. */
        @media (min-width: 769px) {
            .live-room-page .bac-panel,
            .live-room-page .dt-panel,
            .live-room-page .sb-panel,
            .live-room-page .rl-panel,
            .live-room-page .ts-panel,
            .live-room-page .xd-panel {
                bottom: 52px !important;
                pointer-events: auto;
            }
            .live-room-page .bac-panel-overlay,
            .live-room-page .dt-panel-overlay,
            .live-room-page .sb-panel-overlay,
            .live-room-page .rl-panel-overlay,
            .live-room-page .ts-panel-overlay,
            .live-room-page .xd-panel-overlay {
                pointer-events: none;
            }
            /* Host-func-panel on PC: lift above chat-input-bar (same as game
               panels) and ensure the wrapping overlay never swallows clicks
               targeting the chat-input-bar below. */
            .live-room-page .host-func-panel {
                bottom: 52px !important;
            }
        }

        /* ===== Game History Toggle & Panel (per-game, inside each panel) ===== */
        .gh-toggle-btn {
            background: none; border: none; padding: 10px;
            cursor: pointer; width: 44px; height: 44px;
            vertical-align: middle; flex-shrink: 0;
            -webkit-tap-highlight-color: rgba(255,255,255,0.2);
            touch-action: manipulation;
            box-sizing: border-box;
            position: relative; z-index: 5;
            pointer-events: auto !important;
        }
        .gh-toggle-btn img {
            width: 22px; height: 22px; object-fit: contain;
            pointer-events: none !important;
        }
        .gh-panel {
            max-height: 220px; overflow-y: auto; overflow-x: hidden;
            -webkit-overflow-scrolling: touch; background: transparent;
            z-index: 80;
            position: relative;
            flex-shrink: 0;
        }
        .gh-row {
            display: flex; align-items: center; padding: 6px 10px;
            border-bottom: 1px solid rgba(255,255,255,0.06); gap: 8px;
            background: transparent;
        }
        .gh-row-id {
            color: rgba(255,255,255,0.7); font-size: 10px; white-space: nowrap;
            min-width: 70px; font-weight: 600; font-family: monospace;
        }
        .gh-row-content { flex: 1; overflow: visible; }

        /* ===== Baccarat In-Chat Panel ===== */
        .bac-panel-overlay {
            display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            background: transparent; z-index: 70;
        }
        .bac-panel {
            position: absolute; bottom: 0; left: 0; right: 0;
            background: #0a0a1a; z-index: 71; display: flex; flex-direction: column;
            overflow: hidden; border-radius: 12px 12px 0 0;
            animation: slideUp 0.2s ease-out;
        }
        .bac-header {
            display: flex; align-items: center; gap: 8px;
            padding: 6px 10px; background: linear-gradient(135deg, #1a0a0a, #2a1a1a);
            border-bottom: 1px solid #333; flex-shrink: 0;
        }
        .bac-logo { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #d4a76a;
            display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
        .bac-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
        .bac-logo-fallback { background: #8b0000; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 8px; color: #fff; font-weight: bold; }
        .bac-header-info { flex: 1; }
        .bac-round { display: none; }
        .bac-timer-row { display: flex; align-items: center; gap: 6px; }
        .bac-timer { color: #fff; font-size: 18px; font-weight: bold; font-family: monospace; }
        .bac-status { color: #4ade80; font-size: 11px; font-weight: 600; }
        .bac-status.closed { color: #ef4444; }
        .bac-close-btn { background: none; border: none; color: #aaa; font-size: 20px; cursor: pointer; padding: 2px 6px; flex-shrink: 0; }
        /* Cards */
        .bac-cards-area {
            display: flex; justify-content: center; align-items: stretch; gap: 0;
            padding: 4px 4px 2px; background: #0a0a1a; flex-shrink: 0;
            height: 100px; overflow: hidden;
        }
        .bac-cards-side { text-align: center; flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
        .bac-cards-side .side-label { font-size: 14px; font-weight: bold; margin-bottom: 2px; position: relative; }
        .bac-cards-side .side-label.player-label { color: #3b82f6; }
        .bac-cards-side .side-label.banker-label { color: #ef4444; }
        .bac-cards-row { display: flex; justify-content: center; gap: 3px; margin-bottom: 2px; align-items: flex-end; min-height: 56px; }
        .bac-card {
            width: 36px; height: 50px; border-radius: 3px;
            overflow: hidden; border: 1px solid #555; flex-shrink: 0;
            background: #fff; position: relative;
        }
        .bac-card img { width: 100%; height: 100%; object-fit: cover; }
        .bac-card.card-back { background: transparent; border-color: transparent; }
        .bac-card.card-back img { width: 100%; height: 100%; object-fit: cover; }
        /* Card deal animation (slide in from top) */
        @keyframes cardDealIn {
            0% { opacity: 0; transform: translateY(-30px) scale(0.7); }
            100% { opacity: 1; transform: translateY(0) scale(1); }
        }
        .bac-card.deal-anim { animation: cardDealIn 0.3s ease-out forwards; }
        /* Card flip animation (3D rotate) */
        @keyframes cardFlip {
            0% { transform: perspective(300px) rotateY(0deg); }
            50% { transform: perspective(300px) rotateY(90deg); }
            100% { transform: perspective(300px) rotateY(0deg); }
        }
        .bac-card.flip-anim { animation: cardFlip 0.4s ease-in-out; }
        /* Third card deal+flip needs combined transform */
        @keyframes cardDealInThird {
            0% { opacity: 0; transform: translateY(-20px) rotate(90deg) scale(0.7); }
            100% { opacity: 1; transform: translateY(7px) rotate(90deg) scale(1); }
        }
        .bac-card.deal-anim-third { animation: cardDealInThird 0.3s ease-out forwards; }
        .bac-card.third-card {
            transform: translateY(7px) rotate(90deg);
            margin: 0 8px;
            align-self: flex-end;
        }
                .bac-card.third-card-left { transform: translateY(7px) rotate(90deg); margin-left: -4px; margin-right: 8px; align-self: flex-end; }
                .bac-card.third-card-right { transform: translateY(7px) rotate(90deg); margin-left: 8px; margin-right: -4px; align-self: flex-end; }
        .bac-card.red { }
        .bac-card.black { }
        .bac-card-rank { display: none; }
        .bac-card-suit { display: none; }
        .bac-vs { color: #d4a76a; font-size: 14px; font-weight: bold; padding: 0 4px; align-self: center;
            display: flex; align-items: center; min-width: 30px; justify-content: center; }
        .bac-points { font-size: 14px; font-weight: bold; position: absolute; top: 0; left: 50%; margin-left: 1.5em; white-space: nowrap; }
        @keyframes bacWinFlash {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.3; }
        }
        .bac-bet-cell.win-flash,
        .bac-bet-cell.flash-win {
            animation: bacWinFlash 0.6s ease-in-out infinite;
            box-shadow: 0 0 8px 2px rgba(255, 215, 0, 0.6);
            border: 1px solid #ffd700;
        }
        .bac-points.player-pts { color: #3b82f6; }
        .bac-points.banker-pts { color: #ef4444; }
        /* Tabs */
        .bac-tabs { display: flex; border-bottom: 1px solid #333; background: #111; flex-shrink: 0; }
        .bac-tab {
            flex: 1; padding: 6px 0; text-align: center; color: #888; font-size: 12px;
            cursor: pointer; border: none; background: none; transition: all 0.2s;
        }
        .bac-tab.active { color: #fff; border-bottom: 2px solid #d4a76a; background: rgba(255,255,255,0.05); }
        .bac-tab-icon { font-size: 16px; }
        /* Bet grid */
        .bac-bet-content { overflow-y: auto; height: 110px; flex: none; }
        .bac-bet-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
            background: #333; border: 1px solid #333;
        }
        .bac-bet-grid.three-col {
            grid-template-columns: 1fr 1fr 1fr;
            grid-template-rows: 1fr 1fr;
        }
        .bac-bet-grid.three-col .bac-cell-left { grid-column: 1; grid-row: 1 / 3; }
        .bac-bet-grid.three-col .bac-cell-mid-top { grid-column: 2; grid-row: 1; }
        .bac-bet-grid.three-col .bac-cell-mid-bottom { grid-column: 2; grid-row: 2; }
        .bac-bet-grid.three-col .bac-cell-right { grid-column: 3; grid-row: 1 / 3; }
        .bac-bet-cell {
            background: #1a1a2e; padding: 10px 4px; text-align: center; cursor: pointer;
            transition: none; position: relative;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            -webkit-tap-highlight-color: transparent; user-select: none;
        }
        .bac-bet-cell:active { background: #1a1a2e; }
        .bac-bet-cell.selected { background: #1a1a2e; }
        .bac-bet-cell.full-width { grid-column: 1 / -1; }
        .bac-bet-name { color: #ddd; font-size: 13px; font-weight: 600; }
        .bac-bet-odds { color: #d4a76a; font-size: 16px; font-weight: bold; margin-top: 2px; }
        .bac-bet-amount { color: #4ade80; font-size: 10px; display: none; position: absolute; top: 2px; right: 4px; font-weight: bold; }
        .bac-bet-cell.has-bet .bac-bet-amount { display: block; }
        /* Chip bar */
        .bac-chip-bar {
            display: flex; align-items: center; padding: 6px 6px;
            background: #111; border-top: 1px solid #333; gap: 5px;
            overflow-x: auto; flex-shrink: 0;
        }
        .bac-user-chip {
            background: linear-gradient(135deg, #1a3a1a, #0a2a0a); border: 1px solid #4ade80;
            border-radius: 16px; padding: 3px 10px; color: #4ade80; font-size: 11px;
            font-weight: bold; white-space: nowrap; display: flex; align-items: center; gap: 4px; min-width: 80px; flex-shrink: 0; font-variant-numeric: tabular-nums;
        }
        .bac-chip-arrow { font-size: 12px; color: #888; }
        .bac-chip {
            width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center;
            justify-content: center; cursor: pointer; border: 3px solid transparent;
            transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; flex-shrink: 0; position: relative;
        }
        .bac-chip.selected { border-color: #fff; transform: scale(1.12); box-shadow: 0 0 6px rgba(255,255,255,0.3); }
        .bac-chip-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
        .bac-chip-val { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 9px; font-weight: bold; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none; }
        .bac-chip.chip-fallback { background: radial-gradient(circle, #555, #333); }
        .bac-chip.chip-fallback .bac-chip-val { font-size: 10px; }
        @keyframes bacWinFadeIn { from { opacity:0; } to { opacity:1; } }
        /* Baccarat Roadmap */
        .bac-roadmap-container {
            display: flex; flex-direction: column; flex-shrink: 0; background: #f5f0e1;
            border-top: 1px solid #c8b88a; border-bottom: 1px solid #c8b88a;
            overflow: hidden;
        }
        .bac-roadmap-top-row {
            display: flex; height: 66px; min-height: 66px; border-bottom: 1px solid #c8b88a;
        }
        .bac-roadmap-bead {
            width: 22%; min-width: 70px; height: 100%; overflow: hidden;
            border-right: 1px solid #c8b88a; display: flex; flex-direction: column; flex-wrap: wrap;
        }
        .bac-roadmap-bead-cell {
            width: 11px; height: 11px; display: flex; align-items: center; justify-content: center;
            font-size: 6px; font-weight: bold; color: #fff; box-sizing: border-box;
        }
        .bac-roadmap-bead-cell .bead-circle {
            width: 10px; height: 10px; border-radius: 50%; display: flex; align-items: center;
            justify-content: center; font-size: 6px; line-height: 1;
        }
        .bac-roadmap-bead-cell .bead-circle.banker { background: #dc2626; }
        .bac-roadmap-bead-cell .bead-circle.player { background: #2563eb; }
        .bac-roadmap-bead-cell .bead-circle.tie { background: #16a34a; }
        .bac-roadmap-bigroad {
            flex: 1; min-width: 0; height: 100%; overflow: hidden; position: relative;
        }
        .bac-roadmap-bigroad-inner {
            display: flex; height: 100%;
        }
        .bac-roadmap-col {
            width: 11px; min-width: 11px; display: flex; flex-direction: column;
        }
        .bac-roadmap-cell {
            width: 11px; height: 11px; display: flex; align-items: center; justify-content: center;
            box-sizing: border-box;
        }
        .bac-roadmap-cell .road-circle {
            width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid transparent;
            box-sizing: border-box;
        }
        .bac-roadmap-cell .road-circle.banker { border-color: #dc2626; }
        .bac-roadmap-cell .road-circle.player { border-color: #2563eb; }
        .bac-roadmap-cell .road-circle.tie-mark {
            width: 4px; height: 4px; border-radius: 50%; background: #16a34a;
            position: absolute;
        }
        .bac-roadmap-cell { position: relative; }
        .bac-roadmap-cell .tie-slash {
            position: absolute; width: 100%; height: 100%; top: 0; left: 0;
        }
        .bac-roadmap-cell .tie-slash line { stroke: #16a34a; stroke-width: 1.5; }
        .bac-roadmap-bottom-row {
            display: flex; height: 30px; min-height: 30px;
        }
        .bac-roadmap-derived-section {
            flex: 1; overflow: hidden; position: relative;
            border-right: 1px solid #c8b88a;
        }
        .bac-roadmap-derived-section:last-child { border-right: none; }
        .bac-roadmap-derived-inner {
            display: flex; height: 100%;
        }
        .bac-roadmap-derived-col {
            display: flex; flex-direction: column;
        }
        .bac-derived-cell {
            display: flex; align-items: center; justify-content: center;
            box-sizing: border-box; position: relative;
        }
        .bac-derived-cell .derived-circle {
            border-radius: 50%; box-sizing: border-box;
        }
        .bac-derived-cell .derived-circle.red-filled { background: #dc2626; }
        .bac-derived-cell .derived-circle.blue-filled { background: #2563eb; }
        .bac-derived-cell .derived-circle.red-hollow { border: 2px solid #dc2626; background: transparent; }
        .bac-derived-cell .derived-circle.blue-hollow { border: 2px solid #2563eb; background: transparent; }
        .bac-derived-cell .derived-slash {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        }
        .bac-derived-cell .derived-slash line.red-line { stroke: #dc2626; stroke-width: 2; stroke-linecap: round; }
        .bac-derived-cell .derived-slash line.blue-line { stroke: #2563eb; stroke-width: 2; stroke-linecap: round; }
        /* Stats panel - vertical on right side of top row (matching reference) */
        .bac-roadmap-stats-right {
            display: flex; flex-direction: column; justify-content: center;
            padding: 2px 4px; background: #f5f0e1;
            border-left: 1px solid #c8b88a; flex-shrink: 0;
            font-size: 9px; font-weight: 600; color: #333; min-width: 52px;
        }
        .bac-roadmap-stats-right .stat-row {
            display: flex; align-items: center; justify-content: space-between;
            padding: 0 2px; line-height: 1.4;
        }
        .bac-roadmap-stats-right .stat-label { font-size: 9px; }
        .bac-roadmap-stats-right .stat-label.label-b { color: #dc2626; }
        .bac-roadmap-stats-right .stat-label.label-p { color: #2563eb; }
        .bac-roadmap-stats-right .stat-label.label-t { color: #16a34a; }
        .bac-roadmap-stats-right .stat-label.label-total { color: #666; }
        .bac-roadmap-stats-right .stat-num { font-size: 9px; font-weight: 700; color: #333; margin-left: 4px; }
        /* Flash animation for new roadmap entries */
        @keyframes bacRoadFlash {
            0% { opacity: 1; }
            25% { opacity: 0.2; }
            50% { opacity: 1; }
            75% { opacity: 0.2; }
            100% { opacity: 1; }
        }
        .bac-road-new {
            animation: bacRoadFlash 1.5s ease-in-out;
        }
        /* History */
        .bac-history { padding: 6px; overflow-y: auto; }
        .bac-history-grid { display: flex; flex-wrap: wrap; gap: 3px; padding: 0 4px; margin-bottom: 6px; }
        .bac-history-dot {
            width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center;
            justify-content: center; font-size: 9px; font-weight: bold; color: #fff;
        }
        .bac-history-dot.player-win { background: #2563eb; }
        .bac-history-dot.banker-win { background: #dc2626; }
        .bac-history-dot.tie-win { background: #16a34a; }
        .bac-history-table { width: 100%; border-collapse: collapse; }
        .bac-history-table th {
            background: #1a1a2e; color: #888; font-size: 10px; padding: 4px 2px;
            text-align: center; border: 1px solid #333;
        }
        .bac-history-table td {
            color: #ddd; font-size: 10px; padding: 4px 2px; text-align: center;
            border: 1px solid #333; background: #111;
        }
        /* Baccarat bet sub-tabs */
        .bac-bet-subtabs {
            display: flex; background: #1a1a2e; border-bottom: 1px solid #333; flex-shrink: 0;
        }
        .bac-bet-subtab {
            flex: 1; padding: 6px 0; text-align: center; color: #888; font-size: 12px;
            cursor: pointer; background: none; border: none; transition: opacity 0.15s, border-color 0.15s;
            display: flex; align-items: center; justify-content: center; gap: 0;
        }
        .bac-subtab-icon { width: 28px; height: 28px; object-fit: contain; opacity: 0.5; }
        .bac-subtab-label { display: none; }
        .bac-bet-subtab.active { border-bottom: 2px solid #d4a76a; background: rgba(212,167,106,0.08); }
        .bac-bet-subtab.active .bac-subtab-icon { opacity: 1.0; }
        /* Mobile: only liveType=4 (.pt-mode) gets the full-height baccarat panel.
           Video live rooms (liveType=2) keep the default content-height panel
           anchored at the bottom so the host video stays visible above it. */
        @media (max-width: 768px) {
            .live-room-page.pt-mode .bac-panel { max-height: 100%; height: 100%; border-radius: 0; }
            .bac-bet-content { flex: 1; height: auto; min-height: 110px; }
        }
        .bac-panel { display: flex; flex-direction: column; }

        .bac-panel, .dt-panel, .sb-panel, .rl-panel, .ts-panel, .xd-panel { opacity: 1; }

        /* ===== Dragon Tiger In-Chat Panel ===== */
        .dt-panel-overlay {
            display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            background: transparent; z-index: 70;
        }
        .dt-panel {
            position: absolute; bottom: 0; left: 0; right: 0;
            background: #0a0a1a; z-index: 71; display: flex; flex-direction: column;
            overflow: hidden; border-radius: 12px 12px 0 0;
            animation: slideUp 0.2s ease-out;
        }
        .dt-header {
            display: flex; align-items: center; gap: 8px;
            padding: 6px 10px; background: linear-gradient(135deg, #1a0a0a, #2a1a1a);
            border-bottom: 1px solid #333; flex-shrink: 0;
        }
        .dt-logo { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #d4a76a;
            display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
        .dt-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
        .dt-logo-fallback { background: #8b0000; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 8px; color: #fff; font-weight: bold; }
        .dt-header-info { flex: 1; }
        .dt-round { display: none; }
        .dt-timer-row { display: flex; align-items: center; gap: 6px; }
        .dt-timer { color: #fff; font-size: 18px; font-weight: bold; font-family: monospace; }
        .dt-status { color: #4ade80; font-size: 11px; font-weight: 600; }
        .dt-status.closed { color: #ef4444; }
        .dt-close-btn { background: none; border: none; color: #aaa; font-size: 20px; cursor: pointer; padding: 2px 6px; flex-shrink: 0; }
        /* Inline dragon/tiger result (mascot + card + VS + card + mascot)
           living inside the header row. Replaces the old .dt-cards-area so
           the panel is shorter and the host video shows through more. */
        .dt-header-result { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
        .dt-header-result .dt-cards-side { flex: none; gap: 4px; overflow: visible; }
        .dt-header-result .dt-mascot { width: 42px; height: 48px; }
        .dt-header-result .dt-card { width: 38px; height: 54px; border-radius: 3px; }
        .dt-header-result .dt-card-slot { min-height: 54px; gap: 3px; }
        .dt-header-result .dt-vs { font-size: 18px; padding: 0 6px; }
        /* DT Cards */
        .dt-cards-area {
            display: flex; justify-content: center; align-items: center; gap: 0;
            padding: 4px 4px 2px; background: #0a0a1a; flex-shrink: 0;
            height: 80px; overflow: hidden;
        }
        .dt-cards-side { text-align: center; flex: 1; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; overflow: hidden; }
        .dt-cards-side .side-label { display: none; }
        .dt-mascot { width: 40px; height: 45px; object-fit: contain; flex-shrink: 0; }
        .dt-mascot.loser { filter: grayscale(1); opacity: 0.5; }
        .dt-card-slot { display: flex; justify-content: center; gap: 3px; align-items: center; min-height: 56px; }
        .dt-card {
            width: 36px; height: 50px; border-radius: 3px;
            overflow: hidden; border: 1px solid #555; flex-shrink: 0;
            background: #fff; position: relative;
        }
        .dt-card img { width: 100%; height: 100%; object-fit: cover; }
        .dt-card.card-back { background: transparent; border-color: transparent; }
        .dt-card.card-back img { width: 100%; height: 100%; object-fit: cover; }
        /* DT Card deal animation */
        .dt-card.deal-anim { animation: cardDealIn 0.3s ease-out forwards; }
        .dt-card.flip-anim { animation: cardFlip 0.4s ease-in-out; }
        .dt-vs { color: #d4a76a; font-size: 14px; font-weight: bold; display: flex; align-items: center; padding: 0 8px; flex-shrink: 0; }
        .dt-point-badge { display: none; }
        /* DT Bet Sub-tabs */
        .dt-bet-subtabs {
            display: flex; background: #1a1a2e; border-bottom: 1px solid #333; flex-shrink: 0;
        }
        .dt-bet-subtab {
            flex: 1; padding: 6px 0; text-align: center; color: #888; font-size: 12px;
            cursor: pointer; background: none; border: none; transition: opacity 0.15s;
            display: flex; align-items: center; justify-content: center; gap: 0;
        }
        .dt-subtab-icon { width: 28px; height: 28px; object-fit: contain; opacity: 0.5; }
        .dt-bet-subtab.active { border-bottom: 2px solid #d4a76a; background: rgba(212,167,106,0.08); }
        .dt-bet-subtab.active .dt-subtab-icon { opacity: 1.0; }
        /* DT Bet grid — tight height; matches the tallest sub-tab (2-row cols-2)
           so tab switches don't resize the panel and there is no empty space
           below the last bet row. */
        .dt-bet-content { overflow-y: auto; height: 115px; flex: none; }
        .dt-bet-grid {
            display: grid; gap: 1px; background: #333; border: 1px solid #333;
        }
        .dt-bet-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
        .dt-bet-grid.cols-2 { grid-template-columns: 1fr 1fr; }
        .dt-bet-cell {
            background: #1a1a2e; padding: 10px 4px; text-align: center; cursor: pointer;
            position: relative; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center;
            -webkit-tap-highlight-color: transparent; transition: none;
            user-select: none; -webkit-user-select: none;
        }
        .dt-bet-cell:active { background: #1a1a2e; }
        .dt-bet-cell .bet-name { font-size: 14px; font-weight: bold; color: #eee; }
        .dt-bet-cell .bet-odds { font-size: 16px; font-weight: bold; color: #d4a76a; margin-top: 2px; }
        .dt-bet-cell .bet-amount-badge {
            position: absolute; top: 2px; right: 4px;
            width: 28px; height: 28px;
            background: url('chips/chip-8.webp') center/contain no-repeat;
            color: #fff; font-size: 9px; font-weight: bold;
            line-height: 28px; text-align: center; z-index: 2;
            text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none;
        }
        .dt-bet-cell.flash-win {
            animation: bacWinFlash 0.6s ease-in-out infinite;
            box-shadow: 0 0 8px 2px rgba(255, 215, 0, 0.6);
            border: 1px solid #ffd700;
        }
        /* DT Chip bar */
        .dt-chip-bar {
            display: flex; align-items: center; gap: 6px; padding: 6px 8px;
            background: #111; border-top: 1px solid #333; flex-shrink: 0;
            overflow-x: auto;
        }
        .dt-chip-balance {
            background: #16a34a; color: #fff; font-size: 12px; font-weight: bold;
            padding: 4px 10px; border-radius: 16px; white-space: nowrap; cursor: pointer; flex-shrink: 0; min-width: 80px; font-variant-numeric: tabular-nums;
        }
        .dt-chip-item {
            width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            font-size: 10px; font-weight: bold; color: #fff; flex-shrink: 0;
            border: 2px solid transparent; opacity: 0.7;
            -webkit-tap-highlight-color: transparent; position: relative;
        }
        .dt-chip-item.selected { border-color: #d4a76a; opacity: 1; transform: scale(1.15); }
        .dt-chip-item img { width: 100%; height: 100%; border-radius: 50%; }
        .dt-chip-val { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 9px; font-weight: bold; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none; }
        /* DT Winner overlay */
        /* Mobile: only liveType=4 (.pt-mode) gets the full-height dragon-tiger
           panel so liveType=2 rooms keep the video visible above it. The bet
           content area uses a fixed height sized to the tallest sub-tab
           (2-row cols-2) so switching tabs does not resize the whole panel. */
        @media (max-width: 768px) {
            .live-room-page.pt-mode .dt-panel { max-height: 100%; height: 100%; border-radius: 0; }
            .dt-bet-content { flex: none; height: 115px; min-height: 115px; }
        }
        /* ===== Sic Bo (1001) Styles ===== */
        .sb-panel-overlay {
            display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            z-index: 100; background: transparent;
        }
        .sb-panel {
            position: absolute; bottom: 0; left: 0; right: 0;
            background: #0f0f1a; border-radius: 12px 12px 0 0;
            display: flex; flex-direction: column; overflow: hidden;
        }
        .sb-header {
            display: flex; align-items: center; gap: 8px;
            padding: 6px 10px; background: linear-gradient(135deg, #1a0a0a, #2a1a1a);
            border-bottom: 1px solid #333; flex-shrink: 0;
        }
        /* Inline result block (3 dice + total/size/parity labels) inside the
           header. Replaces the old standalone .sb-dice-area row so the panel
           is shorter and the host video shows through more. */
        .sb-header-result {
            display: flex; flex-direction: column; align-items: center; gap: 3px;
            flex-shrink: 0;
        }
        .sb-header-result .sb-dice-row { gap: 6px; }
        .sb-header-result .sb-dice { width: 38px; height: 38px; box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
        .sb-header-result .sb-dice img { border-radius: 5px; }
        .sb-header-result .sb-result-labels { gap: 5px; margin-top: 0; }
        .sb-header-result .sb-result-label { padding: 2px 10px; font-size: 13px; min-width: 28px; }
        .sb-logo { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #d4a76a;
            display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
        .sb-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
        .sb-logo-fallback { background: #8b0000; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 8px; color: #fff; font-weight: bold; }
        .sb-header-info { flex: 1; }
        .sb-round { display: none; }
        .sb-timer-row { display: flex; align-items: center; gap: 6px; }
        .sb-timer { color: #fff; font-size: 18px; font-weight: bold; font-family: monospace; }
        .sb-status { color: #4ade80; font-size: 11px; font-weight: 600; }
        .sb-status.closed { color: #ef4444; }
        .sb-close-btn { background: none; border: none; color: #aaa; font-size: 20px; cursor: pointer; padding: 2px 6px; flex-shrink: 0; }
        /* SB Dice Result Area */
        .sb-dice-area {
            display: flex; flex-direction: row; justify-content: flex-end; align-items: center;
            padding: 4px 12px; background: #0a0a1a; flex-shrink: 0;
            height: 78px; min-height: 78px; max-height: 78px; overflow: hidden;
        }
        .sb-dice-wrapper {
            display: flex; flex-direction: column; align-items: center;
        }
        .sb-dice-row {
            display: flex; justify-content: center; align-items: center; gap: 10px;
        }
        .sb-result-labels {
            display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 2px;
        }
        .sb-result-label {
            padding: 2px 10px; border-radius: 4px; font-size: 13px; font-weight: bold;
            color: #fff; min-width: 28px; text-align: center;
        }
        .sb-result-label.total { background: #2563eb; }
        .sb-result-label.size { background: #ea580c; }
        .sb-result-label.parity { background: #ea580c; }
        .sb-dice {
            width: 44px; height: 44px; border-radius: 6px;
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 2px 4px rgba(0,0,0,0.4);
        }
        .sb-dice img { width: 100%; height: 100%; border-radius: 6px; object-fit: contain; }
        .sb-dice.d1 { grid-template: 1fr 1fr 1fr / 1fr 1fr 1fr; }
        .sb-dice-dot {
            width: 8px; height: 8px; background: #333; border-radius: 50%; align-self: center; justify-self: center;
        }
        @keyframes sbDiceShake1 {
            0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
            15% { transform: translate(-4px, -3px) rotate(-12deg) scale(1.05); }
            30% { transform: translate(3px, 4px) rotate(10deg) scale(0.95); }
            45% { transform: translate(-5px, 1px) rotate(-8deg) scale(1.08); }
            60% { transform: translate(4px, -4px) rotate(14deg) scale(0.92); }
            75% { transform: translate(-2px, 3px) rotate(-6deg) scale(1.04); }
            90% { transform: translate(3px, -2px) rotate(8deg) scale(0.96); }
        }
        @keyframes sbDiceShake2 {
            0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
            12% { transform: translate(4px, -4px) rotate(14deg) scale(1.06); }
            25% { transform: translate(-3px, 3px) rotate(-10deg) scale(0.94); }
            40% { transform: translate(5px, 2px) rotate(8deg) scale(1.07); }
            55% { transform: translate(-4px, -3px) rotate(-14deg) scale(0.93); }
            70% { transform: translate(2px, 4px) rotate(6deg) scale(1.03); }
            85% { transform: translate(-3px, -1px) rotate(-9deg) scale(0.97); }
        }
        @keyframes sbDiceShake3 {
            0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
            10% { transform: translate(3px, 4px) rotate(-10deg) scale(0.95); }
            22% { transform: translate(-5px, -2px) rotate(12deg) scale(1.08); }
            38% { transform: translate(4px, -4px) rotate(-14deg) scale(0.92); }
            52% { transform: translate(-3px, 3px) rotate(8deg) scale(1.05); }
            68% { transform: translate(5px, -1px) rotate(-6deg) scale(0.96); }
            82% { transform: translate(-2px, 2px) rotate(10deg) scale(1.03); }
        }
        .sb-dice.shaking:nth-child(1) { animation: sbDiceShake1 0.4s ease-in-out infinite; }
        .sb-dice.shaking:nth-child(2) { animation: sbDiceShake2 0.35s ease-in-out infinite; }
        .sb-dice.shaking:nth-child(3) { animation: sbDiceShake3 0.45s ease-in-out infinite; }
        .sb-dice-total {
            font-size: 20px; font-weight: bold; color: #ffd700; margin-left: 8px;
            text-shadow: 0 0 8px rgba(255,215,0,0.5);
        }
        .sb-dice-label {
            font-size: 11px; color: #aaa; margin-left: 2px;
        }
        /* SB Bet Sub-tabs */
        .sb-bet-subtabs {
            display: flex; background: #1a1a2e; border-bottom: 1px solid #333; flex-shrink: 0;
        }
        .sb-bet-subtab {
            flex: 1; padding: 4px 0; text-align: center; color: #888; font-size: 12px;
            cursor: pointer; background: none; border: none; transition: opacity 0.15s;
            display: flex; align-items: center; justify-content: center; gap: 0;
            border-bottom: 2px solid transparent;
        }
        .sb-subtab-icon { width: 28px; height: 28px; object-fit: contain; opacity: 0.5; }
        .sb-bet-subtab.active { border-bottom: 2px solid #d4a76a; background: rgba(212,167,106,0.08); }
        .sb-bet-subtab.active .sb-subtab-icon { opacity: 1.0; }
        /* SB Bet grid */
        .sb-bet-content { overflow-y: auto; overflow-x: hidden; background: #1a1a2e; }
        .sb-bet-grid {
            display: grid; gap: 1px; background: #333; border: 1px solid #333;
        }
        .sb-bet-grid.cols-2 { grid-template-columns: 1fr 1fr; }
        .sb-bet-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
        .sb-bet-grid.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
        .sb-bet-grid.cols-5 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr; }
        .sb-bet-cell {
            background: #1a1a2e; padding: 8px 4px; text-align: center; cursor: pointer;
            position: relative; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center;
            -webkit-tap-highlight-color: transparent; transition: none;
            user-select: none; -webkit-user-select: none;
        }
        .sb-bet-cell:active { background: #252540; }
        .sb-bet-cell .bet-name { font-size: 14px; font-weight: bold; color: #eee; }
        .sb-bet-cell .bet-odds { font-size: 12px; color: #d4a76a; margin-top: 2px; }
        .sb-bet-cell .bet-amount-badge {
            position: absolute; top: 2px; right: 4px;
            width: 28px; height: 28px;
            background: url('chips/chip-8.webp') center/contain no-repeat;
            color: #fff; font-size: 9px; font-weight: bold;
            line-height: 28px; text-align: center; z-index: 2;
            text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none;
        }
        .sb-bet-cell.flash-win {
            animation: bacWinFlash 0.6s ease-in-out infinite;
            box-shadow: 0 0 8px 2px rgba(255, 215, 0, 0.6);
            border: 1px solid #ffd700;
        }
        /* SB mini dice in bet cells */
        .sb-mini-dice-img {
            width: 28px; height: 28px; border-radius: 4px; object-fit: contain;
        }
        .sb-dice-pair { display: flex; gap: 4px; justify-content: center; margin-bottom: 2px; }
        /* SB Chip bar */
        .sb-chip-bar {
            display: flex; align-items: center; gap: 6px; padding: 6px 8px;
            background: #111; border-top: 1px solid #333; flex-shrink: 0;
            overflow-x: auto;
        }
        .sb-chip-balance {
            background: #16a34a; color: #fff; font-size: 12px; font-weight: bold;
            padding: 4px 10px; border-radius: 16px; white-space: nowrap; cursor: pointer; flex-shrink: 0; min-width: 80px; font-variant-numeric: tabular-nums;
        }
        .sb-chip-item {
            width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            font-size: 10px; font-weight: bold; color: #fff; flex-shrink: 0;
            border: 2px solid transparent; opacity: 0.7;
            -webkit-tap-highlight-color: transparent; position: relative;
        }
        .sb-chip-item.selected { border-color: #d4a76a; opacity: 1; transform: scale(1.15); }
        .sb-chip-item img { width: 100%; height: 100%; border-radius: 50%; }
        .sb-chip-val { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 9px; font-weight: bold; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none; }
        /* Mobile: only liveType=4 (.pt-mode) gets the full-height sic-bo panel
           so liveType=2 rooms keep the video visible above it. */
        @media (max-width: 768px) {
            .live-room-page.pt-mode .sb-panel { max-height: 100%; height: 100%; border-radius: 0; }
            .sb-bet-content { overflow-x: hidden; background: #1a1a2e; }
        }
        /* ===== TaiSai Fish-Shrimp-Crab (1003) Styles ===== */
        .ts-panel-overlay {
            display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            z-index: 100; background: transparent;
        }
        .ts-panel {
            position: absolute; bottom: 0; left: 0; right: 0;
            background: #0f0f1a; border-radius: 12px 12px 0 0;
            display: flex; flex-direction: column; overflow: hidden;
        }
        .ts-header {
            display: flex; align-items: center; gap: 8px;
            padding: 8px 10px; background: #181828;
            border-bottom: 1px solid #2a2a3e;
        }
        .ts-header-result {
            display: flex; flex-direction: column; align-items: center; gap: 2px; margin-left: auto; margin-right: 8px;
        }
        .ts-header-result .ts-dice-row { gap: 6px; }
        .ts-header-result .ts-dice { width: 38px; height: 38px; box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
        .ts-header-result .ts-dice img { border-radius: 5px; }
        .ts-header-result .ts-result-labels { gap: 5px; margin-top: 0; }
        .ts-header-result .ts-result-label { padding: 2px 10px; font-size: 13px; min-width: 28px; }
        .ts-logo { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #d4a76a;
            overflow: hidden; flex-shrink: 0; }
        .ts-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
        .ts-logo-fallback { background: #8b0000; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 8px; color: #fff; font-weight: bold; }
        .ts-header-info { flex: 1; }
        .ts-round { display: none; }
        .ts-timer-row { display: flex; align-items: center; gap: 6px; }
        .ts-timer { color: #fff; font-size: 18px; font-weight: bold; font-family: monospace; }
        .ts-status { color: #4ade80; font-size: 11px; font-weight: 600; }
        .ts-status.closed { color: #ef4444; }
        .ts-close-btn { background: none; border: none; color: #aaa; font-size: 20px; cursor: pointer; padding: 2px 6px; flex-shrink: 0; }
        .ts-dice-row {
            display: flex; gap: 10px; justify-content: center; align-items: center;
        }
        .ts-result-labels {
            display: flex; gap: 6px; justify-content: center; margin-top: 4px;
        }
        .ts-result-label {
            padding: 2px 10px; border-radius: 8px; font-size: 12px; font-weight: bold; color: #fff; text-align: center;
        }
        .ts-result-label.total { background: #2563eb; }
        .ts-dice {
            width: 48px; height: 48px; border-radius: 8px;
            display: flex; align-items: center; justify-content: center;
            transition: transform 0.2s;
        }
        .ts-dice img { width: 100%; height: 100%; border-radius: 6px; object-fit: contain; }
        .ts-dice.shaking:nth-child(1) { animation: sbDiceShake1 0.4s ease-in-out infinite; }
        .ts-dice.shaking:nth-child(2) { animation: sbDiceShake2 0.35s ease-in-out infinite; }
        .ts-dice.shaking:nth-child(3) { animation: sbDiceShake3 0.45s ease-in-out infinite; }
        .ts-bet-subtabs {
            display: flex; border-bottom: 1px solid #2a2a3e; background: #181828;
        }
        .ts-bet-subtab {
            flex: 1; display: flex; align-items: center; justify-content: center;
            padding: 6px 0; cursor: pointer; border-bottom: 2px solid transparent;
            transition: background 0.2s;
        }
        .ts-subtab-icon { width: 28px; height: 28px; object-fit: contain; opacity: 0.5; }
        .ts-bet-subtab.active { border-bottom: 2px solid #d4a76a; background: rgba(212,167,106,0.08); }
        .ts-bet-subtab.active .ts-subtab-icon { opacity: 1.0; }

        .ts-bet-content { overflow-y: auto; height: 230px; min-height: 230px; max-height: 230px; overflow-x: hidden; background: #1a1a2e; }
        .ts-bet-grid {
            display: grid; gap: 4px; padding: 6px;
        }
        .ts-bet-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
        .ts-bet-grid.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
        .ts-bet-grid.cols-6 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; }
        .ts-bet-cell {
            background: #1e1e38; border: 1px solid #2a2a3e; border-radius: 8px; padding: 8px 4px;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            cursor: pointer; position: relative; transition: background 0.2s; min-height: 60px;
        }
        .ts-bet-cell:active { background: #252540; }
        .ts-bet-cell .bet-name { font-size: 14px; font-weight: bold; color: #eee; }
        .ts-bet-cell .bet-odds { font-size: 12px; color: #d4a76a; margin-top: 2px; }
        .ts-bet-cell .bet-amount-badge {
            position: absolute; top: 2px; right: 4px;
            width: 28px; height: 28px;
            background: url('chips/chip-8.webp') center/contain no-repeat;
            color: #fff; font-size: 9px; font-weight: bold;
            line-height: 28px; text-align: center; z-index: 2;
            text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none;
        }
        .ts-bet-cell.flash-win {
            animation: betFlashWin 0.5s ease-in-out infinite alternate;
            border-color: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,0.4);
        }
        .ts-animal-img {
            width: 36px; height: 36px; object-fit: contain;
        }
        .ts-animal-pair { display: flex; gap: 4px; justify-content: center; margin-bottom: 2px; }

        .ts-chip-bar {
            display: flex; gap: 4px; padding: 8px 10px; background: #181828;
            border-top: 1px solid #2a2a3e; align-items: center; overflow-x: auto;
        }
        .ts-chip-balance {
            color: #d4a76a; font-size: 12px; font-weight: bold; margin-right: 6px;
            white-space: nowrap; min-width: 50px;
        }
        .ts-chip-item {
            width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent;
            cursor: pointer; position: relative; flex-shrink: 0;
            transition: transform 0.15s, border-color 0.15s;
            opacity: 0.7;
        }
        .ts-chip-item.selected { border-color: #d4a76a; opacity: 1; transform: scale(1.15); }
        .ts-chip-item img { width: 100%; height: 100%; border-radius: 50%; }
        .ts-chip-val { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 9px; font-weight: bold; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none; }
        @media (max-width: 768px) {
            .live-room-page.pt-mode .ts-panel { max-height: 100%; height: 100%; border-radius: 0; }
            .ts-bet-content { height: 230px; min-height: 230px; max-height: 230px; overflow-x: hidden; background: #1a1a2e; }
        }
        /* ===== XocDia (1004) Styles ===== */
        .xd-panel-overlay {
            display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            z-index: 100; background: transparent;
        }
        .xd-panel {
            position: absolute; bottom: 0; left: 0; right: 0;
            background: #0f0f1a; border-radius: 12px 12px 0 0;
            display: flex; flex-direction: column; overflow: hidden;
        }
        .xd-header {
            display: flex; align-items: center; gap: 8px;
            padding: 8px 10px; background: #181828;
            border-bottom: 1px solid #2a2a3e;
        }
        .xd-header-result {
            display: flex; flex-direction: column; align-items: center; gap: 2px; margin-left: auto; margin-right: 8px;
        }
        .xd-piece-row { display: flex; gap: 6px; justify-content: center; align-items: center; }
        .xd-piece { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
        .xd-piece img { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; }
        .xd-piece.shaking { animation: sbDiceShake1 0.4s ease-in-out infinite; }
        .xd-logo { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #d4a76a;
            overflow: hidden; flex-shrink: 0; }
        .xd-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
        .xd-logo-fallback { background: #8b0000; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 8px; color: #fff; font-weight: bold; }
        .xd-header-info { flex: 1; }
        .xd-round { display: none; }
        .xd-timer-row { display: flex; align-items: center; gap: 6px; }
        .xd-timer { color: #fff; font-size: 18px; font-weight: bold; font-family: monospace; }
        .xd-status { color: #4ade80; font-size: 11px; font-weight: 600; }
        .xd-status.closed { color: #ef4444; }
        .xd-close-btn { background: none; border: none; color: #aaa; font-size: 20px; cursor: pointer; padding: 2px 6px; flex-shrink: 0; }
        .xd-bet-content { overflow-y: auto; overflow-x: hidden; background: #1a1a2e; }
        .xd-bet-grid {
            display: grid; gap: 4px; padding: 2px 6px;
        }
        .xd-grid-4col { grid-template-columns: 2fr 1fr 1fr 2fr; }
        .xd-bet-cell {
            background: #1e1e38; border: 1px solid #2a2a3e; border-radius: 8px; padding: 8px 4px;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            cursor: pointer; position: relative; transition: background 0.2s; min-height: 60px;
        }
        .xd-bet-cell:active { background: #252540; }
        .xd-bet-cell .bet-name { font-size: 14px; font-weight: bold; color: #eee; }
        .xd-bet-cell .bet-odds { font-size: 12px; color: #d4a76a; margin-top: 2px; }
        .xd-bet-cell .bet-amount-badge {
            position: absolute; top: 2px; right: 4px;
            width: 28px; height: 28px;
            background: url('chips/chip-8.webp') center/contain no-repeat;
            color: #fff; font-size: 9px; font-weight: bold;
            line-height: 28px; text-align: center; z-index: 2;
            text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none;
        }
        .xd-bet-cell.flash-win {
            animation: betFlashWin 0.5s ease-in-out infinite alternate;
            border-color: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,0.4);
        }
        .xd-piece-img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
        .xd-piece-group { display: flex; gap: 3px; justify-content: center; margin-bottom: 2px; }
        .xd-piece-group-2row { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 2px; }
        .xd-piece-row-inner { display: flex; gap: 3px; justify-content: center; }
        .xd-chip-bar {
            display: flex; gap: 4px; padding: 8px 10px; background: #181828;
            border-top: 1px solid #2a2a3e; align-items: center; overflow-x: auto;
        }
        .xd-chip-balance {
            color: #d4a76a; font-size: 12px; font-weight: bold; margin-right: 6px;
            white-space: nowrap; min-width: 50px;
        }
        .xd-chip-item {
            width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent;
            cursor: pointer; position: relative; flex-shrink: 0;
            transition: transform 0.15s, border-color 0.15s; opacity: 0.7;
        }
        .xd-chip-item.selected { border-color: #d4a76a; opacity: 1; transform: scale(1.15); }
        .xd-chip-item img { width: 100%; height: 100%; border-radius: 50%; }
        .xd-chip-val { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 9px; font-weight: bold; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none; }
        @media (max-width: 768px) {
            .live-room-page.pt-mode .xd-panel { max-height: 100%; height: 100%; border-radius: 0; }
            .xd-bet-content { overflow-x: hidden; background: #1a1a2e; }
        }
        /* ===== Roulette (1006) Styles ===== */
        .rl-panel-overlay {
            display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            z-index: 100; background: transparent;
        }
        .rl-panel {
            position: absolute; bottom: 0; left: 0; right: 0;
            background: #0f0f1a; border-radius: 12px 12px 0 0;
            display: flex; flex-direction: column; overflow: hidden;
        }
        .rl-header {
            display: flex; align-items: center; gap: 8px;
            padding: 6px 10px; background: linear-gradient(135deg, #1a0a0a, #2a1a1a);
            border-bottom: 1px solid #333; flex-shrink: 0;
        }
        .rl-logo { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #d4a76a;
            display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
        .rl-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
        .rl-logo-fallback { background: #8b0000; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 7px; color: #fff; font-weight: bold; }
        .rl-header-info { flex: 1; }
        .rl-round { display: none; }
        .rl-timer-row { display: flex; align-items: center; gap: 6px; }
        .rl-timer { color: #fff; font-size: 18px; font-weight: bold; font-family: monospace; }
        .rl-status { color: #4ade80; font-size: 11px; font-weight: 600; }
        .rl-status.closed { color: #ef4444; }
        .rl-close-btn { background: none; border: none; color: #aaa; font-size: 20px; cursor: pointer; padding: 2px 6px; flex-shrink: 0; }
        /* Roulette Wheel Area - Arc with fixed center */
        .rl-wheel-area {
            position: relative; overflow: hidden; flex-shrink: 0;
            height: 80px; min-height: 80px; max-height: 80px;
            background: #0a0a1a;
        }
        .rl-wheel-pointer {
            position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
            width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent;
            border-top: 12px solid #ffd700; z-index: 30; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
        }
        .rl-wheel-arc {
            position: absolute;
            left: 50%; top: 216px;
            width: 0; height: 0;
            will-change: transform;
        }
        .rl-wheel-card {
            position: absolute;
            width: 30px; height: 42px; border-radius: 4px;
            display: flex; align-items: center; justify-content: center;
            font-size: 12px; font-weight: bold; color: #ffe082;
            text-shadow: 0 1px 2px rgba(0,0,0,0.8);
            border: 1px solid rgba(255,255,255,0.18);
        }
        .rl-wheel-card.red { background: linear-gradient(180deg, #c0392b, #8b0000); }
        .rl-wheel-card.black { background: linear-gradient(180deg, #444, #1a1a1a); }
        .rl-wheel-card.green { background: linear-gradient(180deg, #27ae60, #0a5c2a); }
        .rl-wheel-card.highlight {
            border: 2px solid #ffd700; box-shadow: 0 0 10px rgba(255,215,0,0.7);
            color: #fff; z-index: 10;
        }
        .rl-wheel-area::before, .rl-wheel-area::after {
            content: ''; position: absolute; top: 0; bottom: 0; width: 60px; z-index: 20; pointer-events: none;
        }
        .rl-wheel-area::before { left: 0; background: linear-gradient(to right, #0a0a1a 0%, transparent 100%); }
        .rl-wheel-area::after { right: 0; background: linear-gradient(to left, #0a0a1a 0%, transparent 100%); }
        /* Roulette Bet Sub-tabs */
        .rl-bet-subtabs {
            display: flex; background: #1a1a2e; border-bottom: 1px solid #333; flex-shrink: 0;
        }
        .rl-bet-subtab {
            flex: 1; padding: 4px 0; text-align: center; color: #888; font-size: 12px;
            cursor: pointer; background: none; border: none; transition: opacity 0.15s;
            display: flex; align-items: center; justify-content: center; gap: 0;
            border-bottom: 2px solid transparent;
        }
        .rl-subtab-icon { width: 28px; height: 28px; object-fit: contain; opacity: 0.5; }
        .rl-bet-subtab.active { border-bottom: 2px solid #d4a76a; background: rgba(212,167,106,0.08); }
        .rl-bet-subtab.active .rl-subtab-icon { opacity: 1.0; }
        /* Roulette Bet grid */
        .rl-bet-content { overflow-y: auto; overflow-x: hidden; background: #1a1a2e; }
        .rl-bet-grid {
            display: grid; gap: 1px; background: #333; border: 1px solid #333;
        }
        .rl-bet-grid.cols-2 { grid-template-columns: 1fr 1fr; }
        .rl-bet-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
        .rl-bet-grid.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
        .rl-bet-grid.cols-6 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; }
        .rl-bet-cell {
            background: #1a1a2e; padding: 10px 4px; text-align: center; cursor: pointer;
            position: relative; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center;
            -webkit-tap-highlight-color: transparent; transition: none;
            user-select: none; -webkit-user-select: none; border: 2px solid transparent;
        }
        .rl-bet-cell.span2 { grid-row: span 2; }
        .rl-bet-cell:active { background: #252540; }
        .rl-bet-cell.selected { border-color: #ffd700; box-shadow: 0 0 6px rgba(255,215,0,0.4); }
        .rl-bet-cell .bet-name { font-size: 16px; font-weight: bold; color: #eee; }
        .rl-bet-cell .bet-name.red-text { color: #e74c3c; }
        .rl-bet-cell .bet-name.green-text { color: #4ade80; }
        .rl-bet-cell .bet-odds { font-size: 13px; color: #d4a76a; margin-top: 2px; }
        .rl-bet-cell .bet-amount-badge {
            position: absolute; top: 2px; right: 4px;
            width: 28px; height: 28px;
            background: url('chips/chip-8.webp') center/contain no-repeat;
            color: #fff; font-size: 9px; font-weight: bold;
            line-height: 28px; text-align: center; z-index: 2;
            text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none;
        }
        .rl-bet-cell.flash-win {
            animation: bacWinFlash 0.6s ease-in-out infinite;
            box-shadow: 0 0 8px 2px rgba(255, 215, 0, 0.6);
            border: 1px solid #ffd700;
        }
        /* Roulette Chip bar */
        .rl-chip-bar {
            display: flex; align-items: center; gap: 6px; padding: 6px 8px;
            background: #111; border-top: 1px solid #333; flex-shrink: 0;
            overflow-x: auto;
        }
        .rl-chip-balance {
            background: #16a34a; color: #fff; font-size: 12px; font-weight: bold;
            padding: 4px 10px; border-radius: 16px; white-space: nowrap; cursor: pointer; flex-shrink: 0; min-width: 80px; font-variant-numeric: tabular-nums;
        }
        .rl-chip-item {
            width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            font-size: 10px; font-weight: bold; color: #fff; flex-shrink: 0;
            border: 2px solid transparent; opacity: 0.7;
            -webkit-tap-highlight-color: transparent; position: relative;
        }
        .rl-chip-item.selected { border-color: #d4a76a; opacity: 1; transform: scale(1.15); }
        .rl-chip-item img { width: 100%; height: 100%; border-radius: 50%; }
        .rl-chip-val { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 9px; font-weight: bold; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none; }
        /* Mobile: only liveType=4 (.pt-mode) gets the full-height roulette
           panel so liveType=2 rooms keep the video visible above it. */
        @media (max-width: 768px) {
            .live-room-page.pt-mode .rl-panel { max-height: 100%; height: 100%; border-radius: 0; }
            .rl-bet-content { overflow-x: hidden; background: #1a1a2e; }
        }

