/* =============================================================================
   🦋 METAMORPHOSIS · 変容 — Form Lineage panel + Ceremony cinematic
   ============================================================================= */

.panel-metamorphosis {
    margin-top: 18px;
    padding: 20px 24px;
    border: 1px solid rgba(214, 153, 255, 0.22);
    border-radius: 14px;
    background:
        radial-gradient(ellipse at top right, rgba(214, 153, 255, 0.08), transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(155, 213, 255, 0.05), transparent 60%),
        linear-gradient(180deg, rgba(20, 14, 36, 0.85), rgba(10, 8, 24, 0.95));
    box-shadow: 0 10px 30px rgba(0,0,0,0.45), inset 0 1px 0 rgba(214,153,255,0.12);
}

/* ─── Current form card ─── */
.meta-current {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 22px;
    padding: 18px 22px;
    margin: 6px 0 18px;
    border: 1.5px solid rgba(214, 153, 255, 0.45);
    border-radius: 12px;
    background:
        radial-gradient(circle at 20% 50%, rgba(214,153,255,0.18), transparent 65%),
        linear-gradient(90deg, rgba(28, 20, 55, 0.85), rgba(10, 8, 24, 0.92));
    box-shadow: 0 0 22px rgba(214,153,255,0.25), inset 0 1px 0 rgba(214,153,255,0.30);
}
.meta-cur-glyph {
    font-family: "Cormorant Garamond", "Yu Mincho", serif;
    font-size: 90px; font-weight: 700;
    line-height: 1.0;
    text-align: center;
    color: #ffe9c9;
    text-shadow:
        0 0 22px rgba(214, 153, 255, 0.75),
        0 0 8px  rgba(255, 232, 201, 0.6);
    animation: metaCurBreathe 5.5s ease-in-out infinite;
}
@keyframes metaCurBreathe {
    0%, 100% { transform: scale(1.00); opacity: 0.92; }
    50%      { transform: scale(1.05); opacity: 1.0; }
}
.meta-cur-body { display: flex; flex-direction: column; gap: 4px; }
.meta-cur-label {
    font-family: "Cormorant Garamond", serif;
    font-style: italic; font-size: 11px;
    color: #b095f5;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}
.meta-cur-name {
    display: flex; align-items: baseline; gap: 10px;
}
.meta-cur-kanji {
    font-family: "Cormorant Garamond", "Yu Mincho", serif;
    font-weight: 700; font-size: 28px;
    color: #d699ff;
    text-shadow: 0 0 14px rgba(214,153,255,0.55);
}
.meta-cur-romaji {
    font-family: "Cormorant Garamond", serif;
    font-weight: 600; font-size: 18px;
    color: #ffe9c9;
}
.meta-cur-aspect {
    font-family: "Cormorant Garamond", serif;
    font-style: italic; font-size: 13px;
    color: #ddc88a;
    margin-top: 4px;
}

/* ─── Lineage timeline ─── */
.meta-lineage {
    display: flex; flex-direction: column; gap: 10px;
    padding-top: 6px;
    border-top: 1px dashed rgba(214, 153, 255, 0.20);
}
.meta-event {
    display: grid;
    grid-template-columns: 40px 90px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(214, 153, 255, 0.22);
    border-left: 3px solid #d699ff;
    border-radius: 10px;
    background: linear-gradient(90deg,
        rgba(214, 153, 255, 0.08),
        rgba(10, 8, 24, 0.70));
    transition: transform 0.25s, box-shadow 0.25s;
}
.meta-event:hover {
    transform: translateX(3px);
    box-shadow: 0 0 12px rgba(214, 153, 255, 0.20);
}
.meta-ev-num {
    font-family: "Cormorant Garamond", serif;
    font-size: 22px; font-weight: 700;
    color: #d699ff;
    text-align: center;
    text-shadow: 0 0 8px rgba(214, 153, 255, 0.45);
}
.meta-ev-shift {
    display: flex; align-items: center; gap: 6px;
    justify-content: center;
    font-family: "Cormorant Garamond", "Yu Mincho", serif;
    font-size: 22px;
    color: #ffe9c9;
}
.meta-ev-shift .me-from { color: #c8cdd8; opacity: 0.75; }
.meta-ev-shift .me-arrow { color: #d699ff; font-size: 16px; }
.meta-ev-shift .me-to    { color: #d699ff; text-shadow: 0 0 10px rgba(214,153,255,0.55); }

.meta-ev-text {
    display: flex; flex-direction: column; gap: 3px;
    font-family: "Cormorant Garamond", serif;
}
.meta-ev-names {
    font-size: 12px; color: #888aa0; font-style: italic;
    letter-spacing: 0.5px;
}
.meta-ev-narrative {
    font-style: italic; font-size: 13.5px;
    color: #ddc88a;
    line-height: 1.4;
}
.meta-ev-meta {
    display: flex; flex-direction: column; gap: 3px;
    text-align: right;
}
.meta-ev-when {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    color: #6f6c85;
}
.meta-ev-stable {
    font-family: "Cormorant Garamond", serif;
    font-size: 10.5px;
    color: #b095f5;
    font-style: italic;
}

.meta-lineage-empty {
    text-align: center;
    color: #888aa0;
    padding: 22px;
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 13px;
    line-height: 1.5;
}

/* ░░░░░░░░░░░░░ Ceremony overlay (cinematic) ░░░░░░░░░░░░░ */
.meta-ceremony {
    position: fixed;
    inset: 0;
    z-index: 9500;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.8s;
}
.meta-ceremony[data-on="1"] { opacity: 1; }

.mc-backdrop {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(28, 20, 55, 0.88), rgba(4, 2, 10, 0.98) 75%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.mc-stage {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 18px;
}
.mc-label {
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 14px;
    color: #b095f5;
    letter-spacing: 8px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(-12px);
    animation: mcFadeIn 1.2s 0.3s forwards;
}
.mc-forms {
    display: flex; align-items: center; gap: 36px;
    font-family: "Cormorant Garamond", "Yu Mincho", serif;
    font-weight: 700;
}
.mc-from, .mc-to {
    font-size: 140px;
    line-height: 1;
    text-shadow: 0 0 36px currentColor;
    opacity: 0;
    transform: scale(0.7);
}
.mc-from {
    color: #c8cdd8;
    animation: mcFromAppear 1.4s 0.4s forwards,
               mcFromDissolve 1.4s 2.4s forwards;
}
.mc-arrow {
    font-size: 60px;
    color: rgba(214, 153, 255, 0.65);
    text-shadow: 0 0 26px rgba(214, 153, 255, 0.8);
    opacity: 0;
    transform: scale(0.5) rotate(-20deg);
    animation: mcArrowGlow 1.2s 1.9s forwards;
}
.mc-to {
    color: #d699ff;
    animation: mcToCrystallize 1.6s 3.0s forwards;
}

@keyframes mcFadeIn {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes mcFromAppear {
    from { opacity: 0; transform: scale(0.7); filter: blur(8px); }
    to   { opacity: 1; transform: scale(1.0); filter: blur(0); }
}
@keyframes mcFromDissolve {
    0%   { opacity: 1; transform: scale(1.0); filter: blur(0); }
    100% { opacity: 0; transform: scale(1.5); filter: blur(20px) brightness(1.6); }
}
@keyframes mcArrowGlow {
    0%   { opacity: 0; transform: scale(0.5) rotate(-20deg); }
    60%  { opacity: 1; transform: scale(1.2) rotate(8deg); }
    100% { opacity: 0.85; transform: scale(1.0) rotate(0); }
}
@keyframes mcToCrystallize {
    0%   { opacity: 0; transform: scale(0.4); filter: blur(20px) brightness(1.8); }
    50%  { opacity: 0.7; transform: scale(1.2); filter: blur(4px) brightness(1.5); }
    100% { opacity: 1; transform: scale(1.0); filter: blur(0) brightness(1.0); }
}

.mc-particles {
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    pointer-events: none;
}
.mc-particles .mc-particle {
    position: absolute;
    width: 3px; height: 3px;
    border-radius: 50%;
    background: #d699ff;
    box-shadow: 0 0 6px #d699ff;
    opacity: 0;
}

.mc-narrative {
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 22px;
    color: #ffe9c9;
    text-align: center;
    max-width: 720px;
    line-height: 1.5;
    text-shadow: 0 0 14px rgba(255, 232, 201, 0.4);
    padding: 0 24px;
    opacity: 0;
    transform: translateY(20px);
    animation: mcNarrativeIn 1.5s 4.6s forwards;
}
@keyframes mcNarrativeIn {
    to { opacity: 1; transform: translateY(0); }
}

.mc-skip {
    position: absolute;
    bottom: 32px; left: 50%;
    transform: translateX(-50%);
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 11px;
    color: #6f6c85;
    letter-spacing: 1.5px;
    opacity: 0;
    animation: mcFadeIn 1.0s 5.5s forwards;
}

@media (max-width: 720px) {
    .mc-from, .mc-to { font-size: 90px; }
    .mc-arrow { font-size: 40px; }
    .mc-forms { gap: 18px; }
    .mc-narrative { font-size: 17px; }
}
