/* =============================================
   狼人杀在线桌游 - 主样式表 v2
   ============================================= */

:root {
    --primary: #7c6cf0;
    --primary-dark: #6358d4;
    --primary-glow: rgba(124, 108, 240, 0.25);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --info: #3b82f6;
    --info-soft: rgba(59, 130, 246, 0.12);
    --dark: #1e1e2e;
    --darker: #16161e;
    --darkest: #111118;
    --gray: #71717a;
    --gray-light: #a1a1aa;
    --light: #d4d4d8;
    --white: #fafafa;
    --surface: #1c1c28;
    --surface-hover: #24243a;
    --surface-active: #2a2a42;
    --border: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(124, 108, 240, 0.5);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    background: var(--darkest);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

::selection { background: var(--primary); color: #fff; }

/* 滚动条 */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* =============================================
   通用组件
   ============================================= */

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 26px;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--white);
    font-family: var(--font);
    letter-spacing: 0.02em;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.2s;
}
.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn:disabled::after { display: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 2px 12px var(--primary-glow);
}
.btn-primary:hover { box-shadow: 0 4px 20px var(--primary-glow); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    box-shadow: 0 2px 12px var(--danger-soft);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #16a34a);
    box-shadow: 0 2px 12px var(--success-soft);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    box-shadow: 0 2px 12px var(--warning-soft);
    color: #1a1a1a;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.15);
    color: var(--gray-light);
}
.btn-outline:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.25); color: var(--white); }

.btn-sm { padding: 7px 16px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* 输入框 */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-light);
    letter-spacing: 0.02em;
}
.form-control {
    width: 100%;
    padding: 13px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--surface);
    color: var(--white);
    font-size: 15px;
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
    line-height: 1.4;
}
.form-control:hover { border-color: rgba(255,255,255,0.12); }
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--surface-hover);
}
.form-control::placeholder { color: var(--gray); }
select.form-control { cursor: pointer; }
select.form-control option { background: var(--surface); color: var(--white); }

/* 卡片 */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.card-header {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--white);
}

/* =============================================
   导航栏
   ============================================= */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: rgba(22, 22, 30, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 0.02em;
}
.navbar-brand .logo { font-size: 26px; filter: drop-shadow(0 0 8px rgba(255,71,87,0.3)); }
.navbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
}
.navbar-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px var(--primary-glow);
}
.navbar-user .avatar:hover { transform: scale(1.08); }

/* =============================================
   登录页
   ============================================= */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--darkest);
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124, 108, 240, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(255, 71, 87, 0.05) 0%, transparent 50%);
}
.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
    padding: 40px 36px;
}
.login-card h1 {
    font-size: 38px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #ff6b6b, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.04em;
}
.login-card .subtitle {
    color: var(--gray);
    margin-bottom: 36px;
    font-size: 14px;
    letter-spacing: 0.05em;
}
.login-card .form-control { text-align: center; font-size: 16px; padding: 14px 18px; }

/* =============================================
   大厅
   ============================================= */
.lobby-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 28px;
}
.lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}
.lobby-header h2 { font-size: 22px; font-weight: 800; letter-spacing: 0.02em; }
.lobby-stats {
    display: flex;
    gap: 24px;
    color: var(--gray-light);
    font-size: 13px;
    font-weight: 500;
}
.lobby-stats span { display: flex; align-items: center; gap: 6px; }

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.room-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}
.room-card:hover {
    border-color: rgba(124, 108, 240, 0.3);
    background: var(--surface-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(124, 108, 240, 0.15);
}
.room-card .room-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--white);
}
.room-card .room-meta {
    display: flex;
    gap: 16px;
    color: var(--gray);
    font-size: 13px;
    margin-bottom: 14px;
}
.room-card .room-meta span { display: flex; align-items: center; gap: 5px; }
.room-card .room-players-bar {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    margin-bottom: 14px;
    overflow: hidden;
}
.room-card .room-players-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--primary));
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.room-card .room-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.room-card .host-tag {
    font-size: 12px;
    padding: 3px 10px;
    background: var(--primary-glow);
    color: var(--primary);
    border-radius: 20px;
    font-weight: 600;
}
.room-card .lock-tag {
    font-size: 12px;
    padding: 3px 8px;
    background: var(--warning-soft);
    color: var(--warning);
    border-radius: 20px;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--gray);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.empty-state p { font-size: 15px; margin-bottom: 24px; }

