/* ======================================================= */
/* 1. ПОДКЛЮЧЕНИЕ ШРИФТОВ (ПУТЬ: pixel.otf) */
/* ======================================================= */

@font-face {
    font-family: 'PixelatedDisplay';
    src: url('pixel.otf') format('opentype'); 
    font-weight: normal;
    font-style: normal;
}


:root {
    /* Настройки */
    --transition-speed: 0.4s;
    --mine-color: rgba(125, 68, 147, 0.4); 
    --hytale-color: rgba(209, 154, 102, 0.4); 
    --top-right-cut: -60%; 
    --bottom-left-cut: 160%; 
    
    /* Размеры логотипа (для десктопа) */
    --logo-width: 400px;
    --logo-height: 200px; 
}

/* --- Общие стили и Секции --- */

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.split-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

.split-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: all var(--transition-speed) ease-in-out;
    cursor: pointer;
    text-decoration: none; 
    color: white;
    
    background-image: url('логоы копия.png'); 
    background-size: cover; 
    background-position: center center;
    
    filter: brightness(0.7); 
    transform: scale(1.0) translateZ(0); 
}

.mine-section {
    z-index: 2; 
    background-color: var(--mine-color);
    background-blend-mode: multiply; 
    /* Используем диагональный clip-path */
    clip-path: polygon(0 0, 100% 0, 100% var(--top-right-cut), 0% var(--bottom-left-cut));
    background-position: left center;
}

.hytale-section {
    z-index: 1;
    background-color: var(--hytale-color);
    background-blend-mode: multiply;
    /* Используем диагональный clip-path */
    clip-path: polygon(0% 100%, 100% 100%, 100% var(--top-right-cut), 0% var(--bottom-left-cut));
    background-position: right center;
}

/* --- Анимация и Эффекты (Обводка) --- */

.mine-section:hover {
    box-shadow: 
        0 0 0 5px white, 
        0 0 30px #c299e4; 
    transform: scale(1.03) translateZ(0); 
    z-index: 3;
    filter: brightness(1.2); 
}
.hytale-section:hover {
    box-shadow: 
        0 0 0 5px white, 
        0 0 30px #ffd794; 
    transform: scale(1.03) translateZ(0); 
    z-index: 3;
    filter: brightness(1.2); 
}


/* --- Центральный контент (РАЗДЕЛЕННЫЙ ЛОГОТИП) --- */
.content {
    position: fixed; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
    
    width: var(--logo-width); 
    height: var(--logo-height);
    /* !!! ИЗМЕНЕНИЕ: Убираем логотип на мобильных, но оставляем его на десктопе */
    transition: opacity var(--transition-speed) ease-out; 
}

.main-logo-part {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background-image: url('logo.png'); /* Имя файла логотипа */
    background-size: var(--logo-width) var(--logo-height); 
    background-repeat: no-repeat;
    background-position: center center;
    
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.7)); 
    transition: all var(--transition-speed) ease-out;
}

.logo-mine {
    clip-path: polygon(0 0, 100% 0, 100% var(--top-right-cut), 0% var(--bottom-left-cut));
}

.logo-hytale {
    clip-path: polygon(0% 100%, 100% 100%, 100% var(--top-right-cut), 0% var(--bottom-left-cut));
}

/* --- Эффекты логотипа при наведении --- */

