/* ═══ MYTHIC RISING · 華麗熱血召喚按鈕 ═══ */

/* 覆寫舊版 .summon-btn 彩虹框（void-option-glass 在後載入亦需覆寫） */
button.summon-btn.mythic-summon-btn {
    display: block;
    border: none;
    border-radius: 0;
    padding: 0;
    overflow: visible;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none;
    background: transparent;
    color: inherit;
}

button.summon-btn.mythic-summon-btn::before,
button.summon-btn.mythic-summon-btn::after {
    display: none !important;
    content: none !important;
    animation: none !important;
    background: none !important;
}

.summon-console__actions--mythic {
    --mythic-btn-h: 128px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
    width: 100%;
    padding: 4px 2px 0;
}

/* —— 共用按鈕基底（等高、等寬） —— */
.mythic-summon-btn {
    position: relative;
    display: block;
    width: 100%;
    height: var(--mythic-btn-h);
    min-height: var(--mythic-btn-h);
    max-height: var(--mythic-btn-h);
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    isolation: isolate;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
}

.mythic-summon-btn--ten {
    height: var(--mythic-btn-h);
    min-height: var(--mythic-btn-h);
    max-height: var(--mythic-btn-h);
}

.mythic-summon-btn__aura {
    position: absolute;
    inset: -8px -6px;
    z-index: 0;
    border-radius: 50%;
    background: radial-gradient(ellipse 70% 55% at 50% 60%, rgba(255, 80, 20, 0.35), transparent 72%);
    animation: mythicAuraBreathe 3.2s ease-in-out infinite;
    pointer-events: none;
}

.mythic-summon-btn__aura--epic {
    inset: -8px -6px;
    background: radial-gradient(ellipse 75% 60% at 50% 55%, rgba(255, 140, 0, 0.42), transparent 70%);
    animation-duration: 2.6s;
}

.mythic-summon-btn__frame {
    position: absolute;
    inset: 4px 6px 8px;
    z-index: 1;
    clip-path: polygon(50% 2%, 88% 14%, 98% 48%, 88% 86%, 50% 98%, 12% 86%, 2% 48%, 12% 14%);
    background: linear-gradient(165deg, #4a3828 0%, #1a1208 35%, #0d0804 55%, #2a1f12 100%);
    box-shadow:
        inset 0 2px 0 rgba(255, 220, 160, 0.35),
        inset 0 -6px 16px rgba(0, 0, 0, 0.75),
        0 6px 20px rgba(0, 0, 0, 0.65);
    pointer-events: none;
}

.mythic-summon-btn--single .mythic-summon-btn__frame {
    clip-path: polygon(50% 0%, 94% 16%, 100% 50%, 94% 84%, 50% 100%, 6% 84%, 0% 50%, 6% 16%);
}

.mythic-summon-btn--ten .mythic-summon-btn__frame {
    clip-path: polygon(50% 0%, 94% 16%, 100% 50%, 94% 84%, 50% 100%, 6% 84%, 0% 50%, 6% 16%);
    background: linear-gradient(160deg, #5c4020 0%, #1e1006 30%, #120a04 50%, #3d2810 100%);
    box-shadow:
        inset 0 0 20px rgba(255, 120, 0, 0.22),
        inset 0 2px 0 rgba(255, 230, 180, 0.38),
        0 6px 20px rgba(0, 0, 0, 0.65);
}

.mythic-summon-btn__frame::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 3px;
    clip-path: inherit;
    background: linear-gradient(
        135deg,
        #ffd700,
        #c9a227,
        #8b5a18,
        #ffe8a8,
        #ff6b00,
        #ffd700
    );
    background-size: 200% 200%;
    animation: mythicMetalFlow 5s linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* 中央紅寶石（單抽盾牌） */
.mythic-summon-btn__shield-gem {
    position: absolute;
    left: 50%;
    top: 32%;
    z-index: 3;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #ff9aaa 0%, #e01030 35%, #6a0018 75%, #2a0008 100%);
    box-shadow:
        0 0 16px rgba(255, 40, 60, 0.9),
        0 0 32px rgba(255, 0, 80, 0.5),
        inset 0 -4px 8px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(255, 200, 220, 0.6);
    animation: mythicGemPulse 2s ease-in-out infinite;
    pointer-events: none;
}

.mythic-summon-btn__shield-gem::after {
    content: "";
    position: absolute;
    inset: 22% 28% 38% 32%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95), transparent 70%);
    opacity: 0.85;
}

