/* ============================================================
   landing.css
   Critical CSS for the landing page (#landingPage) in index.html.
   Extracted from style.css – contains only what the landing page
   and its shared components (header, footer, auth modal, toast,
   cookie consent) need for first-paint.
   ============================================================ */

/* ============================================================
   Base – :root variables, reset, body/html
   ============================================================ */
:root {
    --bg-dark: #0d0d0d;
    --bg-primary: #1a1a1a;
    --bg-secondary: #1a1d24;
    --bg-card: #1e2128;
    --bg-elevated: #22262f;
    --bg-hover: #2a2f3a;
    --border-default: #2d3341;
    --border-hover: #3d4451;
    --text-primary: #f5f5f5;
    --text-secondary: #a0a8b8;
    --text-muted: #6b7280;
    --brand-red: #c53030;
    --accent-gold: #d4af37;
    --accent-gold-light: #f0d875;
    --accent-green: #48bb78;
    --hp-red: #dc2626;
    --hp-green: #16a34a;
    --vp-blue: #3b82f6;
    --vp-purple: #9333ea;
    --font-display: 'Colus', serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Character Sheet V2 Color Palette (referenced by some shared selectors) */
    --bg-panel: linear-gradient(180deg, #16181f 0%, #0f1115 100%);
    --bg-header: linear-gradient(180deg, #12141a 0%, #0d0f14 100%);
    --border-gold: #8b7335;
    --red-hp: #ef4444;
    --green-vp: #22c55e;
    --color-bg-deep: #12141a;
    --color-forest-dark: #2d4a3e;
    --color-purple-dark: #2a2a4a;
    --color-warm-mid: #8b7355;
    --color-warm-gray: #a89f8a;
    --color-parchment: #f5e6c8;
    --color-red: #e74c3c;
    --color-dark-gray: #333;
    --color-light-gray: #ccc;
    --color-purple: #a855f7;
    --color-gray: #a0a0a0;
    --color-bg-deep-blue: #1a1a2e;
    --color-off-white: #f0f0f5;
    --color-warm-gray-2: #8a8578;
    --color-dark-warm: #3d3828;
    --color-off-white-2: #e0e0e0;
    --color-mid-gray: #666;
    --color-light-warm: #c9b97a;
    --color-mid-gray-2: #5a564e;
    --color-red-2: #dc3545;
    --color-warm-gray-3: #c5a059;
    --color-gold-warm: #d7a525;
    --color-warm-beige: #e8d5a9;
    --color-light-gray-3: #ccc7be;
    --color-warm-gray-4: #a89a7a;
    --color-light-warm-2: #b8b3a8;
    --color-gold-warm-2: #c1a434;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    padding-top: 55px;
}

.hidden { display: none !important; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; border: none; border-radius: 1px;
    font-family: cinzel; font-size: 0.875rem; font-weight: 600;
    height: 35px;
    cursor: pointer; transition: all 0.2s; text-decoration: none;
}

.btn-primary {
    background: var(--brand-red);
    color: white !important;
    border-radius: 3px;
}
.btn-primary:hover { background: #a52828; }

.btn-gold {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--bg-primary) !important;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(212,175,55,0.4); }

.btn-ghost { background: transparent; color: var(--text-secondary) !important; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary) !important; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-primary) !important;
    border-radius: 2px;
    background-color: #51493859;
}
.btn-outline:hover { border-color: var(--accent-gold); }

.btn-google {
    background: white;
    color: var(--color-dark-gray) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: 1px solid var(--color-off-white-2);
    font-weight: 500;
}
.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.btn-google svg { flex-shrink: 0; }

.btn-danger {
    background: var(--hp-red);
    color: white !important;
    border: none;
}
.btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.btn-block { width: 100%; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.813rem; height: 35px; }
.btn-xl { padding: 1rem 2rem; font-size: 1rem; }
.btn-xs { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

.btn-gold-outline {
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 2px;
    color: var(--accent-gold);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-gold-outline:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.4);
}

/* ============================================================
   Landing Header & Hero
   ============================================================ */
