* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
img, picture, video {
    max-width: 100%;
    height: auto;
}
/* ===============================
        THEME & TOKENS
        =============================== */
:root {
    --paper-img: url('assets/textures/parchment_textures/parchment-base-4k.png');
    --fibers-img: url('assets/textures/parchment_textures/paper_fibers_1k.png');
    --creases-img: url('assets/textures/parchment_textures/paper_creases_2k.png');
    --noise-img: url('assets/textures/parchment_textures/fine_noise_512.png');
    --bg-0: #f3e7c3; /* parchment base (light) */
    --bg-1: #e9d9a7;
    --bg-2: #d9c48a;
    --bg-3: #b08c53; /* burn */
    --ink: #1f1408;
    --ink-muted: #433522;
    --gold: #e6c965;
    --accent: #cfa34b;
    --accent-2: #9b6b25;
    --elev: 0 2px 4px rgba(0,0,0,.12), 0 6px 12px rgba(0,0,0,.10);
    --radius: 18px;
    --radius-lg: 26px;
    --maxw: 1200px;
}
/* =============== BASE =============== */
html {
    scroll-behavior: smooth;
}
/* === Base Fantasy Theme === */
body {
    font-family: 'Uncial Antiqua', 'MedievalSharp', serif;
    background: url('assets/night.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #f0e6d2;
    line-height: 1.7;
}
/* Headers */
/* Fluid type */
h1 {
    font-size: clamp(1.6rem, 4.5vw + .2rem, 2.6rem);
    line-height: 1.15;
}

h2 {
    font-size: clamp(1.2rem, 2.6vw + .2rem, 1.8rem);
}

h3 {
    font-size: clamp(1.05rem, 1.8vw + .2rem, 1.3rem);
}

h1, h2 {
    font-family: 'MedievalSharp', cursive;
    text-shadow: 2px 2px #000;
    color: var(--gold);
}

    h2 a {
        text-decoration: none;
        color: var(--gold);
    }

li a {
    text-decoration: none;
    color: #fff;
}



/* Logo */
.logo {
    font-size: 2rem;
    color: var(--gold);
    text-shadow: 2px 2px #222;
    flex-shrink: 0;
}
    .logo a {
        color: var(--gold);
        text-decoration: none;
    }
/* Header Layout */
header {
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.5rem;
    background: rgba(0, 0, 0, 0.2); /* subtle overlay to help logo contrast */
    border-bottom: 2px solid rgba(255, 215, 128, 0.3);
}

/* Logo Container */


.logo-link img {
    height: 100px; /* increase for readability */
    width: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 3px 4px rgba(255, 230, 150, 0.8));
    transition: transform 0.25s ease, filter 0.25s ease;
}

/* Logo Hover Effect */
.logo-link:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(255, 230, 150, 0.8));
}

/* Adjust for smaller screens */
@media (max-width: 640px) {
    .logo-link img {
        height: 100px;
    }
}
/* Navigation */
nav {
    background: rgba(30,30,30,.9);
    border-bottom: 2px solid var(--gold);
}
header,
nav {
    position: relative; /* required for z-index to work */
    z-index: 3000; /* above regular content */
    overflow: visible; /* don't clip the dropdown */
}
    nav ul {
        list-style: none;
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.9rem 1rem;
        margin: 0;
    }
    nav a, .nav-links a {
        display: block;
        color: #f2f2f2;
        text-decoration: none;
        font-weight: 700;
        font-size: 1.05rem; /* bump text size */
        padding: 0.9rem 1.2rem; /* more vertical height */
        border-radius: 10px;
        transition: color .3s, background .3s;
    }
        nav a:hover,
        .nav-links a:hover {
            color: #ff9f1c;
            background: #5c2e91;
        }

nav > ul > li{
    position: relative;
    display: inline-block
}




