/* ====================================
   MA SÓI ONLINE - 3D Dark Theme CSS
   ==================================== */

/* ============ RESET & BASE ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #111133;
    --bg-card: rgba(20, 20, 60, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --text-primary: #e8e8ff;
    --text-secondary: #9999cc;
    --text-muted: #666699;
    --accent-purple: #7b2fbe;
    --accent-blue: #2563eb;
    --accent-red: #dc2626;
    --accent-green: #16a34a;
    --accent-gold: #f59e0b;
    --accent-pink: #ec4899;
    --glow-purple: 0 0 20px rgba(123, 47, 190, 0.5);
    --glow-blue: 0 0 20px rgba(37, 99, 235, 0.5);
    --glow-red: 0 0 20px rgba(220, 38, 38, 0.5);
    --glow-green: 0 0 20px rgba(22, 163, 74, 0.5);
    --glow-gold: 0 0 20px rgba(245, 158, 11, 0.5);
    --border-glass: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
    --font-title: 'Creepster', cursive;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-3d: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    perspective: 1000px;
}

/* ============ PARTICLES & FOG ============ */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, rgba(123, 47, 190, 0.6), transparent);
    border-radius: 50%;
    animation: particleFloat 5s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-30px) scale(1.5);
        opacity: 0.8;
    }
}

.fog {
    position: fixed;
    width: 200%;
    height: 200px;
    bottom: -50px;
    left: -50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.15;
}

.fog-1 {
    background: linear-gradient(transparent, rgba(123, 47, 190, 0.3));
    animation: fogMove 15s ease-in-out infinite;
}

.fog-2 {
    background: linear-gradient(transparent, rgba(37, 99, 235, 0.2));
    animation: fogMove 20s ease-in-out infinite reverse;
    bottom: -30px;
}

@keyframes fogMove {
    0%, 100% { transform: translateX(-10%); }
    50% { transform: translateX(10%); }
}

/* ============ GLASSMORPHISM ============ */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    box-shadow: var(--shadow-3d);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(123, 47, 190, 0.1);
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: white;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.btn:hover::after {
    left: 100%;
}

.btn-3d {
    transform: perspective(500px) translateZ(0);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
}

.btn-3d:hover {
    transform: perspective(500px) translateZ(10px) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4), 0 4px 8px rgba(0,0,0,0.3);
}

