/* --- تنظیمات کلی --- */
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-color: #f0e9e9;
}

/* --- استایل کلی لایه‌ها --- */
.layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-in-out; /* انیمیشن محو شدن زیبا */
}

/* --- لایه ورودی و دکمه --- */
#invitation-layer {
    flex-direction: column;
    z-index: 100;
}

#show-video-btn {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background-color: #c0392b;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* --- لایه ویدیو و نگهدارنده آن --- */
#video-layer {
    z-index: 50;
}

.video-container {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 9 / 16;
    position: relative;
    background-color: #000;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- بخش کلیدی: مدیریت وضعیت با کلاس‌های CSS --- */
/* در حالت اولیه (intro) */
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; /* قابل دیدن است */
}