﻿:root {
    --bg-1: #090a12;
    --bg-2: #15182a;
    --ink: #2f2217;
    --ink-soft: #584637;
    --gold: #c8a468;
    --paper-1: #f8eccc;
    --paper-2: #ecd8ad;
    --paper-edge: #b1874d;
    --rose-1: #ff97cc;
    --rose-2: #ff4ea1;
    --rose-3: #ffd6ec;
    --shadow-deep: rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: 'Marcellus', serif;
    font-size: 16.8px;
    background: linear-gradient(165deg, var(--bg-1), var(--bg-2));
    color: var(--ink);
    overflow: hidden;
    cursor: none;
}

body.intro-locked .scroll-wrapper {
    filter: blur(9px) saturate(0.85) brightness(0.85);
    transform: scale(0.992);
    pointer-events: none;
}

body.intro-locked .wand-cursor {
    opacity: 0.96;
    filter: drop-shadow(0 0 10px rgba(255, 118, 191, 0.65)) drop-shadow(0 0 20px rgba(170, 105, 255, 0.38));
}

.scene-backdrop,
.scene-grain,
.arcane-wave,
.ambient-backdrop,
.petal-field,
.ambient-foreground {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.scene-backdrop {
    background:
        radial-gradient(circle at 15% 23%, rgba(255, 151, 204, 0.17), rgba(255, 151, 204, 0) 33%),
        radial-gradient(circle at 84% 18%, rgba(255, 78, 161, 0.14), rgba(255, 78, 161, 0) 31%),
        radial-gradient(circle at 72% 84%, rgba(255, 214, 236, 0.12), rgba(255, 214, 236, 0) 34%),
        linear-gradient(150deg, #0b0f1a 0%, #161d2d 68%, #090a12 100%);
    z-index: -3;
}

.arcane-wave {
    background:
        conic-gradient(from 0deg at 50% 50%, rgba(255, 118, 191, 0.08), rgba(255, 214, 236, 0.03), rgba(168, 109, 255, 0.08), rgba(255, 118, 191, 0.08));
    mix-blend-mode: screen;
    animation: rotateWave 28s linear infinite, hueShift 16s linear infinite;
    z-index: -2;
}

@keyframes rotateWave {
    from {
        transform: rotate(0deg) scale(1);
    }
    to {
        transform: rotate(360deg) scale(1.06);
    }
}

.scene-grain {
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 2px),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.02) 0 1px, transparent 1px 3px);
    mix-blend-mode: soft-light;
    opacity: 0.72;
    z-index: -1;
}

.ambient-backdrop {
    z-index: 1;
}

.petal-field {
    z-index: 8;
}

.ambient-foreground {
    z-index: 10001;
}

.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 30%, rgba(255, 176, 227, 0.28), rgba(255, 176, 227, 0) 52%),
        radial-gradient(circle at 50% 80%, rgba(171, 121, 255, 0.2), rgba(171, 121, 255, 0) 48%),
        rgba(12, 8, 18, 0.58);
    backdrop-filter: blur(10px);
    transition: opacity 420ms ease, visibility 420ms ease;
}

.intro-overlay::before {
    content: '';
    position: absolute;
    inset: -12%;
    pointer-events: none;
    background:
        conic-gradient(from 0deg at 50% 50%, rgba(255, 112, 198, 0.14), rgba(177, 120, 255, 0.06), rgba(255, 228, 246, 0.12), rgba(255, 112, 198, 0.14));
    mix-blend-mode: screen;
    animation: introAuroraDrift 14s linear infinite;
}

.intro-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-card {
    width: min(560px, 90vw);
    border-radius: 16px;
    border: 1px solid rgba(215, 147, 199, 0.66);
    background:
        linear-gradient(180deg, rgba(255, 242, 250, 0.96), rgba(237, 182, 223, 0.88));
    box-shadow:
        0 26px 56px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        0 0 44px rgba(178, 112, 255, 0.24);
    text-align: center;
    padding: 26px 28px 24px;
    position: relative;
    overflow: hidden;
    animation: introPulse 3.8s ease-in-out infinite;
}

.intro-card::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 202, 235, 0.54);
    box-shadow:
        inset 0 0 18px rgba(255, 154, 216, 0.24),
        0 0 18px rgba(177, 120, 255, 0.2);
    pointer-events: none;
    animation: introFramePulse 3.4s ease-in-out infinite;
    z-index: 0;
}

.intro-card::after {
    content: '';
    position: absolute;
    top: -45%;
    left: -20%;
    width: 48%;
    height: 190%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
    transform: rotate(18deg);
    animation: introSheen 4.8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.intro-card > * {
    position: relative;
    z-index: 1;
}

.intro-card h2 {
    margin: 0 0 10px;
    font-family: 'Cinzel', serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #5b2b4c;
    text-shadow:
        0 0 12px rgba(255, 140, 219, 0.26),
        0 1px 0 rgba(255, 255, 255, 0.42);
}

.intro-card p {
    margin: 0 0 19px;
    font-family: 'Marcellus', serif;
    font-size: 1rem;
    color: #5b4456;
    line-height: 1.4;
}

.intro-start {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(166, 92, 149, 0.76);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 223, 243, 0.98), rgba(236, 166, 210, 0.92));
    color: #4f2a44;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 0.6px;
    padding: 11px 18px;
    cursor: pointer;
    box-shadow:
        0 10px 16px rgba(149, 80, 137, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.48);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.intro-start:hover {
    transform: translateY(-1px);
    border-color: rgba(197, 110, 176, 0.9);
    box-shadow:
        0 0 0 2px rgba(255, 93, 176, 0.24),
        0 10px 18px rgba(153, 84, 141, 0.28);
}

.intro-start::before {
    content: '';
    position: absolute;
    top: -2px;
    bottom: -2px;
    left: -34%;
    width: 30%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0));
    transform: skewX(-18deg);
    animation: introBtnShine 2.9s ease-in-out infinite;
}

@keyframes introPulse {
    0% {
        transform: translateY(2px) scale(0.99);
    }
    50% {
        transform: translateY(-2px) scale(1.01);
    }
    100% {
        transform: translateY(2px) scale(0.99);
    }
}

@keyframes introAuroraDrift {
    from {
        transform: rotate(0deg) scale(1);
    }
    to {
        transform: rotate(360deg) scale(1.06);
    }
}

@keyframes introFramePulse {
    0% {
        opacity: 0.58;
    }
    50% {
        opacity: 0.95;
    }
    100% {
        opacity: 0.58;
    }
}

@keyframes introSheen {
    0% {
        transform: translateX(-42%) rotate(18deg);
        opacity: 0;
    }
    22% {
        opacity: 0.46;
    }
    55% {
        transform: translateX(220%) rotate(18deg);
        opacity: 0;
    }
    100% {
        transform: translateX(220%) rotate(18deg);
        opacity: 0;
    }
}

@keyframes introBtnShine {
    0% {
        left: -34%;
        opacity: 0;
    }
    20% {
        opacity: 0.8;
    }
    45% {
        left: 124%;
        opacity: 0;
    }
    100% {
        left: 124%;
        opacity: 0;
    }
}

.scroll-wrapper {
    position: relative;
    width: min(1320px, 97vw);
    height: calc(100vh - 24px);
    margin: 12px auto;
    padding: 0;
    perspective: 1400px;
    z-index: 6;
    transition: filter 320ms ease, transform 320ms ease;
}

.scroll-assembly {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 24px 34px var(--shadow-deep));
    animation: floatBob 7.5s ease-in-out infinite;
}

