/* ======================================
   团团斗地主 Web 版 — 主样式
   深绿牌桌主题 + 金色点缀 + 无障碍
   ====================================== */

:root {
    /* 色板 */
    --bg-deepest: #0a1a0f;
    --bg-dark: #0d2818;
    --bg-table: #1b5e20;
    --bg-table-light: #2e7d32;
    --bg-panel: #1a3a1a;
    --bg-header: #1a1a2e;
    --bg-card: #fafafa;
    --gold: #ffd700;
    --gold-dim: #b8960f;
    --text-primary: #f5f5f5;
    --text-secondary: #b0bec5;
    --text-muted: #5a6a5a;
    --red-suit: #ef5350;
    --black-suit: #212121;
    --focus-blue: #42a5f5;
    --selected-yellow: #ffc107;
    --accent-green: #66bb6a;
    --danger: #e53935;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.3);
    --panel-radius: 12px;
    --transition: 0.2s ease;

    /* 字体 */
    --font: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg-deepest);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* 屏幕阅读器专用 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ====== 屏幕切换 ====== */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
.screen.active { display: flex; }

/* ====== 按钮 ====== */
.btn {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    user-select: none;
}
.btn:focus-visible {
    box-shadow: 0 0 0 3px var(--focus-blue);
}
.btn-primary {
    background: linear-gradient(135deg, var(--bg-table), var(--bg-table-light));
    color: var(--text-primary);
    border: 2px solid var(--gold-dim);
}
.btn-primary:hover { background: var(--bg-table-light); border-color: var(--gold); }
.btn-accent {
    background: linear-gradient(135deg, #e65100, #ff6d00);
    color: #fff;
}
.btn-accent:hover { filter: brightness(1.1); }
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--text-muted);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-primary); }
.btn-action {
    background: var(--bg-table);
    color: var(--text-primary);
    border: 1px solid var(--gold-dim);
    font-size: 13px;
    padding: 8px 16px;
}
.btn-action:hover { background: var(--bg-table-light); border-color: var(--gold); }
.btn-action.btn-play {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    border-color: var(--gold);
}
.btn-large { font-size: 18px; padding: 14px 36px; }
.btn-small { font-size: 12px; padding: 5px 12px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(255,215,0,0.3); }
}
.pulse { animation: pulse 2s infinite; }

/* ====== 登录/注册 ====== */
#auth-screen {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #0d2818 0%, #050f08 100%);
}
.auth-container {
    width: 420px;
    max-width: 90vw;
    text-align: center;
}
.game-title {
    font-size: 52px;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(255,215,0,0.3);
    margin-bottom: 8px;
    letter-spacing: 6px;
}
.game-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
    letter-spacing: 4px;
}
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--bg-dark);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #2a5a2a;
}
.auth-tab {
    flex: 1;
    padding: 12px;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}
.auth-tab.active {
    background: var(--bg-table);
    color: var(--gold);
}
.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
}
.auth-form.active { display: flex; }
.form-group {
    text-align: left;
}
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font);
    font-size: 15px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid #2a5a2a;
    border-radius: 8px;
    outline: none;
    transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--gold);
}
.form-error {
    color: var(--danger);
    font-size: 13px;
    min-height: 20px;
}
#btn-guest {
    margin-top: 16px;
    width: 100%;
}

/* ====== 大厅 ====== */
#lobby-screen {
    flex-direction: column;
    background: radial-gradient(ellipse at top, #0d2818 0%, #050f08 100%);
}
.lobby-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid #1a3a1a;
}
.lobby-title {
    font-size: 28px;
    color: var(--gold);
    font-weight: 900;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}