.landing-header {
    background: linear-gradient(180deg, var(--bg-secondary), var(--bg-dark));
    min-height: 80vh;
    position: relative;
    display: flex;
    flex-direction: column;
    margin-bottom: -290px;
}

/* Keep CTA/news spacing stable on shorter desktop viewports */
@media (max-height: 900px) and (min-width: 769px) {
    .landing-header { margin-bottom: -180px; }
    .gold-frame-section { bottom: -70px; }
}

@media (max-height: 760px) and (min-width: 769px) {
    .landing-header { margin-bottom: -120px; }
    .gold-frame-section { bottom: -35px; }
}

@media (prefers-reduced-motion: reduce) {
    .landing-header::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background-image: url('banner_img_02.png');
        background-size: cover;
        background-position: center;
        opacity: 0.3;
        z-index: 0;
    }
}

.nav-actions { display: flex; align-items: center; gap: 0.8rem; }

.hero {
    max-width: 100%;
    margin: 0 auto;
    padding: 6rem 3rem;
    padding-bottom: 1rem;
    text-align: center;
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   Video Carousel
   ============================================================ */
.bg-video-carousel {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 76%;
    z-index: 1;
    pointer-events: none;
    margin-top: -50px;
    object-fit: cover;
}

.bg-video {
    position: absolute;
    top: 0; left: 0;
    border-bottom: 2px solid #ae964b;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.5;
    transition: opacity 1s ease-in-out;
}

.bg-video.hidden { opacity: 0; pointer-events: none; }
.bg-video.active  { opacity: 0.5; }
.bg-video.fade-out { opacity: 0; }
.bg-video.fade-in  { opacity: 0.5; }

/* CTA Content Transitions */
.hero-content {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    position: relative;
    z-index: 2;
}

.hero-content.cta-fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.hero-content.cta-fade-in {
    animation: ctaFadeIn 0.5s ease-out forwards;
}

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

/* Carousel Indicators */
.carousel-indicators { display: flex; gap: 0.75rem; }

.carousel-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}
.carousel-dot:hover { background: var(--accent-gold-dark); transform: scale(1.1); }
.carousel-dot.active { background: var(--accent-gold); box-shadow: 0 0 10px var(--accent-gold); }

/* Carousel Controls Container */
.carousel-controls {
    position: static;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 10;
}

.carousel-controls-host {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Navigation Arrows */
.carousel-nav {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
    background: rgba(0,0,0,0.5);
    color: var(--accent-gold);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.carousel-nav:hover { background: var(--accent-gold); color: var(--bg-dark); transform: scale(1.1); }
.carousel-nav svg { width: 20px; height: 20px; }

/* Center Section */
.carousel-center { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }

/* Progress Bar */
.carousel-progress {
    width: 120px; height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}
.carousel-progress-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light));
    border-radius: 2px;
    transition: width 0.05s linear;
}

@media (prefers-reduced-motion: reduce) {
    .bg-video { display: none; }
    .bg-video-carousel { display: none; }
}

/* ============================================================
   Hero Text
   ============================================================ */
.hero-title-main {
    display: block;
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 300;
    color: var(--text-primary);
}

.hero-title-sub {
    display: block;
    font-family: 'Cinzel Decorative', serif;
    font-weight: 700;
    background: linear-gradient(135deg, var(--trudvang-gold, var(--accent-gold)) 10%, var(--color-warm-beige) 50%, var(--trudvang-gold, var(--accent-gold)) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--color-light-gray-3);
    font-family: crimson;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

p.hero-eyebrow,
.hero-eyebrow {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: #c9b35e;
    margin-bottom: 1rem;
    animation: fadeUp 0.8s ease 0.2s forwards;
}

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

/* ============================================================
   Layout helpers
   ============================================================ */
.container { max-width: 1200px; margin: 0 auto; }
.features { padding: 4rem 3rem; background: var(--bg-primary); }

.section-heading {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    margin-bottom: 0.5em;
}

span.sec-label {
    font-family: 'Cinzel', serif;
    font-size: 0.55rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--color-gold-warm-2);
    text-align: center;
    display: block;
    margin-bottom: 1rem;
}

