/* 精品卡詳情 · 圖鑑／背包彈窗（參考 SEC/UR/MR 卡面） */

.modal-inner.modal-inner--premium {
    max-width: min(440px, 94vw);
    max-height: min(96vh, 900px);
    padding: 14px 14px 16px;
    overflow: hidden;
    background: linear-gradient(165deg, rgba(18, 10, 36, 0.98), rgba(4, 4, 12, 0.99));
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow:
        0 0 0 1px rgba(255, 215, 0, 0.12),
        0 0 48px rgba(127, 0, 255, 0.28),
        0 24px 64px rgba(0, 0, 0, 0.65);
}

.modal-inner--premium #modal-card-mount {
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
}

.modal-inner--premium #modal-meta:empty {
    display: none;
    margin: 0;
    padding: 0;
}

.modal-inner--premium .modal-actions {
    margin-top: 12px;
}

@media (max-width: 720px) {
    .modal-inner.modal-inner--premium {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: min(100%, 400px);
        max-width: 98vw;
        max-height: none;
        overflow: visible;
        gap: 10px;
    }

    .modal-inner--premium #modal-card-mount {
        flex: 0 0 auto;
        overflow: auto;
        max-height: min(72vh, 640px);
        -webkit-overflow-scrolling: touch;
    }

    .modal-inner--premium .modal-actions {
        flex: 0 0 auto;
        margin-top: 0;
        padding-top: 8px;
        padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
    }

    .premium-detail-card {
        max-width: 100%;
    }
}

/* ── 完整立繪 JPG：只放大卡圖，不重疊 UI（避免與卡面內文字重複） ── */
.modal-inner.modal-inner--art-full {
    width: auto;
    max-width: min(520px, 96vw);
    max-height: min(96vh, 920px);
    padding: 16px 20px 14px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-color: rgba(192, 132, 252, 0.45);
    box-shadow: 0 0 48px rgba(127, 0, 255, 0.35);
}

.modal-inner--art-full #modal-card-mount {
    grid-area: unset;
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
}

/* 彈窗：原生比例完整卡面，不裁四邊 */
.modal-art-panel {
    display: block;
    width: 100%;
    max-width: min(460px, 92vw);
    margin: 0 auto;
    overflow: visible;
    line-height: 0;
    background: transparent;
    filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.55));
}

.modal-art-full-img {
    display: block;
    width: auto;
    max-width: min(460px, 92vw);
    height: auto;
    max-height: min(82vh, 900px);
    margin: 0 auto;
    object-fit: contain;
    object-position: center center;
    border-radius: 0;
    background: transparent;
}

.modal-inner--art-full #modal-meta {
    flex: 0 0 auto;
    width: 100%;
    max-height: none;
    margin-top: 8px;
    text-align: center;
}

.modal-inner--zoom .modal-art-panel--full-bleed {
    max-width: min(360px, 42vw);
    margin: 0 auto;
}

.modal-inner--zoom .modal-art-panel--full-bleed .modal-art-full-img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(82vh, 780px);
    margin: 0 auto;
    object-fit: contain;
    object-position: center top;
}

.modal-inner--zoom #modal-meta {
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    overflow: visible;
    max-height: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-inner--zoom #modal-meta::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.modal-inner--zoom .modal-rarity-banner {
    margin: 0;
    width: 100%;
    text-align: center;
}

.modal-inner--zoom .modal-rarity-cn,
.modal-inner--zoom .modal-rarity-code,
.modal-inner--zoom .modal-rarity-sep {
    font-size: clamp(22px, 3.2vw, 30px);
}

.modal-inner--zoom .modal-card-title {
    font-size: clamp(20px, 2.8vw, 26px);
    line-height: 1.3;
    margin: 4px 0 6px;
    text-align: center;
    width: 100%;
}

.modal-inner--zoom .modal-card-sub {
    font-size: 15px;
    text-align: center;
    width: 100%;
}

.modal-inner--zoom .modal-card-stats {
    font-size: 17px;
    font-weight: 700;
    margin: 4px 0 8px;
}

.modal-inner--zoom .catalog-modal-own {
    font-size: 15px;
    margin: 4px 0;
}

.modal-inner--zoom .modal-bind-row {
    justify-content: center;
    width: 100%;
}

.modal-inner--zoom .modal-card-detail {
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    grid-template-columns: 1fr;
}

.modal-inner--zoom .modal-detail-block {
    width: 100%;
    max-width: 420px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(192, 132, 252, 0.28);
    text-align: center;
}

.modal-inner--zoom .modal-detail-heading {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 800;
    color: #f0e0ff;
    letter-spacing: 0.04em;
}

.modal-inner--zoom .modal-detail-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(240, 245, 255, 0.92);
}

