body{
    margin:0;
    background-color:#07111f;
}

.magic-page{
    background-image:url("images/backgrounds/magic-hero2.png");

    background-size:100% auto;
    background-repeat:repeat-y;
    background-position:top center;

    background-color:#07111f;
}

.magic-hero{
    min-height:50px;

    background:none;

    display:flex;
    align-items:center;
    justify-content:center;

    position:relative;
}

.potions-section{
    padding:55px 4% 70px;

    background:none;

    position:relative;
    overflow:hidden;

    text-align:center;
}

.potions-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 34px;

    transform:translateY(-10px);
}

.potions-heading span {
    width: 90px;
    height: 1px;

    background: #f0ca88;
}

.potions-heading h2 {
    margin: 0;

    color: #f8c350;
    font-size: 30px;
    font-weight: 500;
    letter-spacing: 4px;

    text-shadow:
        0 0 6px rgba(0,0,0,.18),
        0 0 12px rgba(216,178,110,.18);
}

.potions-grid {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;

    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 24px;

    align-items: start;
}

.hidden-potions{
    display:none;
    margin-top:24px;
}

.potion-card {
    width: 100%;
    height: 360px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    background: transparent;
    border: none;
    box-shadow: none;

    position: relative;

    transition: transform .35s ease;
}

.potion-bottle {
    width: 190px;
    height: 285px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
}

.potion-bottle::before {
    content: "";
    position: absolute;

    width: 150px;
    height: 210px;

    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(45, 145, 220, .24),
        rgba(45, 145, 220, .08) 42%,
        transparent 72%
    );

    filter: blur(16px);
    opacity: .75;
}

.potion-bottle img {
    width: 100%;
    height: 100%;

    object-fit: contain;
    display: block;

    position: relative;
    z-index: 1;

    filter:
        drop-shadow(0 12px 14px rgba(0, 0, 0, .48))
        drop-shadow(0 0 10px rgba(55, 150, 220, .18));

    transition:
        transform .5s ease,
        filter .5s ease;
}

.potion-card:hover {
    transform: translateY(-7px);
}

.potions-more{
    padding: 12px 40px;

    background: transparent;
    border: 1px solid rgba(216,178,110,.65);

    color: #f4e6c3;

    font-family: Georgia, serif;
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;

    cursor: pointer;

    transition: .3s;
}

.potions-more:hover{
    color: #f7b74a;
    border-color: #ffba42;
}

.potions-more:active{
    transform: translateY(0);
}

.spells-more{
    padding: 12px 40px;

    background: transparent;
    border: 1px solid rgba(216,178,110,.65);

    color: #f4e6c3;

    font-family: Georgia, serif;
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;

    cursor: pointer;

    transition: .3s;
}

.spells-more:hover{
    color: #f7b74a;
    border-color: #ffba42;
}

.spells-more:active{
    transform: translateY(0);
}

.potion-info {
    margin-top: 4px;
    padding: 0;

    text-align: center;
}

.potion-info h3 {
    margin: 0 0 8px;

    color: #f4e6c3;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 1px;
}

.potion-stars{
    color:#f7bb4d;
    font-size:16px;
    letter-spacing:2px;
}

.hidden-potions{
    display:none;
}

/* ==========================
   HOW MAGIC WORKS
========================== */

.magic-flow{
    max-width:1500px;
    margin:30px auto;
    padding:70px;

    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:70px;
    position:relative;
    overflow:hidden;

background:none;
}

.magic-flow::before{
    content:"";
    position:absolute;
    inset:0;

    background:
    radial-gradient(circle at center,
    rgba(216,178,110,.05),
    transparent 70%);

    pointer-events:none;
}

.magic-flow::after{

    content:"";

    position:absolute;

    inset:0;

    background:url("images/backgrounds/magic-frame1.png")
               center center
               /100% 290%
               no-repeat;

    pointer-events:none;

    z-index:3;

}