.gold { color: var(--gold); font-weight: 700; }
.lobby-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
    gap: 40px;
    overflow-y: auto;
}
.mode-cards {
    display: flex;
    gap: 32px;
}
.mode-card {
    background: linear-gradient(145deg, #1a3a1a, #0d2818);
    border: 2px solid #2a5a2a;
    border-radius: 16px;
    padding: 32px 40px;
    text-align: center;
    min-width: 260px;
    transition: all 0.3s;
}
.mode-card:hover {
    border-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(255,215,0,0.1);
}
.mode-icon { font-size: 48px; margin-bottom: 12px; }
.mode-card h2 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 22px;
}
.mode-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}
.room-list-section {
    width: 100%;
    max-width: 600px;
}
.room-list-section h3 {
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.room-list {
    background: var(--bg-dark);
    border: 1px solid #1a3a1a;
    border-radius: 10px;
    min-height: 80px;
    padding: 12px;
    margin-bottom: 12px;
}
.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-panel);
    border-radius: 8px;
    margin-bottom: 8px;
}
.room-item:last-child { margin-bottom: 0; }
.empty-hint { color: var(--text-muted); text-align: center; padding: 20px; }
.join-room-row {
    display: flex;
    gap: 8px;
}
.join-room-row input {
    flex: 1;
    padding: 10px 16px;
    font-family: var(--font);
    font-size: 14px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid #2a5a2a;
    border-radius: 8px;
    outline: none;
}
.join-room-row input:focus { border-color: var(--gold); }

/* ====== 游戏界面 ====== */
#game-screen {
    flex-direction: column;
    background: var(--bg-dark);
}

/* 顶栏 */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 20px;
    background: var(--bg-header);
    border-bottom: 2px solid #2a2a4e;
    flex-shrink: 0;
}
.header-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--gold);
}
.phase-badge {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
    padding: 4px 16px;
    border-radius: 20px;
}
.multiplier {
    font-size: 15px;
    color: var(--gold);
    font-weight: 700;
}
.role-badge {
    font-size: 15px;
    font-weight: 900;
    color: var(--gold);
    margin-left: 12px;
}

/* 牌桌 */
.game-table {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
}

/* 玩家面板 */
.player-panel {
    width: 180px;
    padding: 16px 12px;
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    border-radius: 0;
}
.left-panel { border-right: 1px solid #1a3a1a; }
.right-panel { border-left: 1px solid #1a3a1a; }
.panel-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.panel-role {
    font-size: 14px;
    color: var(--gold);
    font-weight: 700;
    min-height: 20px;
}
.panel-count {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
    background: var(--bg-dark);
    padding: 6px 16px;
    border-radius: 8px;
    min-width: 60px;
    text-align: center;
}
.panel-action {
    font-size: 14px;
    color: var(--selected-yellow);
    font-weight: 700;
    min-height: 20px;
    text-align: center;
    word-break: break-all;
}
.panel-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    max-width: 160px;
}
.player-panel.active-turn {
    box-shadow: inset 0 0 20px rgba(255,215,0,0.15);
    border-color: var(--gold-dim);
}

/* 中央 */
.center-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
    min-width: 0;
}
.reserved-area {
    display: flex;
    gap: 6px;
    align-items: center;
    position: absolute;
    top: 16px;
}
.reserved-area::before {
    content: '底牌:';
    color: var(--text-secondary);
    font-size: 13px;
    margin-right: 4px;
}
.play-area {
    text-align: center;
}
.play-desc {
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 10px;
    min-height: 24px;
}
.play-cards {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
}
.center-message {
    text-align: center;
}