.sec-body {
    text-align: center;
    font-size: 1.05rem;
    font-family: Crimson Pro;
    color: #b3b3b3;
    max-width: 600px;
    margin: 0 auto 3.5rem;
}

/* ============================================================
   Feature Grid
   ============================================================ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: none;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-primary);
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
    transition: background 0.5s;
    border: none;
    border-radius: 0;
    text-align: left;
    border-left: 1px solid var(--border-default);
}
.feature-card:hover { background: var(--bg-secondary); }
.feature-card:first-child { border-left: none; }

.feature-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100%;
    background: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(201,168,76,0.06), transparent);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}
.feature-card:hover::after { opacity: 1; }

.feature-num {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    font-weight: 900;
    color: rgba(201,168,76,0.07);
    line-height: 1;
    margin-bottom: 1.5rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    position: absolute;
    top: 35px;
    right: 40px;
}

.feature-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: #ddd4c4;
    text-align: left;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--color-warm-gray-4);
    line-height: 1.65;
    margin-bottom: 1.5rem;
    font-family: Crimson;
    letter-spacing: 0.3px;
    text-align: left;
}

.feature-link {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.3s, gap 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    color: #dbb05a;
}
.feature-link:hover { color: var(--accent-gold); gap: 0.8em; }

/* ============================================================
   Gold Frame Section & Box
   ============================================================ */
.gold-frame-section {
    position: relative;
    bottom: -100px;
    padding: 0 2rem 1rem;
    z-index: 10;
}

.gold-frame-box {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--color-bg-deep) 100%);
    padding: 2.5rem 3rem;
    border-radius: 4px;
    border-left: 1px solid #614e1eab;
    border-right: 1px solid #614e1eab;
}

/* Inner glow lines */
.gold-frame-box::before {
    content: '';
    position: absolute;
    top: 0; left: 2rem; right: 2rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold-warm), transparent);
}
.gold-frame-box::after {
    content: '';
    position: absolute;
    bottom: 0; left: 2rem; right: 2rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold-warm), transparent);
}

/* Corner lines */
.gold-frame-box .corner {
    position: absolute;
    width: 50px; height: 50px;
    pointer-events: none;
}
.gold-frame-box .corner::before,
.gold-frame-box .corner::after {
    content: '';
    position: absolute;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 50%, var(--border-gold) 100%);
}

.gold-frame-box .corner.top-left    { top: -2px; left: -2px; }
.gold-frame-box .corner.top-left::before  { top: 0; left: 0; width: 35px; height: 3px; }
.gold-frame-box .corner.top-left::after   { top: 0; left: 0; width: 3px; height: 35px; }

.gold-frame-box .corner.top-right   { top: -2px; right: -2px; }
.gold-frame-box .corner.top-right::before  { top: 0; right: 0; width: 35px; height: 3px; }
.gold-frame-box .corner.top-right::after   { top: 0; right: 0; width: 3px; height: 35px; }

.gold-frame-box .corner.bottom-left  { bottom: -2px; left: -2px; }
.gold-frame-box .corner.bottom-left::before  { bottom: 0; left: 0; width: 35px; height: 3px; }
.gold-frame-box .corner.bottom-left::after   { bottom: 0; left: 0; width: 3px; height: 35px; }

.gold-frame-box .corner.bottom-right { bottom: -2px; right: -2px; }
.gold-frame-box .corner.bottom-right::before { bottom: 0; right: 0; width: 35px; height: 3px; }
.gold-frame-box .corner.bottom-right::after  { bottom: 0; right: 0; width: 3px; height: 35px; }