.modal-inner--art-full .modal-bind-row {
    justify-content: center;
}

.modal-inner--art-full .catalog-modal-own {
    margin: 4px 0;
}

.modal-inner--art-full .modal-actions {
    margin-top: 8px;
    width: 100%;
}

/* ── 標準詳情彈窗：一屏展示 · 禁止內層捲動 ── */
.modal-inner.modal-inner--zoom {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-inner.modal-inner--zoom::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.modal-inner--zoom .btn-card-bind {
    font-size: 14px;
    padding: 10px 18px;
}

.pdc-foot .modal-bind-row {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 6px;
}

.pdc-foot .btn-card-bind {
    justify-content: center;
    margin: 0 auto;
}

.pdc-foot .modal-bind-hint {
    flex: none;
    width: 100%;
    max-width: 100%;
    margin: 0;
    text-align: center;
    font-size: 11px;
    line-height: 1.45;
}

.pdc-foot .modal-bind-status.is-visible {
    flex: 0 0 auto;
    min-width: 3.5em;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .btn-card-bind.bind-anim-lock,
    .btn-card-bind.bind-anim-unlock,
    .bind-lock-shackle,
    .bind-lock-body,
    .modal-bind-status.is-visible,
    .bag-bound-badge--pop,
    .bag-bound-badge--unlock {
        animation: none !important;
        transition: none !important;
    }
}

.modal-inner--zoom .modal-actions button {
    padding: 8px 24px;
    font-size: 13px;
}

.premium-detail-card {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.pdc-frame {
    position: relative;
    aspect-ratio: 5 / 8.2;
    min-height: 480px;
    max-height: min(78vh, 640px);
    display: flex;
    flex-direction: column;
}

.pdc-art {
    position: absolute;
    inset: 0;
    background: var(--pdc-bg, #12081e);
    overflow: hidden;
}

.pdc-art-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    content-visibility: auto;
}

.pdc-art-img--fail {
    display: none;
}

.pdc-art-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}

.pdc-art-glow {
    position: absolute;
    width: 70%;
    height: 50%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 200, 120, 0.35), transparent 70%);
    filter: blur(24px);
    animation: pdc-glow-pulse 4s ease-in-out infinite;
}

@keyframes pdc-glow-pulse {
    0%, 100% { opacity: 0.65; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.pdc-art-emoji {
    position: relative;
    z-index: 1;
    font-size: clamp(64px, 18vw, 96px);
    filter: drop-shadow(0 0 24px rgba(255, 220, 140, 0.55));
    line-height: 1;
}

.pdc-art-glyph {
    position: relative;
    z-index: 1;
    font-size: clamp(28px, 8vw, 40px);
    font-weight: 900;
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    background: linear-gradient(180deg, #fff8dc, #ffd700, #ff9500);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.2em;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.5));
}

.pdc-art-vignette {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(8, 4, 16, 0.55) 0%,
        transparent 28%,
        transparent 42%,
        rgba(4, 2, 10, 0.75) 72%,
        rgba(2, 0, 8, 0.95) 100%
    );
    pointer-events: none;
}

.pdc-overlay {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 10px 12px;
    min-height: 0;
}

.pdc-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    border-radius: 18px;
    border: 2px solid transparent;
    background: linear-gradient(165deg, rgba(212, 175, 55, 0.9), rgba(120, 80, 200, 0.4), rgba(212, 175, 55, 0.85)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    box-shadow: inset 0 0 24px rgba(255, 215, 0, 0.08), 0 0 20px rgba(192, 132, 252, 0.2);
}

.pdc-head {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 8px 10px;
    align-items: start;
}

.pdc-element {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 25%, rgba(255, 220, 140, 0.35), rgba(20, 8, 40, 0.92));
    border: 1px solid rgba(255, 215, 0, 0.55);
    box-shadow: 0 0 14px rgba(255, 180, 60, 0.35);
}

.pdc-element-icon {
    font-size: 22px;
    line-height: 1;
}

.pdc-head-center {
    min-width: 0;
    text-align: center;
}

.pdc-name {
    margin: 0;
    font-size: clamp(15px, 4.2vw, 18px);
    font-weight: 900;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 0 12px rgba(200, 140, 255, 0.65), 0 2px 4px rgba(0, 0, 0, 0.9);
    letter-spacing: 0.04em;
}

.pdc-stars {
    margin: 4px 0 2px;
    font-size: 11px;
    letter-spacing: 2px;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
    line-height: 1;
}

.pdc-tribe {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 248, 230, 0.92);
}

.pdc-subline {
    margin: 2px 0 0;
    font-size: 10px;
    color: rgba(220, 210, 255, 0.75);
}

.pdc-head-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.pdc-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(240, 240, 255, 0.95);
}

