/* ===== FABULA ARCANA - CODEX MYSTERIUM ===== */
/* Fantasy Manual Style - Daggerheart Inspired */

/* ===== CSS VARIABLES ===== */
:root {
    /* Core Colors - Rosa/Viola/Blu/Nero */
    --bg-void: #08080f;
    --bg-deep: #0d0d1a;
    --bg-primary: #12121f;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(22, 33, 62, 0.85);
    
    /* Accent Colors */
    --accent-pink: #e91e8c;
    --accent-rose: #ff6b9d;
    --accent-violet: #a855f7;
    --accent-purple: #7c3aed;
    --accent-blue: #3b82f6;
    --accent-cyan: #22d3ee;
    --accent-gold: #fbbf24;
    
    /* Gradients */
    --gradient-magic: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-violet) 50%, var(--accent-blue) 100%);
    --gradient-card: linear-gradient(145deg, rgba(26, 26, 46, 0.95) 0%, rgba(12, 12, 20, 0.98) 100%);
    --gradient-glow: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, transparent 70%);
    
    /* Text Colors */
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b5;
    --text-accent: #c4b5fd;
    --text-muted: #6b6b80;
    
    /* Effects */
    --glow-pink: 0 0 30px rgba(233, 30, 140, 0.4);
    --glow-violet: 0 0 30px rgba(168, 85, 247, 0.4);
    --glow-blue: 0 0 30px rgba(59, 130, 246, 0.4);
    
    /* Borders */
    --border-subtle: rgba(168, 85, 247, 0.2);
    --border-accent: rgba(168, 85, 247, 0.5);
    
    /* Fonts */
    --font-display: 'Cinzel', serif;
    --font-body: 'Spectral', serif;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body.guida-page {
    font-family: var(--font-body);
    background: var(--bg-void);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== MAGICAL BACKGROUND ===== */
.magical-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.particle-field {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.magic-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-violet);
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle 10s infinite ease-in-out;
    box-shadow: 0 0 10px var(--accent-violet), 0 0 20px var(--accent-pink);
}

@keyframes floatParticle {
    0%, 100% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.8;
        transform: translateY(80vh) scale(1);
    }
    90% {
        opacity: 0.8;
        transform: translateY(-10vh) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20vh) scale(0);
    }
}

.arcane-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(168, 85, 247, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.mystical-fog {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(233, 30, 140, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
    animation: fogDrift 20s ease-in-out infinite;
}

@keyframes fogDrift {
    0%, 100% { transform: scale(1) translate(0, 0); }
    25% { transform: scale(1.1) translate(2%, -2%); }
    50% { transform: scale(1) translate(-1%, 1%); }
    75% { transform: scale(1.05) translate(-2%, 2%); }
}

/* ===== VIDEO BACKGROUND ===== */
.video-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    overflow: hidden;
}

.video-bg-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.2) saturate(0.8);
}

.video-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(180deg, rgba(8, 8, 15, 0.7) 0%, rgba(8, 8, 15, 0.4) 30%, rgba(8, 8, 15, 0.6) 70%, rgba(8, 8, 15, 0.9) 100%),
        radial-gradient(ellipse at center, transparent 0%, rgba(8, 8, 15, 0.5) 100%);
}

/* ===== BOOK SPINE DECORATIONS ===== */
.book-spine {
    position: fixed;
    top: 0;
    width: 8px;
    height: 100%;
    z-index: 50;
    pointer-events: none;
}

.book-spine.left-spine {
    left: 0;
    background: linear-gradient(180deg, 
        var(--accent-pink) 0%, 
        var(--accent-violet) 25%,
        var(--accent-purple) 50%,
        var(--accent-blue) 75%,
        var(--accent-pink) 100%);
    box-shadow: 5px 0 30px rgba(168, 85, 247, 0.3);
}

.book-spine.right-spine {
    right: 0;
    background: linear-gradient(180deg, 
        var(--accent-blue) 0%, 
        var(--accent-purple) 25%,
        var(--accent-violet) 50%,
        var(--accent-pink) 75%,
        var(--accent-blue) 100%);
    box-shadow: -5px 0 30px rgba(168, 85, 247, 0.3);
}