/* 底部 */
.game-bottom {
    background: var(--bg-dark);
    border-top: 2px solid #1a3a1a;
    padding: 8px 20px 12px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.status-bar {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    min-height: 20px;
}
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.picked-info {
    font-size: 13px;
    color: var(--selected-yellow);
    min-height: 18px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.hand-area {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 90px;
    position: relative;
}

/* ====== 卡牌 ====== */
.card {
    width: 58px;
    height: 82px;
    background: var(--bg-card);
    border-radius: 6px;
    border: 2px solid #ccc;
    display: flex;
    flex-direction: column;
    padding: 4px 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    user-select: none;
    box-shadow: var(--card-shadow);
    flex-shrink: 0;
    /* button 重置 */
    font-family: var(--font);
    outline: none;
    text-align: left;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
}
/* 键盘/读屏焦点环 — 与游戏逻辑焦点(.focused)不同 */
.card:focus-visible {
    outline: 3px solid var(--focus-blue);
    outline-offset: 2px;
}
.card .card-rank {
    font-size: 18px;
    line-height: 1;
}
.card .card-suit {
    font-size: 13px;
    line-height: 1;
    margin-top: 2px;
}
.card .card-joker {
    font-size: 16px;
    font-weight: 900;
    text-align: center;
    margin: auto 0;
}
.card.red { color: var(--red-suit); }
.card.black { color: var(--black-suit); }
.card.focused {
    border-color: var(--focus-blue);
    border-width: 3px;
    box-shadow: 0 0 12px rgba(66,165,245,0.5);
}
.card.picked {
    transform: translateY(-22px);
    border-color: var(--selected-yellow);
    border-width: 3px;
    box-shadow: 0 0 12px rgba(255,193,7,0.5);
}
.card-small {
    width: 38px;
    height: 54px;
    border-radius: 4px;
    border: 1px solid #888;
    padding: 3px 4px;
}
.card-small .card-rank { font-size: 13px; }
.card-small .card-suit { font-size: 10px; }
.card-small .card-joker { font-size: 12px; }

/* 手牌堆叠 */
.hand-card {
    margin-left: -36px;
}
.hand-card:first-child { margin-left: 0; }

/* ====== 快捷键面板 ====== */
.shortcuts-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(13,40,24,0.97);
    border: 2px solid var(--gold-dim);
    border-radius: 16px;
    padding: 24px 32px;
    z-index: 100;
    max-height: 80vh;
    overflow-y: auto;
}
.shortcuts-panel h3 {
    color: var(--gold);
    margin-bottom: 16px;
    text-align: center;
}
.shortcuts-panel ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}
.shortcuts-panel li {
    color: var(--text-secondary);
    font-size: 13px;
}
kbd {
    background: var(--bg-header);
    color: var(--text-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font);
    font-size: 12px;
    border: 1px solid #444;
    margin-right: 4px;
}
#btn-close-shortcuts {
    margin-top: 16px;
    width: 100%;
}

/* ====== 用户中心面板 ====== */
.profile-panel {
    background: var(--bg-dark);
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 24px;
    margin: 0 auto 20px;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.profile-panel h3 {
    color: var(--gold);
    margin: 0 0 12px;
    font-size: 18px;
}
.profile-panel h4 {
    color: var(--text);
    margin: 0 0 8px;
    font-size: 15px;
}
.profile-stats {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 16px;
    line-height: 1.8;
}
.profile-stats strong {
    color: var(--gold);
}
.profile-form .form-group {
    margin-bottom: 10px;
}
.profile-form label {
    display: block;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.profile-form .form-error {
    margin-top: 8px;
    min-height: 20px;
}
.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* ====== 触摸手势 Toast ====== */
#touch-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 16px;
    padding: 10px 24px;
    border-radius: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 9999;
    white-space: nowrap;
    font-family: var(--font);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.15);
}
#touch-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ====== 响应式 — 平板 ====== */
@media (max-width: 900px) {
    .player-panel { width: 120px; padding: 10px 6px; }
    .mode-cards { flex-direction: column; }
    .game-title { font-size: 36px; }
    .card { width: 48px; height: 68px; }
    .card .card-rank { font-size: 14px; }
    .hand-card { margin-left: -30px; }
    .lobby-header { flex-direction: column; gap: 8px; }
    .mode-card { min-width: 200px; padding: 24px 20px; }
}

