/* === МОБИЛЬНЫЙ ДИЗАЙН ДЛЯ BIG WORLD === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
}

/* Основной контейнер — вертикальный */
.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 8px;
    gap: 8px;
}

/* Панель — сверху, не более 45% высоты */
.panel {
    background: rgba(25, 42, 86, 0.95);
    border-radius: 14px;
    padding: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    max-height: 45vh;
    display: flex;
    flex-direction: column;
}

.panel h2 {
    text-align: center;
    margin-bottom: 12px;
    color: #4fc3f7;
    font-size: 1.4em;
    font-weight: 600;
}

/* Ресурсы — компактно */
.resources-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.resources-section h3 {
    text-align: center;
    color: gold;
    font-size: 1em;
    margin-bottom: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 6px 0;
}

.stat-label {
    color: #80deea;
    font-weight: 500;
}

.stat-value {
    color: #fff;
    font-weight: 600;
}

/* Выбор страны — крупно */
.country-selection {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.country-selection h3 {
    color: #4fc3f7;
    margin-bottom: 12px;
    font-size: 1.1em;
}

#country-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #4fc3f7;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 16px;
    margin-bottom: 12px;
}

.select-country-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(45deg, #2196f3, #64b5f6);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.select-country-btn:hover,
.select-country-btn:active {
    transform: scale(0.98);
}

/* Кнопки статистики и построенных зданий */
.info-btn {
    width: 100%;
    padding: 14px;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #2196f3, #21cbf3);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.info-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.info-btn:active {
    transform: translateY(0);
}

/* Кнопка построек — прилипает снизу */
.open-buildings-btn {
    position: sticky;
    bottom: 0;
    width: 100%;
    padding: 16px;
    background: linear-gradient(45deg, #9c27b0, #e91e63);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
    margin-top: auto;
}

/* Карта — занимает 55% экрана */
#map {
    flex: 1;
    height: 55vh;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    background: #0a0a14;
}

.leaflet-container {
    background: #0a0a14 !important;
    height: 100%;
}

/* === Модальные окна === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(25, 42, 86, 0.95);
    margin: 10px auto;
    width: 95%;
    max-width: none;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #4fc3f7;
    font-size: 1.3em;
}

.close {
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #fff;
}

.modal-body {
    padding: 16px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Скроллбар */
.panel::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.panel::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: #4fc3f7;
    border-radius: 3px;
}

/* Адаптивность для десктопа */
@media (min-width: 768px) {
    .game-container {
        flex-direction: row;
        padding: 15px;
        gap: 15px;
    }

    .panel {
        width: 320px;
        max-height: none;
        overflow: visible;
    }

    #map {
        flex: 1;
        height: auto;
    }

    .open-buildings-btn {
        position: static;
        margin-top: 15px;
    }
}