:root {
    /* Base Variables */
    --duration: 0.8s;
    --ease: cubic-bezier(0.85, 0, 0.15, 1);

    /* Heaven Colors */
    --h-bg-start: #fbfbfd;
    --h-bg-end: #eaeaea;
    --h-text: #1d1d1f;
    --h-text-dim: rgba(29, 29, 31, 0.6);
    --h-accent: #c9a84c;
    --h-accent-glow: rgba(201, 168, 76, 0.6);
    --h-nav: rgba(255, 255, 255, 0.7);

    /* Hell Colors */
    --u-bg-start: #0a0404;
    --u-bg-end: #170505;
    --u-text: #f5f5f7;
    --u-text-dim: rgba(245, 245, 247, 0.6);
    --u-accent: #d31a1a;
    --u-accent-glow: rgba(211, 26, 26, 0.7);
    --u-nav: rgba(10, 4, 4, 0.75);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
}

body {
    width: 100vw;
    height: 100vh;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
    will-change: background, color;
}

/* ──────── Theme Logic (CSS Variables Swapping) ──────── */
body.theme-heaven {
    --bg-start: var(--h-bg-start);
    --bg-end: var(--h-bg-end);
    --text-primary: var(--h-text);
    --text-secondary: var(--h-text-dim);
    --accent-color: var(--h-accent);
    --accent-glow: var(--h-accent-glow);
    --nav-bg: var(--h-nav);
    background: radial-gradient(circle at center 30%, var(--bg-start) 10%, var(--bg-end) 90%);
    color: var(--text-primary);
}

body.theme-hell {
    --bg-start: var(--u-bg-start);
    --bg-end: var(--u-bg-end);
    --text-primary: var(--u-text);
    --text-secondary: var(--u-text-dim);
    --accent-color: var(--u-accent);
    --accent-glow: var(--u-accent-glow);
    --nav-bg: var(--u-nav);
    background: radial-gradient(circle at center 30%, var(--bg-end) 10%, var(--bg-start) 90%);
    color: var(--text-primary);
}

/* Canvas & Vignettes */
#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -4;
}

#vignette {
    position: absolute;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    transition: background var(--duration);
}

body.theme-heaven #vignette {
    background: radial-gradient(circle, transparent 40%, rgba(255, 255, 255, 0.7) 120%);
}

body.theme-hell #vignette {
    background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.9) 110%);
}

/* God Rays (Heaven only) */
.god-rays {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(0deg, transparent 0, transparent 20px, rgba(201, 168, 76, .03) 20px, rgba(201, 168, 76, .03) 40px);
    transform-origin: center top;
    transform: rotate(15deg) scale(2);
    opacity: 0;
    z-index: -3;
    mix-blend-mode: soft-light;
    transition: opacity var(--duration);
    pointer-events: none;
    animation: sway 20s infinite alternate ease-in-out;
}

body.theme-heaven .god-rays {
    opacity: 1;
}

@keyframes sway {
    0% {
        transform: rotate(10deg) scale(2);
    }

    100% {
        transform: rotate(-10deg) scale(2);
    }
}

/* Hell Overlay (Red tint / noise base) */
.hell-overlay {
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
    opacity: 0;
    mix-blend-mode: multiply;
    transition: opacity var(--duration);
}

body.theme-hell .hell-overlay {
    opacity: 1;
}

/* Hell bottom flames gradient */
.hell-flames {
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(120, 20, 0, 0.5) 0%,
        rgba(80, 10, 0, 0.25) 25%,
        rgba(40, 5, 0, 0.08) 50%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity var(--duration);
}
body.theme-hell .hell-flames {
    opacity: 1;
}

