/* css/style.css 5*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

body {
    background-color: #0a0a14;
    color: #e0d8c0;
    overflow-x: hidden;
    min-height: 100vh;
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Фон с картой Баровии */
.map-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1531259683007-016a7b628fc3?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    z-index: -1;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, transparent 0%, #0a0a14 70%);
    z-index: -1;
}

/* Заголовок */
header {
    padding: 15px 25px;
    text-align: center;
    background-color: rgba(10, 10, 20, 0.85);
    border-bottom: 2px solid #5a0000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background-color: rgba(30, 20, 20, 0.7);
    border-radius: 5px;
    border: 1px solid #5a0000;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #5a0000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar i {
    color: #e0d8c0;
}

.user-name {
    font-weight: bold;
    color: #c41e3a;
}

.user-role {
    font-size: 0.8rem;
    color: #b0a690;
}

h1 {
    font-size: 2.5rem;
    color: #c41e3a;
    text-shadow: 0 0 10px #8b0000, 0 0 20px rgba(139, 0, 0, 0.5);
    margin-bottom: 5px;
    letter-spacing: 3px;
    font-family: 'Times New Roman', serif;
}

/* Основная доска */
.detective-board {
    flex: 1;
    position: relative;
    padding: 30px;
    margin: 20px;
    border-radius: 8px;
    background-color: rgba(15, 15, 25, 0.6);
    border: 1px solid #2a2a3a;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
    min-height: 70vh;
    overflow: hidden;
}

/* Карточки с уликами */
.clue-card {
    position: absolute;
    width: 200px;
    min-height: 120px;
    background-color: rgba(30, 20, 20, 0.9);
    border: 2px solid #5a0000;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
    cursor: move;
    transition: transform 0.3s, box-shadow 0.3s, z-index 0.3s;
    z-index: 1;
    backdrop-filter: blur(3px);
}

.clue-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.5);
    z-index: 100;
}

.clue-card.locked {
    background-color: rgba(20, 15, 15, 0.95);
    border-color: #333;
    cursor: not-allowed;
}

.clue-card.locked:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #5a0000;
}

.card-title {
    font-weight: bold;
    color: #c41e3a;
    font-size: 1.1rem;
}

.card-icon {
    color: #b0a690;
    font-size: 1.2rem;
}

.card-content {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #d0c8b0;
}

.card-content.hidden {
    filter: blur(5px);
    user-select: none;
}

.lock-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    color: #888;
    font-size: 0.8rem;
}

.lock-indicator i {
    margin-right: 5px;
}

.unlock-btn {
    background-color: #5a0000;
    color: #e0d8c0;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 0.8rem;
    transition: background-color 0.3s;
}

.unlock-btn:hover {
    background-color: #8b0000;
}

/* Красные нити связей */
.thread {
    position: absolute;
    height: 3px;
    background-color: #c41e3a;
    transform-origin: 0 0;
    z-index: 0;
    box-shadow: 0 0 5px rgba(196, 30, 58, 0.7);
    pointer-events: none;
    cursor: pointer;
    transition: opacity 0.3s;
}

.thread:hover {
    opacity: 0.7;
}

.thread.selected-for-deletion {
    background-color: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.9);
    height: 4px;
    z-index: 200;
}

.thread::before, .thread::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #c41e3a;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(196, 30, 58, 0.9);
}

.thread.selected-for-deletion::before,
.thread.selected-for-deletion::after {
    background-color: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.9);
}

.thread::before {
    top: -2.5px;
    left: -2px;
}

.thread::after {
    top: -2.5px;
    right: -2px;
}

/* Панель управления */
.controls {
    display: flex;
    justify-content: center;
    padding: 20px;
    background-color: rgba(10, 10, 20, 0.85);
    border-top: 2px solid #5a0000;
    flex-wrap: wrap;
    gap: 15px;
    z-index: 10;
}

.control-btn {
    background-color: #2a2a3a;
    color: #e0d8c0;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.control-btn i {
    margin-right: 8px;
    color: #c41e3a;
}

.control-btn:hover {
    background-color: #3a3a4a;
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
}

.control-btn.admin-only {
    background-color: #5a0000;
}

.control-btn.delete-mode {
    background-color: #8b0000;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 5px rgba(139, 0, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(139, 0, 0, 0.8); }
    100% { box-shadow: 0 0 5px rgba(139, 0, 0, 0.5); }
}

/* Модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background-color: rgba(30, 20, 20, 0.95);
    border: 3px solid #5a0000;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(196, 30, 58, 0.3);
}

.modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.modal-title {
    color: #c41e3a;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.modal-subtitle {
    color: #b0a690;
    font-size: 1rem;
}

.code-input {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.code-input input {
    width: 100%;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    background-color: rgba(10, 10, 20, 0.8);
    border: 2px solid #5a0000;
    border-radius: 5px;
    color: #e0d8c0;
    letter-spacing: 5px;
    font-family: 'Courier New', monospace;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.submit-btn {
    background-color: #5a0000;
    color: #e0d8c0;
}

.submit-btn:hover {
    background-color: #8b0000;
}

.cancel-btn {
    background-color: #2a2a3a;
    color: #e0d8c0;
}

.cancel-btn:hover {
    background-color: #3a3a4a;
}

.message {
    text-align: center;
    margin-top: 15px;
    min-height: 25px;
    font-weight: bold;
}

.success {
    color: #00aa00;
}

.error {
    color: #c41e3a;
}

/* Панель с найденными уликами - изменена для desktop */
.found-clues {
    background-color: rgba(30, 20, 20, 0.9);
    border: 2px solid #5a0000;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
    z-index: 5;
    margin: 10px 20px;
    max-height: 300px;
    overflow-y: auto;
}

.found-clues h3 {
    color: #c41e3a;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.clue-list {
    max-height: 200px;
    overflow-y: auto;
}

.clue-item {
    padding: 8px;
    margin-bottom: 8px;
    background-color: rgba(10, 10, 20, 0.5);
    border-left: 3px solid #c41e3a;
    font-size: 0.9rem;
}

/* Подсказки - изменена для desktop */
.hints {
    background-color: rgba(30, 20, 20, 0.9);
    border: 2px solid #5a0000;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
    z-index: 5;
    margin: 10px 20px 20px;
}

.hints h3 {
    color: #c41e3a;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.hint-text {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

/* =========================== */
/* АДАПТИВНОСТЬ ДЛЯ РАЗНЫХ УСТРОЙСТВ */
/* =========================== */

/* Для очень широких экранов (больше 1200px) - desktop с фиксированными панелями */
@media (min-width: 1200px) {
    /* Для desktop возвращаем панели в поток документа под кнопками */
    .found-clues, .hints {
        position: static;
        width: auto;
        margin: 10px 20px;
    }
    
    /* Если нужно, можно сделать горизонтальное расположение панелей */
    .container > .found-clues {
        margin-bottom: 10px;
    }
    
    .container > .hints {
        margin-top: 10px;
        margin-bottom: 20px;
    }
}

/* Для планшетов и небольших десктопов (от 768px до 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .found-clues, .hints {
        position: static;
        width: calc(50% - 40px);
        margin: 15px 20px;
    }
    
    /* Делаем горизонтальное расположение панелей */
    .found-clues {
        float: left;
        clear: left;
    }
    
    .hints {
        float: right;
        clear: right;
    }
    
    /* Очищаем float после панелей */
    .controls {
        clear: both;
    }
}

/* Для мобильных устройств (до 767px) - текущие стили */
@media (max-width: 767px) {
    h1 {
        font-size: 2rem;
    }
    
    .detective-board {
        padding: 15px;
        margin: 10px;
        min-height: 60vh;
    }
    
    .clue-card {
        width: 180px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .found-clues, .hints {
        position: static;
        width: calc(100% - 40px);
        margin: 15px 20px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        max-width: 300px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-left, .header-right {
        width: 100%;
        justify-content: center;
    }
}

/* Для очень маленьких мобильных */
@media (max-width: 480px) {
    h1 {
        font-size: 1.6rem;
    }
    
    .detective-board {
        margin: 5px;
        padding: 10px;
    }
    
    .clue-card {
        width: 160px;
        padding: 10px;
    }
    
    .found-clues, .hints {
        margin: 10px;
        width: calc(100% - 20px);
    }
}

/* Эффект мигания для важных карточек */
@keyframes pulse {
    0% { box-shadow: 0 0 5px rgba(196, 30, 58, 0.5); }
    50% { box-shadow: 0 0 20px rgba(196, 30, 58, 0.8); }
    100% { box-shadow: 0 0 5px rgba(196, 30, 58, 0.5); }
}

.important {
    animation: pulse 2s infinite;
}

/* Эффект старины */
.aged-paper {
    background-image: 
        linear-gradient(rgba(139, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.logout-btn {
    background-color: #5a0000;
    color: #e0d8c0;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #8b0000;
    text-decoration: none;
}

/* Индикатор режима удаления */
.delete-mode-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(139, 0, 0, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    display: none;
}

/* Координаты на доске */
.coordinates {
    position: absolute;
    font-size: 0.8rem;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.7);
}

.coordinate-top {
    top: 3px;
    right: 3px;
}

.coordinate-bottom {
    bottom: 3px;
    left: 3px;
}

/* Для выделения выбранной карточки */
.selected {
    box-shadow: inset 0 0 0 4px #ff9800 !important;
    z-index: 3 !important;
}

/* Для подсветки доступных ходов */
.valid-move {
    box-shadow: inset 0 0 0 3px #4caf50 !important;
}

.valid-capture::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid #4caf50;
    background-color: rgba(76, 175, 80, 0.2);
}

/* Очистка float для средних экранов */
@media (min-width: 768px) and (max-width: 1199px) {
    .container::after {
        content: '';
        display: table;
        clear: both;
    }
}