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

body {
    margin: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#gameCanvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background-color: #2c3e50;
}

/* Стили для экрана выбора сохранений */
.screen-container {
    position: fixed;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #2c3e50;
}

.save-screen {
    background-color: #34495e;
    border-radius: 10px;
    padding: 30px;
    width: 600px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    color: #ecf0f1;
    text-align: center;
}

/* Стили для заголовка с версией */
.save-screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.save-screen h1 {
    margin: 0;
    color: #f1c40f;
    font-family: 'Times New Roman', serif;
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    flex: 1;
    text-align: center;
}

.game-version-badge {
    position: absolute;
    top: 5px;
    right: 0;
    background-color: #2c3e50;
    color: #ecf0f1;
    font-size: 14px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 15px;
    border: 1px solid #3498db;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.save-slots {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.save-slot {
    background-color: #2c3e50;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.save-slot:hover {
    background-color: #3c536c;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.save-slot.empty {
    border: 2px dashed #7f8c8d;
}

.save-slot.empty:hover {
    border-color: #3498db;
}

.slot-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.slot-title {
    font-size: 20px;
    font-weight: bold;
    color: #f1c40f;
}

.slot-details {
    color: #bdc3c7;
    font-size: 14px;
}

.slot-location {
    color: #e74c3c;
}

/* Стили для мета-информации сохранения (версия и время игры) */
.slot-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 5px;
}

.slot-version {
    font-size: 12px;
    font-weight: bold;
    /* Цвет устанавливается динамически в JavaScript */
}

.slot-playtime {
    font-size: 12px;
    color: #3498db;
}

.slot-resources {
    margin-left: auto;
    display: flex;
    gap: 15px;
}

.resource {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.resource-value {
    font-size: 18px;
    font-weight: bold;
    color: #f1c40f;
}

.resource-label {
    font-size: 12px;
    color: #bdc3c7;
}

.new-game-button {
    color: #2ecc71;
    font-weight: bold;
}

/* Плавная анимация показа/скрытия экранов */
.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* Стили для иконки удаления сохранения */
.delete-save {
    position: relative;
    font-size: 22px;
    color: #e74c3c;
    cursor: pointer;
    margin-left: 15px;
    opacity: 0.7;
    transition: all 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.delete-save:hover {
    opacity: 1;
    background-color: rgba(231, 76, 60, 0.2);
    transform: scale(1.1);
}

/* При наведении на слот показываем иконку удаления */
.save-slot:hover .delete-save {
    opacity: 0.9;
}

/* Стили для тултипа */
.delete-save[title]:hover::after {
    content: attr(title);
    position: absolute;
    background-color: #2c3e50;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    top: -30px;
    right: 0;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Стили для системы энергии в слоте сохранения */
.slot-resources .resource:nth-child(4) {
    background-color: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 5px;
    padding: 5px;
}

.slot-resources .resource:nth-child(4) .resource-label {
    color: #ffcc00;
    font-weight: bold;
}

.slot-resources .resource:nth-child(4) .resource-value {
    color: #ffcc00;
}

/* Стили для иконки энергии */
.energy-icon {
    color: #ffcc00;
    font-size: 1.2em;
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
}

/* Стили для тултипа энергии */
.energy-tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    border: 1px solid #ffcc00;
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
    font-size: 14px;
    pointer-events: none;
    z-index: 100;
}

/* Анимация пульсации для индикатора энергии */
@keyframes energyPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 204, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 204, 0, 0); }
}

/* Класс для низкого уровня энергии */
.energy-low {
    animation: energyPulse 1.5s infinite;
} 