* {
    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;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

header h1 {
    color: #4a5568;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    font-weight: 700;
}

.game-info {
    margin-bottom: 2rem;
}

.status {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
}

.score {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 1rem;
    color: #4a5568;
}

.score span {
    background: #edf2f7;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 2rem 0;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.cell {
    aspect-ratio: 1;
    background: #f7fafc;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2d3748;
}

.cell:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: scale(1.05);
}

.cell.x {
    color: #e53e3e;
}

.cell.o {
    color: #3182ce;
}

.cell.winning {
    background: #fef5e7;
    border-color: #f6ad55;
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.reset-btn, .mode-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.reset-btn {
    background: #48bb78;
    color: white;
}

.reset-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.mode-btn {
    background: #4299e1;
    color: white;
}

.mode-btn:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

.difficulty-selector {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.difficulty-selector label {
    font-weight: 600;
    color: #4a5568;
}

.difficulty-selector select {
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-selector select:hover {
    border-color: #cbd5e0;
}

.difficulty-selector select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Online Multiplayer Styles */
.online-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.online-section h2 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.online-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.online-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #805ad5;
    color: white;
}

.online-btn:hover {
    background: #6b46c1;
    transform: translateY(-2px);
}

.session-info {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    margin-top: 1rem;
}

.session-code {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.code {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #2d3748;
    background: #edf2f7;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    font-size: 1.1rem;
}

.copy-btn {
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 5px;
    background: #48bb78;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #38a169;
}

.player-count {
    font-weight: 600;
    color: #4a5568;
}

/* Connection status */
.connection-status {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1000;
}

.connected {
    background: #48bb78;
    color: white;
}

.disconnected {
    background: #e53e3e;
    color: white;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.modal input {
    width: 100%;
    padding: 0.75rem;
    margin: 1rem 0;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

.modal button {
    margin: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal .primary-btn {
    background: #48bb78;
    color: white;
}

.modal .secondary-btn {
    background: #e2e8f0;
    color: #2d3748;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .status {
        font-size: 1.25rem;
    }
    
    .cell {
        font-size: 2.5rem;
    }
    
    .score {
        font-size: 0.9rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .reset-btn, .mode-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Tablet responsiveness */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 2rem;
    }
    
    .cell {
        font-size: 2.75rem;
    }
} 