/* Gomoku Game Styles */

.gomoku-board {
    width: min(75vw, 60vh, 450px);
    height: min(75vw, 60vh, 450px);
    background: #DEB887;
    border: 4px solid #8B7355;
    border-radius: 10px;
    margin: 0 auto 20px auto;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 1px;
    padding: 6px;
    box-sizing: border-box;
    max-width: 450px;
    max-height: 450px;
    overflow: hidden;
}

.gomoku-cell {
    background: #F5DEB3;
    border: 1px solid #D2B48C;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 20px;
}

.gomoku-cell:hover {
    background: #E6D3A3;
}

.gomoku-stone {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 2px solid #333;
}

.gomoku-stone.black {
    background: #333;
}

.gomoku-stone.white {
    background: #fff;
}

/* AI Mode Toggle */
.ai-mode-toggle {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 15px;
    text-align: center;
}

.ai-toggle-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.ai-toggle-btn:hover {
    background: #5a6268;
}

.ai-toggle-btn.active {
    background: #667eea;
}

/* Desktop optimizations */
@media (min-width: 768px) {
    .gomoku-board {
        width: 500px;
        height: 500px;
        border: 6px solid #8B7355;
        border-radius: 15px;
        padding: 15px;
        gap: 2px;
    }
    
    .gomoku-cell {
        min-height: 28px;
        border: 1px solid #D2B48C;
    }
    
    .gomoku-stone {
        width: 85%;
        height: 85%;
        border: 3px solid #333;
    }
    
    .ai-mode-toggle {
        padding: 15px;
        margin-bottom: 20px;
        border-radius: 12px;
    }
    
    .ai-toggle-btn {
        padding: 10px 24px;
        font-size: 14px;
        border-radius: 25px;
    }
}

/* Tablet/iPad Responsive */
@media (min-width: 601px) and (max-width: 1024px) {
    .gomoku-board {
        width: min(60vw, 65vh, 500px);
        height: min(60vw, 65vh, 500px);
        padding: 12px;
        max-width: 500px;
        max-height: 500px;
        margin-bottom: 20px;
        border-width: 6px;
    }

    .gomoku-cell {
        min-height: 30px;
        border-width: 1.5px;
    }

    .gomoku-cell:hover {
        background: #E6D3A3;
        transform: scale(1.05);
        transition: all 0.2s ease;
    }

    .gomoku-stone {
        width: 85%;
        height: 85%;
        border-width: 3px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    .ai-mode-toggle {
        padding: 20px;
        margin: 20px 0;
        flex-wrap: wrap;
        gap: 20px;
        border-radius: 15px;
        background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    }

    .difficulty-selector {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .difficulty-btn {
        padding: 12px 20px;
        font-size: 1.1em;
        min-width: 100px;
        border-radius: 25px;
        transition: all 0.3s ease;
    }

    .difficulty-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

    .game-info {
        padding: 25px;
        max-width: 600px;
        margin: 0 auto;
        border-radius: 20px;
    }

    .control-section {
        margin: 25px 0;
    }

    .primary-controls {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn {
        padding: 15px 25px;
        font-size: 1.1em;
        min-width: 140px;
        border-radius: 25px;
        transition: all 0.3s ease;
    }

    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

    .status-info {
        gap: 25px;
        margin: 20px 0;
    }

    .moves-counter {
        font-size: 1.1em;
        padding: 12px 20px;
        border-radius: 20px;
    }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .gomoku-board {
        width: min(90vw, 50vh, 320px);
        height: min(90vw, 50vh, 320px);
        padding: 4px;
        max-width: 320px;
        max-height: 320px;
        margin-bottom: 10px;
    }

    .gomoku-cell {
        min-height: 18px;
    }

    .gomoku-stone {
        width: 75%;
        height: 75%;
    }

    .ai-mode-toggle {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .difficulty-selector {
        flex-direction: column;
        gap: 8px;
    }

    .difficulty-btn {
        padding: 8px 12px;
        font-size: 0.9em;
        width: 100%;
    }
}

/* Large Desktop/Monitor Responsive */
@media (min-width: 1025px) {
    .gomoku-board {
        width: min(50vw, 70vh, 600px);
        height: min(50vw, 70vh, 600px);
        padding: 25px;
        max-width: 600px;
        max-height: 600px;
        margin-bottom: 30px;
        border-width: 8px;
        border-radius: 15px;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }

    .gomoku-cell {
        min-height: 35px;
        border-width: 2px;
        border-radius: 3px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .gomoku-cell:hover {
        background: #E6D3A3;
        transform: scale(1.08);
        box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    }

    .gomoku-stone {
        width: 90%;
        height: 90%;
        border-width: 4px;
        box-shadow: 0 3px 6px rgba(0,0,0,0.4);
        transition: all 0.3s ease;
    }

    .gomoku-stone:hover {
        transform: scale(1.05);
    }

    .ai-mode-toggle {
        padding: 30px;
        margin: 30px 0;
        border-radius: 20px;
        background: linear-gradient(135deg, #f8f9fa, #e9ecef);
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .difficulty-selector {
        gap: 20px;
        margin: 20px 0;
    }

    .difficulty-btn {
        padding: 15px 30px;
        font-size: 1.2em;
        min-width: 120px;
        border-radius: 30px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .difficulty-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    }

    .difficulty-btn.active {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    }

    .game-info {
        padding: 40px;
        max-width: 800px;
        margin: 0 auto;
        border-radius: 25px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    .game-header {
        margin-bottom: 30px;
    }

    .game-title-section h1 {
        font-size: 2.5em;
        margin-bottom: 10px;
    }

    .game-subtitle {
        font-size: 1.3em;
    }

    .control-section {
        margin: 30px 0;
    }

    .primary-controls {
        gap: 25px;
        margin: 25px 0;
    }

    .btn {
        padding: 18px 35px;
        font-size: 1.2em;
        min-width: 160px;
        border-radius: 30px;
        transition: all 0.3s ease;
        box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    }

    .btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    }

    .btn:active {
        transform: translateY(-1px);
    }

    .status-info {
        gap: 30px;
        margin: 25px 0;
    }

    .moves-counter {
        font-size: 1.2em;
        padding: 15px 25px;
        border-radius: 25px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .back-btn {
        padding: 12px 25px;
        font-size: 1.1em;
        border-radius: 25px;
    }
}