/* ОСНОВНЫЕ СТИЛИ */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #f0f0f0;
    touch-action: manipulation;
    user-select: none;
    height: 100%;
    min-height: 100vh;
}

.timer {
    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10vw;
    font-weight: 900;
    position: relative;
    transition: color 0.3s;
}

#player1 { 
    background: #fff; 
    color: #000000 !important;
}

#player2 { 
    background: #000; 
    color: #ffffff !important;
}

.active { border: 5px solid red !important; }

.game-over {
    position: absolute;
    font-size: 8vw;
    color: red;
    font-weight: 900;
    z-index: 10;
    text-align: center;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
}

#startScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    padding: 10px;
    box-sizing: border-box;
    overflow-y: auto;
}

#colorSelection {
    width: 90%;
    max-width: 300px;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    margin-bottom: 5px;
}

.hidden {
    display: none !important;
}

.instruction {
    text-align: center;
    font-size: 4vw;
    color: #666;
    margin-bottom: 5px;
    padding: 0 10px;
}

.settings {
    width: 95%;
    max-width: 400px;
    margin-bottom: 5px;
}

.setting-group {
    margin-bottom: 8px;
}

label {
    display: block;
    margin-bottom: 2px;
    font-weight: bold;
    font-size: 3.5vw;
}

select, input {
    width: 100%;
    padding: 8px;
    font-size: 4vw;
    border: 2px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

button {
    padding: 12px;
    font-size: 4.5vw;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    background: #45a049;
}

.btn-full {
    width: 100%;
    margin-bottom: 15px;
}

.control-buttons {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 50;
}

.control-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pauseBtn { background: #ff9800; }
#pauseBtn:hover { background: #e68900; }
#soundBtn { background: #2196F3; }
#soundBtn:hover { background: #1976D2; }
#restartBtn { background: #f44336; }
#restartBtn:hover { background: #d32f2f; }

.sound-off { background: #9E9E9E !important; }

.time-critical {
    color: #ff0000 !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.seo-content {
    display: none;
}

.mode-buttons {
    display: flex;
    gap: 8px;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    font-size: 3.5vw;
    background: #e0e0e0;
    color: #333;
    border: 2px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.mode-btn:hover {
    background: #d0d0d0;
}

.mode-btn.active:hover {
    background: #45a049;
}

/* УДАЛИТЬ ВСЕ СТАРЫЕ СТИЛИ ЖЕРЕБЬЕВКИ ВЫШЕ ЭТОЙ ЛИНИИ */

/* НОВАЯ КОМПАКТНАЯ ЖЕРЕБЬЕВКА */
.lottery-compact {
    width: 95%;
    max-width: 400px;
    margin-bottom: 15px;
}

.lottery-title {
    text-align: center;
    font-size: 4vw;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    padding: 0 10px;
}

.lottery-players {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.lottery-player {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.player-name-input {
    width: 100%;
}

.player-name-input input {
    width: 100%;
    padding: 10px;
    font-size: 3.8vw;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    text-align: center;
    box-sizing: border-box;
    background: #f9f9f9;
}

.player-name-input input:focus {
    outline: none;
    border-color: #45a049;
    background: white;
}

.player-select-btn {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 3.8vw;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.player-select-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-text {
    white-space: nowrap;
}

.lottery-vs {
    font-size: 3.5vw;
    font-weight: bold;
    color: #666;
    padding: 0 10px;
}

.lottery-random-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 4.2vw;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.lottery-random-btn:hover {
    background: linear-gradient(135deg, #ff5722, #e64a19);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 87, 34, 0.3);
}

.lottery-result {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    border: 3px solid #4CAF50;
    margin-top: 10px;
}

.result-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.result-text {
    font-size: 4vw;
    font-weight: bold;
    line-height: 1.4;
}

.white-text {
    color: #4CAF50;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .lottery-title {
        font-size: 4.5vw;
    }
    
    .lottery-players {
        gap: 8px;
    }
    
    .player-name-input input {
        font-size: 4vw;
        padding: 8px;
    }
    
    .player-select-btn {
        padding: 10px;
        font-size: 4vw;
    }
    
    .lottery-vs {
        font-size: 3.8vw;
        padding: 0 8px;
    }
    
    .lottery-random-btn {
        padding: 12px;
        font-size: 4.5vw;
    }
    
    .result-text {
        font-size: 4.5vw;
    }
    
    /* Общие мобильные стили */
    .instruction {
        font-size: 4.2vw;
        margin-bottom: 8px;
    }
    
    .setting-group {
        margin-bottom: 6px;
    }
    
    button {
        padding: 10px;
        font-size: 4.2vw;
    }
}

@media (max-width: 480px) {
    #startScreen {
        padding: 8px;
        justify-content: flex-start;
    }
    
    .lottery-players {
        flex-direction: column;
        gap: 12px;
    }
    
    .lottery-vs {
        margin: 5px 0;
    }
    
    .lottery-player {
        width: 100%;
    }
    
    #colorSelection {
        max-width: 250px;
        margin-bottom: 10px;
    }
}
/* ФИКС ДЛЯ КНОПОК В РЯД */
.player-select-btn {
    display: inline-block !important;
    width: auto !important;
    min-width: 140px;
    max-width: 100%;
}

.lottery-players {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
}

.lottery-player {
    flex: 1;
    max-width: 45%; /* Чтобы не прилипали к краям */
}

.lottery-vs {
    align-self: center;
    margin-top: 20px; /* Выравниваем по середине кнопок */
}

/* Убираем лишние отступы */
.lottery-player .player-name-input {
    margin-bottom: 8px;
}