/* ===== WRAPPER ===== */
.guida-wrapper {
    position: relative;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.guida-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 15px 25px;
    background: linear-gradient(180deg, rgba(8, 8, 15, 0.95) 0%, rgba(8, 8, 15, 0.8) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(233, 30, 140, 0.1) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: 30px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
}

.back-home-btn svg {
    width: 18px;
    height: 18px;
}

.back-home-btn:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3) 0%, rgba(233, 30, 140, 0.2) 100%);
    border-color: var(--accent-violet);
    color: var(--text-primary);
    transform: translateX(-5px);
    box-shadow: var(--glow-violet);
}

.logo-container {
    text-align: center;
    position: relative;
}

.logo-rune {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 50%;
    animation: runeRotate 30s linear infinite;
}

@keyframes runeRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    position: relative;
    z-index: 1;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.logo-accent {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-magic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.logo-subtitle {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    font-style: italic;
    margin-top: 2px;
}

.header-decoration {
    width: 100px;
}

/* ===== SIDEBAR NAVIGATION ===== */
.guida-sidebar {
    position: fixed;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    width: 200px;
    padding: 20px;
    background: linear-gradient(145deg, rgba(18, 18, 31, 0.95) 0%, rgba(8, 8, 15, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--glow-violet);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 15px;
}

.sidebar-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-magic);
    border-radius: 8px;
}

.sidebar-icon svg {
    width: 18px;
    height: 18px;
    color: white;
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition-smooth);
    overflow: hidden;
}

.link-number {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--accent-violet);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    transition: var(--transition-fast);
}

.link-text {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
}

.link-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-magic);
    opacity: 0;
    transition: var(--transition-fast);
    z-index: -1;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(168, 85, 247, 0.1);
}

.sidebar-link:hover .link-number,
.sidebar-link.active .link-number {
    background: var(--gradient-magic);
    border-color: transparent;
    color: white;
}

.sidebar-link:hover .link-text,
.sidebar-link.active .link-text {
    color: var(--text-primary);
}

.sidebar-link.active .link-glow {
    opacity: 0.1;
}

.sidebar-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-subtle);
}

.scroll-indicator {
    display: flex;
    justify-content: center;
}

.scroll-line {
    width: 2px;
    height: 30px;
    background: linear-gradient(180deg, var(--accent-violet) 0%, transparent 100%);
    border-radius: 2px;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; height: 20px; }
    50% { opacity: 1; height: 30px; }
}

/* ===== MAIN CONTENT ===== */
.guida-main {
    padding-left: 260px;
    padding-right: 40px;
    padding-top: 100px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== HERO SECTION ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 100px 20px;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    max-width: 700px;
    padding: 60px 40px;
    background: linear-gradient(145deg, rgba(18, 18, 31, 0.8) 0%, rgba(8, 8, 15, 0.9) 100%);
    border: 2px solid var(--border-subtle);
    border-radius: 30px;
    backdrop-filter: blur(20px);
    animation: heroReveal 1s ease-out;
}

@keyframes heroReveal {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero-ornament {
    height: 40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40'%3E%3Cpath d='M0,20 Q50,0 100,20 T200,20' fill='none' stroke='%23a855f7' stroke-width='1' opacity='0.5'/%3E%3Ccircle cx='100' cy='20' r='4' fill='%23a855f7' opacity='0.8'/%3E%3C/svg%3E") center no-repeat;
    background-size: contain;
}

.hero-ornament.bottom {
    transform: rotate(180deg);
}

.hero-badge {
    display: inline-block;
    padding: 8px 25px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(233, 30, 140, 0.1) 100%);
    border: 1px solid var(--border-accent);
    border-radius: 30px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--accent-violet);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 30px;
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.2); }
    50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.4); }
}

.hero-title {
    margin-bottom: 20px;
}

.title-line {
    display: block;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 5px;
    text-transform: uppercase;
}

.title-main {
    display: block;
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    background: var(--gradient-magic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 8px;
    text-transform: uppercase;
    margin: 15px 0;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.5)); }
    50% { filter: drop-shadow(0 0 30px rgba(233, 30, 140, 0.8)); }
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 30px;
}

.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.divider-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-violet), transparent);
}

.divider-symbol {
    width: 10px;
    height: 10px;
    background: var(--accent-violet);
    transform: rotate(45deg);
    box-shadow: var(--glow-violet);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 35px;
    background: var(--gradient-magic);
    border: none;
    border-radius: 30px;
    color: white;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 40px rgba(168, 85, 247, 0.4);
}

.hero-cta svg {
    width: 20px;
    height: 20px;
    animation: bounceDown 2s ease-in-out infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

.hero-cta:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.6);
}

/* ===== CHAPTER SECTIONS ===== */
.guida-section.chapter {
    padding: 80px 0;
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-slow);
}

