/* ============================================================
   Payment System Styles — 付費方案頁面 + 服務條款簽約
   ============================================================ */

:root {
    /* 付款頁響應式比例 Token：統一放大/縮小並限制邊界 */
    --pay-card-width: clamp(220px, 15.5vw, 340px);
    --pay-card-gap: clamp(32px, 5.2vw, 136px);
    --pay-title-size: clamp(2.2rem, 3.1vw, 3.6rem);
    --pay-subtitle-size: clamp(1rem, 1.45vw, 1.6rem);
    --pay-card-name-size: clamp(0.9rem, 0.72rem + 0.35vw, 1.15rem);
    --pay-price-size: clamp(1.1rem, 1.2vw, 1.5rem);
    --pay-price-action-size: clamp(0.95rem, 1.05vw, 1.25rem);
    --pay-sub-price-size: clamp(1rem, 1.05vw, 1.25rem);
    --pay-info-size: clamp(0.95rem, 1vw, 1.15rem);
}

/* === 付費方案選擇器容器 === */
.payment-selector-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.90);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: auto;
    position: relative;
}

.payment-selector-container.visible {
    opacity: 1;
}

/* 標題區域 */
.payment-header {
    text-align: center;
    margin-bottom: 20px;
}

.payment-title {
    font-family: 'Cinzel', 'Noto Sans TC', serif;
    font-size: var(--pay-title-size);
    color: #d4af37;
    margin: 0;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
    letter-spacing: clamp(4px, 0.5vw, 8px);
}

.payment-subtitle {
    color: #aaa;
    font-size: var(--pay-subtitle-size);
    margin-top: 8px;
    font-family: 'Cinzel', 'Noto Sans TC', serif;
    letter-spacing: 1px;
}

.payment-crypto-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 0;
    color: #4ecdc4;
    font-size: clamp(0.95rem, 1.1vw, 1.25rem);
    font-family: 'Cinzel', 'Noto Sans TC', serif;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(78, 205, 196, 0.4);
}

.crypto-hint-icon {
    font-size: 1.1em;
    opacity: 0.85;
}

/* 內容區域包裹器 — 讓徽章能對齊卡牌寬度 */
.payment-content-wrapper {
    position: relative;
    width: min(96vw, 1720px);
    margin-top: clamp(-100px, -9vh, -36px);
}

/* 點數徽章 — 靠右對齊於最右邊卡牌邊界 */
.payment-credits-badge {
    position: absolute;
    top: 5px;
    right: 0;
    display: block;
    width: 170px;
    height: 95px;
    padding: 0;
    border: none;
    background: transparent;
    z-index: 4;
}

.credits-icon {
    display: block;
    width: 100%;
    height: 95px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.8));
}

/* 圖片載入失敗時的 fallback 樣式 */
.credits-icon.img-error {
    display: none;
}
.credits-badge-fallback {
    display: none;
    width: 100%;
    height: 95px;
    line-height: 95px;
    text-align: center;
    font-size: 2.1rem;
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.8));
}
.credits-icon.img-error ~ .credits-badge-fallback {
    display: block;
}

.credits-count {
    position: absolute;
    top: 50%;
    left: 38%;
    right: 3%;
    transform: translateY(-50%);
    text-align: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: #3ec6ee !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

/* 確保數字滾輪子元素也繼承顏色 */
.credits-count .digit-cell,
.credits-count .digit-strip,
.credits-count .digit-roller {
    color: #3ec6ee !important;
}

/* === 數字滾動動畫 (Number Roller Animation) === */

/* 單一位數的滾輪容器 — 裁切只顯示一個數字 */
.digit-roller {
    display: inline-block;
    height: 1em;
    line-height: 1;
    overflow: hidden;
    vertical-align: top;
}

/* 新位數入場展開（寬度從 0 展開） */
.digit-roller.digit-entering {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
}

/* 數字條帶 — 垂直排列 0-9 */
.digit-strip {
    display: flex;
    flex-direction: column;
}

.digit-strip > .digit-cell {
    display: block;
    height: 1em;
    line-height: 1;
    text-align: center;
}

/* 點數變化脈衝光效 */
.credits-count.credits-flash {
    animation: creditsFlash 1s ease-out;
}

@keyframes creditsFlash {
    0%   { filter: brightness(1); }
    25%  { filter: brightness(2.2) drop-shadow(0 0 20px rgba(0, 207, 255, 0.9)); }
    100% { filter: brightness(1); }
}

/* 增加/減少浮動指示器 (+5 / -1 之類) */
.credits-delta-indicator {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cinzel', serif;
    font-weight: 700;
    pointer-events: none;
    white-space: nowrap;
    z-index: 20;
    animation: deltaFloat 1.8s ease-out forwards;
}

.credits-delta-indicator.increase {
    font-size: 2rem;
    color: #00ff88;
    text-shadow: 0 0 12px rgba(0, 255, 136, 0.6);
}

.credits-delta-indicator.decrease {
    font-size: 1.6rem;
    color: #ff4466;
    text-shadow: 0 0 12px rgba(255, 68, 102, 0.6);
}

@keyframes deltaFloat {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
    70%  { opacity: 0.8; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-60px); }
}

