html,
body {
    min-height: 100%;
}

.landing-body {

    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(0, 229, 255, 0.18), transparent 45%),
        linear-gradient(180deg, #070b14 0%, #040711 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: #040711;

    overflow-x: hidden;
    overflow-y: auto;
}

#landing-app {

    min-height: 100vh;

    padding: 24px;
}

#landing-header {

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}

#landing-logo {

    display: flex;

    align-items: center;

    text-decoration: none;
}

#account-btn {

    width: auto;

    min-width: 210px;

    margin-bottom: 0;

    border-color: rgba(255, 0, 170, 0.7);

    color: #ff4fd8;

    background: rgba(30, 0, 40, 0.78);

    font-weight: bold;

    letter-spacing: 1px;
}

#account-btn:hover {

    box-shadow:
        0 0 18px rgba(255, 0, 170, 0.55);
}

#account-btn:disabled {

    opacity: 0.7;

    cursor: default;

    border-color:
        rgba(0,255,159,.6);

    color:
        var(--green);

    background:
        rgba(0,255,159,.08);

    box-shadow:
        0 0 15px rgba(
            0,
            255,
            159,
            .15
        );
}

#landing-main,
#faq-view {

    max-width: 1600px;

    margin: 0 auto;
}

#hero-section {

    text-align: center;

    padding: 22px 0 34px;
}

#mobile-background-logo {
    display: none;
}

#background_logo {
    width: 100%;

    min-height:
        clamp(
            180px,
            28vw,
            420px
        );

    margin-bottom: 28px;

    display: flex;

    align-items: center;
    justify-content: center;

    filter:
        drop-shadow(
            0 0 12px
            rgba(0, 229, 255, 0.65)
        );
}

/* Logo - Smaller devices */

@media (max-width: 1100px) {

    #mobile-background-logo {
        display: flex;

        width: 100%;

        justify-content: center;
        align-items: center;

        padding:
            14px 10px
            8px;
    }

    #mobile-background-logo img {
        display: block;

        width:
            min(
                80vw,
                520px
            );

        height: auto;

        filter:
            drop-shadow(
                0 0 12px
                rgba(0, 229, 255, 0.65)
            );
    }

    #hero-section #background_logo {
        display: none;
    }
}

@media (max-width: 920px) {

    #account-panel {
        position: relative;

        top: auto;
        right: auto;
        left: auto;

        width: min(94vw, 520px);

        margin:
            0 auto 16px;

        align-self: center;
    }

    #landing-app {
        padding: 12px;
    }

    #mobile-background-logo {
        padding:
            8px 6px
            4px;
    }

    #mobile-background-logo img {
        width:
            min(
                92vw,
                430px
            );
    }

    #landing-logo-img {
        width:
            min(
                94vw,
                520px
            );
    }

    #account-panel,
    #leaderboard-panel {
        width: 100%;
        min-width: 0;
    }

    #leaderboard-panel {
        gap: 8px;
    }

    #leaderboard-ai-btn,
    #leaderboard-pvp-btn {
        width: 100%;
    }
}

#hero-section h2,
#faq-panel h1 {

    color: var(--cyan);

    font-size: clamp(2.0rem, 6vw, 5rem);

    letter-spacing: 4px;

    text-shadow:
        0 0 16px rgba(0, 229, 255, 0.9);

    margin-bottom: 15px;
}

.hero-subtitle {

    max-width: 760px;

    margin: 0 auto 30px;

    color: rgba(215, 225, 255, 0.82);

    font-size: 1.08rem;

    line-height: 1.55;
}

#portal-actions {

    display: grid;

    grid-template-columns: repeat(4, minmax(180px, 1fr));

    gap: 18px;

    max-width: 1300px;

    margin: 0 auto;
}

.portal-btn {

    width: 100%;

    min-height: 100px;

    display: flex;

    flex-direction: column;

    justify-content: center;
   
    align-items: center;

    gap: 7px;

    text-decoration: none;

    border: 1px solid rgba(0, 229, 255, 0.45);

    background: rgba(16, 24, 38, 0.92);

    color: var(--text);

    font-weight: bold;

    letter-spacing: 1.5px;

    box-shadow:
        inset 0 0 18px rgba(0, 229, 255, 0.06);
}

.portal-btn span {

    color: var(--green);

    font-size: 0.75rem;

    letter-spacing: 2px;
}

.portal-btn.primary {

    border-color: var(--green);

    color: var(--green);

    background: rgba(0, 255, 159, 0.08);
}

