.crystal-bond-card {
    position: relative;
    overflow: hidden;
}

.crystal-bond-visual {
    --crystal-growth: .58;
    --crystal-color-intensity: 0;
    --crystal-vein-intensity: 0;
    --crystal-tip-length: 0;
    --crystal-satellite-detail: 0;
    --crystal-symmetry: 0;
    --crystal-inner-veins: 0;
    --guardian-awakening: 0;
    --guardian-resonance: 0;
    --resonance-light: 255, 255, 255;
    position: relative;
    width: 180px;
    height: 190px;
    flex: 0 0 180px;
    isolation: isolate;
    filter: drop-shadow(0 18px 28px rgba(10, 14, 28, .3));
}

.crystal-bond-atmosphere,
.crystal-bond-energy-rings,
.crystal-bond-base,
.crystal-bond-foreground {
    display: none;
}

.crystal-bond-core {
    position: absolute;
    inset: 8px 31px 12px;
    transform: scale(var(--crystal-growth));
    transform-origin: 50% 88%;
    transition: transform 800ms cubic-bezier(.2, .7, .2, 1);
    z-index: 4;
}

.crystal-bond-facet {
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0, 88% 24%, 100% 62%, 68% 100%, 27% 91%, 0 58%, 13% 22%);
    background:
        linear-gradient(124deg, rgba(255,255,255,.98) 0 18%, rgba(219,225,236,.62) 19% 37%, transparent 38%),
        linear-gradient(214deg, transparent 0 31%, rgba(255,255,255,.88) 32% 50%, rgba(189,198,215,.68) 51% 68%, transparent 69%),
        linear-gradient(153deg, #fdfefe 0%, #dfe4ee 24%, #ffffff 46%, #b9c1d0 72%, #eef1f6 100%);
    border: 1px solid rgba(255,255,255,.72);
    box-shadow:
        inset 12px 4px 18px rgba(255,255,255,.7),
        inset -13px -8px 20px rgba(105,116,139,.24),
        inset 0 0 26px rgba(255,255,255,.26);
}

.crystal-bond-facet::before,
.crystal-bond-facet::after {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: inherit;
    pointer-events: none;
}

.crystal-bond-facet::before {
    z-index: 1;
    background:
        linear-gradient(74deg, transparent 0 27%, rgba(104,114,135,.34) 28% 29%, rgba(255,255,255,.5) 30% 48%, transparent 49%),
        linear-gradient(116deg, transparent 0 44%, rgba(112,123,145,.28) 45% 46%, rgba(255,255,255,.64) 47% 63%, transparent 64%),
        linear-gradient(163deg, transparent 0 59%, rgba(115,126,148,.3) 60% 61%, rgba(255,255,255,.44) 62% 76%, transparent 77%);
    mix-blend-mode: multiply;
    opacity: .72;
}

.crystal-bond-facet::after {
    z-index: 2;
    background: linear-gradient(
        145deg,
        transparent 3%,
        rgba(var(--resonance-light), .8) 22%,
        rgba(var(--resonance-light), .42) 58%,
        transparent 96%
    );
    opacity: var(--crystal-color-intensity);
    mix-blend-mode: color;
}

[data-crystal-resonance="moonlight"] { --resonance-light: 194, 216, 255; }
[data-crystal-resonance="ice"] { --resonance-light: 190, 239, 255; }
[data-crystal-resonance="silver"] { --resonance-light: 225, 228, 238; }
[data-crystal-resonance="pearl"] { --resonance-light: 255, 224, 235; }
[data-crystal-resonance="aurora"] { --resonance-light: 197, 211, 255; }
[data-crystal-resonance="pure_light"] { --resonance-light: 255, 250, 231; }