/* Navigation */
nav {
    position: absolute;
    top: 0;
    width: 100%;
    height: 80px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-container {
    width: 90%;
    max-width: 1400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(150, 150, 150, 0.15);
    border-radius: 40px;
    padding: 12px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    transition: background var(--duration), box-shadow var(--duration);
}

body.theme-hell .nav-container {
    box-shadow: 0 10px 40px rgba(211, 26, 26, 0.05);
}

.logo {
    position: relative;
}
.logo-text {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    transition: color var(--duration);
}
.nav-center {
    display: flex;
    flex-wrap: nowrap;
    gap: clamp(16px, 2.5vw, 40px);
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-wallet-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(150, 150, 150, 0.25);
    border-radius: 24px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.nav-wallet-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

body.theme-hell .nav-wallet-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

body.theme-hell .nav-wallet-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

/* Realm Switcher */
.realm-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-track {
    width: 60px;
    height: 30px;
    border-radius: 30px;
    position: relative;
    border: 1px solid rgba(150, 150, 150, 0.3);
    background: transparent;
    overflow: hidden;
    transition: border-color var(--duration);
}

.toggle-indicator {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 4px;
    background: var(--h-accent);
    transition: transform 0.6s cubic-bezier(0.5, 2, 0.5, 0.8), background var(--duration), box-shadow var(--duration);
    box-shadow: 0 0 10px var(--h-accent-glow);
}

body.theme-hell .toggle-indicator {
    transform: translateX(28px);
    background: var(--u-accent);
    box-shadow: 0 0 15px var(--u-accent-glow);
}

.realm-label {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    font-weight: 600;
    opacity: 0.4;
    transition: opacity 0.4s, color var(--duration);
}

.realm-label.active {
    opacity: 1;
    color: var(--accent-color);
}

/* Main Hero */
main {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.hero {
    text-align: center;
    max-width: 1000px;
    padding: 20px;
}

.realm-status {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeUp 1s ease 0.2s forwards;
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    line-height: 1;
    position: relative;
    color: var(--text-primary);
    transition: color var(--duration), text-shadow var(--duration);
    opacity: 0;
    transform: translateY(40px);
    animation: fadeUpHero 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

body.theme-heaven .hero-title {
    text-shadow:
        0 0 12px rgba(201, 168, 76, 0.35),
        0 0 24px rgba(201, 168, 76, 0.2),
        0 8px 24px rgba(201, 168, 76, 0.15);
}

body.theme-hell .hero-title {
    text-shadow: 0 20px 60px rgba(211, 26, 26, 0.5);
    font-style: italic;
    letter-spacing: 0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 30px auto 50px;
    line-height: 1.6;
    opacity: 0;
    animation: fadeUp 1s ease 0.6s forwards;
    transition: color var(--duration);
}

/* Buttons */
.cta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    justify-content: center;
    opacity: 0;
    animation: fadeUp 1s ease 0.8s forwards;
}

.btn {
    position: relative;
    padding: 18px 40px;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    overflow: hidden;
    transition: all 0.4s ease;
    border: none;
    background: transparent;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-start);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px var(--accent-glow);
}

.btn-secondary {
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-3px);
}

.wallet-cta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wallet-address-pill {
    padding: 10px 14px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-hell .wallet-address-pill {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-ghost.btn-disconnect {
    padding: 12px 20px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    background: transparent;
}

.btn-ghost.btn-disconnect:hover {
    color: var(--accent-color);
    transform: none;
}

.wallet-hint {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0;
    animation: fadeUp 0.5s ease forwards;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.wallet-hint code {
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
}

body.theme-hell .wallet-hint code {
    background: rgba(255, 255, 255, 0.1);
}

/* Marquee Ticker */
.ticker {
    position: absolute;
    bottom: 40px;
    width: 100%;
    border-top: 1px solid rgba(150, 150, 150, 0.1);
    border-bottom: 1px solid rgba(150, 150, 150, 0.1);
    padding: 12px 0;
    overflow: hidden;
    white-space: nowrap;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.ticker-track {
    display: inline-block;
    animation: scrollLeft 30s linear infinite;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    color: var(--text-primary);
}

.separator {
    margin: 0 40px;
    color: var(--accent-color);
}

/* Animations */
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUpHero {
    0% {
        opacity: 0;
        transform: translateY(60px);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Glitch for Hell mode */
body.theme-hell .hero-title::before,
body.theme-hell .hero-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.6;
    pointer-events: none;
}

body.theme-hell .hero-title::before {
    left: 4px;
    text-shadow: -2px 0 red;
    animation: glitch 2.5s infinite linear alternate-reverse;
}

body.theme-hell .hero-title::after {
    left: -4px;
    text-shadow: 2px 0 blue;
    animation: glitch 3s infinite linear alternate-reverse;
}

@keyframes glitch {

    0%,
    10% {
        clip-path: inset(10% 0 80% 0);
    }

    20% {
        clip-path: inset(80% 0 1% 0);
    }

    30%,
    100% {
        clip-path: inset(50% 0 30% 0);
    }
}

/* Custom Cursor */
#custom-cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    box-shadow: 0 0 15px var(--accent-glow);
    transition: width 0.2s, height 0.2s, background var(--duration), box-shadow var(--duration);
}

#cursor-trail {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9998;
    opacity: 0.5;
    transition: 0.1s linear, background 0.3s;
}

body:hover #custom-cursor.hovering {
    width: 30px;
    height: 30px;
    mix-blend-mode: difference;
    background: var(--text-primary);
}

/* ──────── Lore page ──────── */
body.lore-page {
    overflow-y: auto;
    overflow-x: hidden;
}

.lore-main {
    position: relative;
    min-height: 100vh;
    padding: 100px 24px 80px;
    z-index: 10;
}

.lore-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
    gap: 48px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
    justify-items: center;
}

@media (max-width: 900px) {
    .lore-layout {
        grid-template-columns: 1fr;
        align-items: start;
    }
}

.lore-book {
    max-width: 640px;
    width: 100%;
    min-width: 0;
    justify-self: end;
}

@media (max-width: 900px) {
    .lore-book {
        justify-self: stretch;
    }
}

.lore-header {
    text-align: center;
    margin-bottom: 48px;
}

.lore-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.lore-subtitle {
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.lore-chapter {
    margin-bottom: 2rem;
}

.chapter-heading {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--accent-color);
    margin-bottom: 28px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(150, 150, 150, 0.2);
}

.lore-book .verse {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-left: 2.5rem;
    text-indent: -2.5rem;
}

.verse-num {
    display: inline-block;
    width: 2rem;
    margin-right: 0.5rem;
    font-weight: 600;
    font-size: 0.85em;
    color: var(--accent-color);
    text-align: right;
}

/* Lore page – trailer video (right side, centered on text and screen) */
.lore-video-wrap {
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    max-width: 560px;
    min-width: 320px;
    justify-self: start;
}

@media (max-width: 900px) {
    .lore-video-wrap {
        position: static;
        transform: none;
        max-width: 100%;
        margin-top: 24px;
    }
}

.lore-video-inner {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

body.theme-hell .lore-video-inner {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.lore-trailer {
    display: block;
    width: 100%;
    height: auto;
    max-height: 85vh;
    min-height: 320px;
    object-fit: contain;
    vertical-align: top;
}

.logo a {
    text-decoration: none;
    color: inherit;
}

/* Play page */
body.play-page {
    overflow-y: auto;
    overflow-x: hidden;
}

.play-main {
    position: relative;
    min-height: 100vh;
    padding: 100px 24px 80px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-section {
    text-align: center;
    max-width: 900px;
    width: 100%;
}

.play-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.play-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.play-preview-wrap {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

body.theme-hell .play-preview-wrap {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.play-preview-img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: top;
}

.btn-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 48px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    text-decoration: none;
    color: var(--bg-start);
    background: var(--accent-color);
    border: none;
    border-radius: 6px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-play:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px var(--accent-glow);
}

/* Play page – video popup (hell background + fire particles, centered, close with X) */
.play-video-popup {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: transparent;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.play-video-popup-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-video-popup-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, #1a0505 0%, #0a0202 50%, #000 100%);
    cursor: pointer;
}

.play-video-popup-particles {
    position: absolute;
    inset: 0;
    z-index: 200;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.play-video-popup-close {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 202;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.play-video-popup-close:hover {
    background: rgba(200, 50, 50, 0.6);
    color: #fff;
}

.play-video-popup-video-wrap {
    position: relative;
    z-index: 201;
    flex-shrink: 0;
    width: min(90vw, 1000px);
    max-width: 90vw;
    max-height: 80vh;
    margin: auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(200, 30, 30, 0.3);
}

.play-video-popup-video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    margin: 0 auto;
}

/* Upgrades page */
body.upgrades-page {
    overflow-y: auto;
    overflow-x: hidden;
}

.upgrades-main {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: 120px 24px 80px;
    z-index: 10;
    max-width: 900px;
    margin: 0 auto;
}

.upgrades-hero {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 40px;
}

.upgrades-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.upgrades-lead {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Cool progress / loading bar */
.upgrades-progress-wrap {
    margin-bottom: 48px;
}

.upgrades-progress-bar {
    position: relative;
    width: 100%;
}

.upgrades-progress-track {
    position: relative;
    height: 12px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

body.theme-hell .upgrades-progress-track {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.upgrades-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--accent-glow) 100%);
    box-shadow: 0 0 20px var(--accent-glow);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.upgrades-progress-shine {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 60%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0%, transparent 100%);
    pointer-events: none;
    animation: progressShine 2.5s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.upgrades-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    padding: 0 4px;
}

.upgrades-step {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: color 0.3s, opacity 0.3s;
}

.upgrades-step.active {
    color: var(--accent-color);
    opacity: 1;
}

/* Connect & NFT list */
.upgrades-connect {
    max-width: 560px;
    margin: 0 auto 48px;
}

.upgrades-connect h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upgrades-connect-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.upgrades-nft-list {
    min-height: 60px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.upgrades-nft-list.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.upgrades-nft-list .upgrade-nft-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    border: 2px solid rgba(150, 150, 150, 0.25);
    background: rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}

.upgrades-nft-list .upgrade-nft-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 16px var(--accent-glow);
    transform: scale(1.02);
}

.upgrades-nft-list .upgrade-nft-item.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

body.theme-hell .upgrades-nft-list .upgrade-nft-item {
    background: rgba(255, 255, 255, 0.04);
}

.upgrades-nft-list .upgrade-nft-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upgrades-nft-list .upgrade-nft-item .upgrade-nft-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upgrades-nft-list .upgrade-nft-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Choose upgrade – two cards */
.upgrades-choose {
    margin-top: 32px;
}

.upgrades-choose h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-align: center;
}

.upgrades-choose-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 28px;
}

.upgrades-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .upgrades-cards {
        grid-template-columns: 1fr;
    }
}

.upgrade-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 28px 24px;
    border-radius: 12px;
    border: 1px solid rgba(150, 150, 150, 0.2);
    background: rgba(0, 0, 0, 0.06);
    text-align: center;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
    min-height: 280px;
}

body.theme-hell .upgrade-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.upgrade-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 24px var(--accent-glow);
    transform: translateY(-2px);
}

