/* ═══════════════════════════════════════════════
   Game Mode Styles — Werewolf (狼人杀)
   ═══════════════════════════════════════════════ */

/* ── Game Creation Panel ── */
.game-rules-card {
    margin-bottom: 16px;
    border-radius: 14px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(139, 92, 246, 0.25);
    position: relative;
    overflow: hidden;
}

.game-rules-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 70%);
    pointer-events: none;
}

.game-rules-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.game-rules-icon {
    font-size: 24px;
}

.game-rules-title {
    font-size: 15px;
    font-weight: 700;
    color: #c4b5fd;
    letter-spacing: 0.5px;
}

.game-rules-body p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.game-roles-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.game-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.game-role-chip.wolf {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.game-role-chip.good {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.game-player-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    font-weight: 500;
    color: var(--gold, #f5a623);
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.game-player-hint i {
    font-size: 15px;
    opacity: 0.8;
}

/* ── Game Type Selector (Card Grid) ── */
.game-type-selector {
    margin-bottom: 16px;
}

.game-type-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e5e7eb);
    margin-bottom: 10px;
}

.game-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.game-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.game-type-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(139, 92, 246, 0.06));
    opacity: 0;
    transition: opacity 0.3s;
}

.game-type-card:hover:not(.coming-soon) {
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.game-type-card:hover:not(.coming-soon)::before {
    opacity: 1;
}

.game-type-card.active {
    border-color: rgba(139, 92, 246, 0.6);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.2), inset 0 0 12px rgba(139, 92, 246, 0.05);
    transform: translateY(-2px);
}

.game-type-card.active::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 11px;
    font-weight: 800;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.3);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-type-card.coming-soon {
    cursor: not-allowed;
    opacity: 0.45;
    filter: grayscale(0.4);
}

.game-type-card.coming-soon:hover {
    opacity: 0.55;
}

.game-type-icon-wrap {
    position: relative;
    z-index: 1;
}

.game-type-icon {
    font-size: 28px;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.game-type-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, #e5e7eb);
    position: relative;
    z-index: 1;
}

.game-type-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
}

.game-type-players {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 3px;
    position: relative;
    z-index: 1;
}

.game-type-players i {
    font-size: 9px;
}

.game-type-badge {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(251, 191, 36, 0.15));
    color: #fde68a;
    letter-spacing: 0.5px;
    white-space: nowrap;
    z-index: 2;
}

/* Sub-panel animation */
.game-sub-panel {
    animation: subPanelSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes subPanelSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 400px) {
    .game-type-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .game-type-card {
        padding: 10px 4px 8px;
    }
    .game-type-icon {
        font-size: 22px;
    }
    .game-type-name {
        font-size: 11px;
    }
}

/* ═══ Day/Night Body Atmosphere ═══ */
body.game-night {
    transition: background-color 2s ease;
    background-color: #0a0a1a !important;
}

body.game-night .live-subtitle-text,
body.game-night .live-subtitle {
    background: rgba(10, 10, 40, 0.85) !important;
    border-color: rgba(99, 102, 200, 0.2) !important;
}

body.game-day {
    transition: background-color 2s ease;
}

/* ═══ Night/Day Transition Vignette ═══ */
body.game-night::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(10, 10, 40, 0.4) 100%);
    animation: nightVignetteIn 2s ease forwards;
}

body.game-day::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(255, 200, 100, 0.08) 100%);
    animation: dayVignetteIn 1.5s ease forwards;
}

@keyframes nightVignetteIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes dayVignetteIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ═══ Game Overlay Container (Sidebar within chat-main) ═══ */

/* When game sidebar is active, shrink main content to make room */
.chat-main.has-game-sidebar > .messages-container {
    margin-right: 290px;
}

.chat-main.has-game-sidebar + .live-controls {
    margin-right: 290px;
}

#game-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    overflow-y: auto;
    transition: background 1.5s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 10;
}

#game-overlay.night-mode {
    background: linear-gradient(180deg, rgba(10, 10, 40, 0.92) 0%, rgba(20, 15, 50, 0.85) 100%);
    box-shadow: -4px 0 30px rgba(99, 102, 241, 0.1);
}