.btn-3d:active {
    transform: perspective(500px) translateZ(-5px) translateY(1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
}

.btn-primary:hover {
    background: linear-gradient(135deg, #8b3fd4, #3b82f6);
}

.btn-secondary {
    background: linear-gradient(135deg, #374151, #1f2937);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green), #059669);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red), #b91c1c);
}

.btn-join {
    background: linear-gradient(135deg, var(--accent-gold), #d97706);
}

.btn-create {
    background: linear-gradient(135deg, var(--accent-purple), #6d28d9);
    padding: 20px 30px;
    flex-direction: column;
    width: 100%;
}

.btn-glow {
    animation: btnGlow 2s ease-in-out infinite;
}

@keyframes btnGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(123, 47, 190, 0.3); }
    50% { box-shadow: 0 4px 30px rgba(123, 47, 190, 0.6), 0 0 40px rgba(123, 47, 190, 0.2); }
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-copy {
    background: rgba(255,255,255,0.1);
    padding: 6px 12px;
    font-size: 1.2rem;
}

.btn-icon { font-size: 1.5rem; }
.btn-label { font-size: 1.1rem; font-weight: 700; }
.btn-desc { font-size: 0.8rem; opacity: 0.7; }

.pulse-btn {
    animation: pulseBtn 2s ease-in-out infinite;
}

@keyframes pulseBtn {
    0%, 100% { transform: perspective(500px) translateZ(0) scale(1); }
    50% { transform: perspective(500px) translateZ(5px) scale(1.02); }
}

/* ============ INPUTS ============ */
input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(123, 47, 190, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.input-group input {
    flex: 1;
}

.input-group .btn {
    white-space: nowrap;
}

/* ============ LANDING PAGE ============ */
.landing-page {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1040 50%, #0a0a2a 100%);
}

.landing-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    position: relative;
    z-index: 2;
}

.landing-header {
    text-align: center;
    position: relative;
}

.moon-glow {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: moonPulse 4s ease-in-out infinite;
}

@keyframes moonPulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.6; }
    50% { transform: translateX(-50%) scale(1.2); opacity: 1; }
}

.game-title {
    font-family: var(--font-title);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.title-icon {
    font-size: 4rem;
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.5));
    animation: wolfFloat 3s ease-in-out infinite;
}

@keyframes wolfFloat {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.title-text {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #f59e0b, #ef4444, #f59e0b);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    text-shadow: none;
    letter-spacing: 4px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.title-sub {
    font-size: 1.8rem;
    color: var(--accent-purple);
    letter-spacing: 12px;
    text-shadow: 0 0 30px rgba(123, 47, 190, 0.5);
}

.tagline {
    color: var(--text-secondary);
    margin-top: 10px;
    font-size: 0.95rem;
}

.landing-card {
    width: 100%;
    padding: 30px;
    text-align: center;
}

.landing-card h2 {
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.highlight {
    color: var(--accent-gold);
    font-weight: 700;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.divider-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 5px 0;
}

.join-section {
    width: 100%;
}

.landing-footer {
    text-align: center;
}

.role-showcase {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 10px;
}

.role-badge {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    cursor: help;
    transition: var(--transition);
    animation: roleFloat 3s ease-in-out infinite;
}

.role-badge:nth-child(2n) { animation-delay: 0.5s; }
.role-badge:nth-child(3n) { animation-delay: 1s; }
.role-badge:nth-child(4n) { animation-delay: 1.5s; }

@keyframes roleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.role-badge:hover {
    transform: scale(1.3) translateY(-5px);
}

.credits {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ LOADING ============ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ ERROR TOAST ============ */
.error-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: 2000;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
    animation: slideDown 0.3s ease-out;
    max-width: 90%;
    text-align: center;
}

.notification-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(20, 10, 50, 0.95), rgba(30, 15, 70, 0.95));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    padding: 18px 32px;
    border-radius: 16px;
    border: 2px solid rgba(138, 43, 226, 0.5);
    font-weight: 600;
    font-size: 1.05rem;
    z-index: 2000;
    box-shadow: 0 0 30px rgba(123, 47, 190, 0.4), 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: notifCenter 0.4s ease-out;
    max-width: 85%;
    text-align: center;
    pointer-events: none;
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes notifCenter {
    from { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ============ LOBBY VIEW ============ */
.game-page {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1040 50%, #0a0a2a 100%);
}

.view-container {
    position: relative;
    z-index: 2;
}

.lobby-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 100vh;
}

.lobby-header {
    padding: 25px;
    text-align: center;
}

.lobby-title {
    font-family: var(--font-title);
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.room-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.room-code-display .label {
    color: var(--text-secondary);
}

.code-value {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--accent-gold);
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
    font-family: monospace;
}

.player-count {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.lobby-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    padding: 10px;
}

.lobby-player-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 15px 10px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    animation: cardAppear 0.4s ease-out;
    overflow: hidden;
    min-height: 90px;
    max-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

@keyframes cardAppear {
    from { opacity: 0; transform: scale(0.8) rotateY(20deg); }
    to { opacity: 1; transform: scale(1) rotateY(0); }
}

.lobby-player-card:hover {
    transform: perspective(500px) rotateY(5deg) translateY(-5px);
    box-shadow: 0 10px 30px rgba(123, 47, 190, 0.2);
    border-color: var(--accent-purple);
}

.lobby-player-card.is-host {
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.lobby-player-card.is-bot {
    border-color: rgba(99, 102, 241, 0.3);
}

.lobby-player-card .player-avatar {
    font-size: 2rem;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    position: relative;
}

.player-card-name {
    font-weight: 600;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    line-height: 1.2;
}

.player-card-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 5px;
}

.badge-host {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-bot {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.kick-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 38, 38, 0.2);
    border: none;
    color: var(--accent-red);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: var(--transition);
}

.lobby-player-card:hover .kick-btn {
    opacity: 1;
}

.lobby-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.lobby-info {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.empty-slot {
    border: 2px dashed rgba(255,255,255,0.1);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    min-height: 90px;
    max-height: 150px;
    cursor: default;
}

/* ============ GAME VIEW ============ */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    margin: 10px;
    position: sticky;
    top: 10px;
    z-index: 10;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-badge, .day-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
}

.day-badge {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-gold);
    border-color: rgba(245, 158, 11, 0.2);
}

.phase-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.phase-icon {
    font-size: 1.4rem;
    animation: phaseIconPulse 2s ease-in-out infinite;
}

@keyframes phaseIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    font-weight: 700;
    font-family: monospace;
    font-size: 1.1rem;
}

.timer-display.warning {
    animation: timerBlink 0.5s ease-in-out infinite;
    background: rgba(220, 38, 38, 0.2);
}

@keyframes timerBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.game-layout {
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    gap: 15px;
    padding: 0 10px 10px;
    min-height: calc(100vh - 80px);
    align-items: start;
}

/* Players Panel */
.players-panel {
    padding: 15px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.panel-title {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.player-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
}

.player-item.is-dead {
    opacity: 0.4;
    text-decoration: line-through;
}

.player-item.is-me {
    border-color: var(--accent-purple);
    background: rgba(123, 47, 190, 0.1);
}

.player-item.is-wolf-team {
    border-color: rgba(220, 38, 38, 0.3);
}

.player-item.is-lover {
    border-color: rgba(236, 72, 153, 0.3);
}

.player-item.selected {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.1);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.player-item-icon {
    font-size: 1.1rem;
    width: 28px;
    height: 28px;
    min-width: 28px;
    max-width: 28px;
    min-height: 28px;
    max-height: 28px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    position: relative;
}

.player-item-icon img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50%;
    pointer-events: none;
}

.player-item-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-item-role {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
}

.player-item-status {
    font-size: 0.9rem;
}

.vote-indicator {
    position: absolute;
    right: 5px;
    top: 5px;
    font-size: 0.65rem;
    background: rgba(245, 158, 11, 0.15);
    padding: 1px 5px;
    border-radius: 6px;
    color: var(--accent-gold);
}

/* Main Game Area */
.game-main {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.role-card-wrapper {
    perspective: 800px;
}

.role-card {
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.role-card:hover {
    transform: rotateY(5deg) rotateX(2deg);
}

.role-card-inner {
    display: flex;
    align-items: center;
    gap: 15px;
}

.role-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
    animation: roleIconFloat 3s ease-in-out infinite;
}

@keyframes roleIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.role-name {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: var(--font-title);
    letter-spacing: 2px;
}

.role-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

.narration-box {
    padding: 20px;
    position: relative;
    overflow: hidden;
    min-height: 80px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.narration-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-purple), var(--accent-blue));
    border-radius: 2px;
}

.narration-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.narration-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    font-style: italic;
}

