/* ============================================
 * H5 Game — Auth 弹窗 (split-panel + 动态图)
 * ============================================ */

/* === 弹窗容器 === */
.h5game-modal-root {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overscroll-behavior: contain;
}
.h5game-modal-root.is-visible {
    display: flex;
    animation: h5game-fade-in .25s ease-out;
}
@keyframes h5game-fade-in { from { opacity: 0; } to { opacity: 1; } }

.h5game-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 6, 24, .65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* === 弹窗卡片 === */
.h5game-modal-card {
    position: relative;
    width: 100%;
    max-width: 920px;
    min-height: 560px;
    max-height: calc(100vh - 32px);
    background: var(--h5game-bg);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .35);
    animation: h5game-pop-in .35s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes h5game-pop-in {
    from { transform: scale(.94) translateY(20px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

.h5game-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(4px);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .15s, transform .15s;
}
.h5game-modal-close:hover {
    background: rgba(255, 255, 255, .32);
    transform: rotate(90deg);
}

/* === 左半: 图文舞台 === */
.h5game-modal-art {
    position: relative;
    width: 380px;
    flex: 0 0 380px;
    background: linear-gradient(160deg, #C4002C 0%, #E02D2D 35%, #FF6B35 100%);
    background-size: 200% 200%;
    animation: h5game-gradient-shift 12s ease-in-out infinite;
    color: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
@keyframes h5game-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
.h5game-modal-art::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, .35) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 107, 53, .5) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .1) 0%, transparent 60%);
    animation: h5game-gradient-pulse 8s ease-in-out infinite;
}
@keyframes h5game-gradient-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .6; }
}

/* 浮动元素 */
.h5game-modal-art-floater {
    position: absolute;
    font-size: 56px;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .25));
    will-change: transform;
}
.h5game-modal-art-floater--coin {
    top: 16%; left: 50%;
    transform: translate(-50%, 0);
    animation: h5game-float-y 4s ease-in-out infinite;
}
.h5game-modal-art-floater--dice {
    top: 50%; right: 12%;
    transform: translate(0, -50%);
    animation: h5game-float-rotate 6s ease-in-out infinite;
}
.h5game-modal-art-floater--slot {
    bottom: 14%; left: 14%;
    transform: translate(0, 0);
    animation: h5game-float-y 5s ease-in-out infinite;
    animation-delay: -1.5s;
}
.h5game-modal-art-floater--gem {
    top: 22%; right: 14%;
    animation: h5game-float-rotate 7s ease-in-out infinite;
    animation-delay: -0.8s;
}
.h5game-modal-art-floater--cards {
    bottom: 24%; right: 18%;
    animation: h5game-float-y 4.5s ease-in-out infinite;
    animation-delay: -2.2s;
}
@keyframes h5game-float-y {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, -16px); }
}
@keyframes h5game-float-rotate {
    0%, 100% { transform: translate(0, -50%) rotate(0deg); }
    50%      { transform: translate(0, -50%) rotate(20deg); }
}
.h5game-modal-art-floater--slot { transform: translate(0, 0) !important; }
.h5game-modal-art-floater--cards { transform: translate(0, 0) !important; }
.h5game-modal-art-floater--dice  { transform: translate(0, -50%) !important; }
.h5game-modal-art-floater--gem   { transform: translate(0, 0) !important; }

@keyframes h5game-float-y-direct {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-16px); }
}
@keyframes h5game-float-rotate-direct {
    0%, 100% { transform: rotate(-8deg); }
    50%      { transform: rotate(8deg); }
}
.h5game-modal-art-floater--slot { animation: h5game-float-y-direct 5s ease-in-out infinite; animation-delay: -1.5s; }
.h5game-modal-art-floater--cards { animation: h5game-float-y-direct 4.5s ease-in-out infinite; animation-delay: -2.2s; }
.h5game-modal-art-floater--dice { animation: h5game-float-rotate-direct 6s ease-in-out infinite; }
.h5game-modal-art-floater--gem { animation: h5game-float-rotate-direct 7s ease-in-out infinite; animation-delay: -0.8s; }

/* 中心 Logo */
.h5game-modal-art-center {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 24px;
}
.h5game-modal-art-logo {
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
    border-radius: 28px;
    background: linear-gradient(135deg, #FFD600, #FF9F1C);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .4);
    animation: h5game-logo-bounce 3s ease-in-out infinite;
}
@keyframes h5game-logo-bounce {
    0%, 100% { transform: translateY(0) rotate(0); }
    25%      { transform: translateY(-6px) rotate(-3deg); }
    75%      { transform: translateY(-6px) rotate(3deg); }
}
.h5game-modal-art-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    letter-spacing: 1px;
}
.h5game-modal-art-sub {
    font-size: 14px;
    margin: 0 0 24px;
    opacity: .92;
}
.h5game-modal-art-bullets {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.h5game-modal-art-bullets li {
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}
.h5game-modal-art-bullets li .icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex: 0 0 28px;
}