/* Corner dots */
.gold-frame-box .corner-dot {
    position: absolute;
    width: 6px; height: 6px;
    background: radial-gradient(circle, var(--accent-gold-light) 0%, var(--accent-gold) 60%, var(--border-gold) 100%);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(212,175,55,0.6);
}
.gold-frame-box .corner-dot.top-left    { top: -2px; left: -2px; }
.gold-frame-box .corner-dot.top-right   { top: -2px; right: -2px; }
.gold-frame-box .corner-dot.bottom-left { bottom: -2px; left: -2px; }
.gold-frame-box .corner-dot.bottom-right{ bottom: -2px; right: -2px; }

/* Gold Frame Content */
.frame-content { text-align: center; }

.frame-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.gold-text {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.frame-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
    font-family: Crimson Pro;
}

/* Tabs */
.frame-tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.frame-tab {
    padding: 0.625rem 1.25rem;
    border: 1px solid #695e1963;
    font-size: 0.813rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.2s;
    background: #79684e1a;
    color: #6d5a43;
    font-family: 'Crimson Text';
    font-weight: 100;
    border-radius: 1px;
    height: 35px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.frame-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.frame-tab.active {
    background: #bd3636;
    color: white;
    font-family: 'Crimson Text';
    font-weight: 100;
    border-radius: 1px;
    height: 35px;
}

/* ============================================================
   Gold line separator
   ============================================================ */
.gold-line-separator {
    height: 1px;
    width: 250px;
    justify-self: anchor-center;
    margin: 1rem 20px;
    background: linear-gradient(90deg, transparent, var(--fantasy-gold, var(--accent-gold)), transparent);
}

/* ============================================================
   Reveal / Fade-in Animations
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.vis {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Unified App Header (landing + app)
   ============================================================ */
.unified-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1100;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(10,10,15,0.95) 0%, rgba(10,10,15,0) 100%);
    transition: background 0.3s;
    filter: drop-shadow(0px 7px 12px #000);
}
.unified-header.scrolled {
    background: rgb(10 10 15 / 25%);
    border-bottom: 1px solid #2d33419e;
    backdrop-filter: blur(12px);
}

.header-brand { text-decoration: none; max-height: 26px; }

.logo-container { display: block; }

.app-nav { display: flex; gap: 1.5rem; align-items: center; }

.nav-tab {
    padding: 0.4em 0;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-family: cinzel;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s;
    text-decoration: none;
}
.nav-tab:hover  { color: var(--accent-gold); }
.nav-tab.active { color: var(--accent-gold); border-bottom-color: #d4af3700; }

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

/* Navigation dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown:hover .nav-dropdown-menu { display: block; }

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%; left: 0;
    background: #000;
    border-radius: 3px;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
    overflow: hidden;
}

.nav-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'Cinzel';
    font-size: 0.675rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-default);
    text-decoration: none;
}
.nav-dropdown-item:last-child { border-bottom: none; }
.nav-dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Nav badge */
.nav-badge {
    background: #bb5941;
    color: var(--color-off-white-2);
    font-size: 0.65rem;
    font-family: cinzel;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 800;
    text-transform: uppercase;
    vertical-align: middle;
    box-shadow: 0 0 8px rgba(197,160,89,0.4);
    display: inline-block;
}

.nav-badge-external {
    background: var(--color-warm-gray-3);
    color: #000;
    font-size: 0.65rem;
    font-family: cinzel;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 800;
    text-transform: uppercase;
    vertical-align: middle;
    box-shadow: 0 0 8px rgba(197,160,89,0.4);
    display: inline-block;
}

/* Discord link in header */
.discord-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    margin-inline-end: 0.5rem;
}
.discord-link:hover { color: #5865F2; }
.discord-icon { width: 24px; height: 24px; }

/* User menu */
.user-menu { display: flex; align-items: center; gap: 0.8rem; }
.user-name {
    font-size: 0.875rem;
    align-content: center;
    margin-right: 15px;
    color: #b39937;
    font-family: Cinzel;
    font-weight: 500;
}

/* Hamburger Menu Button – hidden on desktop */
.hamburger-menu {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    min-width: 44px;
    min-height: 44px;
}

/* Notification bell */
.notification-bell {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s;
}
.notification-bell:hover { color: var(--accent-gold); }

.notification-badge {
    position: absolute;
    top: 0; right: 0;
    background: var(--red-hp);
    color: white;
    border-radius: 50%;
    width: 18px; height: 18px;
    font-size: 0.625rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.notification-badge.hidden { display: none; }

/* ============================================================
   Loading & Spinner
   ============================================================ */
.loading-placeholder { text-align: center; padding: 3rem; color: var(--text-muted); }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border-default);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Modals (Auth modal + generic)
   ============================================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 1rem;
}
.modal.active { display: flex; }

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.modal-header h2 { margin: 0; font-family: var(--font-display); font-size: 1.5rem; }