.pdc-chip--missing { border-color: rgba(255, 120, 100, 0.45); color: #ffc8b8; }
.pdc-chip--owned { border-color: rgba(109, 255, 176, 0.45); color: #9dffc8; }
.pdc-chip--preview { border-color: rgba(192, 132, 252, 0.45); color: #e0c8ff; }
.pdc-chip--bound { border-color: rgba(255, 184, 108, 0.55); color: #ffd9a8; }

.pdc-rarity-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35em;
    margin: 10px auto 8px;
    text-align: center;
    line-height: 1.15;
}

.pdc-rarity-cn,
.pdc-rarity-code {
    font-size: clamp(20px, 5.5vw, 26px);
    font-weight: 900;
    letter-spacing: 0.12em;
    background: linear-gradient(90deg, #b983ff, #5bb6ff, #45f3ff, #ffd700, #ff88cc, #b983ff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: catalog-title-shimmer 3.5s linear infinite;
}

.pdc-rarity-sep {
    font-size: clamp(20px, 5.5vw, 26px);
    font-weight: 900;
    line-height: 1;
    color: rgba(255, 255, 255, 0.45);
}

.premium-detail-card--sec .pdc-rarity-cn,
.premium-detail-card--lr .pdc-rarity-cn {
    background-image: linear-gradient(90deg, #00ffff, #e8ff88, #ffd700, #ff88ff, #00ffff);
}

.premium-detail-card--ur .pdc-rarity-cn {
    background-image: linear-gradient(90deg, #ffd700, #fff8dc, #ff9500, #ffd700);
}

.premium-detail-card--mr .pdc-rarity-cn {
    background-image: linear-gradient(90deg, #ff3366, #ffd700, #ff88ff, #5bb6ff, #ff3366);
}

.pdc-stats {
    display: grid;
    grid-template-columns: 1fr 36px 1fr;
    gap: 6px;
    align-items: stretch;
    margin: 0 0 10px;
}

.pdc-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.35);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.72), rgba(40, 20, 8, 0.85));
}

.pdc-stat--atk {
    border-color: rgba(200, 60, 40, 0.5);
    background: linear-gradient(135deg, rgba(60, 12, 8, 0.9), rgba(20, 4, 4, 0.92));
}

.pdc-stat--def {
    border-color: rgba(60, 120, 200, 0.5);
    background: linear-gradient(135deg, rgba(8, 24, 60, 0.9), rgba(4, 8, 24, 0.92));
}

.pdc-stat-icon { font-size: 16px; opacity: 0.9; }

.pdc-stat-val {
    font-size: clamp(18px, 5vw, 22px);
    font-weight: 900;
    font-family: 'Orbitron', 'Noto Sans TC', sans-serif;
    background: linear-gradient(180deg, #fff4d0, #ffd700, #ff8c00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.04em;
}

.pdc-stat-crest {
    align-self: center;
    width: 28px;
    height: 28px;
    background: radial-gradient(circle, rgba(200, 120, 255, 0.9), rgba(80, 20, 120, 0.6));
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.65);
}

.pdc-panels {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pdc-panel {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(8, 4, 20, 0.78);
    border: 1px solid rgba(212, 175, 55, 0.28);
}

.pdc-panel-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 800;
    color: #e8c8ff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdc-panel--skill .pdc-panel-title {
    background: linear-gradient(90deg, #ff9cf0, #ffd700, #88e0ff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pdc-panel--story .pdc-panel-title {
    color: #ffd9a8;
    -webkit-text-fill-color: #ffd9a8;
}

.pdc-panel-body {
    margin: 0;
    font-size: 12px;
    line-height: 1.65;
    color: rgba(235, 238, 255, 0.9);
}

.pdc-foot {
    flex: 0 0 auto;
    margin-top: 8px;
}

.pdc-foot .modal-bind-row {
    margin: 0;
}

.premium-detail-card--n .pdc-rarity-cn,
.premium-detail-card--r .pdc-rarity-cn {
    background-image: linear-gradient(90deg, #a8b0c4, #d8e4ff, #a8b0c4);
    filter: none;
}

.card-face.card-face--unified:not(.has-art) .card-art {
    position: relative;
}

.card-face.card-face--unified:not(.has-art) .card-art::before {
    content: '';
    position: absolute;
    inset: 12% 18%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 200, 100, 0.25), transparent 68%);
    pointer-events: none;
    z-index: 0;
}

.card-face.card-face--unified:not(.has-art) .card-emoji {
    position: relative;
    z-index: 1;
    font-size: clamp(36px, 12vw, 52px);
    filter: drop-shadow(0 0 16px rgba(255, 200, 120, 0.45));
}

.card-face.card-face--unified:not(.has-art)::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 13;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.06);
}
