:root {
    --background-color: #050505;
    --button-border-color: #ffffff30;
    --card-background-color: #111111;
    --card-border-color: #0d0d0d;
    --card-border-color-hover: #171717;
    --card-description-color: #afafaf;
    --badge-color: #ff0000;
    --accent-color: #329607;
    --text-color: white;
    --text-color-secondary: #aeaeae;
    --item-bg: #0d0d0d;
    --item-border: #111111;
    --button-color: #6480f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Urbanist", sans-serif;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
}

header {
    position: relative;
    text-align: center;
    padding: 10rem 0;
    width: 100%;
    height: 590px;
    overflow: hidden;
    margin-bottom: 4rem;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../images/bg.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(1px);
    z-index: -1;
}

.logo {
    width: 45rem;
    animation: pulse 4s infinite;
}

nav {
    margin-top: 4rem;
}

li {
    list-style: none;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.button {
    border-radius: 0.6rem;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: none;
    padding: 0.8rem 2rem;
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.2s;
    border: 1px solid var(--button-border-color);
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.button:hover {
    transform: translateY(-0.2rem);
    filter: brightness(1.1);
}

.button:active {
    filter: brightness(1.2);
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    25%,
    75% {
        transform: scale(1.02);
    }
    50% {
        transform: scale(1);
    }
}

/* Containers */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 540px) {
    .container { max-width: 540px; }
}
@media (min-width: 668px) {
    .container { max-width: 668px; }
}
@media (min-width: 924px) {
    .container { max-width: 924px; }
}
@media (min-width: 1180px) {
    .container { max-width: 1180px; }
}
@media (min-width: 1436px) {
    .container { max-width: 1436px; }
}

/* Gamemodes */
.gamemodes {
    display: flex;
    gap: 2rem;
    align-items: stretch;
}

.gamemode {
    border: 1px var(--card-background-color) solid;
    background-color: var(--card-border-color);
    display: flex;
    flex-direction: column;
    color: white;
    border-radius: 0.6rem;
    height: fit-content;
    overflow: hidden;
    transition: all 0.2s;
    position: relative;
    flex: 1; 
}

.gamemode:hover {
    transform: translateY(-0.5rem);
    filter: brightness(1.1);
    border: 1px var(--card-border-color-hover) solid;
}

.gamemode img {
    width: 100%;
    height: 12rem;
    object-fit: cover;
    border-radius: 0.6rem 0.6rem 0 0;
}

.gamemode .desc {
    padding: 2rem;
}

.gamemode .desc h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.gamemode .desc p {
    color: var(--card-description-color);
}

.gamemode .badge {
    background-color: var(--badge-color);
    border: 1px solid var(--button-border-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.6rem;
    font-weight: 800;
    position: absolute;
    text-transform: uppercase;
    top: 1rem;
    left: 1rem;
}

/* Vote Section */
.vote {
    margin-top: 5rem;
    background-color: var(--accent-color);
    color: #ffffff;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    border-radius: 0.6rem;
}

.vote h2 {
    font-size: 1.5rem;
}

.vote p {
    color: #ffffff;
}

.vote a {
    border: 1px solid var(--accent-color);
    background-color: white;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 4rem;
    font-weight: 800;
    border-radius: 0.6rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.vote a:hover {
    transform: scale(1.05);
}

.about-voting {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 4rem auto;
    column-gap: 3rem;
}

.about-voting .image {
    flex: 1;
}
.about-voting .image img {
    width: 100%;
    height: auto;
    display: block;
}

.about-voting .text {
    flex: 1;
}
.about-voting .text h2 {
    margin-bottom: 1rem;
}
.about-voting .text p {
    line-height: 1.5;
}

.vote-links h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

/* Footer */
footer {
    margin-top: 5rem;
    padding: 4rem 0;
}

footer .container {
    display: flex;
    flex-wrap: wrap;
    text-align: center;
    gap: 3.5rem 2rem;
}

footer p {
    color: #afafaf;
    line-height: 1.5;
}

footer ul {
    list-style: none;
    padding: 0;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer ul li a {
    color: var(--card-description-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

footer ul li a:hover {
    color: var(--accent-color);
}

footer div {
    flex: 1 1 30%;
}

footer .copyright {
    text-align: center;
    width: 100%;
    margin-top: 2rem;
}

footer .footer-info {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.textpage-title {
    font-size: 4rem;
    margin-top: 2rem;
    margin-bottom: 4.5rem;
}

/* textpage styling */

.textpage-content {
    color: white;
    max-width: 640px;
    margin: 0 auto;
}

.textpage-content h2 {
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.textpage-content p {
    font-size: 1.1rem;
    line-height: 1.5;
    font-weight: 400;
}

.textpage-content a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.textpage-content a:hover {
    text-decoration: underline;
}

.textpage-content ol {
    margin-top: 1rem;
}

.paragraph-1 {
    counter-reset: main-counter 1 sub-counter;
}

.paragraph-2 {
    counter-reset: main-counter 2 sub-counter;
}

.paragraph-3 {
    counter-reset: main-counter 3 sub-counter;
}

.paragraph-4 {
    counter-reset: main-counter 4 sub-counter;
}

.paragraph-5 {
    counter-reset: main-counter 5 sub-counter;
}

.paragraph-6 {
    counter-reset: main-counter 6 sub-counter;
}

.textpage-content ol li {
    counter-increment: sub-counter;
    position: relative;
    padding-left: 2.5rem;

    font-size: 1.1em;
    margin-bottom: 0.6rem;
}

.textpage-content ol li::before {
    content: counter(main-counter) "." counter(sub-counter) ". ";
    position: absolute;
    left: 0;
    font-weight: bold;
}

.site-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 2rem;
}

.site-text {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.site-text span {
    color: var(--text-color-secondary);
}

.site {
    border: 1px solid var(--item-border);
    background-color: var(--item-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.site h3 {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 0.2rem;
}

.site img {
    width: 2rem;
    height: 2rem;
    color: white;
}

.site a {
    background-color: var(--button-color);
    padding: 1rem 2rem;
    border-radius: 0.6rem;
    display: flex;
    justify-items: center;
    align-items: center;
    transition: 0.2s;
}

.site a:hover {
    filter: brightness(1.2);
    transform: translateX(0.2rem);
}

/* Shop styling */

.alert {
    background-color: var(--card-border-color);
    border: 1px solid var(--card-background-color);
    border-radius: 0.6rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    align-items: center;
}

.alert img {
    margin-right: 0.5rem;
}

.alert::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0.5rem;
    background-color: var(--badge-color);
    border-top-left-radius: 0.6rem;
    border-top-right-radius: 0.6rem;
}

.processing::before {
    background-color: var(--accent-color);
}

/* Products */

.products-main {
    display: grid;
    grid-template-columns: 1fr 0.3fr;
    gap: 1rem;
}

.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.product-card {
    background-color: var(--card-border-color);
    border: 1px solid var(--card-background-color);
    border-radius: 0.6rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.2s;
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .discount {
    background-color: var(--badge-color);
    padding: 0.2rem 0.5rem;
    border-radius: 0.6rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.product-card .price {
    font-size: 1rem;
    margin-top: 0.5rem;
}

.product-card del {
    color: var(--card-description-color);
}

.product-card:hover {
    filter: brightness(1.1);
    border: 1px var(--card-border-color-hover) solid;
}

.buy-button,
.voucher-container button {
    background-color: var(--accent-color);
    border: 1px solid #ffffff30;
    width: 100%;
    padding: 0.8rem 0;
    border-radius: 0.6rem;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s;
    margin-top: 1rem;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.buy-button:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.buy-button:active,
.voucher-container button:active {
    filter: brightness(1.2);
}

/* Recent purchases */

aside {
    background-color: var(--card-border-color);
    border: 1px solid var(--card-background-color);
    border-radius: 0.6rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: white;
}

.recent-purchases {
    position: relative;
}

.recent-purchases ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-purchases .purchase-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.recent-purchases .purchase-item img {
    width: 40px;
    height: 40px;
    border-radius: 0.1rem;
}

.recent-purchases .purchase-item .username {
    font-weight: 700;
}

.recent-purchases .purchase-item .purchase {
    color: var(--card-description-color);
}

.voucher-container {
    display: flex;
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 1rem;
    width: 100%;
}

.voucher-container button:hover {
    filter: brightness(1.1);
}

/* Popup styling */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    z-index: 100;
    overflow-y: auto;
    transition: visibility 0.3s ease, opacity 0.3s ease,
        background-color 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.popup.active {
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background-color: var(--card-border-color);
    border: 1px solid var(--card-background-color);
    padding: 2rem;
    border-radius: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 55rem;
    min-width: 55rem;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.popup.active .popup-content {
    transform: translateY(0);
    opacity: 1;
}

.popup-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.modal-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0);
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.popup-header .discount {
    background-color: var(--badge-color);
    padding: 0.2rem 0.5rem;
    border-radius: 0.6rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.popup-image {
    max-width: 100%;
    max-height: 200px;
    object-fit: cover;
}

.popup-description {
    display: flex;
    gap: 4rem;
}

.popup-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cancel-button {
    background-color: var(--card-border-color-hover);
    border: 1px solid var(--button-border-color);
    padding: 1rem 2rem;
    height: 100%;
    border-radius: 0.6rem;
    font-weight: 700;
    transition: all 0.2s;
    cursor: pointer;
    color: #ffffff;
}

.cancel-button:hover {
    filter: brightness(1.1);
}

.cancel-button:active {
    filter: brightness(1.2);
}

.popup-footer {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.popup-footer .buy-button,
.popup-footer .cancel-button {
    margin-top: 0 !important;
    width: 50%;
}

@media (max-width: 768px) {
    .popup-footer {
        flex-direction: column;
    }

    .popup-footer .buy-button,
    .popup-footer .cancel-button {
        width: 100%;
    }
}

.popup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popup-form input {
    padding: 0.8rem 1rem;
    border-radius: 0.6rem;
    border: 1px solid var(--border-border-color);
    background-color: var(--card-border-color-hover);
    color: white;
}

.popup-form input:disabled {
    color: #949494;
}


.popup-form-checkbox {
    font-weight: 200 !important;
}

.popup-form-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.popup-form-group-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.input-wrapper input {
    flex: 1;
}

.input-wrapper button {
    background-color: var(--accent-color);
    width: 30%;
    border-radius: 0.6rem;
    font-weight: 700;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid #ffffff30;
    color: #ffffff;
    display: none;
}

.input-wrapper button:disabled {
    background-color: var(--card-border-color-hover);
    border: 1px solid var(--button-border-color);
    cursor: default;
    color: #949494;
}

.input-wrapper button:not([disabled]):hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

@media (max-width: 768px) {
    .popup-description {
        flex-wrap: wrap;
    }

    .input-wrapper {
        flex-direction: column;
        gap: 0.75rem;
    }

    .input-wrapper button {
        width: 100%;
        padding: 0.8rem 0;
    }
}

.cart-icon {
    width: 1.5rem !important;
    height: 1.5rem !important;
}

.payment-methods {
    margin: 1.5rem 0;
}

.payment-methods h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: white;
}

.payment-options {
    display: flex;
    gap: 0.75rem;
}

.payment-option {
    display: flex;
    width: 100%;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--card-border-color-hover);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-option:hover {
    border-color: var(--accent-color);
    background: var(--card-border-color-hover);
}


.payment-option input[type="radio"] {
    display: none;
}

.payment-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--button-border-color);
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
}

.payment-check:after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
}

.payment-option input[type="radio"]:checked + .payment-check {
    border-color: var(--accent-color);
}

.payment-option input[type="radio"]:checked + .payment-check:after {
    transform: translate(-50%, -50%) scale(1);
}

.payment-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #fff;
}

@media (max-width: 768px) {
    .payment-options {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .popup-content {
        min-width: auto;
    }

    .products-main {
        display: flex;
        flex-direction: column;
    }

    .products {
        grid-template-columns: 1fr;
        grid-row: auto;
    }

    aside {
        grid-row: auto;
        padding: 1rem;
    }

    .product-card {
        padding: 1rem;
    }

    .buy-button {
        font-size: 0.9rem;
    }

    .recent-purchases .purchase-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .logo {
        width: 100%;
    }

    .about-voting {
        flex-direction: column;
    }

    .buttons {
        flex-direction: column;
        padding: 0 1rem;
    }

    .gamemodes {
        flex-direction: column;
        gap: 2rem;
    }

    .vote {
        flex-direction: column;
        gap: 2rem;
    }

    footer .container {
        flex-direction: column;
        text-align: center;
    }

    footer div {
        flex: 1 1 100%;
    }

    .rewards {
        margin-top: 4rem;
    }
    
    .rewards-container {
        grid-template-columns: 1fr;
    }

    .site-container {
        grid-template-columns: 1fr;
    }

    .site {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .site a {
        width: 100%;
    }

    .site img {
        margin: auto;
    }
}