/* MYTHIC RISING · 卡包區 + 展示卡牌區（分開） */

/* 首頁認證框 — 固定頂欄下方左緣（頂欄已 position:fixed + padding-top 預留） */
:root {
    --void-app-hdr-pad-x: 12px;
    --void-home-hdr-gap: 12px;
}

/* 負 top 會超出 home-arena 上緣，須放開裁切否則標題行被吃掉 */
.home-arena:has(> .home-left-pillar) {
    overflow-y: visible;
}

.home-arena > .home-left-pillar .void-seal-cert--pillar {
    padding: 16px 18px 18px;
    text-align: center;
    pointer-events: none;
    isolation: isolate;
    transform: none;
    border-radius: 16px;
    border: 1px solid rgba(255, 215, 0, 0.45);
    background: linear-gradient(145deg, rgba(6, 2, 20, 0.82) 0%, rgba(18, 6, 42, 0.68) 100%);
    box-shadow:
        0 0 18px rgba(127, 0, 255, 0.45),
        0 0 32px rgba(255, 215, 0, 0.12),
        inset 0 0 20px rgba(0, 255, 255, 0.07);
    overflow: hidden;
    animation: voidSealPanelGlow 2.6s ease-in-out infinite alternate;
}

.void-seal-cert__title {
    position: relative;
    z-index: 4;
    margin: 0 0 10px;
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    font-weight: 900;
    letter-spacing: 0.07em;
    line-height: 1.45;
    text-align: center;
}

.void-seal-cert__desc {
    position: relative;
    z-index: 4;
    margin: 0;
    font-size: clamp(0.8rem, 1.65vw, 0.95rem);
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 0.04em;
    text-align: center;
}

.void-seal-cert__desc-line2 {
    display: block;
    margin-top: 6px;
}

.void-seal-cert__rainbow {
    display: inline-block;
    max-width: 100%;
    text-align: center;
    background: linear-gradient(
        92deg,
        #00ffff 0%,
        #ffd700 18%,
        #ff6ec7 36%,
        #a855f7 54%,
        #00ff88 72%,
        #00e5ff 88%,
        #ffd700 100%
    );
    background-size: 320% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: voidSealRainbowFlow 3s linear infinite;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.85)) drop-shadow(0 0 16px rgba(0, 255, 255, 0.5));
}

.void-seal-cert__sweep {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.void-seal-cert__sweep::after {
    content: '';
    position: absolute;
    top: -35%;
    left: 0;
    width: 46%;
    height: 170%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 30%,
        rgba(255, 255, 255, 0.95) 50%,
        rgba(200, 255, 255, 0.85) 55%,
        rgba(255, 255, 255, 0.1) 70%,
        transparent 100%
    );
    transform: skewX(-22deg) translateX(-200%);
    animation: voidSealRainbowSweep 2.4s ease-in-out infinite;
}

.void-seal-cert__sparkles {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0.85;
    background:
        radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.95) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 82% 28%, rgba(255, 215, 0, 0.95) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 48% 78%, rgba(0, 255, 255, 0.9) 0 1px, transparent 2px),
        radial-gradient(circle at 92% 68%, rgba(255, 110, 200, 0.9) 0 1px, transparent 2px);
    animation: voidSealSparkle 1.6s ease-in-out infinite alternate;
}

@keyframes voidSealRainbowFlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 320% 50%;
    }
}

@keyframes voidSealRainbowSweep {
    0%,
    18% {
        transform: skewX(-22deg) translateX(-200%);
    }
    48%,
    58% {
        transform: skewX(-22deg) translateX(280%);
    }
    100% {
        transform: skewX(-22deg) translateX(280%);
    }
}

@keyframes voidSealSparkle {
    0% {
        opacity: 0.35;
        filter: brightness(0.9);
    }
    100% {
        opacity: 1;
        filter: brightness(1.35);
    }
}

@keyframes voidSealPanelGlow {
    0% {
        box-shadow:
            0 0 14px rgba(127, 0, 255, 0.35),
            0 0 24px rgba(255, 215, 0, 0.08),
            inset 0 0 16px rgba(0, 255, 255, 0.05);
    }
    100% {
        box-shadow:
            0 0 24px rgba(127, 0, 255, 0.55),
            0 0 40px rgba(255, 215, 0, 0.22),
            inset 0 0 28px rgba(0, 255, 255, 0.12);
    }
}

