* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    font-family: 'Georgia', serif;
    background:
        radial-gradient(ellipse at center, #3d2817 0%, #1a0f08 100%);
    color: #fff;
    padding: 20px;
}

.menu-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

/* Заголовок */
.game-title {
    font-size: 64px;
    color: #ffd700;
    text-shadow:
        3px 3px 0 #8b6914,
        6px 6px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

.game-subtitle {
    font-size: 20px;
    color: #d4a574;
    margin-bottom: 30px;
    font-style: italic;
}

/* Статистика игрока */
.player-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
}

.stat {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 18px;
    border: 2px solid rgba(212, 165, 116, 0.3);
}

.stat strong {
    color: #ffd700;
    font-size: 20px;
}

/* Сетка уровней */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}


/* === Базовая кнопка уровня === */
.level-btn {
    position: relative;
    height: 120px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;

    /* Убираем лишние отступы */
    padding: 0;
    margin: 0;

    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    user-select: none;
}

/* === Доступный уровень (деревянный) === */
.level-btn.available {
    background: linear-gradient(135deg, #d4a574 0%, #b8864e 50%, #a0723c 100%);
    border: 4px solid #6b4423;
    box-shadow:
        inset 0 2px 5px rgba(255, 220, 180, 0.5),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3),
        0 4px 10px rgba(0, 0, 0, 0.4);
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.level-btn.available:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow:
        inset 0 2px 5px rgba(255, 220, 180, 0.5),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3),
        0 8px 20px rgba(0, 0, 0, 0.5);
    border-color: #ffd700;
}

/* === Пройденный уровень (золотой) === */
.level-btn.completed {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #f0c000 100%);
    border: 4px solid #b8860b;
    box-shadow:
        inset 0 2px 5px rgba(255, 255, 255, 0.5),
        inset 0 -2px 5px rgba(0, 0, 0, 0.2),
        0 4px 15px rgba(255, 215, 0, 0.4);
    color: #5c3a1e;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.level-btn.completed:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow:
        inset 0 2px 5px rgba(255, 255, 255, 0.5),
        inset 0 -2px 5px rgba(0, 0, 0, 0.2),
        0 8px 25px rgba(255, 215, 0, 0.6);
}

/* === Закрытый уровень === */
.level-btn.locked {
    background: linear-gradient(135deg, #4a4a4a 0%, #2d2d2d 100%);
    border: 4px solid #1a1a1a;
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(80%);
    pointer-events: none;
}

/* === Номер уровня === */
.level-number {
    font-size: 48px;
    font-weight: bold;
    line-height: 1;

    line-height: 1;
    margin: 0;
    padding: 0;

    /* На всякий случай */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Иконка замка === */
.lock-icon {
    font-size: 40px;
    opacity: 0.7;
    margin: 0;
    padding: 0;
}

/* === Адаптивность === */
@media (max-width: 600px) {
    .level-btn {
        height: 100px;
    }
    .level-number {
        font-size: 36px;
    }
    .lock-icon {
        font-size: 32px;
    }
}

/* Премиум-уровни */
.level-btn.premium {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    border: 4px solid #6c3483;
    cursor: pointer;
}

.level-btn.premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4);
}

.level-btn.premium::after {
    content: '💎';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 16px;
}

/* Кнопка случайного уровня */
.random-btn {
    padding: 15px 40px;
    font-size: 20px;
    font-family: 'Georgia', serif;
    font-weight: bold;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    border: 4px solid #1B5E20;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.random-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

/* Загрузка */
.loading {
    grid-column: 1 / -1;
    font-size: 20px;
    color: #d4a574;
    padding: 40px;
}

/* Адаптивность */
@media (max-width: 600px) {
    .game-title {
        font-size: 48px;
    }
    .levels-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }
    .level-btn {
        height: 110px;
    }
    .level-btn .level-number {
        font-size: 36px;
    }
}

.premium-banner {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #f0c000 100%);
    border: 3px solid #b8860b;
    border-radius: 16px;
    padding: 20px;
    margin: 20px auto;
    max-width: 700px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    color: #5c3a1e;
}

.premium-banner h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.premium-features {
    list-style: none;
    padding: 0;
    margin: 5px 0;

    display: flex;              /* ← меняем grid на flex */
    flex-direction: row;        /* ← горизонтально */
    justify-content: center;    /* ← по центру */
    gap: 10px;                  /* ← расстояние между элементами */
    flex-wrap: wrap;            /* ← перенос на мобильных */
}

.premium-features li {
    flex: 1;
    min-width: 120px;
    text-align: center;

    /* Размер шрифта адаптируется: минимум 12px, желательно 14px, максимум 18px */
    font-size: clamp(12px, 1.2vw, 16px);

    /* Запрет переноса */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-premium {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.btn-premium:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

/* Премиум-уровни */
.level-btn.premium {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    border: 4px solid #6c3483;
    cursor: pointer;
}

.level-btn.premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4);
}

.level-btn.premium::after {
    content: '💎';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 16px;
}

#premium-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.premium-modal-content {
    background: linear-gradient(135deg, #ffe259 0%, #ffa751 100%);
    border: 4px solid #d4a843;
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modal-appear 0.3s ease;
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #4a3c1a;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: rotate(90deg);
}

.premium-title {
    font-size: 32px;
    color: #3d2e1a;
    margin-bottom: 20px;
    text-align: center;
}


/* Список преимуществ */
.premium-features-list {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 16px;
    color: #3d2e1a;
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-icon {
    font-size: 20px;
}

.feature-text {
    font-weight: 500;
}


/* Кнопки */
.premium-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-buy-premium {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    padding: 16px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

.btn-buy-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6);
}

.btn-later {
    background: transparent;
    border: 2px solid #8b7355;
    color: #5c4a1e;
    padding: 12px;
    font-size: 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-later:hover {
    background: rgba(0, 0, 0, 0.1);
}

.loading-overlay {
    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;
    z-index: 9999;
    backdrop-filter: blur(5px);
}
