/* ========================================
   Webstore V3 - Layout & UI Enhancements
   (supplements main.css for webstore_v3.html)
   ======================================== */

/* ============================================================
   1. GLOBAL LAYOUT RESET
   Override ALL fixed sizes / overflow from main.css
   ============================================================ */
html {
    height: auto !important;
}
body {
    height: auto !important;
    min-height: 100vh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}
.mainContainer {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
    background: url(../images/bg.png) center top / cover fixed;
}
.mainContainer > div:first-child {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
}
.container {
    height: auto !important;
    overflow: visible !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
    text-align: left !important;
}
.right_container {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    display: block !important;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-align: left;
    overflow: visible !important;
}
.right_container .content_div {
    position: relative !important;
    height: auto !important;
    width: 100% !important;
    bottom: auto !important;
    overflow: visible !important;
    background-image: none !important;
}

/* ============================================================
   2. BOX INNER LAYOUT: full width, no float
   ============================================================ */
.content_div .box {
    overflow: visible !important;
}
.content_div .left_title {
    float: none !important;
    width: 100% !important;
    padding-left: 5px !important;
    margin-bottom: 5px;
}
.left_title .use_gem {
    margin-left: 8px;
    font-size: 13px;
}
.left_title .use_gem img {
    width: 14px;
    vertical-align: text-bottom;
}
.content_div .content {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box;
}
/* ============================================================
   USER INFO ROW (relocated between banner & gift tiers)
   Shown only after login (webstore.js toggles .user_info display).
   Overrides main.css fixed 588px width / bg image / absolute switch.
   ============================================================ */
.box.user_info {
    float: none !important;
    width: 100% !important;
    max-width: 1200px;
    margin: 15px auto;
    padding: 0 15px;
    box-sizing: border-box;
    overflow: visible;
}
.box.user_info .left_title {
    display: none !important;
}
.user_info .content {
    width: 100% !important;
    height: auto !important;
    top: 0 !important;
    background-image: none !important;
    box-sizing: border-box;
    display: flex !important;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(228, 175, 118, 0.3);
    border-radius: 10px;
}
.user_info > .content > div {
    float: none !important;
    height: auto !important;
    margin: 0 !important;
    color: #fff0d0;
}
.user_info .avatar {
    flex-shrink: 0;
    width: 75px;
    height: 75px;
}
.user_info .other_info {
    margin-left: 0 !important;
    min-width: 0;
    flex: 1;
    line-height: 1.5;
}
.user_info .nickname {
    margin: 0 0 4px !important;
    font-size: 20px;
    color: #fff2e6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user_info .other_info > div:last-child {
    font-size: 15px;
    color: #f0c896;
}
.user_info .level {
    margin-right: 20px !important;
}
.user_info .switch_user {
    position: static !important;
    right: auto !important;
    top: auto !important;
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.user_info .switch_user img {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}
.user_info .switch_user a {
    color: #e47100 !important;
    font-size: 15px;
    white-space: nowrap;
    cursor: pointer;
}
@media only screen and (max-width: 766px) {
    .box.user_info {
        margin: 10px auto;
        padding: 0 10px;
    }
    .user_info .content {
        gap: 10px;
        padding: 10px 12px;
    }
    .user_info .avatar {
        width: 56px;
        height: 56px;
        background-size: 56px 56px !important;
    }
    .user_info .avatar img {
        height: 48px !important;
    }
    .user_info .nickname {
        font-size: 16px;
    }
    .user_info .other_info > div:last-child {
        font-size: 13px;
    }
    .user_info .level {
        margin-right: 12px !important;
    }
    .user_info .switch_user a {
        font-size: 13px;
    }
}

/* ============================================================
   3. LEFT PANEL (pink gem info) hide logo
   ============================================================ */
.left_container .logo {
    display: none;
}

/* ============================================================
   Payment Action Bar (fixed bottom, index_v2 style)
   ============================================================ */
.pay-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    background: rgba(2, 1, 1, 0.98);
    border-top: 2px solid rgba(228, 175, 118, 0.3);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-x: hidden !important;
    overflow-y: auto;
    box-sizing: border-box;
}
.pay-action-bar *{
    max-width: 100%;
    box-sizing: border-box;
}
.pay-action-bar.visible {
    transform: translateY(0);
}
.pay-action-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    box-sizing: border-box;
    width: 100%;
}
.pay-action-inner .box {
    margin-bottom: 0 !important;
}