/* =============================================
   模态框
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal, .modal-card {
    background: var(--surface);
    border-radius: 18px;
    padding: 32px;
    width: 90%;
    max-width: 460px;
    transform: scale(0.92) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-overlay.active .modal,
.modal-overlay.active .modal-card { transform: scale(1) translateY(0); }
.modal h3 { font-size: 20px; margin-bottom: 22px; font-weight: 700; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 18px; }
.btn-close {
    background: rgba(255,255,255,0.06);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-light);
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}
.btn-close:hover { background: rgba(255,255,255,0.12); color: #fff; }
.modal-body { padding: 0 4px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
}
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* 玩家资料弹窗 */
.profile-info { text-align: center; margin-bottom: 28px; }
.profile-info .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 32px;
    font-weight: 800;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.profile-info h4 { margin: 0; font-size: 17px; font-weight: 700; }
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 18px;
}
.stat-item {
    background: rgba(255,255,255,0.04);
    padding: 14px 8px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}
.stat-label { font-size: 11px; color: var(--gray); display: block; margin-bottom: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 18px; font-weight: 800; }
.password-change h4 { font-size: 15px; margin: 0 0 18px; color: var(--gray-light); font-weight: 600; }

/* =============================================
   等待室
   ============================================= */
.p-avatar.ready { border-color: var(--success); }
.p-avatar.ready::after {
    content: '✓';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--success);
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}
.p-avatar.kickable:hover { cursor: pointer; border-color: var(--danger); transform: scale(1.05); }
.p-avatar.kickable:hover::before {
    content: '✕ 踢出';
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger);
    color: #fff;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
}
.ready-check {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--success);
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}
.room-code-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
    padding: 10px 24px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}

/* =============================================
   游戏容器
   ============================================= */
.game-container {
    height: calc(100vh - 60px);
    display: grid;
    grid-template-columns: 350px 1fr;
    grid-template-rows: 1fr;
    gap: 0;
    overflow: hidden;
    position: relative;
}

/* 左侧面板（玩家列表 + 操作面板上下堆叠） */
.player-panel {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.player-panel h4 {
    font-size: 12px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
    padding: 18px 16px 0;
    flex-shrink: 0;
    font-weight: 700;
}

.seat-list { list-style: none; padding: 0 12px; overflow-y: auto; flex: 1; }
.seat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    margin-bottom: 4px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.seat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
.seat-item:hover::before {
    transform: translateX(100%);
}
.seat-item:hover {
    background: rgba(255,255,255,0.04);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.seat-item .seat-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--gray-light);
    flex-shrink: 0;
    font-weight: 600;
}
.seat-item .seat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.seat-item .seat-name {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--white);
}
.seat-item .seat-role {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    flex-shrink: 0;
}
.seat-item.dead { opacity: 0.35; }
.seat-item.dead .seat-avatar { background: var(--gray); box-shadow: none; }
.seat-item.just-died {
    animation: deathFade 1.5s ease-out forwards;
}
.seat-item.is-me {
    background: rgba(124, 108, 240, 0.1);
    border: 1px solid rgba(124, 108, 240, 0.2);
}
.seat-item.empty { color: var(--gray); font-size: 13px; }