.action-area {
    padding: 20px;
    border: 2px solid rgba(123, 47, 190, 0.3);
    animation: actionGlow 2s ease-in-out infinite;
}

@keyframes actionGlow {
    0%, 100% { border-color: rgba(123, 47, 190, 0.3); }
    50% { border-color: rgba(123, 47, 190, 0.6); box-shadow: 0 0 20px rgba(123, 47, 190, 0.2); }
}

.action-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--accent-gold);
}

.action-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.action-player-btn {
    padding: 10px 8px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-family: var(--font-main);
    font-size: 0.82rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.action-player-btn .avatar-frame--action,
.action-player-btn img {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    max-width: 28px;
    max-height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.action-player-btn img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    pointer-events: none;
}

.action-player-btn:hover {
    background: rgba(123, 47, 190, 0.2);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.action-player-btn.selected {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.action-player-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.action-submit-btn {
    margin-top: 10px;
    align-self: center;
}

.action-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 5px;
}

.witch-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.witch-action-group {
    padding: 15px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
}

.witch-action-group h4 {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.seer-results {
    padding: 15px;
}

.seer-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
}

.seer-result-item.is-wolf {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.seer-result-item.is-good {
    background: rgba(22, 163, 74, 0.15);
    border: 1px solid rgba(22, 163, 74, 0.3);
}

/* Chat Panel */
.chat-panel {
    padding: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow: hidden;
}

.chat-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-glass);
}

.chat-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.chat-tab.active {
    color: var(--accent-purple);
    border-bottom: 2px solid var(--accent-purple);
    background: rgba(123, 47, 190, 0.05);
}

.chat-tab:hover {
    background: rgba(255,255,255,0.03);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 300px;
    max-height: calc(100vh - 220px);
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.log-item {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    line-height: 1.4;
    animation: logAppear 0.3s ease-out;
}

@keyframes logAppear {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.log-item.log-narrator {
    background: rgba(123, 47, 190, 0.1);
    border-left: 3px solid var(--accent-purple);
    color: #c4b5fd;
}

.log-item.log-system {
    background: rgba(37, 99, 235, 0.1);
    border-left: 3px solid var(--accent-blue);
    color: var(--text-secondary);
}

.log-item.log-death {
    background: rgba(220, 38, 38, 0.1);
    border-left: 3px solid var(--accent-red);
    color: #fca5a5;
}

.log-item.log-vote {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--accent-gold);
    color: #fcd34d;
}

.chat-message {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.03);
    animation: logAppear 0.3s ease-out;
}

.chat-message .chat-sender {
    font-weight: 700;
    color: var(--accent-blue);
    margin-right: 5px;
}

.chat-message.is-me .chat-sender {
    color: var(--accent-purple);
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--border-glass);
}