/* Dropdown Styles */
.nav-links li {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 6000;
    min-width: 180px;
    display: none;
    background: #1e1e1e;
    border-radius: 8px;
    padding: .35rem;
    box-shadow: var(--elev);
}
/* Each dropdown needs a positioned parent */
.dropdown {
    position: relative;
}
.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    padding: 0.5rem;
}
.dropdown-menu a {
    padding: .55rem .7rem;
    border-radius: 8px;
    font-size: 1rem;
}
    .dropdown-menu li a {
        color: #f2f2f2;
        text-decoration: none;
        display: block;
    }

    .dropdown-menu li:hover {
        background: #333;
    }
/* Mobile nav: stack links, make dropdowns always visible when parent gets .open (JS can toggle) */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
        padding: .6rem;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        padding: 0;
        background: transparent;
    }

    .dropdown.open .dropdown-menu {
        display: block;
    }
}
/* ===== Parchment Quick Links Banner (light/dark aware) ===== */
.promo-banner {
    position: relative;
    margin: 1.25rem auto 2rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(80,45,10,.25);
    /* Layer real textures if you defined them; graceful fallbacks otherwise */
    background-size: cover, auto, auto, cover;
    background-blend-mode: multiply, overlay, overlay, normal;
    overflow: hidden;
    border-color: rgba(255,255,255,.08);
    background: var(--tx-creases, radial-gradient(120% 80% at 10% 0%, rgba(255,230,170,.08), transparent 50%)), var(--tx-fibers, repeating-linear-gradient(25deg, rgba(255,230,170,.05) 0 2px, transparent 2px 6px)), var(--tx-noise, radial-gradient(80% 70% at 20% 80%, rgba(255,240,200,.05), transparent 50%)), linear-gradient(#2a2316, #1a160f);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), inset 0 0 60px rgba(0,0,0,.35), 0 10px 30px rgba(0,0,0,.4);
}

    /* Burned/torn-ish edge vignette */
    .promo-banner::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: radial-gradient(120% 90% at 50% 0%, transparent 60%, rgba(30,15,5,.35) 95%), radial-gradient(120% 90% at 50% 100%, transparent 60%, rgba(30,15,5,.35) 95%);
        mix-blend-mode: multiply;
    }

@keyframes swirl {
    to {
        transform: rotate(360deg);
    }
}

/* Grid + cards */
.promo-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .9rem;
}

.promo-card {
    position: relative;
    display: grid;
    gap: .35rem;
    padding: .95rem 1rem;
    text-decoration: none;
    border-radius: 14px;
    border: 1px solid rgba(80,45,10,.25);
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, outline-color .18s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,.2);
    outline: 0 solid transparent;
    border-color: rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.18)), var(--tx-noise, radial-gradient(120% 80% at 80% 10%, rgba(255,255,255,.04), transparent 45%));
}

    .promo-card:hover {
        transform: translateY(-3px);
        border-color: rgba(230,201,101,.55);
        outline: 1px solid rgba(230,201,101,.35); /* ember glow */
        box-shadow: 0 12px 32px rgba(0,0,0,.5), 0 0 18px rgba(230,201,101,.28);
        outline-color: rgba(230,201,101,.45);
    }

.promo-ico {
    font-size: 1.4rem;
    line-height: 1;
}

.promo-title {
    font-family: 'Uncial Antiqua', serif;
    font-size: 1.05rem;
}

.promo-sub {
    font-size: .85rem;
    opacity: .9;
}



