/* tictactoe.css — celikezor tictactoe oyunu stilleri */
/* Template: templates/data_manager/games/tictactoe.html'den çıkarıldı */

.game-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    gap: 2rem;
    padding: 4rem 1rem 1rem 1rem;
    min-height: calc(100vh - 120px);
}

.board-container {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.info-wrapper {
    flex: 0.8;
    width: 100%;
}

.glass-card {
    background: rgba(10, 15, 25, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    box-sizing: border-box;
}

/* Scoreboard */
.scoreboard {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.score-box {
    background: rgba(19, 34, 56, 0.3);
    border: 1px solid var(--surface-border);
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.score-box.active-player-x {
    border-color: #ff3333;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.2);
}

.score-box.active-player-o {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

.score-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.score-val {
    font-size: 1.8rem;
    font-weight: 800;
}

.score-val.x-color {
    color: #ff3333;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.4);
}

.score-val.o-color {
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

/* Game controls styling */
.control-group {
    margin-bottom: 1.2rem;
}

.control-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.control-buttons-row {
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    flex: 1;
    background: rgba(19, 34, 56, 0.3);
    border: 1px solid var(--surface-border);
    color: var(--text-secondary);
    padding: 0.6rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    border-color: var(--accent-color);
    color: #ffffff;
}

.toggle-btn.active {
    background: var(--active-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.2);
}

.game-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.action-btn {
    flex: 1;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: rgba(0, 210, 255, 0.1);
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.3);
}

.action-btn.danger {
    border-color: #ff3333;
    color: #ff3333;
}

.action-btn.danger:hover {
    background: rgba(255, 51, 51, 0.1);
    box-shadow: 0 0 12px rgba(255, 51, 51, 0.3);
}

/* Sound/Music control */
.sound-toggle-btn {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-toggle-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.sound-toggle-btn.muted {
    color: #ff3333;
    border-color: #ff3333;
}

/* Board Area */
.game-board-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(var(--grid-size, 3), 1fr);
    grid-template-rows: repeat(var(--grid-size, 3), 1fr);
    gap: 8px;
    width: 100%;
    height: 100%;
    background: rgba(19, 34, 56, 0.35); /* Increased contrast board background */
    border: 2px solid var(--surface-border); /* Slightly thicker border for premium look */
    border-radius: 12px;
    padding: 8px;
    box-sizing: border-box;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 210, 255, 0.08); /* Glow around board */
}

.cell {
    background: rgba(13, 20, 35, 0.85); /* Brighter/visible cell backgrounds */
    border: 1px solid rgba(0, 210, 255, 0.15); /* Visible cell border */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    font-family: 'Inter', sans-serif;
    /* Dynamic font sizing calculation based on grid-size property */
    font-size: calc(11rem / var(--grid-size, 3));
}

.cell:hover {
    background: rgba(0, 210, 255, 0.08);
    border-color: var(--accent-color);
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.3);
    transform: translateY(-2px);
}

.cell.x {
    color: #ff3333;
    text-shadow: 0 0 15px rgba(255, 51, 51, 0.85), 0 0 5px rgba(255, 51, 51, 0.5);
    animation: scaleIn 0.2s ease-out;
}

.cell.o {
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.85), 0 0 5px rgba(0, 210, 255, 0.5);
    animation: scaleIn 0.2s ease-out;
}

.cell.winning {
    background: rgba(0, 210, 255, 0.2) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.5);
    animation: winPulse 0.8s infinite alternate;
}

.cell.winning.x {
    background: rgba(255, 51, 51, 0.2) !important;
    border-color: #ff3333 !important;
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.5);
}

/* Game Status Bar */
.game-status-bar {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.2rem;
    color: #ffffff;
    min-height: 1.8rem;
}

.game-status-bar span.turn-x {
    color: #ff3333;
    text-shadow: 0 0 8px rgba(255, 51, 51, 0.5);
}

.game-status-bar span.turn-o {
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.5);
}

/* Modal Overlay */
.game-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(5px);
    display: none; /* Hide and prevent click interception when inactive */
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: var(--surface-color);
    border: 1px solid var(--accent-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 210, 255, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 80%;
}

.game-modal-overlay.show .modal-card {
    transform: scale(1);
}

.modal-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.modal-title.x-win {
    color: #ff3333;
    text-shadow: 0 0 15px rgba(255, 51, 51, 0.5);
}

.modal-title.o-win {
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.5);
}

.modal-title.draw {
    color: var(--text-secondary);
}

.modal-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-btn {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    background: #00b8e6;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

@keyframes scaleIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes winPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.03); }
}

/* Mobile responsiveness */
@media (max-width: 900px) {
    .game-layout {
        flex-direction: column;
        padding: 2rem 0.5rem 1rem 0.5rem;
        align-items: center;
    }

    .board-container {
        width: 100%;
        margin-bottom: 1.5rem;
    }

    .info-wrapper {
        width: 100%;
    }

    .game-board-wrapper {
        max-width: 90vw;
    }
}

@media (max-width: 576px) {
    .glass-card {
        padding: 1rem;
    }
    
    .scoreboard {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.4rem;
        margin-bottom: 1rem;
    }
    
    .score-box {
        padding: 0.5rem 0.25rem;
    }
    
    .score-label {
        font-size: 0.65rem;
        margin-bottom: 0.15rem;
    }
    
    .score-val {
        font-size: 1.3rem;
    }
    
    .control-group {
        margin-bottom: 1rem;
    }
    
    .control-label {
        font-size: 0.8rem;
        margin-bottom: 0.35rem;
    }
    
    .control-buttons-row {
        flex-direction: column;
        gap: 0.35rem;
    }
    
    .toggle-btn {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .game-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1.2rem;
    }
    
    .action-btn {
        width: 100%;
        padding: 0.7rem;
        font-size: 0.85rem;
    }
    
    .sound-toggle-btn {
        width: 100%;
        padding: 0.7rem;
    }
    
    .modal-card {
        padding: 1.5rem;
        max-width: 90%;
    }
    
    .modal-title {
        font-size: 1.6rem;
    }
    
    .modal-desc {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
}