.modal-close,
.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    padding: 0;
}
.close-modal { position: absolute; top: 1rem; right: 1rem; }
.modal-close:hover,
.close-modal:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body { margin-bottom: 1.5rem; }
.modal-footer { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.5rem; }

.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================================
   Auth Forms
   ============================================================ */
.auth-tabs {
    display: flex;
    gap: 0;
    margin: 1.5rem 0;
    border-bottom: 1px solid var(--border-default);
}
.auth-tab {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cinzel';
}
.auth-tab.active { color: #ffbf45; border-bottom-color: var(--accent-gold); }

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-form input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
    font-family: 'Crimson Text';
}
.auth-form input:focus { outline: none; border-color: var(--accent-gold); }

.auth-divider { text-align: center; margin: 1.5rem 0; color: #ffc53c; font-size: 0.813rem; }

.auth-error {
    background: rgba(197,48,48,0.1);
    border: 1px solid var(--brand-red);
    color: var(--brand-red);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}
.auth-error.active { display: block; }

.auth-success {
    background: rgba(72,187,120,0.1);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}
.auth-success.active { display: block; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ============================================================
   Community Feed Section
   ============================================================ */
.community-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.community-card {
    position: relative;
    background: linear-gradient(165deg, var(--bg-card) 0%, var(--color-bg-deep) 50%, var(--color-bg-deep) 100%);
    border-radius: 3px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(212,175,55,0.06) 0%, transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.community-card:hover {
    border-color: rgba(212,175,55,0.5);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 20px rgba(212,175,55,0.08);
}
.community-card:hover::before { opacity: 1; }

.community-card-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 0.875rem; }

.community-card-icon {
    width: 48px; height: 48px;
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(212,175,55,0.1), rgba(139,115,53,0.15));
    border: 1px solid rgba(212,175,55,0.3);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.community-card-icon img { width: 36px; height: 36px; object-fit: contain; }

.community-card-info { flex: 1; min-width: 0; }
.community-card-type {
    font-size: 0.625rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.community-card-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.community-card-author { font-size: 0.75rem; color: var(--text-muted); }
.community-card-author span { color: var(--text-secondary); }

.community-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.875rem;
    font-family: Crimson Pro;
}

.community-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(212,175,55,0.1);
}
.community-card-meta { font-size: 0.6875rem; color: var(--text-muted); }
.community-card-action { font-size: 0.75rem; color: var(--text-muted); transition: color 0.25s ease; }
.community-card:hover .community-card-action { color: var(--accent-gold); }

/* Community card type icon backgrounds */
.community-card[data-type="adventure"] .community-card-icon {
    background: linear-gradient(145deg, rgba(212,175,55,0.15), rgba(139,115,53,0.2));
}
.community-card[data-type="monster"] .community-card-icon {
    background: linear-gradient(145deg, rgba(239,68,68,0.1), rgba(185,28,28,0.15));
    border-color: rgba(239,68,68,0.3);
}
.community-card[data-type="item"] .community-card-icon {
    background: linear-gradient(145deg, rgba(168,85,247,0.1), rgba(124,58,237,0.15));
    border-color: rgba(168,85,247,0.3);
}
.community-card[data-type="spell"] .community-card-icon {
    background: linear-gradient(145deg, rgba(59,130,246,0.1), rgba(37,99,235,0.15));
    border-color: rgba(59,130,246,0.3);
}

/* Community & featured section wrappers */
.community-showcase,
.featured-adventure {
    padding: 1rem 0;
}
.community-showcase .container,
.featured-adventure .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================================
   Featured Adventure Card
   ============================================================ */
.featured-adventure-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.featured-adventure-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-color: var(--accent-gold);
}

