/* ═══════════════════════════════════════════════════════════════════════════════
   ║  SCIENTIFIC MAFIA CENTER - STYLE SHEET                                        ║
   ║  Version: 2.0 | Mobile-First Design | Vazirmatn Font                         ║
   ╚══════════════════════════════════════════════════════════════════════════════*/

/* ───────────────────────────────────────────────────────────────────────────────
   LOCAL FONTS - VAZIRMATN (Persian Font)
   ───────────────────────────────────────────────────────────────────────────────*/
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ───────────────────────────────────────────────────────────────────────────────
   CSS VARIABLES
   ───────────────────────────────────────────────────────────────────────────────*/
:root {
    /* Font Stack - Vazirmatn Priority (Local) */
    --font-display: 'Vazirmatn', 'Tahoma', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Vazirmatn', 'Tahoma', 'Segoe UI', -apple-system, sans-serif;
    
    /* Color Palette - Dark Mafia Theme */
    --color-bg-primary: #030303;
    --color-bg-secondary: #0a0a0a;
    --color-bg-card: #111111;
    --color-border: #222222;
    --color-border-hover: #333333;
    
    --color-text-primary: #ffffff;
    --color-text-secondary: #a0a0a0;
    --color-text-muted: #666666;
    
    --color-blood: #ff0033;
    --color-blood-dark: #990022;
    --color-blood-light: #ff3366;
    --color-gold: #ffd700;
    --color-gold-dark: #b8860b;
    --color-green: #00ff88;
    --color-purple: #9900ff;
    
    /* Effects */
    --glow-red: 0 0 30px rgba(255, 0, 51, 0.5);
    --glow-gold: 0 0 20px rgba(255, 215, 0, 0.4);
    --glow-green: 0 0 30px rgba(0, 255, 136, 0.5);
    
    /* Transitions */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.4s;
    --duration-slow: 0.6s;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

/* ───────────────────────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────────────────────────*/
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    height: 100%;
    overflow: hidden;
    touch-action: manipulation;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
}

/* ───────────────────────────────────────────────────────────────────────────────
   BACKGROUND EFFECTS LAYER
   ───────────────────────────────────────────────────────────────────────────────*/
.effects-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Animated Gradient Mesh */
.gradient-mesh {
    position: absolute;
    inset: -50%;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(255, 0, 51, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(153, 0, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 215, 0, 0.04) 0%, transparent 60%);
    animation: meshMove 25s ease-in-out infinite;
}

@keyframes meshMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(10%, -5%) rotate(5deg) scale(1.1); }
    50% { transform: translate(-5%, 10%) rotate(-3deg) scale(1); }
    75% { transform: translate(-10%, -10%) rotate(2deg) scale(1.05); }
}

/* Cyber Grid */
.cyber-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 0, 51, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 51, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    animation: gridPulse 3s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Floating Particles */
.particles {
    position: absolute;
    inset: 0;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--color-blood);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-blood);
    opacity: 0;
    animation: particleFloat var(--particle-duration, 10s) ease-in-out infinite;
    animation-delay: var(--particle-delay, 0s);
}

@keyframes particleFloat {
    0% { 
        opacity: 0;
        transform: translateY(100vh) translateX(0) scale(0);
    }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { 
        opacity: 0;
        transform: translateY(-20vh) translateX(var(--particle-drift, 30px)) scale(1);
    }
}

/* Scanlines */
.scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.12) 0px,
        rgba(0, 0, 0, 0.12) 1px,
        transparent 1px,
        transparent 2px
    );
    animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Vignette */
.vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.8) 100%);
}

/* ───────────────────────────────────────────────────────────────────────────────
   SCREEN MANAGEMENT
   ───────────────────────────────────────────────────────────────────────────────*/
.screen {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-bg-primary);
    opacity: 0;
    transform: scale(1.1);
    filter: blur(10px);
    transition: all var(--duration-slow) var(--ease-smooth);
    z-index: 10;
}