.magic-flow-text{
    width:330px;
    position:relative;
    z-index:5;
}

.magic-flow-text h2{
    margin:0 0 25px;

    color:#d8b26e;
    font-size:28px;
    font-weight:500;
    letter-spacing:3px;
}

.magic-flow-text p{
    margin:0;

    color:#d2c4a7;
    line-height:1.8;
    font-size:15px;
}

.magic-flow-steps{
    flex:1;

    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:24px;

    position:relative;
    z-index:5;
}

.magic-step{
    flex:1;
    text-align:center;
    position:relative;
}

.magic-step:not(:last-child)::after{
    content:"";

    position:absolute;

    top:55px;
    left:75%;

    width:60%;
    height:1.2px;

    background:rgba(245, 185, 82, 0.35);
}

.magic-step-icon{
    width:110px;
    height:110px;

    margin:0 auto 18px;

    display:flex;
    align-items:center;
    justify-content:center;
}

.magic-step-icon img{
    object-fit:contain;
    display:block;
}

.icon-intent{
    width:135px;
    height:135px;
}

.icon-focus{
    width:120px;
    height:120px;
}

.icon-symbols{
    width:128px;
    height:128px;
}

.icon-energy{
    width:125px;
    height:125px;
}

.magic-step h3{
    margin:8px 0 12px;
    color:#f2dfb8;
    font-size:20px;
    letter-spacing:2px;
    font-weight:400;
}

.magic-step p{
    margin:0 auto;
    max-width:170px;
    color:#bfb59c;
    font-size:15px;
    line-height:1.7;
}

/*==========================
FEATURED SPELLS
==========================*/

.spells-section{

    max-width:1500px;

    margin:90px auto;

    text-align:center;
}

.spells-heading{
    margin-bottom:28px;

    display:flex;

    align-items:center;

    justify-content:center;

    gap:18px;

    margin-bottom:42px;
}

.spells-heading span{

    width:90px;

    height:1px;

    background:rgba(216,178,110,.45);
}

.spells-heading h2{

    color:#d8b26e;

    font-size:28px;

    letter-spacing:3px;

    font-weight:400;

    margin:0;
}

.spells-grid{

    display:grid;

    grid-template-columns:repeat(6,1fr);

    gap:18px;
}

.hidden-spells{
    display:none;
    margin-top:24px;

    grid-template-columns:repeat(6, 1fr);
    gap:18px;
}

















.spells-more{

    margin-top:24px;

    padding:12px 42px;

    background:transparent;

    color:#f4e6c3;

    border:1px solid rgba(216,178,110,.75);

    cursor:pointer;

    letter-spacing:2px;
}

.potion-card {
    transition: transform .35s ease;
}

.potion-card:hover {
    transform: translateY(-7px);
}

.artifacts-section{
    max-width:1500px;
    margin: 120px auto 25px;
    padding:0 20px;

    display:grid;
    grid-template-columns:2fr 1fr;
    gap:40px;
}

.site-footer {
    padding: 14px 6px;
}

.artifacts-heading{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:18px;

    margin-bottom:35px;
}

.artifacts-heading span{
    width:80px;
    height:1px;
    background:rgba(216,178,110,.45);
}

.artifacts-heading h2{
    margin:0;

    color:#d8b26e;
    font-size:28px;
    font-weight:400;
    letter-spacing:3px;
}

.artifacts-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:24px;
}

.artifact-card{
    text-align:center;
}

.artifact-image{
    height:180px;

    border:1px solid rgba(216,178,110,.7);
    background:rgba(4,11,21,.9);

    margin-bottom:18px;

    transition:.3s;
}

.artifact-image:hover{
    transform:translateY(-6px);
    border-color:#d8b26e;
}

.artifact-card h3{
    margin-bottom:12px;

    color:#f4e6c3;
    font-size:18px;
    font-weight:400;
}

.artifact-card p{
    color:#d3c2a0;
    line-height:1.45;
    font-size:15px;
}

