/* RESET CSS */
*,
*::before,
::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;

    /* Prevent text selection by the user. */
    user-select: none; /* Standard */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE/Edge */
    -webkit-user-select: none; /* Chrome, Safari */
}

/* VARIABLES */
:root {
    --dark-color: rgb(2, 4, 8);
    --dark-hover: rgba(255, 255, 255, 0.1);

    --light-color: rgb(245, 245, 245);
    --light-hover: rgba(0, 0, 0, 0.1);
}

/* GENERAL */
body {
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: monospace, sans-serif;
    font-size: 0.5rem;
    cursor: default;
    transition: background-color 0.3s;
}

body.light-mode {
    color: var(--dark-color);
    background-color: var(--light-color)
}

body.light-mode #toggle-mode-btn:hover {
    background-color: var(--light-hover);
}

body.dark-mode {
    color: var(--light-color);
    background-color: var(--dark-color);
}

body.dark-mode #toggle-mode-btn:hover {
    background-color: var(--dark-hover);
}

a {
    text-decoration: none;
    color: var(--dark-color);
}

/* MAIN */
#toggle-mode-btn {
    width: 2rem;
    height: 2rem;
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    border: none;
    border-radius: 0.5rem;
    background-color: transparent;
    transition: background-color 0.3s;
    cursor: pointer;
}

#portfolio-link {
    padding-right: 0.5rem;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    font-size: 0.75rem;
}

#github-link {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
}

/* RESPONSIVE WARNING */
#responsive-warning {
    width: 100%;
    height: 100%;
    padding: 2rem;
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    font-size: 1rem;
    text-align: center;
    z-index: 9999;
}

.warning-icons {
    font-size: 10rem;
}

@media (max-width: 768px) {
    #responsive-warning.show {
        display: flex;
    }
}

/* SIMPLE MEMORY GAME */
#game-container {
    display: grid;
    grid-template-columns: repeat(4, 10rem);
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.card {
    width: 10rem;
    height: 10rem;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(0);
    transition: transform 0.5s ease-in-out;
}

.card-front,
.card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 0.5rem;
    backface-visibility: hidden;
}

.card-front {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 5rem;
    background-color: #4caf50;
    transform: rotateY(180deg);
}

.card-back {
    background-color: #cccccc;
    cursor: pointer;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}