.guida-section.chapter.visible {
    opacity: 1;
    transform: translateY(0);
}

.chapter-header {
    text-align: center;
    margin-bottom: 50px;
}

.chapter-number {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--accent-violet);
    letter-spacing: 4px;
    text-transform: uppercase;
    padding: 8px 20px;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.title-decoration {
    width: 50px;
    height: 2px;
    background: var(--gradient-magic);
    border-radius: 2px;
}

.chapter-intro {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== CODEX PAGE (GDR Section) ===== */
.codex-page {
    position: relative;
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.page-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid var(--accent-violet);
    opacity: 0.5;
}

.page-corner.top-left {
    top: 15px;
    left: 15px;
    border-right: none;
    border-bottom: none;
}

.page-corner.top-right {
    top: 15px;
    right: 15px;
    border-left: none;
    border-bottom: none;
}

.page-corner.bottom-left {
    bottom: 15px;
    left: 15px;
    border-right: none;
    border-top: none;
}

.page-corner.bottom-right {
    bottom: 15px;
    right: 15px;
    border-left: none;
    border-top: none;
}

.codex-content {
    max-width: 800px;
    margin: 0 auto;
}

.codex-article {
    position: relative;
    padding: 30px;
    margin-bottom: 25px;
    background: rgba(168, 85, 247, 0.03);
    border-left: 3px solid var(--accent-violet);
    border-radius: 0 15px 15px 0;
    opacity: 0;
    transform: translateX(-20px);
    transition: var(--transition-slow);
}

.codex-article.visible {
    opacity: 1;
    transform: translateX(0);
}

.codex-article.highlight {
    background: linear-gradient(135deg, rgba(233, 30, 140, 0.08) 0%, rgba(168, 85, 247, 0.05) 100%);
    border-left-color: var(--accent-pink);
}

.article-icon {
    position: absolute;
    top: -15px;
    left: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    border: 2px solid var(--accent-violet);
    border-radius: 50%;
}

.article-icon svg {
    width: 20px;
    height: 20px;
    color: var(--accent-violet);
}

.article-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--accent-violet);
    margin-bottom: 15px;
    padding-top: 10px;
}

.article-text {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-body);
    color: var(--text-secondary);
}

.feature-bullet {
    width: 8px;
    height: 8px;
    background: var(--gradient-magic);
    border-radius: 50%;
    flex-shrink: 0;
}

.codex-quote {
    position: relative;
    padding: 30px 40px;
    margin: 30px 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: 15px;
    text-align: center;
}

.quote-mark {
    position: absolute;
    top: -10px;
    left: 30px;
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--accent-violet);
    opacity: 0.3;
    line-height: 1;
}

.codex-quote p {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-primary);
    font-style: italic;
    line-height: 1.8;
}

.codex-notice {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px 25px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    margin-top: 30px;
}

.notice-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--accent-gold);
}

.notice-icon svg {
    width: 100%;
    height: 100%;
}

.codex-notice p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--accent-gold);
    line-height: 1.6;
}

/* ===== GRIMOIRE GRID (Rules Cards) ===== */
.grimoire-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    perspective: 1000px;
}

.grimoire-card {
    position: relative;
    height: 220px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: var(--transition-smooth);
    opacity: 0;
    transform: translateY(30px);
}

.grimoire-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-magic);
    border-radius: 18px;
    opacity: 0;
    transition: var(--transition-fast);
    z-index: 0;
}

.card-border {
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    z-index: 1;
}

.card-inner {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.card-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(233, 30, 140, 0.1) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin-bottom: 15px;
    transition: var(--transition-smooth);
}

.card-icon svg {
    width: 26px;
    height: 26px;
    color: var(--accent-violet);
    transition: var(--transition-fast);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: var(--transition-fast);
}

.card-desc {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.card-action {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--accent-violet);
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-fast);
}

.card-action svg {
    width: 14px;
    height: 14px;
}

.grimoire-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.grimoire-card:hover .card-glow {
    opacity: 0.3;
}

.grimoire-card:hover .card-border {
    border-color: var(--accent-violet);
}

.grimoire-card:hover .card-icon {
    background: var(--gradient-magic);
    border-color: transparent;
    transform: scale(1.1);
}

.grimoire-card:hover .card-icon svg {
    color: white;
}

.grimoire-card:hover .card-title {
    color: var(--accent-violet);
}

.grimoire-card:hover .card-action {
    opacity: 1;
    transform: translateY(0);
}

