/*
Theme Name: Halloween Game
Author: Enothost
Description: Halloween mini-game WP theme
Version: 2.0
*/

@import url('https://fonts.googleapis.com/css2?family=Zen+Antique&family=Dela+Gothic+One&display=swap');
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: url("./assets/background.webp") no-repeat center center fixed;
    background-size: cover;
    overflow-x: hidden;
}

/* Заголовок и слоган поверх всего */
.header-section {
    text-align: center;
    position: fixed;
    top: 100px; /* Опущен ниже */
    width: 100%;
    z-index: 100;
    pointer-events: none;
    transition: 0.5s;
}

.header-section.hidden {
    opacity: 0;
    transform: translateY(-20px);
}

.header-section h1 {
    font-size: 30px !important; /* Увеличен основной размер */
	font-weight: revert;
    color: #FF6F61;
    margin-bottom: 10px;
    font-family: 'Zen Antique', serif;
    text-shadow: 2px 2px 5px #000;
}

/* Второй текст после нажатия кнопки */
#gameText {
    display: none;
    position: fixed;
    top: 220px;
    width: 100%;
    text-align: center;
    z-index: 100;
    color: #FFD700;
    font-family: 'Zen Antique', serif;
    text-shadow: 1px 1px 3px #000;
    transition: 0.5s;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: url("./assets/f1.png") no-repeat center center;
    background-size: contain;
    background-color: #020305; /* Заполняет пустые зоны */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
    z-index: 10;
}


/* Кнопка начала игры */
.start-btn {
    background: linear-gradient(180deg, #ff8a00 0%, #ff4d00 100%);
    color: #fff;
    border: none;
    padding: 15px 60px;
    font-size: 18px;
    font-family: 'Dela Gothic One', sans-serif;
    cursor: pointer;
    border-radius: 40px;
    z-index: 11;
    transition: 0.3s;
    box-shadow: 0 0 15px rgba(255, 100, 0, 0.6);
    margin-bottom: 12vh; /* Позиционирование под окошко на фото */
}

.start-btn:hover {
    transform: scale(1.05);
}

/* Карточки */
.cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    z-index: 12;
    position: relative;
}

.card {
    width: 120px;
    height: 160px;
    perspective: 1000px;
    position: relative;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    backface-visibility: hidden;
    overflow: hidden;
}

.card-front { z-index: 2; }

.card-back {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.card-back img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.card-border {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: url('./assets/border.webp') no-repeat center/cover;
    pointer-events: none;
    z-index: 3;
}

/* Попапы победы и поражения */
.popup {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    z-index: 200;
    transition: 0.3s;
}

.popup.active { visibility: visible; }

.popup-content {
    background: orange;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    z-index: 201;
}

.popup-content p {
    color: black;
    font-size: 22px !important;
    margin-bottom: 20px;
}

.popup-content button {
    display: inline-block;
    background: black;
    color: orange;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: 0.3s;
}

.popup-content a:hover {
    background: #333;
    color: #FFD700;
}

#message-popup .popup-content {
    background: orange;
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    max-width: 300px;
    z-index: 201;
}

#message-popup .popup-content p { font-size: 18px !important; margin-bottom: 15px; }

#message-popup .popup-content a {
    background: black;
    color: orange;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
    cursor: pointer;
    transition: 0.3s;
}

#message-popup .popup-content a:hover { background: #333; color: #FFD700; }

/* Canvas для стирания */
.scratch-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 4;
}

/* Попытки */
#attempts-counter {
    color: white;
    font-size: 18px !important;
    margin-top: 20px;
    text-align: left;
    align-self: flex-start;
    z-index: 12;
}

/* Адаптив */
@media (min-width: 1024px) {
    .card { width: 200px; height: 260px; }
    .header-section h1 { font-size: 36px !important; }
    .header-section p { font-size: 20px !important; top: 0px !important;}
    #gameText { font-size: 24px !important;}
}


/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    /* Первый текст — немного меньше */
    .header-section h1 { font-size: 30px !important; font-weight: revert !important; }
    .header-section p { font-size: 18px !important; }

    /* Второй текст — крупный */
    #gameText { font-size: 20px !important; top: 180px !important; }

    /* Карточки — меньше расстояние между ними */
    .cards { gap: 10px !important; }

    /* Счетчик попыток — сдвинуть вправо */
    #attempts-counter {
        text-align: right !important;
        align-self: flex-end !important;
        margin-right: 10px !important;
        font-size: 16px !important;
    }
}
/* Смартфоны до 480px — поднимаем кнопку выше */
@media (max-width: 480px) {
    .start-btn {
        margin-bottom: 21vh !important; /* было 16vh — поднимаем выше */
        padding: 12px 50px; /* чуть компактнее, чтобы не вылезала за края */
        font-size: 20px;
    }

    .header-section h1 {
        font-size: 30px !important;
		font-weight: revert !important;
    }

    .header-section p {
        font-size: 16px !important;
    }
}
.cards {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 12;
    width: 100%;
}
/* Гифка под карточками, изначально скрыта */
.scratch-bg {
    display: none;
    position: absolute;
    top: 10%; /* опустить под карточки */
    left: 50%;
    transform: translateX(-50%);
    width: 280px; /* меньше ширина */
    height: 120px; /* меньше высота */
    background: url('./assets/hint.gif') no-repeat center center;
    background-size: contain;
    opacity: 1; /* чуть прозрачнее для реализма */
    z-index: 1;
    pointer-events: none;
}