.mythic-rising-section {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: min(1180px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.mythic-rising-block {
    width: 100%;
    text-align: center;
}

.mythic-rising-block--cards {
    margin-top: 4px;
}

.mythic-showcase-pity {
    width: 100%;
    max-width: 920px;
    margin: 14px auto 0;
    padding: 0 6px;
    text-align: left;
}

.pity-panel--showcase {
    margin-bottom: 0;
}

.pity-panel--showcase .pity-panel__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.pity-panel--showcase .pity-bar-wrap--wide {
    grid-column: 1 / -1;
}

.pity-panel--showcase .pity-note--ur {
    margin: 0;
    font-size: 11px;
    color: rgba(255, 200, 120, 0.85);
}

@media (max-width: 640px) {
    .pity-panel--showcase .pity-panel__grid {
        grid-template-columns: 1fr;
    }
}

/* —— 炫彩發光標題 —— */
.mythic-rising-neon-title {
    margin: 0 0 8px;
    font-size: clamp(1.15rem, 3.2vw, 1.45rem);
    font-weight: 900;
    letter-spacing: 0.22em;
    text-align: center;
    background: linear-gradient(
        90deg,
        #00ffff 0%,
        #ffd700 22%,
        #ff00aa 44%,
        #a855f7 66%,
        #00ff88 82%,
        #00ffff 100%
    );
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: mythicTitleShine 4.5s linear infinite;
    filter: drop-shadow(0 0 14px rgba(0, 255, 255, 0.55))
        drop-shadow(0 0 28px rgba(255, 0, 128, 0.35));
}

.mythic-rising-neon-title--showcase {
    font-size: clamp(1.25rem, 3.6vw, 1.55rem);
    letter-spacing: 0.28em;
    filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.6))
        drop-shadow(0 0 32px rgba(168, 85, 247, 0.45));
}

.mythic-rising-panel--cards .legend-card {
    position: relative;
}

.legend-card--custom {
    border-color: rgba(255, 215, 0, 0.45) !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.legend-card-mine {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 6;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    color: #1a1000;
    background: linear-gradient(135deg, #ffd700, #ff9f43);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.legend-card-swap {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 6;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.45);
    background: rgba(0, 0, 0, 0.65);
    color: #7df9ff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.mythic-rising-panel--cards .legend-card:hover .legend-card-swap,
.mythic-rising-panel--cards .legend-card:focus-within .legend-card-swap {
    opacity: 1;
}

.legend-card-swap:hover {
    background: rgba(0, 50, 70, 0.9);
    border-color: rgba(255, 215, 0, 0.55);
}

.mythic-rising-neon-caption {
    margin: 0 0 4px;
    font-size: clamp(0.95rem, 2.4vw, 1.1rem);
    font-weight: 800;
    text-align: center;
    color: rgba(255, 248, 230, 0.95);
    text-shadow:
        0 0 12px rgba(255, 215, 0, 0.65),
        0 0 24px rgba(127, 0, 255, 0.35);
}

.mythic-rising-neon-sub {
    margin: 0 auto 14px !important;
    max-width: 640px;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    color: rgba(200, 230, 255, 0.88);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.35);
}

.mythic-rising-pack-hint {
    margin-bottom: 12px !important;
}

@keyframes mythicTitleShine {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 220% center;
    }
}

/* —— 面板：卡包 / 卡牌分開 —— */
.mythic-rising-panel {
    --mythic-slot-w: clamp(158px, 13.6vw, 176px);
    --mythic-row-gap: 12px;
    --mythic-col-gap: 10px;
    width: 100%;
    margin: 0 auto;
    padding: 14px 12px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        inset 0 0 50px rgba(127, 0, 255, 0.1),
        0 10px 36px rgba(0, 0, 0, 0.42);
}

.mythic-rising-panel--packs {
    background:
        radial-gradient(ellipse 90% 60% at 50% 0%, rgba(0, 255, 255, 0.14), transparent 62%),
        radial-gradient(ellipse 70% 50% at 80% 100%, rgba(255, 0, 128, 0.1), transparent 55%),
        linear-gradient(165deg, rgba(10, 8, 28, 0.92), rgba(6, 4, 18, 0.96));
}

.mythic-rising-panel--cards {
    background:
        radial-gradient(ellipse 85% 55% at 50% 0%, rgba(127, 0, 255, 0.22), transparent 62%),
        radial-gradient(ellipse 70% 45% at 12% 80%, rgba(255, 0, 128, 0.12), transparent 55%),
        linear-gradient(165deg, rgba(14, 6, 32, 0.9), rgba(6, 4, 16, 0.94));
}

/* 八大卡包橫列 */
.mythic-rising-packs-row {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: var(--mythic-col-gap);
    align-items: stretch;
    justify-content: center;
}

.mythic-rising-packs-row .pack-tile {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: clamp(168px, 20vw, 200px);
    flex: none;
    justify-self: stretch;
}

.mythic-rising-packs-row .pack-art-img {
    object-position: center 22%;
}

.mythic-rising-packs-row .pack-name {
    font-size: 11px;
}

.mythic-rising-packs-row .pack-en,
.mythic-rising-packs-row .pack-ur,
.mythic-rising-packs-row .pack-format {
    font-size: 9px;
}

/* 展示卡牌 · 三列各 6 格 */
.mythic-rising-panel--cards .mythic-rising-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, var(--mythic-slot-w)));
    gap: var(--mythic-row-gap) var(--mythic-col-gap);
    justify-content: center;
    align-items: stretch;
    margin-bottom: var(--mythic-row-gap);
}