/* ===== LORE SCROLL (Ambientazione) ===== */
.lore-scroll {
    position: relative;
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    overflow: hidden;
}

.scroll-header,
.scroll-footer {
    padding: 20px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(233, 30, 140, 0.05) 100%);
    display: flex;
    justify-content: center;
}

.scroll-ornament {
    width: 150px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 20'%3E%3Cpath d='M0,10 Q37.5,0 75,10 T150,10' fill='none' stroke='%23a855f7' stroke-width='1'/%3E%3Ccircle cx='75' cy='10' r='3' fill='%23a855f7'/%3E%3Ccircle cx='25' cy='10' r='2' fill='%23a855f7' opacity='0.5'/%3E%3Ccircle cx='125' cy='10' r='2' fill='%23a855f7' opacity='0.5'/%3E%3C/svg%3E") center no-repeat;
}

.scroll-content {
    padding: 40px 50px;
}

.lore-section {
    margin-bottom: 35px;
}

.lore-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--accent-violet);
    margin-bottom: 15px;
}

.lore-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 50%;
}

.lore-icon svg {
    width: 20px;
    height: 20px;
    color: var(--accent-violet);
}

.lore-text {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.9;
    text-align: justify;
}

.lore-text strong {
    color: var(--accent-rose);
}

.lore-divider {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.lore-divider span {
    width: 6px;
    height: 6px;
    background: var(--accent-violet);
    border-radius: 50%;
    opacity: 0.5;
}

.lore-divider span:nth-child(2) {
    opacity: 1;
    transform: scale(1.2);
}

.lore-highlight {
    position: relative;
    padding: 30px;
    margin: 35px 0;
    background: linear-gradient(135deg, rgba(233, 30, 140, 0.1) 0%, rgba(168, 85, 247, 0.08) 100%);
    border-left: 4px solid var(--accent-pink);
    border-radius: 0 15px 15px 0;
}

.highlight-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at left center, rgba(233, 30, 140, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.lore-highlight p {
    position: relative;
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.8;
    font-style: italic;
}

.lore-highlight em {
    color: var(--accent-rose);
}

.lore-event {
    padding: 35px;
    background: linear-gradient(145deg, rgba(18, 18, 31, 0.9) 0%, rgba(8, 8, 15, 0.95) 100%);
    border: 2px solid var(--border-accent);
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.lore-event::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
    animation: eventPulse 4s ease-in-out infinite;
}

@keyframes eventPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.event-badge {
    display: inline-block;
    padding: 6px 20px;
    background: var(--gradient-magic);
    border-radius: 20px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: white;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
    position: relative;
}

.event-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    position: relative;
}

.event-quote {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--accent-rose);
    font-style: italic;
    margin-bottom: 20px;
    position: relative;
}

.event-text {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
    position: relative;
}

.event-whisper {
    font-family: var(--font-body);
    font-size: 1.3rem;
    color: var(--accent-violet);
    font-style: italic;
    margin: 25px 0;
    position: relative;
    animation: whisperGlow 3s ease-in-out infinite;
}

@keyframes whisperGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(168, 85, 247, 0.5); }
    50% { text-shadow: 0 0 30px rgba(168, 85, 247, 0.8), 0 0 50px rgba(233, 30, 140, 0.4); }
}

.event-conclusion {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.8;
    position: relative;
}

/* ===== BESTIARY GRID (Ascendenze) ===== */
.bestiary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    perspective: 1000px;
}

.bestiary-card {
    position: relative;
    height: 380px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: var(--transition-smooth);
    opacity: 0;
    transform: translateY(30px) rotateX(5deg);
}

.bestiary-card.visible {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

.bestiary-frame {
    position: absolute;
    inset: 0;
    border: 2px solid var(--border-subtle);
    border-radius: 20px;
    pointer-events: none;
    z-index: 10;
}

.frame-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-violet);
}

.frame-corner.tl {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
    border-radius: 20px 0 0 0;
}

.frame-corner.tr {
    top: -2px;
    right: -2px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 20px 0 0;
}

.frame-corner.bl {
    bottom: -2px;
    left: -2px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 20px;
}

.frame-corner.br {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 20px 0;
}

.bestiary-image {
    position: relative;
    height: 300px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.bestiary-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: var(--transition-slow);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(8, 8, 15, 0.9) 100%);
}

.bestiary-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    text-align: center;
    z-index: 5;
}

.bestiary-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: var(--transition-fast);
}

