body {
    margin: 0;
    height: 100vh;
    font-family: sans-serif;
    overflow: hidden;
        background: url('assets/fon.png') center/cover no-repeat;
    

}

/* ===== LOADER ===== */
.container {
    position: relative;
    width: 100%;
    height: 100%;
}

.logo-box {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 150px;
    height: 100px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.logo {
    width: 120%;
    height: auto;
}

@font-face {
    font-family: 'HistoryFont';
    src: url('fonts/h1.ttf') format('truetype');
}

h1 {
    position: absolute;
    top: 60px;
    width: 100%;
    font-family: 'HistoryFont', serif;

    text-align: center;
    font-size: 120px;
    color: #5c5048;
}

.boat img {
    width: 60px;
}

.progress-container {
    width: 300px;
    height: 12px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #5c5048;
}

/* ===== DARK SCREEN ===== */
.dark-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: #0b0f1a;
    display: none;

    align-items: center;
    justify-content: center;

    opacity: 0;
    transition: opacity 1s;
}


.title {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Верхний текст */
.city {
    color: white;
    font-size: 42px;
    font-family: "Times New Roman", serif;
    letter-spacing: 2px;
     text-shadow:
        0 0 5px #7fdfff,
        0 0 10px #7fdfff,
        0 0 20px #3bbcff,
        0 0 40px #3bbcff;
}
@font-face {
    font-family: 'Orbitron';
    src: url('fonts/years.ttf') format('truetype');
}
/* Отступ как 3 строки */
.year {
    margin-top: 60px;

    font-size: 56px;
    font-family: "Orbitron", sans-serif;

    color: #aef;

    text-shadow:
        0 0 5px #7fdfff,
        0 0 10px #7fdfff,
        0 0 20px #3bbcff,
        0 0 40px #3bbcff;
}
/* ===== MENU SCREEN ===== */
.menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    display: none;

    background: url('assets/fon_2121.png') center/cover no-repeat;
    color: white;
}

/* Левая колонка */
.menu-left {
    position: absolute;
    bottom: 80px;
    left: 60px;

    width: 320px;

    display: flex;
    flex-direction: column;
}

/* ТЕКСТ */
.menu-text {
    font-size: 18px;
    color: #f6f2f2;
    line-height: 1.5;

    margin-bottom: 30px;
}

.menu-text p {
    margin-bottom: 15px;
}

/* КНОПКИ */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* СТИЛЬ КНОПОК */
.menu-btn {
    width: 220px;
    padding: 14px;

    font-size: 18px;
    background: rgba(0,0,0,0.6);
    border: 1px solid #7fdfff;
    color: white;

    cursor: pointer;

    transition: all 0.3s ease;
}

/* АНИМАЦИЯ HOVER */
.menu-btn:hover {
    background: rgba(127,223,255,0.2);
    box-shadow: 
        0 0 10px #7fdfff,
        0 0 20px #3bbcff;

    transform: translateX(10px);
}

/* НАЖАТИЕ */
.menu-btn:active {
    transform: scale(0.95);
}

/* ПЕРСОНАЖ */
.character {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);

    height: 80%;
    object-fit: contain;

    animation: float 3s ease-in-out infinite;
}

/* ЛЕГКОЕ ДВИЖЕНИЕ */
@keyframes float {
    0% { transform: translateX(-50%) translateY(0px); }
    50% { transform: translateX(-50%) translateY(-10px); }
    100% { transform: translateX(-50%) translateY(0px); }
}

/* ===== GAME SCREEN ===== */
.game-screen {
    position: fixed;
    width: 100%;
    height: 100%;

    display: none;

    background: url('assets/fon-doors.png') center/cover no-repeat;
}