.screen.active {
    display: flex;
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* ───────────────────────────────────────────────────────────────────────────────
   INTRO SCREEN WITH VIDEO BACKGROUND
   ───────────────────────────────────────────────────────────────────────────────*/
.intro-screen {
    justify-content: center;
    align-items: center;
    padding: 0;
    z-index: 100;
    position: relative;
}

/* Video Container */
.video-container {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.video-bg {
    position: absolute;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.35) 35%,
        rgba(0, 0, 0, 0.4) 65%,
        rgba(0, 0, 0, 0.85) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.intro-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    gap: var(--spacing-lg);
}

.intro-content.with-video {
    background: rgba(8, 8, 8, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    margin: var(--spacing-md);
    padding: var(--spacing-xl) var(--spacing-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.intro-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.intro-header .logo-wrapper { margin-bottom: var(--spacing-sm); }
.intro-header .game-title { margin-bottom: var(--spacing-xs); }
.intro-header .game-subtitle { margin-bottom: 0; }

/* Intro Actions: video controls + main buttons */
.intro-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
}

.video-controls {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.video-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) ease;
}

.video-btn:hover {
    background: rgba(255, 0, 51, 0.5);
    border-color: var(--color-blood);
}

/* Story Text on Video */
.story-box.with-video {
    background: rgba(17, 17, 17, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
}

.story-text.on-video {
    font-size: 1rem;
    line-height: 2;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Logo Animation */
.logo-wrapper {
    position: relative;
    margin-bottom: var(--spacing-xl);
}

.logo-ring {
    position: absolute;
    inset: -20px;
    border: 2px solid transparent;
    border-radius: 50%;
    animation: ringPulse 3s ease-out infinite;
}

.logo-ring:nth-child(2) { animation-delay: 1s; }
.logo-ring:nth-child(3) { animation-delay: 2s; }

@keyframes ringPulse {
    0% { 
        border-color: rgba(255, 0, 51, 0.5);
        transform: scale(1);
        opacity: 1;
    }
    100% { 
        border-color: transparent;
        transform: scale(1.5);
        opacity: 0;
    }
}

.logo-core {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, rgba(255, 0, 51, 0.3) 0%, transparent 70%);
    border: 3px solid var(--color-blood);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    animation: logoFloat 4s ease-in-out infinite;
    box-shadow: var(--glow-red);
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

/* Title */
.game-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 3px;
    background: linear-gradient(135deg, #fff 0%, var(--color-blood-light) 30%, var(--color-gold) 60%, #fff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleShine 3s ease-in-out infinite;
}

@keyframes titleShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.game-subtitle {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: var(--spacing-xl);
}

/* Story Box */
.story-box {
    width: 100%;
    background: linear-gradient(160deg, rgba(18, 18, 18, 0.98) 0%, rgba(12, 12, 12, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-xl);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.story-box.chapter-transition {
    box-shadow: 0 0 0 1px rgba(255, 0, 51, 0.2);
}

.story-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-blood), transparent);
    opacity: 0.6;
    animation: linePulse 2s ease-in-out infinite;
}

@keyframes linePulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.story-box-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    gap: var(--spacing-md);
}

.intro-chapter-progress {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 1px;
    flex-shrink: 0;
}

/* Chapter Navigation */
.chapter-dots {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.chapter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
    transition: all var(--duration-normal) var(--ease-spring);
    position: relative;
}

.chapter-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid transparent;
    transition: all var(--duration-normal) ease;
}

.chapter-dot.active {
    background: var(--color-blood);
    transform: scale(1.5);
    box-shadow: 0 0 15px var(--color-blood);
}

.chapter-dot.active::after {
    border-color: rgba(255, 0, 51, 0.5);
    animation: dotRipple 1.5s ease-out infinite;
}

@keyframes dotRipple {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

.chapter-dot.completed {
    background: var(--color-green);
}

.chapter-label {
    font-size: 0.7rem;
    color: var(--color-blood-light);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.story-text-wrapper {
    min-height: 120px;
}

.story-text {
    font-size: 1rem;
    line-height: 2;
    color: rgba(255, 255, 255, 0.92);
    transition: opacity 0.25s ease;
}

#typedContent {
    transition: opacity 0.2s ease;
}

.story-text .highlight { 
    color: var(--color-gold); 
    font-weight: 600; 
}

.story-text .danger { 
    color: var(--color-blood-light); 
    font-weight: 600; 
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 18px;
    background: var(--color-blood);
    margin-right: 3px;
    animation: cursorBlink 0.6s infinite;
    vertical-align: middle;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Controls */
.intro-controls {
    display: flex;
    gap: var(--spacing-md);
    width: 100%;
    max-width: 320px;
    justify-content: center;
}

.intro-controls .btn {
    flex: 1;
    min-width: 0;
}

/* ───────────────────────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────────────────────────*/
.btn {
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-spring);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn:hover::before {
    transform: translateX(100%);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-blood) 0%, var(--color-blood-dark) 100%);
    color: #fff;
    box-shadow: 0 5px 25px rgba(255, 0, 51, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 40px rgba(255, 0, 51, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #fff;
}
.btn-outline:hover {
    border-color: var(--color-blood);
    color: var(--color-blood-light);
}

.btn-secondary:hover {
    border-color: var(--color-blood);
    color: var(--color-blood-light);
    transform: translateY(-2px);
}

.btn-gold {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: #000;
    box-shadow: 0 5px 25px rgba(255, 215, 0, 0.4);
}

.btn-gold:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.6);
}

/* ───────────────────────────────────────────────────────────────────────────────
   GAME SCREEN
   ───────────────────────────────────────────────────────────────────────────────*/
.game-header {
    background: rgba(10, 10, 10, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: var(--spacing-md) var(--spacing-lg);
    position: relative;
    z-index: 10;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.level-badge {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.level-badge span {
    color: var(--color-blood);
    font-size: 1.2rem;
}

.menu-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
}

.menu-btn:hover {
    border-color: var(--color-blood);
    color: var(--color-blood-light);
    background: rgba(255, 0, 51, 0.1);
}

/* Header Actions Container */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Close App Button */
.close-app-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-app-btn:hover {
    border-color: #ff4757;
    color: #ff4757;
    background: rgba(255, 71, 87, 0.15);
}

/* Progress Bar */
.progress-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.progress-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-blood), var(--color-gold));
    border-radius: 2px;
    transition: width 0.6s var(--ease-smooth);
}