/* ====== 响应式 — 手机 ====== */
@media (max-width: 640px) {
    body {
        overflow: auto;
        height: 100dvh; /* 考虑手机地址栏 */
    }
    .screen.active {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
    }

    /* 登录 */
    .game-title { font-size: 28px; letter-spacing: 3px; }
    .game-subtitle { font-size: 13px; margin-bottom: 20px; }
    .auth-container { width: 95vw; padding: 0 8px; }
    .auth-tab { font-size: 14px; padding: 10px; }
    .form-group input, .form-group select {
        font-size: 16px; /* 防 iOS 自动缩放 */
        padding: 14px 12px;
    }

    /* 大厅 */
    .lobby-container { padding: 12px; }
    .lobby-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .lobby-title { font-size: 22px; text-align: center; }
    .user-info {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    .lobby-content {
        padding-top: 16px;
        gap: 20px;
    }
    .mode-cards { flex-direction: column; gap: 16px; }
    .mode-card {
        min-width: auto;
        padding: 20px 16px;
    }
    .mode-icon { font-size: 36px; }
    .mode-card h2 { font-size: 18px; }
    .mode-card p { font-size: 13px; margin-bottom: 14px; }

    /* 游戏界面 — 核心手机适配 */
    #game-screen {
        flex-direction: column;
        overflow-y: auto;
    }

    /* 顶栏紧凑 */
    .game-header {
        height: auto;
        padding: 6px 10px;
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
    }
    .header-title { font-size: 15px; display: none; }
    .phase-badge { font-size: 13px; padding: 2px 10px; }
    .multiplier { font-size: 13px; }
    .role-badge { font-size: 13px; margin-left: 4px; }

    /* 牌桌：竖向布局 */
    .game-table {
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

    /* 对手面板：横向条状排列 */
    .player-panel {
        width: 100%;
        flex-direction: row;
        padding: 6px 10px;
        gap: 10px;
        align-items: center;
        justify-content: center;
        border-radius: 0;
    }
    .left-panel { border-right: none; border-bottom: 1px solid #1a3a1a; }
    .right-panel { border-left: none; border-top: 1px solid #1a3a1a; }
    .panel-name { font-size: 13px; }
    .panel-role { font-size: 12px; min-height: auto; }
    .panel-count {
        font-size: 14px;
        padding: 3px 10px;
        min-width: 40px;
    }
    .panel-action {
        font-size: 12px;
        min-height: auto;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .panel-cards {
        max-width: 100px;
        gap: 2px;
    }

    /* 中央区域 */
    .center-area {
        flex: 1;
        min-height: 100px;
        gap: 8px;
        padding: 8px;
    }
    .reserved-area { position: static; margin-bottom: 8px; }
    .reserved-area::before { font-size: 12px; }
    .play-desc { font-size: 14px; margin-bottom: 6px; }

    /* 底部 */
    .game-bottom {
        padding: 6px 8px 10px;
        gap: 4px;
    }
    .status-bar { font-size: 12px; }

    /* 操作按钮：更大的触摸区 */
    .action-buttons {
        flex-wrap: wrap;
        gap: 6px;
    }
    .btn-action {
        font-size: 14px;
        padding: 12px 16px;
        min-height: 44px; /* Apple 推荐触摸目标 */
        flex: 1;
        min-width: 70px;
    }
    .picked-info { font-size: 12px; }

    /* 手牌: 更紧凑的堆叠 */
    .hand-area {
        min-height: 70px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding: 0 8px;
    }
    .card {
        width: 42px;
        height: 60px;
        padding: 3px 4px;
        border-radius: 4px;
    }
    .card .card-rank { font-size: 13px; }
    .card .card-suit { font-size: 10px; }
    .card .card-joker { font-size: 11px; }
    .card.picked { transform: translateY(-16px); }
    .hand-card { margin-left: -24px; }
    .hand-card:first-child { margin-left: 0; }

    /* 小卡 */
    .card-small { width: 30px; height: 42px; }
    .card-small .card-rank { font-size: 10px; }
    .card-small .card-suit { font-size: 8px; }

    /* 快捷键面板 */
    .shortcuts-panel {
        width: 90vw;
        padding: 16px;
        max-height: 70vh;
    }
    .shortcuts-panel ul {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    /* 开始按钮 */
    .btn-large {
        font-size: 16px;
        padding: 14px 24px;
        width: 100%;
    }
}

/* ====== 横屏手机特殊处理 ====== */
@media (max-height: 500px) and (max-width: 900px) {
    .game-table {
        flex-direction: row;
    }
    .player-panel {
        width: 90px;
        flex-direction: column;
        padding: 4px;
    }
    .left-panel { border-right: 1px solid #1a3a1a; border-bottom: none; }
    .right-panel { border-left: 1px solid #1a3a1a; border-top: none; }
    .game-bottom {
        padding: 4px 8px 6px;
    }
    .hand-area { min-height: 55px; }
    .card { width: 36px; height: 50px; }
    .card .card-rank { font-size: 11px; }
    .hand-card { margin-left: -20px; }
}

/* ====== 触屏优化 ====== */
@media (hover: none) and (pointer: coarse) {
    /* 触屏设备：更大的按钮、更明显的触摸反馈 */
    .btn {
        min-height: 44px;
        -webkit-tap-highlight-color: rgba(255,215,0,0.2);
    }
    .btn:active {
        transform: scale(0.96);
    }
    .card:active {
        transform: scale(0.95);
        border-color: var(--gold);
    }
    .card.picked:active {
        transform: translateY(-16px) scale(0.95);
    }
    .mode-card:active {
        transform: scale(0.98);
        border-color: var(--gold);
    }
}

/* ====== 聊天面板 ====== */
.chat-panel {
    position: fixed;
    right: 0;
    top: 48px;
    bottom: 0;
    width: 280px;
    background: rgba(10,10,30,0.95);
    border-left: 1px solid #2a2a5a;
    display: flex;
    flex-direction: column;
    z-index: 50;
    backdrop-filter: blur(8px);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    font-size: 13px;
}
.chat-msg {
    margin-bottom: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    line-height: 1.5;
}
.chat-msg-me {
    background: rgba(66,165,245,0.12);
    border-left: 2px solid var(--focus-blue);
}
.chat-msg-quick {
    font-style: italic;
    color: var(--gold);
}
.chat-sender {
    color: var(--gold);
    font-weight: 700;
    font-size: 12px;
    margin-right: 6px;
}
.chat-time {
    color: var(--text-muted);
    font-size: 11px;
    margin-right: 6px;
}
.chat-content {
    color: var(--text-primary);
}
.chat-quick-bar {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    flex-wrap: wrap;
    border-top: 1px solid #2a2a5a;
}
.chat-quick-bar .btn {
    font-size: 11px;
    padding: 3px 8px;
    min-height: auto;
}
.chat-input-row {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    border-top: 1px solid #2a2a5a;
}
.chat-input-row input {
    flex: 1;
    padding: 6px 10px;
    font-family: var(--font);
    font-size: 13px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid #2a5a2a;
    border-radius: 6px;
    outline: none;
}
.chat-input-row input:focus { border-color: var(--gold); }

/* ====== 投票对话框 ====== */
.vote-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(13,40,24,0.97);
    border: 2px solid var(--gold);
    border-radius: 16px;
    padding: 24px 32px;
    z-index: 200;
    text-align: center;
    min-width: 280px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.vote-dialog p {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.vote-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ====== 房间玩家信息 ====== */
.room-players {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 8px;
}

/* ====== 按钮危险色 ====== */
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { filter: brightness(1.1); }

/* 聊天面板手机适配 */
@media (max-width: 640px) {
    .chat-panel {
        width: 100%;
        top: auto;
        bottom: 0;
        height: 180px;
        position: relative;
        border-left: none;
        border-top: 1px solid #2a2a5a;
    }
    .chat-messages { max-height: 80px; }
    .vote-dialog { min-width: 90vw; }
}
