/**
 * Стили для игры Amnogonas
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

#game-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Главная страница */
.home-page {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.home-page h1 {
    font-size: 3em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 40px;
}

.home-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.action-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    text-align: left;
}

.action-card h2 {
    margin-bottom: 20px;
    color: #333;
}

.action-card form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.action-card input,
.action-card textarea {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.action-card input:focus,
.action-card textarea:focus {
    outline: none;
    border-color: #667eea;
}

.action-card textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.action-card button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-card button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.action-card button:active {
    transform: translateY(0);
}

/* Игровой экран */
.game-screen {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.game-header h1 {
    text-align: center;
    margin: 0;
    flex: 1;
    color: #333;
}

.btn-link {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-link:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.game-screen h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.phase-badge {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
}

.phase-badge.waiting {
    background: #fff3cd;
    color: #856404;
}

.phase-badge.tasks {
    background: #d1ecf1;
    color: #0c5460;
}

.phase-badge.voting {
    background: #f8d7da;
    color: #721c24;
}

.phase-badge.finished {
    background: #d4edda;
    color: #155724;
}

/* Информация о роли */
.role-info {
    text-align: center;
    margin: 20px 0;
}

.role-badge {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: bold;
}

.role-badge.traitor {
    background: #f8d7da;
    color: #721c24;
}

.role-badge.citizen {
    background: #d1ecf1;
    color: #0c5460;
}

.role-badge.organizer {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.organizer-badge {
    text-align: center;
    margin: 20px 0;
}

.fingerprint-info {
    margin-top: 10px;
    font-size: 0.85em;
    color: #6c757d;
}

.fingerprint-label {
    font-weight: bold;
    margin-right: 5px;
}

.fingerprint-value {
    font-family: monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.fingerprint-info-small {
    margin-top: 4px;
    font-size: 0.75em;
    color: #6c757d;
}

.role-info {
    text-align: center;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.organizer-view {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

/* Статистика для организатора */
.stats-section {
    margin: 30px 0;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stats-section h2 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat-label {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

/* Роль игрока в списке организатора */
.player-role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 8px;
}

.player-role-badge.traitor {
    background: #f8d7da;
    color: #721c24;
}

.player-role-badge.citizen {
    background: #d1ecf1;
    color: #0c5460;
}

.organizer-player .player-info {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Секция игроков */
.players-section {
    margin: 30px 0;
}

.players-section h2 {
    margin-bottom: 15px;
    color: #333;
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.player-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.player-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.player-item.dead {
    opacity: 0.5;
    background: #e9ecef;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-label {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: normal;
}

.player-name {
    font-weight: bold;
    font-size: 1.1em;
}

.tasks-count {
    color: #28a745;
    font-weight: bold;
}

/* Задания */
.tasks-section {
    margin: 30px 0;
}

.tasks-section h2 {
    margin-bottom: 15px;
    color: #333;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #667eea;
}

.task-text {
    font-size: 1.1em;
    flex: 1;
}

.btn-task {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-task:hover {
    background: #218838;
    transform: scale(1.05);
}

/* Убийство */
.kill-section {
    margin: 30px 0;
    padding: 20px;
    background: #fff3cd;
    border-radius: 10px;
    border-left: 4px solid #ffc107;
}

.kill-section h3 {
    margin-bottom: 15px;
    color: #856404;
}

.kill-section select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ffc107;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
}

.btn-danger {
    padding: 12px 24px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* Голосование */
.voting-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vote-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.vote-item:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.btn-vote {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-vote:hover {
    background: #5568d3;
    transform: scale(1.05);
}

/* Кнопки */
.btn-primary {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: block;
    margin: 20px auto;
    width: 100%;
    max-width: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.waiting-text {
    text-align: center;
    font-size: 1.2em;
    color: #666;
    margin: 20px 0;
}

/* Финальные результаты */
.final-results {
    text-align: center;
    margin: 30px 0;
}

.final-results h2 {
    font-size: 2em;
    margin-bottom: 30px;
    color: #333;
}

.players-final {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.player-final {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 3px solid transparent;
}

.player-final.alive {
    border-color: #28a745;
}

.player-final.dead {
    opacity: 0.6;
    border-color: #dc3545;
}

.player-final.traitor {
    background: #f8d7da;
}

.player-final.citizen {
    background: #d1ecf1;
}

.player-final .player-name {
    font-size: 1.3em;
    font-weight: bold;
}

.player-final .player-role {
    font-size: 1.1em;
}

.player-final .player-status {
    font-size: 1em;
    font-weight: bold;
}

/* Адаптивность */
@media (max-width: 768px) {
    .home-page {
        padding: 20px;
    }
    
    .home-page h1 {
        font-size: 2em;
    }
    
    .home-actions {
        grid-template-columns: 1fr;
    }
    
    .game-screen {
        padding: 20px;
    }
    
    .players-list {
        grid-template-columns: 1fr;
    }
    
    .task-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-task {
        width: 100%;
    }
}
