/* Mobile Toon Demo — 1920×1080 基准 · UI/ 素材 */

.mtd-page {
    --mtd-gold: #ffd84a;
    --mtd-gold-dim: rgba(255, 214, 90, 0.45);
    --mtd-navy: #1a3050;
    --mtd-blue: #4a7ab8;
    --mtd-blue-dark: #2d5088;
    --mtd-panel: rgba(8, 16, 28, 0.88);
    --mtd-font: 'ZCOOL KuaiLe', 'Microsoft YaHei', sans-serif;
    --mtd-design-w: 1920;
    --mtd-design-h: 1080;
    --mtd-safe-t: max(4px, env(safe-area-inset-top, 0px));
    --mtd-safe-b: max(4px, env(safe-area-inset-bottom, 0px));
    --mtd-safe-l: max(8px, env(safe-area-inset-left, 0px));
    --mtd-safe-r: max(8px, env(safe-area-inset-right, 0px));

    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    inset: 0;
    font-family: var(--mtd-font);
    color: #fff;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ---- 背景 ---- */
.mtd-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: #3a7898;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* ---- 资源加载遮罩（登录 / 选角） ---- */
.mtd-page-boot {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    background: radial-gradient(ellipse 80% 70% at 50% 40%, #1a3050 0%, #0a1218 100%);
    color: rgba(255, 255, 255, 0.88);
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.mtd-page-boot__spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid rgba(255, 216, 74, 0.22);
    border-top-color: #ffd84a;
    animation: mtdBootSpin 0.85s linear infinite;
}

.mtd-page-boot__text {
    font-size: 14px;
    letter-spacing: 0.08em;
    opacity: 0.85;
}

@keyframes mtdBootSpin {
    to { transform: rotate(360deg); }
}

.mtd-page-booting .mtd-shell,
.mtd-page-booting .mtd-bg,
.mtd-login-booting .mtd-shell,
.mtd-login-booting .mtd-bg {
    opacity: 0;
    visibility: hidden;
}

.mtd-page-ready .mtd-page-boot,
body:not(.mtd-page-booting):not(.mtd-login-booting) .mtd-page-boot.mtd-page-boot--done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

html.mtd-preload-embed.mtd-page-booting .mtd-shell,
html.mtd-preload-embed.mtd-page-booting .mtd-bg {
    opacity: 0 !important;
    visibility: hidden !important;
}

.mtd-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(5, 10, 18, 0.28) 0%, rgba(5, 10, 18, 0.48) 100%),
        radial-gradient(ellipse 90% 80% at 50% 40%, rgba(8, 14, 22, 0.05) 0%, rgba(8, 14, 22, 0.38) 100%);
    pointer-events: none;
}

.mtd-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-width: 1920px;
    max-height: 1080px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: var(--mtd-safe-t) var(--mtd-safe-r) var(--mtd-safe-b) var(--mtd-safe-l);
    overflow: hidden;
    box-sizing: border-box;
}

/* ---- 图片按钮通用 ---- */
.mtd-art-btn {
    position: relative;
    overflow: hidden;
    border: none;
    padding: 0;
    cursor: pointer;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.mtd-art-btn:active {
    transform: scale(0.97);
}

.mtd-art-btn::after {
    content: '';
    position: absolute;
    inset: 8% 0;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.4) 50%, transparent 62%);
    transform: translateX(-130%) skewX(-12deg);
    animation: mtdShine 3.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes mtdShine {
    0%, 72% { transform: translateX(-130%) skewX(-12deg); opacity: 0; }
    78% { opacity: 1; }
    100% { transform: translateX(130%) skewX(-12deg); opacity: 0; }
}