.chat-input-area input {
    flex: 1;
    padding: 10px;
    font-size: 0.85rem;
}

/* ============ GAME OVER ============ */
.gameover-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gameover-card {
    padding: 40px;
    text-align: center;
    width: 100%;
    animation: gameoverAppear 0.8s ease-out;
}

@keyframes gameoverAppear {
    from { opacity: 0; transform: scale(0.8) rotateX(20deg); }
    to { opacity: 1; transform: scale(1) rotateX(0); }
}

.gameover-icon {
    font-size: 5rem;
    margin-bottom: 15px;
    animation: trophyBounce 1s ease-out;
}

@keyframes trophyBounce {
    0% { transform: translateY(-50px) scale(0); }
    60% { transform: translateY(10px) scale(1.1); }
    100% { transform: translateY(0) scale(1); }
}

.gameover-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gameover-narration {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.6;
}

.gameover-roles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 25px;
}

.gameover-role-card {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    text-align: center;
}

.gameover-role-card.is-alive {
    border-color: var(--accent-green);
    background: rgba(22, 163, 74, 0.1);
}

.gameover-role-card.is-dead {
    opacity: 0.5;
}

.gameover-role-card .player-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.gameover-role-card .role-reveal {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.gameover-actions {
    margin-top: 20px;
}

/* ============ NIGHT OVERLAY ============ */
body.phase-night {
    background: linear-gradient(135deg, #050510 0%, #0a0520 50%, #050510 100%);
}

body.phase-night .game-header {
    background: rgba(5, 5, 16, 0.8);
}

body.phase-day {
    background: linear-gradient(135deg, #1a1040 0%, #2a1860 50%, #1a1040 100%);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .game-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .players-panel, .chat-panel {
        position: static;
        max-height: none;
    }

    .players-panel {
        order: 1;
    }

    .players-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 6px;
    }

    .player-item {
        flex-direction: column;
        text-align: center;
        padding: 6px;
        gap: 2px;
    }

    .player-item-name {
        font-size: 0.75rem;
    }

    .player-item-role {
        font-size: 0.65rem;
    }

    .game-main {
        order: 2;
    }

    .chat-panel {
        order: 3;
    }

    .chat-messages {
        max-height: 200px;
        min-height: 120px;
    }

    .game-header {
        padding: 8px 12px;
        margin: 5px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .phase-indicator {
        font-size: 0.9rem;
    }

    .role-card-inner {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .role-icon {
        font-size: 2.2rem;
    }

    .narration-box {
        padding: 12px;
        min-height: 60px;
    }

    .narration-text {
        font-size: 0.85rem;
    }

    .action-area {
        padding: 12px;
    }
}

@media (max-width: 600px) {
    html {
        font-size: 14px;
    }

    .landing-container {
        padding: 15px 10px;
    }

    .title-text {
        font-size: 2.2rem;
    }

    .title-sub {
        font-size: 1.1rem;
        letter-spacing: 4px;
    }

    .title-icon {
        font-size: 2.5rem;
    }

    .game-header {
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
        padding: 6px 8px;
        top: 0;
        margin: 0;
        border-radius: 0;
    }

    .header-left, .header-right {
        gap: 6px;
    }

    .room-badge, .day-badge {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .timer-display {
        padding: 4px 8px;
        font-size: 0.9rem;
    }

    .lobby-wrapper {
        padding: 10px;
        gap: 12px;
    }

    .lobby-header {
        padding: 15px 10px;
    }

    .lobby-title {
        font-size: 1.5rem;
    }

    .code-value {
        font-size: 1.4rem;
        letter-spacing: 3px;
    }

    .lobby-players-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
        padding: 5px;
    }

    .lobby-player-card {
        padding: 10px 6px;
        min-height: 80px;
        max-height: 130px;
    }

    .lobby-player-card .player-avatar {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 40px;
        max-height: 40px;
        font-size: 1.5rem;
    }

    .lobby-player-card .avatar-frame--lg {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 40px;
        max-height: 40px;
    }

    .player-card-name {
        font-size: 0.7rem;
    }

    .player-card-badge {
        font-size: 0.6rem;
        padding: 1px 5px;
    }

    .empty-slot {
        min-height: 80px;
        font-size: 1.2rem;
    }

    .lobby-actions {
        flex-direction: column;
        padding: 10px;
        gap: 8px;
    }

    .lobby-actions .btn {
        width: 100%;
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .players-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .action-players-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 6px;
    }

    .action-player-btn {
        padding: 8px 4px;
        font-size: 0.75rem;
    }

    .action-player-btn img {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        max-width: 24px;
        max-height: 24px;
    }

    .action-submit-btn {
        width: 100%;
    }

    .role-card {
        padding: 12px;
    }

    .role-name {
        font-size: 1rem;
    }

    .role-reveal-card-flip {
        width: 240px;
        height: 340px;
    }

    .reveal-big-icon {
        font-size: 3rem;
    }

    .reveal-role-name {
        font-size: 1.4rem;
    }

    .reveal-guide {
        font-size: 0.72rem;
        max-height: 120px;
    }

    .gameover-wrapper {
        padding: 20px 10px;
    }

    .gameover-card {
        padding: 20px 12px;
    }

    .gameover-icon {
        font-size: 3.5rem;
    }

    .gameover-title {
        font-size: 1.8rem;
    }

    .gameover-roles {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 6px;
    }

    .gameover-role-card {
        padding: 8px;
    }

    .gameover-role-card .player-name {
        font-size: 0.75rem;
    }

    .chat-input-area {
        padding: 6px;
        gap: 6px;
    }

    .chat-input-area input {
        font-size: 0.8rem;
        padding: 8px;
    }

    .game-modal {
        padding: 24px 16px;
        max-width: 300px;
    }

    .game-modal-icon {
        font-size: 2.8rem;
    }

    .game-modal-title {
        font-size: 1.2rem;
    }

    .avatar-picker-section {
        margin-top: 15px;
    }

    .avatar-preview-circle {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .avatar-actions {
        flex-direction: column;
        gap: 6px;
    }
}

/* ============ SPECIAL EFFECTS ============ */
.shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    from { background-position: -200% 0; }
    to { background-position: 200% 0; }
}

/* Death animation */
.death-animation {
    animation: deathFade 1s ease-out forwards;
}

@keyframes deathFade {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1) rotate(5deg); opacity: 0.5; filter: hue-rotate(90deg); }
    100% { transform: scale(0.8); opacity: 0.3; }
}

/* Waiting dots */
.waiting-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Skip button for night phases */
.skip-phase-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    font-family: var(--font-main);
}