/* ДВЕРЬ */
.doors-block {
    position: absolute;
    left: 160px;
    top: 120px;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.doors-title {
    color: white;
    font-size: 60px;
    margin-bottom: 40px;
}

.doors {
    width: 300px;
    height: 600px;
    object-fit: cover;

    border: 2px solid transparent;
    cursor: pointer;

    transition: 0.3s;
}

/* HOVER */
.doors:hover {
    border: 2px solid #7fdfff;
    box-shadow: 0 0 15px #7fdfff;
}

/* ПЕРСОНАЖ */
.character-game {
    position: absolute;
    bottom: 0;
    left: 60%;

    height: 80%;

    transform: translateX(-50%);
    animation: float 3s ease-in-out infinite;
}

/* ПОДСКАЗКА */
.hints {
    position: absolute;
    bottom: 120px;
    left: 100px;

    display: none;
    align-items: center;
    gap: 10px;

    color: white;
    background: rgba(210, 213, 215, 0.6);
    padding: 10px 15px;

    border: 1px solid #7fdfff;
    box-shadow: 0 0 10px #7fdfff;
}

.hints img {
    width: 30px;
}


/* quest1.html */

.quest1 {
    margin: 0;
    height: 100vh;
    background: url('assets/fon_quest1.png') center/cover no-repeat;
    position: relative;
}

.bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.game-screen {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* текст */
.dialogue-text {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 18px;
    max-width: 80%;
    text-align: center;
    z-index: 5;
}

/* персонаж */
.character-game {
    position: absolute;
    bottom: 0;
    left: 60px;
    height: 80%;
    z-index: 3;
}

/* объект */
.door-block {
    position: absolute;
    left: 70%;
    top: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.door-title {
    color: white;
    font-size: 22px;
    margin-bottom: 10px;
}

.door {
    width: 200px;
    cursor: pointer;
    transition: 0.3s;
}

.door:hover {
    transform: scale(1.05);
}

/* подсказка */
.hint {
    position: absolute;
    bottom: 120px;
    left: 100px;
    display: none;
    align-items: center;
    gap: 10px;
    color: white;
    background: rgba(0,0,0,0.6);
    padding: 10px 15px;
    border: 1px solid #7fdfff;
    z-index: 10;
}
#minigame {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

/* фон */
.mg-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
}

/* окно */
.mg-board {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 600px;
    min-height: 320px;
    background: #1b1f2a;
    border: 2px solid #7fdfff;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* список */
#items {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* карточка */
.item {
    width: 100%;
    padding: 12px;
    background: #2b3245;
    color: white;
    border: 1px solid #7fdfff;
    cursor: pointer;
    user-select: none;
    transition: 0.2s;
}

.item:hover {
    transform: scale(1.02);
}

/* выделение */
.item.selected {
    border: 2px solid yellow;
}

/* кнопка */
.mg-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: #7fdfff;
    border: none;
    cursor: pointer;
}

/* popup */
.mg-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.mg-window {
    background: #1e2433;
    padding: 25px;
    border-radius: 12px;
    color: white;
    text-align: center;
}

.mg-window.success {
    border: 2px solid #7CFF7C;
}


/* =========================
   БАТОНЧИК (НОВЫЙ БЛОК)
========================= */

#bar {
    position: fixed;
    inset: 0;
    display: none; /* скрыт до победы */
    z-index: 50;
}

/* КАРТИНКА ПО ЦЕНТРУ */
.bar-img {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-8deg);

    width: 280px;
    pointer-events: none;

    animation: floatBar 3s ease-in-out infinite;
}

/* ПЛАВАЮЩАЯ АНИМАЦИЯ */
@keyframes floatBar {
    0%   { transform: translate(-50%, -50%) rotate(-8deg); }
    50%  { transform: translate(-50%, -60%) rotate(-8deg); }
    100% { transform: translate(-50%, -50%) rotate(-8deg); }
}

/* КНОПКА ВНИЗУ */
.eatBtn {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);

    padding: 14px 28px;

    background: rgba(0,0,0,0.85);
    border: 2px solid #7fdfff;
    color: #7fdfff;

    font-size: 18px;
    letter-spacing: 1px;

    cursor: pointer;
    pointer-events: auto;

    transition: 0.3s;
}

/* ХОВЕР */
.eatBtn:hover {
    background: #7fdfff;
    color: black;
    box-shadow: 0 0 15px #7fdfff;
}

/* НАЖАТИЕ */
.eatBtn:active {
    transform: translateX(-50%) scale(0.95);
}

/* =========================
   ПОЯВЛЕНИЕ
========================= */

#bar.show {
    display: block;
    animation: fadeInBar 0.5s ease;
}