/* ===== light mode variants  ===== */
body.light .promo-banner {
    background:
    /* crease layer */
    var(--tx-creases, radial-gradient(120% 80% at 10% 0%, rgba(90,60,30,.15), transparent 50%)),
    /* fibers */
    var(--tx-fibers, repeating-linear-gradient(25deg, rgba(80,60,30,.05) 0 2px, transparent 2px 6px)),
    /* noise */
    var(--tx-noise, radial-gradient(80% 70% at 20% 80%, rgba(0,0,0,.05), transparent 50%)),
    /* paper base */
    var(--tx-paper, linear-gradient(#f3e7c3, #e6d39d));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 0 60px rgba(80,40,10,.25), 0 10px 30px rgba(0,0,0,.25);
}

body.light .promo-card {
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.14)), var(--tx-noise, radial-gradient(120% 80% at 80% 10%, rgba(0,0,0,.05), transparent 45%));
}

    body.light .promo-card:hover {
        box-shadow: 0 10px 28px rgba(0,0,0,.28), 0 0 18px rgba(230,201,101,.22);
    }
/* Dice Roller */
.dice-roller {
    margin-top: 1rem;
}

    .dice-roller select,
    .dice-roller button {
        padding: 0.5rem;
        font-size: 1rem;
        margin-right: 0.5rem;
    }

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    max-width: 400px;
    margin: auto;
}

    .contact-form input,
    .contact-form textarea {
        margin-bottom: 1rem;
        padding: 0.75rem;
        border: none;
        border-radius: 5px;
    }

    .contact-form button {
        background: #ff9f1c;
        color: #121212;
        border: none;
        padding: 0.75rem;
        font-weight: bold;
        cursor: pointer;
        border-radius: 5px;
    }

        .contact-form button:hover {
            background: #ffa938;
        }

/* Theme Toggle */
#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Light Mode */
body.light {
    background: url('assets/day.jpg') no-repeat center center fixed;
    background-size: cover;
}

    body.light header,
    body.light .dropdown-menu,
    body.light footer {
        background: #fff;
        color: #121212;
    }

    body.light nav a {
        color: #121212;
    }

    body.light .btn {
        background: #121212;
        color: #fff;
    }
/* Form Validation */
.error {
    color: #ff4d4d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

input:invalid,
textarea:invalid {
    border: 1px solid #ff4d4d;
}

.form-status {
    margin-top: 1rem;
    font-weight: bold;
    color: #77dd77;
}

/* =============== HERO =============== */
.hero {
    background: linear-gradient(rgba(18,18,18,.8), rgba(18,18,18,.8)), url('assets/magic-hero.jpg') center/cover no-repeat;
    text-align: center;
    padding: 4.5rem 1rem;
    color: #f0e6d2;
    
}

    .hero h1 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

     .hero p {
        font-size: 1.2rem;
        max-width: 600px;
        margin: 0.75rem auto 2rem;
    }

@media (max-width:768px) {
    .hero h1 {
        font-size: 2rem;
    }
}



/* =============== BUTTONS =============== */
.btn, .contact-form button {
    display: inline-block;
    padding: .75rem 1.05rem;
    min-height: 44px; /* mobile tap target */
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.14);
    background: linear-gradient(var(--gold), var(--accent));
    color: #20160a;
    text-shadow: 0 1px 0 rgba(255,255,255,.45);
    box-shadow: 0 3px 0 rgba(0,0,0,.18);
    transition: transform .15s ease, box-shadow .15s ease;
    position: relative;
    overflow: hidden;
    z-index: 0;
}

    .btn:hover, .contact-form button:hover {
        background: #d4a017;
        transform: scale(1.05);
        box-shadow: 0 0 15px #ffe184;
    }


/* Sections */
.preview, .page-content {
    background: rgba(0, 0, 0, 0.6);
    padding: 2rem;
    border: 2px solid #5c2e91;
    border-radius: 15px;
    margin: 2rem auto;
    max-width: 900px;
    box-shadow: 0 0 20px #222;
    animation: glow-border 5s infinite alternate;
}

    .preview.alt {
        background: #262626;
    }

    .preview h2 {
        margin-bottom: 1rem;
        color: #ff9f1c;
    }

    .preview ul {
        list-style: none;
    }

    .preview li {
        margin: 0.5rem 0;
    }