.skip-phase-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

/* ============ ROLE REVEAL PHASE ============ */
.phase-reveal .game-header {
    background: linear-gradient(135deg, rgba(123, 47, 190, 0.3), rgba(245, 158, 11, 0.3));
    border-color: var(--accent-gold);
    box-shadow: var(--glow-gold);
}

.role-reveal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 20px 0;
}

.role-reveal-card-flip {
    perspective: 1200px;
    width: 280px;
    height: 400px;
}

.role-reveal-card {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: roleCardFlip 1.8s ease-out forwards;
    position: relative;
}

.role-reveal-front,
.role-reveal-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.role-reveal-front {
    background: linear-gradient(135deg, #1a1a4e, #2d1b69);
    border: 2px solid var(--accent-purple);
    box-shadow: var(--glow-purple), inset 0 0 40px rgba(123, 47, 190, 0.2);
}

.reveal-mystery {
    font-size: 5rem;
    animation: mysteryPulse 1s ease-in-out infinite;
}

.role-reveal-back {
    background: linear-gradient(135deg, #0d1b2a, #1b2a4a, #162040);
    border: 2px solid var(--accent-gold);
    box-shadow: var(--glow-gold), inset 0 0 40px rgba(245, 158, 11, 0.1);
    transform: rotateY(180deg);
    gap: 10px;
}

.reveal-big-icon {
    font-size: 4rem;
    filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.6));
    animation: revealGlow 2s ease-in-out infinite alternate;
}