.upgrade-card-glow {
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.upgrade-card:hover .upgrade-card-glow {
    opacity: 0.15;
}

.upgrade-card-featured {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

.upgrade-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--accent-color);
}

.upgrade-card-badge-mystery {
    opacity: 0.9;
}

.upgrade-card-title {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upgrade-card-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.4;
    min-height: 2.8em;
}

.upgrade-card-price {
    font-family: 'Cinzel', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 20px;
    min-height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-upgrade {
    width: 100%;
    margin-top: auto;
    padding: 14px 20px;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    background: var(--accent-color);
    color: var(--bg-start);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.2s;
}

.btn-upgrade:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-upgrade:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Upgrade modal */
.upgrade-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.upgrade-modal {
    background: var(--bg-start);
    border: 1px solid rgba(150, 150, 150, 0.25);
    border-radius: 16px;
    padding: 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.upgrade-modal-content {
    margin-bottom: 24px;
}

.upgrade-modal-title {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.upgrade-modal-choices {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.upgrade-choice-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(150, 150, 150, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.upgrade-choice-btn:hover {
    border-color: var(--accent-color);
}

.upgrade-choice-btn.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 12px var(--accent-glow);
}

.upgrade-evm-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    border: 1px solid rgba(150, 150, 150, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    margin-top: 8px;
}

.upgrade-modal-actions {
    display: flex;
    gap: 12px;
}

.upgrade-modal-actions .btn-upgrade {
    flex: 1;
    margin-top: 0;
}

.upgrade-modal-cancel {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(150, 150, 150, 0.3);
}

.upgrade-modal-cancel:hover:not(:disabled) {
    box-shadow: none;
}

/* Admin EVM list */
.upgrades-admin {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(150, 150, 150, 0.2);
}

.upgrades-admin h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upgrades-admin .btn-upgrade {
    margin-bottom: 16px;
    margin-top: 0;
}

.upgrades-evm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.upgrades-evm-table th,
.upgrades-evm-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(150, 150, 150, 0.2);
}

.upgrades-evm-table th {
    color: var(--text-secondary);
    font-weight: 600;
}

.upgrades-evm-table code {
    font-size: 0.8rem;
    word-break: break-all;
}

.nav-link.active {
    color: var(--accent-color);
}

/* ──────── Gallery page ──────── */
body.gallery-page {
    overflow-y: auto;
    overflow-x: hidden;
}

body.gallery-page nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* Guaranteed gap so first row never sits under the fixed nav */
.gallery-nav-spacer {
    height: 100px;
    min-height: 100px;
    flex-shrink: 0;
    width: 100%;
}

.gallery-main {
    position: relative;
    height: auto;
    min-height: 100vh;
    display: block;
    justify-content: unset;
    align-items: unset;
    padding: 24px 24px 80px;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-header {
    text-align: center;
    margin-bottom: 48px;
}

.gallery-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.gallery-subtitle {
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.gallery-tabs {
    display: inline-flex;
    gap: 0;
    border-radius: 999px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(150, 150, 150, 0.2);
}

body.theme-hell .gallery-tabs {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.gallery-tab {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    padding: 10px 28px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s, background 0.3s, box-shadow 0.3s;
}

.gallery-tab:hover {
    color: var(--text-primary);
}

.gallery-tab.active {
    background: var(--accent-color);
    color: var(--bg-start);
    box-shadow: 0 0 16px var(--accent-glow);
}

body.theme-hell .gallery-tab.active {
    background: var(--u-accent);
    color: var(--bg-start);
    box-shadow: 0 0 16px var(--u-accent-glow);
}

.gallery-section {
    margin-bottom: 56px;
}

.gallery-section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--accent-color);
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(150, 150, 150, 0.2);
}

.gallery-section.gallery-demons .gallery-section-title {
    color: var(--u-accent);
}

body.theme-hell .gallery-section.gallery-angels .gallery-section-title {
    color: var(--h-accent);
}

body.theme-hell .gallery-section.gallery-demons .gallery-section-title {
    color: var(--u-accent);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

@media (min-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
}

.gallery-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid rgba(150, 150, 150, 0.2);
    background: rgba(0, 0, 0, 0.08);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.gallery-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: scale(1.02);
}

.gallery-card--demon:hover {
    border-color: var(--u-accent);
    box-shadow: 0 0 20px var(--u-accent-glow);
}

body.theme-hell .gallery-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}