@keyframes floatBob {
    0% {
        transform: translateY(8px) rotate(-0.2deg);
    }
    50% {
        transform: translateY(-8px) rotate(0.22deg);
    }
    100% {
        transform: translateY(8px) rotate(-0.2deg);
    }
}

.roller {
    width: calc(100% + 16px);
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 7;
}

.roller.top {
    margin-bottom: -5px;
}

.roller.bottom {
    margin-top: -5px;
}

.paper-roll {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    border: 1px solid rgba(121, 70, 105, 0.62);
    background:
        linear-gradient(180deg, rgba(255, 242, 250, 0.84), rgba(255, 242, 250, 0) 45%),
        linear-gradient(90deg, #e6b0d3 0%, #ffdff1 28%, #d99ec1 50%, #ffd3ec 72%, #bf88ae 100%);
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.5),
        inset 0 -3px 5px rgba(97, 45, 83, 0.25);
}

.parchment-body {
    width: 100%;
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.43), rgba(255, 255, 255, 0) 26%),
        radial-gradient(circle at 86% 20%, rgba(255, 78, 161, 0.12), rgba(255, 78, 161, 0) 34%),
        linear-gradient(174deg, #ffe8f3, #f7cbe0 65%, #efb7d6 100%);
    border-inline: 2px solid rgba(184, 110, 160, 0.66);
    border-top: 1px solid rgba(126, 73, 109, 0.55);
    border-bottom: 1px solid rgba(126, 73, 109, 0.55);
    animation: unfurl 0.9s cubic-bezier(0.2, 0.84, 0.22, 1) forwards, paperAlive 9s ease-in-out infinite 0.95s;
}

.parchment-body.arcane-pulse {
    box-shadow:
        inset 0 0 48px rgba(255, 111, 191, 0.35),
        inset 0 0 92px rgba(170, 105, 255, 0.24),
        0 0 28px rgba(255, 120, 200, 0.24);
}

@keyframes paperAlive {
    0% {
        box-shadow:
            inset 0 0 20px rgba(255, 145, 206, 0.23),
            0 6px 18px rgba(110, 56, 91, 0.16);
    }
    50% {
        box-shadow:
            inset 0 0 50px rgba(255, 92, 177, 0.34),
            inset 0 0 85px rgba(164, 102, 255, 0.26),
            0 10px 25px rgba(96, 45, 80, 0.22);
    }
    100% {
        box-shadow:
            inset 0 0 20px rgba(255, 145, 206, 0.23),
            0 6px 18px rgba(110, 56, 91, 0.16);
    }
}

.parchment-glimmer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, rgba(255, 219, 242, 0.18) 18%, rgba(255, 255, 255, 0.37) 34%, rgba(209, 170, 255, 0.18) 52%);
    mix-blend-mode: screen;
    animation: glimmerSweep 8s ease-in-out infinite, hueShift 14s linear infinite;
    z-index: 1;
}

.parchment-aura {
    position: absolute;
    inset: -14%;
    pointer-events: none;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 112, 198, 0.3), rgba(255, 112, 198, 0) 44%),
        radial-gradient(circle at 72% 30%, rgba(167, 102, 255, 0.28), rgba(167, 102, 255, 0) 48%),
        radial-gradient(circle at 50% 85%, rgba(255, 162, 223, 0.22), rgba(255, 162, 223, 0) 58%);
    filter: blur(20px);
    opacity: 0.7;
    mix-blend-mode: screen;
    animation: auraFloat 9s ease-in-out infinite alternate, hueShift 12s linear infinite;
    z-index: 1;
}

.parchment-flames {
    position: absolute;
    top: 6%;
    bottom: 6%;
    width: 120px;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: screen;
}

.parchment-flames.left {
    left: -34px;
}

.parchment-flames.right {
    right: -34px;
    transform: scaleX(-1);
}

.parchment-flames::before,
.parchment-flames::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.75;
}

.parchment-flames::before {
    background:
        radial-gradient(90px 160px at 65% 92%, rgba(255, 93, 181, 0.38), rgba(255, 93, 181, 0) 72%),
        radial-gradient(72px 130px at 40% 68%, rgba(172, 102, 255, 0.36), rgba(172, 102, 255, 0) 74%),
        radial-gradient(60px 110px at 58% 46%, rgba(255, 203, 238, 0.3), rgba(255, 203, 238, 0) 78%);
    filter: blur(2px);
    animation: flameRise 2.8s ease-in-out infinite, hueShift 11s linear infinite;
}

.parchment-flames::after {
    background:
        radial-gradient(68px 130px at 50% 88%, rgba(255, 128, 205, 0.42), rgba(255, 128, 205, 0) 76%),
        radial-gradient(58px 110px at 32% 56%, rgba(149, 102, 255, 0.34), rgba(149, 102, 255, 0) 78%);
    filter: blur(3px);
    animation: flameRise 3.4s ease-in-out infinite reverse, hueShift 13s linear infinite;
}

@keyframes auraFloat {
    0% {
        transform: translateY(10px) scale(0.96);
        opacity: 0.55;
    }
    50% {
        opacity: 0.82;
    }
    100% {
        transform: translateY(-8px) scale(1.05);
        opacity: 0.63;
    }
}

@keyframes flameRise {
    0% {
        transform: translateY(14px) scaleY(0.8);
        opacity: 0.45;
    }
    45% {
        transform: translateY(-6px) scaleY(1.04);
        opacity: 0.88;
    }
    100% {
        transform: translateY(8px) scaleY(0.88);
        opacity: 0.5;
    }
}

@keyframes hueShift {
    0% {
        filter: hue-rotate(0deg) saturate(103%);
    }
    33% {
        filter: hue-rotate(18deg) saturate(116%);
    }
    66% {
        filter: hue-rotate(-15deg) saturate(112%);
    }
    100% {
        filter: hue-rotate(0deg) saturate(103%);
    }
}

@keyframes glimmerSweep {
    0% {
        transform: translateX(-42%);
        opacity: 0.5;
    }
    25% {
        opacity: 0.82;
    }
    60% {
        opacity: 0.64;
    }
    100% {
        transform: translateX(52%);
        opacity: 0.48;
    }
}

.petal {
    position: fixed;
    width: 12px;
    height: 18px;
    border-radius: 62% 38% 68% 32% / 56% 42% 58% 44%;
    background: linear-gradient(160deg, rgba(255, 237, 248, 0.95), rgba(255, 149, 211, 0.88) 45%, rgba(199, 120, 255, 0.72));
    box-shadow: 0 0 10px rgba(255, 139, 209, 0.45);
    pointer-events: none;
    transform-origin: 50% 72%;
}

.parchment-body::before,
.parchment-body::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 18px;
    pointer-events: none;
    z-index: 2;
}

.parchment-body::before {
    top: 0;
    background: linear-gradient(180deg, rgba(104, 72, 40, 0.22), rgba(104, 72, 40, 0));
}

.parchment-body::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(81, 52, 24, 0.25), rgba(81, 52, 24, 0));
}