#game-overlay.day-mode {
    background: linear-gradient(180deg, rgba(30, 25, 20, 0.92) 0%, rgba(40, 30, 20, 0.85) 100%);
    box-shadow: -4px 0 30px rgba(245, 158, 11, 0.08);
}

/* ═══ Phase Indicator Header ═══ */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 14px;
    backdrop-filter: blur(16px);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.game-phase-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-phase-indicator.phase-night {
    background: linear-gradient(135deg, #1a1a4e, #2d1b69);
    color: #c4b5fd;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3), inset 0 0 20px rgba(139, 92, 246, 0.1);
}

.game-phase-indicator.phase-day,
.game-phase-indicator.phase-dawn {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3), inset 0 0 20px rgba(245, 158, 11, 0.1);
}

.game-phase-indicator.phase-vote {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.game-phase-indicator.phase-over {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.phase-icon {
    font-size: 20px;
    filter: drop-shadow(0 0 4px currentColor);
}

.game-round {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-weight: 500;
}

/* ═══ Role Card — Premium Glass ═══ */
.game-role-card {
    padding: 20px;
    border-radius: 16px;
    backdrop-filter: blur(16px);
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.5), rgba(20, 20, 40, 0.4));
    border: 2px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.game-role-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(139, 92, 246, 0.06) 25%, transparent 50%, rgba(245, 158, 11, 0.06) 75%, transparent 100%);
    animation: roleCardShimmer 8s linear infinite;
    pointer-events: none;
}

@keyframes roleCardShimmer {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.role-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.role-badge {
    font-size: 40px;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.2));
    animation: roleBadgePulse 3s ease-in-out infinite;
}

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