.featured-cover {
    height: 250px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-elevated);
}

.featured-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.featured-info h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}
.featured-subtitle { color: var(--text-secondary); margin-bottom: 1rem; font-family: Crimson Pro; }
.featured-author { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 1rem; }
.featured-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}
.featured-meta span { display: inline-flex; align-items: center; gap: 0.25rem; }

/* ============================================================
   Discord CTA
   ============================================================ */
.discord-cta { padding: 3.5rem 0; }
.discord-cta .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}
.discord-cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    background: linear-gradient(135deg, rgba(70,25,102,0.45), rgba(19,19,28,0.9));
    padding: 2.5rem 3rem;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}
.discord-cta-kicker {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    color: var(--gold-color);
    margin-bottom: 0.75rem;
}
.discord-cta-content h2 { margin-bottom: 0.75rem; font-family: Colus; }
.discord-cta-content p  { color: var(--color-light-gray); margin-bottom: 0; font-family: Crimson Pro; }
.discord-cta-actions    { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ============================================================
   Footer
   ============================================================ */
.landing-footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
}
.landing-footer p { margin-bottom: 0.5rem; }
.footer-disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0.75rem auto 0;
    line-height: 1.5;
}

.footer-links .footer-link {
    color: var(--color-light-gray);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}
.footer-links .footer-link:hover,
.footer-links .footer-link.footer-link-active { color: var(--gold-color); }

.footer-social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.footer-social-link {
    color: var(--color-light-gray);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border: 1px solid rgba(212,175,55,0.4);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.footer-social-link:hover {
    color: var(--bg-dark);
    background: var(--gold-color);
    border-color: var(--gold-color);
}

/* ============================================================
   Cookie Consent Banner
   ============================================================ */
.cookie-consent-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-elevated);
    border-top: 2px solid var(--accent-gold);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    z-index: 10000;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    padding: 1.5rem;
}
.cookie-consent-banner.visible { transform: translateY(0); opacity: 1; }

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.cookie-consent-text { flex: 1; min-width: 300px; }
.cookie-consent-text h3 { margin: 0 0 0.5rem 0; color: var(--accent-gold); font-size: 1.25rem; }
.cookie-consent-text p  { margin: 0; color: var(--text-secondary); font-size: 0.875rem; line-height: 1.5; }
.cookie-consent-text a  { color: var(--accent-gold); text-decoration: underline; }
.cookie-consent-text a:hover { color: var(--text-primary); }

.cookie-consent-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.cookie-consent-actions .btn { white-space: nowrap; background: var(--accent-gold); }

/* ============================================================
   @media – carousel responsive
   ============================================================ */
@media (max-width: 600px) {
    .carousel-controls { gap: 1rem; }
    .carousel-nav { width: 36px; height: 36px; }
    .carousel-nav svg { width: 16px; height: 16px; }
    .carousel-progress { width: 80px; }
}

/* ============================================================
   @media – desktop viewport height tweaks (gold frame)
   ============================================================ */
@media (max-width: 768px) {
    .gold-frame-section {
        margin-top: -60px;
        padding: 0 1rem 2rem;
    }
    .gold-frame-box { padding: 1.5rem; }
    .frame-title { font-size: 1.75rem; }
    .gold-frame-box .corner::before { width: 25px !important; }
    .gold-frame-box .corner::after  { height: 25px !important; }
}

/* ============================================================
   @media – featured adventure + discord + community (768px)
   ============================================================ */
@media (max-width: 768px) {
    .featured-adventure-card { grid-template-columns: 1fr; }
    .featured-cover { height: 180px; }
    .featured-info { padding: 1.5rem; }
    .featured-info h3 { font-size: 1.5rem; }
    .community-showcase, .featured-adventure { padding: 2rem 0; }
    .community-showcase .container,
    .featured-adventure .container { padding: 0 1rem; }
    .discord-cta { padding: 2.5rem 0; }
    .discord-cta .container { padding: 0 1rem; }
    .discord-cta-card { flex-direction: column; align-items: flex-start; padding: 2rem; }
}