.mythic-rising-panel--cards .mythic-rising-row:last-child {
    margin-bottom: 0;
}

.mythic-rising-panel--cards .legend-card {
    width: 100%;
    max-width: var(--mythic-slot-w);
    justify-self: center;
    min-height: clamp(232px, 32vw, 252px);
    padding: 10px 10px 12px;
    box-sizing: border-box;
}

.mythic-rising-panel--cards .legend-card .legend-mount {
    max-width: min(100%, calc(var(--mythic-slot-w) - 12px));
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.mythic-rising-panel--cards .legend-card .void-card-tile,
.mythic-rising-panel--cards .legend-card .card-3d-wrap,
.mythic-rising-panel--cards .legend-card .void-card-tile .card-face {
    width: 100% !important;
    max-width: 100% !important;
}

.mythic-rising-panel--cards .legend-card .legend-title {
    font-size: 12px;
}

.mythic-rising-panel--cards .legend-card .legend-line {
    font-size: 10px;
}

.mythic-rising-panel--cards .legend-card .legend-mount {
    overflow: visible;
}

.mythic-rising-panel--cards .legend-card .void-card-frame.legend-card-art {
    overflow: visible;
}

.mythic-rising-panel--cards .legend-card .void-card-stage .card-temple-seal {
    bottom: 15px;
    left: 12px;
    max-width: calc(100% - 24px);
    padding: 4px 6px 5px;
    z-index: 5;
    border-width: 1.5px;
    background: linear-gradient(145deg, rgba(4, 2, 14, 0.92), rgba(28, 12, 48, 0.88));
}

.mythic-rising-panel--cards .legend-card .card-temple-seal__title {
    font-size: clamp(7px, 1.6vw, 9px);
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.pack-scroll--all.hidden {
    display: none !important;
}

@media (max-width: 1100px) {
    .home-arena > .home-left-pillar .void-seal-cert--pillar {
        padding: 14px 16px 16px;
    }

    .void-seal-cert__title {
        font-size: clamp(0.88rem, 2.4vw, 1.05rem);
    }

    .void-seal-cert__desc {
        font-size: clamp(0.75rem, 2vw, 0.88rem);
    }

    .mythic-rising-packs-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .mythic-rising-panel--cards .mythic-rising-row {
        grid-template-columns: repeat(3, minmax(0, var(--mythic-slot-w)));
    }
}

@media (max-width: 720px) {
    .home-arena {
        overflow-x: clip;
        overflow-y: hidden;
        margin-top: 0;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }

    .home-content {
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        max-height: calc(100dvh - var(--void-mobile-nav-h, 54px) - 140px);
    }

    .mythic-rising-pack-hint,
    .mythic-rising-neon-sub {
        font-size: 12px;
        line-height: 1.45;
    }
}

@media (max-width: 560px) {
    .void-seal-cert__title {
        font-size: clamp(0.9rem, 3.8vw, 1.08rem);
    }

    .void-seal-cert__desc {
        font-size: clamp(0.78rem, 3.2vw, 0.92rem);
    }

    .mythic-rising-section {
        gap: 16px;
    }

    .mythic-rising-panel {
        padding: 10px 8px 12px;
        --mythic-slot-w: min(46vw, 168px);
    }

    .mythic-rising-neon-title {
        letter-spacing: 0.12em;
    }

    .mythic-rising-panel--packs {
        background: linear-gradient(165deg, rgba(10, 8, 28, 0.96), rgba(6, 4, 18, 0.98));
    }

    .mythic-rising-packs-row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        padding-bottom: 6px;
        scroll-snap-type: x mandatory;
        touch-action: pan-x pan-y;
        overscroll-behavior-x: contain;
    }

    .mythic-rising-packs-row .pack-tile {
        flex: 0 0 min(148px, 44vw);
        scroll-snap-align: start;
        min-height: 168px;
        touch-action: pan-y;
    }

    .mythic-rising-packs-row .pack-name {
        font-size: 12px;
    }

    .mythic-rising-packs-row .pack-en,
    .mythic-rising-packs-row .pack-ur,
    .mythic-rising-packs-row .pack-format {
        font-size: 10px;
    }

    .mythic-rising-panel--cards .mythic-rising-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mythic-rising-panel--cards .legend-card {
        min-height: clamp(200px, 52vw, 240px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .void-seal-cert,
    .void-seal-cert__sweep::after,
    .void-seal-cert__sparkles {
        animation: none;
    }

    .void-seal-cert__rainbow {
        animation: none;
        -webkit-text-fill-color: #ffe8a8;
        color: #ffe8a8;
        background: none;
        filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.65));
    }

    .void-seal-cert__sweep::after {
        opacity: 0.35;
        transform: skewX(-22deg) translateX(40%);
    }
}