/* 十連 · 魔法書核心 */
.mythic-summon-btn__grimoire {
    position: absolute;
    left: 50%;
    top: 34%;
    z-index: 3;
    width: 40px;
    height: 30px;
    margin: -15px 0 0 -20px;
    border-radius: 4px 4px 8px 8px;
    background: linear-gradient(180deg, #2a1848 0%, #120820 50%, #1e1030 100%);
    border: 2px solid rgba(255, 200, 100, 0.55);
    box-shadow:
        0 0 24px rgba(180, 80, 255, 0.55),
        inset 0 0 18px rgba(255, 120, 0, 0.35);
    pointer-events: none;
}

.mythic-summon-btn__grimoire::before,
.mythic-summon-btn__grimoire::after {
    content: "";
    position: absolute;
    top: -5px;
    width: 16px;
    height: 24px;
    background: linear-gradient(180deg, #3d2818, #1a0e06);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 2px 8px 2px 2px;
    box-shadow: inset 0 0 12px rgba(255, 180, 60, 0.25);
}

.mythic-summon-btn__grimoire::before {
    left: -8px;
    transform: rotate(-18deg);
}

.mythic-summon-btn__grimoire::after {
    right: -8px;
    transform: rotate(18deg);
    border-radius: 8px 2px 2px 2px;
}

/* 翅膀（十連） */
.mythic-summon-btn__wings {
    position: absolute;
    left: 50%;
    top: 30%;
    z-index: 2;
    width: min(88%, 100px);
    height: 36px;
    transform: translateX(-50%);
    pointer-events: none;
}

.mythic-summon-btn__wings::before,
.mythic-summon-btn__wings::after {
    content: "";
    position: absolute;
    top: 0;
    width: 46%;
    height: 34px;
    background: linear-gradient(145deg, rgba(255, 220, 140, 0.5), rgba(255, 100, 0, 0.15) 40%, transparent 70%);
    border: 1px solid rgba(255, 215, 0, 0.35);
    border-radius: 80% 20% 60% 40%;
    filter: drop-shadow(0 0 12px rgba(255, 180, 0, 0.45));
    animation: mythicWingPulse 2.8s ease-in-out infinite;
}

.mythic-summon-btn__wings::before {
    left: 0;
    transform: scaleX(-1) rotate(-8deg);
}

.mythic-summon-btn__wings::after {
    right: 0;
    transform: rotate(-8deg);
    animation-delay: 0.4s;
}

/* 十一顆寶石環 */
.mythic-summon-btn__gem-ring {
    position: absolute;
    left: 50%;
    top: 30%;
    z-index: 4;
    width: 68px;
    height: 68px;
    margin: -34px 0 0 -34px;
    animation: mythicRingSpin 24s linear infinite;
    pointer-events: none;
}

.mythic-summon-btn__gem-ring i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    margin: -4.5px 0 0 -4.5px;
    border-radius: 50%;
    transform: rotate(var(--a)) translateY(-30px);
    box-shadow: 0 0 8px currentColor;
    animation: mythicOrbTwinkle 2.4s ease-in-out infinite;
    animation-delay: calc(var(--a) / 360deg * -2.4s);
}

.mythic-summon-btn__gem-ring i:nth-child(1) { --a: 0deg; background: #ff3366; color: #ff3366; }
.mythic-summon-btn__gem-ring i:nth-child(2) { --a: 33deg; background: #ff9500; color: #ff9500; }
.mythic-summon-btn__gem-ring i:nth-child(3) { --a: 66deg; background: #ffd700; color: #ffd700; }
.mythic-summon-btn__gem-ring i:nth-child(4) { --a: 99deg; background: #7fff00; color: #7fff00; }
.mythic-summon-btn__gem-ring i:nth-child(5) { --a: 132deg; background: #00f5ff; color: #00f5ff; }
.mythic-summon-btn__gem-ring i:nth-child(6) { --a: 165deg; background: #b24bff; color: #b24bff; }
.mythic-summon-btn__gem-ring i:nth-child(7) { --a: 198deg; background: #ff6ec7; color: #ff6ec7; }
.mythic-summon-btn__gem-ring i:nth-child(8) { --a: 231deg; background: #ff4500; color: #ff4500; }
.mythic-summon-btn__gem-ring i:nth-child(9) { --a: 264deg; background: #e8ff88; color: #e8ff88; }
.mythic-summon-btn__gem-ring i:nth-child(10) { --a: 297deg; background: #4a90ff; color: #4a90ff; }
.mythic-summon-btn__gem-ring i:nth-child(11) { --a: 330deg; background: #fff; color: #fff; }

/* 火焰 */
.mythic-summon-btn__flame {
    position: absolute;
    bottom: 18%;
    z-index: 2;
    width: 22px;
    height: 36px;
    border-radius: 50% 50% 45% 45%;
    background: linear-gradient(180deg, rgba(255, 220, 80, 0.95) 0%, rgba(255, 80, 0, 0.85) 45%, rgba(180, 0, 0, 0.4) 100%);
    filter: blur(0.5px);
    opacity: 0.75;
    animation: mythicFlameDance 1.2s ease-in-out infinite;
    pointer-events: none;
}

.mythic-summon-btn__flame--l { left: 14%; animation-delay: 0s; }
.mythic-summon-btn__flame--r { right: 14%; animation-delay: 0.35s; }
.mythic-summon-btn__flame--epic-l { left: 12%; width: 22px; height: 36px; opacity: 0.85; }
.mythic-summon-btn__flame--epic-r { right: 12%; width: 22px; height: 36px; opacity: 0.85; animation-delay: 0.2s; }

/* 符文 I */
.mythic-summon-btn__rune {
    position: absolute;
    bottom: 10px;
    left: 50%;
    z-index: 5;
    transform: translateX(-50%);
    font-family: Orbitron, "Noto Sans TC", sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    color: rgba(255, 220, 140, 0.9);
    text-shadow:
        0 0 8px rgba(255, 180, 0, 0.9),
        0 0 16px rgba(255, 80, 0, 0.5);
    animation: mythicRuneFlicker 2.5s ease-in-out infinite;
    pointer-events: none;
}

/* 金屬銘牌 */
.mythic-summon-btn__badge {
    position: absolute;
    z-index: 8;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.1em;
    white-space: nowrap;
    background: linear-gradient(180deg, #5a4828 0%, #2a1c08 50%, #1a1004 100%);
    border: 1px solid rgba(255, 215, 0, 0.65);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 240, 200, 0.35),
        0 0 12px rgba(255, 180, 0, 0.35);
    color: #fff8e0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 1);
    pointer-events: none;
}

.mythic-summon-btn__badge--pity {
    top: 6px;
    left: 8px;
    transform: none;
}

.mythic-summon-btn__badge--pity .summon-btn__bonus {
    position: static;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    font-size: inherit;
    color: inherit;
    animation: none;
}

.mythic-summon-btn__badge--extra {
    top: 6px;
    right: 8px;
    left: auto;
    font-size: 8px;
    color: #ffe8a8;
    border-color: rgba(255, 140, 80, 0.7);
}

/* 文字區 */
.mythic-summon-btn__content {
    position: relative;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-height: var(--mythic-btn-h);
    padding: 38px 8px 10px;
    pointer-events: none;
}

.mythic-summon-btn__content--epic {
    min-height: var(--mythic-btn-h);
    padding: 38px 8px 10px;
    gap: 2px;
}

.mythic-summon-btn__title {
    font-family: Orbitron, "Noto Sans TC", sans-serif;
    font-size: clamp(15px, 2.2vw, 18px);
    font-weight: 900;
    letter-spacing: 0.14em;
    line-height: 1.2;
    color: #fff8f0;
    -webkit-text-fill-color: unset;
    background: linear-gradient(180deg, #fff 0%, #ffe8c8 40%, #ffb347 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.95));
    text-shadow: none;
    animation: mythicTitleShine 4s ease-in-out infinite;
}

.mythic-summon-btn__title--epic {
    font-size: clamp(15px, 2.2vw, 18px);
    letter-spacing: 0.08em;
    background: linear-gradient(180deg, #fff 0%, #ffd700 30%, #ff6b00 70%, #ff3366 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 8px rgba(255, 140, 0, 0.45));
}

.mythic-summon-btn__title::before,
.mythic-summon-btn__cost::before,
.mythic-summon-btn__sub::before {
    display: none;
}

.mythic-summon-btn__sub {
    min-height: 14px;
    line-height: 1.25;
    font-size: 10px;
}

.mythic-summon-btn__sub--reserve {
    visibility: hidden;
    pointer-events: none;
}

.mythic-summon-btn__cost {
    font-size: clamp(12px, 1.8vw, 14px);
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #ffe8b0 !important;
    -webkit-text-fill-color: #ffe8b0 !important;
    background: none !important;
    animation: none !important;
    text-shadow:
        0 1px 4px rgba(0, 0, 0, 1),
        0 0 10px rgba(255, 200, 80, 0.5);
}

.mythic-summon-btn__cost .void-coin-icon {
    vertical-align: -0.15em;
    margin-right: 2px;
}

.mythic-summon-btn__sub {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 220, 180, 0.85) !important;
    -webkit-text-fill-color: rgba(255, 220, 180, 0.85) !important;
    animation: none !important;
}

.mythic-summon-btn__shock {
    position: absolute;
    inset: 0;
    z-index: 10;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 55%, rgba(255, 240, 200, 0.55), transparent 55%);
}

/* —— 懸停 · 點擊 —— */
.mythic-summon-btn:hover {
    animation: mythicBtnHoverPulse 0.42s ease-in-out infinite;
    filter: brightness(1.12) saturate(1.1);
}

.mythic-summon-btn:hover .mythic-summon-btn__aura {
    animation: mythicAuraBurst 0.6s ease-out forwards;
}

.mythic-summon-btn:hover .mythic-summon-btn__shield-gem,
.mythic-summon-btn:hover .mythic-summon-btn__grimoire {
    animation: mythicGemBurst 0.5s ease-out;
}

.mythic-summon-btn:hover .mythic-summon-btn__flame {
    opacity: 1;
    animation: mythicFlameSurge 0.45s ease-out infinite alternate;
}

.mythic-summon-btn:hover .mythic-summon-btn__frame {
    box-shadow:
        inset 0 0 28px rgba(255, 160, 40, 0.35),
        0 0 32px rgba(255, 120, 0, 0.45),
        0 8px 24px rgba(0, 0, 0, 0.65);
}

.mythic-summon-btn:active {
    transform: translateY(2px) scale(0.97);
}

.mythic-summon-btn:active .mythic-summon-btn__shock {
    animation: mythicClickShock 0.55s ease-out forwards;
}

/* —— Keyframes —— */
@keyframes mythicBtnHoverPulse {
    0%, 100% {
        transform: translateY(-4px) scale(1.03);
    }
    25% {
        transform: translateY(-4px) scale(1.04) translateX(-2px);
    }
    75% {
        transform: translateY(-4px) scale(1.04) translateX(2px);
    }
}

@keyframes mythicAuraBreathe {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.04); }
}

@keyframes mythicAuraBurst {
    0% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
    100% { opacity: 0.75; transform: scale(1.05); }
}

@keyframes mythicMetalFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes mythicGemPulse {
    0%, 100% {
        box-shadow: 0 0 16px rgba(255, 40, 60, 0.9), 0 0 28px rgba(255, 0, 80, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 24px rgba(255, 80, 100, 1), 0 0 40px rgba(255, 50, 120, 0.65);
        transform: scale(1.08);
    }
}

@keyframes mythicGemBurst {
    0% { transform: scale(1); filter: brightness(1); }
    40% { transform: scale(1.2); filter: brightness(1.5); }
    100% { transform: scale(1.05); filter: brightness(1.15); }
}

@keyframes mythicFlameDance {
    0%, 100% { transform: scaleY(1) translateY(0); opacity: 0.7; }
    50% { transform: scaleY(1.15) translateY(-4px); opacity: 0.95; }
}

@keyframes mythicFlameSurge {
    0% { transform: scaleY(1.1) translateY(-2px); }
    100% { transform: scaleY(1.35) translateY(-8px); opacity: 1; }
}

@keyframes mythicRuneFlicker {
    0%, 100% { opacity: 0.65; }
    40% { opacity: 1; }
    70% { opacity: 0.8; }
}

@keyframes mythicWingPulse {
    0%, 100% { opacity: 0.55; transform: rotate(-8deg) scale(1); }
    50% { opacity: 0.9; transform: rotate(-6deg) scale(1.05); }
}

@keyframes mythicRingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes mythicOrbTwinkle {
    0%, 100% { opacity: 0.65; filter: brightness(0.9); }
    50% { opacity: 1; filter: brightness(1.4); }
}

@keyframes mythicTitleShine {
    0%, 100% { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.95)) brightness(1); }
    50% { filter: drop-shadow(0 0 12px rgba(255, 200, 80, 0.6)) brightness(1.15); }
}

@keyframes mythicClickShock {
    0% {
        opacity: 0.9;
        transform: scale(0.85);
    }
    40% {
        opacity: 0.7;
        transform: scale(1.15);
    }
    100% {
        opacity: 0;
        transform: scale(1.45);
    }
}

@media (max-width: 520px) {
    .summon-console__actions--mythic {
        --mythic-btn-h: 118px;
        gap: 8px;
    }

    .mythic-summon-btn__gem-ring {
        width: 60px;
        height: 60px;
        margin: -30px 0 0 -30px;
    }

    .mythic-summon-btn__gem-ring i {
        transform: rotate(var(--a)) translateY(-26px);
    }

    .mythic-summon-btn__badge {
        font-size: 8px;
        padding: 2px 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mythic-summon-btn__aura,
    .mythic-summon-btn__frame::before,
    .mythic-summon-btn__shield-gem,
    .mythic-summon-btn__flame,
    .mythic-summon-btn__rune,
    .mythic-summon-btn__gem-ring,
    .mythic-summon-btn__gem-ring i,
    .mythic-summon-btn__wings::before,
    .mythic-summon-btn__wings::after,
    .mythic-summon-btn__title {
        animation: none !important;
    }

    .mythic-summon-btn__title,
    .mythic-summon-btn__title--epic {
        -webkit-text-fill-color: #fff8f0;
        color: #fff8f0;
        background: none;
    }
}