/* ============================================================
   @media – Mobile Navigation & Header (768px)
   ============================================================ */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 2;
    }
    .header-brand {
        order: 1;
        flex: 0 0 auto;
        min-width: 0;
    }
    .nav-actions {
        order: 3;
        display: flex;
        gap: 0.25rem;
        flex: 0 0 auto;
    }
    .nav-actions .btn        { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
    .nav-actions .btn-ghost  { padding: 0.5rem; }
    .nav-actions button      { flex: 0 1 auto; white-space: nowrap; font-size: 0.813rem; padding: 0.5rem 0.75rem; }

    .user-menu {
        order: 3;
        display: flex;
        gap: 0.5rem;
        flex: 0 0 auto;
        align-items: center;
    }
    .user-name { display: none; }

    .app-nav { display: none; width: 100%; }
    .app-nav.mobile-nav-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--bg-dark, var(--bg-secondary));
        border-bottom: 1px solid var(--border-default);
        padding: 1.5rem 1rem;
        z-index: 1000;
        gap: 1rem;
        align-items: center;
    }
    .app-nav.mobile-nav-open .nav-tab,
    .app-nav.mobile-nav-open .nav-dropdown {
        width: 100%;
        display: flex;
        justify-content: center;
        margin: 0;
    }
    .app-nav.mobile-nav-open .nav-dropdown .nav-tab {
        width: auto;
        text-align: center;
    }
    .nav-badge { margin-left: 8px; vertical-align: middle; }
    .nav-tab {
        width: 100%;
        text-align: left;
        padding: 1rem 1.5rem;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    .nav-tab.active {
        border-left-color: var(--accent-gold);
        border-bottom-color: transparent;
        background: var(--bg-hover);
    }
    .nav-dropdown-menu { position: static; box-shadow: none; margin-top: 0; border-radius: 0; }

    /* Touch target sizing */
    .btn, .btn-sm, .btn-xs { min-height: 44px; padding: 0.75rem 1rem; font-size: 0.8rem; }
    .modal-close, .close-modal { min-width: 44px; min-height: 44px; }
    .carousel-nav, .carousel-dot { min-width: 44px; min-height: 44px; }

    /* Inputs minimum height + prevent iOS zoom */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea, select,
    .auth-form input { min-height: 44px; padding: 0.75rem; font-size: 16px; }

    /* Modal on mobile */
    .modal-content { max-width: 95%; width: 95%; margin: 1rem; padding: 1.5rem; max-height: 95vh; }

    /* Overflow fix */
    body { overflow-x: hidden; }
    .container { overflow-x: hidden; }

    /* Feature grid single column */
    .feature-grid { grid-template-columns: 1fr; }

    .discord-icon { display: none; }

    .feature-card {
        background: var(--bg-primary);
        padding: 3rem 1rem;
        position: relative;
        overflow: hidden;
        transition: background 0.5s;
        border: none;
        border-radius: 0;
        text-align: left;
    }

    .frame-tabs  { flex-direction: column; }
    .frame-tab   { width: 100%; }

    /* Cookie consent */
    .cookie-consent-banner    { padding: 1rem; }
    .cookie-consent-content   { flex-direction: column; align-items: stretch; gap: 1rem; }
    .cookie-consent-text      { min-width: auto; }
    .cookie-consent-actions   { flex-direction: column; gap: 0.5rem; }
    .cookie-consent-actions .btn { width: 100%; }
}

/* ============================================================
   @media – Very small screens (480px)
   ============================================================ */
