/* ============================================================
   Wtoy Gacha Product Page
   ============================================================ */
:root {
    --primary: #ffbf01;
    --primary-dark: #e09615;
    --accent: #ff4081;
    --accent-light: #ff80ab;
    --accent-rgb: 255, 64, 129;
}

.wgp-page-wrap {
    min-height: 60vh;
    padding-bottom: 100px; /* draw bar 高度預留 */
}

.wtoy-gacha-page {
    max-width: 1200px;
    margin: 0 auto 100px;
    padding: 0 16px;
    font-family: inherit;
}

/* ── Header ─────────────────────────────────────────────── */
.wgp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0 12px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 16px;
}

.wgp-product-name {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #222;
}

.wgp-header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Draw Restrictions（抽獎限制面板）──────────────────────── */

.wgp-draw-restrictions {
    flex: 0 0 auto;
    max-width: 300px;
    background: #000;
    border: 1px solid hsl(248, 40%, 32%);
    border-radius: 10px;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 2px 14px rgba(20, 10, 60, 0.28);
}

.wgp-draw-restrictions-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px 7px 12px;
    background: linear-gradient(90deg, hsl(45, 90%, 52%), hsl(38, 95%, 58%));
    font-size: 0.8rem;
    font-weight: 700;
    color: hsl(35, 80%, 18%);
    letter-spacing: 0.04em;
}

.wgp-ricon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    stroke: hsl(35, 80%, 18%);
}

.wgp-draw-restrictions-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 12px;
}

.wgp-draw-restriction-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    line-height: 1.3;
    padding: 4px 0;
}

.wgp-draw-restriction-icon-wrap {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wgp-draw-restriction-item.is-passed .wgp-draw-restriction-icon-wrap {
    background: hsla(140, 55%, 38%, 0.3);
}

.wgp-draw-restriction-item.is-failed .wgp-draw-restriction-icon-wrap {
    background: hsla(0, 65%, 50%, 0.25);
}

.wgp-cicon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    stroke: hsl(270, 60%, 80%);
}

.wgp-draw-restriction-item.is-passed .wgp-cicon {
    stroke: hsl(140, 65%, 62%);
}

.wgp-draw-restriction-item.is-failed .wgp-cicon {
    stroke: hsl(0, 80%, 75%);
}

.wgp-draw-restriction-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.wgp-draw-restriction-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: hsl(265, 40%, 78%);
    line-height: 1.3;
}

.wgp-draw-restriction-desc {
    color: hsl(45, 90%, 82%);
    font-size: 0.8rem;
    line-height: 1.3;
}

.wgp-draw-restriction-item.is-failed .wgp-draw-restriction-desc {
    color: hsl(0, 88%, 80%);
}

/* 手機版 header 內的限制面板：改用淺色調 */
.wgp-eligibility-mobile-header .wgp-draw-restrictions {
    background: #fff;
    border: 1px solid hsl(248, 30%, 88%);
    box-shadow: 0 1px 6px rgba(80, 60, 180, 0.1);
    color: hsl(248, 40%, 22%);
}

.wgp-eligibility-mobile-header .wgp-draw-restrictions-header {
    color: #fff;
}

.wgp-eligibility-mobile-header .wgp-ricon {
    stroke: #fff;
}

.wgp-eligibility-mobile-header .wgp-draw-restriction-icon-wrap {
    background: hsl(248, 30%, 92%);
}

.wgp-eligibility-mobile-header .wgp-draw-restriction-item.is-passed .wgp-draw-restriction-icon-wrap {
    background: hsl(140, 40%, 88%);
}

.wgp-eligibility-mobile-header .wgp-draw-restriction-item.is-failed .wgp-draw-restriction-icon-wrap {
    background: hsl(0, 60%, 92%);
}

.wgp-eligibility-mobile-header .wgp-cicon {
    stroke: hsl(248, 50%, 55%);
}

.wgp-eligibility-mobile-header .wgp-draw-restriction-item.is-passed .wgp-cicon {
    stroke: hsl(140, 55%, 40%);
}

.wgp-eligibility-mobile-header .wgp-draw-restriction-item.is-failed .wgp-cicon {
    stroke: hsl(0, 65%, 52%);
}

.wgp-eligibility-mobile-header .wgp-draw-restriction-name {
    color: hsl(248, 30%, 52%);
}

.wgp-eligibility-mobile-header .wgp-draw-restriction-desc {
    color: hsl(248, 40%, 22%);
}

.wgp-eligibility-mobile-header .wgp-draw-restriction-item.is-failed .wgp-draw-restriction-desc {
    color: hsl(0, 60%, 45%);
}

/* draw actions 容器：維持原本的 flex 橫排 */
.wgp-draw-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* 一般模式有限制時：保留原本 inner 內 space-between 佈局（restrictions 仍在 inner 內） */
.wgp-draw-bar.has-restrictions .wgp-draw-bar-inner {
    justify-content: space-between;
    max-width: 1100px;
    align-items: center;
}
/* 限定模式有限制時：restrictions 面板移出 inner 並排，inner 約 50% 寬 */
.wgp-draw-bar--limited.has-restrictions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.wgp-draw-bar--limited.has-restrictions .wgp-draw-bar-inner {
    flex: 1;
    margin: 0;
    justify-content: flex-start;
    align-items: stretch;
    max-width: 1040px;
}
/* 手機版：限定有 restrictions 時 bar 還原 block，inner 全寬 */
@media (max-width: 768px) {
    .wgp-draw-bar--limited.has-restrictions {
        display: block;
    }
    .wgp-draw-bar--limited.has-restrictions .wgp-draw-bar-inner {
        max-width: none;
        margin: 0 auto;
    }
}

/* draw bar 不符合資格時：隱藏按鈕、限制面板置中 */
.wgp-draw-bar.is-ineligible .wgp-draw-actions {
    display: none;
}

.wgp-draw-bar.is-ineligible .wgp-draw-bar-inner {
    justify-content: center;
}

/* 手機版：wgp-draw-restrictions 預設隱藏（在 page body 的 eligible 版負責顯示） */
@media (max-width: 768px) {
    .wgp-draw-restrictions {
        display: none;
        max-width: 100%;
    }

    /* 不符合資格時：在 draw bar 顯示限制面板，隱藏按鈕 */
    .wgp-draw-bar.is-ineligible .wgp-draw-restrictions {
        display: block;
    }

    /* 手機 header 下方的資格面板（符合資格時）仍要顯示 */
    .wgp-eligibility-mobile-header .wgp-draw-restrictions {
        display: block;
        max-width: 100%;
    }

    .wgp-draw-bar.is-ineligible .wgp-draw-actions {
        display: none;
    }
}

/* 手機版資格說明（符合資格時，顯示在 header 下方） */
.wgp-eligibility-mobile-header {
    display: none;
}

@media (max-width: 768px) {
    .wgp-eligibility-mobile-header {
        display: block;
        margin: 10px 0 14px;
    }

    /* 手機版 draw bar 中的限制面板 padding 收緊 */
    .wgp-draw-bar.is-ineligible .wgp-draw-restrictions {
        padding: 0;
    }

    /* 手機版 draw actions gap 收窄 */
    .wgp-draw-actions {
        gap: 6px;
    }
}