.magic-nature{
    padding:40px;

    border:1px solid rgba(241, 187, 93, 0.35);

    background:
    linear-gradient(
        rgba(168,138,90,.25),
        rgba(90,65,35,.18)
    );
}

.magic-nature h2{
    text-align:center;
    margin-bottom:28px;

    color:#ebb237;
}

.magic-nature p{
    text-align:center;
    line-height:1.8;
    color:#ebb237;
}

.magic-signature{
    margin-top:32px;

    display:flex;
    align-items:center;
    justify-content:center;
    gap:14px;
}

.signature-name{
    font-family: "Great Vibes", cursive !important;
    font-size: 34px;
    font-weight: 400;
    color: #d89a2b;
    white-space: nowrap;
}

.signature-line{
    width:70px;
    height:1px;

    background:linear-gradient(
        to right,
        transparent,
        rgba(216,154,43,.7)
    );
}

.signature-line:last-child{
    background:linear-gradient(
        to left,
        transparent,
        rgba(216,154,43,.7)
    );
}

.artifacts-carousel {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 18px;
}

.artifact-prev{
    position:absolute;
    left:-30px;
    top:70px;
}

.artifact-next{
    position:absolute;
    right:-30px;
    top:70px;
}

.artifacts-track {
    flex: 1;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.artifact-hidden{
    display:none;
}

.artifact-arrow{
    border: none;
    background: none;
    outline: none;

    color:#d8b26e;
    font-size:32px;
    cursor:pointer;

    display:flex;
    align-items:center;
    justify-content:center;
}

.artifact-arrow:hover{
    color:#f2d08a;
    transform:scale(1.2);
}

/* =========================
   ACTIVE NAVIGATION
========================= */

.nav-link{
    position:relative;
}

.nav-link.active{
    color:#d9b45b;
}

.nav-link.active::after{
    content:"";
    position:absolute;

    left:50%;
    bottom:-18px;

    width:72px;
    height:1px;

    background:#d9b45b;
    transform:translateX(-50%);
}

.nav-link.active::before{
    content:"◇";
    position:absolute;

    left:50%;
    bottom:-25px;

    transform:translateX(-50%);

    color:#d9b45b;
    background:#07111f;

    padding:0 6px;

    font-size:13px;
    line-height:14px;

    z-index:2;
}
/* Unrevealed artifacts */
.artifact-mystery {
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at center, rgba(184, 135, 46, .13), transparent 68%),
        rgba(4, 11, 21, .9);
}