.progress-text {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Stats Bar — تمیز */
.stats-bar {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
}

.stat-pill {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-xs);
    text-align: center;
    transition: border-color var(--duration-fast) ease;
}

.stat-pill:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-icon {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xs);
    display: block;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
    transition: all var(--duration-fast) ease;
}

.stat-value.points { 
    color: var(--color-gold); 
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3); 
}

.stat-value.danger { color: var(--color-blood); }
.stat-value.success { color: var(--color-green); }

.stat-label {
    font-size: 0.6rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ───────────────────────────────────────────────────────────────────────────────
   TABLE AREA
   ───────────────────────────────────────────────────────────────────────────────*/
.table-area {
    padding: var(--spacing-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.table-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
}

.table-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 0, 51, 0.25) 0%, transparent 70%);
    border: 2px solid rgba(255, 0, 51, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: centerPulse 3s ease-in-out infinite;
}

@keyframes centerPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 51, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 0, 51, 0.6); }
}

.table-center::after {
    content: '⚗';
    font-size: 28px;
    filter: drop-shadow(0 0 8px var(--color-blood));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Seats */
.seat {
    position: absolute;
    width: 48px;
    height: 48px;
    background: linear-gradient(145deg, #151515 0%, #0a0a0a 100%);
    border: 2px solid #2a2a2a;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-spring);
    z-index: 5;
}

.seat::before {
    content: '';
    position: absolute;
    inset: -6px;
    border: 1px solid transparent;
    border-radius: 50%;
    transition: all var(--duration-normal) ease;
}

.seat.alive {
    animation: seatIdle 4s ease-in-out infinite;
}

@keyframes seatIdle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.seat.alive:hover {
    transform: scale(1.2);
    border-color: var(--color-blood);
    box-shadow: 0 0 30px rgba(255, 0, 51, 0.5);
    z-index: 20;
}

.seat.alive:hover::before {
    border-color: rgba(255, 0, 51, 0.3);
    animation: ringExpand 1s ease-out infinite;
}

.seat.active {
    border-color: var(--color-green);
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.15) 0%, #0a0a0a 100%);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
    animation: activePulse 1.2s ease-in-out infinite;
    z-index: 20;
}

@keyframes activePulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.4); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 136, 0.8); }
}