.mtd-img-btn {
    border: none;
    padding: 0;
    cursor: pointer;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.mtd-img-btn:active {
    transform: scale(0.94);
}

/* ---- Login ---- */
.mtd-login-ui {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.mtd-title-wrap {
    position: absolute;
    left: 50%;
    top: clamp(26%, 30vh, 34%);
    transform: translate(-50%, -50%) scale(1);
    z-index: 1;
    pointer-events: none;
    transition:
        left 0.75s cubic-bezier(0.34, 1.45, 0.64, 1),
        top 0.75s cubic-bezier(0.34, 1.45, 0.64, 1),
        transform 0.75s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.mtd-login-ui.form-open .mtd-title-wrap {
    left: clamp(8px, 2.5vw, 40px);
    top: 44%;
    transform: translate(0, -50%) scale(0.68);
    z-index: 5;
}

.mtd-title-wrap .mtd-title {
    animation: mtdTitleIdle 4.8s ease-in-out infinite;
    transform-origin: center center;
}

.mtd-login-ui.form-open .mtd-title-wrap .mtd-title {
    animation: mtdTitleIdleSmall 4.8s ease-in-out infinite;
}

@keyframes mtdTitleIdle {
    0%, 100% { transform: rotate(-1.4deg) translateY(0); }
    50% { transform: rotate(1.4deg) translateY(-8px); }
}

@keyframes mtdTitleIdleSmall {
    0%, 100% { transform: rotate(-1deg) translateY(0); }
    50% { transform: rotate(1deg) translateY(-5px); }
}

.mtd-title {
    width: clamp(260px, 36vw, 680px);
    aspect-ratio: 560 / 371;
    background: var(--mtd-icon-big-title, url('/UI/icons/icon_big_title.png')) center / contain no-repeat;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
}

.mtd-login-bottom {
    position: absolute;
    left: 50%;
    bottom: clamp(10%, 14vh, 18%);
    transform: translateX(-50%);
    width: clamp(280px, 34vw, 600px);
    z-index: 4;
}

.mtd-login-actions {
    width: min(100%, calc(clamp(52px, 12vh, 130px) * 460 / 122));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2.2vh, 28px);
}

.mtd-login-btn-slot {
    position: relative;
    width: 100%;
    aspect-ratio: 460 / 122;
    max-height: clamp(52px, 12vh, 130px);
}

.mtd-login-btn-slot .mtd-art-btn-login {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: unset;
}

.mtd-login-submit {
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

.mtd-login-ui.form-open .mtd-login-submit {
    opacity: 1;
    pointer-events: auto;
}

.mtd-login-ui.form-open #loginBtn {
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.mtd-form-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + clamp(6px, 1vh, 10px));
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(180deg, #ffffff 0%, #f2f5fa 100%);
    border: 6px solid #05070a;
    border-radius: 22px;
    padding: 0 18px;
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    box-shadow:
        inset 0 3px 0 rgba(255, 255, 255, 0.95),
        inset 0 -2px 0 rgba(5, 7, 10, 0.06),
        6px 8px 0 #05070a;
    transform: translateY(10px) scale(0.96);
    transform-origin: bottom center;
    transition:
        grid-template-rows 0.45s cubic-bezier(0.22, 0.85, 0.28, 1),
        opacity 0.35s ease,
        padding 0.45s ease,
        transform 0.45s cubic-bezier(0.34, 1.35, 0.64, 1);
    z-index: 3;
}

.mtd-form-panel-inner {
    min-height: 0;
    overflow: hidden;
}

.mtd-login-ui.form-open .mtd-form-panel {
    grid-template-rows: 1fr;
    opacity: 1;
    padding: 14px 18px 12px;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

@media (max-height: 480px) {
    .mtd-login-ui.form-open .mtd-form-panel {
        padding: 10px 14px 10px;
    }

    .mtd-form-panel label {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .mtd-form-panel input {
        padding: 8px 10px;
        margin-bottom: 8px;
        font-size: 15px;
    }

    .mtd-form-back {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .mtd-login-ui.form-open .mtd-title-wrap {
        top: 38%;
        transform: translate(0, -50%) scale(0.58);
    }
}

.mtd-art-btn-login {
    width: 100%;
    aspect-ratio: 460 / 122;
    max-height: clamp(52px, 12vh, 130px);
    background-image: var(--mtd-login, url('/UI/buttons/english/butt_login.png'));
}

.mtd-art-btn-guest {
    width: 100%;
    aspect-ratio: 461 / 124;
    max-height: clamp(52px, 12vh, 130px);
    background-image: var(--mtd-guest, url('/UI/buttons/english/GUEST_button.png'));
}

.mtd-art-btn-guest.is-disabled,
.mtd-art-btn-guest:disabled {
    filter: grayscale(1) brightness(0.52);
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

.mtd-art-btn-guest.is-disabled::after,
.mtd-art-btn-guest:disabled::after {
    animation: none;
    opacity: 0;
}

.mtd-art-btn-login:disabled {
    pointer-events: none;
}

.mtd-art-btn-guest::after {
    animation-delay: 1.4s;
}

/* 登录页两枚按钮：扫光范围略小于按钮 PNG（避免超出透明边距） */
.mtd-login-actions .mtd-art-btn::after {
    inset: 10% 5%;
    border-radius: 999px;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.38) 50%, transparent 60%);
}

.mtd-form-panel label {
    display: block;
    color: #1a3050;
    font-size: clamp(16px, 1.35vw, 22px);
    margin-bottom: 6px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.85);
}

.mtd-form-panel input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    margin-bottom: 12px;
    font-family: var(--mtd-font);
    font-size: clamp(16px, 1.4vw, 22px);
    border: 3px solid #05070a;
    border-radius: 14px;
    background: #f8fafc;
    color: #1a3050;
    outline: none;
    user-select: text;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        2px 3px 0 #05070a;
}

.mtd-form-panel input:focus {
    background: #fff;
    border-color: #05070a;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.95),
        2px 3px 0 #05070a,
        0 0 0 3px rgba(255, 216, 74, 0.45);
}

.mtd-form-back {
    border: none;
    background: none;
    color: #1a3050;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
    font-family: var(--mtd-font);
    font-size: clamp(14px, 1.2vw, 18px);
    margin-bottom: 10px;
    cursor: pointer;
    padding: 0;
}

/* ---- Character 顶栏 / HUD ---- */
.mtd-topbar {
    flex-shrink: 0;
    height: clamp(48px, 8.5vh, 88px);
    display: flex;
    align-items: center;
    gap: clamp(6px, 0.8vw, 12px);
}

.mtd-page--character {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mtd-page--character .mtd-shell {
    position: relative;
    flex-direction: column;
    padding-top: 0;
    /* 设计稿 16:9 — 任意窗口尺寸下保持比例，仅 scale-to-fit */
    width: min(100vw, calc(100vh * 16 / 9), 1920px);
    height: min(100vh, calc(100vw * 9 / 16), 1080px);
    max-width: 1920px;
    max-height: 1080px;
    flex: none;
    margin: 0;
    container-type: size;
    container-name: mtd-shell;
}

@keyframes mtdTitleIdleCorner {
    0%, 100% { transform: rotate(-2.8deg) translateY(0); }
    50% { transform: rotate(2.8deg) translateY(-8px); }
}

.mtd-title-corner {
    position: absolute;
    top: var(--mtd-safe-t);
    left: clamp(52px, 6.5vw, 108px);
    z-index: 30;
    width: clamp(200px, 24vw, 420px);
    height: clamp(56px, 9.5vh, 104px);
    background: var(--mtd-icon-big-title, url('/UI/icons/icon_big_title.png')) left center / contain no-repeat;
    pointer-events: none;
    animation: mtdTitleIdleCorner 3s ease-in-out infinite;
    transform-origin: center center;
}

.mtd-hud-leftcol {
    position: absolute;
    left: var(--mtd-safe-l);
    top: 0;
    bottom: var(--mtd-safe-b);
    width: clamp(56px, 6.5vw, 104px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(10px, 1.4vh, 20px);
    padding-top: calc(var(--mtd-safe-t) + clamp(52px, 8.5vh, 96px));
    pointer-events: none;
}

.mtd-hud-leftcol > * {
    pointer-events: auto;
    flex-shrink: 0;
}

.mtd-hud-leftcol .mtd-avatar-btn {
    margin-top: auto;
}

.mtd-back-btn {
    width: clamp(40px, 4.2vw, 72px);
    height: clamp(40px, 4.2vw, 72px);
    background-image: var(--mtd-back, url('/UI/buttons/common/back_round.png'));
}

.mtd-title-sm {
    width: clamp(88px, 9vw, 160px);
    height: clamp(36px, 5.5vh, 60px);
    background: var(--mtd-icon-small-title, url('/UI/icons/icon_small_title.png')) center / contain no-repeat;
    flex-shrink: 0;
}

.mtd-rank-btn {
    width: clamp(72px, 8vw, 140px);
    height: clamp(36px, 5vh, 56px);
    background-image: var(--mtd-rank, url('/UI/buttons/english/butt_rank.png'));
}

.mtd-chips {
    flex: 0 1 auto;
    display: flex;
    gap: clamp(4px, 0.5vw, 8px);
    overflow: hidden;
    min-width: 0;
}

.mtd-chip {
    padding: clamp(4px, 0.5vh, 8px) clamp(8px, 0.8vw, 14px);
    border-radius: 999px;
    border: 2px solid var(--mtd-navy);
    background: var(--mtd-panel);
    font-size: clamp(14px, 1.25vw, 24px);
    white-space: nowrap;
    flex-shrink: 0;
}

.mtd-chip strong {
    color: var(--mtd-gold);
    font-weight: 400;
}

.mtd-topbar-actions {
    display: flex;
    gap: clamp(4px, 0.5vw, 8px);
    flex-shrink: 0;
    margin-left: auto;
}

.mtd-shop-btn {
    width: clamp(40px, 4.2vw, 72px);
    height: clamp(40px, 4.2vw, 72px);
    background-image: var(--mtd-shop-round, url('/UI/buttons/common/shop_round.png'));
}

.mtd-help-btn {
    width: clamp(40px, 4.2vw, 72px);
    height: clamp(40px, 4.2vw, 72px);
    background-image: var(--mtd-help-round, url('/UI/buttons/common/help_round.png'));
}

.mtd-settings-btn {
    width: clamp(40px, 4.2vw, 72px);
    height: clamp(40px, 4.2vw, 72px);
    background-image: var(--mtd-settings, url('/UI/buttons/common/setting_round.png'));
    background-size: contain;
}

.mtd-avatar-btn {
    width: clamp(40px, 4.2vw, 72px);
    height: clamp(40px, 4.2vw, 72px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 3px solid var(--mtd-gold);
    background-color: #0a0a0a;
    background-image: var(--mtd-avatar, url('/assets/ponies/hero_idle_007_transparent_cropped.png'));
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* ---- 主内容：board_left / board_right 双背板 ---- */
.mtd-main {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: clamp(2px, 0.5vh, 8px);
    padding: 0 clamp(6px, 0.8vw, 16px);
}

.mtd-board-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1780px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: clamp(8px, 1vw, 16px);
    box-sizing: border-box;
}

.mtd-board-left,
.mtd-board-right {
    position: relative;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mtd-board-panel-bg {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 0;
}

.mtd-board-left .mtd-board-panel-bg {
    background-image: var(--mtd-board-left, url('/UI/board_left.png'));
}

.mtd-board-right .mtd-board-panel-bg {
    background-image: var(--mtd-board-right, url('/UI/board_right.png'));
}

/* Character 选角：双 board 等高底对齐 · 右移 · 右留 10% */
.mtd-page--character .mtd-main {
    flex: 1;
    min-width: 0;
    width: 100%;
    align-items: flex-end;
    justify-content: flex-end;
    margin-top: 0;
    padding: var(--mtd-safe-t) 10% var(--mtd-safe-b) clamp(8px, 1vw, 20px);
    box-sizing: border-box;
}

.mtd-page--character .mtd-board-wrap {
    height: 95%;
    max-height: 95%;
    align-items: stretch;
    margin-left: clamp(48px, 6vw, 96px);
    --mtd-board-right-slot: clamp(180px, 16vw, 290px);
}

.mtd-page--character .mtd-board-left,
.mtd-page--character .mtd-board-right {
    height: 100%;
    align-self: stretch;
}

.mtd-page--character .mtd-board-left {
    flex: 0 1 calc((100% - var(--mtd-board-right-slot) - clamp(8px, 1vw, 16px)) * 0.8);
    min-width: 0;
    max-width: calc((100% - var(--mtd-board-right-slot) - clamp(8px, 1vw, 16px)) * 0.8);
}

.mtd-page--character .mtd-board-left .mtd-board-panel-bg {
    background-size: 100% 100%;
}

.mtd-page--character .mtd-board-right {
    flex: 0 0 auto;
    width: auto;
    aspect-ratio: 527 / 890;
    min-width: var(--mtd-board-right-slot);
    max-width: min(34vw, 380px);
}

.mtd-page--character .mtd-board-right .mtd-board-panel-bg {
    background-size: auto 100%;
    background-position: center center;
}

.mtd-page--character .mtd-hud-leftcol .mtd-back-btn,
.mtd-page--character .mtd-hud-leftcol .mtd-shop-btn,
.mtd-page--character .mtd-hud-leftcol .mtd-help-btn,
.mtd-page--character .mtd-hud-leftcol .mtd-settings-btn,
.mtd-page--character .mtd-hud-leftcol .mtd-avatar-btn {
    width: clamp(52px, 5.8vw, 96px);
    height: clamp(52px, 5.8vw, 96px);
}

.mtd-page--character .mtd-hud-leftcol .mtd-avatar-btn {
    border: 4px solid var(--mtd-gold);
    background-color: #0a0a0a;
}

.mtd-board-inner {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.mtd-board-left .mtd-board-inner {
    padding: 12% 5.5% 4.5% 5.5%;
}

.mtd-board-right .mtd-board-inner {
    padding: 10.5% 7.5% 5.5% 7.5%;
}

.mtd-panel-title {
    flex-shrink: 0;
    text-align: center;
    font-size: clamp(16px, 1.65vw, 30px);
    font-weight: 400;
    letter-spacing: 0.1em;
    margin: 0 0 clamp(6px, 1vh, 12px);
    padding: 0;
    line-height: 1.1;
}

.mtd-panel-title--slot {
    color: #fff;
    text-shadow: 0 2px 0 #9a2020, 0 0 6px rgba(180, 40, 40, 0.5);
    margin-top: clamp(-18px, -2.2vh, -8px);
}

.mtd-panel-title--preview {
    color: #fff;
    text-shadow: 0 2px 0 #1a4580, 0 0 6px rgba(40, 100, 180, 0.45);
    margin-top: clamp(-14px, -1.8vh, -6px);
}

/* ---- 拉霸左区 ---- */
.mtd-slot-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 0.6vh, 8px);
}

.mtd-reels {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(4px, 0.6vw, 10px);
    padding: 2px 0;
}

.mtd-reel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(2px, 0.4vh, 6px);
}

.mtd-reel-label {
    flex-shrink: 0;
    height: clamp(22px, 3.5vh, 40px);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    text-indent: -9999px;
    overflow: hidden;
}

.mtd-reel[data-key="horse"] .mtd-reel-label {
    background-image: var(--mtd-hoof, url('/UI/buttons/common/hoof.png'));
}

.mtd-reel[data-key="rider"] .mtd-reel-label {
    background-image: var(--mtd-silk, url('/UI/buttons/common/silk.png'));
}

.mtd-reel[data-key="track"] .mtd-reel-label {
    background-image: var(--mtd-map, url('/UI/buttons/common/map.png'));
}

.mtd-reel.is-disabled .mtd-reel-window {
    filter: grayscale(1) brightness(0.58);
    opacity: 0.72;
    cursor: not-allowed;
    pointer-events: none;
}

.mtd-reel.is-disabled .mtd-reel-item .mtd-reel-thumb {
    filter: grayscale(1) brightness(0.62);
}

.mtd-column-icons .mtd-reel-label.is-disabled {
    filter: grayscale(1) brightness(0.55);
    opacity: 0.65;
}

.mtd-reel-window {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    border: 2px solid #c9a227;
    border-radius: clamp(6px, 0.55vw, 10px);
    background: rgba(0, 0, 0, 0.82);
    touch-action: none;
    cursor: grab;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}

.mtd-reel-window:active {
    cursor: grabbing;
}

.mtd-reel-window::before,
.mtd-reel-window::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 28%;
    z-index: 2;
    pointer-events: none;
}

.mtd-reel-window::before {
    top: 0;
    background: linear-gradient(180deg, rgba(8, 16, 28, 0.92) 0%, transparent 100%);
}

.mtd-reel-window::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(8, 16, 28, 0.92) 0%, transparent 100%);
}

.mtd-reel-strip {
    will-change: transform;
    display: flex;
    flex-direction: column;
    gap: clamp(3px, 0.4vh, 6px);
    padding: 0 clamp(3px, 0.3vw, 6px);
    box-sizing: border-box;
}

.mtd-reel-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    position: relative;
    border: 2px solid var(--mtd-navy);
    border-radius: clamp(6px, 0.5vw, 10px);
    background: rgba(255, 255, 255, 0.07);
    box-sizing: border-box;
}