.artifact-question {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 128px;
    font-weight: normal;
    line-height: 1;
    color: #e7c477;
    background: linear-gradient(135deg, #fff0bf 10%, #e7c477 40%, #a86b1c 72%, #efd58f 95%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 9px rgba(224, 173, 69, .3));
    transition: filter .25s ease;
}

.artifact-mystery:hover .artifact-question {
    filter: drop-shadow(0 0 14px rgba(224, 173, 69, .55));
}

.artifact-coming-soon h3 {
    color: #e7c477;
    letter-spacing: 3px;
    font-size: 16px;
    font-weight: normal;
    margin: 18px 0 0;
}

/* Potion recipe modal */
.potion-card { cursor: pointer; }
.potion-card:focus-visible { outline: 2px solid #e7c477; outline-offset: 6px; }
.potion-dialog {
    width: min(1000px, 90vw);
    max-width: none;
    max-height: 94vh;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: auto;
    color: #33200e;
}
.potion-dialog::backdrop { background: rgba(2, 8, 17, .88); }
body:has(.potion-dialog[open]) { overflow: hidden; }
.potion-book { position: relative; aspect-ratio: 1572 / 1024; perspective: 1800px; }
.potion-book-background { display: block; width: 100%; height: 100%; }
.potion-book-close {
    position: absolute; top: 3%; right: 3%;
    width: 36px; height: 36px; padding: 0;
    border: 1px solid #d4ad64; border-radius: 50%;
    background: #20160e; color: #efd395;
    font: 28px/1 Georgia, serif; cursor: pointer; z-index: 5;
}
.potion-book-content {
    position: absolute; inset: 0;
    font-family: Georgia, serif;
    font-size: clamp(12px, 1.05vw, 16px);
    line-height: 1.3;
}
.potion-book-content > * { position: absolute; margin: 0; box-sizing: border-box; }
.potion-book-image { left: 12%; top: 11%; width: 15%; height: 26%; object-fit: contain; }
#potion-book-title { left: 29.5%; top: 11%; width: 20%; height: 7%; font-size: 1.35em; display: flex; align-items: center; }
.potion-book-level { left: 33%; top: 21.5%; width: 16%; }
.potion-book-time { left: 33%; top: 25.5%; width: 16%; }
.potion-book-storage { left: 33%; top: 29.5%; width: 16%; }
.potion-book-effect { left: 12%; top: 45%; width: 37%; height: 10.5%; overflow: auto; }
.potion-book-ingredients {
    left: 11.8%; top: 63%; width: 37.5%; height: 28%;
    display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr;
}
.potion-book-ingredients > div { grid-column: span 2; padding: 8px; align-self: center; text-align: center; }
.potion-book-ingredients > div:nth-child(n+4) { grid-column: span 3; }
.potion-book-steps {
    left: 58%; top: 15.8%; width: 33.3%; height: 65.3%;
    padding: 0; list-style: none; display: grid; grid-template-rows: repeat(10, 1fr);
}
.potion-book-steps li { display: flex; align-items: center; overflow: auto; padding: 2px 4px; }
.potion-book-result { left: 55%; top: 88%; width: 36%; height: 4%; overflow: auto; }
/* Opening sequence: cover first, spread second, text last. */
.potion-book-background,
.potion-book-content { opacity: 0; }
.potion-book-close { z-index: 5; }
.potion-book-cover {
    position: absolute;
    left: 50.5%; top: 3%; width: 45%; height: 100%;
    background: url("images/backgrounds/potions-book2.png") center / 100% 100% no-repeat;
    transform-origin: left center;
    backface-visibility: hidden;
    pointer-events: none;
    opacity: 0;
    z-index: 3;
}
.is-opening .potion-book-cover {
    animation: potion-cover-open 1.5s ease-in-out both;
}

.is-opening .potion-book-background {
    animation: potion-spread-open 2.1s ease-in-out both;
}

.is-opening .potion-book-content {
    animation: potion-content-appear 2.0s ease-in-out both;
}

@keyframes potion-cover-open {
    0%, 15% {
        opacity: 1;
        transform: rotateY(0deg);
    }

    45% {
        opacity: 1;
        transform: rotateY(-65deg);
    }

    65%, 100% {
        opacity: 0;
        transform: rotateY(-100deg);
    }
}

@keyframes potion-spread-open {
    0%, 25% {
        opacity: 0;
        transform: scaleX(.45);
    }

    45% {
        opacity: .65;
        transform: scaleX(.65);
    }

    75%, 100% {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes potion-content-appear {
    0%, 70% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}
@media (max-width: 800px) {
    .potion-book { width: 1000px; }
    .potion-book-content { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    .is-opening .potion-book-cover { animation: none; opacity: 0; }
    .is-opening .potion-book-background,
    .is-opening .potion-book-content { animation: none; opacity: 1; transform: none; }
}

.potion-dialog {
    scrollbar-width: none;
}

.potion-dialog::-webkit-scrollbar {
    display: none;
}

.potion-book-ingredients > div,
.potion-book-steps li,
.potion-book-result {
    white-space: pre-line;
}
/* Recipe text fitted to the ten printed rows. */
.potion-book-content { font-size: clamp(10px, 1.08vw, 13px); line-height: 1.16; }
.potion-book-effect {
    top: 45%; height: 11.5%; overflow: visible;
    font-size: .88em;
}
.potion-book-steps li {
    display: block; align-content: center; overflow: visible;
    white-space: normal; padding: 2px 4px;
    font-size: .84em; line-height: 1.15;
}
.potion-book-result {
    top: 87.6%; height: 6.2%; font-size: .78em;
    line-height: 1.13; overflow: visible; white-space: normal;
}
.potion-book-ingredients {
    top: 63%; height: 28%; overflow: visible;
}
.potion-book-ingredients > div {
    position: relative; align-self: stretch; align-content: center;
    padding: 7px; font-size: .95em; white-space: normal;
}
.ingredient-help {
    display: inline-grid; place-items: center; margin-left: 4px;
    width: 16px; height: 16px; padding: 0;
    background: #4d321b; color: #f5dfad;
    border: 1px solid #aa8042; border-radius: 50%;
    font: 11px Georgia, serif; cursor: pointer;
}
.ingredient-tip {
    display: none; position: absolute; z-index: 6;
    bottom: 75%; left: 0; width: 220px; max-width: 35vw;
    padding: 10px; background: #f5e6c4; color: #33200e;
    border: 1px solid #896438; border-radius: 5px;
    box-shadow: 0 4px 16px #0005; font-size: 12px;
    line-height: 1.35; text-align: left;
}
.show-tip .ingredient-tip,
.ingredient-help:hover + .ingredient-tip,
.ingredient-help:focus-visible + .ingredient-tip { display: block; }









/* Spell cards and accessible descriptions */
.spell-card{width:220px;height:460px;position:relative;display:flex;flex-direction:column;overflow:hidden;border:1px solid #d8b26ea6;border-radius:50%;background:#040b15b8;transition:box-shadow .35s,border-color .35s}
.spell-card::before{content:"";position:absolute;inset:7px;z-index:2;border:1px solid #d8b26e59;border-radius:50%;pointer-events:none}
.spell-image{flex:1;min-height:0;overflow:hidden}
.spell-image img{display:block;width:100%;height:100%;object-fit:cover;object-position:center;transform:none;transition:none}
.spell-name {
    flex: 0 0 110px;
    width: 100%; min-width: 0; margin: 0;
    box-sizing: border-box;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 25px 30px 0;
    border-top: 1px solid #d8b26e40;
    background: #02080ff2; color: #e9d7b0;
    font-family: Georgia, serif; font-size: 15px;
    font-weight: normal; line-height: 1.2; letter-spacing: 2px;
    text-align: center; white-space: normal; overflow-wrap: normal;
}
.spell-card:hover,.spell-card:focus-visible{outline:none;border-color:#ffda85;box-shadow:0 0 8px #ffda85a6,0 0 22px #e0ad4559,inset 0 0 12px #ffda852e}
.spell-card:hover .spell-image img,.spell-card:focus-visible .spell-image img{transform:none}
.spell-tooltip{position:fixed;z-index:1000;width:max-content;max-width:min(230px,calc(100vw - 24px));padding:11px 15px;border:1px solid #b48c49;border-radius:8px;background:#07111ffa;color:#f4e6c3;box-shadow:0 8px 24px #0008;font:13px/1.45 Georgia,serif;text-align:center;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .2s,visibility .2s}
.spell-tooltip.is-visible{opacity:1;visibility:visible}
@media(prefers-reduced-motion:reduce){.spell-card,.spell-image img,.spell-tooltip{transition:none}}

.spell-card .spell-image img {
    transform: translateZ(0) scale(1) !important;
    transition: transform 0.6s ease !important;
    transform-origin: center;
    backface-visibility: hidden;
    will-change: transform;
}

.spell-card:hover .spell-image img,
.spell-card:focus-visible .spell-image img {
    transform: translateZ(0) scale(1.08) !important;
}

.magic-page {
    display: flow-root;
    padding-bottom: 30px;
}

.magic-page .artifacts-section {
    margin-bottom: 0;
}