@keyframes ringExpand {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.seat.dead {
    background: #050505;
    border-color: #151515;
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.seat.dead::after {
    content: '💀';
    font-size: 20px;
    position: absolute;
    opacity: 0.5;
}

.seat-number {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary);
    transition: all var(--duration-fast) ease;
}

.seat-role {
    font-size: 0.45rem;
    color: var(--color-text-muted);
    max-width: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seat.dead .seat-number,
.seat.dead .seat-role {
    opacity: 0;
}

/* ───────────────────────────────────────────────────────────────────────────────
   GAME CONTENT AREA
   ───────────────────────────────────────────────────────────────────────────────*/
.game-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-xl);
    -webkit-overflow-scrolling: touch;
}

.phase-header {
    text-align: center;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.7rem;
    color: var(--color-text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: var(--spacing-lg);
    font-weight: 600;
}

/* Cards — تمیز و مینیمال */
.card {
    background: rgba(17, 17, 17, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.meta-info {
    flex: 1;
}

.meta-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 3px;
}

.meta-role {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.message {
    font-size: 0.95rem;
    line-height: 2;
    color: var(--color-text-secondary);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.page-info {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.page-info span {
    color: var(--color-blood);
    font-weight: 700;
}

/* ───────────────────────────────────────────────────────────────────────────────
   QUESTION PHASE
   ───────────────────────────────────────────────────────────────────────────────*/
.diff-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
}

.diff-easy { 
    background: rgba(0, 255, 136, 0.12); 
    color: var(--color-green); 
    border: 1px solid rgba(0, 255, 136, 0.3); 
}

.diff-medium { 
    background: rgba(255, 215, 0, 0.12); 
    color: var(--color-gold); 
    border: 1px solid rgba(255, 215, 0, 0.3); 
}

.diff-hard { 
    background: rgba(255, 0, 51, 0.12); 
    color: var(--color-blood); 
    border: 1px solid rgba(255, 0, 51, 0.3); 
}

.diff-extreme { 
    background: rgba(153, 0, 255, 0.12); 
    color: var(--color-purple); 
    border: 1px solid rgba(153, 0, 255, 0.3); 
}

.question {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
}

/* Powerups — تمیز */
.powerups {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.powerup {
    flex: 1;
    min-width: 70px;
    padding: 10px var(--spacing-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 0.72rem;
    cursor: pointer;
    transition: border-color var(--duration-fast) ease, color var(--duration-fast) ease;
    text-align: center;
}

.powerup:hover:not(:disabled) {
    border-color: rgba(255, 215, 0, 0.4);
    color: var(--color-gold);
}

.powerup:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.powerup.used {
    opacity: 0.2;
    text-decoration: line-through;
}

.powerup-cost {
    display: block;
    font-size: 0.58rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* Hint Box — مینیمال */
.hint {
    display: none;
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    animation: hintAppear 0.4s var(--ease-smooth);
}

.hint.show { display: block; }

@keyframes hintAppear {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Options — تمیز و خوانا */
.options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.option {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
    text-align: right;
}

.option:hover:not(.disabled) {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
}

.option.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.option.correct {
    background: rgba(0, 255, 136, 0.08);
    border-color: rgba(0, 255, 136, 0.35);
    animation: correctPulse 0.4s ease;
}

@keyframes correctPulse {
    from { transform: scale(0.98); }
    to { transform: scale(1); }
}

.option.wrong {
    background: rgba(255, 0, 51, 0.06);
    border-color: rgba(255, 0, 51, 0.35);
    animation: shake 0.4s ease;
}

.option.hidden { display: none; }

.option-letter {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: background var(--duration-fast) ease;
}

.option:hover:not(.disabled) .option-letter {
    background: rgba(255, 255, 255, 0.15);
}

/* ───────────────────────────────────────────────────────────────────────────────
   TARGET PHASE
   ───────────────────────────────────────────────────────────────────────────────*/
.target-card {
    background: rgba(17, 17, 17, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.target-title {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.target-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-gold);
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
    margin: var(--spacing-sm) 0;
    animation: numberPulse 2s ease-in-out infinite;
}

@keyframes numberPulse {
    0%, 100% { 
        transform: scale(1); 
        text-shadow: 0 0 40px rgba(255, 215, 0, 0.5); 
    }
    50% { 
        transform: scale(1.1); 
        text-shadow: 0 0 60px rgba(255, 215, 0, 0.8); 
    }
}

.target-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
}

.shoot-btn {
    width: 100%;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--color-blood) 0%, var(--color-blood-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-spring);
    text-transform: uppercase;
    letter-spacing: 3px;
    box-shadow: 0 8px 30px rgba(255, 0, 51, 0.4);
    position: relative;
    overflow: hidden;
}

.shoot-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
}

.shoot-btn:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(255, 0, 51, 0.6);
}

.shoot-btn:hover:not(:disabled)::before {
    animation: btnShine 0.8s ease;
}

@keyframes btnShine {
    to { transform: translateX(100%); }
}

.shoot-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* ───────────────────────────────────────────────────────────────────────────────
   OVERLAYS
   ───────────────────────────────────────────────────────────────────────────────*/
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 3, 3, 0.98);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-xl);
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
}

.overlay.active {
    display: flex;
    opacity: 1;
}

/* Kill Overlay */
.kill-effect {
    position: relative;
    text-align: center;
}

.kill-icon {
    font-size: 5rem;
    margin-bottom: var(--spacing-md);
    animation: killAnim 0.8s var(--ease-spring);
    filter: drop-shadow(0 0 30px var(--color-blood));
}

@keyframes killAnim {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.kill-title {
    font-size: 2rem;
    color: var(--color-blood);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 0 40px rgba(255, 0, 51, 0.6);
    animation: titleFlash 0.5s ease-in-out 3;
}

@keyframes titleFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.kill-victim {
    font-size: 1rem;
    color: var(--color-text-muted);
}

/* Luck Overlay */
.luck-title {
    font-size: 1.6rem;
    color: var(--color-blood);
    margin-bottom: var(--spacing-sm);
    text-align: center;
    animation: luckPulse 2s ease-in-out infinite;
}

@keyframes luckPulse {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 0, 51, 0.4); }
    50% { text-shadow: 0 0 40px rgba(255, 0, 51, 0.8); }
}

.luck-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xl);
    text-align: center;
    line-height: 1.9;
}