/* === 點數徽章：永遠顯示（所有用戶） === */
/* .credits-hidden 類已停用，徽章永遠可見 */

/* === 卡牌列表 === */
.payment-card-list {
    display: flex;
    gap: var(--pay-card-gap);
    perspective: 1000px;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: clamp(24px, 3vh, 32px);
    position: relative;
    z-index: 6;
    width: 100%;
    max-width: 100%;
    padding-inline: clamp(8px, 1.6vw, 24px);
    box-sizing: border-box;
}

/* 單卡模式：居中顯示（台灣：僅 tier1 單次購買 49 元） */
.payment-card-list.single-card {
    gap: 0;
    justify-content: center;
}

/* 單卡模式下 content-wrapper 也居中 */
.payment-content-wrapper.single-card-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 雙卡模式：台灣 — tier4 月訂閱 + tier1 單次購買 */
.payment-card-list.dual-card {
    gap: clamp(40px, 7vw, 100px);
    justify-content: center;
}

/* 雙卡模式下 content-wrapper 居中 */
.payment-content-wrapper.dual-card-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 單張付費卡牌 */
.payment-card {
    width: var(--pay-card-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
    background: transparent;
}

.payment-card .payment-card-img {
    width: 100%;
    height: auto;
    aspect-ratio: 300 / 515;
    background-size: cover;
    background-position: center;
    opacity: 0.75;
    transition: opacity 0.3s, border-color 0.3s, box-shadow 0.3s;
    border: 2px solid #554400;
    border-radius: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.payment-card .payment-card-name {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: var(--pay-card-name-size);
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

/* 徽章 (訂閱特惠) — 已停用，不再顯示 */
.payment-badge {
    display: none !important;
}

/* 價格標籤 — 深藍發光邊框風格 */
.payment-price {
    margin-top: clamp(12px, 1.6vh, 20px);
    display: inline-block;
    width: 100%;
    padding: clamp(8px, 1.2vh, 12px) clamp(16px, 2vw, 26px);
    box-sizing: border-box;
    text-align: center;

    /* 漸層背景：從中間深藍向兩邊變暗 */
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 26, 53, 1) 20%,
        rgba(0, 26, 53, 1) 80%,
        rgba(0, 0, 0, 0.8) 100%
    );

    /* 頂部與底部的發光藍色邊框 */
    border: none;
    border-top: 2px solid #3498db;
    border-bottom: 2px solid #3498db;
    border-radius: 0;

    /* 外發光效果：僅上下邊框發光，左右不發光 */
    box-shadow: 0 -4px 10px -4px rgba(52, 152, 219, 0.5),
                0  4px 10px -4px rgba(52, 152, 219, 0.5);
}

.payment-price .price-text {
    font-family: 'Cinzel', serif;
    font-size: var(--pay-price-size);
    color: #fff;
    font-weight: 700;
}

.payment-price .price-action {
    font-family: 'Noto Sans TC', sans-serif;
    font-size: var(--pay-price-action-size);
    color: #d4af37;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 已訂閱特殊樣式 */
.payment-price.subscribed {
    border-top-color: rgba(212, 175, 55, 0.5);
    border-bottom-color: rgba(212, 175, 55, 0.5);
    border-top-style: dashed;
    border-bottom-style: dashed;
    box-shadow: 0 -4px 10px -4px rgba(212, 175, 55, 0.3),
                0  4px 10px -4px rgba(212, 175, 55, 0.3);
}

/* 已取消訂閱樣式 */
.payment-price.subscribed.cancelled {
    border-top-color: rgba(136, 136, 136, 0.5);
    border-bottom-color: rgba(136, 136, 136, 0.5);
    box-shadow: none;
}

.payment-price.subscribed.cancelled .price-action {
    color: #888;
    text-decoration: none;
}

.payment-sub-price {
    margin-top: 8px;
    font-size: var(--pay-sub-price-size);
    color: #888;
    text-align: center;
    font-family: 'Noto Sans TC', sans-serif;
}

/* 副標籤高亮（Best Value、Save 40% 等賣點文字） */
.payment-sub-price.payment-sub-highlight {
    color: #e3ad1b;
    font-size: clamp(1.2rem, 1.3vw, 1.6rem);
    font-weight: 600;
    font-style: italic;
}

/* 進度條 */
.payment-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: transparent;
}

.payment-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #d4af37, #ff00de);
    transition: width 0.1s linear;
    box-shadow: 0 0 10px #d4af37;
}

