@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');

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

body {
    font-family: 'Poppins', sans-serif;
}

a {
    text-decoration: none;
}

.loading-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(42, 42, 42);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: 0.3s opacity ease-in-out;
}

.loading-wrapper.hide {
    pointer-events: none;
    opacity: 0;
}

.loading-bar {
    border: 16px solid #f3f3f3; /* Light grey */
    border-top: 16px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}
  
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dialog.dialog-wrapper {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.5s opacity ease-in-out;
    opacity: 1;
}

.dialog.dialog-wrapper.hide {
    opacity: 0;
    pointer-events: none;
}

.dialog.dialog-card {
    width: 100%;
    margin: 0 24px;
    max-width: 600px;
    background-color: #fff;
    border-radius: 6px;
    opacity: 1;
}

.dialog.dialog-wrapper.show .dialog-card {
    animation: slide 0.5s ease-in-out forwards;
}

.dialog.dialog-wrapper.hide .dialog-card {
    animation: slide 0.5s ease-in-out backwards reverse;
}

@keyframes slide {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.dialog.dialog-header {
    padding-inline: 24px;
    padding-top: 16px;
    padding-bottom: 8px;
    font-size: 24px;
    font-weight: bold;
    color: #2b2b2b;
}

.dialog.dialog-body {
    padding: 8px 24px;
    font-size: 16px;
    color: rgba(42, 42, 42, 0.8);
}

.dialog.dialog-body > *:not(:last-child) {
    margin-bottom: 8px;
}

.dialog.button-wrapper {
    width: 100%;
    display: flex;
    gap: 8px;
    padding-top: 10px;
    padding-inline: 24px;
    padding-bottom: 20px;
}

.dialog.dialog-btn {
    cursor: pointer;
    flex-grow: 1;
    padding: 10px 16px;
    background: none;
    border-radius: 99px;
    border: none;
    font-weight: bold;
    transition: background 0.2s ease-in-out;
}

.dialog.dialog-btn:hover {
    background: #e2e2e2;
}

.dialog.dialog-btn.btn-confirm {
    background: #2d4462;
    color: white;
}

.dialog.dialog-btn.btn-confirm:hover {
    background: #1e2d42;
}

.dialog.dialog-btn.btn-cancel {
    color: rgb(201, 58, 58);
}

.select-wrapper {
    width: fit-content;
    padding-right: 16px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.select-option {
    cursor: pointer;
    border: none;
    outline: none;
    padding: 10px 0 10px 16px;
}

.timer.timer-wrapper {
    max-width: 840px;
    padding-inline: 5px;
    width: 100%;
}

.timer.timer-range {
    width: 100%;
    height: 20px;
    background-color: #ccc;
    border-radius: 99px;
    overflow: hidden;
}

@keyframes shrink {
    0% {
        width: 100%;
    }

    100% {
        width: 0%;
    }
}

.timer.timer-slider {
    width: 100%;
    height: 100%;
    background: #2980b9;
}

.timer.timer-indicator {
    margin-bottom: 10px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
}

.container {
    padding: 2.5rem 6.25rem;
}

.main.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.title {
    font-size: clamp(1.5rem, 1.1667rem + 1.4815vw, 2.5rem);
    margin-bottom: 1.5rem;
    color: #2b2b2b;
    text-align: center;
}

#card-board {
    margin: 24px auto 48px;
    width: 100%;
    max-width: 840px;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

#card-board .card-wrapper {
    cursor: pointer;
    background-color: transparent;
    perspective: 1000px;
    width: calc(25% - 10px);
    aspect-ratio: 9 / 14;
}

#card-board .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s ease-in-out;
    transform-style: preserve-3d;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.10), 6px 12px 16px rgba(0, 0, 0, 0.08);
}

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

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

.card-front {
    background-color: #bbb;
    color: black;
}

.card-back {
    background-color: #2980b9;
    border: inset 4px rgba(25, 35, 60, 0.3);
    color: white;
    transform: rotateY(180deg);
}

.card-front img,
.card-back img {
    user-select: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.footer.container {
    padding-block: 1.5rem;
    background-color: #2b2b2b;
    color: white;
    text-align: center;
}

.footer.container a {
    position: relative;
    color: rgb(107, 207, 238);
}

.footer.container a::after {
    left: 0;
    top: -2px;
}

.footer.container a::before {
    left: 0;
    bottom: -2px;
}

.footer.container a::after,
.footer.container a::before {
    content: '';
    position: absolute;
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 1px;
    background-color: rgb(107, 207, 238);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease-in-out;
}

.footer.container a:hover::after,
.footer.container a:hover::before {
    transform: scaleX(1);
}

@media screen and (max-width: 1024px){
    .container{
        padding: 2rem 5rem;
    }
}

@media screen and (max-width: 728px){
    .container{
        padding: 2rem 4rem;
    }

    .card-back {
        border: inset 2px rgba(25, 35, 60, 0.3);
    }
}

@media screen and (max-width: 640px){
    #card-board .card-wrapper {
        width: calc(33% - 10px);
    }
}

@media screen and (max-width: 480px){
    .container{
        padding: 1.5rem;
    } 
}