.mtd-reel-item.locked {
    opacity: 0.5;
}

.mtd-reel-item.locked .mtd-reel-thumb {
    filter: grayscale(1) brightness(0.62);
}

.mtd-reel-icon {
    font-size: clamp(18px, 2.2vw, 32px);
    line-height: 1;
}

.mtd-reel-name {
    font-size: clamp(9px, 0.85vw, 14px);
    color: rgba(255, 255, 255, 0.9);
    max-width: 92%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.mtd-reel-tag {
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: clamp(7px, 0.6vw, 10px);
    padding: 0 4px;
    border-radius: 4px;
    background: var(--mtd-blue-dark);
    border: 1px solid var(--mtd-navy);
    line-height: 1.3;
}

.mtd-reel-highlight {
    position: absolute;
    left: 5px;
    right: 5px;
    top: 50%;
    aspect-ratio: 1 / 1;
    height: auto;
    transform: translateY(-50%);
    border: 2px solid var(--mtd-gold);
    border-radius: clamp(6px, 0.5vw, 10px);
    box-shadow:
        0 0 12px rgba(255, 216, 74, 0.4),
        inset 0 0 8px rgba(255, 216, 74, 0.12);
    pointer-events: none;
    z-index: 3;
}

.mtd-random-wrap {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding-top: clamp(2px, 0.5vh, 6px);
}

.mtd-art-btn-random {
    width: clamp(200px, 28vw, 560px);
    aspect-ratio: 460 / 122;
    max-height: clamp(44px, 7vh, 88px);
    background-image: var(--mtd-random, url('/UI/buttons/english/butt_random.png'));
}

/* ---- 预览右区 ---- */
.mtd-preview {
    flex: 1;
    min-height: clamp(72px, 16vh, 180px);
    border-radius: clamp(8px, 0.7vw, 12px);
    border: none;
    background: rgba(0, 0, 0, 0.12);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(48px, 6vw, 96px);
    margin-bottom: clamp(4px, 0.8vh, 10px);
}

.mtd-preview.night {
    background: linear-gradient(180deg, #0a1020 0%, rgba(8, 16, 28, 0.85) 100%);
}

.mtd-blackboard {
    flex-shrink: 0;
    position: relative;
    width: 100%;
    min-height: clamp(72px, 12vh, 150px);
    background: var(--mtd-blackboard, url('/UI/blackboard.png')) center / 100% 100% no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(2px, 0.4vh, 6px);
    padding: clamp(10px, 1.5vh, 20px) clamp(14px, 1.5vw, 24px);
    box-sizing: border-box;
    margin-bottom: clamp(4px, 0.8vh, 10px);
}

.mtd-blackboard-row {
    display: flex;
    align-items: baseline;
    gap: clamp(10px, 1.2vw, 18px);
    font-size: clamp(14px, 1.35vw, 28px);
    color: rgba(255, 255, 255, 0.72);
}

.mtd-blackboard-row span {
    flex: 0 0 auto;
    min-width: clamp(56px, 6vw, 84px);
    color: var(--mtd-gold);
}

.mtd-blackboard-row strong {
    flex: 1 1 auto;
    min-width: 0;
    color: #fff;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 地图名称较长，允许换行完整显示 */
.mtd-blackboard-row:last-child {
    align-items: flex-start;
}

.mtd-blackboard-row:last-child span {
    padding-top: 0.08em;
}

.mtd-blackboard-row:last-child strong {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.3;
}

.mtd-start-wrap {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.mtd-art-btn-start {
    width: clamp(180px, 26vw, 520px);
    aspect-ratio: 460 / 122;
    max-height: clamp(44px, 7vh, 88px);
    background-image: var(--mtd-start, url('/UI/buttons/english/butt_start.png'));
}

/* Character 右板：预览区 + 黑板区 · 整体缩一圈 */
.mtd-page--character .mtd-board-right .mtd-board-inner {
    padding: 11% 10% 5% 10%;
    --mtd-action-width: calc(100% - clamp(12px, 1.8vw, 24px));
}

.mtd-page--character .mtd-right-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 0.9vh, 12px);
    margin-bottom: clamp(4px, 0.6vh, 8px);
}

.mtd-page--character .mtd-preview {
    flex: 0 0 38%;
    min-height: clamp(48px, 9vh, 110px);
    max-height: 42%;
    align-self: center;
    width: calc(100% - clamp(16px, 2.4vw, 32px));
    margin: 0 auto;
    border-radius: clamp(8px, 0.75vw, 12px);
    font-size: clamp(32px, 4.2vw, 64px);
}

.mtd-page--character .mtd-blackboard {
    flex: 1 1 38%;
    min-height: clamp(96px, 17vh, 200px);
    padding: clamp(14px, 2vh, 24px) clamp(14px, 1.6vw, 24px);
    margin-bottom: 0;
}

.mtd-page--character .mtd-blackboard--pager {
    align-self: center;
    width: var(--mtd-action-width, calc(100% - clamp(12px, 1.8vw, 24px)));
    max-width: 100%;
    display: block;
    padding: 0;
    margin-bottom: 0;
    overflow: visible;
}

.mtd-blackboard-pager-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: inherit;
    box-sizing: border-box;
    padding: clamp(10px, 1.5vh, 16px) clamp(2px, 0.3vw, 4px);
    column-gap: clamp(2px, 0.35vw, 5px);
}

.mtd-blackboard--pager > .mtd-blackboard-viewport,
.mtd-blackboard-pager-inner > .mtd-blackboard-viewport {
    grid-column: 2;
    min-width: 0;
}

.mtd-blackboard-viewport {
    position: relative;
    min-height: clamp(68px, 11vh, 120px);
    width: 100%;
    box-sizing: border-box;
    padding: 0 clamp(2px, 0.35vw, 4px);
}

.mtd-blackboard-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(2px, 0.4vh, 6px);
    animation: mtdBlackboardPageIn 0.2s ease-out;
}