.reveal-role-name {
    font-family: 'Creepster', cursive;
    font-size: 1.8rem;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.reveal-role-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.reveal-guide {
    font-size: 0.8rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
    line-height: 1.5;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.reveal-countdown {
    font-size: 1.2rem;
    color: var(--accent-gold);
    font-weight: 700;
    animation: countdownPulse 1s ease-in-out infinite;
}

.reveal-timer-value {
    font-family: 'Creepster', cursive;
    font-size: 1.5rem;
}

@keyframes roleCardFlip {
    0% { transform: rotateY(0deg) scale(0.8); }
    30% { transform: rotateY(0deg) scale(1); }
    100% { transform: rotateY(180deg) scale(1); }
}

@keyframes mysteryPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

@keyframes revealGlow {
    0% { filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.4)); }
    100% { filter: drop-shadow(0 0 25px rgba(245, 158, 11, 0.8)); }
}

@keyframes countdownPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============ RAVEN MARK INDICATOR ============ */
.raven-marked {
    position: relative;
}
.raven-marked::after {
    content: '🦅+2';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.65rem;
    background: var(--accent-red);
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 700;
}

/* ============ AVATAR SYSTEM ============ */
/* Universal avatar containment - prevents ANY image from breaking layout */
.avatar-frame {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.avatar-frame img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    border-radius: 50%;
    pointer-events: none;
    display: block;
}

.avatar-frame--lg {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.avatar-frame--sm {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    vertical-align: middle;
}

.avatar-frame--md {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.avatar-frame--action {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    max-width: 28px;
    max-height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Legacy class compat */
.avatar-img {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    display: block;
    pointer-events: none;
}

.avatar-img-sm {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    vertical-align: middle;
    flex-shrink: 0;
    display: inline-block;
    pointer-events: none;
}

.avatar-img-md {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    display: block;
    pointer-events: none;
}

.player-avatar {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    position: relative;
}

.player-avatar img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50%;
    pointer-events: none;
}

/* ============ AVATAR PICKER ============ */
.avatar-picker-section {
    text-align: center;
}

.avatar-preview-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.avatar-preview-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 3px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 2.5rem;
    transition: var(--transition);
}

.avatar-preview-circle:hover {
    border-color: var(--accent-purple);
}

.avatar-preview-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.avatar-upload-btn {
    cursor: pointer;
    white-space: nowrap;
}

/* ============ CHARMED / SLEEP EFFECT ============ */
.player-item.is-charmed {
    border-color: rgba(147, 51, 234, 0.4);
    background: rgba(147, 51, 234, 0.1);
    position: relative;
}

.player-item.is-charmed::before {
    content: '💤';
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 0.8rem;
    animation: sleepFloat 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes sleepFloat {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(-5px); opacity: 0.6; }
}

.lobby-player-card .player-avatar {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
}

.lobby-player-card .player-avatar img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50%;
}

/* ============ CENTER MODAL ============ */
.game-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-modal {
    background: linear-gradient(135deg, #1a1040, #0d0d2b);
    border: 2px solid var(--accent-purple);
    border-radius: 16px;
    padding: 30px 24px;
    text-align: center;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 0 40px rgba(123, 47, 190, 0.4), 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: modalPop 0.4s ease-out;
}

@keyframes modalPop {
    from { transform: scale(0.7) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.game-modal-icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
    animation: modalIconPulse 1.5s ease-in-out infinite;
}

@keyframes modalIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.game-modal-title {
    font-family: var(--font-title);
    font-size: 1.4rem;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.game-modal-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.game-modal-btn {
    padding: 12px 40px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: white;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    box-shadow: 0 4px 15px rgba(123, 47, 190, 0.4);
    transition: var(--transition);
    font-family: var(--font-main);
}

.game-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 47, 190, 0.6);
}

/* ============ EVENT TOAST ============ */
.event-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 900;
    background: linear-gradient(135deg, rgba(20, 20, 60, 0.95), rgba(10, 10, 30, 0.95));
    border: 2px solid var(--accent-gold);
    border-radius: 16px;
    padding: 20px 30px;
    text-align: center;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3), 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: eventToastIn 0.4s ease-out, eventToastOut 0.4s ease-in 2.2s forwards;
    pointer-events: none;
    max-width: 320px;
    width: 90%;
}

.event-toast-icon {
    font-size: 2.5rem;
    margin-bottom: 6px;
}

.event-toast-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

@keyframes eventToastIn {
    from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes eventToastOut {
    from { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    to { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}