.portal-btn:hover {

    transform: translateY(-4px);

    box-shadow:
        0 0 20px rgba(0, 229, 255, 0.42),
        inset 0 0 20px rgba(255, 0, 170, 0.08);
}

.portal-btn.disabled {

    opacity: 0.72;
}

#promo-grid {

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 18px;

    padding-bottom: 50px;
}

.promo-card {

    justify-items: center;

    padding: 16px;

    border: 1px solid rgba(0, 229, 255, 0.24);

    background: rgba(10, 15, 25, 0.9);

    box-shadow:
        0 0 16px rgba(0, 229, 255, 0.08);
}

.promo-card h2,
.faq-item h2 {

    color: var(--cyan);

    font-size: 0.95rem;

    letter-spacing: 2px;

    margin-bottom: 10px;
}

.promo-card p,
.faq-item p {

    color: rgba(215, 225, 255, 0.78);

    line-height: 1.5;

    font-size: 0.95rem;
}

#faq-panel {

    max-width: 850px;

    margin: 40px auto;

    padding: 28px;

    border: 1px solid rgba(255, 0, 170, 0.36);

    background: rgba(10, 15, 25, 0.94);

    box-shadow:
        0 0 26px rgba(255, 0, 170, 0.16),
        inset 0 0 20px rgba(0, 229, 255, 0.06);
}

.faq-item {

    margin-bottom: 18px;

    padding-bottom: 18px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#back-home-btn {

    margin-top: 14px;

    border-color: var(--green);

    color: var(--green);

    background: rgba(0, 255, 159, 0.08);
}

.hidden {

    display: none !important;
}

@media (max-width: 920px) {

    #portal-actions,
    #promo-grid {

        grid-template-columns: 1fr;
    }


    #promo-grid {

        width: 100%;

        max-width: 560px;

        margin-left: auto;
        margin-right: auto;
    }


    .promo-card {

        width: 100%;

        box-sizing: border-box;
    }


    .promo-image-placeholder {

        width: 100%;

        display: flex;

        justify-content: center;
        align-items: center;

        overflow: hidden;
    }


    .promo-image-placeholder img {

        display: block;

        width: 100%;

        max-width: 480px;

        height: auto;

        object-fit: contain;

        margin: 0 auto;
    }


    #landing-header {

        flex-direction: column;
    }


    #account-btn {

        width: 100%;
    }


    #hero-banner-placeholder {

        height: 190px;
    }
}

@media (max-width: 600px) {

    #promo-grid {

        max-width: 440px;

        padding-left: 8px;
        padding-right: 8px;

        box-sizing: border-box;
    }


    .promo-card {

        padding: 12px;
    }


    .promo-image-placeholder img {

        max-width: 400px;
    }
}

#account-panel {

    display: flex;

    flex-direction: column;

    gap: 10px;

    padding: 16px;

    width: fit-content;

    min-width: 340px;

    border: 1px solid rgba(
        0,
        229,
        255,
        .3
    );

    background: rgba(
        10,
        15,
        25,
        .85
    );

    box-shadow:
        0 0 18px rgba(
            0,
            229,
            255,
            .15
        );
}

#account-status {

    color: var(--cyan);

    font-weight: bold;

    letter-spacing: 2px;

    text-shadow:
        0 0 10px rgba(0,229,255,.8);
}

#auth-login-modal,
#auth-register-modal,
#auth-verify-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(7px);
}

#auth-content {
    position: relative;
    width: 420px;
    padding: 32px;
    border: 1px solid rgba(0, 255, 238, 0.7);
    background: rgba(8, 12, 30, 0.98);
    box-shadow: 0 0 30px rgba(0, 255, 238, 0.25);
}

#auth-content input,
#auth-content select,
#auth-content button {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
}

#auth-login-close-btn,
#auth-register-close-btn {

    position: absolute;

    top: 10px;
    right: 12px;

    max-width: 34px;
    height: 34px;

    cursor: pointer;

    border:
        1px solid rgba(255, 79, 216, 0.8);

    background:
        rgba(255, 79, 216, 0.12);

    color:
        #ff4fd8;

    font-size: 24px;

    line-height: 28px;

    text-shadow:
        0 0 10px rgba(255, 79, 216, 0.9);

    box-shadow:
        0 0 12px rgba(255, 79, 216, 0.4);
}

#auth-login-close-btn:hover,
#auth-register-close-btn:hover {

    background:
        rgba(255, 79, 216, 0.3);

    color:
        white;
}