/* شمارش معکوس و نتیجه شانس — ابتدا ۳، ۲، ۱ با صدا، بعد «نجات یافتی» یا «حذف شدی» */
.luck-countdown {
    display: none;
    font-size: 5rem;
    font-weight: 800;
    color: var(--color-text-primary);
    text-align: center;
    margin: var(--spacing-xl) 0;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
    animation: countdownPop 0.4s var(--ease-spring);
}

.luck-countdown.visible {
    display: block;
}

.luck-countdown.luck-result {
    font-size: 2rem;
    animation: resultReveal 0.6s var(--ease-spring);
}

.luck-countdown.luck-win {
    color: var(--color-green);
    text-shadow: 0 0 50px rgba(0, 255, 136, 0.6);
}

.luck-countdown.luck-lose {
    color: var(--color-blood);
    text-shadow: 0 0 50px rgba(255, 0, 51, 0.6);
}

/* ویدئو شلیک باخت — وقتی کارت اشتباه است، به‌جای متن «حذف شدی» پخش می‌شود */
.luck-lose-video {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 5;
}

.luck-lose-video.visible {
    display: block;
}

/* Game Over Overlay */
#gameOverOverlay {
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
}

.game-over-content {
    text-align: center;
    max-width: 360px;
    padding: var(--spacing-xl);
}

.game-over-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.9;
}

.game-over-title {
    font-size: 1.75rem;
    color: var(--color-blood-light);
    margin-bottom: var(--spacing-sm);
    font-weight: 800;
}