.paper-curl {
    position: absolute;
    left: 16px;
    right: 16px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid rgba(111, 79, 44, 0.45);
    background:
        linear-gradient(180deg, rgba(255, 247, 226, 0.84), rgba(255, 247, 226, 0.15)),
        linear-gradient(90deg, #e3c896, #f8e8c8 45%, #debc8a 100%);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(101, 68, 33, 0.2);
    z-index: 3;
    pointer-events: none;
}

.paper-curl-top {
    top: 4px;
}

.paper-curl-bottom {
    bottom: 4px;
}

@keyframes unfurl {
    from {
        clip-path: inset(0 0 100% 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.parchment-inner {
    position: relative;
    z-index: 5;
    height: 100%;
    overflow-y: auto;
    padding: 36px 68px 60px;
    background:
        repeating-linear-gradient(90deg, rgba(101, 66, 34, 0.03) 0 2px, transparent 2px 6px),
        repeating-linear-gradient(0deg, rgba(101, 66, 34, 0.018) 0 1px, transparent 1px 4px);
    scrollbar-width: thin;
    scrollbar-color: rgba(127, 91, 49, 0.85) transparent;
}

.parchment-inner::-webkit-scrollbar {
    width: 9px;
}

.parchment-inner::-webkit-scrollbar-thumb {
    background: rgba(124, 89, 48, 0.8);
    border-radius: 999px;
}

.grimoire-header {
    text-align: center;
    margin-bottom: 22px;
    padding-top: 10px;
    position: relative;
}

.language-switch {
    position: absolute;
    right: 0;
    top: 0;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    max-width: 420px;
    padding: 4px 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 240, 248, 0.64), rgba(239, 198, 225, 0.44));
    border: 1px solid rgba(172, 114, 160, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.54),
        0 8px 18px rgba(108, 57, 98, 0.14);
}

.lang-btn {
    border: 1px solid rgba(121, 82, 41, 0.65);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 247, 230, 0.95), rgba(235, 213, 172, 0.9));
    color: #422d1c;
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 12px;
    cursor: none;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 160ms ease, background 220ms ease;
}

.lang-btn:hover,
.lang-btn.active {
    transform: translateY(-1px);
    border-color: rgba(198, 126, 173, 0.95);
    box-shadow:
        0 0 0 2px rgba(255, 78, 161, 0.2),
        0 0 12px rgba(188, 112, 255, 0.22);
}

.lang-btn[data-lang] {
    min-width: 44px;
    padding: 6px 12px;
    border-color: rgba(162, 95, 153, 0.7);
    background:
        radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 44%),
        linear-gradient(180deg, rgba(255, 241, 250, 0.98), rgba(236, 180, 218, 0.9));
    color: #4d2441;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.68),
        0 6px 12px rgba(151, 85, 135, 0.16);
}

.lang-btn[data-lang]:hover,
.lang-btn[data-lang].active {
    border-color: rgba(201, 114, 183, 0.96);
    background:
        radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 44%),
        linear-gradient(180deg, rgba(255, 232, 246, 0.99), rgba(228, 156, 205, 0.94));
    box-shadow:
        0 0 0 2px rgba(255, 126, 194, 0.26),
        0 0 16px rgba(192, 120, 255, 0.24);
}

.music-btn {
    position: relative;
    overflow: hidden;
    border-color: rgba(152, 92, 142, 0.72);
    background:
        linear-gradient(180deg, rgba(255, 244, 250, 0.98), rgba(240, 179, 220, 0.92)),
        radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.45), transparent 52%);
    color: #4f2646;
    min-width: 110px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.62),
        0 6px 12px rgba(162, 91, 151, 0.18);
}

.music-btn::after {
    content: '';
    position: absolute;
    top: -16%;
    left: -34%;
    width: 30%;
    height: 140%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
    transform: skewX(-20deg);
    opacity: 0.75;
    animation: musicBtnShimmer 3.1s ease-in-out infinite;
    pointer-events: none;
}

.music-btn.off {
    opacity: 0.72;
    filter: grayscale(18%);
}

.music-controls {
    width: 210px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px 8px;
    align-items: center;
    background: linear-gradient(180deg, rgba(255, 236, 247, 0.92), rgba(238, 189, 224, 0.82));
    border: 1px solid rgba(152, 89, 141, 0.55);
    border-radius: 10px;
    padding: 7px 9px 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
    z-index: 60;
    backdrop-filter: blur(6px);
}

.audio-popover {
    position: relative;
}

.audio-popover.open .music-controls {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.settings-wheel {
    position: relative;
    overflow: hidden;
    min-width: 34px;
    width: 34px;
    padding: 5px 0;
    border-color: rgba(163, 108, 180, 0.9);
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 45%),
        conic-gradient(from 25deg, rgba(255, 223, 247, 0.98), rgba(233, 172, 219, 0.94), rgba(187, 133, 245, 0.92), rgba(255, 223, 247, 0.98));
    color: #4a2547;
    font-size: 0.98rem;
    line-height: 1;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        0 5px 10px rgba(157, 95, 169, 0.26),
        0 0 14px rgba(191, 128, 255, 0.24);
}

.settings-wheel::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 999px;
    border: 1px dashed rgba(255, 236, 249, 0.7);
    opacity: 0.8;
    animation: settingsRuneSpin 7.6s linear infinite;
    pointer-events: none;
}

.audio-popover.open .settings-wheel {
    box-shadow:
        0 0 0 2px rgba(255, 87, 174, 0.24),
        0 0 16px rgba(194, 126, 255, 0.35);
}

.music-label {
    font-family: 'Cinzel', serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #5c2f52;
    text-transform: uppercase;
}

.music-volume {
    width: 100%;
    accent-color: #ff5faa;
    height: 16px;
}

.music-theme {
    width: 100%;
    border: 1px solid rgba(146, 90, 136, 0.6);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 242, 250, 0.96), rgba(240, 204, 229, 0.92));
    color: #4f2f4a;
    font-family: 'Cinzel', serif;
    font-size: 0.68rem;
    padding: 4px 6px;
}

@keyframes musicBtnShimmer {
    0% {
        left: -34%;
        opacity: 0;
    }
    18% {
        opacity: 0.75;
    }
    52% {
        left: 124%;
        opacity: 0;
    }
    100% {
        left: 124%;
        opacity: 0;
    }
}

@keyframes settingsRuneSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.hero-medallion {
    margin: 22px auto 24px;
    width: 192px;
    height: 192px;
    border-radius: 999px;
    position: relative;
    overflow: visible;
}

.hero-medallion::before {
    content: '';
    position: absolute;
    inset: -16px;
    border-radius: 999px;
    background:
        conic-gradient(
            from 0deg,
            rgba(255, 135, 208, 0.8),
            rgba(167, 110, 255, 0.75),
            rgba(255, 212, 241, 0.84),
            rgba(255, 135, 208, 0.8)
        );
    filter: blur(0.5px);
    animation: medallionSpin 8.6s linear infinite, hueShift 11s linear infinite;
    z-index: 0;
}

.hero-medallion::after {
    content: '';
    position: absolute;
    inset: -24px;
    border-radius: 999px;
    border: 1px solid rgba(255, 176, 223, 0.62);
    box-shadow:
        0 0 18px rgba(255, 120, 198, 0.34),
        inset 0 0 18px rgba(176, 120, 255, 0.25);
    animation: medallionPulse 3.4s ease-in-out infinite;
    z-index: 0;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 999px;
    border: 3px solid #dfc38f;
    box-shadow: 0 12px 20px rgba(67, 44, 22, 0.32);
    position: relative;
    z-index: 3;
}

.hero-aura-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 999px;
    border: 3px solid #dfc38f;
    box-shadow: 0 12px 20px rgba(67, 44, 22, 0.32);
    box-sizing: border-box;
    opacity: 0;
    transform: scale(1);
    filter: contrast(1.06) saturate(1.05) blur(0.35px);
    transition: opacity 220ms ease, filter 240ms ease;
    mix-blend-mode: normal;
    pointer-events: none;
    z-index: 3;
    will-change: opacity, filter;
}

.hero-medallion.hover-video .hero-aura-video {
    opacity: 1;
    filter: contrast(1.08) saturate(1.08) blur(0.28px);
}

