@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

::-webkit-scrollbar {
    width: 10px;
    border-radius: 10px;
    background-color: #BECFAD;
}

::-webkit-scrollbar:hover {
    background-color: #BECFAD;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #222813, #708054);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #708054, #222813);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Poppins", sans-serif;
    text-align: center;
    background: linear-gradient(to bottom, #708054, #222813);
    background-size: contain;
    background-repeat: no-repeat;
    height: 100vh;
}

.memory-container {
    margin: 5rem auto;
}

.memory-container h2 {
    background: linear-gradient(to bottom, #CA9B29, #543d0e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.game-board {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 2rem auto;
}

.card {
    width: 100px;
    height: 100px;
    background: linear-gradient(to bottom, #CA9B29, #7E5B15);
    color: #E0DDCA;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    cursor: pointer;
}

.card:hover {
    background: linear-gradient(to bottom, #7E5B15, #CA9B29);
    transform: translateY(-5px);
}

.card.flipped {
    background: #E0DDCA;
    color: #2B331B;
    border: 2px solid #2B331B;
}

#gameBoard {
    display: flex;
    flex-wrap: wrap;
    max-width: 440px;
    margin-bottom: 20px;
}

.win-message {
    font-size: 1.8em;
    color: #fff;
    margin-top: 0.8rem;
}

#restartButton {
    background: linear-gradient(to right, #CA9B29, #543d0e);
    padding: 0.5rem 1rem;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
    border-radius: 0.4rem;
    color: #fff;
    font-size: 1.2rem;
}

#restartButton:hover {
    background: linear-gradient(to right, #543d0e, #CA9B29);
    transform: scale(1.05);
    cursor: pointer;
}

/* Navbar */
.navbar {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    display: flex;
    justify-content: flex-start;
}

/* Back Button */
.back-button {
    background: #2867f0;
    color: white;
    border: none;
    padding: 0.8rem 20px;
    width: 4rem;
    height: 2.5rem;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #0190f6;
    transform: scale(1.05);
}

.toggle-btn {
    position: fixed;
    top: 0;
    right: 20px;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 30px;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toggle theme style */
#toggleTheme {
    background: transparent;
    box-shadow: none;
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Click animation (subtle scaling effect) */
#toggleTheme:active {
    transform: scale(0.9);
    opacity: 0.7;
}

/* Dark mode effect */
.dark-mode #toggleTheme {
    background: transparent;
    box-shadow: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Click animation in dark mode */
.dark-mode #toggleTheme:active {
    transform: scale(0.9);
    opacity: 0.7;
}

.toggle-btn:hover {
    background: #0056b3;
}

body.dark-mode {
    background: #121212;
    color: #fff;
}

/* Dark mode for header */
.dark-mode nav {
    background: linear-gradient(135deg, #1e1e1e, #333);
}