.wgp-price-badge {
    background: var(--accent);
    color: #fff;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.wgp-price-badge strong {
    font-size: 1.1em;
}

.wgp-draw-count-badge {
    background: #f0f0f0;
    color: #555;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.wgp-draw-count-badge strong {
    font-size: 1.1em;
    color: #333;
}

/* ── Boss Banner ─────────────────────────────────────────── */
.wgp-boss-banner {
    position: relative;
    background: linear-gradient(135deg, #e53935, #b71c1c);
    border-radius: 12px;
    padding: 14px 20px 12px;
    color: #fff;
    margin-bottom: 20px;
    overflow: hidden;
}

.wgp-boss-watermark {
    position: absolute;
    right: 140px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 4.5rem;
    font-weight: 900;
    color: #fff;
    opacity: 0.12;
    pointer-events: none;
    white-space: nowrap;
    letter-spacing: 6px;
}

/* 主內容：左右對齊 */
.wgp-boss-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* 左側：圓形圖標 + 文字 */
.wgp-boss-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wgp-boss-crown-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wgp-boss-crown {
    font-size: 1.8rem;
    line-height: 1;
}

.wgp-boss-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wgp-boss-title {
    font-size: 1.125rem;
    opacity: 0.9;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: var(--primary);
}

.wgp-boss-rate-badge {
    display: inline-block;
    background: var(--primary);
    color: #b71c1c;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    vertical-align: middle;
    letter-spacing: 0;
}

.wgp-boss-name {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

/* 右側：累積收益 */
.wgp-boss-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.wgp-boss-revenue-label {
    font-size: 0.72rem;
    opacity: 0.85;
}

.wgp-boss-revenue-amount {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1.1;
}

/* Hint 文字 */
.wgp-boss-hint {
    color: var(--primary);
    opacity: 0.9;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px;
    text-align: left;
    background-color: rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 8px 0 0 0;
    border-radius: 4px;
}

.wgp-boss-hint strong {
    color: var(--primary);
}

/* ── Main Layout ─────────────────────────────────────────── */
.wgp-main {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
}

.wgp-left {
    grid-column: 1;
    min-width: 0;
}

.wgp-right-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── 手機版抽屜：桌面隱藏 ─────────────────────────────── */
.wgp-drawer-toggle,
.wgp-drawer-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .wgp-main {
        grid-template-columns: 1fr;
    }

    .wgp-left,
    .wgp-right-col {
        grid-column: 1;
        grid-row: auto;
    }

    /* 右欄改為固定抽屜 */
    .wgp-right {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 85vw;
        max-width: 380px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 10001;
        overflow-y: auto;
        background: #f5f5f5;
        padding: 16px;
        box-sizing: border-box;
        flex: none;
    }

    .wgp-right.wgp-drawer-open {
        transform: translateX(0);
    }

    /* 觸發鈕：固定右側邊緣半圓形 */
    .wgp-drawer-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 56px;
        border: none;
        border-radius: 28px 0 0 28px;
        background: var(--accent);
        color: #fff;
        font-size: 1.2rem;
        cursor: pointer;
        z-index: 10001;
        box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.15);
        transition: background 0.2s, right 0.3s ease;
        padding: 0;
    }

    .wgp-drawer-toggle.active {
        right: min(85vw, 380px);
    }

    .wgp-drawer-toggle:hover {
        background: var(--accent-light);
    }

    /* 遮罩 */
    .wgp-drawer-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 10000;
    }

    .wgp-drawer-backdrop.active {
        display: block;
    }
}

/* ── Section Title ───────────────────────────────────────── */
.wgp-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px;
    padding-left: 10px;
    border-left: 4px solid var(--accent);
}

/* ── Prize List ──────────────────────────────────────────── */
.wgp-prize-list {
    background: #fafafa;
    border-radius: 10px;
    padding: 16px;
}

.wgp-rarity-section {
    margin-bottom: 16px;
}

.wgp-rarity-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    user-select: none;
    margin-bottom: 10px;
}

.wgp-rarity-label {
    font-weight: 700;
    font-size: 1rem;
    font-style: italic;
    flex: 1;
}

.wgp-rarity-prob {
    font-size: 0.85rem;
    color: #888;
}

.wgp-arrow {
    font-size: 0.7rem;
    color: #aaa;
    transition: transform 0.2s;
    display: inline-block;
}

.wgp-arrow.open {
    transform: rotate(180deg);
}

.wgp-prize-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.wtoy-gacha-page--limited .wgp-prize-grid {
    gap: 6px;
}

