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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.game-header {
    background: linear-gradient(90deg, #1a237e, #311b92);
    color: white;
    padding: 20px;
    text-align: center;
}

.user-info {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    opacity: 0.9;
}

.game-area {
    padding: 20px;
}

.ticket-container,
.barrel-section {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.lobby-section {
    background: #e8f5e9;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.lobby-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.lobby-controls label {
    font-weight: bold;
}

.lobby-controls select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.btn-lobby {
    background: linear-gradient(45deg, #ff9800, #f57c00);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.btn-lobby:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.lobby-area {
    padding: 20px;
}

.create-lobby-section {
    background: #e8f5e9;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.lobbies-list {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.lobby-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.lobby-info h4 {
    margin: 0 0 10px 0;
}

.lobby-info p {
    margin: 5px 0;
    font-size: 14px;
}

.btn-enter-lobby {
    background: linear-gradient(45deg, #4caf50, #8bc34a);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.btn-enter-lobby:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.lobby-info-section {
    background: #e3f2fd;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.btn-leave-lobby {
    background: linear-gradient(45deg, #f44336, #e91e63);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.btn-leave-lobby:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.bot-stats {
    background: #f0f0f0;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.last-marked-number {
    font-weight: bold;
    color: #1a237e;
    margin-top: 5px;
}

.bots-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.bot-ticket-container {
    background: #f0f0f0;
    border-radius: 10px;
    padding: 10px;
}

.bot-ticket {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 3px;
    margin-top: 10px;
}

.bot-ticket .ticket-cell {
    font-size: 12px;
    aspect-ratio: 1;
}

.bot-barrels-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.bot-barrels {
    background: #e0e0e0;
    border-radius: 8px;
    padding: 10px;
}

.bot-barrels-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.bot-barrel {
    width: 30px;
    height: 30px;
    background: linear-gradient(45deg, #4caf50, #8bc34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.ticket {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 5px;
    margin-top: 10px;
}

.ticket-cell {
    aspect-ratio: 1;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.ticket-cell.has-number {
    background: #e3f2fd;
}

.ticket-cell.marked {
    background: #4caf50;
    color: white;
    border-color: #388e3c;
}

.ticket-cell.marked::after {
    content: '✓';
    position: absolute;
    color: white;
}

.barrels-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
    min-height: 80px;
}

.barrel {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #ff9800, #ff5722);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 24px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: pop 0.3s ease-out;
}

@keyframes pop {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.game-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.btn-barrel,
.btn-new-game,
.btn-rules {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-barrel {
    background: linear-gradient(45deg, #2196f3, #21cbf3);
    color: white;
}

.btn-new-game {
    background: linear-gradient(45deg, #4caf50, #8bc34a);
    color: white;
}

.btn-rules {
    background: linear-gradient(45deg, #9c27b0, #e91e63);
    color: white;
}

.btn-barrel:hover,
.btn-new-game:hover,
.btn-rules:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.stats {
    background: #e8eaf6;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.stats p {
    margin: 5px 0;
    font-size: 16px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
}

@media (max-width: 600px) {
    .ticket-cell {
        font-size: 14px;
    }

    .barrel {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .btn-barrel,
    .btn-new-game,
    .btn-rules {
        padding: 12px 20px;
        font-size: 16px;
    }
}