/* Inputs & Form */
input, textarea, select {
    font-family: 'MedievalSharp', sans-serif;
    background: #2d2d2d;
    color: #f0e6d2;
    border: 1px solid #e6c965;
    border-radius: 6px;
    padding: 0.5rem;
    width: 100%;
}
/* Contact form container */
.contact-form {
    display: flex;
    flex-direction: column;
    max-width: 400px;
    margin: auto;
}

    .contact-form input, .contact-form textarea {
        margin-bottom: 1rem;
    }
/* Footer */
footer {
  display: flex;               /* make it a flex container */
  flex-direction: row;         /* row is default, but fine to keep */
  flex-wrap: wrap;             /* allows wrapping on small screens */
  justify-content: center;     /* center the row */
  align-items: center;
  gap: .75rem 1rem;            /* space between links */
  background: rgba(30,30,30,.9);
  border-top: 2px solid #e6c965;
  color: #aaa;
  padding: .6rem 1rem;
  font-size: .9rem;
}

/* prevent any global “display:block” link styles from stacking them */
footer a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: 1.2em;
  color: white;
}
    footer a:hover {
        color: #ff9f1c;
    }
.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .75rem 0 0;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.2);
    background: rgba(0,0,0,.04);
    text-decoration: none;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease, opacity .15s ease;
}

    .social-link svg {
        width: 18px;
        height: 18px;
        fill: white;
    }
    body.light footer a {
        color:black;
    }
        body.light footer a:hover {
            color: #ff9f1c;
        }
        body.light .social-link svg {
            fill: black;
        }

    .social-link:hover {
        transform: translateY(-2px);
        background: rgba(0,0,0,.06);
        border-color: rgba(0,0,0,.35);
    }

@media (prefers-color-scheme: dark) {
    .social-link {
        border-color: rgba(255,255,255,.25);
        background: rgba(255,255,255,.06);
    }

        .social-link:hover {
            background: rgba(255,255,255,.12);
            border-color: rgba(255,255,255,.45);
        }
}
/* accessible hidden text for labels */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Page Fade-In */
body {
    opacity: 0;
    transition: opacity 1s ease-in;
}

    body.loaded {
        opacity: 1;
    }
/*hover shimmer effect*/
.btn, .contact-form button, .nav-links a {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

    .btn::before, .contact-form button::before, .nav-links a::before {
        content: "";
        position: absolute;
        top: 0;
        left: -120%;
        width: 220%;
        height: 100%;
        background: linear-gradient(120deg, transparent, rgba(255,255,255,.3), transparent);
        transition: left .5s;
        z-index: -1;
    }

    .btn:hover::before,
    .contact-form button:hover::before,
    .nav-links a:hover::before {
        left: 100%;
    }
/*Glowing spell border*/
.spell-border {
    border: 2px solid #7f00ff;
    box-shadow: 0 0 10px #7f00ff, 0 0 20px #b266ff;
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px #7f00ff;
    }

    100% {
        box-shadow: 0 0 25px #b266ff;
    }
}

/* Fade-in animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeUp 1s ease forwards;
}

/* Add a delay via inline style or class */
.delay-1 {
    animation-delay: 0.3s;
}

.delay-2 {
    animation-delay: 0.6s;
}

.delay-3 {
    animation-delay: 0.9s;
}

/* Button Hover */
.btn, .contact-form button {
    transition: transform 0.2s ease;
}

    .btn:hover, .contact-form button:hover {
        transform: scale(1.05);
    }

/* Dropdown Animation */
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}
/* Optional animated glowing border */
@keyframes glow-border {
    0% {
        box-shadow: 0 0 10px #ffdf70;
    }

    50% {
        box-shadow: 0 0 20px #e6c965;
    }

    100% {
        box-shadow: 0 0 10px #ffdf70;
    }
}

.page-content, .preview {
    animation: glow-border 5s infinite alternate;
}

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .preview h2 {
        font-size: 1.5rem;
    }
}
.dice-face {
    width: 64px;
    height: 64px;
    margin: 0.5rem;
    display: inline-block;
    animation: fadeUp 0.4s ease;
}