.medallion-ring {
    position: absolute;
    inset: -8px;
    border: 1px dashed rgba(255, 207, 237, 0.92);
    border-radius: 999px;
    z-index: 6;
    animation: ringBreath 2.8s ease-in-out infinite;
}

.medallion-halo {
    position: absolute;
    inset: -28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 149, 211, 0.44);
    box-shadow:
        inset 0 0 16px rgba(255, 145, 210, 0.24),
        0 0 20px rgba(169, 113, 255, 0.28);
    animation: haloDrift 6.8s ease-in-out infinite;
    z-index: 1;
}

.medallion-runes {
    position: absolute;
    inset: -24px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 213, 242, 0.9) 0 4px, transparent 5px),
        radial-gradient(circle at 100% 50%, rgba(190, 142, 255, 0.88) 0 4px, transparent 5px),
        radial-gradient(circle at 50% 100%, rgba(255, 158, 216, 0.88) 0 4px, transparent 5px),
        radial-gradient(circle at 0% 50%, rgba(190, 142, 255, 0.88) 0 4px, transparent 5px);
    animation: medallionSpin 12s linear infinite reverse;
    z-index: 2;
}

@keyframes medallionSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes medallionPulse {
    0% {
        transform: scale(0.97);
        opacity: 0.55;
    }
    50% {
        transform: scale(1.04);
        opacity: 0.92;
    }
    100% {
        transform: scale(0.97);
        opacity: 0.55;
    }
}

@keyframes ringBreath {
    0% {
        box-shadow: 0 0 8px rgba(255, 165, 221, 0.32);
    }
    50% {
        box-shadow: 0 0 16px rgba(176, 118, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 8px rgba(255, 165, 221, 0.32);
    }
}

@keyframes haloDrift {
    0% {
        transform: rotate(-2deg) scale(0.97);
    }
    50% {
        transform: rotate(2deg) scale(1.03);
    }
    100% {
        transform: rotate(-2deg) scale(0.97);
    }
}

.grimoire-header h1 {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: clamp(2.15rem, 4.3vw, 3.4rem);
    color: #3f2819;
}

.subtitle {
    margin: 8px 0 8px;
    font-family: 'Marcellus', serif;
    font-size: clamp(1.08rem, 2.35vw, 1.55rem);
    color: #624833;
}

.legend-line {
    margin: 0;
    font-size: 1.06rem;
    color: #67513d;
}

.magic-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 15px 0 12px;
}

.nav-rune {
    position: relative;
    border: 1px solid rgba(167, 98, 154, 0.62);
    border-radius: 9px;
    background:
        radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, rgba(255, 240, 249, 0.96), rgba(236, 186, 218, 0.92));
    color: #4b2740;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 0.42px;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 10px 14px;
    cursor: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
    isolation: isolate;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.62),
        0 6px 14px rgba(140, 72, 124, 0.18);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease, filter 200ms ease;
}

.nav-rune > * {
    position: relative;
    z-index: 1;
}

.nav-rune::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 8px;
    opacity: 0;
    background: linear-gradient(112deg, rgba(255, 187, 228, 0.22), rgba(255, 235, 247, 0.1), rgba(215, 155, 255, 0.24));
    transition: opacity 220ms ease;
    pointer-events: none;
}

.nav-rune::after {
    content: '';
    position: absolute;
    top: -30%;
    left: -45%;
    width: 36%;
    height: 170%;
    transform: skewX(-18deg);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity 180ms ease;
    pointer-events: none;
}

.nav-icon-frame {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(149, 83, 138, 0.42);
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.74), rgba(255, 214, 239, 0.7));
    display: grid;
    place-items: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.nav-icon {
    width: 14px;
    height: 14px;
    display: block;
    opacity: 0.92;
}

.nav-label {
    line-height: 1;
}

.nav-rune:hover,
.nav-rune.active {
    transform: translateY(-1px);
    border-color: #be6cab;
    background:
        radial-gradient(circle at 22% 14%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, rgba(255, 230, 246, 0.99), rgba(232, 162, 208, 0.96));
    box-shadow:
        0 0 0 2px rgba(255, 78, 161, 0.18),
        0 10px 16px rgba(160, 84, 143, 0.24);
    filter: saturate(1.08);
}

.nav-rune:hover::before,
.nav-rune.active::before {
    opacity: 1;
}

.nav-rune:hover::after,
.nav-rune.active::after {
    opacity: 0.82;
    animation: navShimmer 1.35s ease-in-out;
}

.nav-rune:hover .nav-icon-frame,
.nav-rune.active .nav-icon-frame {
    transform: translateY(-1px) scale(1.06);
    border-color: rgba(176, 90, 155, 0.62);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 0 0 2px rgba(255, 130, 198, 0.2);
}

@keyframes navShimmer {
    from {
        transform: translateX(0) skewX(-18deg);
    }
    to {
        transform: translateX(340%) skewX(-18deg);
    }
}

.divider-rune {
    text-align: center;
    letter-spacing: 6px;
    color: #8b6944;
    margin-bottom: 18px;
}

.tab-section {
    display: none;
    animation: fadeSlide 260ms ease;
}

.tab-section.active {
    display: block;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(161, 98, 144, 0.46);
    border-radius: 10px;
    padding: 15px 18px;
    margin-bottom: 12px;
    background: linear-gradient(180deg, rgba(255, 239, 248, 0.93), rgba(243, 209, 229, 0.83));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(161, 95, 145, 0.22),
        0 8px 13px rgba(130, 74, 119, 0.15);
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.panel::before,
.panel::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(186, 117, 164, 0.52);
    pointer-events: none;
}

.panel::before {
    top: 7px;
    left: 7px;
    border-right: 0;
    border-bottom: 0;
}

.panel::after {
    right: 7px;
    bottom: 7px;
    border-left: 0;
    border-top: 0;
}

.panel:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 10px 15px rgba(255, 109, 180, 0.1);
}

.panel h2,
.panel h3,
.panel h4 {
    margin: 0 0 7px;
    font-family: 'Cinzel', serif;
    color: #5a2b4c;
    line-height: 1.2;
}

.panel h2 {
    font-size: 1.4rem;
}

.panel h3 {
    font-size: 1.18rem;
}

.panel h4 {
    font-size: 1.08rem;
}

.panel p,
.panel li,
.ally-description,
.power-card p,
.campaign-grid p {
    font-size: 1.11rem;
    line-height: 1.54;
    color: #5d4755;
}

.panel p {
    margin: 6px 0;
}

.power-card .meta,
.ally-role,
.detail-list li {
    font-family: 'Marcellus', serif;
    letter-spacing: 0.28px;
}

.legend-panel p,
.prophecy-panel .verse,
#poderes > .panel p,
#naturaleza-celestial .panel p,
#naturaleza-oscura .panel p {
    font-family: 'Marcellus', serif;
    letter-spacing: 0.2px;
}

.verse {
    font-size: 1.16rem;
    line-height: 1.55;
    font-style: italic;
    color: #5b3f2b;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.power-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.power-card {
    border: 1px solid rgba(161, 97, 145, 0.46);
    border-radius: 10px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(255, 239, 248, 0.93), rgba(243, 210, 230, 0.83));
    box-shadow: 0 7px 12px rgba(126, 72, 113, 0.14);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform 340ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 360ms ease, border-color 320ms ease;
}

.power-card > * {
    position: relative;
    z-index: 1;
}

.power-card h4 {
    transition: color 260ms ease;
}