.mine-section:hover ~ .content .logo-mine {
    filter: brightness(1.2) drop-shadow(0 0 15px #c299e4);
    transform: scale(1.05); 
}

.mine-section:hover ~ .content .logo-hytale {
    filter: brightness(0.5); 
}

.hytale-section:hover ~ .content .logo-hytale {
    filter: brightness(1.2) drop-shadow(0 0 15px #ffd794);
    transform: scale(1.05);
}

.hytale-section:hover ~ .content .logo-mine {
    filter: brightness(0.5); 
}


/* --- Названия игр в углах: ПИКСЕЛЬНЫЙ ШРИФТ (РАЗМЕР 2em) --- */

.game-title {
    position: absolute;
    color: white;
    font-size: 2em; 
    font-weight: 900; 
    
    font-family: 'PixelatedDisplay'; 
    
    text-shadow: 0 0 5px rgba(0, 0, 0, 1), 0 0 10px rgba(0, 0, 0, 1);
    opacity: 0; 
    transition: all var(--transition-speed) ease-out;
    letter-spacing: 2px;
    padding: 20px;
    z-index: 4; 
}

/* 1. Mine: Верхний правый (Десктоп) */
.mine-title {
    top: 15%; 
    right: 70%;
    text-align: right;
    transform: translateX(50px); 
}

/* 2. Hytale: Нижний левый (Десктоп) */
.hytale-title {
    bottom: 15%;
    left: 70%;
    text-align: left;
    transform: translateX(-50px); 
}

/* Эффект появления при наведении (Десктоп) */
.mine-section:hover .mine-title {
    opacity: 1; 
    transform: translateX(0); 
    text-shadow: 0 0 5px rgba(0, 0, 0, 1), 0 0 10px rgba(0, 0, 0, 1), 0 0 10px #ffffff;
}
.hytale-section:hover .hytale-title {
    opacity: 1; 
    transform: translateX(0); 
    text-shadow: 0 0 5px rgba(0, 0, 0, 1), 0 0 10px rgba(0, 0, 0, 1), 0 0 10px #ffffff;
}


/* --- ОПИСАНИЯ ПРОЕКТА: ПИКСЕЛЬНЫЙ ШРИФТ (ФИНАЛЬНЫЙ ОТСТУП) --- */

.project-description {
    position: absolute;
    color: white;
    font-size: 0.7em; 
    font-weight: normal; 
    
    font-family: 'PixelatedDisplay'; 
    
    line-height: 1.6;
    opacity: 0; 
    transition: all var(--transition-speed) ease-out 0.1s; 
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9); 
    
    /* Увеличенный боковой отступ */
    padding: 0 50px; 
    z-index: 4;
}

/* 1. Позиционирование описания MINECRAFT (Десктоп) */
.mine-desc {
    top: calc(15% + 100px); 
    right: 70%;
    text-align: right;
    transform: translateX(60px); 
}

/* 2. Позиционирование описания HYTALE (Десктоп) */
.hytale-desc {
    bottom: calc(15% + 120px); 
    left: 70%;
    text-align: left;
    transform: translateX(-60px); 
}

/* Эффект появления при наведении */
.mine-section:hover .mine-desc {
    opacity: 1;
    transform: translateX(0);
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 0 0 5px rgba(255, 255, 255, 0.5); 
}

.hytale-section:hover .hytale-desc {
    opacity: 1;
    transform: translateX(0);
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 0 0 5px rgba(255, 255, 255, 0.5);
}


/* --- Адаптивность для телефона --- */
@media (max-width: 768px) {
    
    /* 1. Скрываем центральный логотип */
    .content {
        opacity: 0;
        visibility: hidden;
    }
    
    /* 2. Уменьшаем шрифт примерно в 2 раза (1.5em -> 0.75em, 0.7em -> 0.4em) */
    .game-title {
        font-size: 0.75em; /* Уменьшили шрифт заголовка */
        opacity: 1; 
        padding: 5px 10px;
    }
    
    .project-description {
        font-size: 0.4em; /* Уменьшили шрифт описания */
        opacity: 1; 
        line-height: 1.4;
        padding: 0 10px; 
    }

    /* 3. Позиционирование: Mine - к левой стенке, Hytale - к правой стенке */
    
    /* Общие стили для мобильного позиционирования */
    .game-title,
    .project-description {
        left: 0; /* Отключаем центрирование */
        transform: none; /* Сброс translateX(-50%) */
        width: 45%; /* Ограничиваем ширину, чтобы не пересекались */
        padding: 0 15px;
    }
    
    /* --- MINECRAFT (К левой стенке) --- */
    .mine-title,
    .mine-desc {
        text-align: left; /* Выравнивание по левому краю */
        left: 0; /* Прижимаем к левому краю */
    }

    .mine-title {
        top: 15%; /* Позиция сверху */
    }
    .mine-desc {
        top: calc(15% + 35px); /* Сдвиг ниже заголовка */
    }
    
    /* --- HYTALE (К правой стенке) --- */
    .hytale-title,
    .hytale-desc {
        text-align: right; /* Выравнивание по правому краю */
        right: 0; /* Прижимаем к правому краю */
        left: auto; /* Отключаем left: 0 */
    }
    
    .hytale-title {
        bottom: 25%; /* Позиция снизу */
    }
    .hytale-desc {
        bottom: calc(25% + 35px); /* Сдвиг выше заголовка */
    }
    
    /* Сброс анимации вылета (для мобильных, чтобы не было сдвига) */
    .mine-section:hover .mine-title,
    .hytale-section:hover .hytale-title,
    .mine-section:hover .mine-desc,
    .hytale-section:hover .hytale-desc {
        transform: none;
    }
}

/* ======================================================= */
/* 2. СТИЛИ ДЛЯ ДОНАТ-МАГАЗИНА (МОДАЛЬНОЕ ОКНО) - V2 COMPACT/CLEAN */
/* ======================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Прозрачный фон для затемнения */
    background-color: rgba(0, 0, 0, 0.85);
    display: none; /* Скрыто по умолчанию, показывается через JS */
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.shop-modal {
    /* Темный фон */
    background-color: #222;
    /* Стиль обводки из Mine-section */
    border: 4px solid white;
    /* Уменьшенная тень для компактности */
    box-shadow: 0 0 0 4px var(--mine-color), 0 0 20px #c299e4; 
    width: 95%; 
    max-width: 380px; /* Оптимальная ширина для десктопа/планшета */
    border-radius: 4px;
    overflow: hidden;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    animation: fadeIn 0.3s ease-out;
}

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

/* Шапка модального окна */
.modal-header {
    background-color: var(--mine-color);
    padding: 10px 15px; 
    font-size: 1.1em;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid white;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em; 
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ffd794; 
}

.modal-content-shop {
    padding: 15px; 
}

.form-group {
    margin-bottom: 15px; 
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9em;
    color: #ffd794; 
    font-weight: 600; 
}

/* Поля ввода (Применяется к nickname, email, quantity) */
#nickname,
#email-input, /* !!! ИСПРАВЛЕНО: Добавлен email-input !!! */
#quantity-input {
    width: 100%;
    padding: 8px; 
    border: 1px solid #777;
    background-color: #333;
    color: white;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.2s;
    border-radius: 2px;
}

