/* --- تنظیمات کلی --- */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #ffeef8 0%, #ffe0f0 100%);
}

/* --- استایل کلی لایه‌ها --- */
.layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-in-out;
}

/* --- لایه ورودی و دکمه --- */
#invitation-layer {
    flex-direction: column;
    z-index: 100;
    background: linear-gradient(135deg, #ffeef8 0%, #ffe0f0 100%);
}

#invitation-layer h1 {
    font-size: 24px;
    color: #c0392b;
    margin-bottom: 30px;
    text-align: center;
    font-weight: bold;
}

#show-video-btn {
    padding: 18px 40px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(192, 57, 43, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

#show-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(192, 57, 43, 0.5);
}

#show-video-btn:active {
    transform: translateY(0);
}

#show-video-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- لایه ویدیو و نگهدارنده آن --- */
#video-layer {
    z-index: 50;
    background-color: #000;
}

.video-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    position: relative;
    background-color: #000;
    overflow: hidden;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- برای موبایل - ویدیو عمودی --- */
@media (max-width: 768px) {
    .video-container {
        max-width: 100vw;
        height: 100vh;
    }
    
    .video-container video {
        object-fit: cover;
    }
}

/* --- بخش کلیدی: مدیریت وضعیت با کلاس‌های CSS --- */
body.state-intro #invitation-layer {
    opacity: 1;
    pointer-events: auto;
}

body.state-intro #video-layer {
    opacity: 0;
    pointer-events: none;
}

body.state-playing #invitation-layer {
    opacity: 0;
    pointer-events: none;
}

body.state-playing #video-layer {
    opacity: 1;
    pointer-events: auto;
}