.crystal-bond-veins {
    position: absolute;
    inset: 18% 20%;
    z-index: 2;
    opacity: calc(.1 + var(--crystal-vein-intensity) + var(--crystal-inner-veins));
    background:
        linear-gradient(72deg, transparent 42%, rgba(103,111,130,.48) 44% 45%, transparent 47%),
        linear-gradient(112deg, transparent 52%, rgba(137,145,162,.42) 54% 55%, transparent 57%),
        linear-gradient(72deg, transparent 42%, rgba(156,115,255,var(--crystal-vein-intensity)) 44% 46%, transparent 48%),
        linear-gradient(112deg, transparent 52%, rgba(99,211,255,var(--crystal-vein-intensity)) 54% 56%, transparent 58%);
    filter: blur(.2px);
}

.crystal-bond-tip {
    position: absolute;
    width: 28px;
    height: calc(48px + 24px * var(--crystal-tip-length));
    bottom: 19px;
    clip-path: polygon(50% 0, 100% 70%, 52% 100%, 0 72%);
    background: linear-gradient(145deg, #fff, #dce4f4 60%, #aeb9d0);
    opacity: .93;
    z-index: 3;
}

.crystal-bond-tip.left {
    left: 28px;
    transform: rotate(-26deg) scale(calc(.72 + var(--crystal-symmetry) * .25));
}

.crystal-bond-tip.right {
    right: 27px;
    transform: rotate(28deg) scale(calc(.66 + var(--crystal-symmetry) * .3));
}

.crystal-bond-shards {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.crystal-bond-guardian {
    position: absolute;
    z-index: 1;
    width: 230px;
    height: 184px;
    top: 0;
    right: -42px;
    overflow: hidden;
    opacity: .58;
    transform-origin: 67% 62%;
    animation: crystal-guardian-float 15s ease-in-out infinite;
    pointer-events: none;
    user-select: none;
}

.crystal-bond-guardian-art {
    position: absolute;
    right: 0;
    bottom: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right bottom;
    filter:
        drop-shadow(0 0 calc(3px + 7px * var(--guardian-awakening)) rgba(106, 72, 211, .34))
        drop-shadow(0 10px 18px rgba(0, 0, 0, .24));
    transform-origin: 67% 56%;
    animation: crystal-guardian-breathe 17s ease-in-out infinite;
}

.crystal-bond-guardian-chest-glow {
    position: absolute;
    z-index: 1;
    left: 58%;
    top: 46%;
    width: 9%;
    aspect-ratio: 1;
    border-radius: 50%;
    translate: -50% -50%;
    background: radial-gradient(
        circle,
        rgba(255,255,255,.32),
        rgba(151,98,255,.2) 38%,
        transparent 72%
    );
    opacity: calc(.2 + var(--guardian-awakening) * .2 + var(--guardian-resonance) * .16);
    filter: blur(1.8px);
    animation: crystal-guardian-core 14s ease-in-out infinite;
}

[data-crystal-phase="shards"] .crystal-bond-guardian,
[data-crystal-phase="awakening"] .crystal-bond-guardian {
    opacity: .75;
}

[data-crystal-phase="living"] .crystal-bond-guardian,
[data-crystal-phase="resonance"] .crystal-bond-guardian {
    opacity: .88;
}

.bond-card .crystal-bond-guardian,
.bond.crystal-bond-card .crystal-bond-guardian {
    width: 286px;
    height: 224px;
    top: -2px;
    right: -55px;
}

@keyframes crystal-guardian-float {
    0%, 100% { transform: translate3d(0, 1px, 0) rotate(-.25deg); }
    50% { transform: translate3d(0, -4px, 0) rotate(.35deg); }
}

@keyframes crystal-guardian-breathe {
    0%, 100% { transform: scale(1); opacity: .96; }
    50% { transform: scale(1.012); opacity: 1; }
}

@keyframes crystal-guardian-core {
    0%, 100% { transform: scale(.94); opacity: .54; }
    50% { transform: scale(1.06); opacity: .88; }
}

.crystal-bond-shard {
    position: absolute;
    left: calc(16px + var(--shard-x) * 1px);
    top: calc(26px + var(--shard-y) * 1px);
    width: calc(8px + var(--crystal-satellite-detail) * 10px);
    height: calc(22px + var(--crystal-satellite-detail) * 12px);
    transform: rotate(calc(var(--shard-angle) * 1deg));
    clip-path: polygon(50% 0, 100% 68%, 52% 100%, 0 72%);
    background: linear-gradient(145deg, #fff, #dce5f5 63%, #9eaac2);
    opacity: .88;
    box-shadow: inset -3px -4px 8px rgba(94,105,127,.22);
}

.crystal-bond-copy {
    min-width: 0;
}

.crystal-bond-copy h2,
.crystal-bond-copy h3 {
    margin: 6px 0 8px;
}

.crystal-bond-copy p {
    margin: 0;
    color: var(--muted, #aeb2c3);
    line-height: 1.65;
}

.bond-card .crystal-bond-visual,
.bond.crystal-bond-card .crystal-bond-visual {
    width: 210px;
    height: 218px;
    flex-basis: 210px;
}

/* Analyse: gemeinsame, geschichtete Szene aus Bond und offiziellem Wächter. */
.bond.crystal-bond-scene {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "copy"
        "scene";
    align-content: start;
    min-height: 548px;
    padding: 28px 30px 18px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.bond.crystal-bond-scene .crystal-bond-copy {
    grid-area: copy;
    position: relative;
    z-index: 10;
    max-width: 340px;
    min-width: 0;
}

.bond.crystal-bond-scene .crystal-bond-copy p {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.bond.crystal-bond-scene .crystal-bond-visual {
    grid-area: scene;
    width: min(100%, 520px);
    height: 390px;
    flex-basis: auto;
    margin: -12px auto 0;
    overflow: visible;
    filter: none;
}

.bond.crystal-bond-scene .crystal-bond-atmosphere,
.bond.crystal-bond-scene .crystal-bond-energy-rings,
.bond.crystal-bond-scene .crystal-bond-base,
.bond.crystal-bond-scene .crystal-bond-foreground {
    display: block;
    position: absolute;
    pointer-events: none;
}

.bond.crystal-bond-scene .crystal-bond-atmosphere {
    z-index: 0;
    inset: 5% -7% -3%;
    background:
        radial-gradient(ellipse at 57% 51%, rgba(146, 106, 235, .2), transparent 40%),
        radial-gradient(circle at 70% 50%, rgba(214, 197, 255, .1), transparent 27%),
        radial-gradient(circle at 38% 69%, rgba(245, 241, 255, .15), transparent 34%),
        radial-gradient(circle at 25% 23%, rgba(255,255,255,.5) 0 1px, transparent 1.8px),
        radial-gradient(circle at 81% 31%, rgba(198,181,255,.4) 0 1px, transparent 1.8px);
    filter: blur(.2px);
    opacity: .72;
    animation: crystal-scene-glow 18s ease-in-out infinite;
}

.bond.crystal-bond-scene .crystal-bond-energy-rings {
    z-index: 2;
    left: 5%;
    bottom: 5%;
    width: 66%;
    height: 23%;
    border: 1px solid rgba(220, 210, 255, .24);
    border-radius: 50%;
    box-shadow:
        0 0 18px rgba(150, 112, 255, .13),
        inset 0 0 16px rgba(255,255,255,.08);
    transform: rotate(-4deg);
    opacity: calc(.32 + var(--crystal-vein-intensity) * .18);
    animation: crystal-energy-ring 16s ease-in-out infinite;
}

.bond.crystal-bond-scene .crystal-bond-energy-rings::before,
.bond.crystal-bond-scene .crystal-bond-energy-rings::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(168, 136, 255, .16);
    border-radius: 50%;
}

.bond.crystal-bond-scene .crystal-bond-energy-rings::before {
    inset: 20% -8%;
}

.bond.crystal-bond-scene .crystal-bond-energy-rings::after {
    inset: 34% 8%;
}

.bond.crystal-bond-scene .crystal-bond-guardian {
    z-index: 1;
    width: 440px;
    height: 360px;
    top: 2px;
    right: 20px;
    opacity: .66;
}

.bond.crystal-bond-scene .crystal-bond-guardian-art {
    object-position: right bottom;
}

.bond.crystal-bond-scene .crystal-bond-guardian-chest-glow {
    left: 58%;
    top: 46%;
}

.bond.crystal-bond-scene .crystal-bond-core {
    z-index: 6;
    inset: 23px auto 28px 62px;
    width: 182px;
    height: 337px;
    filter:
        drop-shadow(0 0 12px rgba(255,255,255,.3))
        drop-shadow(0 24px 30px rgba(14, 10, 35, .5));
}

.bond.crystal-bond-scene .crystal-bond-tip {
    z-index: 5;
    bottom: 34px;
    width: 57px;
    height: calc(92px + 40px * var(--crystal-tip-length));
    opacity: 0;
    transition: opacity 700ms ease, transform 800ms ease;
}

.bond.crystal-bond-scene .crystal-bond-tip.left {
    left: 35px;
}

.bond.crystal-bond-scene .crystal-bond-tip.right {
    right: auto;
    left: 224px;
}

.bond.crystal-bond-scene .crystal-bond-shards {
    z-index: 7;
}

.bond.crystal-bond-scene .crystal-bond-shard {
    left: calc(48px + var(--shard-x) * 1.32px);
    top: calc(56px + var(--shard-y) * 1.22px);
    filter: drop-shadow(0 0 7px rgba(255,255,255,.2));
}

.bond.crystal-bond-scene .crystal-bond-base {
    z-index: 4;
    left: 4px;
    bottom: 16px;
    width: 330px;
    height: 86px;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 50% 72%, rgba(255,255,255,.48), rgba(213,203,244,.18) 34%, transparent 68%),
        linear-gradient(164deg, transparent 32%, rgba(225,228,239,.32) 33% 48%, rgba(68,57,88,.58) 49% 65%, transparent 66%);
    clip-path: polygon(2% 67%, 10% 43%, 19% 55%, 28% 25%, 36% 58%, 44% 10%, 52% 52%, 61% 17%, 69% 55%, 79% 29%, 87% 55%, 97% 45%, 99% 70%, 84% 91%, 15% 93%);
    opacity: .34;
    transform: scale(.72);
    transform-origin: 50% 80%;
    transition: opacity 700ms ease, transform 800ms ease;
}

.bond.crystal-bond-scene .crystal-bond-base::before,
.bond.crystal-bond-scene .crystal-bond-base::after {
    content: "";
    position: absolute;
    bottom: 14%;
    background: linear-gradient(145deg, #fff, #dfe5f0 62%, #aeb8cc);
    filter: drop-shadow(0 0 6px rgba(255,255,255,.22));
}

.bond.crystal-bond-scene .crystal-bond-base::before {
    left: 11%;
    width: 43%;
    height: 68%;
    clip-path: polygon(2% 100%, 18% 54%, 29% 84%, 42% 20%, 53% 72%, 67% 3%, 80% 69%, 96% 100%);
}

.bond.crystal-bond-scene .crystal-bond-base::after {
    right: 8%;
    width: 44%;
    height: 72%;
    clip-path: polygon(1% 100%, 17% 58%, 29% 80%, 43% 5%, 56% 72%, 71% 24%, 82% 67%, 98% 100%);
}

.bond.crystal-bond-scene .crystal-bond-foreground {
    z-index: 8;
    left: 24px;
    bottom: 18px;
    width: 292px;
    height: 35px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255,255,255,.38), rgba(190,166,255,.14) 42%, transparent 73%);
    box-shadow: 96px -72px 54px rgba(133, 91, 224, .07);
    filter: blur(2.4px);
}

.bond.crystal-bond-scene[data-crystal-phase="shards"] .crystal-bond-base {
    opacity: .42;
    transform: scale(.78);
}

.bond.crystal-bond-scene[data-crystal-phase="awakening"] .crystal-bond-tip,
.bond.crystal-bond-scene[data-crystal-phase="living"] .crystal-bond-tip,
.bond.crystal-bond-scene[data-crystal-phase="resonance"] .crystal-bond-tip {
    opacity: .93;
}

.bond.crystal-bond-scene[data-crystal-phase="awakening"] .crystal-bond-base {
    opacity: .58;
    transform: scale(.86);
}

.bond.crystal-bond-scene[data-crystal-phase="living"] .crystal-bond-base {
    opacity: .72;
    transform: scale(.95);
}

.bond.crystal-bond-scene[data-crystal-phase="resonance"] .crystal-bond-base {
    opacity: .82;
    transform: scale(1);
}

.bond.crystal-bond-scene[data-crystal-resonance="neutral"] .crystal-bond-facet::after {
    opacity: 0;
}

@keyframes crystal-scene-glow {
    0%, 100% { opacity: .62; transform: scale(.99); }
    50% { opacity: .78; transform: scale(1.01); }
}

@keyframes crystal-energy-ring {
    0%, 100% { transform: rotate(-4deg) scale(.98); opacity: .3; }
    50% { transform: rotate(-2deg) scale(1.015); opacity: .42; }
}

@media (prefers-reduced-motion: reduce) {
    .crystal-bond-core,
    .crystal-bond-guardian,
    .crystal-bond-guardian-art,
    .crystal-bond-guardian-chest-glow,
    .crystal-bond-atmosphere,
    .crystal-bond-energy-rings {
        transition: none;
        animation: none;
    }
}

body.no-animations .crystal-bond-guardian,
body.no-animations .crystal-bond-guardian-art,
body.no-animations .crystal-bond-guardian-chest-glow,
.crystal-bond-static .crystal-bond-guardian,
.crystal-bond-static .crystal-bond-guardian-art,
.crystal-bond-static .crystal-bond-guardian-chest-glow,
.crystal-bond-static .crystal-bond-atmosphere,
.crystal-bond-static .crystal-bond-energy-rings {
    animation: none;
}

@media (max-width: 900px) {
    .crystal-bond-guardian,
    .bond-card .crystal-bond-guardian,
    .bond.crystal-bond-card .crystal-bond-guardian {
        width: 225px;
        height: 180px;
        top: 1px;
        right: -30px;
    }

    .bond.crystal-bond-scene {
        min-height: 505px;
    }

    .bond.crystal-bond-scene .crystal-bond-visual {
        width: min(100%, 455px);
        height: 350px;
    }

    .bond.crystal-bond-scene .crystal-bond-guardian {
        width: 405px;
        height: 310px;
        top: 12px;
        right: 15px;
    }

    .bond.crystal-bond-scene .crystal-bond-core {
        inset: 66px auto 30px 66px;
        width: 137px;
        height: 250px;
    }

    .bond.crystal-bond-scene .crystal-bond-tip.left {
        left: 44px;
    }

    .bond.crystal-bond-scene .crystal-bond-tip.right {
        left: 188px;
    }
}

@media (max-width: 620px) {
    .grid > *,
    .crystal-bond-card {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .crystal-bond-visual,
    .bond-card .crystal-bond-visual,
    .bond.crystal-bond-card .crystal-bond-visual {
        width: min(175px, 52vw);
        height: min(184px, 55vw);
        flex-basis: min(175px, 52vw);
        margin-inline: auto;
    }

    .crystal-bond-guardian,
    .bond-card .crystal-bond-guardian,
    .bond.crystal-bond-card .crystal-bond-guardian {
        width: 190px;
        height: 152px;
        top: 4px;
        right: -18px;
    }

    .crystal-bond-guardian-chest-glow {
        opacity: calc(.14 + var(--guardian-awakening) * .15);
    }

    .bond.crystal-bond-scene {
        min-height: 440px;
        padding: 22px 16px 12px;
    }

    .bond.crystal-bond-scene .crystal-bond-copy {
        max-width: none;
    }

    .bond.crystal-bond-scene .crystal-bond-visual {
        width: min(100%, 340px);
        height: 300px;
        margin-top: -2px;
    }

    .bond.crystal-bond-scene .crystal-bond-guardian {
        width: 300px;
        height: 227px;
        top: 19px;
        right: 65px;
    }

    .bond.crystal-bond-scene .crystal-bond-core {
        inset: 67px auto 28px 39px;
        width: 112px;
        height: 205px;
    }

    .bond.crystal-bond-scene .crystal-bond-tip {
        bottom: 30px;
        width: 34px;
        height: calc(58px + 22px * var(--crystal-tip-length));
    }

    .bond.crystal-bond-scene .crystal-bond-tip.left {
        left: 26px;
    }

    .bond.crystal-bond-scene .crystal-bond-tip.right {
        left: 137px;
    }

    .bond.crystal-bond-scene .crystal-bond-base {
        left: 2px;
        bottom: 15px;
        width: 198px;
        height: 52px;
    }

    .bond.crystal-bond-scene .crystal-bond-foreground {
        left: 22px;
        bottom: 20px;
        width: 155px;
    }

    .bond.crystal-bond-scene .crystal-bond-shard {
        left: calc(22px + var(--shard-x) * .96px);
        top: calc(55px + var(--shard-y) * .92px);
    }

    .bond.crystal-bond-scene .crystal-bond-energy-rings {
        left: 0;
        bottom: 4%;
        width: 61%;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .crystal-bond-visual,
    .bond-card .crystal-bond-visual,
    .bond.crystal-bond-card .crystal-bond-visual {
        width: 142px;
        height: 150px;
        flex-basis: 142px;
    }

    .crystal-bond-guardian,
    .bond-card .crystal-bond-guardian,
    .bond.crystal-bond-card .crystal-bond-guardian {
        width: 150px;
        height: 120px;
        top: 2px;
        right: -12px;
    }

    .bond.crystal-bond-scene {
        min-height: 330px;
        grid-template-columns: minmax(118px, .62fr) minmax(150px, 1fr);
        grid-template-areas: "scene copy";
        align-items: center;
        gap: 8px;
    }

    .bond.crystal-bond-scene .crystal-bond-visual {
        width: 210px;
        height: 210px;
        margin: 0 0 0 -26px;
    }

    .bond.crystal-bond-scene .crystal-bond-guardian {
        width: 190px;
        height: 148px;
        top: 17px;
        right: 4px;
    }

    .bond.crystal-bond-scene .crystal-bond-core {
        inset: 50px auto 23px 27px;
        width: 77px;
        height: 140px;
    }

    .bond.crystal-bond-scene .crystal-bond-tip {
        bottom: 24px;
        width: 25px;
        height: 43px;
    }

    .bond.crystal-bond-scene .crystal-bond-tip.left {
        left: 18px;
    }

    .bond.crystal-bond-scene .crystal-bond-tip.right {
        left: 96px;
    }

    .bond.crystal-bond-scene .crystal-bond-base {
        left: 1px;
        bottom: 12px;
        width: 140px;
        height: 38px;
    }

    .bond.crystal-bond-scene .crystal-bond-foreground {
        left: 14px;
        bottom: 15px;
        width: 110px;
    }

    .bond.crystal-bond-scene .crystal-bond-shard {
        left: calc(7px + var(--shard-x) * .68px);
        top: calc(37px + var(--shard-y) * .64px);
    }
}