/* -- Row 1: selected item + rebate + user info -- */
.pay-action-row1 {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 10px;
    padding-right: 45px;
    border-bottom: 1px solid rgba(228, 175, 118, 0.15);
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
}
.pay-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.pay-action-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.pay-action-detail {
    min-width: 0;
}
.pay-action-item-name {
    font-size: 14px;
    color: #fff2e6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pay-action-item-price {
    font-size: 18px;
    color: #ffe033;
    font-weight: bold;
}
.pay-action-row1 .rebate_box {
    flex: 1;
    min-width: 0;
}
.pay-action-row1 .rebate_box .content {
    width: auto !important;
}
.pay-action-row1 .rebate_text {
    font-size: 13px;
    line-height: 1.4;
    color: #f0c896;
    display: inline;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pay-action-row1 .rebate_text span {
    color: #ffd200;
}
.pay-action-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}
.pay-action-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pay-action-name {
    color: #fff2e6;
    font-size: 13px;
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pay-action-switch {
    color: #e47100 !important;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
}

/* -- Row 2: channels (top) + pay button (bottom), vertical layout -- */
.pay-action-row2 {
    width: 100%;
    box-sizing: border-box;
}
.pay-action-row2 .box-channel {
    margin-bottom: 10px;
}
.pay-action-row2 .box-channel .left_title {
    color: #f0c896;
    font-size: 14px;
    margin-bottom: 6px;
}
.pay-action-bar .channel_content {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px;
}
.pay-action-bar .channel {
    width: 120px !important;
    height: 44px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: transform 0.2s;
    box-sizing: border-box;
}
.pay-action-bar .channel > img {
    max-width: 100%;
    max-height: 100%;
}
.pay-action-bar .channel:hover {
    transform: scale(1.05);
}
.pay-action-bar .channel::after {
    width: calc(100% + 8px) !important;
    height: calc(100% + 8px) !important;
    top: -4px !important;
    left: -4px !important;
}
.pay-action-row2 .box.pay {
    text-align: center;
}
.pay-action-row2 .box.pay .left_title {
    display: none !important;
}
.pay-action-row2 .amount_price {
    text-align: center;
    margin-bottom: 6px;
}
.pay-action-row2 .pay_button {
    text-align: center;
}
.pay-action-row2 .toPay {
    height: 50px !important;
    font-size: 20px !important;
    width: 200px !important;
}

/* -- Close button -- */
.pay-action-close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(228, 175, 118, 0.15);
    border: 1px solid rgba(228, 175, 118, 0.4);
    border-radius: 50%;
    color: #f0c896;
    font-size: 24px;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
}
.pay-action-close:hover {
    background: rgba(228, 175, 118, 0.3);
    color: #fff;
}

/* --- Footer: normal flow, always visible --- */
.footer {
    position: static !important;
    display: block !important;
    padding: 15px 0;
}

/* ============================================================
   3. LEFT PANEL (pink gem info): restyle as info card
   ============================================================ */
.left_container {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    padding: 0;
    box-sizing: border-box;
}
.left_container .desc {
    width: auto !important;
    height: auto !important;
    float: none !important;
    position: static !important;
    background-image: none !important;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(228, 175, 118, 0.2);
    border-radius: 10px;
    padding: 16px 20px;
    text-align: center;
    color: #e4af76;
    margin-bottom: 15px;
}
.left_container .pink_gem_desc {
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}
.left_container .discount {
    font-size: 16px;
    color: #321901;
    background: #e49100;
    border-radius: 30px;
    max-width: 280px;
    margin: 10px auto 5px;
    padding: 6px 15px;
    width: auto;
}
.left_container .discount2 {
    font-size: 14px;
    color: #e47100;
    margin: 0 auto;
    width: fit-content;
}
.left_container .sale_time {
    font-size: 13px;
    color: #e47100;
    margin: 6px auto 0;
    max-width: 280px;
    line-height: 1.4;
}
.left_container .faq {
    position: static !important;
    bottom: auto !important;
    width: auto !important;
    margin-top: 10px;
    font-size: 16px;
}
.left_container .faq img {
    width: auto;
    height: 18px;
    vertical-align: middle;
    margin-right: 5px;
}

