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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5rem;
}

.screen {
    display: block;
}

.screen.hidden {
    display: none;
}

/* Menu Screen */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.join-section {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

input[type="text"] {
    flex: 1;
    padding: 12px 20px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 2px;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
    max-width: 400px;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Game Screen */
.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.info-item {
    text-align: center;
}

.info-item strong {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.message {
    text-align: center;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 600;
    min-height: 40px;
}

.message.info {
    background: #cfe2ff;
    color: #084298;
}

.message.success {
    background: #d1e7dd;
    color: #0f5132;
}

.message.error {
    background: #f8d7da;
    color: #842029;
}

/* Board */
.board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.board {
    display: grid;
    grid-template-columns: repeat(7, 60px);
    grid-template-rows: repeat(6, 60px);
    gap: 10px;
    background: #1e3a8a;
    padding: 20px;
    border-radius: 15px;
}

.cell {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cell:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.cell.RED {
    background: #dc3545;
}

.cell.YELLOW {
    background: #ffc107;
}

.cell.EMPTY {
    background: white;
}

.cell.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.cell.disabled:hover {
    transform: none;
}

#back-to-menu-btn {
    display: block;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .board {
        grid-template-columns: repeat(7, 45px);
        grid-template-rows: repeat(6, 45px);
        gap: 8px;
        padding: 15px;
    }

    .cell {
        width: 45px;
        height: 45px;
    }

    .game-info {
        flex-direction: column;
        gap: 10px;
    }
}