.bestiary-accent {
    width: 40px;
    height: 3px;
    background: var(--gradient-magic);
    border-radius: 3px;
    margin: 0 auto;
    transition: var(--transition-smooth);
}

.bestiary-hover-effect {
    position: absolute;
    inset: 0;
    background: var(--gradient-glow);
    opacity: 0;
    transition: var(--transition-fast);
    pointer-events: none;
    border-radius: 20px;
}

.bestiary-card:hover {
    transform: translateY(-15px) scale(1.03);
}

.bestiary-card:hover .bestiary-image img {
    transform: scale(1.1);
}

.bestiary-card:hover .bestiary-frame {
    border-color: var(--accent-violet);
    box-shadow: var(--glow-violet);
}

.bestiary-card:hover .bestiary-name {
    color: var(--accent-violet);
}

.bestiary-card:hover .bestiary-accent {
    width: 80px;
}

.bestiary-card:hover .bestiary-hover-effect {
    opacity: 0.3;
}

/* ===== CLASS SHOWCASE ===== */
.class-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    perspective: 1000px;
}

.class-card {
    position: relative;
    height: 420px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: var(--transition-smooth);
    opacity: 0;
    transform: translateY(30px);
}

.class-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.class-card-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    border-radius: 20px;
}

.class-card-border {
    position: absolute;
    inset: 0;
    border: 2px solid var(--border-subtle);
    border-radius: 20px;
    transition: var(--transition-fast);
}

.class-portrait {
    position: relative;
    height: 280px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.class-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: var(--transition-slow);
}

.portrait-vignette {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at center, transparent 30%, rgba(8, 8, 15, 0.5) 100%),
        linear-gradient(180deg, transparent 60%, rgba(8, 8, 15, 0.95) 100%);
}

.class-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    z-index: 5;
}

.class-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    transition: var(--transition-fast);
}

.class-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.stat .stat-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-rose);
}

.stat .stat-icon svg {
    width: 100%;
    height: 100%;
}

.stat .stat-value {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.class-domains {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.class-reveal {
    position: absolute;
    bottom: 25px;
    right: 25px;
    padding: 8px 20px;
    background: var(--gradient-magic);
    border-radius: 20px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: white;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-smooth);
    z-index: 10;
}

.class-card:hover {
    transform: translateY(-15px) scale(1.02);
}

.class-card:hover .class-card-border {
    border-color: var(--accent-violet);
    box-shadow: var(--glow-violet);
}

.class-card:hover .class-portrait img {
    transform: scale(1.1);
}

.class-card:hover .class-name {
    color: var(--accent-violet);
}

.class-card:hover .class-reveal {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SUBCLASS GALLERY ===== */
.subclass-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    perspective: 1000px;
}

.subclass-card {
    position: relative;
    height: 320px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: var(--transition-smooth);
    overflow: hidden;
    border-radius: 16px;
    opacity: 0;
    transform: translateY(30px);
}

.subclass-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.subclass-glow {
    position: absolute;
    inset: -2px;
    background: var(--gradient-magic);
    opacity: 0;
    transition: var(--transition-fast);
    z-index: 0;
    border-radius: 18px;
}

.subclass-frame {
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    z-index: 1;
}

.subclass-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    z-index: 2;
}

.subclass-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: var(--transition-slow);
}

.subclass-content {
    position: relative;
    padding: 20px;
    text-align: center;
    z-index: 2;
    background: linear-gradient(180deg, transparent, rgba(8, 8, 15, 0.9) 20%);
    margin-top: -40px;
}

.subclass-name {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    transition: var(--transition-fast);
}

.subclass-trait {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.subclass-card:hover {
    transform: translateY(-10px) scale(1.03);
}

.subclass-card:hover .subclass-glow {
    opacity: 0.4;
}

.subclass-card:hover .subclass-frame {
    border-color: var(--accent-violet);
}

.subclass-card:hover .subclass-image img {
    transform: scale(1.1);
}

.subclass-card:hover .subclass-name {
    color: var(--accent-violet);
}

/* ===== DOMAIN CONSTELLATION ===== */
.domain-constellation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    padding: 40px 0;
}

.domain-orb {
    position: relative;
    width: 160px;
    height: 200px;
    cursor: pointer;
    transition: var(--transition-smooth);
    opacity: 0;
    transform: scale(0.8);
}

.domain-orb.visible {
    opacity: 1;
    transform: scale(1);
}

.orb-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid var(--accent-violet);
    border-radius: 50%;
    opacity: 0.3;
    transition: var(--transition-smooth);
}