@media (max-width: 480px) {
    .nav-actions .btn { padding: 0.4rem 0.6rem; font-size: 0.7rem; }
    .section-heading  { font-size: 1.5rem; }
    .feature-card h3  { font-size: 1.125rem; }
    .container        { padding: 0 1rem; }
    .features         { padding: 2rem 1rem; }
    .modal-content    { padding: 1rem; }
    .feature-card     { padding: 1rem; }
    .btn-xl           { padding: 0.875rem 1.25rem; font-size: 0.875rem; }
    .carousel-nav     { min-width: 40px; min-height: 40px; }
}

/* ============================================================
   @media – Mid-width nav scaling (1508 → 950px)
   ============================================================ */
@media (max-width: 1508px) {
    .unified-header { padding: 0.8rem 1rem; }
    .app-nav        { gap: 0.8rem; }
    .nav-tab        { font-size: 0.6rem; letter-spacing: 0.08em; }
    .app-nav        { gap: 0.4rem; }
    .nav-tab        { font-size: 0.65rem; letter-spacing: 0.04em; }
    .nav-badge      { font-size: 0.4rem; height: 10px; padding: 0.1em 0.3em; }
}

@media (max-width: 1202px) {
    .app-nav   { gap: 0.2rem; }
    .nav-tab   { font-size: 0.55rem; letter-spacing: 0.04em; }
    .nav-badge { font-size: 0.4rem; padding: 0.1em 0.3em; }
}

@media (max-width: 950px) and (min-width: 769px) {
    .nav-tab { font-size: 0.5rem; letter-spacing: 0; padding: 0.3em 0; }
}

/* ============================================================
   Landing Page Mobile Rendering Fixes (from comprehensive
   mobile section at end of style.css)
   ============================================================ */
@media (max-width: 768px) {
    .landing-header {
        min-height: 78dvh !important;
        display: flex;
        flex-direction: column;
    }

    .bg-video-carousel {
        position: relative !important;
        order: 1;
        height: 50vh;
        min-height: 300px;
        width: 100%;
        top: auto !important;
        left: auto !important;
        margin-bottom: 0;
    }

    .unified-header {
        top: 0px;
        margin-top: 3px;
        z-index: 1100;
        padding-top: env(safe-area-inset-top);
    }

    .hero {
        order: 3;
        padding: 0;
        min-height: auto;
        display: flex;
        flex-direction: column;
    }

    .hero-content {
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        display: flex;
        flex-direction: column;
    }

    .hero-title {
        order: -1;
        position: absolute;
        top: 25vh;
        left: 50%;
        transform: translate(-50%, 0);
        z-index: 10;
        width: 100%;
        padding: 1rem;
    }

    .hero-title-main,
    .hero-title-sub {
        text-shadow: 2px 2px 12px rgba(0,0,0,0.95);
        padding: 0.5rem;
        text-align: center;
    }

    .hero-title-main {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    .hero-title-sub {
        font-size: 1.5rem;
        line-height: 1.3;
        background: none !important;
        -webkit-text-fill-color: var(--accent-gold) !important;
        color: var(--accent-gold);
    }

    .hero-description {
        background: var(--bg-elevated);
        font-family: Cinzel;
        padding: 2rem 1rem;
        margin: 0;
        font-size: 1rem;
        line-height: 1.6;
        box-shadow: 0px 0px 48px 20px rgb(0 0 0 / 68%);
        border-radius: 10px;
        border: solid 1px #ecd26c3d;
    }

    .hero-cta {
        background: var(--bg-elevated);
        padding: 20px;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        box-shadow: 0px 0px 48px 20px rgb(0 0 0 / 68%);
        border-radius: 10px;
        border: solid 1px #ecd26c3d;
    }

    .hero-cta .btn {
        width: 100%;
        min-height: 56px;
        font-size: 1.125rem;
        justify-content: center;
    }

    .gold-frame-section { padding: 2rem 1rem; margin-top: 0; }
    .frame-title        { font-size: 1.5rem; line-height: 1.3; margin-bottom: 1rem; }
    .frame-subtitle     { font-size: 0.95rem; line-height: 1.6; margin: 15px; }
}

/* ============================================================
   @media print – hide header/nav
   ============================================================ */
@media print {
    .unified-header,
    header.unified-header { display: none !important; }
}