/* ============================================================
   4. GIFT GRID: responsive
   ============================================================ */
.gift_content {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-left: 0 !important;
}
.gift {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
    display: flex !important;
    flex-direction: column;
    background-size: 100% 100% !important;
    background-position: 0 0 !important;
    border-radius: 8px;
}
.gift::after {
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    border-radius: 8px;
}
.gift .item {
    flex: 1;
    background-size: 65% !important;
    background-position: center 25px !important;
}
.gift .price {
    text-align: center;
    padding: 4px 0;
}

/* ============================================================
   5. FAQ / PINK / AGREEMENT BOXES: responsive
   ============================================================ */
#faqBox, #pinkBox {
    width: 94vw !important;
    max-width: 1144px;
    left: 50% !important;
    transform: translateX(-50%);
    top: 3vh;
    height: auto;
    max-height: 94vh;
}
#pinkBox {
    max-width: 1120px;
}
#agreementBox {
    width: 94vw !important;
    max-width: 750px;
    left: 50% !important;
    transform: translate(-50%, -50%);
    top: 50%;
}
#faqBox .faqs, #pinkBox .faqs {
    max-height: calc(94vh - 250px) !important;
    height: auto !important;
    overflow-y: auto;
    padding-bottom: 20px !important;
}
#faqBox .button_div, #pinkBox .button_div {
    position: static !important;
    bottom: auto !important;
    padding: 15px 0;
}

/* ============================================================
   6. HEADER: fixed top + right area + login button
   ============================================================ */
.mainContainer .header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    box-sizing: border-box;
    display: flex !important;
    align-items: center;
}
.mainContainer .header .title {
    display: block !important;
    flex-shrink: 0;
}
.mainContainer .header .add_to_home_div {
    float: none !important;
    margin-left: auto;
    align-items: center;
}
.fired .mainContainer .header .add_to_home_div {
    display: flex !important;
}
/* Space for fixed header */
.mainContainer > div:first-child {
    padding-top: 66px;
}
.header-login-btn {
    height: 40px;
    padding: 0 15px;
    background-image: url(../images/button_green.png);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.3s;
    white-space: nowrap;
    margin-left: auto;
    margin-right: 10px;
}
.header-login-btn:hover { opacity: 1; }

/* ============================================================
   7. LOGIN ACTION BAR (fixed bottom, same style as pay bar)
   ============================================================ */