@media (max-width: 600px) {
    .wgp-prize-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.wgp-prize-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 4px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.wgp-prize-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wgp-prize-img-wrap {
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wgp-prize-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.wgp-prize-no-img {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eee, #ddd);
}

.wgp-prize-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.wgp-prize-name {
    font-size: 0.86rem;
    font-weight: bold;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wgp-prize-prob {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.65rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 600;
    line-height: 1.4;
    pointer-events: none;
}

.wgp-prize-points {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: bold;
}

.wgp-prize-boss {
    font-size: 0.8rem;
    color: var(--primary);
    text-align: center;
    font-weight: bold;
}

/* ── Doll Panel ──────────────────────────────────────────── */

/* 共用卡片樣式 */
.wgp-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* 外層容器：兩個卡片垂直排列，中間有間距 */
.wgp-doll-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* stage：3欄 flex 橫向佈局 */
.wgp-doll-stage {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 12px;
}

/* 左右部位欄 */
.wgp-slot-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 64px;
    flex-shrink: 0;
}

/* 中央角色欄 */
.wgp-doll-center {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wgp-doll-boss-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 6px;
    white-space: nowrap;
}

/* 裝備槽格 */
.wgp-slot-cell {
    aspect-ratio: 1;
    height: 64px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
    background: #fafafa;
}

.wgp-slot-cell:hover {
    border-color: var(--primary);
}

.wgp-slot-cell.equipped {
    border-style: solid;
}

.wgp-slot-cell.wgp-rarity-1 { border-color: #c0c0c0; }
.wgp-slot-cell.wgp-rarity-2 { border-color: #ffd700; }
.wgp-slot-cell.wgp-rarity-3 { border-color: #b9f2ff; }
.wgp-slot-cell.wgp-rarity-4 { border-color: #1a1a2e; }

/* 裝備槽內 badge：overflow:hidden 故改為內縮定位 */
.wgp-slot-cell .wgp-inv-rate-badge {
    top: -4px;
    left: -4px;
    font-size: 0.6rem;
    padding: 1px 4px;
}

/* 裝備槽縮圖：正方形 letterbox */
.wgp-slot-cell img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}

.wgp-slot-label {
    font-size: 0.65rem;
    color: #aaa;
    text-align: center;
    padding: 4px;
}

/* 角色立繪 */
.wgp-doll-character {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.wgp-char-base {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 0;
}

.wgp-char-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eee 0%, #ddd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wgp-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.wgp-char-name {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* ── 背包 ────────────────────────────────────────────────── */
.wgp-backpack {
    /* 獨立卡片，透過 wgp-card 提供背景/陰影 */
}

.wgp-backpack-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.wgp-backpack-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #333;
}

.wgp-inv-count {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.75rem;
    margin-left: 4px;
}

.wgp-coupon-count {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

.wgp-coupon-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
}

.wgp-coupon-num {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
}

.wgp-backpack-toggle {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: #aaa;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s;
}

.wgp-backpack-toggle:hover {
    color: var(--accent);
}

.wgp-inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 16px 16px;
    max-height: 360px;
    overflow-y: auto;
}

/* ── 道具卡片 ─────────────────────────────────────────────── */
.wgp-inventory-item {
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.wgp-inventory-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

/* 圖片區：強制正方形（padding-top hack 確保 grid 內生效） */
.wgp-inv-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 65%; /* 略扁矩形 */
    z-index: 1;
}

/* 圖片：有 padding，不貼邊，letterbox */
.wgp-inv-img-wrap img {
    position: absolute;
    inset: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    object-fit: contain;
}

/* 無圖佔位：填滿整個區域 */
.wgp-inv-no-img {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #eee, #ddd);
}

/* 收益率徽章（左上角浮層） */
.wgp-inv-rate-badge {
    background: var(--primary);
    color: white;
    position: absolute;
    top: -6px;
    left: -6px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1.3;
    z-index: 2;
    pointer-events: none;
}

/* 穿戴中效果 */
.wgp-inventory-item.equipped {
    border-color: var(--primary);
    background: rgb(255, 251, 235);
    opacity: .8;
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.wgp-inv-equipped-label {
    font-size: 0.8rem;
    color: rgb(217, 119, 6);
    font-weight: 600;
    display: block;
}

/* 文字區 */
.wgp-inv-info {
    padding: 4px 6px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.wgp-inv-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    width: 100%;
}

.wgp-inv-slot {
    font-size: 0.65rem;
    color: #aaa;
    display: block;
}

.wgp-outfit-status {
    font-size: 0.8rem;
    color: #aaa;
    text-align: center;
    margin: 4px 0 0;
}

.wgp-login-notice {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.wgp-login-notice a {
    color: var(--accent);
    text-decoration: underline;
}

/* ── Draw Bar ────────────────────────────────────────────── */
.wgp-draw-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
    backdrop-filter: blur(6px);
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    padding: 10px 16px 14px;
}

.wgp-draw-bar-inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.wgp-draw-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(var(--accent-rgb), 0.4);
    font-size: 0.75rem;
    line-height: 1.2;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    font-weight: 600;
    padding: 0;
}

.wgp-draw-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.5);
}

.wgp-draw-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.wgp-draw-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wgp-btn-icon {
    font-size: 1rem;
    display: block;
}

.wgp-btn-draws {
    font-size: 0.82rem;
    font-weight: 700;
}

.wgp-btn-cost {
    font-size: 0.65rem;
    opacity: 0.9;
}

.wgp-draw-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
}

.wgp-qty-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wgp-qty-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    height: 44px;
}

.wgp-qty-btn {
    width: 32px;
    height: 100%;
    border: none;
    background: #f5f5f5;
    color: #555;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
    line-height: 1;
    user-select: none;
}

.wgp-qty-btn:hover:not(:disabled) {
    background: #e8e8e8;
}

.wgp-qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wgp-draw-qty {
    width: 40px;
    height: 100%;
    border: none;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    padding: 0;
    appearance: textfield;
}

.wgp-draw-qty::-webkit-inner-spin-button,
.wgp-draw-qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wgp-custom-cost-badge {
    display: flex;
    align-items: baseline;
    gap: 2px;
    background: linear-gradient(135deg, #fff0f3, #ffe0e6);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    border-radius: 8px;
    padding: 6px 10px;
    min-width: 48px;
    justify-content: center;
    white-space: nowrap;
}

.wgp-custom-cost-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.wgp-custom-cost-unit {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    opacity: 0.8;
    line-height: 1;
}

.wgp-draw-custom-btn {
    height: 44px;
    padding: 0 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(var(--accent-rgb), 0.35);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.wgp-draw-custom-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(var(--accent-rgb), 0.45);
}

.wgp-draw-custom-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .wgp-draw-btn {
        width: 56px;
        height: 56px;
        font-size: 0.68rem;
    }

    .wgp-btn-icon { font-size: 0.85rem; }

    .wgp-draw-custom {
        margin-left: 2px;
        gap: 4px;
    }

    .wgp-qty-group {
        flex-direction: column-reverse;
        gap: 3px;
    }

    .wgp-qty-wrap {
        height: 36px;
    }

    .wgp-qty-btn {
        width: 28px;
        font-size: 0.95rem;
    }

    .wgp-draw-qty {
        width: 34px;
        font-size: 0.85rem;
    }

    .wgp-custom-cost-badge {
        padding: 3px 8px;
        font-size: 0.8rem;
    }

    .wgp-custom-cost-value {
        font-size: 0.9rem;
    }

    .wgp-draw-custom-btn {
        height: 56px;
        padding: 0 12px;
        font-size: 0.85rem;
    }

    .wgp-draw-bar {
        padding: 6px 8px 10px;
    }

    .wgp-draw-bar-inner {
        gap: 6px;
    }
}

/* ── Loading 遮罩 ──────────────────────────────────────────── */
.wgp-loading-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 10001;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px;
}

.wgp-loading-spinner {
    width: 48px; height: 48px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: wgp-spin 0.7s linear infinite;
}

@keyframes wgp-spin {
    to { transform: rotate(360deg); }
}

.wgp-loading-text {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 1px;
}

/* ── 抽獎結果 Modal ────────────────────────────────────────── */
.wgp-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

.wgp-modal--result {
    background: #fff;
    border-radius: 20px;
    width: 100%; max-width: 400px;
    max-height: 88vh;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.35);
}

/* Header */
.wgp-modal-header {
    background: linear-gradient(160deg, var(--accent-light), var(--accent));
    padding: 20px 16px 18px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}
.wgp-modal-x {
    position: absolute; top: 12px; right: 14px;
    background: rgba(255,255,255,0.25);
    border: none; border-radius: 50%;
    width: 28px; height: 28px;
    color: #fff; font-size: 0.9rem;
    cursor: pointer; line-height: 1;
}
.wgp-modal-hero { font-size: 2rem; margin-bottom: 4px; }
.wgp-modal-title {
    margin: 0;
    font-size: 1.1rem; font-weight: 700; color: #fff;
}