/* === 右半: 表单 === */
.h5game-modal-form-side {
    flex: 1;
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
}
.h5game-modal-mobile-art {
    display: none;
    position: relative;
    height: 160px;
    background: linear-gradient(160deg, #C4002C 0%, #E02D2D 35%, #FF6B35 100%);
    overflow: hidden;
}
.h5game-modal-mobile-art-logo {
    width: 64px;
    height: 64px;
    margin: 24px auto 8px;
    border-radius: 18px;
    background: linear-gradient(135deg, #FFD600, #FF9F1C);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.h5game-modal-mobile-art-text {
    text-align: center;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

/* Tab 切换器 */
.h5game-modal-tabs {
    display: flex;
    background: var(--h5game-bg-soft);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 24px;
    position: relative;
}
.h5game-modal-tab {
    flex: 1;
    padding: 12px 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--h5game-text-soft);
    transition: color .25s;
    z-index: 1;
}
.h5game-modal-tab.is-active { color: var(--h5game-primary); }
.h5game-modal-tab-slider {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: var(--h5game-bg);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}
.h5game-modal-tab[data-tab="register"].is-active ~ .h5game-modal-tab-slider,
.h5game-modal-tabs[data-active="register"] .h5game-modal-tab-slider { transform: translateX(100%); }

.h5game-modal-form { display: none; }
.h5game-modal-form.is-active {
    display: block;
    animation: h5game-form-in .25s ease-out;
}
@keyframes h5game-form-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 表单 */
.h5game-modal-title-row {
    margin-bottom: 18px;
}
.h5game-modal-title-row h2 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
}
.h5game-modal-title-row p {
    margin: 0;
    font-size: 13px;
    color: var(--h5game-text-soft);
}

.h5game-form-row { margin-bottom: 14px; position: relative; }
.h5game-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--h5game-bg-soft);
    border: 1.5px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    color: var(--h5game-text);
    transition: border-color .15s, background .15s;
}
.h5game-input:focus {
    outline: none;
    border-color: var(--h5game-primary);
    background: var(--h5game-bg);
}
.h5game-input.is-error {
    border-color: var(--h5game-danger);
    background: #FFF5F5;
    animation: h5game-shake .3s ease-in-out;
}
@keyframes h5game-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}
.h5game-pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--h5game-text-mute);
}
.h5game-pwd-toggle:hover { color: var(--h5game-primary); }

/* 提交按钮: shimmer */
.h5game-btn {
    position: relative;
    overflow: hidden;
}
.h5game-btn:disabled { opacity: .65; pointer-events: none; }
.h5game-btn-loading > * { opacity: 0; }
.h5game-btn-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    animation: h5game-shimmer 1.2s linear infinite;
}
.h5game-btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: h5game-spin .7s linear infinite;
}
@keyframes h5game-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes h5game-spin     { to { transform: rotate(360deg); } }

.h5game-modal-foot {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--h5game-text-soft);
}
.h5game-modal-foot a {
    color: var(--h5game-primary);
    font-weight: 700;
    cursor: pointer;
}
.h5game-modal-foot a:hover { text-decoration: underline; }

.h5game-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    color: var(--h5game-text-soft);
    line-height: 1.5;
    margin-bottom: 14px;
}
.h5game-checkbox-row input { margin-top: 2px; }
.h5game-checkbox-row a { color: var(--h5game-primary); }

.h5game-req { color: var(--h5game-danger); }

.h5game-modal-helper-text {
    text-align: center;
    font-size: 11px;
    color: var(--h5game-text-mute);
    margin-top: 16px;
    line-height: 1.6;
}

/* === 响应式 === */
@media (max-width: 720px) {
    .h5game-modal-card {
        flex-direction: column;
        max-width: 420px;
        min-height: auto;
        max-height: 95vh;
    }
    .h5game-modal-art {
        display: none;
    }
    .h5game-modal-mobile-art {
        display: block;
    }
    .h5game-modal-form-side {
        padding: 24px 22px 22px;
    }
    .h5game-modal-title-row h2 { font-size: 19px; }
}

/* 超窄屏进一步压缩 */
@media (max-width: 360px) {
    .h5game-modal-form-side { padding: 20px 18px; }
    .h5game-modal-title-row h2 { font-size: 18px; }
}

/* === 旧版兼容（兜底） === */
.h5game-auth-page {
    display: none; /* 旧版弃用 */
}

/* ============================================
 * H5 Game — 游戏容器 + 钱包 + 商城样式
 * (原本就有,重设计弹窗时保留)
 * ============================================ */

.h5game-app {
    width: 100%;
    box-sizing: border-box;
}

