:root {
    --primary-color: #3498db;
    --secondary-color: #e74c3c;
    --background-color: #f9f9f9;
    --board-color: #fff;
    --border-color: #ddd;
    --text-color: #333;
    --hover-color: #eaeaea;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    width: 100%;
    max-width: 800px;
    background-color: var(--board-color);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    color: white;
    padding: 20px;
    text-align: center;
}

h1 {
    font-size: 42px;
    margin-bottom: 5px;
    font-weight: bold;
}

.subtitle {
    font-size: 14px;
    opacity: 0.8;
}

.game-content {
    display: flex;
    flex-direction: column;
    padding: 30px;
}

.settings {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.mode-selector {
    display: flex;
    gap: 10px;
}

.mode-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    background-color: #5dade2; /* Celeste medio azul */
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.mode-btn.active {
    background-color: #3498db; /* Azul más oscuro cuando está activo */
    color: white;
}

.difficulty {
    display: flex;
    align-items: center;
    gap: 10px;
}

select {
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background-color: white;
    cursor: pointer;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    height: 30px;
    text-align: center;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 10px;
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1/1;
    margin-bottom: 20px;
}

.cell {
    background-color: #f5f5f5;
    border-radius: 10px;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.cell:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
}

.cell.x {
    color: var(--secondary-color);
}

.cell.o {
    color: var(--primary-color);
}

.cell.highlight {
    background-color: rgba(46, 204, 113, 0.2);
}

.cell:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: transparent;
    border-radius: 10px;
    transition: background-color 0.3s;
}

.cell:active:after {
    background-color: rgba(0, 0, 0, 0.05);
}

.scoreboard {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 350px;
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.score {
    text-align: center;
    padding: 10px 15px;
    border-radius: 8px;
    min-width: 80px;
}

.score-label {
    font-size: 14px;
    margin-bottom: 5px;
    color: #555;
}

.score-value {
    font-size: 24px;
    font-weight: bold;
}

.player-x .score-value {
    color: var(--secondary-color);
}

.player-o .score-value {
    color: var(--primary-color);
}

.actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

button.secondary {
    background-color: #95a5a6;
}

#restart-btn {
    background-color: #808080;
    color: white;
}

#restart-btn:hover {
    background-color: #6b6b6b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

@media (max-width: 600px) {
    .settings {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .game-content {
        padding: 20px;
    }
}

.thinking {
    position: relative;
    display: inline-block;
}

.thinking::after {
    content: "...";
    position: absolute;
    animation: thinking 1.5s infinite;
    margin-left: 5px;
}

@keyframes thinking {
    0% { content: "."; }
    33% { content: ".."; }
    66% { content: "..."; }
    100% { content: "."; }
}

/* 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);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.modal-content .form-group {
    margin-bottom: 1.5rem;
}

.modal-content label {
    display: block;
    margin-bottom: 0.5rem;
    color: white;
    font-weight: 500;
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.modal-content input[type="text"],
.modal-content input[type="tel"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="tel"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-content .form-actions {
    margin-top: 1.5rem;
    text-align: right;
}

.modal-content .btn-primary {
    background: linear-gradient(145deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.modal-content .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 8px rgba(0, 0, 0, 0.4),
        0 4px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.modal-content .btn-primary:active {
    transform: translateY(0px);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