/* 懸停效果 */
.payment-card.hover,
.payment-card:hover {
    transform: scale(1.07) translateY(-12px);
    z-index: 10;
}

.payment-card.hover .payment-card-img,
.payment-card:hover .payment-card-img {
    opacity: 1;
    border-color: #fff;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.6),
                0 0 60px rgba(212, 175, 55, 0.2);
}

.payment-card.selected {
    transform: scale(1.1) translateY(-16px);
}

.payment-card.selected .payment-card-img {
    border-color: #ff00de;
    box-shadow: 0 0 50px #ff00de, 0 0 100px rgba(255, 0, 222, 0.3);
}

/* 點數消耗說明橫幅（國際版） */
.payment-cost-banner {
    width: 80%;
    max-width: 900px;
    padding: 10px 60px;
    box-sizing: border-box;
    text-align: center;
    background: linear-gradient(90deg, transparent 0%, #5e1a6a 30px, #5e1a6a calc(100% - 30px), transparent 100%);
    margin-bottom: 10px;
    font-family: 'Cinzel', 'Noto Sans TC', serif;
    font-size: clamp(1.05rem, 1.2vw, 1.4rem);
    color: #e792f6;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(231, 146, 246, 0.3);
}

/* 說明文字 */
.payment-info-text {
    color: #d4af37;
    font-size: var(--pay-info-size);
    text-align: center;
    margin-bottom: 24px;
    font-family: 'Noto Sans TC', sans-serif;
}

/* 返回按鈕（與「再次占卜」按鈕樣式一致） */
.payment-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: clamp(12px, 1.8vh, 16px) clamp(28px, 4.5vw, 64px);
    border-radius: 16px;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;

    /* 金屬金色漸層背景 */
    background: linear-gradient(110deg,
            #aa771c 0%,
            #bf953f 25%,
            #fcf6ba 50%,
            #bf953f 75%,
            #aa771c 100%);
    background-size: 200% auto;

    /* 深度 & 發光 */
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);

    /* 流光動畫 */
    animation: shine 4s linear infinite;
    transition: transform 0.2s, box-shadow 0.2s;
}

.payment-back-btn .back-icon {
    font-size: 1.5rem;
}

.payment-back-btn .back-text {
    font-family: 'Cinzel', 'Noto Sans TC', serif;
    font-size: clamp(1.05rem, 1.25vw, 1.5rem);
    font-weight: 700;
    color: white;
    letter-spacing: clamp(1px, 0.2vw, 3px);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
}

/* 返回按鈕不需要手勢懸停效果，透過 OK 手勢觸發 */

.payment-back-btn:active {
    transform: scale(0.95);
}

.back-progress-bar {
    display: none;
}

.back-progress-fill {
    display: none;
}

.payment-back-hint {
    margin-top: 10px;
    font-size: clamp(0.8rem, 0.8vw, 0.95rem);
    color: #666;
    text-align: center;
    font-family: 'Noto Sans TC', sans-serif;
}