/* 大转盘 */
.h5game-wheel-wrap {
    text-align: center;
    padding: 20px 12px;
}
.h5game-wheel-stage {
    position: relative;
    width: 320px;
    max-width: 100%;
    margin: 0 auto 16px;
    aspect-ratio: 1 / 1;
}
.h5game-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        from -90deg,
        #FF6B35 0deg,    #FF6B35 53deg,
        #FFE9A8 60deg,   #FFE9A8 144deg,
        #FFD600 144deg,  #FFD600 192deg,
        #FF9500 192deg,  #FF9500 228deg,
        #FF6B35 228deg,  #FF6B35 264deg,
        #C71585 264deg,  #C71585 288deg,
        #6B5BFF 288deg,  #6B5BFF 312deg,
        #2EC27E 312deg,  #2EC27E 360deg
    );
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    transform: rotate(0deg);
    transition: transform 4.5s cubic-bezier(.17, .67, .12, .99);
    will-change: transform;
    border: 6px solid #fff;
    outline: 2px solid var(--h5game-primary);
}
.h5game-wheel.is-spinning { pointer-events: none; }
.h5game-wheel-pointer {
    position: absolute;
    top: -10px; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 24px solid var(--h5game-primary);
    z-index: 5;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
.h5game-wheel-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--h5game-grad-primary);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 18px;
    box-shadow: 0 4px 12px rgba(224,45,45,.4);
    border: 4px solid #fff;
    z-index: 4;
}
.h5game-wheel-controls { margin-bottom: 16px; }
.h5game-wheel-bet-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 0 auto 16px;
    max-width: 360px;
}
.h5game-wheel-bet-btn {
    background: var(--h5game-bg);
    border: 1px solid var(--h5game-border);
    border-radius: var(--h5game-radius-md);
    padding: 10px 0;
    font-weight: 700;
    color: var(--h5game-text);
}
.h5game-wheel-bet-btn.is-active {
    background: var(--h5game-grad-primary);
    color: #fff;
    border-color: var(--h5game-primary);
}
.h5game-wheel-result {
    margin: 16px auto 0;
    padding: 16px;
    background: var(--h5game-bg-soft);
    border-radius: var(--h5game-radius-md);
    text-align: center;
    max-width: 360px;
    min-height: 60px;
}
.h5game-wheel-result.is-win { background: linear-gradient(135deg, #FFF7E5, #FFE9A8); }
.h5game-wheel-result.is-thanks { background: #F0F0F0; }
.h5game-wheel-result-title { font-size: 18px; font-weight: 800; }
.h5game-wheel-result-detail {
    font-size: 13px;
    margin-top: 4px;
    color: var(--h5game-text-soft);
}

/* 老虎机 */
.h5game-slot-wrap { text-align: center; padding: 20px 12px; }
.h5game-slot-machine {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0 auto 16px;
    max-width: 320px;
}
.h5game-slot-reel {
    aspect-ratio: 1 / 1;
    background: linear-gradient(180deg, #1A1A2E, #16213E);
    border-radius: var(--h5game-radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 56px;
    overflow: hidden;
    box-shadow: inset 0 4px 8px rgba(0,0,0,.4);
    position: relative;
}
.h5game-slot-symbol { display: inline-block; transition: transform .12s; }
.h5game-slot-reel.is-spinning .h5game-slot-symbol {
    animation: h5game-slot-cycle .12s linear infinite;
}
@keyframes h5game-slot-cycle {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

/* 斗地主 */
.h5game-landlord-wrap { padding: 20px 12px; }
.h5game-landlord-table {
    background: linear-gradient(180deg, #2E7D32, #1B5E20);
    border-radius: var(--h5game-radius-lg);
    padding: 20px;
    min-height: 60vh;
    color: #fff;
}
.h5game-landlord-hand {
    background: rgba(255,255,255,.08);
    border-radius: var(--h5game-radius-md);
    padding: 12px;
    margin-bottom: 12px;
}
.h5game-landlord-hand-cards {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.h5game-landlord-card {
    width: 36px; height: 52px;
    background: #fff;
    color: var(--h5game-text);
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    cursor: pointer; user-select: none;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .08s;
}
.h5game-landlord-card.is-selected {
    transform: translateY(-8px);
    box-shadow: 0 6px 12px rgba(0,0,0,.3);
    border: 2px solid var(--h5game-accent);
}
.h5game-landlord-controls {
    display: flex; gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

/* 钱包 + 商城 */
.h5game-wallet-wrap { padding: 20px 12px; }
.h5game-wallet-history { margin-top: 20px; }
.h5game-tx-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--h5game-border);
}
.h5game-tx-type { font-size: 13px; color: var(--h5game-text-soft); }
.h5game-tx-amount { font-weight: 700; font-size: 15px; }
.h5game-tx-amount.is-positive { color: var(--h5game-success); }
.h5game-tx-amount.is-negative { color: var(--h5game-danger); }
.h5game-shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.h5game-shop-item {
    background: var(--h5game-bg);
    border-radius: var(--h5game-radius-md);
    overflow: hidden;
    box-shadow: var(--h5game-shadow-sm);
}
.h5game-shop-item-image {
    aspect-ratio: 1 / 1;
    background: var(--h5game-bg-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 48px;
}
.h5game-shop-item-info { padding: 12px; }
.h5game-shop-item-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.h5game-shop-item-cost {
    color: var(--h5game-primary);
    font-weight: 700;
}

/* 游戏页通用 */
.h5game-game-page { padding: 16px 0 32px; }
.h5game-game-page-title {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 20px;
    color: var(--h5game-text);
}
