* {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

h1 {
    text-align: center;
    color: white;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    text-align: center;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
    font-size: 1.1em;
}

/* Кнопки */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background: #0b7dda;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-danger {
    background: #f44336;
    color: white;
}

/* Поля ввода */
.input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    margin-bottom: 10px;
}

.input:focus {
    outline: none;
    border-color: #667eea;
}

/* Лобби */
.lobby-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.lobby-section h2 {
    margin-bottom: 15px;
    color: #333;
}

.room-info {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#players-list {
    margin: 20px 0;
}

.player-item {
    padding: 10px;
    margin: 5px 0;
    background: #f5f5f5;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-item.bot-player {
    background: #e8f5e9;
    border-left: 3px solid #4CAF50;
}

/* Игровой экран */
.game-header {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.team-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
}

.team {
    text-align: center;
}

.team.blue h3 {
    color: #2196F3;
}

.team.red h3 {
    color: #f44336;
}

.score {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 5px;
}

.round-info {
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

/* Сетка */
#game-grid-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.grid-cell {
    aspect-ratio: 1;
    background: #e0e0e0;
    border: 2px solid #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    padding: 5px;
    word-break: break-word;
}

.grid-cell:hover:not(.revealed):not(.disabled) {
    background: #d0d0d0;
    transform: scale(1.05);
}

.grid-cell.revealed {
    cursor: default;
}

.grid-cell.revealed.blue-archive {
    background: #2196F3;
    color: white;
}

.grid-cell.revealed.red-archive {
    background: #f44336;
    color: white;
}

.grid-cell.revealed.trap {
    background: #000;
    color: white;
}

.grid-cell.revealed.quest {
    background: #FF9800;
    color: white;
}

.grid-cell.revealed.neutral {
    background: #9E9E9E;
    color: white;
}

.grid-cell.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.grid-cell.selected {
    border: 3px solid #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* Панели */
.role-info {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.turn-info {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.captain-panel, .seeker-panel {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.visible-layout {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin: 20px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.visible-layout-cell {
    aspect-ratio: 1;
    border: 2px solid #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.visible-layout-cell.blue-archive {
    background: #2196F3;
    color: white;
}

.visible-layout-cell.red-archive {
    background: #f44336;
    color: white;
}

.visible-layout-cell.trap {
    background: #000;
    color: white;
}

.visible-layout-cell.hidden {
    background: #e0e0e0;
}

.association-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.association-form .input {
    flex: 1;
    margin-bottom: 0;
}

.letter-restriction {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border-radius: 6px;
    border: 1px solid #ffc107;
}

.letter-restriction strong {
    font-size: 1.5em;
    color: #f44336;
}

/* Модальные окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

#quest-content {
    margin: 20px 0;
}

.question-text {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
}

.answer-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
}

.timer {
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    color: #f44336;
}

/* PWA Auth */
.pwa-auth {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#telegram-login-btn {
    width: 100%;
    background: #0088cc;
    color: white;
    padding: 15px;
    font-size: 18px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .grid {
        gap: 5px;
    }
    
    .grid-cell {
        font-size: 12px;
    }
    
    .association-form {
        flex-direction: column;
    }
    
    h1 {
        font-size: 2em;
    }
}