/* ============================================================
   服務條款簽約覆蓋層 (AgreementOverlay)
   ============================================================ */

.agreement-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 8000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: auto;
}

.agreement-overlay.visible {
    opacity: 1;
}

.agreement-overlay.hiding {
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.agreement-container {
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 2px solid #d4af37;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.3),
                0 0 100px rgba(212, 175, 55, 0.1);
}

/* 魔法陣背景 — 固定在容器中央，不跟隨滾動 */
.agreement-magic-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 500px;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 0;
    opacity: 0; /* 初始完全透明，隨比讚手勢增加 */
    transition: opacity 0.15s linear;
}

.magic-circle-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.5))
            drop-shadow(0 0 60px rgba(212, 175, 55, 0.2));
}

.agreement-magic-circle.confirmed {
    animation: magicCirclePulse 1s ease-in-out;
}

@keyframes magicCirclePulse {
    0% { filter: brightness(1); }
    50% { filter: brightness(2); }
    100% { filter: brightness(1); }
}

/* 可滾動的條款內容 */
.agreement-scroll {
    flex: 1;
    min-height: 0; /* 修復 Flexbox 滾動：允許子元素縮小至小於內容高度 */
    overflow-y: auto;
    padding: 30px;
    position: relative;
    z-index: 1;
    /* 確保文字在魔法陣上方 */
}

.agreement-scroll::-webkit-scrollbar {
    width: 6px;
}

.agreement-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.agreement-scroll::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

.agreement-content {
    position: relative;
    z-index: 2;
}

.agreement-main-title {
    text-align: center;
    font-family: 'Cinzel', 'Noto Sans TC', serif;
    font-size: 2rem;
    color: #d4af37;
    margin: 0 0 30px 0;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.agreement-section {
    margin-bottom: 25px;
}

.agreement-section h3 {
    color: #d4af37;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 1.1rem;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.agreement-section p {
    color: #ccc;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    margin: 0 0 10px 0;
}

.agreement-section strong {
    color: #fff;
}

.agreement-section ul {
    list-style: none;
    padding-left: 20px;
    margin: 10px 0;
}

.agreement-section ul li {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.8;
    position: relative;
    padding-left: 15px;
}

.agreement-section ul li::before {
    content: '◆';
    position: absolute;
    left: 0;
    color: #d4af37;
    font-size: 0.6rem;
    top: 5px;
}

.agreement-note {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    padding: 15px;
}

.agreement-note p {
    color: #d4af37;
    font-style: italic;
    font-size: 0.9rem;
}

.agreement-spacer {
    height: 100px;
}

/* 簽約儀式提示 (底部固定) */
.agreement-ritual-hint {
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    text-align: center;
    z-index: 5;
    flex-shrink: 0;
}

.ritual-hint-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    animation: thumbBounce 2s ease-in-out infinite;
}