.power-card::before,
.power-card::after {
    content: '';
    position: absolute;
    inset: -26%;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.power-card::before {
    background: radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 45%);
    transition: opacity 420ms ease, transform 520ms ease;
    transform: scale(0.96);
}

.power-card::after {
    transition: opacity 420ms ease, transform 520ms ease, filter 420ms ease;
    transform: translateY(10px) scale(0.98);
}

.power-card:hover {
    transform: translateY(-2px);
    border-color: rgba(186, 109, 166, 0.62);
    box-shadow: 0 12px 20px rgba(126, 72, 113, 0.22);
}

.power-card:hover::before,
.power-card:hover::after {
    opacity: 1;
}

.power-card:hover::before {
    transform: scale(1.05);
}

.power-card:hover::after {
    transform: translateY(0) scale(1);
}

.power-card .power-icon {
    transition: transform 300ms ease, box-shadow 320ms ease, filter 300ms ease;
}

.power-card:hover .power-icon {
    transform: translateY(-1px) scale(1.08);
    box-shadow: 0 0 14px rgba(255, 170, 220, 0.46);
}

.power-card.dark:hover .power-icon {
    box-shadow: 0 0 14px rgba(176, 142, 255, 0.48);
}

.power-card.celestial:hover .power-icon {
    box-shadow: 0 0 14px rgba(255, 215, 150, 0.52);
}

.fx-blizzard::after {
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.4px) 0 0 / 18px 18px,
        radial-gradient(circle, rgba(207, 239, 255, 0.62) 0 1px, transparent 1.3px) 8px 10px / 18px 18px;
    animation: blizzardDrift 5.4s linear infinite;
}

.fx-blizzard:hover .power-icon {
    animation: iconGlide 1.4s ease-in-out infinite;
}

.fx-love::after {
    background:
        radial-gradient(circle at 52% 52%, rgba(255, 140, 203, 0.42), rgba(255, 140, 203, 0) 58%),
        radial-gradient(circle at 32% 24%, rgba(255, 197, 229, 0.36), rgba(255, 197, 229, 0) 48%);
    animation: auraPulse 2.8s ease-in-out infinite;
}

.fx-love:hover .power-icon {
    animation: iconPulse 1.1s ease-in-out infinite;
}

.fx-root::after {
    background:
        linear-gradient(180deg, rgba(101, 174, 126, 0), rgba(101, 174, 126, 0.34) 40%, rgba(101, 174, 126, 0) 100%),
        radial-gradient(ellipse at 24% 88%, rgba(122, 197, 130, 0.34), rgba(122, 197, 130, 0) 56%),
        radial-gradient(ellipse at 78% 84%, rgba(150, 222, 158, 0.3), rgba(150, 222, 158, 0) 54%);
    animation: rootMist 3.6s ease-in-out infinite;
}

.fx-root:hover .power-icon {
    animation: iconRoot 1.6s ease-in-out infinite;
}

.fx-beam::after {
    background:
        linear-gradient(90deg, rgba(255, 241, 212, 0) 34%, rgba(255, 234, 171, 0.68) 50%, rgba(255, 241, 212, 0) 66%),
        radial-gradient(circle at 50% 14%, rgba(255, 240, 190, 0.54), rgba(255, 240, 190, 0) 62%);
    animation: beamPulse 2.2s ease-in-out infinite;
}

.fx-beam:hover .power-icon {
    animation: iconBeam 1.2s ease-in-out infinite;
}

.fx-shadow::after {
    background:
        radial-gradient(circle at 24% 72%, rgba(84, 57, 130, 0.36), rgba(84, 57, 130, 0) 58%),
        linear-gradient(118deg, rgba(59, 38, 102, 0) 10%, rgba(59, 38, 102, 0.42) 50%, rgba(59, 38, 102, 0) 90%);
    animation: shadowDrift 3.8s ease-in-out infinite;
}

.fx-shadow:hover .power-icon {
    animation: iconShadow 1.5s ease-in-out infinite;
}

.fx-echo::after {
    background:
        radial-gradient(ellipse at 22% 56%, rgba(171, 150, 230, 0.32), rgba(171, 150, 230, 0) 56%),
        radial-gradient(ellipse at 78% 46%, rgba(148, 128, 210, 0.28), rgba(148, 128, 210, 0) 54%),
        radial-gradient(circle at 50% 54%, rgba(193, 175, 241, 0.24), rgba(193, 175, 241, 0) 62%);
    animation: echoDrift 3.1s ease-in-out infinite;
}

.fx-echo:hover .power-icon {
    animation: iconPulse 1.25s ease-in-out infinite;
}

.fx-veil::after {
    background:
        linear-gradient(120deg, rgba(122, 94, 184, 0) 8%, rgba(122, 94, 184, 0.44) 50%, rgba(122, 94, 184, 0) 92%);
    animation: veilSweep 2.4s ease-in-out infinite;
}

.fx-veil:hover .power-icon {
    animation: iconGlide 1.6s ease-in-out infinite;
}

.fx-aurora::after {
    background:
        linear-gradient(120deg, rgba(153, 255, 224, 0.42), rgba(133, 206, 255, 0.26), rgba(255, 216, 172, 0.38));
    mix-blend-mode: screen;
    animation: auroraFlow 4.2s linear infinite;
}

.fx-aurora:hover .power-icon {
    animation: iconAurora 1.7s ease-in-out infinite;
}

.fx-polarstar::after {
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 242, 190, 0.64), rgba(255, 242, 190, 0) 44%),
        linear-gradient(90deg, rgba(255, 242, 190, 0) 47%, rgba(255, 242, 190, 0.56) 50%, rgba(255, 242, 190, 0) 53%),
        linear-gradient(0deg, rgba(255, 242, 190, 0) 47%, rgba(255, 242, 190, 0.56) 50%, rgba(255, 242, 190, 0) 53%);
    animation: starBlink 1.9s ease-in-out infinite;
}

.fx-polarstar:hover .power-icon {
    animation: starBlink 1.4s ease-in-out infinite;
}

.fx-bells::after {
    background:
        repeating-radial-gradient(circle at 50% 60%, rgba(255, 224, 164, 0.5) 0 4px, rgba(255, 224, 164, 0) 4px 16px);
    animation: bellWave 2.7s ease-out infinite;
}

.fx-bells:hover .power-icon {
    animation: bellWave 1.9s ease-out infinite;
}

.power-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 14px 24px rgba(126, 72, 113, 0.24),
        0 0 0 1px rgba(255, 172, 227, 0.2);
}

.fx-blizzard:hover {
    border-color: rgba(166, 216, 255, 0.72);
    box-shadow:
        0 18px 30px rgba(89, 139, 188, 0.24),
        0 0 24px rgba(182, 228, 255, 0.36);
}

.fx-blizzard:hover::before {
    background:
        radial-gradient(circle at 24% 20%, rgba(228, 248, 255, 0.74), rgba(228, 248, 255, 0) 52%),
        radial-gradient(circle at 76% 78%, rgba(172, 219, 255, 0.48), rgba(172, 219, 255, 0) 54%);
    animation: polarFlash 2.1s ease-in-out infinite;
}

.fx-love:hover {
    border-color: rgba(255, 141, 204, 0.76);
    box-shadow:
        0 18px 30px rgba(171, 70, 126, 0.24),
        0 0 24px rgba(255, 140, 202, 0.34);
}

.fx-love:hover::before {
    background:
        radial-gradient(circle at 48% 40%, rgba(255, 171, 220, 0.56), rgba(255, 171, 220, 0) 52%),
        linear-gradient(120deg, rgba(255, 144, 206, 0) 8%, rgba(255, 221, 240, 0.46) 50%, rgba(255, 144, 206, 0) 92%);
    animation: loveWave 2.8s ease-in-out infinite;
}

