/* tictactoe_style.css - стили для игры */
.tictactoe-game-container {
    max-width: 1000px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    padding: 30px;
    margin: 40px auto;
}

.tictactoe-game-container header {
    text-align: center;
    margin-bottom: 30px;
}

.tictactoe-game-container h1 {
    color: #e84393;
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.tictactoe-game-container .subtitle {
    color: #636e72;
    font-size: 1.2rem;
    font-weight: 500;
}

.tictactoe-girl-info {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
    padding: 15px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 5px 15px rgba(232, 67, 147, 0.3);
}

.tictactoe-girl-name {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.tictactoe-girl-message {
    font-size: 1.1rem;
    font-style: italic;
}

.tictactoe-game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.tictactoe-game-info {
    background-color: #f8f9fa;
    padding: 20px 30px;
    border-radius: 15px;
    width: 100%;
    max-width: 700px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

.tictactoe-current-player {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.tictactoe-player-x {
    color: #0984e3;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.tictactoe-player-o {
    color: #e84393;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.tictactoe-player-turn {
    background: linear-gradient(to right, #0984e3, #0652a0);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    display: inline-block;
    margin-top: 10px;
    box-shadow: 0 4px 8px rgba(9, 132, 227, 0.3);
}

.tictactoe-girl-turn {
    background: linear-gradient(to right, #e84393, #d63031);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    display: inline-block;
    margin-top: 10px;
    box-shadow: 0 4px 8px rgba(232, 67, 147, 0.3);
}

.tictactoe-difficulty-selector {
    margin: 20px 0;
    padding: 15px;
    background-color: #ffeaa7;
    border-radius: 10px;
}

.tictactoe-difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tictactoe-difficulty-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.tictactoe-difficulty-btn.easy {
    background-color: #00b894;
    color: white;
}

.tictactoe-difficulty-btn.medium {
    background-color: #fdcb6e;
    color: white;
}

.tictactoe-difficulty-btn.hard {
    background-color: #e17055;
    color: white;
}

.tictactoe-difficulty-btn.expert {
    background-color: #6c5ce7;
    color: white;
}

.tictactoe-difficulty-btn.active {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.tictactoe-game-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-gap: 8px;
    max-width: 600px;
    width: 100%;
    background: linear-gradient(145deg, #2d3436, #636e72);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.tictactoe-cell {
    aspect-ratio: 1;
    background-color: #ecf0f1;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1);
    border: none;
}

.tictactoe-cell:hover:not(.disabled) {
    background-color: #d5edda;
    transform: scale(1.03);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.tictactoe-cell.disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

.tictactoe-cell.disabled:hover {
    background-color: #ecf0f1;
    transform: none;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1);
}

.tictactoe-cell.x {
    color: #0984e3;
    text-shadow: 2px 2px 4px rgba(9, 132, 227, 0.3);
}

.tictactoe-cell.o {
    color: #e84393;
    text-shadow: 2px 2px 4px rgba(232, 67, 147, 0.3);
}

.tictactoe-cell.highlight {
    animation: tictactoeHighlightCell 0.5s ease;
}

@keyframes tictactoeHighlightCell {
    0% { transform: scale(1); background-color: #ecf0f1; }
    50% { transform: scale(1.1); background-color: #ffeaa7; }
    100% { transform: scale(1); background-color: #ecf0f1; }
}

.tictactoe-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.tictactoe-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.tictactoe-btn-reset {
    background: linear-gradient(to right, #0984e3, #0652a0);
    color: white;
}

.tictactoe-btn-reset:hover {
    background: linear-gradient(to right, #0652a0, #043a7a);
    transform: translateY(-3px);
}

.tictactoe-btn-howto {
    background: linear-gradient(to right, #00b894, #00a085);
    color: white;
}

.tictactoe-btn-howto:hover {
    background: linear-gradient(to right, #00a085, #008b74);
    transform: translateY(-3px);
}

.tictactoe-game-result {
    margin-top: 20px;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    animation: tictactoeFadeIn 0.5s;
    display: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.tictactoe-win-x {
    background: linear-gradient(135deg, rgba(9, 132, 227, 0.1), rgba(9, 132, 227, 0.2));
    color: #0984e3;
    border: 3px solid #0984e3;
}

.tictactoe-win-o {
    background: linear-gradient(135deg, rgba(232, 67, 147, 0.1), rgba(232, 67, 147, 0.2));
    color: #e84393;
    border: 3px solid #e84393;
}

.tictactoe-draw {
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.1), rgba(253, 203, 110, 0.2));
    color: #fdcb6e;
    border: 3px solid #fdcb6e;
}

.tictactoe-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    font-size: 1.1rem;
    flex-wrap: wrap;
}

.tictactoe-stat-item {
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    min-width: 140px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.tictactoe-stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
    margin-top: 5px;
}

@keyframes tictactoeFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tictactoePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.tictactoe-pulse {
    animation: tictactoePulse 1.5s infinite;
}

@keyframes tictactoeThinking {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.tictactoe-thinking {
    animation: tictactoeThinking 1s infinite;
}

.tictactoe-hidden {
    display: none !important;
}

/* Скрытая ссылка для открытия новой вкладки */
.tictactoe-popup-link {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #0984e3;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    display: none;
    z-index: 1000;
}

/* Адаптивность */
@media (max-width: 768px) {
    .tictactoe-game-board {
        max-width: 90vw;
    }
    
    .tictactoe-cell {
        font-size: 2rem;
    }
    
    .tictactoe-game-container h1 {
        font-size: 2.2rem;
    }
    
    .tictactoe-game-container {
        padding: 20px;
    }
    
    .tictactoe-difficulty-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .tictactoe-difficulty-btn {
        width: 200px;
    }
}