#login-submit-btn {

    border-color:
        var(--cyan);

    color:
        var(--cyan);
}

#register-submit-btn {

    border-color:
        var(--green);

    color:
        var(--green);
}

#logout-btn {

    display: inline-flex;

    justify-content: center;

    width: auto;

    min-width: 110px;

    padding: 8px 16px;

    margin: 0;

    border: 1px solid rgba(
        255,
        80,
        80,
        .6
    );

    background: rgba(
        40,
        0,
        0,
        .7
    );

    color:
        #ff8080;

    font-size:
        .8rem;

    letter-spacing:
        1px;

    box-shadow:
        0 0 12px rgba(
            255,
            80,
            80,
            .15
        );
}

#logout-btn:hover {

    box-shadow:
        0 0 15px rgba(
            255,
            80,
            80,
            .4
        );

    transform:
        translateY(-1px);
}

#username-error,
#email-error,
#verification-error,
#auth-login-message {
    min-height: 20px;
    margin-top: 6px;
    margin-bottom: 0;

    color: #ff6060;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

#register-country {
    width: 100%;
    margin-top: 12px;
    padding: 12px;

    border: 1px solid rgba(0, 229, 255, 0.45);
    background: rgba(5, 10, 20, 0.95);
    color: var(--text);
}

.account-name {

    color: var(--cyan);

    font-weight: bold;

    letter-spacing: 2px;

    margin-bottom: 4px;
}

.account-stat {

    color: rgba(
        215,
        225,
        255,
        .85
    );

    font-size: .9rem;
}

#history-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(7px);
}

#history-content {
    position: relative;

    width: 560px;
    max-height: 70vh;
    overflow-y: auto;

    padding: 32px;

    border: 1px solid rgba(0, 255, 238, 0.7);
    background: rgba(8, 12, 30, 0.98);

    box-shadow:
        0 0 30px rgba(0, 255, 238, 0.25);
}

#history-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;

    width: 34px;
    height: 34px;
}

.history-entry {
    padding: 12px;
    margin-bottom: 10px;

    border: 1px solid rgba(0, 229, 255, 0.25);
    background: rgba(10, 15, 25, 0.85);

    color: rgba(215, 225, 255, 0.9);
}

#leaderboard-panel {
    position: absolute;
    top: 24px;
    right: 24px;

    display: flex;
    flex-direction: column;
    gap: 10px;
}

#leaderboard-ai-btn,
#leaderboard-pvp-btn {
    width: auto;
    min-width: 190px;

    border-color: var(--green);
    color: var(--green);
    background: rgba(0, 255, 159, 0.08);
}

#leaderboard-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(7px);
}

#leaderboard-content {
    position: relative;

    width: 680px;
    max-height: 75vh;
    overflow-y: auto;

    padding: 32px;

    border: 1px solid rgba(0, 255, 159, 0.7);
    background: rgba(8, 12, 30, 0.98);

    box-shadow:
        0 0 30px rgba(0, 255, 159, 0.25);
}

#leaderboard-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;

    width: 34px;
    height: 34px;
}

#leaderboard-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.leaderboard-tab {
    width: auto;
    padding: 10px 18px;
}

.leaderboard-tab.active {
    border-color: var(--green);
    color: var(--green);
    box-shadow: 0 0 14px rgba(0, 255, 159, 0.35);
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 70px 1fr 90px 130px;
    gap: 12px;

    padding: 12px;
    margin-bottom: 10px;

    border: 1px solid rgba(0, 229, 255, 0.25);
    background: rgba(10, 15, 25, 0.86);

    color: rgba(215, 225, 255, 0.9);
}

.leaderboard-rank {
    color: var(--green);
    font-weight: bold;
}

.leaderboard-name {
    display: flex;

    align-items: center;

    gap: 8px;

    color: var(--cyan);

    font-weight: bold;
}

.country-flag {
    width: 32px;
    height: 24px;

    flex:
        0 0 auto;

    object-fit: contain;
}

@media (max-width: 920px) {

    .country-flag {
        width: 25px;
        height: 19px;
    }
}

.leaderboard-rating {
    color: var(--green);
}

#landing-logo-img {
    width: clamp(220px, 65vw, 1200px);
    height: auto;
}

@media (max-width: 920px) {
    #account-panel,
    #leaderboard-panel {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 10px;
    }
}

#profile-modal {
    position: fixed;
    inset: 0;

    z-index: 9999;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(7px);
}

