* {
    user-select: none;
}

.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    top: var(--headerheight);
    height: calc(100dvh - var(--headerheight));
    width: 100vw;
    margin-bottom: 20px;
}

.menu-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 20px;
}

.card-column-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.selected-card-container {
    position: relative; /* for stacking children absolutely */
    width: 100%;
    height: 70vh;
    aspect-ratio: var(--cardRatio);
    padding: 15px;
    border: 3px dashed var(--primarypagecolour);
    border-radius: 4px;
    box-sizing: border-box;
    perspective: 1000px; /* enables 3D effect */
    display: flex;
    justify-content: center;
    align-items: center;
}

.gamemode-info-container {
    text-align: center;
    font-size: 16px;
    color: var(--primarypagecolour);
    font-weight: bold;
    border: 3px dashed var(--primarypagecolour);
    border-radius: 4px;
    width: 100%;
}

.card-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 240px;
    aspect-ratio: var(--cardRatio);
    margin: 0 auto;
}

.card-container img {
    height: 100%;
    width: auto;
}

.arrow-btn {
    all: unset;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 48px;
    color: var(--primarypagecolour);
}

.arrow-btn.disabled{
    color: var(--backgroundcolour);
    cursor: default;
}

.arrow-left {
    margin-right: 10px;
}

.arrow-right {
    margin-left: 10px;
}

.carousel-item {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    background-color: var(--backgroundcolour);
    border: var(--bordersize) solid var(--primarypagecolour);
    border-radius: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.carousel-item.selected {
    color: var(--backgroundcolour);
}


.carousel-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    height: 20px;
    width: 100%;
    border: 3px dashed var(--primarypagecolour);
    border-radius: 4px;
}

.carousel-separator {
    width: 4px;
    border-radius: 2px;
    height: 100%;
    background-color: var(--primarypagecolour);
    align-self: stretch;
}

.selected-card-container .card-flip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: translateX(0) rotateZ(0);
    transition: transform 0.8s ease;
}

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

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 15px;
}

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


/* Shake animation with flip support */
.card-flip.flipped.shake {
  animation: shake-flip 0.3s;
}

@keyframes shake {
  0%   { transform: translateX(0) rotateZ(0); }
  25%  { transform: translateX(-10px) rotateZ(-2deg); }
  50%  { transform: translateX(10px) rotateZ(2deg); }
  75%  { transform: translateX(-5px) rotateZ(-1deg); }
  100% { transform: translateX(0) rotateZ(0); }
}

@keyframes shake-flip {
  0%   { transform: rotateY(180deg) translateX(0) rotateZ(0); }
  25%  { transform: rotateY(180deg) translateX(-10px) rotateZ(-2deg); }
  50%  { transform: rotateY(180deg) translateX(10px) rotateZ(2deg); }
  75%  { transform: rotateY(180deg) translateX(-5px) rotateZ(-1deg); }
  100% { transform: rotateY(180deg) translateX(0) rotateZ(0); }
}

.shake {
  animation: shake 0.3s;
}

@media (orientation: portrait) {
    .selected-card-container {
        width: 100%;
        height: 50vh;
    }
}