.fx-root:hover {
    border-color: rgba(131, 195, 141, 0.8);
    box-shadow:
        0 18px 30px rgba(74, 131, 87, 0.24),
        0 0 24px rgba(140, 212, 152, 0.34);
}

.fx-root:hover::before {
    background:
        linear-gradient(180deg, rgba(148, 231, 157, 0), rgba(148, 231, 157, 0.36) 46%, rgba(148, 231, 157, 0) 100%),
        linear-gradient(105deg, rgba(96, 180, 114, 0) 14%, rgba(96, 180, 114, 0.3) 52%, rgba(96, 180, 114, 0) 90%);
    animation: rootUnfurl 2.9s ease-in-out infinite;
}

.fx-beam:hover {
    border-color: rgba(250, 212, 121, 0.82);
    box-shadow:
        0 18px 30px rgba(166, 124, 44, 0.24),
        0 0 30px rgba(255, 224, 146, 0.36);
}

.fx-beam:hover::before {
    background:
        linear-gradient(90deg, rgba(255, 232, 182, 0) 36%, rgba(255, 232, 182, 0.82) 50%, rgba(255, 232, 182, 0) 64%),
        radial-gradient(circle at 50% 12%, rgba(255, 233, 170, 0.64), rgba(255, 233, 170, 0) 58%);
    animation: lighthouseSweep 1.9s ease-in-out infinite;
}

.fx-shadow:hover {
    border-color: rgba(132, 104, 203, 0.76);
    box-shadow:
        0 18px 30px rgba(62, 43, 108, 0.34),
        0 0 24px rgba(132, 104, 203, 0.34);
}

.fx-shadow:hover::before {
    background:
        radial-gradient(circle at 50% 50%, rgba(116, 84, 188, 0.28), rgba(116, 84, 188, 0) 58%),
        linear-gradient(120deg, rgba(89, 61, 156, 0) 10%, rgba(89, 61, 156, 0.38) 52%, rgba(89, 61, 156, 0) 92%);
    animation: cavePulse 2.6s ease-in-out infinite;
}

.fx-shadow:hover::before,
.fx-shadow:hover::after {
    opacity: 0.62;
}

.fx-echo:hover {
    border-color: rgba(160, 138, 227, 0.78);
    box-shadow:
        0 18px 30px rgba(81, 66, 130, 0.26),
        0 0 24px rgba(180, 161, 236, 0.32);
}

.fx-echo:hover::before {
    background:
        radial-gradient(ellipse at 32% 54%, rgba(205, 188, 252, 0.36), rgba(205, 188, 252, 0) 56%),
        radial-gradient(ellipse at 70% 52%, rgba(184, 164, 246, 0.32), rgba(184, 164, 246, 0) 58%);
    animation: echoWave 2.2s ease-in-out infinite;
}

.fx-veil:hover {
    border-color: rgba(156, 126, 223, 0.76);
    box-shadow:
        0 18px 30px rgba(88, 63, 145, 0.28),
        0 0 24px rgba(177, 154, 236, 0.34);
}

.fx-veil:hover::before {
    background:
        linear-gradient(120deg, rgba(176, 150, 238, 0) 12%, rgba(176, 150, 238, 0.52) 50%, rgba(176, 150, 238, 0) 88%);
    animation: veilShiver 1.8s ease-in-out infinite;
}

.fx-aurora:hover {
    border-color: rgba(155, 233, 211, 0.78);
    box-shadow:
        0 18px 30px rgba(77, 150, 136, 0.24),
        0 0 30px rgba(175, 240, 225, 0.32);
}

.fx-aurora:hover::before {
    background:
        linear-gradient(120deg, rgba(173, 255, 234, 0.42), rgba(146, 215, 255, 0.24), rgba(255, 234, 188, 0.4));
    mix-blend-mode: screen;
    animation: auroraPrism 2.8s linear infinite;
}

.fx-polarstar:hover {
    border-color: rgba(255, 225, 147, 0.82);
    box-shadow:
        0 18px 30px rgba(164, 129, 58, 0.24),
        0 0 28px rgba(255, 231, 167, 0.36);
}

.fx-polarstar:hover::before {
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 236, 180, 0.74), rgba(255, 236, 180, 0) 48%),
        linear-gradient(90deg, rgba(255, 236, 180, 0) 48%, rgba(255, 236, 180, 0.72) 50%, rgba(255, 236, 180, 0) 52%),
        linear-gradient(0deg, rgba(255, 236, 180, 0) 48%, rgba(255, 236, 180, 0.72) 50%, rgba(255, 236, 180, 0) 52%);
    animation: starBurstSpin 2.6s linear infinite;
}

.fx-bells:hover {
    border-color: rgba(255, 208, 132, 0.82);
    box-shadow:
        0 18px 30px rgba(170, 118, 45, 0.24),
        0 0 28px rgba(255, 214, 149, 0.34);
}

.fx-bells:hover::before {
    background:
        repeating-radial-gradient(circle at 50% 56%, rgba(255, 222, 166, 0.52) 0 4px, rgba(255, 222, 166, 0) 4px 16px);
    animation: bellHalo 2.2s ease-out infinite;
}

@keyframes blizzardDrift {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-16px, 22px, 0);
    }
}

@keyframes auraPulse {
    0% {
        transform: scale(0.94);
    }
    50% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(0.94);
    }
}

@keyframes rootRise {
    0% {
        transform: translateY(12px);
    }
    50% {
        transform: translateY(-4px);
    }
    100% {
        transform: translateY(12px);
    }
}

@keyframes rootMist {
    0% {
        transform: translateY(8px);
        opacity: 0.55;
    }
    50% {
        transform: translateY(-5px);
        opacity: 1;
    }
    100% {
        transform: translateY(8px);
        opacity: 0.55;
    }
}

@keyframes beamPulse {
    0% {
        transform: scaleX(0.94);
        opacity: 0.7;
    }
    50% {
        transform: scaleX(1.08);
        opacity: 1;
    }
    100% {
        transform: scaleX(0.94);
        opacity: 0.7;
    }
}

@keyframes shadowSwirl {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shadowDrift {
    0% {
        transform: translateX(-8%) translateY(2%);
    }
    50% {
        transform: translateX(8%) translateY(-2%);
    }
    100% {
        transform: translateX(-8%) translateY(2%);
    }
}

@keyframes echoRing {
    0% {
        transform: scale(0.82);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.12);
        opacity: 0.25;
    }
}

@keyframes echoDrift {
    0% {
        transform: translateX(-12%);
        opacity: 0.58;
    }
    50% {
        transform: translateX(10%);
        opacity: 1;
    }
    100% {
        transform: translateX(-12%);
        opacity: 0.58;
    }
}

@keyframes veilSweep {
    0% {
        transform: translateX(-28%);
    }
    50% {
        transform: translateX(14%);
    }
    100% {
        transform: translateX(-28%);
    }
}

@keyframes auroraFlow {
    0% {
        transform: translateX(-14%) skewX(-8deg);
    }
    50% {
        transform: translateX(12%) skewX(-8deg);
    }
    100% {
        transform: translateX(-14%) skewX(-8deg);
    }
}

@keyframes starBlink {
    0% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.4;
    }
}

@keyframes bellWave {
    0% {
        transform: scale(0.84);
        opacity: 0.85;
    }
    100% {
        transform: scale(1.14);
        opacity: 0.2;
    }
}