.mtd-blackboard-page[hidden] {
    display: none !important;
}

@keyframes mtdBlackboardPageIn {
    from { opacity: 0; transform: translateX(6px); }
    to { opacity: 1; transform: translateX(0); }
}

.mtd-blackboard-arrow {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: clamp(28px, 3vw, 40px);
    height: clamp(36px, 4.5vh, 52px);
    border: none;
    background: transparent;
    color: rgba(255, 244, 210, 0.92);
    font: 900 clamp(36px, 4.2vw, 52px)/1 "Comic Sans MS", "Segoe UI", sans-serif;
    cursor: pointer;
    padding: 0;
    margin: 0;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.5),
        0 0 8px rgba(255, 220, 120, 0.18);
    opacity: 0.95;
    -webkit-text-stroke: 0.8px rgba(0, 0, 0, 0.3);
    align-self: center;
    justify-self: center;
}

.mtd-blackboard-arrow--prev { grid-column: 1; }
.mtd-blackboard-arrow--next { grid-column: 3; }

.mtd-blackboard-arrow:hover {
    color: #ffe8a8;
    opacity: 1;
}

.mtd-blackboard-arrow:active {
    transform: scale(0.94);
    color: #fff;
}

.mtd-blackboard--pager .mtd-blackboard-row {
    display: grid;
    grid-template-columns: minmax(3.2em, 34%) minmax(0, 1fr);
    align-items: start;
    column-gap: clamp(8px, 1vw, 14px);
    row-gap: 0;
    font-size: clamp(12px, 1.05vw, 18px);
    line-height: 1.25;
}

.mtd-blackboard--pager .mtd-blackboard-row span {
    min-width: 0;
    flex: none;
    padding-top: 0.04em;
}

.mtd-blackboard--pager .mtd-blackboard-row strong {
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.25;
    padding-right: 0;
}

.mtd-blackboard-page--build {
    width: 100%;
    align-items: stretch;
    justify-content: center;
    gap: clamp(2px, 0.4vh, 6px);
}

.mtd-blackboard-page--build .mtd-shop-stat-panel--chalk {
    gap: clamp(2px, 0.4vh, 6px);
    width: 100%;
}

.mtd-blackboard-page--build .mtd-shop-stat-row--chalk {
    display: grid;
    grid-template-columns: 40% minmax(0, 1fr) clamp(1.4em, 8%, 2.4em);
    align-items: center;
    column-gap: clamp(8px, 1vw, 14px);
    width: 100%;
    font-size: clamp(14px, 1.35vw, 26px);
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.72);
}

.mtd-blackboard-page--build .mtd-shop-stat-label {
    grid-column: 1;
    color: var(--mtd-gold);
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: normal;
    line-height: inherit;
    white-space: nowrap;
    justify-self: start;
    align-self: center;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
    padding-top: 0.04em;
}

.mtd-blackboard-page--build .mtd-shop-stat-val {
    grid-column: 3;
    color: #fff;
    font-size: inherit;
    font-weight: 400;
    text-align: right;
    line-height: inherit;
    white-space: nowrap;
    justify-self: end;
}

.mtd-blackboard-page--build .mtd-shop-stat-track {
    position: relative;
    grid-column: 2;
    width: 100%;
    min-width: 0;
    height: clamp(12px, 1.35vh, 16px);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.11);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
    justify-self: stretch;
    align-self: center;
}

.mtd-blackboard-page--build .mtd-shop-stat-fill {
    display: block;
    height: 100%;
    width: 0;
    min-width: 0;
    border-radius: 3px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, transparent 42%),
        linear-gradient(180deg, rgba(255, 252, 228, 0.98) 0%, rgba(255, 214, 108, 0.92) 100%);
    box-shadow:
        0 0 6px rgba(255, 220, 120, 0.28),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12);
    transition: width 0.24s cubic-bezier(0.22, 0.85, 0.28, 1);
}

.mtd-shop-stat-panel.is-updating .mtd-blackboard-page--build .mtd-shop-stat-fill,
.mtd-blackboard-page--build .mtd-shop-stat-panel.is-updating .mtd-shop-stat-fill {
    filter: brightness(1.08);
}

.mtd-blackboard-page--build .mtd-shop-stat-panel[data-rarity="rare"] .mtd-shop-stat-fill {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, transparent 42%),
        linear-gradient(180deg, rgba(220, 238, 255, 0.98) 0%, rgba(120, 178, 255, 0.92) 100%);
}

.mtd-blackboard-page--build .mtd-shop-stat-panel[data-rarity="epic"] .mtd-shop-stat-fill {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, transparent 42%),
        linear-gradient(180deg, rgba(244, 220, 255, 0.98) 0%, rgba(190, 120, 255, 0.92) 100%);
}

.mtd-blackboard-page--build .mtd-shop-stat-panel[data-rarity="legendary"] .mtd-shop-stat-fill {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 42%),
        linear-gradient(180deg, rgba(255, 248, 196, 0.98) 0%, rgba(255, 204, 64, 0.94) 100%);
}

.mtd-blackboard-page--build .mtd-shop-stat-row.is-peak-row .mtd-shop-stat-label::after {
    content: ' ★';
    color: rgba(255, 232, 160, 0.95);
}

.mtd-blackboard--pager[data-blackboard-page="build"] .mtd-blackboard-arrow {
    color: rgba(255, 248, 220, 0.98);
}

.mtd-page--character .mtd-blackboard-row {
    font-size: clamp(14px, 1.35vw, 26px);
    line-height: 1.4;
}

.mtd-page--character .mtd-start-wrap {
    padding: 0 clamp(4px, 0.6vw, 8px);
}

.mtd-page--character .mtd-art-btn-start {
    width: var(--mtd-action-width, calc(100% - clamp(12px, 1.8vw, 24px)));
    max-width: 100%;
}

/* ---- 登录 BGM 开关 ---- */
.mtd-bgm-toggle {
    position: fixed;
    top: calc(var(--mtd-safe-t) + clamp(6px, 1vh, 12px));
    right: calc(var(--mtd-safe-r) + clamp(6px, 1vw, 12px));
    z-index: 20;
    width: clamp(42px, 4.8vw, 58px);
    height: clamp(42px, 4.8vw, 58px);
    padding: 0;
    border: 3px solid var(--mtd-gold);
    border-radius: 50%;
    background: linear-gradient(180deg, var(--mtd-blue) 0%, var(--mtd-blue-dark) 55%, #1e3a62 100%);
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.38),
        inset 0 2px 0 rgba(255, 255, 255, 0.22);
    color: var(--mtd-gold);
    font-family: var(--mtd-font);
    font-size: clamp(20px, 2.2vw, 28px);
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
    transition: transform 0.15s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.mtd-bgm-toggle:active {
    transform: scale(0.92);
}

.mtd-bgm-toggle .mtd-bgm-icon-off {
    display: none;
    position: relative;
}

.mtd-bgm-toggle.is-muted .mtd-bgm-icon-on {
    display: none;
}

.mtd-bgm-toggle.is-muted .mtd-bgm-icon-off {
    display: block;
    opacity: 0.55;
}

.mtd-bgm-toggle.is-muted .mtd-bgm-icon-off::after {
    content: '';
    position: absolute;
    left: -18%;
    right: -18%;
    top: 50%;
    height: 3px;
    border-radius: 2px;
    background: #ff6b6b;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
    transform: rotate(-38deg);
}

.mtd-bgm-toggle.is-muted {
    opacity: 0.82;
    border-color: rgba(255, 216, 74, 0.42);
}

/* ---- 底部提示 ---- */
.mtd-hint {
    position: fixed;
    bottom: var(--mtd-safe-b);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--mtd-gold-dim);
    font-size: clamp(10px, 0.9vw, 14px);
    color: rgba(255, 255, 255, 0.55);
    pointer-events: none;
    white-space: nowrap;
}

/* ---- 弹窗 ---- */
.mtd-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: var(--mtd-safe-t) var(--mtd-safe-r) var(--mtd-safe-b) var(--mtd-safe-l);
}

.mtd-modal.open {
    display: flex;
}