.role-werewolf { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.role-seer { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.role-witch { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.role-hunter { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.role-guard { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.role-villager { background: rgba(255,255,255,0.08); color: var(--gray-light); }

/* 中间主区域 */
.main-area {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 游戏状态栏 */
.game-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}
.game-status-bar .phase-icon { font-size: 22px; }
.game-status-bar .phase-text { font-weight: 700; }
.game-status-bar .round-info { color: var(--gray); font-size: 13px; font-weight: 500; }

.phase-night {
    background: linear-gradient(135deg, #12122a, #1a1a3e) !important;
    border-bottom-color: rgba(124, 108, 240, 0.15) !important;
}
.phase-day {
    background: linear-gradient(135deg, #1e2420, #2a3028) !important;
    border-bottom-color: rgba(245, 158, 11, 0.15) !important;
}

/* =============================================
   聊天区域
   ============================================= */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--darkest);
    position: relative;
}
.chat-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.chat-msg {
    max-width: 80%;
    animation: fadeInUp 0.3s ease;
    position: relative;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 洗牌分角色动画 */
@keyframes shuffle {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    20% { transform: translateY(-10px) rotate(5deg); opacity: 0.8; }
    40% { transform: translateY(10px) rotate(-5deg); opacity: 0.9; }
    60% { transform: translateY(-5px) rotate(3deg); opacity: 0.8; }
    80% { transform: translateY(5px) rotate(-3deg); opacity: 0.9; }
    100% { transform: translateY(0) rotate(0deg); opacity: 1; }
}

/* 毒药动画 */
@keyframes poison {  
    0% { transform: scale(1); opacity: 1; }
    25% { transform: scale(1.1); opacity: 0.8; box-shadow: 0 0 10px rgba(163, 230, 53, 0.6); }
    50% { transform: scale(1.05); opacity: 0.9; box-shadow: 0 0 20px rgba(163, 230, 53, 0.8); }
    75% { transform: scale(1.1); opacity: 0.8; box-shadow: 0 0 15px rgba(163, 230, 53, 0.6); }
    100% { transform: scale(1); opacity: 1; }
}

/* 击杀动画 */
@keyframes kill {
    0% { transform: scale(1); opacity: 1; }
    30% { transform: scale(1.2); opacity: 0.8; box-shadow: 0 0 20px rgba(239, 68, 68, 0.8); }
    60% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

/* 开枪动画 */
@keyframes shoot {
    0% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(-5deg); }
    50% { transform: scale(1.2) rotate(5deg); box-shadow: 0 0 15px rgba(245, 158, 11, 0.8); }
    75% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* 角色揭示动画 */
@keyframes reveal {
    0% { transform: translateY(20px); opacity: 0; }
    50% { transform: translateY(-5px); opacity: 0.8; }
    100% { transform: translateY(0); opacity: 1; }
}

/* 胜利动画 */
@keyframes victory {
    0% { transform: scale(1); }
    20% { transform: scale(1.1) rotate(2deg); }
    40% { transform: scale(1.05) rotate(-2deg); }
    60% { transform: scale(1.1) rotate(1deg); }
    80% { transform: scale(1.05) rotate(-1deg); }
    100% { transform: scale(1); }
}

/* 失败动画 */
@keyframes defeat {
    0% { transform: scale(1); }
    20% { transform: scale(0.9) rotate(-2deg); }
    40% { transform: scale(0.95) rotate(2deg); }
    60% { transform: scale(0.9) rotate(-1deg); }
    80% { transform: scale(0.95) rotate(1deg); }
    100% { transform: scale(1); }
}

/* 阶段切换动画 */
@keyframes phaseIn {
    0% { opacity: 0; transform: scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* 倒计时警告动画 */
@keyframes countdownPulse {
    0% { transform: scale(1); color: var(--white); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); color: var(--white); }
}

@keyframes countdownUrgent {
    0% { transform: scale(1); color: var(--warning); }
    25% { transform: scale(1.2); color: var(--danger); text-shadow: 0 0 10px var(--danger); }
    50% { transform: scale(1.1); color: var(--warning); }
    75% { transform: scale(1.15); color: var(--danger); text-shadow: 0 0 8px var(--danger); }
    100% { transform: scale(1); color: var(--danger); text-shadow: 0 0 5px var(--danger); }
}

/* 投票动画 */
@keyframes voteSlide {
    0% { transform: translateX(-20px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes voteHighlight {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* 死亡动画 */
@keyframes deathFade {
    0% { opacity: 1; transform: scale(1); filter: brightness(1); }
    30% { opacity: 0.8; transform: scale(1.05); filter: brightness(1.5) saturate(0.5); }
    100% { opacity: 0.3; transform: scale(0.95); filter: brightness(0.5) saturate(0); }
}

/* 选中效果 */
@keyframes selectPulse {
    0% { box-shadow: 0 0 0 0 rgba(124, 108, 240, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(124, 108, 240, 0); }
    100% { box-shadow: 0 0 0 0 rgba(124, 108, 240, 0); }
}

/* 等待动画 */
@keyframes waitPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 角色揭示 */
@keyframes roleReveal {
    0% { opacity: 0; transform: rotateY(90deg) scale(0.8); }
    50% { opacity: 0.5; transform: rotateY(45deg) scale(0.9); }
    100% { opacity: 1; transform: rotateY(0deg) scale(1); }
}

/* 背景闪烁效果 */
@keyframes bgFlash {
    0% { background-color: transparent; }
    50% { background-color: rgba(239, 68, 68, 0.1); }
    100% { background-color: transparent; }
}

/* 结算卡片入场 */
@keyframes cardSlideIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-msg.system {
    align-self: center;
    max-width: 90%;
    text-align: center;
}
.chat-msg.system .msg-bubble {
    background: rgba(255,255,255,0.06);
    color: var(--gray-light);
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.chat-msg.system .msg-bubble.death {
    background: var(--danger-soft);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}
.chat-msg.system .msg-bubble.good-news {
    background: var(--success-soft);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.2);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}
.chat-msg.system .msg-bubble.round-start {
    background: var(--primary-glow);
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    padding: 14px 32px;
    border-color: rgba(124, 108, 240, 0.2);
    box-shadow: 0 2px 8px rgba(124, 108, 240, 0.15);
}

.chat-msg.self { align-self: flex-end; }
.chat-msg.other { align-self: flex-start; }
.chat-msg .msg-sender {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 4px;
    padding-left: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}
.chat-msg.self .msg-sender {
    text-align: right;
    padding-right: 6px;
    color: var(--primary);
}
.chat-msg .msg-bubble {
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}
.chat-msg .msg-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.chat-msg.other .msg-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
}
.chat-msg.self .msg-bubble {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-top-right-radius: 4px;
    box-shadow: 0 2px 8px var(--primary-glow);
}
.chat-msg.self .msg-bubble:hover {
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* 聊天输入 */
.chat-input-bar {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    position: relative;
}
.chat-input-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.chat-input-bar input {
    flex: 1;
    padding: 14px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--darkest);
    color: var(--white);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.chat-input-bar input:hover {
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.chat-input-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 2px 12px rgba(0,0,0,0.15);
    background: var(--surface-hover);
}
.chat-input-bar input::placeholder { color: var(--gray); }
.chat-input-bar .btn {
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}
.chat-input-bar .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* =============================================
   操作面板（左侧下半部分）
   ============================================= */
.action-panel {
    border-top: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
    min-height: 0;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-hover) 100%);
}

/* 阶段提示 */
.phase-hint {
    background: linear-gradient(135deg, var(--primary-glow), rgba(124, 108, 240, 0.15));
    color: var(--primary);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    text-align: center;
    animation: phaseIn 0.5s ease-out;
    border: 1px solid rgba(124, 108, 240, 0.2);
}
.phase-hint.wait-hint {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    color: var(--gray);
    animation: phaseIn 0.5s ease-out, waitPulse 2s infinite;
}

.action-panel h4 {
    font-size: 12px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 10px;
}

/* 角色卡片 */
.my-role-card {
    text-align: center;
    padding: 20px 16px;
    border-radius: var(--radius);
    border: 2px solid;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.my-role-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0.6;
}
.my-role-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.my-role-card .role-emoji { font-size: 40px; margin-bottom: 8px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.my-role-card .role-name { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.my-role-card .role-desc { font-size: 13px; color: var(--gray-light); line-height: 1.4; }
.my-role-card.werewolf { border-color: var(--danger); background: var(--danger-soft); }
.my-role-card.seer { border-color: var(--info); background: var(--info-soft); }
.my-role-card.witch { border-color: #a855f7; background: rgba(168, 85, 247, 0.08); }
.my-role-card.hunter { border-color: var(--warning); background: var(--warning-soft); }
.my-role-card.guard { border-color: var(--success); background: var(--success-soft); }
.my-role-card.villager { border-color: var(--gray); background: rgba(255,255,255,0.03); }

/* 行动按钮组 */
.action-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.action-btns .btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.action-btns .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* 目标选择列表 */
.target-list { list-style: none; }
.target-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 6px;
    border: 2px solid transparent;
    background: rgba(255,255,255,0.03);
    position: relative;
    overflow: hidden;
}
.target-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}
.target-item:hover::before {
    transform: translateX(100%);
}
.target-item:hover {
    background: rgba(255,255,255,0.06);
    transform: translateX(4px);
}
.target-item.selected {
    border-color: var(--primary);
    background: var(--primary-glow);
    box-shadow: 0 0 0 1px rgba(124, 108, 240, 0.2);
}
.target-item.dead { opacity: 0.3; pointer-events: none; }
.target-item .t-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
}
.target-item:hover .t-avatar {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.target-item .t-name {
    font-size: 15px;
    font-weight: 500;
    flex: 1;
}
.target-item.selected .t-name {
    font-weight: 600;
    color: var(--primary);
}

/* 投票结果 */
.vote-results {
    padding: 14px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}
.vote-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 13px;
}
.vote-result-item .v-name { flex: 1; font-weight: 500; }
.vote-result-item .v-count {
    font-weight: 700;
    color: var(--danger);
    min-width: 42px;
    text-align: right;
}
.vote-result-item .v-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    margin: 0 14px;
    overflow: hidden;
}
.vote-result-item .v-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger), #f87171);
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 等待室样式 */
.waiting-room {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 28px;
    text-align: center;
    padding: 24px;
}
.waiting-room .big-icon { font-size: 64px; filter: drop-shadow(0 0 16px rgba(255,71,87,0.3)); }
.waiting-room h2 { font-size: 26px; font-weight: 800; }
.waiting-room .player-avatars {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.waiting-room .p-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: var(--transition);
}
.waiting-room .p-avatar.empty {
    background: rgba(255,255,255,0.06);
    color: var(--gray);
    font-size: 24px;
    border: 2px dashed rgba(255,255,255,0.1);
    box-shadow: none;
}

/* 倒计时 */
.timer {
    font-size: 36px;
    font-weight: 800;
    color: var(--warning);
    font-variant-numeric: tabular-nums;
}

/* 游戏结束 */
.game-over-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: fadeIn 0.5s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.game-over-card {
    text-align: center;
    padding: 48px 40px;
    border-radius: 22px;
    background: var(--surface);
    border: 2px solid;
    max-width: 460px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: cardSlideIn 0.8s ease-out;
}
.game-over-card .result-icon { font-size: 72px; margin-bottom: 18px; animation: victory 1.5s ease-in-out; }
.game-over-card .result-text { font-size: 30px; font-weight: 800; margin-bottom: 10px; animation: fadeInUp 0.8s ease-out 0.3s both; }
.game-over-card.wolf-win { border-color: var(--danger); box-shadow: 0 0 30px rgba(239, 68, 68, 0.3); }
.game-over-card.good-win { border-color: var(--success); box-shadow: 0 0 30px rgba(34, 197, 94, 0.3); }
.game-over-card .reveal-list {
    text-align: left;
    margin: 28px 0;
    max-height: 400px;
    overflow-y: auto;
}
.game-over-card .reveal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}
.game-over-card .reveal-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}
.game-over-card .reveal-item:last-child {
    border-bottom: none;
}

/* =============================================
   Toast 通知
   ============================================= */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 14px 22px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1), fadeOut 0.3s ease 2.7s;
    box-shadow: var(--shadow);
    max-width: 360px;
    backdrop-filter: blur(12px);
}
.toast.error { background: rgba(239, 68, 68, 0.92); color: #fff; }
.toast.success { background: rgba(34, 197, 94, 0.92); color: #fff; }
.toast.info { background: rgba(59, 130, 246, 0.92); color: #fff; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* =============================================
   语音功能
   ============================================= */
.voice-btn {
    background: rgba(255,255,255,0.06) !important;
    border: 1.5px solid rgba(255,255,255,0.1) !important;
    font-size: 17px !important;
    padding: 0 !important;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.voice-btn:hover {
    background: var(--primary-glow) !important;
    border-color: var(--primary) !important;
}
.voice-btn.voice-active {
    background: var(--success-soft) !important;
    border-color: var(--success) !important;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.25);
    animation: voicePulse 2s infinite;
}
@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 16px rgba(34, 197, 94, 0.25); }
    50% { box-shadow: 0 0 24px rgba(34, 197, 94, 0.4); }
}

.voice-indicator {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    opacity: 0.35;
    transition: opacity 0.2s;
}
.voice-indicator.speaking { opacity: 1; }
.voice-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 16px;
}
.voice-wave::before,
.voice-wave::after,
.voice-wave span {
    content: '';
    display: block;
    width: 3px;
    height: 6px;
    background: var(--success);
    border-radius: 2px;
    animation: none;
}
.voice-indicator.speaking .voice-wave::before,
.voice-indicator.speaking .voice-wave::after {
    animation: wave 0.6s ease-in-out infinite;
}
.voice-indicator.speaking .voice-wave::after { animation-delay: 0.15s; }
@keyframes wave {
    0%, 100% { height: 4px; }
    50% { height: 14px; }
}
.voice-mute-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    margin-left: 2px;
    opacity: 0.7;
}
.voice-status-tip {
    font-size: 12px;
    color: var(--gray);
    text-align: center;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.voice-status-tip.connected { color: var(--success); }
.voice-status-tip.disconnected { color: var(--danger); }

/* 倒计时 */
.countdown {
    font-size: 17px;
    font-weight: 800;
    color: var(--warning);
    font-variant-numeric: tabular-nums;
    margin-left: auto;
    min-width: 42px;
    text-align: center;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* =============================================
   响应式 - 平板 ≤ 1024px
   ============================================= */
@media (max-width: 1024px) {
    .game-container {
        grid-template-columns: 300px 1fr;
    }
    .rooms-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* =============================================
   响应式 - 小平板 ≤ 900px
   ============================================= */
@media (max-width: 900px) {
    .game-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .player-panel {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 45vh;
    }
    .action-panel {
        max-height: none;
    }
    .rooms-grid { grid-template-columns: 1fr; }
    .navbar-user .username-text { display: none; }
    .navbar-user .stats-text { display: none; }
}

/* =============================================
   响应式 - 手机 ≤ 640px
   ============================================= */
@media (max-width: 640px) {
    html { font-size: 15px; }
    body { font-size: 14px; }

    /* 安全区域 */
    .navbar { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }

    /* 导航栏 */
    .navbar {
        padding: 10px 14px;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        gap: 8px;
    }
    .navbar-brand { font-size: 16px; }
    .navbar-brand .logo { font-size: 22px; }
    .navbar-user { gap: 8px; font-size: 12px; }
    .navbar-user .avatar { width: 32px; height: 32px; font-size: 13px; }
    .navbar-user .username-text { display: none; }
    .navbar-user .stats-text { display: none; }

    .btn { padding: 11px 18px; font-size: 14px; }
    .btn-sm { padding: 8px 14px; font-size: 13px; }
    .btn-lg { padding: 13px 26px; font-size: 15px; }

    /* 登录 */
    .login-card { max-width: 100%; padding: 32px 24px; }
    .login-card h1 { font-size: 32px; }
    .login-card .subtitle { font-size: 13px; margin-bottom: 28px; }
    .login-card .form-control { font-size: 16px; padding: 14px 18px; }

    /* 模态框 */
    .modal, .modal-card { padding: 24px 20px; width: 96%; max-width: none; border-radius: 16px; }
    .modal h3 { font-size: 18px; margin-bottom: 18px; }
    .modal-body { padding: 0 2px; }
    .profile-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-value { font-size: 16px; }

    /* 大厅 */
    .lobby-container { padding: 18px 14px; }
    .lobby-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .lobby-header h2 { font-size: 20px; }
    .lobby-stats { gap: 14px; font-size: 13px; }
    .rooms-grid { grid-template-columns: 1fr; gap: 12px; }
    .room-card { padding: 18px; }
    .room-card .room-name { font-size: 16px; }
    .room-card .room-meta { gap: 10px; font-size: 12px; }

    /* 表单 */
    .form-group { margin-bottom: 14px; }
    .form-control { padding: 13px 16px; font-size: 16px; }

    /* 游戏界面 */
    .player-panel h4 {
        padding: 14px 14px 0;
        font-size: 11px;
    }
    .seat-list {
        padding: 0 10px;
    }
    .seat-item {
        padding: 12px 14px;
        gap: 8px;
        margin-bottom: 6px;
    }
    .seat-item .seat-num {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    .seat-item .seat-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    .seat-item .seat-name {
        font-size: 13px;
    }
    .seat-item .seat-role {
        font-size: 10px;
        padding: 2px 6px;
    }
    .action-panel {
        padding: 16px 14px;
        gap: 12px;
    }
    .action-panel h4 {
        font-size: 11px;
        margin-bottom: 8px;
    }
    .my-role-card {
        padding: 16px 12px;
    }
    .my-role-card .role-emoji { font-size: 30px; margin-bottom: 6px; }
    .my-role-card .role-name { font-size: 15px; margin-bottom: 3px; }
    .my-role-card .role-desc { font-size: 12px; }
    .target-item {
        padding: 12px 14px;
        gap: 10px;
        margin-bottom: 5px;
    }
    .target-item .t-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    .target-item .t-name {
        font-size: 14px;
    }
    .action-btns {
        gap: 10px;
    }
    .action-btns .btn {
        padding: 11px 20px;
        font-size: 14px;
    }
    .chat-area {
        padding: 16px 16px;
        gap: 10px;
    }
    .chat-msg {
        max-width: 85%;
    }
    .chat-msg .msg-sender {
        font-size: 11px;
        margin-bottom: 3px;
    }
    .chat-msg .msg-bubble {
        padding: 10px 16px;
        font-size: 13px;
    }
    .chat-input-bar {
        padding: 14px 16px;
        gap: 8px;
    }
    .chat-input-bar input {
        padding: 12px 16px;
        font-size: 13px;
    }
    .chat-input-bar .btn {
        padding: 12px 18px;
        font-size: 14px;
    }
    .game-status-bar {
        padding: 12px 16px;
        gap: 10px;
        font-size: 14px;
    }
    .game-status-bar .phase-icon { font-size: 20px; }
    .countdown {
        font-size: 15px;
        min-width: 36px;
    }

    /* 游戏结束 */
    .game-over-card { padding: 32px 22px; }
    .game-over-card .result-icon { font-size: 56px; }
    .game-over-card .result-text { font-size: 24px; }

    /* Toast */
    .toast-container { top: 64px; right: 10px; left: 10px; }
    .toast { max-width: 100%; font-size: 13px; padding: 12px 18px; }
}

/* =============================================
   响应式 - 小屏手机 ≤ 380px
   ============================================= */
@media (max-width: 380px) {
    .login-card h1 { font-size: 28px; }
    .navbar-brand { font-size: 14px; }
    .waiting-room .p-avatar { width: 46px; height: 46px; font-size: 18px; }
    .game-over-card .result-text { font-size: 20px; }
    .game-over-card { padding: 28px 18px; }
    
    /* 游戏界面 - 小屏手机优化 */
    .player-panel h4 {
        padding: 12px 12px 0;
        font-size: 10px;
    }
    .seat-list {
        padding: 0 8px;
    }
    .seat-item {
        padding: 10px 12px;
        gap: 6px;
        margin-bottom: 4px;
    }
    .seat-item .seat-num {
        width: 20px;
        height: 20px;
        font-size: 9px;
    }
    .seat-item .seat-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    .seat-item .seat-name {
        font-size: 12px;
    }
    .seat-item .seat-role {
        font-size: 9px;
        padding: 1px 4px;
    }
    .action-panel {
        padding: 14px 12px;
        gap: 10px;
    }
    .action-panel h4 {
        font-size: 10px;
        margin-bottom: 6px;
    }
    .my-role-card {
        padding: 14px 10px;
    }
    .my-role-card .role-emoji { font-size: 28px; margin-bottom: 4px; }
    .my-role-card .role-name { font-size: 14px; margin-bottom: 2px; }
    .my-role-card .role-desc { font-size: 11px; }
    .target-item {
        padding: 10px 12px;
        gap: 8px;
        margin-bottom: 4px;
    }
    .target-item .t-avatar {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
    .target-item .t-name {
        font-size: 13px;
    }
    .action-btns .btn {
        padding: 10px 18px;
        font-size: 13px;
    }
    .chat-area {
        padding: 14px 14px;
        gap: 8px;
    }
    .chat-msg .msg-sender {
        font-size: 10px;
        margin-bottom: 2px;
    }
    .chat-msg .msg-bubble {
        padding: 8px 14px;
        font-size: 12px;
    }
    .chat-input-bar {
        padding: 12px 14px;
        gap: 6px;
    }
    .chat-input-bar input {
        padding: 10px 14px;
        font-size: 12px;
    }
    .chat-input-bar .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    .game-status-bar {
        padding: 10px 14px;
        gap: 8px;
        font-size: 13px;
    }
    .game-status-bar .phase-icon { font-size: 18px; }
    .countdown {
        font-size: 14px;
        min-width: 32px;
    }
    .mobile-tab {
        padding: 8px 2px;
        font-size: 10px;
    }
    .mobile-tab .tab-icon { font-size: 18px; }
}

/* =============================================
   移动端游戏 Tab 布局
   ============================================= */
@media (max-width: 900px) {
    .mobile-tabs {
        display: flex !important;
        border-top: 1px solid var(--border);
        background: var(--surface);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 150;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .mobile-tab {
        flex: 1;
        padding: 10px 4px;
        text-align: center;
        font-size: 11px;
        color: var(--gray);
        cursor: pointer;
        transition: var(--transition);
        border: none;
        background: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        font-family: var(--font);
        font-weight: 500;
        position: relative;
    }
    .mobile-tab.active { color: var(--primary); }
    .mobile-tab .tab-icon { font-size: 20px; }
    .mobile-tab.active::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 20%;
        right: 20%;
        height: 2px;
        background: var(--primary);
        border-radius: 2px 2px 0 0;
    }

    /* 技能Tab角标 */
    .mobile-tab .skill-badge {
        position: absolute;
        top: 4px;
        right: 25%;
        width: 8px;
        height: 8px;
        background: var(--danger);
        border-radius: 50%;
        animation: pulse 1.5s infinite;
    }

    .game-container {
        height: calc(100vh - 60px - 52px) !important;
    }

    #game-view .game-container {
        display: block !important;
        position: relative;
    }
    #game-view .player-panel,
    #game-view .main-area,
    #game-view .action-panel {
        display: none !important;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border: none;
        max-height: none;
    }
    #game-view .player-panel.mobile-active,
    #game-view .main-area.mobile-active,
    #game-view .action-panel.mobile-active {
        display: flex !important;
    }
    #game-view .main-area.mobile-active { flex-direction: column; }
    #game-view .action-panel.mobile-active {
        flex-direction: column;
        overflow-y: auto;
    }
    #game-view .player-panel.mobile-active {
        overflow-y: auto;
        max-height: none;
    }
}

/* 桌面端隐藏移动 Tab */
.mobile-tabs { display: none; }

/* =============================================
   抽牌洗牌动画
   ============================================= */

/* 洗牌动画容器 */
.shuffle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    min-height: 400px;
}

/* 牌堆容器 */
.deck-container {
    position: relative;
    width: 180px;
    height: 250px;
}

/* 单张牌 */
.card {
    position: absolute;
    width: 180px;
    height: 250px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2d2d44 0%, #1c1c28 100%);
    border: 3px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    transition: all 0.3s ease;
}

/* 牌背面 */
.card-back {
    background: linear-gradient(135deg, #4a3f8c 0%, #2d235c 50%, #1a143a 100%);
    border-color: #7c6cf0;
}

.card-back::before {
    content: '🃏';
    font-size: 70px;
}

/* 洗牌动画 */
@keyframes shuffle {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    25% { transform: rotate(-5deg) translateY(-10px); }
    50% { transform: rotate(5deg) translateY(0); }
    75% { transform: rotate(-3deg) translateY(5px); }
}

/* 牌展开动画 */
@keyframes spread {
    0% { transform: translateX(0) rotate(0deg) scale(1); }
    100% { transform: translateX(var(--tx)) rotate(var(--rot)) scale(0.8); }
}

/* 抽牌动画 */
@keyframes drawCard {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-100px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-200px) scale(1.5); opacity: 0; }
}

/* 角色卡翻转动画 */
@keyframes flipCard {
    0% { transform: perspective(1000px) rotateY(0deg); }
    50% { transform: perspective(1000px) rotateY(90deg); }
    100% { transform: perspective(1000px) rotateY(0deg); }
}

/* 角色卡显示动画 */
@keyframes revealCard {
    0% { opacity: 0; transform: scale(0.5) rotateY(180deg); }
    50% { opacity: 1; transform: scale(1.1) rotateY(90deg); }
    100% { opacity: 1; transform: scale(1) rotateY(0deg); }
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 洗牌状态的牌 */
.shuffle-container .card {
    animation: shuffle 1.2s ease-in-out infinite;
}

.shuffle-container .card:nth-child(2) {
    animation-delay: 0.1s;
    top: 5px;
    left: 5px;
}

.shuffle-container .card:nth-child(3) {
    animation-delay: 0.2s;
    top: 10px;
    left: 10px;
}

.shuffle-container .card:nth-child(4) {
    animation-delay: 0.3s;
    top: 15px;
    left: 15px;
}

.shuffle-container .card:nth-child(5) {
    animation-delay: 0.4s;
    top: 20px;
    left: 20px;
}

/* 展开的牌堆 */
.deck-spread {
    display: flex;
    gap: -20px;
    justify-content: center;
    position: relative;
    margin: 40px 0;
}

.deck-spread .card {
    position: relative;
    animation: spread 0.6s ease-out forwards;
    animation-delay: var(--delay);
}

/* 抽牌遮罩 */
.draw-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 17, 24, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* 你的角色卡 */
.your-role-card {
    width: 220px;
    height: 310px;
    border-radius: 20px;
    background: linear-gradient(135deg, #2d2d44 0%, #1c1c28 100%);
    border: 4px solid var(--primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--primary-glow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    animation: revealCard 0.8s ease-out;
}

.your-role-card .role-emoji {
    font-size: 80px;
    animation: pulse 2s ease-in-out infinite;
}

.your-role-card .role-name {
    font-size: 28px;
    font-weight: 800;
    color: var(--white);
}

.your-role-card .role-desc {
    font-size: 14px;
    color: var(--gray-light);
    text-align: center;
    padding: 0 20px;
}

/* 狼人角色卡样式 */
.your-role-card.role-werewolf {
    border-color: var(--danger);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(239, 68, 68, 0.3);
}

/* 预言家角色卡样式 */
.your-role-card.role-seer {
    border-color: var(--info);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(59, 130, 246, 0.3);
}

/* 女巫角色卡样式 */
.your-role-card.role-witch {
    border-color: var(--warning);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(245, 158, 11, 0.3);
}

/* 继续按钮 */
.continue-btn {
    margin-top: 40px;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 700;
    animation: pulse 2s ease-in-out infinite;
}

/* 抽牌文字 */
.draw-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 30px;
    text-align: center;
}

.draw-subtext {
    font-size: 14px;
    color: var(--gray);
    margin-top: 10px;
}