/* Spinning Animation */
@keyframes spinDice {
    0% {
        transform: rotateY(0deg) scale(1);
    }

    50% {
        transform: rotateY(180deg) scale(1.2);
    }

    100% {
        transform: rotateY(360deg) scale(1);
    }
}
/*All added*/
button {
    background-color: #444;
    color: #fff;
    padding: 0.5rem 1rem;
    border: none;
    margin: 0.5rem 0;
    cursor: pointer;
    border-radius: 0.4rem;
}

    button:hover {
        background-color: #666;
    }
.entry h3 {
    cursor: pointer;
}

.entry-body {
    display: none;
    margin: 0.5rem 0;
}

/* Map marker */
.map-marker {
    position: absolute;
    transform: translate(-50%,-50%);
    background: rgba(255,255,255,.2);
    border: 2px solid #88f;
    border-radius: 50%;
    font-size: 1.2rem;
    padding: 4px 6px;
    cursor: pointer;
    color: #fff;
}
/* Spell Animation Base */
#spellDisplay {
    position: relative;
    text-align: center;
    font-size: 2rem;
    padding: 1rem;
    margin: 1rem auto;
    max-width: 600px;
    transition: all 0.3s ease;
}

/* Base animation */
.spell-animation {
    animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
        opacity: 0.8;
    }

    to {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Spell specific styles */
.spell-fire {
    color: orangered;
    text-shadow: 0 0 10px red;
    background: linear-gradient(to right, #ff6600, #ff0000);
    border-radius: 10px;
}

.spell-frost {
    color: lightblue;
    text-shadow: 0 0 10px #00ffff;
    background: linear-gradient(to right, #ccf2ff, #99e6ff);
    border-radius: 10px;
}

.spell-lightning {
    color: yellow;
    text-shadow: 0 0 10px #ffff66;
    background: linear-gradient(to right, #fefcea, #f1da36);
    border-radius: 10px;
}

.spell-heal {
    color: lightgreen;
    text-shadow: 0 0 10px #00ff99;
    background: linear-gradient(to right, #cfffdd, #aaffcc);
    border-radius: 10px;
}

.spell-dark {
    color: white;
    background: black;
    text-shadow: 0 0 20px #666;
    border-radius: 10px;
}

.spell-light {
    color: gold;
    text-shadow: 0 0 12px white;
    background: linear-gradient(to right, #fff9c4, #fff176);
    border-radius: 10px;
}

.spell-shield {
    color: #aeeaff;
    background: linear-gradient(to right, #d0f0ff, #a0cfe8);
    border-radius: 10px;
}

.spell-polymorph {
    color: violet;
    background: linear-gradient(to right, #f3c6ff, #e0aaff);
    border-radius: 10px;
}

.spell-generic {
    color: white;
    background: gray;
    border-radius: 10px;
}
/* ===== Mobile-safe floating UI (dice, cart, back-to-top) ===== */

/* Always visible on small screens (even if other CSS hides them) */
@media (max-width: 900px) {
    .dice-fab,
    .floating-cart,
    #backToTop {
        display: block !important;
    }
}

/* Floating Dice */
.dice-fab {
    position: fixed;
    left: max(16px, env(safe-area-inset-left));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 9999; /* above nav overlays/modals */
    pointer-events: auto;
}

    .dice-fab button {
        width: 56px;
        height: 56px;
        border-radius: 9999px;
        background: radial-gradient(circle at 30% 30%, var(--gold), var(--accent));
        border: 1px solid rgba(0,0,0,.2);
        box-shadow: 0 6px 12px rgba(0,0,0,.35);
        cursor: pointer;
    }

/* Floating Cart (launcher chip + modal container) */
.floating-cart {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 9998;
    cursor: pointer;
}

    .floating-cart .cart-link {
        background: rgba(0,0,0,.65);
        color: white;
        border: 1px solid rgba(255,255,255,.2);
        padding: .55rem .75rem;
        border-radius: 999px;
        box-shadow: 0 6px 12px rgba(0,0,0,.3);
    }

/* Ensure cart modal sits above everything when opened */
.cart-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.6);
    z-index: 10000;
}

    .cart-modal.show,
    .cart-modal[open] {
        display: flex;
    }

.cart-panel {
    width: min(520px, 92vw);
    max-height: 80vh;
    overflow: auto;
    background: linear-gradient(var(--bg-0), var(--bg-1));
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.55);
    cursor: pointer;
}
.cart-panel strong, .cart-panel p, .cart-panel span, .tiny{
    color: black;
}
/* Back to Top */
#backToTop {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 72px); /* clear cart button */
    width: 48px;
    height: 48px;
    display: none;
    place-items: center;
    background: rgba(0,0,0,.75);
    color: #fff;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    font-size: 1.2rem;
    box-shadow: 0 6px 12px rgba(0,0,0,.35);
    z-index: 9997;
    text-align: center; /* horizontal safety */
    line-height: 2; /* remove extra leading */
    padding: 0;
}

    #backToTop.show {
        display: grid;
        place-items: center; /* perfect centering */

    }
    #backToTop:hover {
        cursor: pointer;
        border-color: white;
    }
/* ===== Ads: theme-aware, zero CLS ===== */
.ad-slot {
    position: relative;
    display: grid;
    place-items: center;
    margin: 1rem auto;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.12);
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.14)), var(--tx-noise, radial-gradient(120% 80% at 80% 10%, rgba(255,255,255,.04), transparent 45%));
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
    overflow: hidden;
    min-height: 280px; /* Reserve space to prevent CLS */
}