.mtd-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.mtd-modal-box {
    position: relative;
    z-index: 1;
    width: min(92vw, 520px);
    max-height: calc(100% - 16px);
    background: var(--mtd-panel);
    border: 3px solid var(--mtd-navy);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.mtd-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 2px solid rgba(255, 214, 90, 0.2);
    flex-shrink: 0;
}

.mtd-modal-head h2 {
    font-size: clamp(15px, 1.4vw, 20px);
    color: var(--mtd-gold);
    font-weight: 400;
}

.mtd-modal-close {
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.mtd-modal-body {
    padding: 10px 12px 12px;
    overflow: hidden;
    font-size: clamp(12px, 1.1vw, 16px);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
}

/* ---- 玩家资料（Toon 浅色） ---- */
.mtd-modal-box--profile {
    width: min(92vw, 440px);
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.mtd-profile-close {
    position: absolute;
    top: clamp(-10px, -1.2vh, -6px);
    right: clamp(-10px, -1.2vw, -6px);
    left: auto;
    z-index: 2;
    width: clamp(32px, 4vw, 40px);
    height: clamp(32px, 4vw, 40px);
    border: 4px solid #05070a;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff 0%, #f2f5fa 100%);
    color: #1a3050;
    font-size: clamp(20px, 2.2vw, 26px);
    line-height: 1;
    cursor: pointer;
    box-shadow: 3px 4px 0 #05070a;
    padding: 0;
}

.mtd-profile-close:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 2px 0 #05070a;
}

.mtd-profile-panel,
.mtd-toon-panel {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #f2f5fa 100%);
    border: 6px solid #05070a;
    border-radius: 22px;
    padding: clamp(14px, 2vh, 20px) clamp(16px, 2vw, 22px) clamp(16px, 2.2vh, 22px);
    box-shadow:
        inset 0 3px 0 rgba(255, 255, 255, 0.95),
        inset 0 -2px 0 rgba(5, 7, 10, 0.06),
        6px 8px 0 #05070a;
    animation: mtdProfileIn 0.35s cubic-bezier(0.34, 1.35, 0.64, 1) forwards;
}

.mtd-modal-box--profile:has(.mtd-toon-panel--shop) {
    width: auto;
    max-width: min(96vw, 860px);
}

.mtd-modal-box--profile:has(.mtd-toon-panel--help),
.mtd-modal-box--profile:has(.mtd-toon-panel--settings) {
    width: auto;
    max-width: min(96vw, 784px);
}

.mtd-toon-panel--shop {
    width: min(78vw, 640px);
    zoom: 1.22;
}

.mtd-toon-panel--help,
.mtd-toon-panel--settings {
    width: min(48vw, 560px);
    zoom: 1.4;
}

.mtd-modal-box--profile:has(.mtd-profile-panel) {
    width: auto;
    max-width: min(96vw, 616px);
}

.mtd-profile-panel {
    width: min(92vw, 440px);
    zoom: 1.4;
}

.mtd-toon-header {
    margin-bottom: clamp(10px, 1.2vh, 12px);
    padding-bottom: clamp(8px, 1vh, 10px);
    padding-right: clamp(28px, 3vw, 36px);
    border-bottom: 3px solid #05070a;
}

.mtd-toon-header h3 {
    margin: 0;
    font-size: clamp(15px, 1.5vw, 20px);
    font-weight: 800;
    color: #c89600;
    text-shadow:
        2px 2px 0 #05070a,
        -1px -1px 0 rgba(255, 255, 255, 0.6);
}

.mtd-toon-sub {
    margin: 6px 0 0;
    font-size: clamp(12px, 1.05vw, 15px);
    font-weight: 700;
    color: #1a3050;
}

.mtd-toon-sub strong {
    color: #c89600;
    font-size: clamp(16px, 1.4vw, 20px);
}

.mtd-toon-scroll {
    max-height: min(58vh, 420px);
    overflow-y: auto;
    padding-right: 4px;
    margin-top: clamp(8px, 1vh, 10px);
}

.mtd-toon-scroll::-webkit-scrollbar {
    width: 8px;
}

.mtd-toon-scroll::-webkit-scrollbar-thumb {
    background: rgba(5, 7, 10, 0.25);
    border-radius: 999px;
}

.mtd-toon-empty {
    margin: 0;
    padding: 12px 8px;
    text-align: center;
    color: #1a3050;
    font-weight: 700;
}

.mtd-toon-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--mtd-safe-b, 12px) + 12px);
    z-index: 120;
    transform: translate(-50%, 16px);
    opacity: 0;
    pointer-events: none;
    padding: 10px 18px;
    border-radius: 999px;
    border: 4px solid #05070a;
    background: linear-gradient(180deg, #fff9e6 0%, #ffe9a8 100%);
    color: #1a3050;
    font-weight: 800;
    font-size: clamp(12px, 1.1vw, 15px);
    box-shadow: 4px 5px 0 #05070a;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mtd-toon-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---- 横向卡片滑动 ---- */
.mtd-hcarousel-wrap {
    margin-top: clamp(8px, 1vh, 10px);
}

.mtd-hcarousel {
    display: flex;
    gap: clamp(10px, 1.4vw, 14px);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 4px clamp(4px, 0.6vw, 8px) 10px;
    scrollbar-width: none;
}

.mtd-hcarousel::-webkit-scrollbar {
    display: none;
}

.mtd-hcarousel-card {
    flex: 0 0 min(88%, 420px);
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.mtd-hcarousel--shop .mtd-hcarousel-card {
    flex: 0 0 min(88%, 440px);
}

.mtd-hcarousel-wrap--shop {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1vh, 10px);
}

.mtd-shop-stat-dock {
    flex: 0 0 auto;
    padding: clamp(10px, 1.2vh, 12px);
    border-radius: 16px;
    border: 4px solid #05070a;
    background: linear-gradient(180deg, #f4f8ff 0%, #e8eef8 100%);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), 3px 4px 0 #05070a;
}

.mtd-shop-stat-dock-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px dashed rgba(5, 7, 10, 0.14);
}

.mtd-shop-stat-dock-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: clamp(13px, 1.2vw, 16px);
    font-weight: 800;
    color: #1a3050;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mtd-shop-stat-dock-hint {
    flex: 0 0 auto;
    font-size: clamp(10px, 0.9vw, 12px);
    font-weight: 700;
    color: #6a7a90;
    white-space: nowrap;
}

.mtd-hcarousel-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: clamp(8px, 1vh, 10px);
}

.mtd-hcarousel-nav--pager {
    margin-top: clamp(10px, 1.2vh, 12px);
}