.orb-ring.outer {
    width: 150px;
    height: 150px;
    animation: ringRotate 20s linear infinite;
}

.orb-ring.middle {
    width: 120px;
    height: 120px;
    animation: ringRotate 15s linear infinite reverse;
}

.orb-ring.inner {
    width: 90px;
    height: 90px;
    animation: ringRotate 10s linear infinite;
}

@keyframes ringRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.orb-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-violet);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.4), inset 0 0 20px rgba(168, 85, 247, 0.2);
    transition: var(--transition-smooth);
}

.orb-core img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.orb-label {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 20px;
    background: rgba(8, 8, 15, 0.9);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    white-space: nowrap;
}

.orb-label span {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.orb-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.domain-orb:hover {
    transform: scale(1.15);
}

.domain-orb:hover .orb-ring {
    opacity: 0.8;
    border-color: var(--accent-pink);
}

.domain-orb:hover .orb-core {
    border-color: var(--accent-pink);
    box-shadow: 0 0 50px rgba(233, 30, 140, 0.6), inset 0 0 30px rgba(233, 30, 140, 0.3);
}

.domain-orb:hover .orb-core img {
    transform: scale(1.2);
}

.domain-orb:hover .orb-label {
    background: var(--gradient-magic);
    border-color: transparent;
}

/* ===== CODEX FOOTER ===== */
.codex-footer {
    text-align: center;
    padding: 60px 20px;
    margin-top: 60px;
    border-top: 1px solid var(--border-subtle);
}

.footer-ornament {
    width: 100px;
    height: 30px;
    margin: 0 auto 30px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30'%3E%3Cpath d='M0,15 Q25,5 50,15 T100,15' fill='none' stroke='%23a855f7' stroke-width='1'/%3E%3Ccircle cx='50' cy='15' r='4' fill='%23a855f7'/%3E%3C/svg%3E") center no-repeat;
}

.footer-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-primary);
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.footer-copyright {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== MOBILE NAVIGATION ===== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(180deg, rgba(8, 8, 15, 0.95) 0%, rgba(8, 8, 15, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    padding: 10px 8px;
    padding-bottom: env(safe-area-inset-bottom, 10px);
}

.mobile-nav-inner {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mobile-nav-inner::-webkit-scrollbar {
    display: none;
}

.mobile-nav-link {
    flex-shrink: 0;
    padding: 10px 14px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.mobile-nav-link.home {
    padding: 10px 12px;
    background: var(--gradient-magic);
    border-color: transparent;
}

.mobile-nav-link.home svg {
    width: 16px;
    height: 16px;
    color: white;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
    background: rgba(168, 85, 247, 0.3);
    border-color: var(--accent-violet);
    color: var(--text-primary);
}

/* ===== ARCANE MODAL ===== */
.arcane-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.arcane-modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    position: relative;
    width: 100%;
    max-width: 950px;
    max-height: 90vh;
    background: linear-gradient(145deg, rgba(18, 18, 31, 0.98) 0%, rgba(8, 8, 15, 0.99) 100%);
    border: 2px solid var(--border-accent);
    border-radius: 24px;
    overflow: hidden;
    animation: modalSlide 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 80px rgba(168, 85, 247, 0.3), 0 30px 60px rgba(0, 0, 0, 0.5);
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-frame {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.frame-decoration {
    position: absolute;
    background: var(--accent-violet);
}

.frame-decoration.top,
.frame-decoration.bottom {
    left: 30px;
    right: 30px;
    height: 2px;
}

.frame-decoration.top { top: 10px; }
.frame-decoration.bottom { bottom: 10px; }

.frame-decoration.left,
.frame-decoration.right {
    top: 30px;
    bottom: 30px;
    width: 2px;
}

.frame-decoration.left { left: 10px; }
.frame-decoration.right { right: 10px; }

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    transition: var(--transition-smooth);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--accent-violet);
    border-color: var(--accent-violet);
    transform: rotate(90deg);
}

.modal-close:hover svg {
    color: white;
}

.modal-scroll {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-scroll::-webkit-scrollbar {
    width: 6px;
}

.modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.modal-scroll::-webkit-scrollbar-thumb {
    background: var(--accent-violet);
    border-radius: 3px;
}

/* Modal Page Layouts */
.modal-page {
    padding: 40px;
}

.modal-page.rules {
    padding: 50px;
}

.modal-page.character {
    display: flex;
    gap: 0;
}

.modal-page.domain {
    text-align: center;
    padding: 60px 40px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.header-ornament {
    width: 60px;
    height: 2px;
    background: var(--gradient-magic);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--accent-violet);
    text-align: center;
    letter-spacing: 2px;
}

.modal-subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    margin-top: 10px;
}

.modal-divider {
    width: 80px;
    height: 2px;
    background: var(--gradient-magic);
    margin: 20px auto;
    border-radius: 2px;
}

.page-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.rules-content {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.9;
}

.rules-content h1, .rules-content h2, .rules-content h3 {
    font-family: var(--font-display);
    color: var(--accent-violet);
    margin: 25px 0 15px;
}

.rules-content h1 { font-size: 1.5rem; }
.rules-content h2 { font-size: 1.3rem; }
.rules-content h3 { font-size: 1.1rem; }

.rules-content p {
    margin-bottom: 15px;
}

.rules-content ul, .rules-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.rules-content li {
    margin-bottom: 8px;
}

.rules-content strong {
    color: var(--accent-rose);
}

.rules-content em {
    color: var(--text-accent);
}

/* Character Modal Layout */
.modal-portrait {
    flex: 0 0 40%;
    position: relative;
    overflow: hidden;
}

.modal-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.portrait-frame {
    position: absolute;
    inset: 0;
    border-right: 1px solid var(--border-subtle);
    background: linear-gradient(90deg, transparent 80%, rgba(8, 8, 15, 0.9) 100%);
}

.modal-details {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    max-height: 85vh;
}

.modal-details.centered {
    text-align: center;
}

.modal-stats-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.modal-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

.modal-stat .stat-icon {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.modal-stat .stat-num {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--accent-violet);
}

.detail-section {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(168, 85, 247, 0.05);
    border-left: 3px solid var(--accent-violet);
    border-radius: 0 12px 12px 0;
}

.detail-section.feature {
    border-left-color: var(--accent-pink);
    background: rgba(233, 30, 140, 0.05);
}

.detail-section.hope {
    border-left-color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.05);
}

.detail-section.mastery {
    border-left-color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.05);
}

.detail-section.lore {
    border-left-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

.detail-section h4 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--accent-violet);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.detail-section.feature h4 { color: var(--accent-pink); }
.detail-section.hope h4 { color: var(--accent-cyan); }
.detail-section.mastery h4 { color: var(--accent-gold); }
.detail-section.lore h4 { color: var(--accent-blue); }

.detail-section p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Domain Modal */
.modal-orb-display {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 30px;
}

.modal-orb-display .orb-glow {
    position: absolute;
    inset: -20px;
    background: var(--gradient-glow);
    animation: orbPulse 3s ease-in-out infinite;
}

@keyframes orbPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.modal-orb-display img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--accent-violet);
    box-shadow: var(--glow-violet);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .guida-sidebar {
        width: 180px;
        left: 15px;
        padding: 15px;
    }
    
    .guida-main {
        padding-left: 220px;
        padding-right: 30px;
    }
}