.role-name {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.role-team {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.9;
}

/* ═══ Players Bar ═══ */
.game-players-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    border-radius: 14px;
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.player-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-avatar-small {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.player-chip.alive {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.player-chip.dead {
    background: rgba(239, 68, 68, 0.1);
    color: rgba(252, 165, 165, 0.6);
    border: 1px solid rgba(239, 68, 68, 0.15);
    opacity: 0.5;
    text-decoration: line-through;
    filter: grayscale(0.5);
}

.player-chip.speaking {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(251, 191, 36, 0.15));
    border-color: rgba(245, 158, 11, 0.5);
    color: #fde68a;
    animation: speaker-glow 1s ease-in-out infinite alternate;
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.player-chip.thinking {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.12));
    border-color: rgba(139, 92, 246, 0.45);
    color: #c4b5fd;
    animation: thinking-pulse 1.8s ease-in-out infinite;
    position: relative;
}

.player-chip.thinking::after {
    content: '💭';
    position: absolute;
    top: -6px;
    right: -4px;
    font-size: 10px;
    animation: thinking-bubble 2s ease-in-out infinite;
}

@keyframes thinking-pulse {
    0%, 100% { 
        box-shadow: 0 0 6px rgba(139, 92, 246, 0.15);
        opacity: 0.85;
    }
    50% {
        box-shadow: 0 0 18px rgba(139, 92, 246, 0.4);
        opacity: 1;
    }
}

@keyframes thinking-bubble {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

.player-status {
    font-size: 10px;
}

.wolf-tag-icon svg,
.seer-tag-icon svg {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    margin-left: 6px;
    margin-bottom: 2px;
    display: inline-block;
}

.seer-tag-icon svg {
    opacity: 0.9;
    filter: drop-shadow(0 0 4px rgba(68, 136, 255, 0.4));
}

.ai-badge {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    font-weight: 600;
}

.human-badge {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(251, 191, 36, 0.25));
    color: #fde68a;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ═══ Vote Panel ═══ */
.game-vote-panel {
    padding: 16px;
    border-radius: 16px;
    backdrop-filter: blur(16px);
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.12), rgba(220, 38, 38, 0.06));
    border: 1px solid rgba(239, 68, 68, 0.25);
    animation: voteSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes voteSlideIn {
    from { opacity: 0; transform: translateY(15px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.vote-title {
    font-size: 16px;
    font-weight: 700;
    color: #fca5a5;
    margin-bottom: 12px;
    text-align: center;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.vote-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vote-btn {
    padding: 10px 16px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.1);
    color: #fecaca;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.vote-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(239, 68, 68, 0.1));
    opacity: 0;
    transition: opacity 0.25s;
}

.vote-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.vote-btn:hover::before {
    opacity: 1;
}

.vote-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ═══ Action Panel ═══ */
.game-action-panel {
    padding: 16px;
    border-radius: 16px;
    backdrop-filter: blur(16px);
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.06));
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.action-title {
    font-size: 16px;
    font-weight: 700;
    color: #a5b4fc;
    margin-bottom: 12px;
    text-align: center;
}

.action-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-action-btn {
    padding: 10px 16px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    color: #c7d2fe;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-action-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.game-action-btn.pass-btn {
    background: rgba(107, 114, 128, 0.1);
    border-color: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* ═══ Game Log — Enhanced ═══ */
.game-log-panel {
    flex: 1;
    min-height: 140px;
    max-height: 240px;
    padding: 12px;
    border-radius: 14px;
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.log-title {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.log-entries {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.log-entry {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-left: 2px solid rgba(99, 102, 241, 0.3);
    animation: logEntrySlide 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.4;
}

@keyframes logEntrySlide {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ═══ Game Over Screen ═══ */
.game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(24px);
    z-index: 2000;
    animation: gameOverFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes gameOverFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-over-title {
    font-size: 36px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 32px;
    text-shadow: 0 0 40px rgba(245, 158, 11, 0.5);
    animation: gameOverTitlePop 0.6s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes gameOverTitlePop {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

.game-over-roles {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.reveal-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 16px;
    color: #e5e7eb;
    animation: revealSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.reveal-row:nth-child(1) { animation-delay: 0.4s; }
.reveal-row:nth-child(2) { animation-delay: 0.5s; }
.reveal-row:nth-child(3) { animation-delay: 0.6s; }
.reveal-row:nth-child(4) { animation-delay: 0.7s; }
.reveal-row:nth-child(5) { animation-delay: 0.8s; }
.reveal-row:nth-child(6) { animation-delay: 0.9s; }
.reveal-row:nth-child(7) { animation-delay: 1.0s; }

@keyframes revealSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.reveal-row.dead {
    opacity: 0.45;
}

.reveal-name {
    font-weight: 700;
    min-width: 80px;
}

.reveal-role {
    color: #a5b4fc;
    font-weight: 600;
}

.game-over-btn {
    padding: 14px 36px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    animation: gameOverTitlePop 0.5s 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.game-over-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

/* ═══ Animations ═══ */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.5); }
}

@keyframes speaker-glow {
    from { box-shadow: 0 0 8px rgba(245, 158, 11, 0.15); }
    to { box-shadow: 0 0 20px rgba(245, 158, 11, 0.4); }
}

.slide-in {
    animation: voteSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
    .chat-main.has-game-sidebar > .messages-container,
    .chat-main.has-game-sidebar > .live-controls {
        margin-right: 0;
    }

    #game-overlay {
        width: 100%;
        height: auto;
        max-height: 40vh;
        bottom: 0;
        top: auto;
        border-radius: 20px 20px 0 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
    }

    .game-over-title {
        font-size: 24px;
    }

    .game-role-card {
        padding: 14px;
    }

    .role-badge {
        font-size: 32px;
    }
}

/* ═══ Human Action Prompt ═══ */
.game-action-prompt {
    animation: promptSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.human-prompt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    backdrop-filter: blur(16px);
    animation: promptSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.human-prompt.speech-prompt {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(251, 191, 36, 0.08));
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.human-prompt.vote-prompt-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(220, 38, 38, 0.08));
    border: 1.5px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

@keyframes promptSlideIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.prompt-icon {
    font-size: 28px;
    flex-shrink: 0;
    animation: promptIconPulse 2s ease-in-out infinite;
}

@keyframes promptIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.prompt-body {
    flex: 1;
    min-width: 0;
}

.prompt-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.prompt-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.3;
}

.prompt-countdown {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.prompt-action-btn {
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.prompt-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* ═══ Vote Panel Enhancements ═══ */
.vote-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.vote-countdown {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.4);
    font-size: 13px;
    font-weight: 800;
    color: #fca5a5;
    font-variant-numeric: tabular-nums;
}

.vote-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vote-btn-name {
    font-weight: 600;
}

.vote-btn-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-weight: 600;
}

/* ═══ Chat Input Pulse (when human's turn) ═══ */
.game-input-active {
    animation: chatInputPulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
}

@keyframes chatInputPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.15); }
    50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.4); }
}

/* ═══ Phase Guide Banners ═══ */
.phase-guide.night-guide {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(79, 70, 229, 0.08));
    border: 1.5px solid rgba(99, 102, 241, 0.35);
}

.phase-guide.day-guide {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(234, 179, 8, 0.06));
    border: 1.5px solid rgba(245, 158, 11, 0.3);
}

