* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #87ceeb 0%, #b0e0e6 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Modal Styles */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.name-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.input-group {
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.input-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
}

#start-game-btn {
    background: #4caf50;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background 0.3s ease;
}

#start-game-btn:hover {
    background: #45a049;
}

.local-options, .online-options {
    margin-top: 10px;
}

.local-options {
    display: block;
}

.online-options {
    display: none;
}

#room-id-input {
    display: none;
}

.connection-info {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

#room-info {
    font-size: 1.1em;
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 5px;
}

#player-info {
    font-size: 1em;
    color: #388e3c;
    margin-bottom: 5px;
}

#connection-status {
    font-size: 0.9em;
    color: #4caf50;
    font-style: italic;
}

.container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.scoreboard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.player-score {
    text-align: center;
    flex: 1;
}

.player-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
}

.score {
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.vs {
    font-size: 1.5em;
    font-weight: bold;
    color: #888;
    margin: 0 20px;    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.series-info {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

#series-status {
    font-size: 1.1em;
    font-weight: bold;
    color: #e65100;
    margin-bottom: 5px;
}

#series-progress {
    font-size: 0.95em;
    color: #bf360c;
    font-weight: 500;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#current-player {
    font-size: 1.2em;
    font-weight: bold;
    color: #555;
}

.button-group {
    display: flex;
    gap: 10px;
}

#reset-btn, #reset-scores-btn, #change-names-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

#reset-scores-btn {
    background: #4ecdc4;
}

#change-names-btn {
    background: #9b59b6;
}

#reset-btn:hover {
    background: #ff5252;
}

#reset-scores-btn:hover {
    background: #26a69a;
}

#change-names-btn:hover {
    background: #8e44ad;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 20px;
    background: #333;
    border-radius: 10px;
    padding: 5px;
}

.cell {
    background: white;
    border: none;
    border-radius: 5px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cell:hover {
    background: #f0f0f0;
    transform: scale(0.95);
}

.cell.x {
    color: #ff6b6b;
}

.cell.o {
    color: #4ecdc4;
}

.cell.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

#game-status {
    font-size: 1.3em;
    font-weight: bold;
    min-height: 30px;
    color: #333;
}

.winner {
    color: #4caf50 !important;
    animation: bounce 0.5s ease-in-out;
}

.draw {
    color: #ff9800 !important;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Responsive design */
@media (max-width: 480px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .scoreboard {
        padding: 15px;
    }
    
    .player-name {
        font-size: 1em;
    }
    
    .score {
        font-size: 2em;
    }
      .vs {
        font-size: 1.2em;
        margin: 0 10px;
    }
    
    .series-info {
        padding: 10px;
    }
    
    #series-status {
        font-size: 1em;
    }
    
    #series-progress {
        font-size: 0.85em;
    }
    
    .cell {
        height: 60px;
        font-size: 1.5em;
    }
      .game-info {
        flex-direction: column;
        gap: 15px;
    }
      .button-group {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    #reset-btn, #reset-scores-btn, #change-names-btn {
        padding: 8px 12px;
        font-size: 0.8em;
        margin: 2px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .modal-content h2 {
        font-size: 1.5em;
    }
}
