/* Global Styles */
body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    background-size: 300% 300%;
    font-family: Arial, sans-serif;
    margin: 0;
    transition: background-color 1s ease, color 1s ease;
}

/* Theme Toggle Button */
#themeToggle {
    margin: 10px;
    padding: 12px 24px;
    font-size: 1rem;
}

/* Game Title */
.game-title {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: bold;
    color: #ffea00;
    text-shadow: 0 0 20px #ffea00, 0 0 40px #ffcc00;
    margin-bottom: 20px;
    text-align: center;
    animation: glow 1.5s infinite alternate;
}

/* Board */
.container {
    text-align: center;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, minmax(70px, 100px));
    grid-template-rows: repeat(3, minmax(70px, 100px));
    gap: 10px;
    justify-content: center;
    align-items: center;
}

/* Cells */
.cell {
    user-select: none;
    width: min(22vw, 100px);
    height: min(22vw, 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: min(10vw, 3rem);
    font-weight: bold;
    cursor: pointer;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    color: white;
    transition: transform 0.2s ease-in-out, background 0.3s ease-in-out;
}

.cell:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cell:active {
    transform: scale(1.1);
}

/* X and O Colors */
.cell.x {
    color: cyan;
    text-shadow: 0 0 15px cyan;
}

.cell.o {
    color: pink;
    text-shadow: 0 0 15px pink;
}

/* Restart Button */
#restartBtn {
    margin-top: 20px;
    /* margin-left: 20px; */
    padding: 12px 24px;
    font-size: clamp(1rem, 3vw, 1.2rem);
    border: none;
    background-color: black;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}

#restartBtn {
    margin-right: 14px; /* ✅ Restart aur Theme Toggle ke beech gap */
}

/* Choti screen ke liye responsive spacing */
@media (max-width: 500px) {
    #restartBtn {
        margin-right:7px; /* ✅ Choti screen pe thoda kam gap */
    }
}


#restartBtn:hover {
    transform: scale(1.1);
    background-color: #222;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.7);
}



/* Dark Mode */
.dark-mode {
    background: black;
    color: white;
}

/* Victory GIF */
.hidden {
    display: none;
}

.show {
    display: block;
    width: 150px;
    margin: 20px auto;
}

/* Winning Cells */
.winning-cell {
    animation: glow 0.8s infinite alternate;
}

/* Button Styling - Modern Gradient Look */
button {
    background: linear-gradient(45deg, #ff6b6b, #ffcc5c);
    border: none;
    padding: 12px 24px;
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: bold;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Hover Effect */
button:hover {
    background: linear-gradient(45deg, #ffcc5c, #ff6b6b);
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Adjust Button Colors in Dark Mode */
.dark-mode button {
    background: linear-gradient(45deg, #66a6ff, #89f7fe);
    color: black;
}

.dark-mode button:hover {
    background: linear-gradient(45deg, #89f7fe, #66a6ff);
}

/* Glow Animation */
@keyframes glow {
    0% {
        background-color: yellow;
    }
    100% {
        background-color: orange;
    }
}

/* Fully Responsive Design */
@media (max-width: 500px) {
    .board {
        grid-template-columns: repeat(3, minmax(60px, 80px));
        grid-template-rows: repeat(3, minmax(60px, 80px));
    }

    .cell {
        width: min(22vw, 80px);
        height: min(22vw, 80px);
        font-size: min(9vw, 2.5rem);
    }

    .game-title {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
    }
}

@media (max-width: 350px) {
    .board {
        grid-template-columns: repeat(3, minmax(55px, 70px));
        grid-template-rows: repeat(3, minmax(55px, 70px));
    }

    .cell {
        width: min(22vw, 70px);
        height: min(22vw, 70px);
        font-size: min(8vw, 2rem);
    }

    .game-title {
        font-size: clamp(1.5rem, 4.5vw, 2rem);
    }
}

/* Winning cells highlight */
.win {
    background-color: yellow !important;
    animation: glow 1s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 15px yellow;
    }
    to {
        box-shadow: 0 0 30px yellow;
    }
}