/* Subtle parchment variant in light mode */
body.light .ad-slot {
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.08)), var(--tx-noise, radial-gradient(120% 80% at 80% 10%, rgba(0,0,0,.05), transparent 45%));
    border-color: rgba(0,0,0,.14);
}

/* Sizes that adapt */
.ad--rect {
    width: 100%;
    max-width: 336px;
    min-height: 280px;
}
/* 300x250/336x280 */
.ad--leader {
    width: 100%;
    min-height: 90px;
}
/* 728x90/970x90 */
@media (min-width: 980px) {
    .ad--leader {
        min-height: 90px;
    }
}

/* Ad label */
.ad-label {
    position: absolute;
    top: 8px;
    left: 10px;
    padding: .15rem .45rem;
    font-size: .75rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(0,0,0,.4);
    color: #fff;
}

body.light .ad-label {
    background: #fff1cf;
    color: #2a1b08;
    border-color: rgba(0,0,0,.15);
}

/* Skeleton while loading */
.ad-skeleton {
    width: 92%;
    height: 70%;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.14), rgba(255,255,255,.06));
    animation: adshimmer 1.3s infinite;
}

@keyframes adshimmer {
    0% {
        transform: translateX(-10%)
    }

    100% {
        transform: translateX(10%)
    }
}

/* ===== Sticky mobile footer ad ===== */
.ad-sticky-footer {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 72px); /* clears your floating cart/back-to-top */
    z-index: 9996; /* below your back-to-top (9997) */
    display: none;
}

@media (max-width: 900px) {
    .ad-sticky-footer {
        display: block;
    }
}

.ad-sticky-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(6px);
}

body.light .ad-sticky-inner {
    background: rgba(255,241,207,.92);
    border-color: rgba(0,0,0,.15);
}

.ad-sticky-close {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 1.1rem;
}

/* Optional: desktop right rail (hidden on small screens) */
.ad-rail {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    top: 120px;
    width: 300px;
    z-index: 20;
    display: none;
}

@media (min-width: 1200px) {
    .ad-rail {
        display: block;
    }
}