.game-over-desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: var(--spacing-xl);
}

.game-over-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
}

.game-over-actions .btn {
    min-width: 140px;
}

@keyframes countdownPop {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes resultReveal {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.cards-wrapper {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    perspective: 1000px;
}

.flip-card {
    width: 90px;
    height: 130px;
    position: relative;
    transform-style: preserve-3d;
    cursor: pointer;
    transition: transform var(--duration-normal) var(--ease-spring);
}

.flip-card:hover:not(.flipped) {
    transform: translateY(-15px) scale(1.05);
}

.flip-card.flipped {
    transform: rotateY(180deg);
    cursor: default;
}

.flip-card-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

.flip-front, .flip-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid;
}

.flip-front {
    background: linear-gradient(145deg, #151515 0%, #0a0a0a 100%);
    border-color: #333;
}

.flip-front::before {
    content: '?';
    font-size: 3rem;
    color: var(--color-blood);
    opacity: 0.5;
    animation: questionPulse 2s ease-in-out infinite;
}

@keyframes questionPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.flip-back {
    transform: rotateY(180deg);
    background: linear-gradient(145deg, rgba(255, 0, 51, 0.2) 0%, rgba(102, 0, 17, 0.3) 100%);
    border-color: var(--color-blood);
}

.flip-back.win {
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 170, 92, 0.3) 100%);
    border-color: var(--color-green);
}

.flip-back.lose {
    background: linear-gradient(145deg, rgba(255, 0, 51, 0.2) 0%, rgba(102, 0, 17, 0.3) 100%);
}

.flip-icon {
    font-size: 2.75rem;
    margin-bottom: var(--spacing-xs);
}

.flip-text {
    font-size: 0.75rem;
    color: #fff;
    text-align: center;
}

/* Victory Overlay */
.victory-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-height: 45%;
    object-fit: contain;
    z-index: 0;
}

#victoryOverlay .victory-content {
    position: relative;
    z-index: 1;
}

.victory-content {
    text-align: center;
    max-width: 400px;
}

.victory-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    animation: victoryBounce 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 30px var(--color-green));
}

@keyframes victoryBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.1); }
}

.victory-title {
    font-size: 1.75rem;
    color: var(--color-green);
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    text-shadow: 0 0 40px rgba(0, 255, 136, 0.5);
}

.survivors {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.survivor-tag {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm) var(--spacing-sm);
    font-size: 0.8rem;
    animation: tagAppear 0.5s var(--ease-smooth) backwards;
}

@keyframes tagAppear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.final-score {
    font-size: 1rem;
    color: var(--color-gold);
    margin-bottom: var(--spacing-lg);
}

.teaser-box {
    background: linear-gradient(145deg, rgba(153, 0, 255, 0.1) 0%, rgba(10, 10, 10, 0.9) 100%);
    border: 1px solid rgba(153, 0, 255, 0.4);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    animation: teaserGlow 3s ease-in-out infinite;
}

@keyframes teaserGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(153, 0, 255, 0.2); }
    50% { box-shadow: 0 0 40px rgba(153, 0, 255, 0.4); }
}

.teaser-title {
    font-size: 1.1rem;
    color: var(--color-purple);
    margin-bottom: var(--spacing-sm);
}

.teaser-text {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.9;
}

/* ───────────────────────────────────────────────────────────────────────────────
   UTILITY ANIMATIONS
   ───────────────────────────────────────────────────────────────────────────────*/
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-10px); }
    30% { transform: translateX(10px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
    90% { transform: translateX(3px); }
}

.shake { animation: shake 0.5s ease; }

@keyframes flashGreen {
    0%, 100% { background: transparent; }
    50% { background: rgba(0, 255, 136, 0.25); }
}

.flash-green { animation: flashGreen 0.6s ease; }

@keyframes flashRed {
    0%, 100% { background: transparent; }
    50% { background: rgba(255, 0, 51, 0.25); }
}

.flash-red { animation: flashRed 0.6s ease; }

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --color-border: #444444;
        --color-text-secondary: #cccccc;
    }
}