:root {
    --bg-start: #1b2a4d;
    --bg-mid: #0f172a;
    --bg-end: #000000;
}

html,
body {
    position: fixed;
    inset: 0;
    min-height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    scrollbar-width: none;
    background: linear-gradient(180deg, #000000 0%, #0b1220 45%, #111826 100%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.hidden {
    display: none !important;
}

.status-bar-fill {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top);
    min-height: 20px;
    background: #000;
    z-index: 999;
}

.login-button {
    background: #9146ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 16px;
    cursor: pointer;
    min-width: 180px;
}

.logout-button {
    background: #ff4646;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
}

.logout-button:hover {
    background: #e83b3b;
}

.app-container {
    position: sticky;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.network-logo {
    display: block;
    width: clamp(120px, 40vw, 180px);
    max-width: 280px;
    margin: 20px auto 10px;
    position: relative;
    z-index: 10;
}

::-webkit-scrollbar {
    display: none;
}

.card {
    position: relative;
    width: clamp(330px, 85vw, 420px);
    aspect-ratio: 1.7 / 1;
    min-height: 220px;
    margin: 20px clamp(18px, 4vw, 35px) 0;
    background: transparent;
    color: #000;
}

.flip-card-container {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 1200px;
    transform-style: preserve-3d;
    transition: transform 0.8s;
}

.front,
.back {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    border-radius: 22px;
    backface-visibility: hidden;
    transition: transform 0.6s ease;
}

.front {
    background-color: #000;
    color: #000;
}

.back {
    background-color: #c0c0c0;
    color: #fff;
    transform: rotateY(180deg);
    justify-content: center;
}

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

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 22px;
}

.white-square {
    width: 130px;
    height: 130px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding: 5px;
}

.qr-code {
    width: 120px;
    height: 120px;
    margin-bottom: 2px;
}

.member-id,
.member-id-Text {
    margin: 3px;
    font-weight: bold;
    color: #000;
    text-align: center;
}

.member-id {
    font-size: 20px;
}

.member-id-Text {
    font-size: 15px;
}

.mobile-only {
    display: flow-root;
}

.desktop-only {
    display: none;
}

.resource-links {
    margin: 5px 20px 0;
    color: #fff;
    text-align: center;
}

.resource-links p {
    margin: 1px 0 10px;
    color: #fff;
    text-align: left;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    justify-items: center;
    align-items: end;
    align-content: end;
    justify-content: center;
}

.link-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 70px;
    height: 70px;
    border-radius: 14px;
    background: #f3f3f3;
    color: #333;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.twitch-icon,
.x-icon,
.youtube-icon,
.marshmallow-icon,
.fandom-icon {
    background-repeat: no-repeat;
    background-position: center;
}

.twitch-icon {
    background: #9146FF url('/image/twitch.png') center / 60px 60px no-repeat;
}

.x-icon {
    background: #000 url('/image/x.png') center / 60px 60px no-repeat;
}

.youtube-icon {
    background: #fff url('/image/youtube.png') center / 60px 60px no-repeat;
}

.marshmallow-icon {
    background: #F3969A url('/image/marshmallow.png') center / 80px 80px no-repeat;
}

.fandom-icon {
    background: #FCF0DD url('/image/fandom.png') center / 70px 70px no-repeat;
}

.card-bg {
    background: #FCF0DD url('/image/fandom.png') center / 70px 70px no-repeat;
}

@media (min-width: 501px) {
    .mobile-only {
        display: none;
    }

    .desktop-only {
        display: block;
        text-align: center;
        margin-top: 100px;
        color: white;
    }

    .desktop-only h1 {
        font-size: 3em;
    }

    .desktop-only p {
        font-size: 1.5em;
    }
}

.bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #000000 0%, #0b1220 45%, #111826 100%);
}

.login-layer {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px;
    text-align: center;
    color: #fff;
}

.membership-card {
    position: absolute;
    right: clamp(15px, 4vw, 30px);
    bottom: 10px;
    color: #000;
    font-size: 16px;
    font-weight: 700;
}

.user-info {
    position: absolute;
    left: clamp(15px, 4vw, 30px);
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-info .username,
.user-info .red-element {
    position: static;
}

.user-info .username {
    color: #000;
    font-size: 16px;
    font-weight: 700;
}

.user-info .red-element {
    width: 41px;
    height: 16.5px;
    box-shadow: 1px 2px 2px black;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 36px;
    color: #fff;
    padding-right: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
}

.user-info .mod {
    background: #4eeb4e;
}

.user-info .vip {
    background: #F500BF;
}

.user-info .T1 {
    background: #7584F1;
}

.user-info .T2 {
    background: #f1a375;
}

.user-info .T3 {
    background: #56d4d4;
}