@keyframes fadeInBar {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* подсветка вендинга */
.glow {
    filter: drop-shadow(0 0 20px yellow);
}
/* ЛЕВАЯ ПОЗИЦИЯ */
.left {
    left: 60px;
    right: auto;
}

/* ЦЕНТР ПЕРСОНАЖ (СЦЕНА 1) */
.center {
    left: 50%;
    transform: translateX(-50%);
}

/* ПРАВЕЕ ЦЕНТРА (СЦЕНА 2) */
.right {
    left: 65%;
    transform: translateX(-50%);
}

/* ТЕКСТ ПО ЦЕНТРУ ВВЕРХУ */
.top-center {
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
}

/* ТЕКСТ СПРАВА */
.top-right {
    top: 60px;
    left: 65%;
    transform: translateX(-50%);
}
.vending-wrap {
    position: absolute;
}

/* батончик строго под вендингом */
#bar {
    position: absolute;
    top: 210px;   /* под вендингом */
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
}
/* обертка */
.vending-wrap {
    position: absolute;
}

/* батончик скрыт */
#bar {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
}

/* АНИМАЦИЯ ВЫПАДЕНИЯ */
@keyframes dropBar {
    0% {
        transform: translate(-50%, -80px);
        opacity: 0;
    }
    60% {
        transform: translate(-50%, 10px);
    }
    100% {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

#bar.drop {
    animation: dropBar 0.6s ease;
}

/* НЕОН */
.glow {
    animation: neonGlow 1s infinite alternate;
}

@keyframes neonGlow {
    from {
        filter: drop-shadow(0 0 5px #7fdfff);
    }
    to {
        filter: drop-shadow(0 0 25px #00eaff);
    }
}

.item {
    cursor: grab;
}

.item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

.item:active {
    cursor: grabbing;
}
.vending-wrap {
    position: absolute;
}
/* 862.html */
/* ===== ЭКРАН 862 ===== */
/* ===== СЦЕНА 1 (862) ===== */
.screen-862 {
    margin: 0;
    height: 100vh;
    background: url('assets/fon-862.png') center/cover no-repeat;

    display: flex;
    justify-content: center;
    align-items: center;

    cursor: pointer;
}

.title-862 {
    font-family: 'HistoryFont', serif;
    font-size: 120px;
    color: #e6d3a3;

    text-shadow:
        0 0 10px rgba(255,255,200,0.6),
        0 0 20px rgba(255,220,150,0.5),
        0 0 40px rgba(255,200,100,0.4);

    letter-spacing: 10px;
}

/* ===== СЦЕНА 2 ===== */
.scene2 {
    margin: 0;
    height: 100vh;
    background: url('assets/fon_862.png') center/cover no-repeat;
    position: relative;
}
/* персонажи */
.person {
    position: absolute;
    bottom: 0;
    display: flex;
    flex-direction: column-reverse; /* ВАЖНО */
    align-items: center;
}

/* позиции */
.left-person {
    left: 40px;
}

.right-person {
    right: 40px;
}

/* КАРТИНКИ */
.char-img {
    height: 70vh;
    object-fit: contain;
}

/* текст (теперь сверху) */
.speech {
    margin-bottom: 20px;
    width: 260px;
    font-size: 16px;

    background: rgba(255,255,255,0.9);
    padding: 10px;
    border-radius: 10px;
}

/* выравнивание */
.left-text {
    text-align: left;
}

.right-text {
    text-align: right;
}

/* КНОПКА — фикс */
.choice-btn {
    position: fixed; /* ВАЖНО */
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);

    padding: 12px 20px;
    background: black;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 100;
}


/* quest2.html */

.quest2 {
    margin: 0;
    height: 100vh;
    background: url('assets/fon_quest2.png') center/cover no-repeat;
    position: relative;
}
/* БЛОК ВРАГОВ ПО ЦЕНТРУ */
.enemies {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* идеально центрирует */

    display: flex;
    flex-direction: column;
    align-items: center;

    z-index: 2;
}

/* картинка */
.enemies img {
    width: 220px;
    height: auto;
    border-radius: 20px;
}
/* АНИМАЦИЯ ПОЯВЛЕНИЯ ОКНА */
.dg-window {
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* АНИМАЦИЯ МЕДАЛИ */
.result-img {
    width: 120px;
    margin: 15px 0;
    animation: medalDrop 0.6s ease;
}

@keyframes medalDrop {
    0% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
    60% {
        transform: translateY(20px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ПЛАВНОЕ ЗАТУХАНИЕ */
.fade-out {
    animation: fadeOut 0.6s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* текст */
.enemies-text {
    position: absolute;
    top: 15px;

    font-size: 20px;
    font-weight: bold;
    color: black;
}
.dg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.dg-window {
    background: #eaeaea;
    width: 600px;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    position: relative;
}

.dg-close {
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
    font-size: 20px;
}

.dg-columns {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
}

.dg-col {
    width: 45%;
}

.dg-col button {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    cursor: pointer;
}

.dg-check {
    margin-top: 30px;
    padding: 10px 20px;
}
.result-img {
    width: 50px;
    margin: 15px 0;
}
.hint-box {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

/* картинка справа */
.hint-img {
    float: right;
    width: 120px;
    margin-left: 15px;
    margin-bottom: 10px;
}

/* текст обтекает */
.hint-box p {
    font-size: 16px;
    line-height: 1.4;
}
/* quest3.html */
#counterText {
    transition: 0.3s;
}

.reset-anim {
    color: red;
    transform: scale(1.2);
}
/* контейнер бревен */
#logs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

/* одно бревно */
.log {
    width: 40px;
    height: 80px;
    background: url("assets/log.png") center/cover no-repeat;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.3s;
}

/* появление */
.log.show {
    opacity: 1;
    transform: translateY(0);
}

/* кнопки */
.actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

/* menu.html *//* =========================
   КОНТЕЙНЕР
========================= */
.rurik-menu {
    position: fixed;
    inset: 0;
    display: none;
    font-family: 'Arial', sans-serif;
    z-index: 1000;
}

/* =========================
   ФОН
========================= */
.rurik-bg {
    position: absolute;
    inset: 0;
    background: url("assets/fon_menu.png") center/cover no-repeat;
    z-index: 1;
}

/* =========================
   ЛОГО
========================= */
.rurik-logo {
    position: absolute;
    top: 50px;
    left: 700px;

    width: 160px;   /* 🔥 небольшой размер */
    height: auto;

    z-index: 2;
}

/* =========================
   НАЗВАНИЕ
========================= */
.rurik-title {
    position: absolute;
    top: 120px;   /* ниже логотипа */
    left: 20px;

    font-size: 140px;  /* 🔥 крупнее */
    color: #8b0000;
    letter-spacing: 4px;
    z-index: 2;
}

/* =========================
   КНОПКИ (СЕРЕДИНА ЭКРАНА)
========================= */
.rurik-buttons {
    position: absolute;
    top: 50%;           /* 🔥 центр по вертикали */
    left: 80px;
    transform: translateY(-20%); /* чуть выше центра */

    display: flex;
    flex-direction: column;
    gap: 18px;

    z-index: 2;
}

.rurik-btn {
    width: 240px;
    padding: 14px;
    font-size: 18px;

    border: none;
    cursor: pointer;

    background: linear-gradient(#eee, #cfcfcf);
    border-radius: 6px;
    box-shadow: 0 3px 0 #999;

    transition: 0.2s;
}

.rurik-btn:hover {
    transform: translateY(-2px) scale(1.03);
}

.rurik-btn.main {
    background: linear-gradient(#c62828, #8e0000);
    color: white;
    box-shadow: 0 3px 0 #5a0000;
}

/* =========================
   ПЕРСОНАЖ
========================= */
.rurik-character {
    position: absolute;
    right: 60px;
    bottom: 60px;

    height: 75%;
    max-height: 800px;

    object-fit: contain;
    z-index: 2;
}
/* quest3.html */
.quest3 {
    margin: 0;
    height: 100vh;
    background: url('assets/fon_quest3.png') center/cover no-repeat;
    position: relative;
}
/* quest4.html */
.quest4 {
    margin: 0;
    height: 100vh;
    background: url('assets/fon_quest4.png') center/cover no-repeat;
    position: relative;
}
/* quest5.html */
.quest5 {
    margin: 0;
    height: 100vh;
    background: url('assets/fon_quest5.png') center/cover no-repeat;
    position: relative;
}

/* ===== СЦЕНА 4 ===== */
.scene4 {
    margin: 0;
    height: 100vh;
    background: url('assets/fon-rurik.png') center/cover no-repeat;
    position: relative;
}