@font-face {
    font-family: 'MFJinHei_Noncommercial-Regular';
    src: url('../assets/fonts/MFJinHei_Noncommercial-Regular.otf') format('opentype');
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: radial-gradient(1200px 800px at 50% 15%, rgba(43, 216, 255, .18), transparent 55%),
        radial-gradient(900px 700px at 15% 55%, rgba(86, 120, 255, .22), transparent 52%),
        linear-gradient(180deg, var(--bg2), var(--bg1));
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font: inherit;
}

/* ========= Layout ========= */
.page {
    background: url("../assets/images/back.png") no-repeat;
    background-size: 100% 100%;
}

.stage {}

.stage__bg {}

.stage__top {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
    user-select: none;
}

.card {
    position: relative;
    overflow: hidden;
    z-index: 2;
    /* sit above back/back1 */
}

/* ========= Top ========= */
.top {
    padding: 14px;
    text-align: center;
    margin-top: 40px;
}

.top__hint {
    font-weight: 700;
    letter-spacing: .28em;
    font-size: 12px;
    color: rgba(184, 216, 255, .55);
    margin-bottom: 8px;
}

.top__banner {
    font-size: 19px;
    width: 100%;
    padding: 10px 16px;
    border-radius: 30px;
    background: #FDC637;
    font-weight: 800;
    letter-spacing: 1px;
}

/* ========= Profile ========= */
.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.avatar {
    width: 88px;
    height: 88px;
    background: #000;
    border: 4px solid #1E4009;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar--fallback {
    background:
        linear-gradient(135deg, rgba(43, 216, 255, .22), rgba(74, 255, 198, .10)),
        rgba(0, 0, 0, .35);
}

.player-name {
    font-weight: 500;
    color: #fff;
}

/* ========= Invite Panel ========= */
.invite {
    margin: 0 15px;
    padding: 14px;
    border-radius: 45px;
    background: linear-gradient(180deg, #3EBC17 0%, #214707 100%);
    border: 10px solid #1E4007;
}

.invite__title {
    text-align: center;
    color: rgba(255, 255, 255, .92);
    margin-bottom: 10px;
    font-size: 14px;
}

.rewards {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 0 4px;
}

.reward {
    flex: 1;
    text-align: center;
}

.reward__value {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.reward__num {
    font-size: 34px;
    color: #FDC637;
    font-family: 'MFJinHei_Noncommercial-Regular';
}

.reward__plus {
    font-weight: 900;
    color: #ffe85c;
    opacity: .95;
}

.coin {
    width: 18px;
    height: 18px;
    image-rendering: -webkit-optimize-contrast;
    transform: translateY(2px);
}

.reward__label {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 800;
    margin-right: 22px;
    color: rgba(255, 255, 255, .86);
}

.code-row {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.code {
    font-weight: 900;
    letter-spacing: 1px;
    text-align: center;
    color: #FFDE2F;
}

.btn {
    width: 80px;
    height: 40px;
    border: 0;
    font-weight: 900;
    border-radius: 50px;
    letter-spacing: .15em;
}

.btn:active {
    transform: translateY(1px);
}

.btn--copy {
    background: linear-gradient(180deg, #ffe36d, #ffcc2d);
    color: #242211;
}

.btn--download {
    background: linear-gradient(180deg, #ffe36d, #ffcc2d);
    color: #242211;
}

.btn[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

.validity {
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    color: #fff;
}

/* ========= Brand / Download ========= */
.brand {
    margin: 14px;
    padding: 20px 10px;
    border-radius: 18px;
    background-color: #132905;
    display: flex;
    align-items: center;
    justify-content: space-around;
    max-width: 100vw;
    overflow-x: auto;
    box-sizing: border-box;
}

.brand__bar {
    display: flex;
    gap: 10px;
}

.brand__left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand__logo {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand__logo--fallback {
    background: radial-gradient(circle at 30% 20%, rgba(43, 216, 255, .30), transparent 55%),
        linear-gradient(180deg, rgba(43, 182, 75, .25), rgba(11, 109, 42, .20));
}

.brand__meta {
    min-width: 0;
}

.brand__name {
    font-weight: 500;
    color: rgba(255, 255, 255, .92);
}

.brand__tag {
    font-size: 12px;
    color: #FF6200;
    letter-spacing: .06em;
    margin-top: 5px;
}

/* Brand section right QR code image */
.qr__img {
    max-width: 80px;
    border-radius: 8px;
}

.qr__fallbackText {
    display: none;
    font-weight: 900;
    color: #111;
}

.qr--fallback .qr__fallbackText {
    display: block;
}

.features {
    list-style: none;
    margin: 10px 0 0;
    padding: 0 2px;
    display: flex;
    gap: 12px;
    align-items: center;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.feature {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shield {
    width: 16px;
    height: 16px;
}

.scan-tip {
    margin-top: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* ========= Responsive for Brand/Download Section ========= */
@media (max-width: 379px) {
    .brand {
        flex-direction: column;
    }
}

/* ========= Preview ========= */
.preview {
    margin: 12px 14px 0;
    overflow: hidden;
    border: 8px solid rgba(255, 255, 255, 0.4);
}

.preview__img {
    width: 100%;
    height: auto;
}

.preview__fallback {
    display: none;
    padding: 40px 12px;
    text-align: center;
    font-weight: 900;
    color: rgba(184, 216, 255, .85);
}

.preview--fallback .preview__fallback {
    display: block;
}

/* ========= Footer ========= */
.footer {
    padding: 20px 14px 14px 14px;
    text-align: center;
    color: #fff;
    font-size: 12px;
}

/* ========= Toast ========= */
.toast {
    position: fixed;
    left: 50%;
    bottom: 50%;
    background: rgba(0, 0, 0, .72);
    color: #fff;
    padding: 10px 12px;
    border-radius: 12px;
    opacity: 0;
    text-align: center;
    font-weight: 800;
    z-index: 9999;
}

.toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}