#profile-content {
    position: relative;

    width: 620px;
    max-width: 92vw;

    padding: 30px;

    border: 1px solid rgba(0, 255, 238, 0.7);

    background: rgba(8, 12, 30, 0.98);

    box-shadow:
        0 0 30px rgba(0, 255, 238, 0.25);

    text-align: center;
}

#profile-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;

    width: 34px;
    height: 34px;
}

#profile-identity {
    margin-bottom: 22px;

    color: var(--text);

    line-height: 1.8;
}

#profile-rank-card {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    gap: 14px;
}

#profile-rank-img {
    max-width: 160px;
    height: auto;

    filter:
        drop-shadow(0 0 14px rgba(0, 229, 255, 0.5));
}

#profile-rank-name {
    margin-top: 10px;

    color: var(--green);

    font-size: 1.3rem;
    font-weight: bold;
}

#profile-rank-rating,
#profile-rank-record {
    margin-top: 8px;

    color: rgba(215, 225, 255, 0.85);
}

#profile-rank-prev-btn,
#profile-rank-next-btn {
    height: 48px;
}

/* Profile Card - Smaller Screens */
@media (max-width: 920px) {
    #profile-rank-card {
        grid-template-columns: 1fr;
    }

    #profile-rank-prev-btn,
    #profile-rank-next-btn {
        width: 100%;
    }
}

/* Leaderboards - Smaller Screens */
@media (max-width: 920px) {

    .leaderboard-entry {
        grid-template-columns:
            52px
            minmax(0, 1fr)
            72px
            105px;

        gap: 8px;

        padding: 10px;
    }

    #leaderboard-tabs {
        justify-content: center;

        flex-wrap: wrap;

        display: grid;

        grid-template-columns:
            1fr 1fr;

        gap: 7px;

        margin-bottom: 12px;
    }

    #leaderboard-modal {
        align-items: flex-start;

        padding:
            12px 0;
    }

    #leaderboard-content {
        width: 96vw;

        max-height:
            calc(
                100svh - 24px
            );

        padding:
            48px 12px
            16px;
    }

    #leaderboard-content h1 {
        margin-top: 0;

        text-align: center;

        font-size: 1.35rem;

        letter-spacing: 2px;
    }

    .leaderboard-tab {
        width: 100%;

        padding:
            9px 6px;

        font-size: 0.72rem;
    }

    .leaderboard-entry {
        grid-template-columns:
            42px
            minmax(0, 1fr)
            auto;

        grid-template-areas:
            "rank name rating"
            "rank record record";

        align-items: center;

        gap:
            4px 8px;

        padding:
            10px 8px;
    }

    .leaderboard-rank {
        grid-area: rank;

        align-self: stretch;

        display: flex;

        align-items: center;
    }

    .leaderboard-name {
        grid-area: name;

        min-width: 0;

        overflow: hidden;

        text-overflow: ellipsis;

        white-space: nowrap;
    }

    .leaderboard-rating {
        grid-area: rating;

        text-align: right;
    }

    .leaderboard-record {
        grid-area: record;

        font-size: 0.75rem;

        opacity: 0.82;
    }
}

/* Country Editor for Profile Card */
#profile-country-row {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 10px;
}

#profile-country-change-btn {
    width: auto;
    min-width: 0;

    flex:
        0 0 auto;

    display:
        inline-flex;

    align-items: center;
    justify-content: center;

    padding:
        4px 9px;
}

#profile-country-editor {
    width: auto;

    max-width: 100%;

    align-self: center;

    margin:
        10px auto 0;

    display: flex;

    justify-content: center;
    align-items: center;

    flex-wrap: wrap;

    gap: 8px;
}

#profile-country-select {
    width: auto;

    min-width: 210px;

    flex:
        0 0 auto;
}

#profile-country-save-btn,
#profile-country-cancel-btn {
    width: auto;

    min-width: 0;

    flex:
        0 0 auto;

    display:
        inline-flex;

    align-items: center;
    justify-content: center;
}

#profile-country {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 6px;
}

.profile-country-flag {
    width: 32px;
    height: 24px;

    flex:
        0 0 auto;

    object-fit: contain;

}

.profile-country-flag.hidden {
    display: none;
}

@media (max-width: 920px) {

    #profile-country-editor {
        width: 100%;

        flex-direction: row;

        justify-content: center;
    }

    #profile-country-select {
        width:
            min(
                100%,
                260px
            );

        min-width: 0;

        flex-basis: 100%;
    }

    #profile-country-save-btn,
    #profile-country-cancel-btn {
        width: auto;
    }
}