.login-action-bar {
    display: none !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 100;
    background: rgba(2, 1, 1, 0.98) !important;
    background-image: none !important;
    border-top: 2px solid rgba(228, 175, 118, 0.3);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-sizing: border-box !important;
    text-align: center;
    float: none !important;
}
.login-action-bar.login-open {
    display: block !important;
    transform: translateY(0);
}
.login-action-inner {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 25px;
    box-sizing: border-box;
    text-align: center;
}
.login-action-inner .login-prompt {
    font-size: 18px;
    color: #fff2e6;
    margin-bottom: 15px;
    text-align: center;
}
.login-action-form {
    position: relative;
}
.login-action-input {
    position: relative;
}
.login-action-bar #user_id {
    width: 100% !important;
    height: 50px;
    font-size: 18px;
    color: #fff0d0;
    border: none;
    border-radius: 5px;
    padding-left: 12px;
    outline: none;
    background-image: url(../images/login.png);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    box-sizing: border-box;
}
.login-action-bar i.question {
    position: absolute;
    right: 12px;
    top: 15px;
    background: url(../images/question.png) center top / cover;
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.login-action-bar .user_id_sample {
    display: none;
    width: 100%;
    margin-top: 5px;
    border-radius: 5px;
    position: relative;
}
.login-action-bar .question:hover ~ .user_id_sample {
    display: block;
}
.login-action-bar .id_tips {
    color: #f0c896;
    margin-top: 8px;
    font-size: 13px;
    text-align: left;
}
.login-action-btn {
    margin-top: 15px;
}
.login-action-btn .user_button {
    height: 50px !important;
    width: 200px !important;
    font-size: 20px !important;
}

/* ===== ABtest gate: override for login bar ===== */
body.abtest-gate-active .user_id {
    display: none !important;
}
body.abtest-gate-active .user_id.login-open {
    display: block !important;
    transform: translateY(0);
}

/* ============================================================
   9. TABS + 7-DAY CHECK-IN
   ============================================================ */
.tabs-section {
    max-width: 1200px;
    margin: 15px auto;
    padding: 0 15px;
    box-sizing: border-box;
}
.tab-header {
    display: flex;
    gap: 0;
    border-bottom: 2px solid rgba(228, 175, 118, 0.2);
}
.tab-item {
    padding: 10px 24px;
    font-size: 16px;
    color: #f0c896;
    cursor: pointer;
    position: relative;
    opacity: 0.6;
    transition: all 0.3s;
    background: none;
    border: none;
    outline: none;
    font-family: inherit;
    white-space: nowrap;
}
.tab-item:hover { opacity: 0.85; }
.tab-item.active { opacity: 1; color: #ffd44d; }
.tab-item.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #ffc62d, #e47100);
    border-radius: 1px;
}
.tab-content { display: none; padding: 15px 0; }
.tab-content.active { display: block; }

.checkin-container {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(228, 175, 118, 0.5);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(228, 175, 118, 0.35), 0 0 40px rgba(228, 175, 118, 0.15), inset 0 0 15px rgba(228, 175, 118, 0.08);
    padding: 15px;
}
.checkin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.checkin-header .checkin-title { font-size: 18px; color: #fff2e6; display: flex; align-items: center; gap: 8px; }
.checkin-rules-btn {
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    transition: color 0.2s;
}
.checkin-rules-btn:hover {
    color: #ffc62d;
}
.checkin-header-right { display: flex; align-items: center; gap: 15px; }
.checkin-header .checkin-streak { font-size: 14px; color: #f08c20; }
.checkin-countdown { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.checkin-countdown .countdown-label { color: #aaa; }
.checkin-countdown .countdown-time { color: #ffc62d; font-weight: bold; font-family: monospace; font-size: 14px; }
.checkin-grid { display: flex; flex-direction: column; gap: 8px; }
.checkin-row {
    display: flex;
    align-items: center;
    background: rgba(40, 30, 25, 0.7);
    border: 1px solid rgba(228, 175, 118, 0.2);
    border-radius: 8px;
    padding: 10px 16px;
    transition: all 0.3s;
}
.checkin-row-day { flex: 0 0 55px; text-align: center; }
.checkin-row-day-label { font-size: 11px; color: #dcc4a8; line-height: 1.2; }
.checkin-row-day-num { font-size: 22px; font-weight: bold; color: #f0c896; line-height: 1.2; }
.checkin-row-rewards { flex: 1; display: flex; gap: 10px; flex-wrap: wrap; }
.checkin-reward-group { display: flex; align-items: center; gap: 4px; }
.checkin-reward-group .reward-group-label { font-size: 10px; color: #dcc4a8; white-space: nowrap; writing-mode: vertical-lr; text-orientation: mixed; letter-spacing: 1px; }
.checkin-reward-group.bonus-group .reward-group-label { color: #ff9a40; }
.checkin-reward-group .reward-group-items { display: flex; gap: 4px; flex-wrap: wrap; }
.checkin-row-reward {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: #ffe033;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    min-width: 60px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.checkin-row-reward.bonus { color: #ff6a00; background: rgba(255, 200, 0, 0.08); border: 1px solid #d4a017; box-shadow: 0 0 6px rgba(212, 160, 23, 0.4), inset 0 0 4px rgba(255, 215, 0, 0.1); }
.checkin-row-reward img { width: 50px; height: 50px; }
.checkin-row-reward span { font-size: 14px; white-space: nowrap; }
.checkin-row-btn {
    flex: 0 0 80px;
    height: 32px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}
.checkin-row-btn.claimable { background: linear-gradient(135deg, #4caf50, #2e7d32); color: #fff; }
.checkin-row-btn.claimable:hover { box-shadow: 0 0 10px rgba(76, 175, 80, 0.5); }
.checkin-row-btn.claimed { background: transparent; color: #4caf50; cursor: default; font-size: 22px; font-weight: bold; }
.checkin-row-btn.locked { background: rgba(158, 158, 158, 0.4); color: #fff; cursor: pointer; border: none; }
.checkin-row-btn.locked.no-click { cursor: not-allowed; }
.checkin-row-btn.expired { background: rgba(255, 82, 82, 0.15); color: #ff5252; cursor: not-allowed; }
.checkin-row.checked { border-color: rgba(100, 181, 246, 0.5); background: rgba(100, 181, 246, 0.15); border-left: 3px solid #64b5f6; }
.checkin-row.today { border-color: #4caf50; box-shadow: 0 0 8px rgba(76, 175, 80, 0.3); background: rgba(76, 175, 80, 0.15); }
.checkin-row.today .checkin-row-day { color: #66bb6a; }
.checkin-row.expired { opacity: 0.6; }
.checkin-row.locked { opacity: 1; border-color: rgba(158, 158, 158, 0.35); background: rgba(158, 158, 158, 0.1); }
.checkin-row.locked .checkin-row-btn { opacity: 0.5; }

/* ============================================================
   10. BANNER CAROUSEL
   ============================================================ */
.banner-section {
    max-width: 1200px;
    margin: 15px auto;
    padding: 0 15px;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}
.banner-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid rgba(228, 175, 118, 0.3);
}
.banner-track {
    display: flex;
    transition: transform 0.5s ease;
}
.banner-slide {
    min-width: 100%;
    position: relative;
}
.banner-slide img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.banner-slide.clickable {
    cursor: pointer;
}
.banner-slide .banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
}
.banner-slide .banner-overlay h3 {
    font-size: 18px;
    margin-bottom: 4px;
}
.banner-slide .banner-overlay p {
    font-size: 13px;
    opacity: 0.8;
}
.banner-dots {
    text-align: center;
    padding: 10px 0;
    position: absolute;
    bottom: 5px;
    width: 100%;
    z-index: 2;
}
.banner-dots .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    margin: 0 4px;
    cursor: pointer;
    transition: all 0.3s;
}
.banner-dots .dot.active {
    background: #ffc62d;
    width: 24px;
    border-radius: 5px;
}
.banner-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(228, 175, 118, 0.3);
    border-radius: 50%;
    color: #fff2e6;
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}
.banner-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}
.banner-nav.prev {
    left: 10px;
}
.banner-nav.next {
    right: 10px;
}

.add-to-home-mobile { display: none; }

/* ============================================================
   10. MOBILE RESPONSIVE
   ============================================================ */
@media only screen and (max-width: 766px) {
    body {
        min-width: 0 !important;
        overflow-x: hidden !important;
    }
    .mainContainer .header .title {
        font-size: 20px;
        padding: 0;
        line-height: 50px;
    }
    .checkin-header {
        flex-wrap: wrap;
        gap: 6px;
    }
    .checkin-header .checkin-title {
        font-size: 16px;
        width: 100%;
        justify-content: space-between;
    }
    .checkin-header-right {
        width: 100%;
        justify-content: space-between;
    }
    .checkin-header .checkin-streak {
        font-size: 13px;
    }
    .checkin-countdown {
        font-size: 12px;
    }
    .checkin-reward-group .reward-group-label {
        display: none;
    }
    .checkin-row-rewards {
        gap: 4px;
    }
    .checkin-reward-group .reward-group-items {
        gap: 3px;
    }
    .checkin-row-reward {
        padding: 5px 8px;
        font-size: 12px;
        gap: 2px;
        min-width: 44px;
    }
    .checkin-row-reward img {
        width: 36px;
        height: 36px;
    }
    .checkin-row-reward span {
        font-size: 12px;
    }
    .checkin-row-btn {
        flex: 0 0 60px;
        font-size: 11px;
    }
    .checkin-row {
        padding: 8px 10px;
    }
    .checkin-row-day {
        flex: 0 0 40px;
    }
    .checkin-row-day-num {
        font-size: 18px;
    }
    .mainContainer,
    .mainContainer > div:first-child,
    .container,
    .right_container,
    .right_container .content_div {
        height: auto !important;
        overflow: visible !important;
    }
    .mainContainer > div:first-child {
        padding-top: 50px;
    }
    .mainContainer .right_container {
        background-color: transparent !important;
    }
    .footer {
        display: block !important;
    }
    .pay-action-bar {
        max-height: 90vh;
    }
    .pay-action-inner {
        padding: 10px 10px;
        width: 100%;
    }
    .pay-action-row1,
    .pay-action-row2 {
        width: 100%;
    }
    .pay-action-row1 {
        flex-wrap: wrap;
        gap: 8px;
    }
    .pay-action-row1 .rebate_box {
        order: 3;
        width: 100%;
        flex: none;
    }
    .pay-action-bar .channel {
        width: 100px !important;
        height: 38px !important;
    }
    .pay-action-row2 .toPay {
        width: 180px !important;
        height: 44px !important;
        font-size: 18px !important;
    }
    .fired .mainContainer .header .add_to_home_div {
        display: none !important;
    }
    .fired .add_to_home_div2 {
        display: none !important;
    }
    .fired .add-to-home-mobile {
        display: flex;
        justify-content: flex-end;
        padding: 8px 15px;
        background: rgba(0, 0, 0, 0.4);
    }
    .fired .add-to-home-mobile .add_to_home {
        width: auto;
        height: 32px;
        line-height: 16px;
        font-size: 14px;
        padding: 0 20px;
        border-radius: 6px;
        background-image: url(../images/pay_button.png);
        background-size: 100% 100%;
        background-repeat: no-repeat;
        color: #3c261a;
        font-weight: bold;
        border: none;
        cursor: pointer;
    }
    .header-login-btn {
        height: 30px;
        padding: 0 10px;
        font-size: 13px;
        margin-right: 5px;
    }
    .banner-slide img {
        width: 100%;
        height: 140px;
        object-fit: cover;
    }
    .banner-nav {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    .container {
        padding: 0 10px;
    }
    .gift_content {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px;
    }
    .box.user_id.login-open {
        width: 92vw;
        height: auto;
        min-height: 300px;
    }
    .box.user_id.login-open .faq_title {
        font-size: 20px;
        line-height: 58px;
        height: 55px;
    }
    .box.user_id.login-open .faq_title img {
        right: 12px;
        top: 12px;
    }
    .box.user_id.login-open .login-body {
        padding: 5px 20px 0;
    }
    .box.user_id.login-open .button_div {
        bottom: 18px;
    }
    .box.user_id.login-open .button_div .user_button {
        width: 200px;
        height: 50px;
        font-size: 18px;
    }
}

@media only screen and (max-width: 860px) {
    .fired .mainContainer .header .add_to_home_div {
        display: none !important;
    }
}

@media only screen and (max-width: 400px) {
    .gift_content {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==========================================================
   Z-INDEX hierarchy (webstore_v3 unified management)
   Layer 1 z-50   : fixed header
   Layer 2 z-100  : pay/login bottom action bar
   Layer 3 z-200  : .mask shared overlay
   Layer 4 z-300  : system popups (faqBox, agreementBox, errorBox etc.)
   Layer 5 z-400  : V3 popups (reward detail, rules, check-in success, player ID)
   ========================================================== */
.mask { z-index: 200 !important; }
#loadingBox { z-index: 500 !important; }
#endBox, #paiedBox, #errorBox, #faqBox, #pinkBox, #agreementBox { z-index: 300 !important; }

/* ========== Reward Detail Popup ========== */
.reward-detail-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.65);
}
.reward-detail-dialog {
    background: linear-gradient(135deg, #2a1f18, #1a1210);
    border: 2px solid rgba(228,175,118,0.4);
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    overflow: hidden;
}
.reward-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(228,175,118,0.2);
    font-size: 16px;
    font-weight: bold;
    color: #fff2e6;
}
.reward-detail-close {
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}
.reward-detail-close:hover { color: #fff; }
.reward-detail-body {
    padding: 16px 20px;
    max-height: 60vh;
    overflow-y: auto;
}
.reward-detail-section {
    margin-bottom: 16px;
}
.reward-detail-section:last-child { margin-bottom: 0; }
.reward-detail-label {
    font-size: 13px;
    font-weight: bold;
    color: #dcc4a8;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(228,175,118,0.15);
}
.bonus-section .reward-detail-label {
    color: #ff9a40;
    border-bottom-color: rgba(255,106,0,0.2);
}
.reward-detail-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.reward-detail-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    border: 1px solid rgba(228,175,118,0.1);
}
.bonus-section .reward-detail-row {
    background: rgba(255,106,0,0.06);
    border-color: rgba(255,106,0,0.15);
}
.reward-detail-icon {
    flex: 0 0 36px;
}
.reward-detail-icon img {
    width: 36px;
    height: 36px;
    border-radius: 4px;
}
.reward-detail-name {
    flex: 1;
    font-size: 14px;
    color: #e8d5c0;
}
.bonus-section .reward-detail-name {
    color: #ffba70;
}
.reward-detail-amount {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: bold;
    color: #ffe033;
}
.bonus-section .reward-detail-amount {
    color: #ff6a00;
}
/* Reward row click interaction hint */
.checkin-row-rewards {
    cursor: pointer;
}
.checkin-row-rewards:hover {
    opacity: 0.85;
}

/* Check-in row highlight flash */
.checkin-row.highlight-pulse {
    animation: checkinPulse 0.5s ease 3;
}
@keyframes checkinPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(76, 175, 80, 0); }
    50% { box-shadow: 0 0 15px rgba(76, 175, 80, 0.6), inset 0 0 8px rgba(76, 175, 80, 0.15); }
}

/* ============================================================
   Check-in Rules popup -- reuses the shared ShowPage framework (#checkinRulesBox),
   visual style mirrors the "How to use Pink Gems" (#pinkBox) / #agreementBox parchment popup.
   Shown via ShowPage('checkinRules') / closed via HidePage('checkinRules').
   ============================================================ */
#checkinRulesBox {
    display: none;
    position: fixed;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    width: 960px;
    max-width: 94vw;
    height: 80vh;
    max-height: 780px;
    background: url(../images/alert_bg.png);
    background-size: 100% 100%;
    background-repeat: no-repeat;
}
#checkinRulesBox .faq_title {
    height: 70px;
    color: #f6dba7;
    text-align: center;
    line-height: 78px;
    font-size: 35px;
}
#checkinRulesBox .faq_title img {
    position: absolute;
    right: 22px;
    top: 20px;
    cursor: pointer;
}
#checkinRulesBox .faqs {
    padding: 10px 55px 0;
    height: calc(80vh - 170px);
    max-height: 610px;
    overflow-y: auto;
    box-sizing: border-box;
}
#checkinRulesBox .faqs::-webkit-scrollbar { display: none; }
#checkinRulesBox .question {
    font-size: 20px;
    line-height: 36px;
    color: #412314;
    text-align: left;
    word-break: break-word;
}
#checkinRulesBox .button_div {
    padding: 15px 0;
    width: 100%;
    text-align: center;
}
#checkinRulesBox button {
    width: 280px;
    height: 70px;
    color: #fdf7d3;
    font-size: 26px;
    border: none;
    cursor: pointer;
    background: url(../images/button_green.png);
    background-repeat: no-repeat;
    background-size: 100% 100%;
}
@media only screen and (max-width: 766px) {
    #checkinRulesBox {
        width: 90vw;
        max-width: 90vw;
        height: 78vh;
        max-height: 560px;
        background-image: url(../images/alert_bg_m.png);
    }
    #checkinRulesBox .faq_title { height: 54px; line-height: 60px; font-size: 24px; }
    #checkinRulesBox .faqs { padding: 8px 24px 0; height: calc(78vh - 130px); max-height: 430px; box-sizing: border-box; }
    #checkinRulesBox .question { font-size: 15px; line-height: 26px; }
    #checkinRulesBox .button_div { padding: 12px 0; }
    #checkinRulesBox button { width: 200px; height: 52px; font-size: 20px; }
}
