/* ==========================================
   INTRO — ВСТУПЛЕНИЕ К САЙТУ
   ========================================== */

#intro-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #000;
    z-index: 9999;
    overflow: hidden;
    transition: opacity 2s ease-in-out;
}
#intro-overlay.intro-finish { opacity: 0; pointer-events: none; }
#intro-overlay.hidden { display: none; }

/* Кнопка "Пропустить вступление" */
.intro-skip {
    position: absolute; top: 20px; right: 30px;
    color: rgba(229, 193, 88, 0.55);
    text-decoration: none;
    font-size: 14px; letter-spacing: 1px;
    z-index: 100; padding: 8px 16px;
    border: 1px solid rgba(107, 71, 51, 0.4);
    border-radius: 4px;
    transition: all 0.3s ease;
    font-family: 'Georgia', serif;
}
.intro-skip:hover {
    color: #e5c158;
    border-color: #6b4733;
    background: rgba(0,0,0,0.5);
}

/* Луч света */
.intro-light {
    position: absolute; top: -20%; left: -10%;
    width: 65%; height: 140%;
    background: radial-gradient(ellipse at top left,
        rgba(255, 220, 150, 0.35) 0%,
        rgba(255, 200, 100, 0.15) 20%,
        rgba(255, 180, 80, 0.05) 40%,
        transparent 70%);
    opacity: 0;
    transition: opacity 4s ease-in-out;
    pointer-events: none;
    filter: blur(40px);
}
.intro-light.on { opacity: 1; }

/* Пылинки */
.intro-dust {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 3s ease-in-out;
}
.intro-dust.on { opacity: 1; }
.intro-dust span {
    position: absolute;
    width: 2px; height: 2px;
    background: rgba(255, 220, 150, 0.7);
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255, 220, 150, 0.9);
    animation: dustFloat linear infinite;
}
@keyframes dustFloat {
    0%   { transform: translate(0, 0);        opacity: 0; }
    20%  { opacity: 0.9; }
    80%  { opacity: 0.9; }
    100% { transform: translate(40px, -100px); opacity: 0; }
}

/* Фразы */
.intro-phrase {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%; max-width: 850px;
    text-align: center;
    color: #e5c158;
    font-family: 'Georgia', serif;
    font-size: 30px;
    line-height: 1.7;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 2.5s ease-in-out, filter 2.5s ease-in-out;
    filter: blur(12px);
    pointer-events: none;
    text-shadow: 0 0 30px rgba(229, 193, 88, 0.35);
}
.intro-phrase.on  { opacity: 1; filter: blur(0); }
.intro-phrase.off { opacity: 0; filter: blur(10px); }

/* Название */
.intro-title {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
    transition: opacity 2.5s ease-in-out, transform 2.5s ease-in-out;
    pointer-events: none;
    width: 90%;
}
.intro-title.on  { opacity: 1; }
.intro-title.off { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
.intro-title h1 {
    color: #e5c158;
    font-family: 'Georgia', serif;
    font-size: 58px;
    font-weight: normal;
    letter-spacing: 8px;
    margin: 0 0 26px;
    text-shadow: 0 0 40px rgba(229, 193, 88, 0.45), 0 2px 6px rgba(0,0,0,0.9);
}
.intro-title p {
    color: #c9b88e;
    font-family: 'Georgia', serif;
    font-size: 20px;
    letter-spacing: 4px;
    line-height: 1.7;
    font-style: italic;
    margin: 0;
}

/* Мобильная адаптация */
@media (max-width: 700px) {
    .intro-title h1 { font-size: 32px; letter-spacing: 5px; margin-bottom: 16px; }
    .intro-title p  { font-size: 14px; letter-spacing: 2px; }
    .intro-phrase   { font-size: 20px; line-height: 1.6; }
    .intro-skip     { top: 12px; right: 12px; font-size: 12px; padding: 6px 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .intro-light, .intro-dust, .intro-phrase, .intro-title {
        transition: none !important;
    }
    .intro-dust span { animation: none !important; }
}

/* ==========================================
   СЦЕНА СО СТОЛОМ
   ========================================== */

.table-scene {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.table-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('/assets/img/intro-table-desktop.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    z-index: 1;
    transition: filter 0.4s ease;
}
.table-bg:hover { filter: brightness(1.06); }

@media (max-width: 700px) {
    .table-bg { background-image: url('/assets/img/intro-table-mobile.jpg'); }
}

.open-book-btn {
    position: relative;
    z-index: 10;
    margin-bottom: 60px;
    background: rgba(26, 16, 8, 0.85);
    color: #e5c158;
    border: 1px solid #8a6d3b;
    padding: 14px 44px;
    border-radius: 4px;
    font-family: 'Georgia', serif;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.open-book-btn:hover {
    background: rgba(43, 26, 14, 0.95);
    border-color: #e5c158;
    box-shadow: 0 0 24px rgba(229, 193, 88, 0.35);
}

.open-book-hint {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(201, 184, 142, 0.55);
    font-family: 'Georgia', serif;
    font-size: 13px;
    letter-spacing: 2px;
    z-index: 10;
    pointer-events: none;
}

@media (max-width: 700px) {
    .open-book-btn { margin-bottom: 40px; padding: 12px 28px; font-size: 14px; letter-spacing: 2px; }
    .open-book-hint { bottom: 14px; font-size: 11px; }
}