/* Item list */
.wgp-result-list {
    flex: 1; overflow-y: auto;
    padding: 8px 12px;
    max-height: 320px;
}
.wgp-result-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    margin: 6px 0;
    border-radius: 4px;
}
.wgp-result-row:last-child { border-bottom: none; }
.wgp-result-row-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
    overflow: hidden;
}
.wgp-result-row-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.wgp-result-row-name {
    font-size: 0.9rem; font-weight: 600; color: #1a1a1a;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wgp-result-row-rarity { font-size: 0.75rem; color: #888; }
.wgp-result-row-pts {
    font-size: 0.9rem; font-weight: 700;
    color: var(--primary); white-space: nowrap; flex-shrink: 0;
}

/* Footer */
.wgp-modal-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.wgp-modal-total {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
    font-size: 0.9rem; color: #555;
}
.wgp-modal-total-pts {
    font-size: 1.1rem; font-weight: 700; color: var(--primary);
}
.wgp-modal-close {
    display: block; width: 100%;
    padding: 13px;
    text-align: center;
    background: var(--primary);
    color: #fff; border: none; border-radius: 12px;
    font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: background 0.15s;
}
.wgp-modal-close:hover { background: var(--primary-dark); }

/* ── 角色選擇 ── */
.wgp-char-select {
    width: 100%;
    max-width: 800px;
    margin: 60px auto;
    text-align: center;
    padding: 0 16px;
    box-sizing: border-box;
}

.wgp-char-select__title {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.wgp-char-select__desc {
    color: #666;
    margin-bottom: 32px;
}

.wgp-char-select__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.wgp-char-card {
    border: 3px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .2s, transform .2s;
    overflow: hidden;
    background: #f5f5f5;
}

.wgp-char-card:hover {
    border-color: #aaa;
    transform: translateY(-4px);
}

.wgp-char-card--selected {
    border-color: #7c4dff;
}

.wgp-char-card__img-wrap {
    aspect-ratio: 3/4;
    overflow: hidden;
}

.wgp-char-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wgp-char-card__no-img {
    width: 100%;
    height: 100%;
    background: #ddd;
}

.wgp-char-card__name {
    display: block;
    padding: 8px 4px;
    font-weight: 600;
}

/* ── 中獎名單 ───────────────────────────────────── */
.wgp-winners-list {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

.wgp-winners-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 8px;
    border-bottom: none;
}
.wgp-winners-trophy { color: #f59e0b; flex-shrink: 0; }
.wgp-winners-title { font-size: 16px; font-weight: 700; color: #1d2327; }
.wgp-winners-legend {
    margin-left: auto;
    font-size: 10px;
    color: #737373;
    white-space: nowrap;
}

.wgp-winners-pinned {
    padding: 2px 0 4px;
}
.wgp-winners-pinned .wgp-winner-row {
    box-shadow: 0 0 0 1.5px rgba(147, 51, 234, 0.35);
}

.wgp-winners-body {
    max-height: 320px;
    overflow-y: auto;
    padding: 2px 0;
}

.wgp-winner-row {
    --winner-bg: #f8fafc;
    --winner-avatar-grad: linear-gradient(135deg, #cbd5e1, #94a3b8);
    --winner-badge-bg: #f1f5f9;
    --winner-badge-color: #475569;

    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    margin: 4px 0;
    background: var(--winner-bg);
}
.wgp-winner-row[data-rarity="4"] {
    --winner-bg: #faf5ff;
    --winner-avatar-grad: linear-gradient(135deg, #312e81, #581c87, #1e1b4b);
    --winner-badge-bg: #ede9fe;
    --winner-badge-color: #7c3aed;
}
.wgp-winner-row[data-rarity="3"] {
    --winner-bg: #f0f9ff;
    --winner-avatar-grad: linear-gradient(135deg, #7dd3fc, #38bdf8);
    --winner-badge-bg: #cffafe;
    --winner-badge-color: #0891b2;
}
.wgp-winner-row[data-rarity="2"] {
    --winner-bg: #fffbeb;
    --winner-avatar-grad: linear-gradient(135deg, #fcd34d, #f59e0b);
    --winner-badge-bg: #fef3c7;
    --winner-badge-color: #b45309;
}
.wgp-winner-row[data-rarity="1"] {
    --winner-bg: #f8fafc;
    --winner-avatar-grad: linear-gradient(135deg, #cbd5e1, #94a3b8);
    --winner-badge-bg: #f1f5f9;
    --winner-badge-color: #475569;
}

.wgp-winner-avatar {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: var(--winner-avatar-grad);
    overflow: hidden;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1;
}

.wgp-winner-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wgp-winner-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.wgp-winner-sparkle { color: #f59e0b; flex-shrink: 0; }
.wgp-winner-prize {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.wgp-winner-rarity-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--winner-badge-bg);
    color: var(--winner-badge-color);
    white-space: nowrap;
    flex-shrink: 0;
}
.wgp-winner-rarity-badge[data-rarity="4"] { background: #ede9fe; color: #7c3aed; }
.wgp-winner-rarity-badge[data-rarity="3"] { background: #cffafe; color: #0891b2; }
.wgp-winner-rarity-badge[data-rarity="2"] { background: #fef3c7; color: #b45309; }
.wgp-winner-rarity-badge[data-rarity="1"] { background: #f1f5f9; color: #475569; }

/* ============================================================
   衣櫃頁（My Account / doll-wardrobe）
   ============================================================ */
.wtoy-wardrobe-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

.wtoy-wardrobe-wrap .wtoy-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 20px;
}

/* ── 區塊 A：紙娃娃展示（限制尺寸） ──── */
.wtoy-wardrobe-doll-section {
    max-width: 420px;
    margin: 0 auto 28px;
}

.wtoy-wardrobe-doll-section .wgp-doll-stage {
    padding: 10px 8px;
}

.wtoy-wardrobe-doll-section .wgp-doll-character {
    max-height: 320px;
    aspect-ratio: 3/4;
}

.wtoy-wardrobe-doll-section .wgp-boss-hint {
    font-size: 0.72rem;
}

/* ── 篩選列 ──── */
.wtoy-filter-name {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #333;
    background: #fff;
    margin-bottom: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.wtoy-filter-name::placeholder { color: #bbb; }
.wtoy-filter-name:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.wtoy-wardrobe-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.wtoy-wardrobe-filters select {
    flex: 1 1 0;
    min-width: 100px;
    padding: 8px 28px 8px 12px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #444;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%23999'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") right 10px center / 10px no-repeat;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.wtoy-wardrobe-filters select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.wgp-filter-toggle-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}
.wgp-filter-toggle-btn:hover {
    background: #f5f5f5;
}
.wgp-filter-toggle-btn.active {
    background: var(--accent, #ff4081);
    border-color: var(--accent, #ff4081);
    color: #fff;
}

.wgp-backpack-filters {
    padding: 10px 16px 0;
}

/* ── 稀有度邊框 ──── */
.wgp-rarity-1 { border-color: #c0c0c0; }  /* 白銀 */
.wgp-rarity-2 { border-color: #ffd700; }  /* 黃金 */
.wgp-rarity-3 { border-color: #b9f2ff; }  /* 鑽石 */
.wgp-rarity-4 { border-color: #1a1a2e; }  /* 黑鑽 */

/* ── 區塊 B：所有裝備 ──── */
.wtoy-wardrobe-inventory-section {
    margin-bottom: 32px;
}

.wtoy-wardrobe-inventory-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px;
    padding-left: 10px;
    border-left: 4px solid var(--accent, #ff4081);
}

/* 衣櫃頁用更多欄 + 固定高度捲動 */
.wtoy-wardrobe-inventory-section .wgp-inventory-grid {
    grid-template-columns: repeat(6, 1fr);
    max-height: 480px;
    overflow-y: auto;
    gap: 10px;
    padding: 0;
}

@media (max-width: 768px) {
    .wtoy-wardrobe-inventory-section .wgp-inventory-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 衣櫃裝備卡：退點 badge */
.wgp-inv-return-badge {
    display: block;
    font-size: 0.7rem;
    color: var(--primary-dark, #e09615);
    font-weight: 600;
    margin-top: 2px;
}

.wgp-inv-return-link {
    color: var(--accent, #ff4081);
    text-decoration: underline;
    font-size: 0.68rem;
    margin-left: 4px;
    cursor: pointer;
}

.wgp-inv-return-link:hover {
    color: #c51162;
}

/* ── 區塊 C：虛擬獎品退點 ──── */
.wtoy-virtual-return-section {
    margin-bottom: 32px;
}

.wtoy-virtual-return-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px;
    padding-left: 10px;
    border-left: 4px solid var(--accent, #ff4081);
}

.wtoy-virtual-return-section .wtoy-hint {
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 16px;
}

.wtoy-virtual-return-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.wtoy-virtual-return-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 12px 16px;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.wtoy-virtual-return-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wtoy-virtual-return-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: #f5f5f5;
    flex-shrink: 0;
}

.wtoy-virtual-return-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wtoy-virtual-return-info strong {
    font-size: 0.9rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wtoy-virtual-return-source {
    font-size: 0.75rem;
    color: #aaa;
}

.wtoy-virtual-return-points {
    font-size: 0.82rem;
    color: var(--primary-dark, #e09615);
    font-weight: 600;
}

.wtoy-virtual-return-item .wtoy-btn {
    flex-shrink: 0;
    font-size: 0.8rem;
    padding: 8px 14px;
}

/* ── 獎項卡片可點擊 ──────────────────────────────────────── */
.wgp-prize-clickable {
    cursor: pointer;
}

/* ── 獎項詳情彈窗 ────────────────────────────────────────── */
.wgp-prize-detail-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

.wgp-prize-detail-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%; max-width: 400px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(0,0,0,0.3);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 關閉按鈕 */
.wgp-detail-close {
    position: absolute; top: 12px; right: 14px;
    background: none;
    border: none;
    width: 32px; height: 32px;
    color: #999; font-size: 1.4rem;
    cursor: pointer; line-height: 1;
    transition: color 0.15s;
    z-index: 1;
}
.wgp-detail-close:hover { color: #555; }

/* Hero 區：淺灰背景 + 置中內容 */
.wgp-detail-hero {
    background: #f7f7f7;
    border-radius: 20px 20px 0 0;
    padding: 32px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.wgp-detail-img-wrap {
    width: 140px; height: 140px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.8);
    border-radius: 16px;
    margin-bottom: 14px;
    padding: 10px;
}
.wgp-detail-img-wrap img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
}
.wgp-detail-no-img {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #eee, #ddd);
    border-radius: 12px;
}

.wgp-detail-badge {
    display: inline-block;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.wgp-detail-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
    margin-bottom: 6px;
}

.wgp-detail-hero-pts {
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 2px;
}

.wgp-detail-hero-boss {
    font-size: 0.82rem;
    font-weight: bold;
    color: var(--primary);
}

/* Body 區 */
.wgp-detail-body {
    padding: 16px 20px 0;
}

/* 商品介紹 */
.wgp-detail-desc {
    padding: 0;
    background: none;
    border-radius: 0;
    margin-bottom: 12px;
}
.wgp-detail-desc-title {
    font-size: 0.88rem;
    font-weight: bold;
    color: #000;
    margin-bottom: 8px;
}
.wgp-detail-desc-body {
    font-size: 0.88rem;
    color: #000;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* 中獎機率 */
.wgp-detail-prob {
    padding: 12px 0 0;
    background: none;
    border-radius: 0;
    border-top: 1px solid #f0f0f0;
    margin-bottom: 4px;
}
.wgp-detail-prob-title {
    font-size: 0.88rem;
    font-weight: bold;
    color: #000;
    margin-bottom: 10px;
}
.wgp-detail-prob-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    font-size: 0.85rem;
    color: #000;
}
.wgp-detail-prob-text {
    font-size: 0.85rem;
    color: #000;
    padding: 3px 0;
    line-height: 1.5;
}
.wgp-detail-prob-val {
    font-weight: bold;
    color: var(--primary);
}
.wgp-detail-prob-highlight {
    font-weight: bold;
    color: var(--primary);
    font-size: 0.92rem;
    margin-top: 6px;
    padding-top: 8px;
}

/* 出貨時間 */
.wgp-detail-shipping {
    padding: 12px 0 0;
    background: none;
    border-radius: 0;
    border-top: 1px solid #f0f0f0;
    margin-bottom: 12px;
}
.wgp-detail-shipping-title {
    font-size: 0.88rem;
    font-weight: bold;
    color: #000;
    margin-bottom: 8px;
}
.wgp-detail-shipping-text {
    font-size: 0.85rem;
    color: #000;
    line-height: 1.5;
}

/* 返回按鈕 */
.wgp-detail-back {
    display: block;
    width: calc(100% - 40px);
    margin: 16px 20px 20px;
    padding: 13px;
    text-align: center;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.wgp-detail-back:hover { background: #e4e4e4; }

/* ── 退回模式 ───────────────────────────────────────────── */

/* 背包 header actions */
.wgp-backpack-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wgp-wardrobe-inv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.wgp-wardrobe-inv-header h3 {
    margin-bottom: 0;
}

.wgp-return-mode-btn {
    background: #f0f0f0;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.wgp-return-mode-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.wgp-return-mode-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.wgp-return-all-btn {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border: 1.5px solid #ffb74d;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #e65100;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.wgp-return-all-btn:hover {
    background: linear-gradient(135deg, #ffe0b2, #ffcc80);
    border-color: #ff9800;
}

/* 退回模式下的 checkbox overlay */
.wgp-return-mode .wgp-inventory-item::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background: #fff;
    z-index: 10;
    transition: all 0.15s;
}

.wgp-return-mode .wgp-inventory-item {
    position: relative;
}

.wgp-return-mode .wgp-inventory-item.wgp-return-checked::before {
    background: var(--accent);
    border-color: var(--accent);
}

.wgp-return-mode .wgp-inventory-item.wgp-return-checked::after {
    content: '✓';
    position: absolute;
    top: 7px;
    left: 10px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 11;
    pointer-events: none;
}

/* 已穿戴卡片在退回模式中顯示 disabled 效果 */
.wgp-return-mode .wgp-inventory-item.equipped {
    opacity: 0.45;
    pointer-events: auto;
    cursor: not-allowed;
}

.wgp-return-mode .wgp-inventory-item.equipped::before {
    border-color: #e0e0e0;
    background: #e0e0e0;
}

/* 批次操作列（固定底部浮動） */
.wgp-batch-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(to top, rgba(255,255,255,0.98), rgba(255,255,255,0.92));
    backdrop-filter: blur(6px);
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.wgp-batch-info {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.wgp-batch-return-btn {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(var(--accent-rgb), 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.wgp-batch-return-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(var(--accent-rgb), 0.45);
}

/* 單個退回按鈕（退回模式下每張卡片） */
.wgp-single-return-btn {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.wgp-single-return-btn:hover:not(:disabled) {
    background: rgba(var(--accent-rgb), 0.18);
    border-color: var(--accent);
}

.wgp-single-return-btn:disabled {
    color: #bbb;
    background: #f5f5f5;
    border-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ── 瞬殺模式（Limited Mode） ─────────────────────────────────── */
/*
 * 設計參考：https://prize-wonderland-gacha.lovable.app/limited
 * 主色：暖黃／琥珀色系（#f5a623 / #f7c44d / #fff8e1）
 */
.wtoy-gacha-page--limited {
    --primary:       #f5a623;
    --primary-rgb:   245, 166, 35;
    --accent:        #f5a623;
    --accent-rgb:    245, 166, 35;
    --accent-light:  #ffd166;
}

/* 整頁淡黃色暈染背景，提升 limited 模式氛圍 */
.wtoy-gacha-page--limited {
    position: relative;
}
.wtoy-gacha-page--limited::before {
    content: "";
    position: absolute;
    inset: -40px -16px auto;
    height: 320px;
    background: linear-gradient(180deg, #fff7d6 0%, rgba(255, 247, 214, 0) 100%);
    z-index: -1;
    pointer-events: none;
}

.wtoy-gacha-page--limited .wgp-main {
    grid-template-columns: 1fr;
}

/* ── 頂部 Header ───────────────────────────────────────────── */
.wgp-limited-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 24px;
    align-items: center;
    padding: 10px 18px;
    margin: 0 0 12px;
    background: linear-gradient(135deg, #fff3c4 0%, #ffe7a0 100%);
    border: 1px solid #f5d27a;
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(245, 166, 35, 0.10);
}

.wgp-limited-title { grid-column: 1; grid-row: 1; }

.wgp-limited-name {
    display: inline-block;
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
    color: #b8860b;
    letter-spacing: 2px;
}

.wgp-limited-crown {
    font-size: 18px;
    margin-right: 6px;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.05));
}

.wgp-limited-sub {
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
    color: #8a6d3b;
    letter-spacing: 1px;
}

.wgp-limited-delisting {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    line-height: 16px;
    background: linear-gradient(to right, #fef3c7, #fefce8, #fef3c7);
    border: 1px solid #fcd34d;
    border-radius: 9999px;
    color: #b45309;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.wgp-limited-delisting.is-expired {
    background: #ffebee;
    border-color: #d63638;
    color: #d63638;
    font-weight: 700;
}
.wgp-delisting-icon { color: #b45309; flex: 0 0 14px; }
.wgp-delisting-label    { font-weight: 700; }
.wgp-delisting-date     { color: #b45309; font-weight: 700; }
.wgp-delisting-countdown {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color: #d63638;
    font-weight: 700;
}

.wgp-limited-quota {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px dashed #e8bf64;
}
.wgp-quota-label   { font-size: 12px; color: #8a6d3b; }
.wgp-quota-numbers { font-size: 22px; font-weight: 800; color: #b8860b; }
.wgp-quota-remaining { color: #d63638; }
.wgp-quota-divider   { margin: 0 6px; color: #c5c5c5; font-weight: 400; }
.wgp-quota-total     { color: #b8860b; opacity: 0.6; font-weight: 700; }

/* ── 獎項列表：無外框，純背景，稀有度標題左側彩色直條 ────── */
.wtoy-gacha-page--limited .wgp-prize-list {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}
.wtoy-gacha-page--limited .wgp-section-title { display: none; }
.wtoy-gacha-page--limited .wgp-rarity-section {
    border: none;
    background: transparent;
    margin-bottom: 18px;
    padding: 0;
}
.wtoy-gacha-page--limited .wgp-rarity-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    margin-bottom: 10px;
    cursor: default;
}
.wtoy-gacha-page--limited .wgp-rarity-header::before {
    content: "";
    display: inline-block;
    flex: 0 0 6px;
    width: 6px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--rarity-c1, #d4d4d8), var(--rarity-c2, #a1a1aa), var(--rarity-c3, #71717a));
}
.wtoy-gacha-page--limited .wgp-rarity-label {
    flex: 0 0 auto;
    font-size: 18px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 1px;
    color: var(--rarity-text, #71717a) !important;
}
.wtoy-gacha-page--limited .wgp-rarity-section[data-rarity="4"] {
    --rarity-c1: #27272a; --rarity-c2: #581c87; --rarity-c3: #18181b;
    --rarity-text: #9333ea;
}
.wtoy-gacha-page--limited .wgp-rarity-section[data-rarity="3"] {
    --rarity-c1: #a5f3fc; --rarity-c2: #7dd3fc; --rarity-c3: #60a5fa;
    --rarity-text: #3b82f6;
}
.wtoy-gacha-page--limited .wgp-rarity-section[data-rarity="2"] {
    --rarity-c1: #fde68a; --rarity-c2: #facc15; --rarity-c3: #f59e0b;
    --rarity-text: #f59e0b;
}
.wtoy-gacha-page--limited .wgp-rarity-section[data-rarity="1"] {
    --rarity-c1: #e2e8f0; --rarity-c2: #d4d4d8; --rarity-c3: #94a3b8;
    --rarity-text: #64748b;
}
.wgp-rarity-count {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 600;
}
/* 該稀有度沒任何獎項時顯示「尚未上架」 */
.wgp-rarity-section:has(.wgp-prize-grid:empty)::after {
    content: "尚未上架";
    display: block;
    margin: -4px 0 0 16px;
    font-size: 13px;
    color: #9ca3af;
}
.wtoy-gacha-page--limited .wgp-arrow { display: none; }

/* ── 底部抽獎列：白色卡片 + 黃色矩形按鈕 ───────────────────── */
/* 注意：draw-bar 是 fixed 定位在 page wrapper 外，需重新宣告變數 */
.wgp-draw-bar--limited {
    --primary:      #f5a623;
    --primary-rgb:  245, 166, 35;
    --accent:       #f5a623;
    --accent-rgb:   245, 166, 35;
    --accent-light: #ffd166;
}
.wgp-draw-bar--limited {
    background: linear-gradient(to top, #fff 92%, rgba(255,255,255,0.92));
    border-top: 1px solid #f0e6c4;
}
.wgp-draw-bar--limited .wgp-draw-bar-inner {
    max-width: 1040px;
    background: linear-gradient(135deg, #fefce8 0%, #fff 50%, #fffbeb 100%);
    border: 2px solid rgba(252, 211, 77, 0.3);
    border-radius: 10px;
    padding: 6px 14px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.10), 0 4px 6px -2px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 5px;
}

/* 抽獎列：頂部 summary 區（價格 + 剩餘/總量） */
.wgp-draw-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
}
.wgp-draw-summary-price {
    display: flex;
    align-items: baseline;
    gap: 3px;
}
.wgp-draw-summary-price-num {
    font-size: 15px;
    font-weight: 900;
    font-style: italic;
    line-height: 1;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #f59e0b, #eab308, #d97706);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.wgp-draw-summary-price-unit {
    font-size: 10px;
    color: #d97706;
    font-weight: 700;
}
.wgp-draw-summary-quota {
    text-align: right;
}
.wgp-draw-summary-label {
    font-size: 10px;
    color: #8a6d3b;
    margin-bottom: 1px;
}
.wgp-draw-summary-numbers {
    font-size: 15px;
    font-weight: 800;
    color: #1d2327;
    line-height: 1;
}
.wgp-draw-summary-remaining { color: #1d2327; }
.wgp-draw-summary-divider {
    color: #c5c5c5;
    margin: 0 3px;
    font-weight: 500;
}
.wgp-draw-summary-total {
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
}
.wgp-draw-summary-divider-line {
    align-self: stretch;
    height: 3px;
    background: #f0f0f0;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.wgp-draw-summary-divider-line::before {
    content: "";
    display: block;
    height: 100%;
    width: var(--quota-pct, 0%);
    background: linear-gradient(to right, #fbbf24, #eab308);
    border-radius: 999px;
    transition: width 0.3s;
}

.wgp-draw-bar--limited .wgp-draw-actions {
    display: flex;
    align-items: stretch;
    gap: 5px;
    flex: 1;
}
.wgp-draw-bar--limited .wgp-draw-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: auto;
    height: auto;
    min-height: 24px;
    padding: 2px 12px;
    border-radius: 6px;
    background: linear-gradient(to right, #f59e0b, #eab308, #d97706);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    border: none;
    box-shadow: none;
}
.wgp-draw-bar--limited .wgp-draw-btn:hover:not(:disabled) {
    background: linear-gradient(to right, #d97706, #ca8a04, #b45309);
    transform: translateY(-1px);
}
.wgp-draw-bar--limited .wgp-btn-top {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    line-height: 18px;
}
.wgp-draw-bar--limited .wgp-btn-icon  {
    display: inline-flex;
    align-items: center;
    opacity: 1;
    margin-right: 0;
}
.wgp-draw-bar--limited .wgp-btn-icon svg {
    width: 15px;
    height: 15px;
}
.wgp-draw-bar--limited .wgp-btn-draws {
    display: inline;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0;
}
.wgp-draw-bar--limited .wgp-btn-cost {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 400;
    line-height: 14px;
}
.wgp-draw-bar--limited .wgp-btn-cost::before { content: "花費 "; }
.wgp-draw-bar--limited .wgp-btn-cost::after  { content: " 點"; }

/* 自訂抽：白色卡片，三色漸層邊框；row1 = qty-wrap 全寬；row2 = btn + badge 同行 */
.wgp-draw-bar--limited .wgp-draw-custom {
    flex: 1;
    margin-left: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 8px;
    padding: 1px 8px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(to right, #a855f7, #d946ef, #f59e0b) border-box;
    border: 2px solid transparent;
    border-radius: 6px;
    min-height: 24px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    cursor: pointer;
}
/* 用 display: contents 讓 qty-wrap / cost-badge 變成 .wgp-draw-custom 的直接 flex 子元素，方便用 order 排版 */
.wgp-draw-bar--limited .wgp-qty-group {
    display: contents;
}
.wgp-draw-bar--limited .wgp-qty-wrap            { order: 1; flex-basis: 100%; }
.wgp-draw-bar--limited .wgp-draw-custom-btn     { order: 2; }
.wgp-draw-bar--limited .wgp-custom-cost-badge   { order: 3; }
.wgp-draw-bar--limited .wgp-qty-wrap {
    display: flex;
    align-items: center;
    gap: 3px;
    width: 100%;
    height: 16px;
    border: none;
    border-radius: 0;
    background: transparent;
}
.wgp-draw-bar--limited .wgp-qty-btn {
    background: #fff;
    color: #262626;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.wgp-draw-bar--limited .wgp-qty-btn:hover:not(:disabled) { background: #f3f4f6; color: #1d2327; }
.wgp-draw-bar--limited .wgp-draw-qty {
    flex: 1;
    min-width: 0;
    height: 16px;
    text-align: center;
    border: 1px solid #ebebeb;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 900;
    color: #262626;
    background: #fafafa;
    padding: 0 3px;
}
.wgp-draw-bar--limited .wgp-custom-cost-badge {
    background: transparent;
    color: #6b7280;
    border: none;
    padding: 0;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.1;
}
.wgp-draw-bar--limited .wgp-custom-cost-badge::before { content: "花費 "; }
.wgp-draw-bar--limited .wgp-custom-cost-unit { display: none; }
.wgp-draw-bar--limited .wgp-custom-cost-value::after { content: " 點"; }
/* 電腦版：qty input + 按鈕放大 */
@media (min-width: 769px) {
    .wgp-draw-bar--limited .wgp-qty-wrap {
        height: 30px;
        gap: 6px;
    }
    .wgp-draw-bar--limited .wgp-qty-btn {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
        border-radius: 6px;
        font-size: 16px;
    }
    .wgp-draw-bar--limited .wgp-draw-qty {
        height: 30px;
        font-size: 16px;
        border-radius: 8px;
        padding: 0 6px;
    }
    /* 電腦版：wgp-draw-btn 平均拉伸 */
    .wgp-draw-bar--limited .wgp-draw-btn {
        flex: 1;
    }
}
.wgp-draw-bar--limited .wgp-draw-custom-btn {
    background: transparent;
    color: #d97706;
    border: none;
    border-radius: 6px;
    padding: 0;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: none;
    letter-spacing: 0.5px;
}
.wgp-draw-bar--limited .wgp-draw-custom-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #f59e0b;
    height: auto;
}
.wgp-draw-bar--limited .wgp-draw-custom-icon {
    color: #f59e0b;
    width: 11px;
    height: 11px;
}
.wgp-draw-bar--limited .wgp-draw-custom-btn:hover:not(:disabled) {
    color: #b45309;
    box-shadow: none;
    transform: none;
}

@media (max-width: 768px) {
    .wgp-limited-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .wgp-limited-title  { grid-row: 1; }
    .wgp-limited-delisting {
        grid-column: 1;
        grid-row: 2;
        justify-self: center;
    }
    .wgp-limited-quota  {
        grid-row: 3;
        justify-content: center;
    }
    .wgp-draw-bar--limited .wgp-draw-actions {
        flex-wrap: wrap;
    }
    .wgp-draw-bar--limited .wgp-draw-btn {
        flex: 1 1 calc((100% - 10px) / 3);
        min-width: 0;
        max-width: calc((100% - 10px) / 3);
    }
    .wgp-draw-bar--limited .wgp-draw-custom {
        flex: 1 1 100%;
        min-width: 100%;
    }
}

/* ── 瞬殺模式：獎項卡片（對齊 lovable 設計稿） ─────────────── */
.wgp-prize-card--limited {
    --rarity-c1: #e5e7eb; --rarity-c2: #d4d4d8; --rarity-c3: #a1a1aa;
    --rarity-text: #71717a;
    padding: 10px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, var(--rarity-c1), var(--rarity-c2), var(--rarity-c3)) border-box;
    border: 2px solid transparent;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.wgp-prize-card--limited:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.wgp-prize-card--limited[data-rarity="4"] {
    --rarity-c1: #27272a; --rarity-c2: #581c87; --rarity-c3: #18181b;
    --rarity-text: #9333ea;
}
.wgp-prize-card--limited[data-rarity="3"] {
    --rarity-c1: #a5f3fc; --rarity-c2: #7dd3fc; --rarity-c3: #60a5fa;
    --rarity-text: #3b82f6;
}
.wgp-prize-card--limited[data-rarity="2"] {
    --rarity-c1: #fde68a; --rarity-c2: #facc15; --rarity-c3: #f59e0b;
    --rarity-text: #f59e0b;
}
.wgp-prize-card--limited[data-rarity="1"] {
    --rarity-c1: #e2e8f0; --rarity-c2: #d4d4d8; --rarity-c3: #94a3b8;
    --rarity-text: #64748b;
}
.wgp-prize-card--limited .wgp-prize-img-wrap {
    height: 110px;
    background: linear-gradient(135deg, var(--rarity-c1), var(--rarity-c2), var(--rarity-c3));
    border-bottom: none;
    margin: 0 0 6px 0;
    border-radius: 10px;
}
.wgp-prize-card--limited .wgp-prize-no-img {
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    color: #f5a623;
}
.wgp-prize-card--limited .wgp-prize-no-img::before {
    content: "🎁";
}
.wgp-prize-card--limited .wgp-prize-info {
    padding: 0;
    text-align: left;
    gap: 3px;
}
.wgp-prize-card--limited .wgp-prize-name {
    font-size: 14px;
    color: #262626;
    -webkit-line-clamp: 1;
    font-weight: 700;
    line-height: 20px;
}
.wgp-prize-card--limited .wgp-prize-value {
    font-size: 12px;
    color: #ffbf00;
    font-weight: 900;
    line-height: 16px;
}
.wgp-prize-progress {
    height: 4px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 2px;
}
.wgp-prize-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fcd34d 0%, #f59e0b 100%);
    border-radius: 4px;
    transition: width 0.3s;
}
.wgp-prize-card--limited .wgp-prize-progress-fill {
    background: linear-gradient(90deg, var(--rarity-c1), var(--rarity-c2), var(--rarity-c3));
}
.wgp-prize-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}
.wgp-prize-card--limited .wgp-prize-quota {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 10px;
    color: rgb(115, 115, 115);
    font-weight: 400;
    line-height: 15px;
}
.wgp-prize-card--limited .wgp-prize-quota-num {
    color: #262626;
    font-weight: 700;
}
.wgp-prize-card--limited .wgp-prize-detail-link {
    font-size: 10px;
}
.wgp-prize-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #9ca3af;
}
.wgp-prize-detail-icon { color: #d97706; }

/* SOLD OUT 狀態 — 覆蓋整張卡片 */
.wgp-prize-card--sold-out::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    border-radius: inherit;
    pointer-events: none;
    z-index: 10;
}
.wgp-prize-card--sold-out::after {
    content: "SOLD OUT";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    color: #ef4444;
    background: transparent;
    border: 4px solid #ef4444;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 2px;
    padding: 4px 12px;
    line-height: 28px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 11;
}

/* ── 瞬殺模式：獎項詳情 popup ───────────────────────────────── */
.wgp-prize-detail-overlay--limited {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.wgp-prize-detail-modal--limited {
    --ldetail-title-color: #64748b;
    --ldetail-gradient: linear-gradient(to right bottom, #e2e8f0, #d4d4d8, #94a3b8);

    width: min(448px, 92vw);
    max-height: 88vh;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}
.wgp-prize-detail-modal--limited[data-rarity="4"] {
    --ldetail-title-color: #9333ea;
    --ldetail-gradient: linear-gradient(to right bottom, #27272a, #581c87, #18181b);
}
.wgp-prize-detail-modal--limited[data-rarity="3"] {
    --ldetail-title-color: #3b82f6;
    --ldetail-gradient: linear-gradient(to right bottom, #a5f3fc, #7dd3fc, #60a5fa);
}
.wgp-prize-detail-modal--limited[data-rarity="2"] {
    --ldetail-title-color: #f59e0b;
    --ldetail-gradient: linear-gradient(to right bottom, #fde68a, #facc15, #f59e0b);
}
.wgp-prize-detail-modal--limited[data-rarity="1"] {
    --ldetail-title-color: #64748b;
    --ldetail-gradient: linear-gradient(to right bottom, #e2e8f0, #d4d4d8, #94a3b8);
}

.wgp-prize-detail-modal--limited .wgp-ldetail-title {
    margin: 0;
    padding: 0;
    font-size: 20px;
    font-weight: 900;
    color: var(--ldetail-title-color);
    letter-spacing: 0;
    line-height: 1.2;
}

.wgp-prize-detail-modal--limited .wgp-detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: #1d2327;
    opacity: 0.7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: opacity 0.15s;
}
.wgp-prize-detail-modal--limited .wgp-detail-close:hover { opacity: 1; }
.wgp-prize-detail-modal--limited .wgp-detail-close svg { width: 16px; height: 16px; }

.wgp-ldetail-frame {
    padding: 2px;
    border-radius: 12px;
    background: var(--ldetail-gradient);
}
.wgp-ldetail-inner {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wgp-ldetail-image {
    height: 192px;
    border-radius: 6px;
    background: var(--ldetail-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.wgp-ldetail-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.wgp-ldetail-image .wgp-detail-no-img {
    width: auto;
    height: auto;
    background: transparent;
    font-size: 72px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.wgp-ldetail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
}
.wgp-ldetail-info-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: rgba(240, 240, 240, 0.5);
    border: none;
    border-radius: 4px;
}
.wgp-ldetail-info-label {
    font-size: 12px;
    color: #737373;
    letter-spacing: 0;
    line-height: 1.3;
}
.wgp-ldetail-info-val {
    font-size: 14px;
    font-weight: 700;
    color: #262626;
    line-height: 1.3;
}
.wgp-ldetail-val-rarity { color: var(--ldetail-title-color); }
.wgp-ldetail-val-accent { color: #ffbf00; }

.wgp-ldetail-sections {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wgp-ldetail-section + .wgp-ldetail-section { margin-top: 0; }
.wgp-ldetail-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #262626;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}
.wgp-ldetail-section-icon { flex-shrink: 0; }
.wgp-ldetail-section-body {
    font-size: 14px;
    color: #737373;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.wgp-ldetail-footer {
    margin: 8px 0 0;
    padding: 0;
    text-align: center;
    background: transparent;
    border: none;
    font-size: 10px;
    color: #737373;
}

@media (max-width: 480px) {
    .wgp-prize-detail-modal--limited { padding: 20px; }
    .wgp-ldetail-image { height: 160px; }
    .wgp-ldetail-info-grid { gap: 6px; }
    .wgp-ldetail-info-cell { padding: 6px 8px; }
}