#nickname:focus,
#email-input:focus { /* !!! ИСПРАВЛЕНО: Добавлен email-input !!! */
    border-color: #c299e4;
    box-shadow: 0 0 4px #c299e4;
}

/* Контроль количества */
.quantity-control {
    display: flex;
    align-items: center;
}

.quantity-btn {
    background-color: var(--mine-color);
    color: white;
    border: 1px solid white;
    padding: 6px 10px; 
    font-size: 1em;
    cursor: pointer;
    width: 35px; /* Уменьшенная ширина */
    height: 35px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s, box-shadow 0.2s;
    user-select: none;
    font-weight: bold; 
    
    /* !!! ИСПРАВЛЕНО: Убираем цифру "5" из кнопок, остается только знак !!! */
    /* Текст +/- будет задан прямо в HTML-тегах */
}

.quantity-btn:hover {
    background-color: #c299e4;
}

#quantity-input {
    flex-grow: 1;
    text-align: center;
    margin: 0 8px; 
    max-width: 70px; 
    -moz-appearance: textfield;
}

#quantity-input::-webkit-outer-spin-button,
#quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Сводка (Итого) */
.summary {
    margin-top: 15px; 
    padding: 10px; 
    border: 1px solid var(--hytale-color); 
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: 500;
}

.summary-line {
    margin: 5px 0;
    font-size: 1em;
}

.summary-line span {
    color: #ffd794;
    font-weight: bold;
}

/* Подвал и кнопки */
.modal-footer {
    padding: 10px 15px; 
    background-color: #1a1a1a;
    display: flex;
    justify-content: space-between;
}

.modal-button {
    flex: 1;
    padding: 10px 15px; 
    margin: 0 4px; 
    border: 1px solid white;
    font-size: 0.95em;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    font-weight: bold; 
    border-radius: 2px;
}

.cancel-button {
    background-color: #555;
    color: white;
}

.cancel-button:hover {
    background-color: #777;
}

.pay-button {
    background-color: #38a169; 
    color: white;
}

.pay-button:hover {
    background-color: #48bb78;
    box-shadow: 0 0 8px #38a169;
}

/* !!! ИСПРАВЛЕНО: Адаптация для мобильных устройств (менее 450px) !!! */
@media (max-width: 450px) {
    .shop-modal {
        max-width: 90%; /* Немного уменьшили, чтобы избежать скролла на узких экранах */
        margin: 10px auto; 
    }
    
    /* Кнопки в подвале становятся вертикальными */
    .modal-footer {
        flex-direction: column;
        padding: 10px;
    }
    
    .modal-button {
        margin: 5px 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .modal-content-shop {
        padding: 10px;
    }
}