/* Google Fonts для кириллицы */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;700&family=Roboto:wght@400;700&display=swap');

/* Общие стили для body */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif; /* Основной текст, хорошо читается */
    color: #e0f2f1; /* Светлый, слегка голубоватый текст */
    background: #0a1118; /* Очень темный, почти черный фон */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    /* Заглушка для вашего фона. Замените 'your-pirate-game-background.jpg' на реальный путь к вашему изображению! */
    background-image: url('https://i.imgur.com/3Z8q0t5.jpeg'); /* Игровой фон: корабль в море, туман */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7); /* Тень для лучшей читаемости */
}

/* Затемнение и блюр фона */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8); /* Сильное затемнение */
    backdrop-filter: blur(8px); /* Сильный блюр */
    z-index: 0;
}

/* Основной контейнер */
.container {
    position: relative;
    z-index: 1;
    background: linear-gradient(145deg, rgba(20, 40, 60, 0.95), rgba(10, 25, 40, 0.98)); /* Темный градиент для глубины */
    padding: 40px 60px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), inset 0 0 10px rgba(70, 130, 180, 0.3); /* Глубокая тень и легкое внутреннее свечение */
    max-width: 900px;
    width: 90%;
    text-align: center;
    border: 2px solid #3a506b; /* Темно-синяя/стальная рамка */
    /* Эффект легкой текстуры металла/старой бумаги, но очень тонко */
    background-image: url('https://www.transparenttextures.com/patterns/dark-fish-skin.png');
    background-repeat: repeat;
}

/* Header */
header h1 {
    font-family: 'Exo 2', sans-serif; /* Более современный, но характерный шрифт */
    font-size: 3.8em;
    color: #ffd700; /* Золотистый цвет для названия игры */
    margin-bottom: 30px;
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 5px rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid rgba(255, 215, 0, 0.4); /* Тонкая золотая линия */
    padding-bottom: 15px;
}

/* Секции игры */
.game-section {
    display: none;
    animation: fadeIn 1s ease-out forwards;
}

.game-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Заголовки секций */
h2 {
    font-family: 'Exo 2', sans-serif;
    font-size: 2.8em;
    color: #87ceeb; /* Небесно-голубой, морской */
    margin-bottom: 25px;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7), 0 0 8px rgba(135, 206, 235, 0.4);
}

/* Параграфы текста */
p {
    font-size: 1.15em;
    line-height: 1.7;
    margin-bottom: 20px;
    color: #cce7f0; /* Чуть темнее светлого текста */
}

/* Кнопки */
.button-glow {
    background: linear-gradient(145deg, #1e90ff, #0056b3); /* Синий градиент */
    color: #ffffff;
    border: none;
    padding: 18px 35px;
    font-size: 1.3em;
    font-family: 'Exo 2', sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: 1px solid #004080;
}

.button-glow:hover {
    background: linear-gradient(145deg, #0056b3, #1e90ff); /* Обратный градиент при наведении */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7), inset 0 0 15px rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

/* Списки команды */
.crew-list {
    list-style: none;
    padding: 0;
    margin-top: 30px;
}

.crew-list li {
    background: rgba(40, 60, 80, 0.7); /* Темно-синий полупрозрачный фон */
    border: 1px solid #3a506b;
    padding: 15px 25px;
    margin-bottom: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1em;
    color: #e0f2f1;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4);
}

.crew-list li:hover:not(.selected-captain) {
    background: rgba(50, 75, 100, 0.9); /* Чуть светлее при наведении */
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6), 0 0 10px rgba(70, 130, 180, 0.4);
}

.crew-list li.selected-captain {
    background: linear-gradient(145deg, #ffd700, #b8860b); /* Золотистый градиент */
    color: #2c1a0e; /* Темно-коричневый текст */
    font-weight: bold;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.7), inset 0 0 10px rgba(255, 255, 255, 0.5);
    pointer-events: none;
    border: 1px solid #a87e00;
}

.info-message {
    margin-top: 20px;
    font-size: 1.15em;
    color: #f0e68c; /* Золотистый хаки */
    min-height: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* Стили для распределения ролей */
.role-assignment-grid {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.players-column, .roles-column {
    flex: 1;
    min-width: 300px;
    background: rgba(30, 50, 70, 0.8); /* Темно-синий полупрозрачный */
    border: 1px solid #4a6b8a;
    border-radius: 10px;
    padding: 25px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.players-column h3, .roles-column h3 {
    font-family: 'Exo 2', sans-serif;
    color: #87ceeb;
    font-size: 2em;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
    border-bottom: 1px dotted rgba(135, 206, 235, 0.5);
    padding-bottom: 10px;
}

#available-crew-list li {
    cursor: grab;
    background: rgba(60, 90, 120, 0.7); /* Более светлый синий для драг-элементов */
    border: 1px solid #5a80a0;
}

#available-crew-list li.dragging {
    opacity: 0.6;
    border: 1px dashed #ffd700;
}

.role-slot {
    background: rgba(40, 70, 100, 0.6);
    border: 1px dashed #6a90b0;
    padding: 18px;
    margin-bottom: 12px;
    border-radius: 8px;
    min-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1em;
    color: #e0f2f1;
    position: relative;
    flex-wrap: wrap;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4);
}

.role-slot.drag-over {
    background: rgba(70, 100, 130, 0.8);
    border: 1px dashed #ffd700;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 215, 0, 0.5);
}

.role-slot .assigned-player-name {
    color: #ffd700;
    font-weight: bold;
    margin-left: 5px;
}

.assigned-player-tag {
    display: inline-block;
    background: linear-gradient(45deg, #ffd700, #daa520); /* Золотистый градиент */
    color: #2c1a0e;
    padding: 6px 12px;
    border-radius: 20px;
    margin-left: 10px;
    font-size: 0.95em;
    cursor: grab;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
    border: 1px solid #b8860b;
}
.assigned-player-tag.dragging {
    opacity: 0.7;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
        width: 95%;
    }
    header h1 {
        font-size: 2.8em;
    }
    h2 {
        font-size: 2em;
    }
    .button-glow {
        padding: 15px 30px;
        font-size: 1.2em;
    }
    .role-assignment-grid {
        flex-direction: column;
    }
    .players-column, .roles-column {
        min-width: unset;
        width: 100%;
    }
}