@media (max-width: 1024px) {
    .guida-sidebar {
        display: none;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .guida-main {
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 100px;
    }
    
    .book-spine {
        width: 4px;
    }
    
    .header-decoration {
        display: none;
    }
    
    .back-home-btn span {
        display: none;
    }
    
    .back-home-btn {
        padding: 10px;
        border-radius: 50%;
    }
}

@media (max-width: 768px) {
    .guida-header {
        padding: 12px 15px;
    }
    
    .logo-text {
        font-size: 0.9rem;
    }
    
    .logo-accent {
        font-size: 1.2rem;
    }
    
    .logo-subtitle {
        display: none;
    }
    
    .hero-section {
        min-height: auto;
        padding: 120px 15px 80px;
    }
    
    .hero-content {
        padding: 40px 25px;
    }
    
    .title-main {
        font-size: 2.2rem;
        letter-spacing: 4px;
    }
    
    .title-line {
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: 1.6rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .title-decoration {
        width: 40px;
    }
    
    .codex-page {
        padding: 30px 20px;
    }
    
    .codex-article {
        padding: 25px 20px;
    }
    
    .grimoire-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .grimoire-card {
        height: 180px;
    }
    
    .card-inner {
        padding: 20px 15px;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 10px;
    }
    
    .card-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .card-title {
        font-size: 0.9rem;
    }
    
    .card-desc {
        font-size: 0.75rem;
        display: none;
    }
    
    .scroll-content {
        padding: 25px 20px;
    }
    
    .lore-title {
        font-size: 1.1rem;
    }
    
    .lore-text {
        font-size: 0.95rem;
        text-align: left;
    }
    
    .bestiary-grid,
    .class-showcase {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .bestiary-card {
        height: 280px;
    }
    
    .bestiary-image {
        height: 200px;
    }
    
    .bestiary-name {
        font-size: 1rem;
    }
    
    .class-card {
        height: 320px;
    }
    
    .class-portrait {
        height: 200px;
    }
    
    .class-name {
        font-size: 1.1rem;
    }
    
    .class-stats {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .stat {
        padding: 4px 8px;
    }
    
    .class-domains {
        display: none;
    }
    
    .subclass-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .subclass-card {
        height: 260px;
    }
    
    .subclass-image {
        height: 180px;
    }
    
    .domain-constellation {
        gap: 25px;
    }
    
    .domain-orb {
        width: 130px;
        height: 170px;
    }
    
    .orb-ring.outer { width: 120px; height: 120px; }
    .orb-ring.middle { width: 100px; height: 100px; }
    .orb-ring.inner { width: 80px; height: 80px; }
    
    .orb-core {
        width: 80px;
        height: 80px;
    }
    
    .orb-label span {
        font-size: 0.75rem;
    }
    
    /* Modal responsive */
    .modal-container {
        border-radius: 16px;
        max-height: 95vh;
    }
    
    .modal-page.character {
        flex-direction: column;
    }
    
    .modal-portrait {
        flex: none;
        height: 250px;
    }
    
    .portrait-frame {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        background: linear-gradient(180deg, transparent 70%, rgba(8, 8, 15, 0.95) 100%);
    }
    
    .modal-details {
        padding: 25px;
        max-height: none;
    }
    
    .modal-title {
        font-size: 1.4rem;
    }
    
    .modal-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding: 30px 20px;
        border-radius: 20px;
    }
    
    .hero-badge {
        font-size: 0.65rem;
        padding: 6px 15px;
    }
    
    .title-main {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .hero-cta {
        padding: 12px 25px;
        font-size: 0.8rem;
    }
    
    .chapter-number {
        font-size: 0.7rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .chapter-intro {
        font-size: 0.95rem;
    }
    
    .grimoire-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .grimoire-card {
        height: 160px;
    }
    
    .card-title {
        font-size: 0.8rem;
    }
    
    .card-action {
        display: none;
    }
    
    .bestiary-card {
        height: 240px;
    }
    
    .bestiary-image {
        height: 170px;
    }
    
    .class-card {
        height: 280px;
    }
    
    .class-portrait {
        height: 180px;
    }
    
    .class-info {
        padding: 15px;
    }
    
    .class-name {
        font-size: 1rem;
    }
    
    .class-reveal {
        display: none;
    }
    
    .subclass-card {
        height: 220px;
    }
    
    .subclass-image {
        height: 150px;
    }
    
    .subclass-name {
        font-size: 0.9rem;
    }
    
    .subclass-trait {
        display: none;
    }
    
    .domain-orb {
        width: 100px;
        height: 140px;
    }
    
    .orb-ring.outer { width: 95px; height: 95px; }
    .orb-ring.middle { width: 80px; height: 80px; }
    .orb-ring.inner { width: 65px; height: 65px; }
    
    .orb-core {
        width: 60px;
        height: 60px;
    }
    
    .orb-label {
        padding: 5px 12px;
    }
    
    .orb-label span {
        font-size: 0.65rem;
    }
    
    .mobile-nav-link {
        padding: 8px 10px;
        font-size: 0.65rem;
    }
    
    .modal-page {
        padding: 25px 20px;
    }
    
    .modal-page.rules {
        padding: 30px 20px;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .modal-stats-row {
        gap: 10px;
    }
    
    .modal-stat {
        padding: 10px 15px;
    }
    
    .modal-stat .stat-num {
        font-size: 1.2rem;
    }
    
    .detail-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .detail-section h4 {
        font-size: 0.75rem;
    }
    
    .detail-section p {
        font-size: 0.9rem;
    }
}

/* ===== UTILITY ANIMATIONS ===== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Print styles */
@media print {
    .magical-bg,
    .video-bg-container,
    .book-spine,
    .guida-sidebar,
    .mobile-nav,
    .arcane-modal {
        display: none !important;
    }
    
    .guida-main {
        padding: 0 !important;
    }
    
    body.guida-page {
        background: white;
        color: black;
    }
}