.phase-guide.vote-guide {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.06));
    border: 1.5px solid rgba(239, 68, 68, 0.3);
}

/* ═══ Secret Message Syling ═══ */
.live-lyrics-line.secret-message-wolf,
.message.secret-message-wolf .bubble {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(185, 28, 28, 0.05)) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    box-shadow: inset 0 0 15px rgba(239, 68, 68, 0.1) !important;
    position: relative;
    /* overflow: hidden removed to prevent clipping of absolute pseudo-elements/children */
}

.live-lyrics-line.secret-message-wolf::before,
.message.secret-message-wolf .bubble::before {
    content: '🐺 狼人秘密频道';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    font-size: 32px;
    font-weight: 900;
    color: rgba(239, 68, 68, 0.04);
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
}

.secret-message-wolf .content,
.secret-message-wolf .bubble,
.secret-message-wolf .live-lyrics-text,
.secret-message-wolf .sender,
.secret-message-wolf .live-lyrics-meta {
    position: relative;
    z-index: 10; /* Elevated z-index to ensure text is solidly above the watermark */
    opacity: 1 !important;
    visibility: visible !important;
}

.secret-message-wolf .sender,
.secret-message-wolf .live-lyrics-meta {
    color: #fca5a5 !important;
    font-weight: bold;
}

/* SVG Icon Base Stylings */
.svg-icon {
    width: 1.25em;
    height: 1.25em;
    vertical-align: -0.2em;
    fill: currentColor;
    stroke: currentColor;
    display: inline-block;
    transition: transform 0.2s, fill 0.2s, stroke 0.2s;
}

/* Image-based role icons override */
img.role-icon-img {
    border-radius: 50%;
    object-fit: cover;
    background: transparent;
    border: none;
    fill: none;
    stroke: none;
    box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

/* Specifically adjust player chip svgs */
.player-chip .svg-icon,
.game-over-roles .svg-icon,
.log-entry .svg-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
}

/* Let the role card icons be slightly larger */
.role-badge .svg-icon {
    width: 2.5em;
    height: 2.5em;
    vertical-align: middle;
}

/* ═══ Wolf Secret Message Visibility ═══ 
   JS now sets opacity:1 immediately for secret messages.
   These CSS rules ensure visibility even when container has hidden-text class. */
.messages-container.hidden-text .live-lyrics-line.secret-message-wolf,
.messages-container.hidden-text .message.secret-message-wolf .bubble {
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    transform: scale(1) translateY(0) !important;
    pointer-events: auto !important;
}

.live-lyrics-line.secret-message-wolf .live-lyrics-text,
.message.secret-message-wolf .content {
    opacity: 1 !important;
    visibility: visible !important;
    color: #ffffff !important;
    display: block !important;
    z-index: 10;
    position: relative;
}

/* User messages also override hidden-text */
.messages-container.hidden-text .message.user .bubble {
    opacity: 1 !important;
    filter: none !important;
}

