/* Tic Tac Toe - Complete Styling */

/* Game Container */
.game-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.game-box {
    position: relative;
}
.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
}

/* Mode Selection */
.mode-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 20px;
    border: 3px solid #e5e7eb;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mode-btn:hover {
    transform: translateY(-3px);
    border-color: #10b981;
}

.mode-btn.active {
    border-color: #10b981;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.mode-icon {
    font-size: 40px;
}

.mode-title {
    font-weight: 700;
    color: #333;
    font-size: 16px;
}

/* Difficulty Section */
.difficulty-section {
    margin-bottom: 30px;
}

.difficulty-section h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #555;
    font-size: 18px;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.difficulty-btn {
    padding: 15px;
    border: 3px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
}

.difficulty-btn.active {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.diff-icon {
    font-size: 28px;
}

.diff-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* Player Names */
.player-names-section {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.name-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.name-input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.name-input-group input:focus {
    outline: none;
    border-color: #10b981;
}

/* Start Game Button */
.start-game-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.start-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

/* Board Container */
.board-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: auto;
}

/* Game Info */
.game-info {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f3f4f6;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 12px;
    background: #f9fafb;
    transition: all 0.3s;
}

.player-info.current-player {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.2);
}

.player-symbol {
    font-size: 36px;
}

.player-details {
    flex: 1;
}

.player-name {
    font-weight: 700;
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

.player-score {
    color: #666;
    font-size: 14px;
}

.game-status {
    text-align: center;
}

.current-turn {
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 8px;
}

.move-count {
    color: #666;
    font-size: 14px;
}

/* Draw Score */
.draw-score {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #fef3c7;
    border-radius: 10px;
    font-weight: 600;
    color: #92400e;
}

/* Game Board */
.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    position: relative;
}

.cell {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 3px solid #e5e7eb;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.cell:hover:not(.taken) {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-color: #38bdf8;
    transform: scale(1.05);
}

.cell.taken {
    cursor: not-allowed;
}

.cell.player-x {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #f87171;
}

.cell.player-o {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
}

.cell.winner {
    animation: winnerPulse 0.6s infinite;
}

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

@keyframes winnerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px 10px rgba(16, 185, 129, 0);
    }
}

/* Winning Line Canvas */
.winning-line-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Game Controls */
.game-controls {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.control-btn {
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    border-color: #10b981;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-btn .btn-icon {
    font-size: 24px;
}

.control-btn .btn-text {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.undo-btn:hover:not(:disabled) {
    border-color: #f59e0b;
}

.reset-btn:hover {
    border-color: #ef4444;
}

.new-game-btn:hover {
    border-color: #8b5cf6;
}

.stats-btn:hover {
    border-color: #3b82f6;
}

/* Statistics Panel */
.stats-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 20px rgba(0,0,0,0.3);
    transition: right 0.3s;
    z-index: 1000;
    overflow-y: auto;
}

.stats-panel.active {
    right: 0;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #f3f4f6;
}

.stats-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.close-stats-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.close-stats-btn:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

.stats-content {
    padding: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 10px;
    background: #f9fafb;
    border-radius: 10px;
}

.stat-label {
    font-weight: 600;
    color: #555;
}

.stat-value {
    font-weight: 700;
    color: #10b981;
    font-size: 18px;
}

.reset-stats-btn {
    width: 100%;
    padding: 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 20px 0;
}

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

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 9999;
    animation: confettiFall 3s linear forwards;
    pointer-events: none;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Info & Features Boxes */
.info-box {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 5px solid #10b981;
    padding: 30px;
    border-radius: 15px;
    margin-top: 40px;
}

.info-box h4 {
    color: #065f46;
    margin-bottom: 20px;
    font-size: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.info-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.info-item strong {
    color: #065f46;
    display: block;
    margin-bottom: 5px;
}

.features-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
}

.features-box h4 {
    color: #92400e;
    font-size: 20px;
    margin-bottom: 20px;
}

.features-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-box li {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #78350f;
    line-height: 1.6;
}

.features-box li strong {
    color: #92400e;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .player-info {
        justify-content: center;
    }
    
    .game-controls {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cell {
        font-size: 40px;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .mode-selection {
        grid-template-columns: 1fr;
    }
    
    .difficulty-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .board-container {
        padding: 20px 15px;
    }
    
    .cell {
        font-size: 32px;
    }
    
    .player-symbol {
        font-size: 28px;
    }
    
    .game-controls {
        gap: 8px;
    }
    
    .control-btn .btn-icon {
        font-size: 20px;
    }
    
    .control-btn .btn-text {
        font-size: 11px;
    }
}

/* SEO Content */
.seo-content {
    padding: 80px 20px;
    background: white;
}

.content-article {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.content-article h2 {
    font-size: 32px;
    font-weight: 800;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #333;
}

.content-article h2:first-child {
    margin-top: 0;
}

.content-article h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #444;
}

.content-article p {
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.content-article strong {
    color: #333;
    font-weight: 700;
}

/* Related Tools */
.related-tools {
    max-width: 900px;
    margin: 60px auto 0;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
}

.related-tools h3 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    text-align: center;
    color: #10b981;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.related-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 25px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
}

.related-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #10b981;
}

.related-tool-card .tool-icon {
    font-size: 42px;
}

.related-tool-card .tool-name {
    font-weight: 700;
    color: #333;
    font-size: 16px;
}