@keyframes iconPulse {
    0% {
        transform: translateY(-1px) scale(1.05);
    }
    50% {
        transform: translateY(-1px) scale(1.14);
    }
    100% {
        transform: translateY(-1px) scale(1.05);
    }
}

@keyframes iconGlide {
    0% {
        transform: translate(-1px, -1px) scale(1.06);
    }
    50% {
        transform: translate(1px, -2px) scale(1.1);
    }
    100% {
        transform: translate(-1px, -1px) scale(1.06);
    }
}

@keyframes iconRoot {
    0% {
        transform: translateY(-1px) scale(1.06);
    }
    50% {
        transform: translateY(0) scale(1.11);
    }
    100% {
        transform: translateY(-1px) scale(1.06);
    }
}

@keyframes iconBeam {
    0% {
        transform: translateY(-1px) scale(1.06);
        filter: brightness(1);
    }
    50% {
        transform: translateY(-1px) scale(1.14);
        filter: brightness(1.22);
    }
    100% {
        transform: translateY(-1px) scale(1.06);
        filter: brightness(1);
    }
}

@keyframes iconShadow {
    0% {
        transform: translateY(-1px) scale(1.06);
        filter: brightness(1);
    }
    50% {
        transform: translateY(-1px) scale(1.12);
        filter: brightness(1.22);
    }
    100% {
        transform: translateY(-1px) scale(1.06);
        filter: brightness(1);
    }
}

@keyframes iconAurora {
    0% {
        transform: translateY(-1px) scale(1.06);
        filter: hue-rotate(0deg);
    }
    50% {
        transform: translateY(-1px) scale(1.12);
        filter: hue-rotate(22deg);
    }
    100% {
        transform: translateY(-1px) scale(1.06);
        filter: hue-rotate(0deg);
    }
}

@keyframes polarFlash {
    0% {
        opacity: 0.58;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.58;
    }
}

@keyframes roseFlares {
    from {
        transform: rotate(0deg) scale(0.96);
    }
    to {
        transform: rotate(360deg) scale(1.06);
    }
}

@keyframes loveWave {
    0% {
        transform: translateX(-16%) skewX(-8deg);
        opacity: 0.62;
    }
    50% {
        transform: translateX(12%) skewX(-8deg);
        opacity: 1;
    }
    100% {
        transform: translateX(-16%) skewX(-8deg);
        opacity: 0.62;
    }
}

@keyframes rootBloom {
    0% {
        transform: translateY(16px) scaleY(0.9);
    }
    50% {
        transform: translateY(-4px) scaleY(1.07);
    }
    100% {
        transform: translateY(16px) scaleY(0.9);
    }
}

@keyframes rootUnfurl {
    0% {
        transform: translateY(10px) scaleY(0.92);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-3px) scaleY(1.05);
        opacity: 1;
    }
    100% {
        transform: translateY(10px) scaleY(0.92);
        opacity: 0.6;
    }
}

@keyframes lighthouseSweep {
    0% {
        transform: translateX(-20%);
        opacity: 0.6;
    }
    50% {
        transform: translateX(14%);
        opacity: 1;
    }
    100% {
        transform: translateX(-20%);
        opacity: 0.6;
    }
}

@keyframes shadowBlink {
    0% {
        transform: rotate(0deg);
        opacity: 0.42;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        transform: rotate(360deg);
        opacity: 0.42;
    }
}

@keyframes cavePulse {
    0% {
        transform: scale(0.94);
        opacity: 0.52;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.78;
    }
    100% {
        transform: scale(0.94);
        opacity: 0.52;
    }
}

@keyframes echoStorm {
    0% {
        transform: scale(0.82);
        opacity: 0.95;
    }
    100% {
        transform: scale(1.14);
        opacity: 0.18;
    }
}

@keyframes echoWave {
    0% {
        transform: translateX(-10%);
        opacity: 0.55;
    }
    50% {
        transform: translateX(8%);
        opacity: 0.95;
    }
    100% {
        transform: translateX(-10%);
        opacity: 0.55;
    }
}

@keyframes veilShiver {
    0% {
        transform: translateX(-16%) skewX(-8deg);
    }
    50% {
        transform: translateX(12%) skewX(-8deg);
    }
    100% {
        transform: translateX(-16%) skewX(-8deg);
    }
}

@keyframes auroraPrism {
    0% {
        transform: translateX(-14%) skewX(-10deg);
    }
    50% {
        transform: translateX(13%) skewX(-10deg);
    }
    100% {
        transform: translateX(-14%) skewX(-10deg);
    }
}

@keyframes starBurstSpin {
    from {
        transform: rotate(0deg) scale(0.96);
    }
    to {
        transform: rotate(360deg) scale(1.06);
    }
}

@keyframes bellHalo {
    0% {
        transform: scale(0.82);
        opacity: 0.85;
    }
    100% {
        transform: scale(1.16);
        opacity: 0.16;
    }
}

@media (prefers-reduced-motion: reduce) {
    .power-card,
    .power-card::before,
    .power-card::after,
    .power-card .power-icon {
        animation: none !important;
        transition-duration: 0ms !important;
    }
}

.power-card .meta {
    font-size: 0.89rem;
    color: #71495e;
    font-weight: 700;
}

.power-card.ultimate {
    border-color: rgba(154, 78, 120, 0.58);
    background: linear-gradient(180deg, rgba(255, 233, 244, 0.93), rgba(243, 202, 226, 0.8));
}

.power-card.dark {
    border-color: rgba(85, 63, 128, 0.7);
    background: linear-gradient(180deg, rgba(57, 43, 87, 0.9), rgba(40, 29, 64, 0.86));
    filter: blur(4.4px) saturate(0.82) brightness(0.85);
    opacity: 0.72;
    transition:
        transform 340ms cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 360ms ease,
        border-color 320ms ease,
        filter 960ms ease,
        opacity 960ms ease;
}

.power-card.dark h4,
.power-card.dark p {
    color: #efe6ff;
}

.power-card.dark .meta {
    color: #cdb6ff;
}

.power-card.dark .power-icon {
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.4), rgba(168, 123, 255, 0.9));
    color: #2e1948;
}

.power-card.celestial {
    border-color: rgba(228, 166, 98, 0.65);
    background: linear-gradient(180deg, rgba(255, 244, 220, 0.96), rgba(246, 217, 164, 0.84));
    filter: blur(4.4px) saturate(0.82) brightness(0.85);
    opacity: 0.72;
    transition:
        transform 340ms cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 360ms ease,
        border-color 320ms ease,
        filter 960ms ease,
        opacity 960ms ease;
}

.power-card.dark:hover,
.power-card.celestial:hover {
    filter: blur(0);
    opacity: 1;
}

.power-card:not(.dark):not(.celestial):hover::before,
.power-card:not(.dark):not(.celestial):hover::after {
    opacity: 0.34;
}

.power-card:not(.dark):not(.celestial):hover h4,
.power-card:not(.dark):not(.celestial):hover p {
    text-shadow: none;
}

.power-card:not(.dark):not(.celestial):hover {
    transform: none;
    filter: none;
}

.power-card.celestial .meta {
    color: #855b2f;
}

.power-icon {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(120, 79, 45, 0.5);
    display: grid;
    place-items: center;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 6px;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), rgba(253, 222, 243, 0.9));
    color: #4c2f40;
}

.ally-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.ally-card {
    border: 1px solid rgba(160, 97, 143, 0.44);
    border-radius: 10px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(255, 241, 249, 0.92), rgba(241, 206, 227, 0.82));
    box-shadow: 0 7px 11px rgba(125, 73, 112, 0.14);
}

.ally-card header {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 7px;
}