@keyframes thumbBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.ritual-main-hint {
    color: #d4af37;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.ritual-sub-hint {
    color: #888;
    font-size: 0.85rem;
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.ritual-progress-bar {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 8px auto;
}

.ritual-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #d4af37, #ff00de, #d4af37);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    transition: width 0.1s linear;
    border-radius: 3px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.ritual-progress-text {
    font-size: 0.9rem;
    color: #888;
    font-family: 'Noto Sans TC', sans-serif;
}

.ritual-progress-text.confirmed {
    color: #d4af37;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.agreement-confirm-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 48px;
    background: linear-gradient(135deg, #4a0072, #7b1fa2);
    color: #fff;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: 'Noto Sans TC', 'Cinzel', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
}

.agreement-confirm-btn:hover {
    background: linear-gradient(135deg, #6a0099, #9c27b0);
    border-color: #d4af37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.agreement-confirm-btn:active {
    transform: translateY(0);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}


/* ============================================================
   響應式調整 (手機端)
   ============================================================ */

@media (max-width: 768px) {
    .payment-card-list {
        gap: 14px;
    }

    .payment-card {
        width: 175px;
    }

    .payment-card .payment-card-img {
        height: 300px; /* 175 * 1.715 */
    }

    .payment-title {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }

    .payment-subtitle {
        font-size: 1rem;
    }

    .payment-credits-badge {
        top: 5px;
        right: 0;
    }

    .credits-icon {
        height: 50px;            /* 原 88px × 56% */
    }

    .credits-count {
        font-size: 1.15rem;
    }

    .payment-back-btn {
        padding: 12px 40px;
    }

    .payment-back-btn .back-text {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }

    /* 協議頁面手機適配 */
    .agreement-container {
        max-height: 90vh;
        width: 95%;
    }

    .agreement-scroll {
        padding: 20px;
    }

    .agreement-main-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .payment-card-list {
        gap: 9px;
    }

    .payment-card {
        width: 85px;
    }

    .payment-card .payment-card-img {
        height: 146px; /* 85 * 1.715 */
    }

    .payment-card-name {
        font-size: 0.5rem !important;
    }

    .payment-price {
        padding: 4px 10px;
        box-shadow: 0 -3px 6px -3px rgba(52, 152, 219, 0.4),
                    0  3px 6px -3px rgba(52, 152, 219, 0.4);
    }

    .payment-price .price-text {
        font-size: 0.75rem;
    }

    .payment-badge {
        font-size: 0.55rem;
        margin-bottom: 6px;
        letter-spacing: 1px;
    }
}

/* ============================================================
   手勢確認對話框（替代 browser confirm()）
   ============================================================ */
.gesture-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: auto;
}

.gesture-confirm-overlay.visible {
    opacity: 1;
}

.gesture-confirm-box {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 16px;
    padding: 40px 50px;
    max-width: 560px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 0 40px rgba(212, 175, 55, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.6);
}

.gesture-confirm-msg {
    font-family: 'Cinzel', 'Noto Sans TC', serif;
    font-size: 1.3rem;
    color: #e8e0d0;
    line-height: 1.6;
    margin-bottom: 30px;
}

.gesture-confirm-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.gesture-confirm-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

.gesture-confirm-hint-text {
    font-family: 'Cinzel', 'Noto Sans TC', serif;
    font-size: 1rem;
    color: #d4af37;
    letter-spacing: 1px;
}

.gesture-confirm-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.gesture-confirm-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #f0d060);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.gesture-confirm-status {
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.95rem;
    color: #888;
    letter-spacing: 1px;
}

/* Payment Waiting Overlay */
.payment-waiting-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: inherit;
}
.payment-waiting-overlay.active {
    opacity: 1;
}
.payment-waiting-content {
    text-align: center;
}
.payment-waiting-content p {
    color: #d4af37;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 1px;
    margin-top: 20px;
}
.payment-waiting-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top-color: #d4af37;
    border-radius: 50%;
    margin: 0 auto;
    animation: paymentSpin 1s linear infinite;
}
@keyframes paymentSpin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Crypto Pending Order Modal (恢復待付款提示彈窗)
   ============================================================ */

#crypto-pending-modal {
    animation: cryptoModalFadeIn 0.3s ease-out;
}

@keyframes cryptoModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.crypto-pending-modal-box {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    border: 1px solid rgba(234, 202, 70, 0.4);
    border-radius: 16px;
    padding: 40px 50px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 0 40px rgba(234, 202, 70, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.6);
    animation: cryptoModalBoxIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes cryptoModalBoxIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.crypto-pending-modal-icon {
    font-size: 2.5rem;
    color: #eaca46;
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(234, 202, 70, 0.5);
}

.crypto-pending-modal-title {
    font-family: 'Cinzel', 'Noto Sans TC', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #eaca46;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.crypto-pending-modal-info {
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.95rem;
    color: #aaa;
    line-height: 1.6;
    margin-bottom: 24px;
}

.crypto-pending-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.crypto-pending-modal-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 32px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: opacity 0.2s, transform 0.15s;
    font-family: 'Cinzel', 'Noto Sans TC', sans-serif;
    width: 100%;
    max-width: 280px;
}

.crypto-pending-modal-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.crypto-pending-modal-btn.continue {
    background: linear-gradient(135deg, #eaca46, #c9a83e);
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(234, 202, 70, 0.3);
}

.crypto-pending-modal-btn.dismiss {
    background: transparent;
    border: 1px solid #555;
    color: #888;
}

.crypto-pending-modal-btn.dismiss:hover {
    border-color: #888;
    color: #bbb;
}