.mtd-hcarousel-btn {
    border: 3px solid #05070a;
    border-radius: 999px;
    padding: 6px 12px;
    background: linear-gradient(180deg, #fff 0%, #eef2f8 100%);
    color: #1a3050;
    font: inherit;
    font-size: clamp(11px, 1vw, 13px);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 2px 3px 0 #05070a;
}

.mtd-hcarousel-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.mtd-hcarousel-btn:active:not(:disabled) {
    transform: translate(1px, 1px);
    box-shadow: 1px 2px 0 #05070a;
}

.mtd-hcarousel-counter {
    font-size: clamp(12px, 1.05vw, 14px);
    font-weight: 800;
    color: #1a3050;
    min-width: 4.5em;
    text-align: center;
}

/* ---- 商城滑动卡片 ---- */
.mtd-shop-slide {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    justify-content: space-between;
    min-height: clamp(168px, 24vh, 210px);
    padding: clamp(12px, 1.5vh, 16px) clamp(14px, 1.8vw, 18px);
    border-radius: 18px;
    background: linear-gradient(180deg, #fffef8 0%, #fff8ea 100%);
    border: 4px solid #05070a;
    box-shadow: 4px 5px 0 #05070a;
    gap: clamp(8px, 1vh, 10px);
}

.mtd-shop-slide.is-owned {
    background: linear-gradient(180deg, #f8fff8 0%, #eef8ee 100%);
}

.mtd-shop-slide[data-rarity="rare"] {
    border-color: #1565c0;
    box-shadow: 4px 5px 0 #1565c0;
}

.mtd-shop-slide[data-rarity="epic"] {
    border-color: #7b1fa2;
    box-shadow: 4px 5px 0 #7b1fa2;
}

.mtd-shop-slide[data-rarity="legendary"] {
    border-color: #c89600;
    box-shadow: 4px 5px 0 #c89600;
}

.mtd-shop-slide[data-rarity="rare"] .mtd-shop-slide-rarity { color: #1565c0; }
.mtd-shop-slide[data-rarity="epic"] .mtd-shop-slide-rarity { color: #7b1fa2; }
.mtd-shop-slide[data-rarity="legendary"] .mtd-shop-slide-rarity { color: #c89600; }

.mtd-shop-slide-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.2vh, 12px);
}

.mtd-shop-slide-hero {
    display: flex;
    align-items: flex-start;
    gap: clamp(12px, 1.4vw, 16px);
}

.mtd-shop-slide-meta {
    flex: 1;
    min-width: 0;
}

.mtd-shop-slide-icon {
    flex: 0 0 auto;
    width: clamp(72px, 8vw, 92px);
    height: clamp(72px, 8vw, 92px);
    display: grid;
    place-items: center;
    font-size: clamp(34px, 3.6vw, 42px);
    border-radius: 16px;
    border: 4px solid #05070a;
    background: linear-gradient(180deg, #fff9e6 0%, #fff3cc 100%);
    box-shadow: 3px 4px 0 #05070a;
}

.mtd-shop-slide-icon--img {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    font-size: 0;
}

.mtd-shop-slide-name {
    margin: 0 0 4px;
    font-size: clamp(17px, 1.7vw, 22px);
    font-weight: 800;
    color: #1a3050;
    line-height: 1.2;
}

.mtd-shop-slide-rarity {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 2px solid #05070a;
    background: #fff;
    font-size: clamp(10px, 0.95vw, 12px);
    font-weight: 800;
    color: #666;
}

.mtd-shop-slide-desc {
    margin: 0;
    font-size: clamp(11px, 1vw, 13px);
    font-weight: 700;
    color: #4a6078;
    line-height: 1.45;
}

.mtd-shop-stat-panel {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mtd-shop-stat-panel.is-updating .mtd-shop-stat-cell.is-on {
    animation: mtdShopStatPulse 0.22s ease-out;
}

@keyframes mtdShopStatPulse {
    0% { transform: scaleY(0.72); opacity: 0.55; }
    100% { transform: scaleY(1); opacity: 1; }
}

.mtd-shop-stat-row {
    display: grid;
    grid-template-columns: 2.4em 1fr 2.2em;
    align-items: center;
    gap: 6px;
}

.mtd-shop-stat-row.is-weak-row .mtd-shop-stat-label {
    color: #9a3050;
}

.mtd-shop-stat-row.is-peak-row .mtd-shop-stat-label::after {
    content: ' ★';
    color: #c89600;
    font-size: 0.85em;
}

.mtd-shop-stat-label {
    font-size: clamp(11px, 1vw, 13px);
    font-weight: 800;
    color: #1a3050;
    letter-spacing: 0.02em;
}

.mtd-shop-stat-cells {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 3px;
    min-height: 12px;
}

.mtd-shop-stat-cell {
    display: block;
    height: clamp(11px, 1.3vh, 13px);
    border-radius: 3px;
    border: 2px solid #05070a;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.mtd-shop-stat-cell.is-on {
    background: linear-gradient(180deg, #7ec8ff 0%, #3d8fd9 100%);
    box-shadow: inset 0 -1px 0 rgba(5, 7, 10, 0.15);
}

.mtd-shop-stat-panel[data-rarity="rare"] .mtd-shop-stat-cell.is-on {
    background: linear-gradient(180deg, #8ecbff 0%, #1565c0 100%);
}

.mtd-shop-stat-panel[data-rarity="epic"] .mtd-shop-stat-cell.is-on {
    background: linear-gradient(180deg, #d9a8ff 0%, #7b1fa2 100%);
}

.mtd-shop-stat-panel[data-rarity="legendary"] .mtd-shop-stat-cell.is-on {
    background: linear-gradient(180deg, #ffe27a 0%, #c89600 100%);
}

.mtd-shop-stat-cell.is-weak.is-on {
    background: linear-gradient(180deg, #ffc8d0 0%, #d06078 100%);
}

.mtd-shop-stat-row.is-peak-row .mtd-shop-stat-cell.is-on {
    background: linear-gradient(180deg, #ffe082 0%, #ff9800 100%);
}

.mtd-shop-stat-val {
    font-size: clamp(11px, 1vw, 13px);
    font-weight: 800;
    color: #1a3050;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* 商城 Build 预览 — 粉笔条（与选角黑板同款布局） */
.mtd-shop-stat-dock .mtd-shop-stat-panel--chalk {
    --mtd-shop-label-w: clamp(5em, 36%, 6.4em);
    --mtd-shop-val-w: 1.9em;
    gap: clamp(4px, 0.55vh, 6px);
}

.mtd-shop-stat-dock .mtd-shop-stat-row--chalk {
    display: grid;
    grid-template-columns: var(--mtd-shop-label-w) minmax(0, 1fr) var(--mtd-shop-val-w);
    align-items: center;
    column-gap: clamp(5px, 0.6vw, 8px);
}

.mtd-shop-stat-dock .mtd-shop-stat-row--chalk .mtd-shop-stat-label {
    font-size: clamp(11px, 1vw, 13px);
    font-weight: 800;
    color: #1a3050;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.mtd-shop-stat-dock .mtd-shop-stat-row--chalk .mtd-shop-stat-val {
    justify-self: end;
    white-space: nowrap;
}

.mtd-shop-stat-dock .mtd-shop-stat-track {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: clamp(10px, 1.15vh, 12px);
    border-radius: 4px;
    background: rgba(5, 7, 10, 0.06);
    border: 2px solid rgba(5, 7, 10, 0.12);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(5, 7, 10, 0.08);
}

.mtd-shop-stat-dock .mtd-shop-stat-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 2px;
    background: linear-gradient(180deg, #7ec8ff 0%, #3d8fd9 100%);
    box-shadow: inset 0 -1px 0 rgba(5, 7, 10, 0.12);
    transition: width 0.24s cubic-bezier(0.22, 0.85, 0.28, 1);
}

.mtd-shop-stat-dock .mtd-shop-stat-panel.is-updating .mtd-shop-stat-fill {
    filter: brightness(1.06);
}

.mtd-shop-stat-dock .mtd-shop-stat-panel[data-rarity="rare"] .mtd-shop-stat-fill {
    background: linear-gradient(180deg, #8ecbff 0%, #1565c0 100%);
}

.mtd-shop-stat-dock .mtd-shop-stat-panel[data-rarity="epic"] .mtd-shop-stat-fill {
    background: linear-gradient(180deg, #d9a8ff 0%, #7b1fa2 100%);
}

.mtd-shop-stat-dock .mtd-shop-stat-panel[data-rarity="legendary"] .mtd-shop-stat-fill {
    background: linear-gradient(180deg, #ffe27a 0%, #c89600 100%);
}

.mtd-shop-stat-dock .mtd-shop-stat-panel--delta .mtd-shop-stat-row.is-delta-pos .mtd-shop-stat-fill {
    background: linear-gradient(180deg, #b8f0c0 0%, #3dab5a 100%);
}

.mtd-shop-stat-dock .mtd-shop-stat-panel--delta .mtd-shop-stat-row.is-delta-neg .mtd-shop-stat-fill {
    background: linear-gradient(180deg, #ffc8c8 0%, #d95050 100%);
}

.mtd-shop-stat-dock .mtd-shop-stat-panel--delta .mtd-shop-stat-row.is-delta-zero .mtd-shop-stat-fill {
    background: rgba(5, 7, 10, 0.1);
}

.mtd-shop-stat-dock .mtd-shop-stat-panel--delta .mtd-shop-stat-row.is-delta-pos .mtd-shop-stat-val {
    color: #2e7d32;
}

.mtd-shop-stat-dock .mtd-shop-stat-panel--delta .mtd-shop-stat-row.is-delta-neg .mtd-shop-stat-val {
    color: #c62828;
}

.mtd-shop-stat-dock .mtd-shop-stat-panel--delta .mtd-shop-stat-row.is-delta-zero .mtd-shop-stat-val {
    color: #6a7a90;
}

.mtd-shop-stat-dock .mtd-shop-stat-row.is-peak-row .mtd-shop-stat-label::after {
    content: ' ★';
    color: #c89600;
    font-size: 0.85em;
}

.mtd-shop-stat-dock .mtd-shop-stat-row.is-peak-row .mtd-shop-stat-fill {
    background: linear-gradient(180deg, #ffe082 0%, #ff9800 100%);
}

.mtd-shop-slide-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 6px;
    border-top: 2px dashed rgba(5, 7, 10, 0.12);
}

.mtd-shop-slide-price {
    font-size: clamp(14px, 1.3vw, 17px);
    font-weight: 800;
    color: #c89600;
    margin-bottom: 0;
}

.mtd-shop-slide-price.is-owned-label {
    color: #2e7d32;
}

.mtd-shop-buy-btn {
    margin-left: auto;
    border: 3px solid #05070a;
    border-radius: 999px;
    padding: 8px 18px;
    background: linear-gradient(180deg, #ffe566 0%, #ffc933 100%);
    color: #1a3050;
    font: inherit;
    font-size: clamp(12px, 1.05vw, 14px);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 2px 3px 0 #05070a;
    white-space: nowrap;
}

.mtd-shop-buy-btn:active:not(:disabled) {
    transform: translate(1px, 1px);
    box-shadow: 1px 2px 0 #05070a;
}

.mtd-shop-buy-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: linear-gradient(180deg, #eee 0%, #ddd 100%);
}

/* ---- 说明 Tab ---- */
.mtd-help-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: clamp(8px, 1vh, 10px);
}

.mtd-help-tab {
    flex: 1;
    border: 3px solid #05070a;
    border-radius: 999px;
    padding: 10px 14px;
    background: #fff;
    color: #1a3050;
    font: inherit;
    font-size: clamp(16px, 1.5vw, 22px);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 2px 3px 0 #05070a;
}

.mtd-help-tab.is-active {
    background: linear-gradient(180deg, #ffe082 0%, #ffc107 100%);
}

.mtd-help-item-icon {
    display: grid;
    place-items: center;
    border-radius: 14px;
    border: 3px solid #05070a;
    background: linear-gradient(180deg, #f8fbff 0%, #e8eef7 100%);
    box-shadow: 2px 3px 0 #05070a;
}

.mtd-help-item-name {
    font-weight: 800;
    color: #1a3050;
}

.mtd-help-item-desc {
    color: #334155;
}

/* ---- 说明分页 / 道具滑动 ---- */
.mtd-help-pane[hidden] {
    display: none !important;
}

.mtd-help-page-view {
    min-height: clamp(180px, 28vh, 240px);
    padding: clamp(12px, 1.6vh, 16px);
    border-radius: 18px;
    background: #fff;
    border: 4px solid #05070a;
    box-shadow: 3px 4px 0 #05070a;
}

.mtd-help-page-title {
    margin: 0 0 clamp(10px, 1.2vh, 12px);
    font-size: clamp(18px, 1.8vw, 24px);
    font-weight: 800;
    color: #c89600;
    text-shadow:
        2px 2px 0 #05070a,
        -1px -1px 0 rgba(255, 255, 255, 0.55);
}

.mtd-help-page-text {
    font-size: clamp(14px, 1.35vw, 18px);
    line-height: 1.65;
    color: #1a3050;
    font-weight: 700;
}

.mtd-help-intro {
    margin: 0 0 10px;
    font-size: clamp(13px, 1.15vw, 16px);
    line-height: 1.55;
    color: #1a3050;
    font-weight: 700;
}

.mtd-help-item-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: clamp(210px, 32vh, 260px);
    padding: clamp(14px, 2vh, 18px) clamp(12px, 1.6vw, 16px);
    border-radius: 18px;
    background: #fff;
    border: 4px solid #05070a;
    box-shadow: 4px 5px 0 #05070a;
}

.mtd-help-item-slide .mtd-help-item-icon {
    width: clamp(52px, 6vw, 64px);
    height: clamp(52px, 6vw, 64px);
    margin: 0 0 10px;
    font-size: clamp(28px, 3vw, 34px);
}

.mtd-help-item-slide .mtd-help-item-name {
    margin: 0 0 8px;
    font-size: clamp(16px, 1.5vw, 20px);
}

.mtd-help-item-slide .mtd-help-item-desc {
    margin: 0;
    font-size: clamp(13px, 1.2vw, 16px);
    line-height: 1.55;
    text-align: center;
}

/* ---- 设置 TOON ---- */
.mtd-settings-body {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.2vh, 12px);
}

.mtd-setting-block {
    padding: clamp(10px, 1.2vh, 12px);
    border-radius: 16px;
    background: #fff;
    border: 4px solid #05070a;
    box-shadow: 3px 4px 0 #05070a;
}

.mtd-setting-block--note {
    background: linear-gradient(180deg, #fff9e6 0%, #fff3cc 100%);
}

.mtd-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.mtd-setting-label {
    font-size: clamp(14px, 1.25vw, 17px);
    font-weight: 800;
    color: #1a3050;
}

.mtd-toggle-pair {
    display: flex;
    gap: 6px;
}

.mtd-toggle-btn,
.mtd-sfx-toggle {
    min-width: 52px;
    padding: 6px 14px;
    border: 3px solid #05070a;
    border-radius: 999px;
    background: #fff;
    color: #1a3050;
    font: inherit;
    font-size: clamp(11px, 1vw, 13px);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 2px 3px 0 #05070a;
}

.mtd-toggle-btn.is-active,
.mtd-sfx-toggle.is-active {
    background: linear-gradient(180deg, #ffe082 0%, #ffc107 100%);
}

.mtd-setting-slider {
    display: block;
}

.mtd-setting-slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: clamp(12px, 1.05vw, 14px);
    font-weight: 700;
    color: #334155;
}

.mtd-setting-slider-label strong {
    color: #c89600;
    font-size: clamp(13px, 1.15vw, 16px);
}

.mtd-setting-slider input[type="range"] {
    width: 100%;
    accent-color: #c89600;
}

.mtd-setting-note {
    margin: 6px 0 0;
    font-size: clamp(12px, 1.05vw, 14px);
    line-height: 1.5;
    color: #334155;
    font-weight: 600;
}

@keyframes mtdProfileIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.mtd-profile-header {
    margin-bottom: clamp(10px, 1.4vh, 14px);
    padding-bottom: clamp(8px, 1vh, 10px);
    border-bottom: 3px solid #05070a;
}

.mtd-profile-header h3 {
    margin: 0;
    font-size: clamp(15px, 1.5vw, 20px);
    font-weight: 800;
    color: #c89600;
    text-shadow:
        2px 2px 0 #05070a,
        -1px -1px 0 rgba(255, 255, 255, 0.6);
}

.mtd-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(10px, 1.4vh, 14px) clamp(12px, 1.6vw, 16px);
}

.mtd-profile-stat {
    text-align: center;
    padding: clamp(8px, 1vh, 10px) clamp(6px, 0.8vw, 8px);
    border-radius: 16px;
    background: #fff;
    border: 4px solid #05070a;
    box-shadow: 3px 4px 0 #05070a;
}

.mtd-profile-value {
    font-size: clamp(24px, 3.2vw, 34px);
    font-weight: 800;
    color: #c89600;
    line-height: 1.1;
    text-shadow:
        2px 2px 0 #05070a,
        0 0 8px rgba(255, 216, 74, 0.35);
}

.mtd-profile-label {
    margin-top: 4px;
    font-size: clamp(11px, 1vw, 14px);
    font-weight: 700;
    color: #1a3050;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.85);
}

.mtd-profile-best {
    margin-top: clamp(10px, 1.4vh, 14px);
    padding: clamp(10px, 1.4vh, 14px) clamp(8px, 1vw, 10px);
    border-radius: 18px;
    text-align: center;
    background: linear-gradient(180deg, #fff9e6 0%, #fff3cc 100%);
    border: 4px solid #05070a;
    box-shadow: 3px 4px 0 #05070a;
}

.mtd-profile-value--best {
    font-size: clamp(28px, 3.8vw, 40px);
    letter-spacing: 0.04em;
}

/* Legacy compact grid (settings 等深色弹窗仍可用 mtd-help-section) */
.mtd-shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.mtd-shop-item {
    border: 2px solid var(--mtd-navy);
    border-radius: 10px;
    padding: 6px 4px;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    font-size: clamp(10px, 0.9vw, 13px);
}

.mtd-shop-item .icon {
    font-size: 20px;
    display: block;
    margin-bottom: 2px;
}

.mtd-shop-item .price {
    color: var(--mtd-gold);
    margin-top: 4px;
}

.mtd-help-section {
    margin-bottom: 10px;
}

.mtd-help-section strong {
    display: block;
    color: var(--mtd-gold);
    margin-bottom: 4px;
    font-weight: 400;
}

.mtd-sfx-toggle-wrap {
    display: flex;
    gap: 8px;
}

.mtd-sfx-toggle {
    min-width: 52px;
    padding: 6px 14px;
    border: 2px solid rgba(255, 220, 120, 0.45);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--mtd-gold);
    font: inherit;
    cursor: pointer;
}

.mtd-sfx-toggle.is-active {
    background: rgba(255, 220, 120, 0.22);
    border-color: var(--mtd-gold);
    box-shadow: 0 0 0 1px rgba(255, 220, 120, 0.35);
}

/* ---- 竖屏提示 ---- */
.mtd-rotate-hint {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0a1218;
    color: var(--mtd-gold);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    font-size: 16px;
}

@media (orientation: portrait) and (max-width: 600px) {
    .mtd-rotate-hint {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-height: 320px) {
    .mtd-reel-strip {
        gap: 2px;
    }

    .mtd-board-left .mtd-board-inner {
        padding-top: 10%;
    }

    .mtd-board-right .mtd-board-inner {
        padding-top: 9%;
    }
}

/* ---- Login → 选角 Loading 过渡 ---- */
.mtd-load-track {
    --mtd-load-pct: 0;
    position: fixed;
    left: 50%;
    bottom: clamp(8%, 11vh, 15%);
    transform: translateX(-50%);
    width: min(90vw, 760px);
    z-index: 18;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease 0.4s;
}

.mtd-load-track.is-done {
    opacity: 0 !important;
    transition: opacity 0.35s ease;
}

.mtd-login-transitioning .mtd-load-track {
    opacity: 1;
}

.mtd-load-track-inner {
    position: relative;
    padding: 0 clamp(6px, 1vw, 12px);
}

.mtd-load-track-stage {
    position: relative;
    /* ── Loading 栅栏横杆（上/下白横杠）· 改数值即可 ──
     * --mtd-fence-rail-h-top     上横杠高度
     * --mtd-fence-rail-h-bottom  下横杠高度（可不同于上）
     * --mtd-fence-post-gap       横杠与竖杆间距
     * --mtd-fence-h              栅栏区域总高（含竖杆）
     */
    --mtd-fence-rail-h-top: clamp(7px, 1.05vh, 10px);
    --mtd-fence-rail-h-bottom: clamp(7px, 1.65vh, 10px);
    --mtd-fence-post-gap: 6px;
    --mtd-track-h: clamp(40px, 6vh, 66px);
    --mtd-track-shadow: 4px;
    --mtd-fence-h: clamp(20px, 3.2vh, 32px);
    --mtd-lane-top: #7fd048;
    --mtd-lane-bottom: #4fa828;
    --mtd-center-line: #ffffff;
    padding-top: clamp(48px, 8vh, 82px);
}

.mtd-load-track-bed {
    display: none;
}

.mtd-load-track-rail {
    position: relative;
    height: var(--mtd-track-h);
    border-radius: clamp(6px, 0.8vw, 10px);
    border: 4px solid #05070a;
    background: linear-gradient(180deg, var(--mtd-lane-top) 0%, var(--mtd-lane-bottom) 100%);
    box-shadow: 0 var(--mtd-track-shadow) 0 #05070a;
    z-index: 1;
    overflow: hidden;
}

.mtd-load-track-rail::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 22%;
    min-height: clamp(6px, 0.9vh, 10px);
    max-height: 40%;
    transform: translateY(-50%);
    background: var(--mtd-center-line);
    z-index: 2;
    pointer-events: none;
}

/* 赛道底色：草地 / 沙地 / 雪地 / 雨天 / 泥地 */
.mtd-load-track-stage[data-surface="grass"] {
    --mtd-lane-top: #7fd048;
    --mtd-lane-bottom: #4fa828;
    --mtd-center-line: #ffffff;
}

.mtd-load-track-stage[data-surface="sand"] {
    --mtd-lane-top: #f2d070;
    --mtd-lane-bottom: #d4a838;
    --mtd-center-line: #fffef5;
}

.mtd-load-track-stage[data-surface="snow"] {
    --mtd-lane-top: #f4f8fc;
    --mtd-lane-bottom: #c8d8ea;
    --mtd-center-line: #7a9ec0;
}

.mtd-load-track-stage[data-surface="rain"] {
    --mtd-lane-top: #5a9850;
    --mtd-lane-bottom: #3a6838;
    --mtd-center-line: rgba(230, 240, 255, 0.92);
}

.mtd-load-track-stage[data-surface="mud"] {
    --mtd-lane-top: #8aaa48;
    --mtd-lane-bottom: #5a7028;
    --mtd-center-line: rgba(240, 230, 200, 0.88);
}

.mtd-load-track-stage[data-surface="rain"] .mtd-load-track-rail::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: repeating-linear-gradient(
        112deg,
        transparent 0,
        transparent 10px,
        rgba(180, 210, 255, 0.14) 10px,
        rgba(180, 210, 255, 0.14) 11px
    );
    z-index: 3;
}

.mtd-load-pony-lane {
    position: absolute;
    left: clamp(12px, 1.6vw, 20px);
    right: clamp(12px, 1.6vw, 20px);
    bottom: calc(var(--mtd-track-h) * 0.32);
    height: clamp(56px, 9.8vw, 104px);
    z-index: 3;
    pointer-events: none;
}

.mtd-load-pony {
    position: absolute;
    left: calc(var(--mtd-load-pct, 0) * 1%);
    bottom: 0;
    width: clamp(54px, 9.5vw, 102px);
    height: clamp(54px, 9.5vw, 102px);
    transform: translateX(-50%);
    background: center bottom / contain no-repeat;
    filter: drop-shadow(0 3px 0 rgba(5, 7, 10, 0.4));
    animation: mtdLoadPonyWobble 0.24s ease-in-out infinite alternate;
}

/* 栅栏：白横杆 + 黑竖杆（参考图） */
.mtd-load-fence {
    position: absolute;
    left: 0;
    right: 0;
    height: var(--mtd-fence-h);
    pointer-events: none;
}

.mtd-load-fence-rail {
    position: absolute;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 3px solid #05070a;
    border-radius: 2px;
    z-index: 2;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.mtd-load-fence-posts {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    background: repeating-linear-gradient(
        90deg,
        #05070a 0,
        #05070a clamp(3px, 0.42vw, 4px),
        transparent clamp(3px, 0.42vw, 4px),
        transparent clamp(20px, 2.8vw, 28px)
    );
}

/* 上栅栏 — 横杆贴顶，竖杆向下；小马身后 z:2 */
.mtd-load-fence-top {
    bottom: var(--mtd-track-h);
    z-index: 2;
}

.mtd-load-fence-top .mtd-load-fence-rail {
    top: 0;
    height: var(--mtd-fence-rail-h-top);
}

.mtd-load-fence-top .mtd-load-fence-posts {
    top: calc(var(--mtd-fence-rail-h-top) + var(--mtd-fence-post-gap));
    bottom: 0;
}

/* 下栅栏 — 横杆贴竖杆顶，竖杆向下；最前 z:4 */
.mtd-load-fence-bottom {
    bottom: calc(-1 * var(--mtd-track-shadow));
    z-index: 4;
}

.mtd-load-fence-bottom .mtd-load-fence-rail {
    top: 0;
    transform: none;
    height: var(--mtd-fence-rail-h-bottom);
}

.mtd-load-fence-bottom .mtd-load-fence-posts {
    top: calc(var(--mtd-fence-rail-h-bottom) + var(--mtd-fence-post-gap));
    bottom: 0;
}

@keyframes mtdLoadPonyWobble {
    0% {
        transform: translateX(-50%) translateY(0) rotate(-5deg) scaleX(1);
    }
    100% {
        transform: translateX(-50%) translateY(-3px) rotate(5deg) scaleX(0.96);
    }
}

.mtd-login-transitioning .mtd-title-wrap {
    left: 50% !important;
    top: 42% !important;
    transform: translate(-50%, -50%) scale(1.15) !important;
    z-index: 16;
    transition:
        left 0.7s cubic-bezier(0.34, 1.35, 0.64, 1),
        top 0.7s cubic-bezier(0.34, 1.35, 0.64, 1),
        transform 0.7s cubic-bezier(0.34, 1.35, 0.64, 1);
}

.mtd-login-transitioning .mtd-title-wrap .mtd-title {
    animation: none;
}

.mtd-login-transitioning .mtd-login-bottom,
.mtd-login-transitioning .mtd-hint {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.mtd-login-transitioning .mtd-login-bottom {
    transform: translateX(-50%) translateY(24px);
}

.mtd-char-preload {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    z-index: 8;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: #0a1218;
}

.mtd-char-preload.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 14;
    transition: opacity 0.55s ease;
}

.mtd-character-active .mtd-shell {
    visibility: hidden;
}

html.mtd-preload-embed,
html.mtd-preload-embed body {
    background: #0a1218;
}

html.mtd-preload-embed .mtd-rotate-hint,
html.mtd-preload-embed .mtd-hint {
    display: none !important;
}

@media (max-height: 480px) {
    .mtd-login-transitioning .mtd-title-wrap {
        top: 36% !important;
        transform: translate(-50%, -50%) scale(0.92) !important;
    }

    .mtd-load-track {
        bottom: clamp(6%, 8vh, 10%);
    }

    .mtd-load-track-stage {
        padding-top: clamp(34px, 6vh, 58px);
    }

    .mtd-load-pony-lane {
        height: clamp(44px, 8vw, 72px);
        bottom: calc(var(--mtd-track-h) * 0.3);
    }

    .mtd-load-pony {
        width: clamp(44px, 8vw, 72px);
        height: clamp(44px, 8vw, 72px);
    }
}