.ally-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(116, 83, 46, 0.52);
    display: grid;
    place-items: center;
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(255, 236, 246, 0.9), rgba(243, 205, 229, 0.86));
    color: #69354e;
    flex: 0 0 auto;
}

.ally-card h4 {
    margin: 0;
    font-family: 'Cinzel', serif;
    color: #3f2a1a;
    font-size: 0.96rem;
}

.ally-role {
    margin: 1px 0 0;
    font-size: 0.85rem;
    color: #6c4d38;
    font-weight: 600;
}

.detail-list {
    margin: 0;
    padding-left: 18px;
    color: #4e3d2f;
}

.detail-list li {
    margin-bottom: 5px;
}

.detail-list.compact li {
    font-size: 0.98rem;
}

.relic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.relic {
    margin-bottom: 0;
}

.campaign-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 9px;
}

.campaign-grid div {
    border: 1px dashed rgba(160, 95, 142, 0.54);
    border-radius: 8px;
    padding: 9px;
    background: rgba(255, 233, 246, 0.64);
}

.campaign-grid h4 {
    margin: 0 0 5px;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    color: #5c2d4d;
}

.magic-title {
    position: relative;
    display: inline-block;
    background: linear-gradient(100deg, #6a2f59 0%, #bf5ea2 40%, #e9b6ff 58%, #7f3f98 100%);
    background-size: 240% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 1px rgba(112, 52, 98, 0.24);
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    filter: blur(4px);
    transition: opacity 500ms ease, transform 500ms ease, filter 500ms ease;
    animation: titleSheen 8s linear infinite;
}

.magic-title.title-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.magic-title-large {
    text-shadow:
        0 0 14px rgba(218, 124, 255, 0.26),
        0 0 26px rgba(255, 106, 201, 0.22),
        0 2px 0 rgba(82, 35, 67, 0.2);
    letter-spacing: 0.6px;
    animation: titleSheen 8s linear infinite, bigTitlePulse 3.2s ease-in-out infinite;
}

.magic-title-large::before {
    content: '';
    position: absolute;
    left: -8%;
    right: -8%;
    bottom: -0.18em;
    height: 0.18em;
    background:
        linear-gradient(90deg, rgba(255, 140, 219, 0), rgba(255, 140, 219, 0.75), rgba(177, 121, 255, 0.82), rgba(255, 140, 219, 0));
    filter: blur(3px);
    opacity: 0.7;
    animation: bigTitleLine 2.9s ease-in-out infinite;
}

@keyframes bigTitlePulse {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-1px) scale(1.02);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes bigTitleLine {
    0% {
        opacity: 0.3;
        transform: scaleX(0.84);
    }
    50% {
        opacity: 0.9;
        transform: scaleX(1.05);
    }
    100% {
        opacity: 0.3;
        transform: scaleX(0.84);
    }
}

@keyframes titleSheen {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 180% 50%;
    }
}

.parchment-end {
    margin-top: 14px;
    padding: 8px 0 2px;
    text-align: center;
}

.end-rune {
    display: inline-block;
    border-top: 1px dashed rgba(108, 76, 41, 0.45);
    border-bottom: 1px dashed rgba(108, 76, 41, 0.45);
    padding: 6px 14px;
    color: #785838;
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.wand-cursor {
    position: fixed;
    width: 56px;
    height: 12px;
    pointer-events: none;
    transform: translate(0, -5px) rotate(17deg);
    transform-origin: 0 50%;
    z-index: 13050;
    transition: transform 120ms ease;
}

.wand-stick {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 50px;
    height: 4px;
    border-radius: 999px;
    border: 1px solid #2b1b12;
    background: linear-gradient(90deg, #4d2e1d 0%, #7a4f34 45%, #3f2617 100%);
}

.wand-tip {
    position: absolute;
    left: -4px;
    top: 1px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 199, 232, 0.95);
    background: radial-gradient(circle at 30% 25%, #ffd7ee 0%, #ff71b8 64%, #e53f95 100%);
    box-shadow:
        0 0 12px rgba(255, 104, 175, 0.96),
        0 0 22px rgba(156, 96, 255, 0.62);
}

.wand-shine {
    position: absolute;
    left: -16px;
    top: -9px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 120, 188, 0.76), rgba(172, 99, 255, 0.2) 56%, transparent 100%);
    animation: pinkPulse 1s infinite ease-in-out;
}

@keyframes pinkPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.45;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.85;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.45;
    }
}

.wand-cursor.engaged {
    transform: translate(0, -5px) rotate(17deg) scale(1.12);
}

@media (max-width: 1140px) {
    .parchment-inner {
        padding: 30px 30px 52px;
    }

    .hero-medallion {
        width: 170px;
        height: 170px;
    }

    .two-col,
    .power-grid,
    .relic-grid {
        grid-template-columns: 1fr;
    }

    .campaign-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    body {
        overflow-y: auto;
    }

    .scroll-wrapper {
        height: auto;
        min-height: calc(100vh - 20px);
        width: min(98vw, 760px);
        margin: 10px auto;
        padding: 0;
    }

    .scroll-assembly {
        min-height: calc(100vh - 6px);
    }

    .roller {
        height: 13px;
        width: calc(100% + 8px);
    }

    .parchment-body {
        flex: none;
        min-height: auto;
    }

    .parchment-inner {
        height: auto;
        max-height: none;
        padding: 30px 18px 36px;
    }

    .language-switch {
        position: static;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-bottom: 10px;
        max-width: 100%;
        width: 100%;
        padding: 0 2px;
        background: none;
        border: 0;
        box-shadow: none;
    }

    .language-switch .lang-btn {
        font-size: 0.72rem;
        padding: 7px 10px;
    }

    .music-btn {
        flex: 0 1 auto;
        min-width: 96px;
        max-width: 132px;
        padding-inline: 10px;
    }

    .audio-popover {
        width: auto;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        flex: 0 0 auto;
    }

    .music-controls {
        width: min(320px, 92vw);
        left: auto;
        right: 0;
        transform: translateY(-8px) scale(0.97);
        top: calc(100% + 6px);
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px;
        justify-items: center;
    }

    .audio-popover.open .music-controls {
        transform: translateY(0) scale(1);
    }

    .settings-wheel {
        min-width: 38px;
        width: 38px;
        font-size: 1rem;
    }

    .music-label {
        font-size: 0.66rem;
        justify-self: center;
        text-align: center;
    }

    .music-volume {
        height: 22px;
        width: min(260px, 100%);
        justify-self: center;
    }

    .music-theme {
        font-size: 0.78rem;
        padding: 6px 8px;
        width: min(260px, 100%);
        justify-self: center;
    }

    .hero-medallion {
        width: 152px;
        height: 152px;
    }

    .magic-nav {
        gap: 7px;
    }

    .nav-rune {
        font-size: 0.68rem;
        padding: 8px 10px;
        flex: 1 1 calc(50% - 7px);
        gap: 7px;
        justify-content: flex-start;
    }

    .nav-icon-frame {
        width: 20px;
        height: 20px;
    }

    .nav-icon {
        width: 12px;
        height: 12px;
    }

    .ally-grid {
        grid-template-columns: 1fr;
    }

    .campaign-grid {
        grid-template-columns: 1fr;
    }
}

@media (hover: none), (pointer: coarse) {
    body {
        cursor: auto;
    }

    .wand-cursor {
        display: none;
    }

    .nav-rune,
    .lang-btn,
    .music-btn {
        cursor: pointer;
    }

    .power-card.dark,
    .power-card.celestial {
        filter: none;
        opacity: 1;
    }
}
