:root {
    --color-dark: #0f0a1a;
    --color-purple-light: #9772fb;
    --color-purple-dark: #4a2b7c;
    --color-gold: #d4af37;
    --color-gold-dark: #9c7a23;
    --color-text: #f1e6ff;
    --color-blue: #acbed3;
    --font-display: 'Cinzel', serif;
    --font-medieval: 'MedievalSharp', cursive;
    --font-body: 'Spectral', serif;
}

/* Add specific styling for category description elements - from public.css */
.lore-meta a,
.category-card p a {
    color: var(--color-gold);
    text-decoration: underline;
    transition: all 0.2s ease-in-out;
}

.lore-meta a:hover,
.category-card p a:hover {
    color: #fff;
    text-decoration: underline;
}

.lore-meta p,
.category-card p p {
    margin-bottom: 1em;
}

.lore-meta strong,
.lore-meta b,
.category-card p strong,
.category-card p b {
    color: var(--color-gold);
    font-weight: bold;
}

.lore-meta em,
.lore-meta i,
.category-card p em,
.category-card p i {
    font-style: italic;
}

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

html,
body {
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-dark);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body.lore-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/fantasy-harbor.webp');
    background-size: cover;
    background-position: center;
    filter: blur(8px) brightness(0.6);
    z-index: -1;
}

.background-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(74, 43, 124, 0.6), rgba(15, 10, 26, 0.8));
    z-index: 1;
}

/* Featured image container and styling - floats to allow text flow around image */
.featured-image-container {
    float: right;
    max-width: 75%;
    width: 75%;
    margin: 0 0 20px 20px;
    position: relative;
    z-index: 1;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.featured-image {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

.content-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    flex: 1 0 auto;
    position: relative;
    z-index: 2;
    padding: 15px 15px 40px;
    width: 100%;
    margin: 0 auto;
    max-width: 1850px;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

header {
    text-align: center;
    margin-bottom: 10px;
    padding: 0;
    position: relative;
    width: 95%;
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
}

h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--color-gold);
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
    letter-spacing: 2px;
    font-variant: small-caps !important;
}

/* Consolidated h2 styling with strong specificity */
h2,
.lore-content-text h2,
body h2,
body.lore-page h2 {
    font-family: 'Cinzel', serif !important;
    color: var(--color-gold) !important;
    font-variant: small-caps !important;
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    margin: 1.5rem 0 1rem !important;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3) !important;
    letter-spacing: 0.05em !important;
    line-height: 1.3 !important;
    text-transform: none !important;
}

/* Ensure h2 in lore content has the right margins */
.lore-content-text h2 {
    margin: 1.8rem 0 1.2rem !important;
}

/* Border styles for h2 that need them */
.lore-content-text h2:not(.no-border) {
    padding-bottom: 10px !important;
    border-bottom: none !important;
    /* Remove solid border */
    position: relative !important;
}

/* Add fading gradient border using pseudo-element */
.lore-content-text h2:not(.no-border)::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 1px !important;
    background: linear-gradient(to right,
            var(--color-purple-light) 0%,
            var(--color-purple-light) 30%,
            rgba(74, 43, 124, 0) 100%) !important;
}

/* No border version */
h2.no-border,
.lore-content-text h2.no-border {
    font-family: 'Cinzel', serif !important;
    color: var(--color-gold) !important;
    font-variant: small-caps !important;
    margin: 30px 0 20px !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.form-container {
    /* background: rgba(15, 10, 26, 0.85); */
    border-radius: 8px;
    padding: 20px;
    /* box-shadow: 0 4px 30px rgba(74, 43, 124, 0.5),
                0 0 10px rgba(212, 175, 55, 0.3); */
    /* border: 1px solid rgba(74, 43, 124, 0.6); */
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.form-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
    z-index: 5;
}

.tab-btn {
    background-color: rgba(15, 10, 26, 0.9);
    color: var(--color-text);
    border: 1px solid var(--color-purple-dark);
    padding: 8px 20px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    outline: none;
}

.tab-btn:hover {
    background-color: rgba(74, 43, 124, 0.6);
    border-color: var(--color-gold);
}

.tab-btn.active {
    background-color: var(--color-purple-dark);
    border-color: var(--color-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
    position: relative;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background-color: var(--color-gold);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.form-content {
    min-height: 800px;
}

iframe#google-form,
iframe#dark-google-form {
    width: 100%;
    min-height: 800px;
    background-color: transparent;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--color-purple-dark);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold-dark);
}






/* Lore-specific background override */
body.lore-page .background-container {
    background-image: url('../images/library.webp') !important;
}

/* Fallback for browsers that don't support WebP */
.no-webp body.lore-page .background-container {
    background-image: url('../images/library.png') !important;
}

/* Admin-specific background override (for pages in admin subdirectory) */
body.lore-page.admin-page .background-container {
    background-image: url('../../images/library.webp') !important;
}

/* Fallback for browsers that don't support WebP */
.no-webp body.lore-page.admin-page .background-container {
    background-image: url('../../images/library.png') !important;
}

/* Fixed sidebar styles */
.lore-container {
    flex: 1 0 auto;
    display: flex;
    flex-direction: row;
    gap: 30px;
    max-width: 1800px;
    margin: 0 auto;
    align-items: flex-start;
    width: 95%;
    position: relative;
    /* Remove min-height, flex-direction: column, etc. */
}

.lore-content {
    flex: 1 0 auto;
}

.lore-footer {
    flex-shrink: 0;
    width: 100%;
    text-align: center;
    padding: 18px 0 12px 0;
    margin: 0;
}

/* Adjust header to remove logo container from there */
header {
    text-align: center;
    margin-bottom: 10px;
    padding: 0;
    position: relative;
    width: 95%;
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
}

/* Logo container styling */
.logo-container {
    max-width: 270px;
    /* Match sidebar width */
    margin: 0 auto 15px auto;
    padding: 20px 0 0 0;
    text-align: center;
    position: relative;
    display: block;
}

.logo-image {
    width: 75%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Move sidebar and logo to a wrapper div to keep them together */
.sidebar-column {
    display: flex;
    flex-direction: column;
    width: 270px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
}

.lore-sidebar {
    position: relative;
    height: auto;
    min-height: 200px;
    max-height: calc(100vh - 120px);
    /* Reduced to account for logo */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    padding-left: 23px;
    padding-right: 23px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    z-index: 10;
    background: rgba(15, 10, 26, 0.8);
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(76, 47, 117, 0.5);
    border: 1px solid var(--color-purple-dark);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    margin-right: 15px;
    width: 270px;
    flex-shrink: 0;
    align-self: flex-start;
}

/* Move sidebar and logo to a wrapper div to keep them together */
.sidebar-column {
    display: flex;
    flex-direction: column;
    width: 270px;
    flex-shrink: 0;
}

.lore-sidebar::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
    width: 0;
}

/* Sidebar navigation styling */
.lore-nav-category {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    text-align: center;
    font-size: 1.1rem;
    margin: 20px 0 10px;
    position: relative;
    letter-spacing: 0.5px;
    border-bottom: none;
    /* Explicitly remove border-bottom */
}

.lore-nav-category:after {
    display: none;
    /* Remove the line under Categories */
}

.lore-nav-category:before {
    display: none;
    /* Ensure no pseudo-elements are adding lines */
}

.lore-nav {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    width: 100%;
}

.lore-nav li {
    margin-bottom: 8px;
}

.lore-nav a {
    display: block;
    text-decoration: none;
    color: var(--color-text);
    font-family: 'Spectral', serif;
    padding: 8px 15px;
    border-radius: 15px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
    background: rgba(30, 10, 60, 0.3);
    position: relative;
    overflow: hidden;
}

.lore-nav a:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(212, 175, 55, 0) 0%,
            rgba(212, 175, 55, 0.05) 50%,
            rgba(212, 175, 55, 0) 100%);
    transition: all 0.8s ease;
    z-index: 1;
}

.lore-nav a:hover {
    background: rgba(30, 10, 60, 0.5);
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.lore-nav a:hover:before {
    left: 100%;
}

.lore-nav a.active {
    background: rgba(30, 10, 60, 0.7);
    color: var(--color-gold);
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
    font-weight: 600;
    border-width: 2px;
}

.lore-nav a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 300%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(15, 10, 26, 0.7) 0%,
            rgba(76, 47, 117, 0.3) 16.67%,
            rgba(212, 175, 55, 0.2) 33.33%,
            rgba(76, 47, 117, 0.3) 50%,
            rgba(15, 10, 26, 0.7) 66.67%,
            rgba(76, 47, 117, 0.3) 83.33%,
            rgba(212, 175, 55, 0.2) 100%);
    background-size: 300% 100%;
    animation: shimmerNav 6s infinite linear;
    opacity: 0.5;
    z-index: 0;
}

/* Use this class to specifically disable animations */
.lore-nav a.active.no-animation::before {
    animation: none;
}

@keyframes shimmerNav {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 0%;
    }
}

.lore-nav a span {
    position: relative;
    z-index: 2;
}

.lore-nav a.active:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0) 70%);
    opacity: 0.6;
    z-index: 1;
    animation: navPulse 3s infinite ease-in-out;
    pointer-events: none;
}

/* TABLES */

.lore-content-text ul,
.lore-content-text ol {
    padding-left: 25px;
    margin: 15px 0;
}

.lore-content-text li {
    margin-bottom: 8px;
}

.lore-content-text blockquote {
    margin: 20px 0;
    padding: 15px 20px;
    background: rgba(74, 43, 124, 0.2);
    border-left: 4px solid var(--color-gold);
    font-style: italic;
}

/* Lore table centering and colspan centering */
.lore-content-text table {
    border-collapse: collapse !important;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 90% !important;
    max-width: 90% !important;
    background: rgba(30, 10, 60, 0.3) !important;
    border: 1px solid rgba(74, 43, 124, 0.5) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    padding: 0 !important;
    float: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: table !important;
    border-spacing: 0 !important;
    table-layout: auto !important;
    /* Removed border-left/right for scrollable tables */
}

.lore-content-text th[colspan],
.lore-content-text td[colspan] {
    text-align: center !important;
    justify-content: center;
    align-items: center;
}

/* Table cells styling */
.lore-content-text td,
.lore-content-text th,
.lore-content-text tr {
    background: inherit !important;
    padding: 16px 20px !important;
    border: 1px solid rgba(74, 43, 124, 0.3) !important;
    font-family: inherit !important;
    font-size: inherit !important;
    text-align: left !important;
    vertical-align: middle !important;
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    color: var(--color-text) !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    font-weight: normal !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    position: static !important;
}

/* Apply header styling to first row cells regardless of element type */
.lore-content-text table tr:first-child td,
.lore-content-text table tr:first-child th,
.lore-content-text table tr:first-child td[style],
.lore-content-text table tr:first-child th[style],
.lore-content-text table thead tr td,
.lore-content-text table thead tr th {
    background: rgba(74, 43, 124, 0.4) !important;
    color: var(--color-gold) !important;
    font-family: 'Cinzel', serif !important;
    font-weight: bold !important;
    font-variant: small-caps !important;
    text-transform: none !important;
}

/* Ensure alternating row colors even with inline styles */
.lore-content-text tr:nth-child(even),
.lore-content-text tr:nth-child(even)[style] {
    background: rgba(15, 10, 26, 0.4) !important;
}

/* Consistent hover effect */
.lore-content-text tr:hover,
.lore-content-text tr:hover[style] {
    background: #2a1a4d !important;
}



/* Lore search styles from public.css */
.lore-search {
    margin-bottom: 20px;
}

.lore-search input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(30, 20, 50, 0.7);
    border: 1px solid var(--color-purple-light);
    border-radius: 4px;
    color: var(--color-text);
}

.lore-search button {
    margin-top: 10px;
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, var(--color-purple-dark), var(--color-purple-light));
    border: 1px solid var(--color-gold);
    border-radius: 4px;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.lore-search button:hover {
    background: var(--color-purple-light);
}

/* Redesigned search styles */
.lore-search {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.lore-search form {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lore-search input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(15, 10, 26, 0.7);
    color: var(--color-text);
    font-family: 'Spectral', serif;
    font-size: 14px;
    letter-spacing: 0.5px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(74, 43, 124, 0.2) inset;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.lore-search input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.lore-search input[type="text"]:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3), 0 0 5px rgba(74, 43, 124, 0.2) inset;
    background: rgba(15, 10, 26, 0.85);
    background-image: linear-gradient(125deg,
            rgba(100, 50, 150, 0.05) 0%,
            rgba(15, 10, 26, 0) 40%,
            rgba(212, 175, 55, 0.08) 65%,
            rgba(15, 10, 26, 0) 100%);
    background-size: 250% 100%;
    animation: cosmicShimmer 4s ease infinite;
    width: 95%;
    /* Slightly wider on focus */
}

/* Class for search box with focus animation */
.lore-search input[type="text"].focus-active {
    border-color: var(--color-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3), 0 0 5px rgba(74, 43, 124, 0.2) inset;
    background: rgba(15, 10, 26, 0.85);
    background-image: linear-gradient(125deg,
            rgba(100, 50, 150, 0.05) 0%,
            rgba(15, 10, 26, 0) 40%,
            rgba(212, 175, 55, 0.08) 65%,
            rgba(15, 10, 26, 0) 100%);
    background-size: 250% 100%;
    animation: cosmicShimmer 4s ease infinite;
    width: 95%;
}

@keyframes cosmicShimmer {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.lore-search .search-button {
    position: absolute;
    right: 7%;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(30, 10, 60, 0.6);
    color: var(--color-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(74, 43, 124, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow: hidden;
}

.lore-search .search-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 50%, rgba(212, 175, 55, 0) 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lore-search .search-button:hover,
.lore-search .search-button.active {
    background: rgba(30, 10, 60, 0.8);
    border-color: var(--color-gold);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4), 0 0 25px rgba(74, 43, 124, 0.5);
}

.lore-search .search-button:hover:before {
    opacity: 1;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.2) 10%, rgba(212, 175, 55, 0) 70%);
    animation: pulseGlow 2s ease infinite;
}

.lore-search .search-button svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    position: relative;
    z-index: 2;
}

@keyframes pulseGlow {
    0% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.5);
    }

    100% {
        opacity: 0.2;
        transform: scale(0.8);
    }
}

.lore-content {
    flex: 1;
    padding: 20px;
    background: rgba(15, 10, 26, 0.8);
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(76, 47, 117, 0.5);
    border: 1px solid var(--color-purple-dark);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    max-width: 100%;
    overflow-x: hidden;
    min-width: 0;
    /* Ensures proper flex behavior */
}

/* Make sure all content has consistent font styling */
.lore-content-text {
    line-height: 1.7;
    font-family: Verdana, sans-serif !important;
    font-size: 16px !important;
    padding-left: 18px;
    padding-right: 18px;
}

.lore-content-text *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) {
    font-family: Verdana, sans-serif !important;
    font-size: 16px !important;
}

.search-button-nav {
    display: block;
    text-decoration: none;
    background: linear-gradient(135deg, var(--color-purple-dark), var(--color-purple-light));
    color: var(--color-text);
    font-family: 'MedievalSharp', cursive;
    padding: 8px 15px;
    font-size: 1rem;
    border-radius: 8px;
    border: 2px solid var(--color-gold);
    transition: all 0.3s ease;
    text-align: center;
    cursor: pointer;
    width: auto;
    min-width: 120px;
}

/* Back to top button */
.scroll-top {
    position: fixed;
    bottom: 90px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: rgba(15, 10, 26, 0.9);
    color: var(--color-gold);
    border: 2px solid var(--color-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 50;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3), 0 0 25px rgba(74, 43, 124, 0.4);
    font-size: 20px;
    visibility: hidden;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.scroll-top.visible {
    opacity: 0.95;
    transform: scale(1);
    visibility: visible;
}

.scroll-top:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5), 0 0 35px rgba(74, 43, 124, 0.6);
}

/* Styled chat button - matching timeline style */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: rgba(15, 10, 26, 0.9);
    border-radius: 50%;
    border: 2px solid var(--color-gold);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3), 0 0 25px rgba(74, 43, 124, 0.4);
    opacity: 0.95;
    transform: scale(1);
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.chat-button:after,
.chat-button:before {
    display: none !important;
}

/* Update chat frame container with public.css styles */
.chat-frame-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 500px;
    background: rgba(15, 10, 26, 0.9);
    border-radius: 12px;
    border: 2px solid var(--color-purple-dark);
    box-shadow: 0 0 15px rgba(76, 47, 117, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transform-origin: bottom right;
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.chat-frame-container.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

.chat-frame {
    width: 100%;
    height: 100%;
    border: none;
}


.search-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.search-particles .star {
    position: absolute;
    background-color: var(--color-gold);
    border-radius: 50%;
    animation: twinkle 6s infinite ease-in-out;
    box-shadow: 0 0 4px rgba(212, 175, 55, 0.8);
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.search-particles .star.visible {
    opacity: 0.7;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.1;
        transform: scale(0.8);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.lore-content {
    flex: 1;
    overflow-y: auto;
    min-height: 650px;
}

/* Navigation buttons styling */
body.lore-page .main-nav {
    margin: 40px 0 0px;
    /* Increased top and bottom margins to center vertically */
}

body.lore-page .main-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    gap: 15px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

body.lore-page .main-nav .nav-link {
    display: block;
    text-decoration: none;
    background: rgba(15, 10, 26, 0.7);
    color: var(--color-text);
    font-family: 'Spectral', serif;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 25px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 0 10px rgba(74, 43, 124, 0.2);
    letter-spacing: 0.5px;
    overflow: hidden;
}

body.lore-page .main-nav .nav-link:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(212, 175, 55, 0) 0%,
            rgba(212, 175, 55, 0.05) 50%,
            rgba(212, 175, 55, 0) 100%);
    transition: all 0.8s ease;
    z-index: 1;
}

body.lore-page .main-nav .nav-link:hover {
    transform: translateY(-2px);
    border-color: var(--color-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3), 0 0 25px rgba(74, 43, 124, 0.4);
}

body.lore-page .main-nav .nav-link:hover:before {
    left: 100%;
}

body.lore-page .main-nav .nav-link span {
    position: relative;
    z-index: 2;
}

body.lore-page .main-nav .nav-link.active {
    background: rgba(30, 10, 60, 0.8);
    color: var(--color-gold);
    border-color: var(--color-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

/* Active nav link shimmer effect */
body.lore-page .main-nav .nav-link.active:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0) 70%);
    opacity: 0.6;
    z-index: 1;
    animation: navPulse 3s infinite ease-in-out;
}

@keyframes navPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.95);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

/* Related entries styling */
body.lore-page .related-entries .related-link {
    display: block;
    text-decoration: none;
    background: rgba(15, 10, 26, 0.7);
    color: var(--color-text);
    font-family: 'Spectral', serif;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 25px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 0 10px rgba(74, 43, 124, 0.2);
    letter-spacing: 0.5px;
    overflow: hidden;
}

body.lore-page .related-entries .related-link:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(212, 175, 55, 0) 0%,
            rgba(212, 175, 55, 0.05) 50%,
            rgba(212, 175, 55, 0) 100%);
    transition: all 0.8s ease;
    z-index: 1;
}

body.lore-page .related-entries .related-link:hover {
    transform: translateY(-2px);
    border-color: var(--color-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3), 0 0 25px rgba(74, 43, 124, 0.4);
}

body.lore-page .related-entries .related-link:hover:before {
    left: 100%;
}

body.lore-page .related-entries .related-link span {
    position: relative;
    z-index: 2;
}

/* Style for the related list container */
body.lore-page .related-entries .related-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Style for the related entries heading */
body.lore-page .related-entries h3 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    margin: 30px 0 15px;
    text-align: center;
    font-variant: small-caps !important;
}

/* Timeline event view button styling */
body.lore-page .view-timeline-event {
    display: inline-block;
    text-decoration: none;
    background: rgba(15, 10, 26, 0.7);
    color: var(--color-text);
    font-family: 'Spectral', serif;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 0 10px rgba(74, 43, 124, 0.2);
    letter-spacing: 0.5px;
    overflow: hidden;
    margin-top: 12px;
}

body.lore-page .view-timeline-event:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(212, 175, 55, 0) 0%,
            rgba(212, 175, 55, 0.05) 50%,
            rgba(212, 175, 55, 0) 100%);
    transition: all 0.8s ease;
    z-index: 1;
}

body.lore-page .view-timeline-event:hover {
    transform: translateY(-2px);
    border-color: var(--color-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3), 0 0 25px rgba(74, 43, 124, 0.4);
}

body.lore-page .view-timeline-event:hover:before {
    left: 100%;
}

/* Breadcrumb navigation styling */
body.lore-page .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 15px;
    font-family: 'Spectral', serif;
    letter-spacing: 0.3px;
}

body.lore-page .breadcrumb li {
    position: relative;
    margin-right: 25px;
}

body.lore-page .breadcrumb li:not(:last-child)::after {
    content: '›';
    position: absolute;
    right: -17px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(212, 175, 55, 0.6);
    font-size: 1.2rem;
}

body.lore-page .breadcrumb a {
    color: var(--color-text);
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    padding: 3px 5px;
    border-radius: 12px;
}

body.lore-page .breadcrumb a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-gold);
    transition: width 0.3s ease;
}

body.lore-page .breadcrumb a:hover {
    color: var(--color-gold);
}

body.lore-page .breadcrumb a:hover::before {
    width: 100%;
}

body.lore-page .breadcrumb li:last-child {
    color: var(--color-gold);
    font-weight: 600;
}

/* Breadcrumb navigation */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    font-size: 0.9rem;
}

.breadcrumb li {
    display: inline-block;
}

.breadcrumb li:not(:last-child)::after {
    content: "›";
    margin: 0 10px;
    color: var(--color-purple-light);
}

.breadcrumb a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--color-gold);
}

.breadcrumb li:last-child {
    color: var(--color-gold);
}

/* No results container styling */
body.lore-page .no-results-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px 25px 0 25px;
    /* Remove bottom padding */
    margin: 20px auto;
    max-width: 600px;
    background: rgba(15, 10, 26, 0.7);
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 20px rgba(74, 43, 124, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
    min-height: 320px;
}

body.lore-page .no-results-container img {
    width: 120px;
    height: auto;
    position: absolute;
    left: 0;
    bottom: 0;
    margin: 0;
    padding: 0;
    opacity: 0.92;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
    border-radius: 0 0 0 15px;
}

body.lore-page .no-results-container h3 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    font-variant: small-caps !important;
}

body.lore-page .no-results-container p {
    color: var(--color-text);
    margin-bottom: 20px;
    font-family: 'Spectral', serif;
}

body.lore-page .no-results-container ul {
    list-style: none;
    padding: 0 0 0 60px;
    text-align: left;
    max-width: 400px;
    margin: 0 auto 20px auto;
    color: var(--color-text);
}

body.lore-page .no-results-container li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

body.lore-page .no-results-container li::before {
    content: '•';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-gold);
}

body.lore-page .no-results-container .nav-button-container {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

body.lore-page .no-results-container .nav-link {
    display: inline-block;
    background: rgba(15, 10, 26, 0.7);
    color: var(--color-text);
    font-family: 'Spectral', serif;
    padding: 7px 18px;
    font-size: 0.98rem;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.18);
    transition: all 0.2s;
    text-align: center;
    margin: 0 2px;
    box-shadow: 0 0 8px rgba(74, 43, 124, 0.13);
    opacity: 0.85;
    text-decoration: none;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

body.lore-page .no-results-container .nav-link:hover {
    color: var(--color-gold);
    background: rgba(30, 10, 60, 0.85);
    border-color: var(--color-gold);
    opacity: 1;
    text-decoration: underline;
}

body.lore-page .no-results-container a {
    color: var(--color-gold);
    text-decoration: underline;
    font-size: 0.98rem;
    transition: color 0.2s;
}

body.lore-page .no-results-container a:hover {
    color: #fff;
    text-decoration: underline;
}

body.lore-page .no-results-container .nav-button-container {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

/* Lore header section styling */
body.lore-page .lore-header {
    margin-bottom: 30px;
    position: relative;
    border-bottom: none;
    padding-bottom: 0;
}

body.lore-page .lore-title {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 2.2rem;
    margin: 10px 0;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    position: relative;
}

body.lore-page .lore-title:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg,
            rgba(212, 175, 55, 0.8) 0%,
            rgba(212, 175, 55, 0.2) 100%);
}

body.lore-page .lore-meta {
    max-width: 800px;
    margin: 20px 0;
    font-family: Verdana, sans-serif;
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* Logo styling to align with sidebar and reduce size */
.logo-container {
    max-width: 270px;
    /* Match sidebar width */
    margin: 0 auto 15px auto;
    padding: 20px 0 0 0;
    text-align: center;
    position: relative;
    display: block;
}

.logo-image {
    width: 75%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Existing media query styles will take over for smaller screens */

/* Lore content styling to match sidebar */
body.lore-page .lore-content {
    position: relative;
    z-index: 10;
    width: 100%;
}

.entry-list {
    list-style: none;
    padding: 0;
}

.entry-list li {
    margin-bottom: 8px;
}

.entry-list a {
    color: var(--color-text);
    text-decoration: none;
    display: block;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.entry-list a:hover {
    background: rgba(46, 34, 80, 0.6);
    color: var(--color-gold);
}

.entry-card {
    background: rgba(15, 10, 26, 0.8);
    border-radius: 20px;
    border: 2px solid var(--color-purple-dark);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 0 15px rgba(76, 47, 117, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.entry-card:hover {
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.6), 0 0 10px rgba(212, 175, 55, 0.4) inset;
    transform: translateY(-5px);
    border-color: var(--color-gold);
    outline: 1px solid var(--color-gold);
    outline-offset: -1px;
}

.entry-card h3 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    margin-bottom: 10px;
    font-variant: small-caps !important;
}

.entry-card h3 a {
    color: var(--color-gold);
    text-decoration: none;
    transition: all 0.3s ease;
    font-variant: small-caps !important;
}

.entry-card h3 a:hover {
    color: var(--color-text);
    font-variant: small-caps !important;
}

.entry-card-content {
    color: var(--color-text);
    margin-bottom: 15px;
    max-height: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

.entry-card-meta {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(76, 47, 117, 0.3);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.related-entries {
    margin-top: 40px;
    padding-top: 20px;
    border-top: none;
    position: relative;
}

/* Add fading gradient border using pseudo-element */
.related-entries::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 1px !important;
    background: linear-gradient(to right,
            var(--color-purple-light) 0%,
            var(--color-purple-light) 30%,
            rgba(74, 43, 124, 0) 100%) !important;
}

.related-entries h3 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    margin-bottom: 15px;
    font-variant: small-caps !important;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /* Exactly 3 columns */
    gap: 20px;
}



/* Category styling */
.category-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /* Exactly 3 columns */
    gap: 25px;
    margin-top: 30px;
}

/* Responsive adjustments for category list */
@media (max-width: 1200px) {
    .category-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        /* 2 columns for medium screens */
    }
}



.category-card {
    background: rgba(15, 10, 26, 0.8);
    border-radius: 20px;
    border: 2px solid var(--color-purple-dark);
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 0 15px rgba(76, 47, 117, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.category-card:hover {
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.6), 0 0 10px rgba(212, 175, 55, 0.4) inset;
    transform: translateY(-5px);
    border-color: var(--color-gold);
    outline: 1px solid var(--color-gold);
    outline-offset: -1px;
}

.category-card h3 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    margin-bottom: 10px;
    font-variant: small-caps !important;
}

.category-card h3 a {
    color: var(--color-gold);
    text-decoration: none;
    transition: all 0.3s ease;
    font-variant: small-caps !important;
}

.category-card h3 a:hover {
    color: var(--color-text);
    font-variant: small-caps !important;
}

.category-card p {
    color: var(--color-text-muted);
    font-family: Verdana, sans-serif;
    font-size: 16px;
    margin-bottom: 15px;
    flex-grow: 1;
}

/* Preserve line breaks and formatting in category descriptions */
.category-card p,
.lore-meta {
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.6;
}

.category-card:hover .entry-featured-image img {
    transform: scale(1.05);
}

.category-card .entry-featured-image img {
    transform: scale(1.0);
}





.category-card:hover .entry-featured-image img {
    transform: scale(1.05);
    filter: brightness(1.1);
    border-radius: 8px;
}

/* Styles for timeline event cards on lore entry pages */
.related-timeline-event,
.related-timeline-events {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.related-timeline-event h3,
.related-timeline-events h3 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
    font-variant: small-caps !important;
}

.timeline-events-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.timeline-event-card {
    background: linear-gradient(135deg, var(--color-purple-dark), var(--color-purple-light));
    border: 1px solid var(--color-purple-light);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    max-width: 300px;
    flex: 1 1 300px;
}

.timeline-event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    border-color: var(--color-gold);
}

.timeline-event-card h4 {
    font-family: 'Cinzel', serif !important;
    font-size: 1.2rem;
    color: var(--color-gold);
    margin-top: 0;
    margin-bottom: 10px;
}

.timeline-event-details {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.timeline-event-era {
    font-size: 0.9rem;
    color: var(--color-gold);
    background: rgba(15, 10, 26, 0.5);
    padding: 3px 8px;
    border-radius: 4px;
}

.timeline-event-year {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.timeline-event-description {
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.view-timeline-event {
    display: inline-block;
    background: rgba(15, 10, 26, 0.8);
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Cinzel', serif !important;
    font-size: 0.9rem;
}

.view-timeline-event:hover {
    background: var(--color-gold);
    color: var(--color-background);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

/* Form elements styling - specifically for Safari compatibility */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
textarea,
select {
    font-size: 16px !important;
    /* Prevent auto-zoom on mobile and ensure consistent sizing in Safari */
    -webkit-appearance: none;
    /* Remove Safari's default styling */
    -moz-appearance: none;
    appearance: none;
    border-radius: 4px;
    font-family: Verdana, sans-serif;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Logo styling to align with sidebar and reduce size */
/* Category navigation */
.category-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.category-parent {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.category-parent.expanded .dropdown-icon {
    transform: rotate(180deg);
}

.category-children ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-children li {
    margin-bottom: 0;
}

.category-children a {
    padding-left: 20px;
    font-size: 0.95rem;
}

/* Parent and child category visual distinction */
.category-parent {
    font-weight: 600;
    color: var(--color-gold);
}

/* Base styling for all child categories */
.category-children a {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

/* Progressive indentation for parent categories */
.nested-level-0>a {
    padding-left: 10px;
}

.nested-level-1>a {
    padding-left: 25px;
}

.nested-level-2>a {
    padding-left: 40px;
}

.nested-level-3>a {
    padding-left: 55px;
}

/* Progressive indentation for nested levels */
.nested-level-0 .category-children a {
    border-left: 2px solid var(--color-purple-light);
    margin-left: 10px;
    padding-left: 15px !important;
}

.nested-level-1 .category-children a {
    border-left: 2px solid var(--color-purple-light);
    margin-left: 15px;
    padding-left: 25px !important;
}

.nested-level-2 .category-children a {
    border-left: 2px solid var(--color-purple-light);
    margin-left: 20px;
    padding-left: 35px !important;
}

.nested-level-3 .category-children a {
    border-left: 2px solid var(--color-purple-light);
    margin-left: 25px;
    padding-left: 45px !important;
}

.category-children a:hover,
.category-children a.active {
    color: var(--color-text);
    background: rgba(46, 34, 80, 0.4);
}

/* Add rotate-border animation for rainbow effects */
@keyframes rotate-border {
    0% {
        background-position: 0% 0%;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    }

    25% {
        box-shadow: 0 0 15px rgba(138, 43, 226, 0.3);
    }

    50% {
        background-position: 100% 100%;
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    }

    75% {
        box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    }

    100% {
        background-position: 0% 0%;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    }
}

/* Special h2 heading without bottom border */
h2.no-border {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    margin: 30px 0 20px;
    border-bottom: none;
    font-variant: small-caps !important;
}

.lore-content-text h2 {
    font-family: var(--font-display);
    color: var(--color-gold);
    font-size: 1.7em !important;
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-purple-light);
    font-variant: small-caps !important;
}

.lore-content-text h3 {
    font-family: var(--font-display);
    color: var(--color-gold);
    font-size: 1.4em !important;
    font-variant: small-caps !important;
    margin: 25px 0 12px;
}

.lore-content-text h4 {
    font-family: var(--font-display);
    color: var(--color-gold);
    font-size: 1.2em !important;
    margin: 20px 0 10px;
}


.lore-content-text h2.no-border {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    font-variant: small-caps !important;
}


.lore-content-text p {
    margin: 1.2em 0;
    line-height: 1.6;
    font-size: 1.05rem;
}

.lore-content-text p+p {
    margin-top: 1.5em;
    text-indent: 0;
}

.lore-content-text h2 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-variant: small-caps !important;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 1.8rem 0 1.2rem;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    letter-spacing: 0.05em;
}

.lore-content-text h1+p,
.lore-content-text h2+p,
.lore-content-text h3+p {
    margin-top: 1.2em;
}

/* Handle TinyMCE-generated paragraphs with inline styles */
.lore-content-text p[style] {
    margin: 1.2em 0 !important;
    display: block !important;
}

/* Fix <br> tag behavior */
.lore-content-text br {
    display: block;
    content: "";
    margin-top: 0.5em;
}

/* Only clear floats when explicitly needed with these utility classes */
.lore-content-text .clear-floats {
    clear: both;
    display: block;
    width: 100%;
}

/* For cases where you need content to appear below the image */
.lore-content-text .below-image {
    clear: both;
}


/* Enhanced hover effect for card images - make sure both types are covered */
.category-card:hover .entry-featured-image img,
.entry-card:hover .entry-featured-image img {
    transform: scale(1.05);
    filter: brightness(1.1);
    border-radius: 8px;
}

/* Card hover animations with gold glow */
.entry-card:hover,
.category-card:hover {
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.6), 0 0 10px rgba(212, 175, 55, 0.4) inset;
    transform: translateY(-5px);
    border-color: var(--color-gold);
    outline: 1px solid var(--color-gold);
    outline-offset: -1px;
}

/* Animation override for repeated navigation */
.lore-nav a.active.no-animation {
    animation: none !important;
    transition: none !important;
}

/* Make sure category items still appear active even with no animation */
.lore-nav a.active.no-animation {
    color: var(--color-purple) !important;
    background-color: var(--color-purple-light-alt) !important;
    font-weight: 600 !important;
}

/* CONSOLIDATED MOBILE STYLES - All @media (max-width: 768px) rules */
@media (max-width: 768px) {

    /* Header and layout adjustments */
    header {
        flex-direction: column;
        align-items: center;
        padding: 10px;
        text-align: center;
        padding-bottom: 20px;
    }

    /* Container layout */
    .lore-container {
        flex-direction: column;
        width: 95% !important;
        max-width: 95% !important;
        padding: 0;
    }

    /* Featured images */
    .featured-image-container {
        max-width: 100%;
        width: 100%;
        float: none;
        margin: 0 0 20px 0;
        border-radius: 10px;
    }

    /* Sidebar column positioning */
    .sidebar-column {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 25px;
        z-index: 1;
        /* Lower z-index to allow content to slide over */
    }

    /* Logo styling for mobile */
    .logo-container {
        margin-bottom: 15px;
        max-width: 250px !important;
        width: 90%;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        padding-left: 0 !important;
        order: 1;
        position: relative;
        top: 0;
        transform: none;
        z-index: 2;
    }

    .logo-image {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Navigation adjustments */
    .main-nav {
        width: 100%;
        order: 2;
        margin-bottom: 15px;
        flex-direction: column;
    }

    /* Sidebar styling for mobile - allow full height without scrolling */
    .lore-sidebar {
        position: relative;
        top: 0;
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
        max-height: none !important;
        /* Remove height restriction */
        overflow-y: visible !important;
        /* No scrolling needed */
        order: 3;
        padding: 20px !important;
        height: auto !important;
        border-radius: 20px !important;
        box-shadow: 0 0 15px rgba(76, 47, 117, 0.5) !important;
    }

    /* Main content styling for mobile with overlay effect */
    .lore-content {
        width: 100%;
        max-width: 100%;
        padding: 20px !important;
        border-radius: 20px !important;
        position: relative;
        z-index: 5;
        /* Higher z-index to slide over sidebar */
        margin-top: -15px;
        /* Create slight overlap for sliding effect */
        box-shadow: 0 -10px 15px rgba(0, 0, 0, 0.2) !important;
        /* Enhanced shadow for depth */
    }

    /* Grid layouts for mobile */
    .category-list,
    .related-list {
        grid-template-columns: 1fr;
        /* 1 column for mobile */
    }
}

/* Mobile fixes for logo size and layout */
@media (max-width: 768px) {

    /* Fix for sidebar rounded corners */
    .lore-sidebar {
        border-radius: 20px !important;
        padding: 20px !important;
        max-height: none !important;
        /* Remove height restriction */
        overflow-y: visible !important;
        /* No scrolling needed */
        height: auto !important;
    }

    /* Improved logo size */
    .logo-container {
        max-width: 250px !important;
        width: 90% !important;
    }

    .logo-image {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Add space between sidebar and content */
    .sidebar-column {
        margin-bottom: 30px !important;
        z-index: 1 !important;
    }

    /* Main content styling for overlay effect */
    .lore-content {
        margin-top: -15px !important;
        z-index: 5 !important;
        box-shadow: 0 -10px 15px rgba(0, 0, 0, 0.2) !important;
        border-radius: 20px !important;
    }

    /* Make container wider */
    .lore-container {
        width: 95% !important;
        max-width: 95% !important;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
        padding-bottom: 20px;
    }

    .lore-container {
        flex-direction: column;
        width: 95% !important;
        max-width: 95% !important;
        padding: 0;
    }

    .sidebar-column {
        width: 100%;
        margin-bottom: 30px;
        /* Increased from 20px for more space */
        position: relative;
        /* Remove sticky position on mobile */
        top: 0;
        max-height: none;
    }

    .logo-container {
        margin-bottom: 15px;
        max-width: 250px !important;
        /* Increased from 150px */
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        padding-left: 0 !important;
        order: 1;
    }

    .logo-image {
        width: 100% !important;
        /* Ensure image fills the container */
        max-width: 100% !important;
    }

    .main-nav {
        width: 100%;
        order: 2;
        margin-bottom: 15px;
    }

    .lore-sidebar {
        position: relative;
        top: 0;
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
        max-height: 400px;
        /* Set a specific max height for scrolling */
        overflow-y: auto;
        /* Enable scrolling */
        order: 3;
        padding: 20px !important;
        border-radius: 20px !important;
        /* Ensure rounded corners */
        box-shadow: 0 0 15px rgba(76, 47, 117, 0.5) !important;
    }

    .lore-content {
        width: 100%;
        max-width: 100%;
        padding: 20px !important;
        border-radius: 20px !important;
        /* Ensure rounded corners */
        position: relative;
        z-index: 5;
        /* Add z-index for sliding on top effect */
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {

    .scroll-top,
    .chat-button {
        width: 40px;
        height: 40px;
    }

    .scroll-top {
        bottom: 75px;
        right: 15px;
    }

    .chat-button {
        bottom: 20px;
        right: 15px;
    }
}

/* Responsive adjustments for related list */
@media (max-width: 1200px) {
    .related-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        /* 2 columns for medium screens */
    }
}

@media (max-width: 768px) {
    .related-list {
        grid-template-columns: 1fr;
        /* 1 column for mobile */
    }
}

@media (max-width: 768px) {
    .category-list {
        grid-template-columns: 1fr;
        /* 1 column for mobile */
    }

    .lore-container {
        flex-direction: column;
        width: 95% !important;
        max-width: 95% !important;
        padding: 0;
    }

    .sidebar-column {
        width: 100%;
        margin-bottom: 30px;
        /* Increased from 20px for more space */
        position: relative;
        /* Remove sticky position on mobile */
        top: 0;
        max-height: none;
    }

    .logo-container {
        margin-bottom: 15px;
        max-width: 250px !important;
        /* Increased from 150px */
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        padding-left: 0 !important;
        order: 1;
    }

    .logo-image {
        width: 100% !important;
        /* Ensure image fills the container */
        max-width: 100% !important;
    }

    .main-nav {
        width: 100%;
        order: 2;
        margin-bottom: 15px;
    }

    .lore-sidebar {
        position: relative;
        top: 0;
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
        max-height: 400px;
        /* Set a specific max height for scrolling */
        overflow-y: auto;
        /* Enable scrolling */
        order: 3;
        padding: 20px !important;
        border-radius: 20px !important;
        /* Ensure rounded corners */
        box-shadow: 0 0 15px rgba(76, 47, 117, 0.5) !important;
    }

    .lore-content {
        width: 100%;
        max-width: 100%;
        padding: 20px !important;
        border-radius: 20px !important;
        /* Ensure rounded corners */
        position: relative;
        z-index: 5;
        /* Add z-index for sliding on top effect */
    }
}

@media (max-width: 768px) {
    header {
        padding: 10px;
        text-align: center;
    }

    .lore-container {
        flex-direction: column;
        padding: 0;
        width: 95%;
        /* Expand container width on mobile */
        max-width: 95%;
    }

    .sidebar-column {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        position: relative;
    }

    .logo-container {
        position: relative;
        top: 0;
        transform: none;
        z-index: 2;
        text-align: center;
        margin: 0 auto 15px;
        width: 80%;
        /* Increase logo container width */
    }

    .logo-image {
        max-width: 250px;
        /* Make the logo bigger on mobile */
        width: 80%;
    }

    .main-nav {
        flex-direction: column;
        margin-bottom: 1rem;
    }

    .lore-sidebar {
        padding: 0;
        height: auto;
        max-height: 400px;
        width: 100%;
        border-radius: 10px;
        margin-bottom: 20px;
        overflow-y: auto;
    }

    .lore-content {
        width: 100%;
        padding: 20px;
    }
}

body.timeline-mode .lore-nav a.active,
body.timeline-mode .lore-nav a.active::before,
body.timeline-mode .lore-nav a.active:after {

    animation: none !important;
}

body.timeline-mode .scroll-top,
body.timeline-mode .chat-button,
body.timeline-mode .chat-frame-container {
    display: none !important;
}

.lore-footer {
    flex-shrink: 0;
    width: 100%;
    text-align: center;
    padding: 18px 0 12px 0;
    /* Remove max-width and margin */
}

.lore-footer a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
    opacity: 0.7;
    /* Remove background, blur, and border */
    border-radius: 12px;
    padding: 8px 22px 7px 22px;
    display: inline-block;
}

.lore-footer a:hover {
    color: var(--color-gold);
    opacity: 1;
    text-decoration: underline;
}

.copyright-blur-bg {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 10, 26, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    pointer-events: auto;
    display: none;
    opacity: 0;
    transition: opacity 0.25s;
}

.copyright-blur-bg.active {
    display: block;
    opacity: 1;
}

.copyright-container {
    z-index: 10001;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    max-width: 700px;
    width: 100vw;
    max-height: 80vh;
    overflow-y: auto;
    background: rgba(15, 10, 26, 0.82);
    border-radius: 18px;
    box-shadow: 0 0 24px 4px #2e1a4d, 0 0 64px 8px #0ff2;
    padding: 2.5rem 2rem 2rem 2rem;
    color: var(--color-text);
    font-family: 'Spectral', serif;
    font-size: 1.08rem;
    line-height: 1.7;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s cubic-bezier(.4, 1.4, .6, 1), transform 0.32s cubic-bezier(.4, 1.4, .6, 1);
}

.copyright-container.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.copyright-container a {
    color: var(--color-gold);
    text-decoration: underline;
    transition: color 0.2s;
    word-break: break-all;
}

.copyright-container a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Hide scrollbar for copyright modal (Webkit browsers) */
.copyright-container::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

/* Hide scrollbar for Firefox */
.copyright-container {
    scrollbar-width: none;
}

@media (max-width: 600px) {
    .copyright-container {
        padding: 1.2rem 0.5rem 1.2rem 0.5rem;
        font-size: 0.98rem;
    }
}

.entry-featured-image {
    aspect-ratio: 16 / 9;
    width: 100%;
    background: #222;
    /* optional, for letterbox effect */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    /* <-- Add this line */
    margin-bottom: 15px;
}

.entry-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #222;
    /* optional, for letterbox effect */
    border-radius: 16px;
    transition: transform 0.4s ease, filter 0.4s ease, border-radius 0.3s ease;
}

.category-card:hover .entry-featured-image img,
.entry-card:hover .entry-featured-image img {
    transform: scale(1.05);
    filter: brightness(1.1);
    border-radius: 16px;
}

/* Lore content text links styled like breadcrumbs */
.lore-content-text a {
    color: var(--color-gold);
    text-decoration: none;
    transition: color 0.2s, text-decoration 0.2s;
    border-radius: 4px;
}

.lore-content-text a:hover {
    color: var(--color-gold);
    text-decoration: underline;
}


.lore-content-text {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sidebar-support-btn {
    display: block;
    margin: 32px auto 0 auto;
    padding: 10px 0;
    width: 100%;
    background: rgba(30, 10, 60, 0.3);
    color: var(--color-gold);
    font-family: 'Spectral', serif;
    font-weight: bold;
    font-size: 1.08rem;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    border: 1.5px solid var(--color-gold);
    box-shadow: 0 0 8px 1.5px #d4af3755;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.sidebar-support-btn:hover {
    background: rgba(30, 10, 60, 0.6);
    color: #fff;
    box-shadow: 0 0 16px 2px #d4af37cc;
    border-color: #fff;
}

/* Responsive horizontal scroll for wide tables */
.lore-table-scroll-x {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 18px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(30, 10, 60, 0.08);
    background: none;
    padding-left: 18px;
    padding-right: 18px;
}

.lore-table-scroll-x table {
    min-width: 600px;
    border-left: none !important;
    border-right: none !important;
}

/* Table column width and uniform th styling */
.lore-content-text table th:first-child,
.lore-content-text table td:first-child {
    width: 30%;
    min-width: 120px;
}

.lore-content-text table th:nth-child(2),
.lore-content-text table td:nth-child(2) {
    width: 70%;
}

.lore-content-text th {
    background: rgba(74, 43, 124, 0.4) !important;
    color: var(--color-gold) !important;
    font-family: 'Cinzel', serif !important;
    font-weight: bold !important;
    font-variant: small-caps !important;
    text-transform: none !important;
}

/* --- Lore Hero Header Parallax Section (namespaced) --- */
.lore-hero-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 2rem 1rem;
    transition: opacity 0.5s, transform 0.5s;
    opacity: calc(1 - 1.2 * var(--scroll, 0));
    transform: translateY(calc(-60px * var(--scroll, 0)));
    pointer-events: auto;
}

.content-container {
    margin-top: 100vh;
    position: relative;
    z-index: 3;
}

.lore-hero-header.-scrolled {
    pointer-events: none;
    /* disables pointer events when fully scrolled out */
}

.lore-hero-logo-container {
    max-width: 450px;
    margin: 0 auto 2rem;
    position: relative;
    order: 1;
    transition: transform 0.5s cubic-bezier(.5, 0, .5, 1);
    transform: scale(calc(1 - 0.25 * var(--scroll, 0)));
}

.lore-hero-logo-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.15), transparent 70%);
    animation: lore-hero-pulse-glow 3s infinite alternate ease-in-out;
    z-index: -1;
    border-radius: 50%;
}

@keyframes lore-hero-pulse-glow {
    0% {
        opacity: 0.3;
        transform: scale(0.95);
    }

    100% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

.lore-hero-logo-image {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
}

.lore-hero-main-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 0 0 2rem;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
    z-index: 10;
    order: 2;
}

.lore-hero-nav-link {
    background: #0c0c18cc !important;
    color: #7742c2 !important;
    border: 1.5px solid #7742c2 !important;
    border-radius: 20px !important;
    padding: 0.5rem 1.2rem !important;
    font-family: 'Cinzel', serif !important;
    font-weight: 600 !important;
    letter-spacing: 0.03em !important;
    font-size: 1.1rem !important;
    box-shadow: none !important;
    transition: all 0.25s !important;
    text-decoration: none !important;
    animation: none !important;
    display: inline-block;
}

.lore-hero-nav-link:hover,
.lore-hero-nav-link.active {
    background: #7742c2 !important;
    color: #fff !important;
    box-shadow: 0 0 6px 1.5px #7742c2 !important;
    border-color: #7742c2 !important;
    font-weight: bold !important;
}

.lore-hero-content {
    max-width: 800px;
    text-align: center;
    position: relative;
    z-index: 2;
    animation: lore-hero-fade-in 1.5s ease-out;
    order: 3;
    display: flex;
    flex-direction: column;
}

@keyframes lore-hero-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lore-hero-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2.5rem;
    max-width: 800px;
    position: relative;
    padding: 1.5rem;
    background: rgba(15, 10, 26, 0.85);
    border-radius: 15px;
    border: 1.5px solid var(--color-purple-dark);
    box-shadow: 0 0 20px rgba(74, 43, 124, 0.3);
    text-align: center;
    order: 1;
    transition: opacity 0.5s, transform 0.5s;
    opacity: calc(1 - 1.5 * var(--scroll, 0));
    transform: translateY(calc(-30px * var(--scroll, 0)));
}

.lore-hero-tagline {
    font-family: var(--font-medieval);
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    color: var(--color-purple-light);
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(151, 114, 251, 0.5);
    position: relative;
    letter-spacing: 0.04em;
    font-variant: small-caps;
    transition: opacity 0.5s, transform 0.5s;
    opacity: calc(1 - 2 * var(--scroll, 0));
    transform: translateY(calc(-40px * var(--scroll, 0)));
}

.lore-hero-tagline::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-purple-light), transparent);
}

@media (max-width: 1200px) {
    .lore-hero-lamp-post {
        left: -8%;
        transform: translateY(-50%) scale(1.3);
    }
}

@media (max-width: 768px) {
    .lore-hero-header {
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 2rem;
    }

    .lore-hero-logo-container {
        order: 1;
        max-width: 350px;
        margin-bottom: 1.5rem;
    }

    .lore-hero-main-nav {
        order: 2;
        margin-bottom: 2rem;
    }

    .lore-hero-content {
        order: 3;
    }

    .lore-hero-tagline {
        font-size: 1.6rem;
    }

    .lore-hero-description {
        padding: 1.2rem;
    }

    .lore-hero-lamp-post {
        display: none;
    }
}

@media (max-width: 480px) {
    .lore-hero-header {
        padding-top: 1.5rem;
        justify-content: flex-start;
    }

    .lore-hero-logo-container {
        max-width: 280px;
        margin-bottom: 1rem;
    }

    .lore-hero-main-nav {
        margin-bottom: 1.5rem;
    }

    .lore-hero-tagline {
        font-size: 1.3rem;
    }

    .lore-hero-description {
        font-size: 1rem;
        padding: 1rem;
    }
}

.lore-hero-background-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/fantasy-harbor.webp');
    background-size: cover;
    background-position: center;
    filter: blur(8px) brightness(0.6);
    z-index: -1;
    pointer-events: none;
}

.no-webp .lore-hero-background-container {
    background-image: url('../images/fantasy-harbor.jpg');
}

.lore-hero-background-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(74, 43, 124, 0.6), rgba(15, 10, 26, 0.8));
    z-index: 1;
}

.lore-hero-lamp-post-picture {
    position: absolute;
    top: 0;
    left: -5%;
    z-index: 0;
    pointer-events: none;
}

.lore-hero-lamp-post {
    position: absolute;
    top: 100%;
    left: -15%;
    transform: translateY(0%) scale(1.5);
    height: 100vh;
    width: auto;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
    filter: blur(1px) brightness(0.7);
    transition: opacity 0.5s ease;
    max-width: none;
    animation: lore-hero-lamp-sway 12s ease-in-out infinite alternate;
}

@keyframes lore-hero-lamp-sway {
    0% {
        transform: translateY(0%) scale(1.5) rotate(0deg);
    }

    100% {
        transform: translateY(0%) scale(1.5) rotate(0.5deg);
    }
}

@media (max-width: 1200px) {
    .lore-hero-lamp-post {
        left: -20%;
        top: 100%;
        transform: translateY(0%) scale(1.3);
    }
}

@media (max-width: 768px) {
    .lore-hero-lamp-post {
        display: none;
    }
}

/* Lore Home Intro Styles (scoped for lore.php home only) */
.lore-page .lore-home-intro {
    max-width: 800px;
    margin: 0 auto 2.5rem auto;
    text-align: center;
    position: relative;
    z-index: 2;
    background: rgba(15, 10, 26, 0.85);
    border-radius: 15px;
    border: 1.5px solid var(--color-purple-dark);
    box-shadow: 0 0 20px rgba(74, 43, 124, 0.3);
    padding: 1.5rem 1.5rem 2.5rem 1.5rem;
}

.lore-page .lore-home-intro p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text);
}

.lore-page .lore-home-intro p:last-child {
    margin-bottom: 0;
}

.lore-page .lore-home-intro .hero-tagline {
    font-family: var(--font-medieval);
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    color: var(--color-purple-light);
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(151, 114, 251, 0.5);
    position: relative;
    letter-spacing: 0.04em;
    font-variant: small-caps;
}

.lore-page .lore-home-intro .hero-tagline::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-purple-light), transparent);
}

.lore-page .adventure-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 4rem;
    padding-bottom: 3rem;
    position: relative;
    z-index: 5;
}

.lore-page .adventure-button-container {
    position: relative;
}

.lore-page .signup-section {
    float: none;
    width: 100%;
    box-sizing: border-box;
    padding: 30px 25px 0 25px;
    margin: 20px auto;
    background: rgba(15, 10, 26, 0.7);
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 20px rgba(74, 43, 124, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
    min-height: 0;
    padding-top: 18px;
}

.lore-page .signup-section .signup-description {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.5;
    max-width: 80%;
    color: var(--color-blue);
}

.lore-page .signup-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 1rem;
    max-width: 500px;
    width: 80%;
}

.lore-page .signup-input {
    border: 1px solid #7742c2 !important;
    box-shadow: 0 0 15px rgba(119, 66, 194, 0.3), 0 0 5px rgba(119, 66, 194, 0.2) inset !important;
    outline: none !important;
    padding: 10px 15px !important;
    border-radius: 20px !important;
    background: rgba(15, 10, 26, 0.7) !important;
    color: var(--color-text) !important;
    font-family: 'Spectral', serif !important;
    font-size: 14px !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
}

.lore-page .signup-input:focus {
    background: rgba(15, 10, 26, 0.85);
    background-image: linear-gradient(125deg, rgba(100, 50, 150, 0.05) 0%, rgba(15, 10, 26, 0) 40%, rgba(119, 66, 194, 0.08) 65%, rgba(15, 10, 26, 0) 100%);
    background-size: 250% 100%;
    animation: cosmicShimmer 4s ease infinite;
}

.lore-page .signup-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.lore-page .signup-button {
    background: #0c0c18cc !important;
    color: #7742c2 !important;
    border: 1.5px solid #7742c2 !important;
    border-radius: 20px !important;
    padding: 10px 18px !important;
    font-family: 'Cinzel', serif !important;
    font-weight: 600 !important;
    letter-spacing: 0.03em !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s !important;
    text-decoration: none !important;
    animation: none !important;
    display: inline-block;
    height: auto !important;
    min-height: unset !important;
    box-sizing: border-box !important;
    cursor: pointer;
}

.lore-page .signup-button:hover,
.lore-page .signup-button:active {
    background: transparent !important;
    color: #7742c2 !important;
    border-color: #7742c2 !important;
    box-shadow: 0 0 16px 2px #7742c2cc, 0 0 32px 4px #7742c288 !important;
    font-weight: bold !important;
    transition: box-shadow 0.2s, border-color 0.2s, color 0.2s;
}

.lore-page .signup-message {
    margin-top: 0.8rem;
    font-family: var(--font-body);
    min-height: 24px;
    font-size: 0.98rem;
    width: 80%;
    max-width: 500px;
    text-align: center;
    color: var(--color-gold);
    text-shadow: 0 0 2px var(--color-gold);
}

.lore-page .signup-success {
    color: var(--color-gold);
}

.lore-page .signup-error {
    color: #ff6b6b;
}

/* Responsive adjustments for lore home intro */
@media (max-width: 768px) {
    .lore-page .lore-home-intro {
        padding: 1.2rem 0.5rem 2rem 0.5rem;
    }

    .lore-page .lore-home-intro .hero-tagline {
        font-size: 1.6rem;
    }

    .lore-page .signup-form {
        flex-direction: column;
        width: 90%;
        max-width: 350px;
    }

    .lore-page .signup-input {
        width: 100% !important;
        height: 50px !important;
        font-size: 16px !important;
        padding: 12px 20px !important;
        margin-bottom: 10px;
        min-width: 250px !important;
        box-shadow: 0 0 5px rgba(74, 43, 124, 0.5) !important;
    }

    .lore-page .signup-button {
        width: auto !important;
        min-width: 120px !important;
        height: auto !important;
        font-size: 16px !important;
        padding: 10px 25px !important;
        margin-top: 5px;
        align-self: center;
    }

    .lore-page .signup-description,
    .lore-page .signup-message {
        width: 90%;
        max-width: 100%;
    }

    .lore-page .cta-button,
    .lore-page .adventure-button {
        padding: 12px 30px;
        font-size: 1.1rem;
    }

    .lore-page .adventure-button {
        font-size: 1rem !important;
        padding: 0.5rem 1rem !important;
    }
}

@media (max-width: 480px) {
    .lore-page .lore-home-intro .hero-tagline {
        font-size: 1.3rem;
    }

    .lore-page .signup-title {
        font-size: 1.2rem;
    }

    .lore-page .signup-form {
        gap: 12px;
        width: 94%;
        align-items: center;
    }

    .lore-page .signup-input {
        height: 50px !important;
        font-size: 16px !important;
        padding: 12px 20px !important;
        width: 100% !important;
        min-width: 100% !important;
        box-sizing: border-box !important;
    }

    .lore-page .signup-button {
        height: auto !important;
        padding: 10px 25px !important;
        width: auto !important;
        min-width: 120px !important;
        box-sizing: border-box !important;
        font-size: 1rem !important;
    }
}

/* --- LOGIN/LOGGED-IN GREETING & BUTTONS LAYOUT --- */
@media (max-width: 768px) {

    /* Container for login/logout area */
    div[style*='display:flex; justify-content:flex-end'] {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        margin-bottom: 16px !important;
        width: 100% !important;
    }

    /* Greeting row: keep greeting on one line, buttons below */
    div[style*='color:var(--color-gold); font-weight:600; font-size:1.13rem'] {
        display: block !important;
        text-align: center !important;
        margin-right: 0 !important;
        margin-bottom: 8px;
        width: 100%;
    }

    /* Buttons row: stack vertically, center, full width */
    div[style*='color:var(--color-gold); font-weight:600; font-size:1.13rem'] a {
        display: block !important;
        width: 100% !important;
        margin: 6px 0 0 0 !important;
        text-align: center !important;
    }

    /* Login form: stack vertically */
    div[style*='display:flex; justify-content:flex-end'] form {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100%;
    }

    /* Login/Signup buttons: center text */
    div[style*='display:flex; justify-content:flex-end'] button,
    div[style*='display:flex; justify-content:flex-end'] a {
        text-align: center !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .signup-button,
    .login-input[type='submit'],
    button.signup-button {
        text-align: center !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        display: flex !important;
    }

    /* Login form: make buttons full width and stack vertically */
    div[style*='display:flex; justify-content:flex-end'] form {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100%;
    }

    div[style*='display:flex; justify-content:flex-end'] form input.login-input,
    div[style*='display:flex; justify-content:flex-end'] form button,
    div[style*='display:flex; justify-content:flex-end'] form a {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
        display: block !important;
        margin: 0 0 8px 0 !important;
        text-align: center !important;
    }

    /* Logged-in: stack greeting and buttons, buttons full width */
    div[style*='color:var(--color-gold); font-weight:600; font-size:1.13rem'] {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: center !important;
        margin-right: 0 !important;
        margin-bottom: 8px;
        width: 100%;
        gap: 0;
    }

    div[style*='color:var(--color-gold); font-weight:600; font-size:1.13rem'] a {
        display: block !important;
        width: 100% !important;
        margin: 6px 0 0 0 !important;
        text-align: center !important;
        box-sizing: border-box;
    }
}

.sidebar-dropdown-list {
    list-style: none;
    margin: 0;
    padding-left: 18px;
    /* or whatever you want for indentation */
}

.sidebar-dropdown-list li {
    margin-bottom: 0;
}

.footer-wrapper {
    margin-left: 270px;
    width: calc(100% - 270px);
}

.lore-footer {
    text-align: center;
    padding: 18px 0 12px 0;
}

@media (max-width: 768px) {
    .footer-wrapper {
        margin-left: 0;
        width: 100%;
    }
}

.adventure-signup-flex {
    display: block;
    margin: 36px 0 36px 0;
}

.adventure-signup-image {
    width: 100%;
    max-width: 500px;
    float: left;
    margin: 0 24px 18px 0;
    border-radius: 15px;
    /* box-shadow: 0 5px 15px rgba(0,0,0,0.5); */
    /* Remove this line */
}

.adventure-signup-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    /* Remove border-radius and box-shadow here */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.adventure-signup-content {
    overflow: hidden;
}

@media (max-width: 768px) {
    .adventure-signup-flex {
        display: flex;
        flex-direction: column;
        gap: 24px;
        align-items: stretch;
    }

    .adventure-signup-image {
        float: none;
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 0;
    }

    .adventure-signup-content {
        overflow: visible;
    }
}

.lore-content-text .below-image,
.lore-header-inner .below-image,
.below-image {
    clear: both;
    display: block;
}

.lore-page .signup-button:hover,
.lore-page .signup-button:active,
.lore-page .adventure-button:hover,
.lore-page .adventure-button:active {
    background: transparent !important;
    color: #7742c2 !important;
    border-color: #7742c2 !important;
    box-shadow: 0 0 16px 2px #7742c2cc, 0 0 32px 4px #7742c288 !important;
    font-weight: bold !important;
    transition: box-shadow 0.2s, border-color 0.2s, color 0.2s;
}

/* For square images in the adventure signup area */
.adventure-signup-image-square {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1/1;
    float: left;
    margin: 0 24px 18px 0;
    border-radius: 15px;
}

.adventure-signup-image-square img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.signup-left-col {
    float: left;
    width: 500px;
    max-width: 40%;
    margin: 0 2.2em 1.2em 0;
}

.signup-float-left {
    width: 100%;
    display: block;
    margin-bottom: 1em;
    border-radius: 18px;
    box-shadow: 0 4px 24px #0004;
}

.streaming-float-right {
    float: right;
    width: 500px;
    max-width: 40%;
    margin: 1.2em 0 0 2.2em;
    border-radius: 18px;
    box-shadow: 0 4px 24px #0004;
}

@media (max-width: 768px) {

    .signup-left-col,
    .streaming-float-right {
        float: none;
        display: block;
        margin: 0 auto 1.2em auto;
        max-width: 90%;
    }
}

/* --- Cast Section Personal Profile Styles --- */
.cast-section {
    width: 100%;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    max-width: none;
    box-shadow: 0 8px 32px 0 #1e0a3c33;
    background: rgba(30, 10, 60, 0.7);
    border-radius: 22px;
}

.cast-profiles {
    display: flex;
    flex-wrap: wrap;
    gap: 36px;
    justify-content: center;
    margin-top: 32px;
}

.cast-profile-card {
    background: rgba(15, 10, 26, 0.6);
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    padding: 32px 24px;
    max-width: 320px;
    min-width: 220px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(151, 114, 251, 0.3);
    position: relative;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.cast-profile-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(151, 114, 251, 0.3);
    border-color: var(--color-gold);
    background: rgba(30, 10, 60, 0.75);
}

.cast-profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 0;
}

.cast-profile-avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-gold);
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    position: relative;
    z-index: 1;
    transition: transform 0.4s ease, border-color 0.4s ease;
}

.cast-profile-card:hover .cast-profile-avatar {
    transform: scale(1.05);
    border-color: #fff;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.6);
}

.cast-profile-name {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 1.5rem;
    margin-bottom: 6px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cast-profile-character {
    color: var(--cast-accent, var(--color-gold));
    font-size: 1.15rem;
    /* Slight increase for readability */
    margin-bottom: 2px;
    /* Pull closer to race/class line */
    font-weight: bold;
    font-variant: small-caps;
    font-family: 'Spectral', serif;
    position: relative;
    z-index: 1;
    letter-spacing: 0.5px;
}

.cast-profile-bio {
    color: #e0d6ff;
    font-size: 1rem;
    margin-bottom: 24px;
    font-family: 'Spectral', serif;
    line-height: 1.6;
    border-left: none;
    /* Removed border */
    padding: 0 10px;
    /* Centered layout preference */
    text-align: center;
    min-height: 60px;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.cast-profile-twitch {
    display: inline-block;
    background: rgba(30, 20, 50, 0.6);
    color: var(--cast-accent, var(--color-gold));
    font-family: 'Cinzel', serif;
    font-weight: 600;
    border-radius: 50px;
    /* Pill shape */
    padding: 8px 24px;
    text-decoration: none;
    font-size: 0.95rem;
    margin-top: auto;
    /* Push to bottom if flex container grows */
    transition: all 0.3s ease;
    border: 1px solid var(--cast-accent, var(--color-gold));
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 1px;

    /* Disable clicks by default so clicking the button just opens the card */
    pointer-events: none;
}

.cast-profile-twitch:hover {
    background: var(--cast-accent, var(--color-gold));
    color: #1e0a3c;
    box-shadow: 0 0 15px var(--cast-accent, rgba(212, 175, 55, 0.5));
    transform: translateY(-2px);
}

@media (max-width: 900px) {
    .cast-profiles {
        flex-direction: column;
        align-items: center;
    }
}

/* Removed flex helper classes */

/* Old DM styles removed here as they are integrated above */

@media (max-width: 1100px) {
    .cast-flex-container {
        flex-direction: column;
        align-items: stretch;
        gap: 32px;
    }

    .cast-flex-dm {
        max-width: 100%;
        min-width: 0;
    }
}

/* --- Fanned Cast Layout (Desktop) --- */
.cast-grid-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 600px;
    /* Specific height for the fan area */
    width: 100%;
    max-width: 1400px;
    margin: 40px auto 0 auto;
    /* Reduced margin to pull up closer */
    padding: 0;
    position: relative;
    perspective: 1000px;
}

.cast-profile-card {
    position: relative;
    width: 260px;
    /* Default compressed width */
    height: 380px;
    /* Fixed height for consistency */
    background: rgba(15, 10, 26, 0.7);
    /* Slightly more transparent when stacked */
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    /* Slower, fluid transition */
    margin-right: -130px;
    /* profound negative margin for overlap */
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    /* Shadow on the left edge */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--cast-accent, rgba(255, 215, 0, 0.15));
    /* Use accent or subtle default */
    /* Subtle border */
    overflow: hidden;
    /* Hide content until expanded */
    cursor: pointer;
    transform-origin: bottom center;
}

/* Ensure the last card doesn't need negative margin if we want to center the fan perfectly, 
   but simplistic negative margin works well for "hand" look. 
   We'll add a spacer or padding to container if needed, but centering flex works. */

/* Content visibility states */
/* Content visibility states */
.cast-profile-card .cast-profile-bio,
.cast-profile-card .cast-profile-twitch,
.cast-profile-card .cast-profile-bio,
.cast-profile-card .cast-profile-twitch,
.cast-profile-card .cast-profile-character,
.cast-profile-card .cast-profile-race-class {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    /* Slower content reveal */
    height: 0;
    /* Collapse height to compress card */
    margin: 0;
    overflow: hidden;
}

/* Always show Name and Avatar */
.cast-profile-card .cast-profile-name {
    font-size: 1.1rem;
    /* Smaller default */
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    color: var(--color-gold);
    /* Keep names gold */
}

.cast-profile-card .cast-profile-avatar {
    width: 100px;
    height: 100px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    border-width: 2px;
    border-color: var(--cast-accent, var(--color-gold));
}

/* --- The Fan Rotations (Assume ~7 cards) --- */
/* DM is 1st */
.cast-grid-container .cast-profile-card:nth-child(1) {
    transform: rotate(-25deg) translateY(40px);
    z-index: 1;
}

.cast-grid-container .cast-profile-card:nth-child(2) {
    transform: rotate(-15deg) translateY(20px);
    z-index: 2;
}

.cast-grid-container .cast-profile-card:nth-child(3) {
    transform: rotate(-8deg) translateY(5px);
    z-index: 3;
}

.cast-grid-container .cast-profile-card:nth-child(4) {
    transform: rotate(0deg) translateY(0px);
    z-index: 4;
}

.cast-grid-container .cast-profile-card:nth-child(5) {
    transform: rotate(8deg) translateY(5px);
    z-index: 3;
}

.cast-grid-container .cast-profile-card:nth-child(6) {
    transform: rotate(15deg) translateY(20px);
    z-index: 2;
}

.cast-grid-container .cast-profile-card:nth-child(7) {
    transform: rotate(25deg) translateY(40px);
    z-index: 1;
    margin-right: 0;
    /* Reset last margin */
}

/* --- Active State (Clicked) --- */
.cast-profile-card.active {
    /* Main expansion effect */
    transform: translateY(-100px) rotate(0deg) scale(1.15) !important;
    /* Pop up and zoom in */
    z-index: 100 !important;
    /* Bring to very front */

    background: rgba(20, 10, 40, 0.98);
    /* Opaque background */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), 0 0 30px var(--cast-accent, rgba(212, 175, 55, 0.3));
    border-color: var(--cast-accent, var(--color-gold));
    border-radius: 20px;

    /* Allow height to grow for content */
    height: auto;
    min-height: 520px;
    transition-delay: 0s;
    /* Instant reaction to click */
}

/* --- Hover State (Subtle) --- */
.cast-profile-card:not(.active):hover {
    /* z-index removed to prevent stacking jumps */
    border-color: var(--cast-accent, var(--color-gold));
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5), 0 0 15px var(--cast-accent, rgba(212, 175, 55, 0.4));
    background: rgba(30, 20, 50, 0.85);
    /* Slightly lighter */
}

/* Fix margin for hover if possible to avoid overlap issues? 
   Actually with z-index 100, overlapping is fine, it looks like picking a card. */

.cast-profile-card.active .cast-profile-bio,
.cast-profile-card.active .cast-profile-twitch,
.cast-profile-card.active .cast-profile-bio,
.cast-profile-card.active .cast-profile-twitch,
.cast-profile-card.active .cast-profile-character,
.cast-profile-card.active .cast-profile-race-class {
    opacity: 1;
    transform: translateY(0);
    height: auto;
    /* Restore height */
    margin-bottom: 15px;
    /* Restore margins */
    transition-delay: 0.1s;
    /* Slight delay for better feel */
    pointer-events: auto;
    /* Re-enable clicks when active */
}

.cast-profile-card.active .cast-profile-name {
    font-size: 1.3rem;
    /* Slightly smaller scale increase since card is scaling */
    margin-bottom: 10px;
}

.cast-profile-card.active .cast-profile-avatar {
    width: 140px;
    height: 140px;
    border-color: #fff;
    box-shadow: 0 0 25px var(--cast-accent, rgba(212, 175, 55, 0.6));
}

/* DM Specific overrides in fan */
.cast-profile-card.dm {
    /* border-color: var(--color-gold); <--- Removed to allow accent color */
    background: rgba(30, 15, 10, 0.7);
}

.cast-profile-card.dm.active {
    background: rgba(20, 10, 40, 0.98) !important;
    /* Force opaque when active to match others */
}

.cast-profile-card.dm:hover {
    background: rgba(45, 20, 10, 0.95);
}

/* --- Mobile / Tablet Fallback --- */
@media (max-width: 1000px) {
    .cast-grid-container {
        display: flex;
        /* Reset */
        flex-direction: column;
        /* Stack vertically */
        height: auto;
        gap: 30px;
        margin-top: 20px;
        perspective: none;
    }

    .cast-profile-card {
        margin-right: 0;
        width: 100%;
        max-width: 320px;
        height: auto;
        transform: none !important;
        /* Disable rotation on mobile */
        opacity: 1 !important;
        margin-bottom: 20px;
        background: rgba(15, 10, 26, 0.8);
        z-index: 1 !important;
        overflow: visible;
    }

    .cast-grid-container .cast-profile-card:nth-child(n) {
        transform: none !important;
        /* Force reset specific nth-childs */
        z-index: 1;
        margin-right: 0;
    }

    /* Show content always on mobile */
    .cast-profile-card .cast-profile-bio,
    .cast-profile-card .cast-profile-twitch,
    .cast-profile-card .cast-profile-character,
    .cast-profile-card .cast-profile-race-class {
        opacity: 1;
        transform: translateY(0);
        height: auto;
        margin-bottom: 15px;
        overflow: visible;
        pointer-events: auto;
        /* Enable links */
    }

    /* Adjust Class Icons for Mobile (Always visible/active size) */
    .cast-profile-card .cast-class-icons {
        opacity: 1;
        margin-top: 20px;
    }

    .cast-profile-card .class-icon {
        width: 50px;
        height: 50px;
    }

    .cast-profile-card .cast-profile-name {
        font-size: 1.4rem;
    }

    .cast-profile-card .cast-profile-avatar {
        width: 120px;
        height: 120px;
    }

    .cast-profile-card:hover {
        transform: none !important;
        margin-right: 0;
        min-height: 0;
    }
}

.blog-divider {
    height: 0.5px;
    margin: 32px 0;
    border: none;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--color-gold) 20%,
            var(--color-gold) 80%,
            transparent 100%);
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.cast-spoiler-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(15, 10, 26, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    overflow: hidden;
}

.cast-spoiler-message {
    background: rgba(15, 10, 26, 0.88);
    color: var(--color-gold);
    font-family: 'Cinzel', serif;
    font-size: 2.1rem;
    font-weight: bold;
    border-radius: 18px;
    box-shadow: 0 0 24px 4px #1e0a3c88;
    padding: 56px 44px;
    text-align: center;
    border: 2.5px solid var(--color-purple-light);
    letter-spacing: 0.04em;
    line-height: 1.4;
    backdrop-filter: blur(0.5px);
    margin-top: -45vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.cast-spoiler-image {
    display: block;
    margin: 0 auto 24px auto;
    max-width: 180px;
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 2px 12px 0 #1e0a3c55;
}

.cast-spoiler-message .spoiler-tag {
    display: block;
    margin-top: 18px;
    font-size: 1.3rem;
    color: var(--color-purple-light);
    background: rgba(212, 175, 55, 0.13);
    border-radius: 10px;
    padding: 8px 22px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.adventure-btn-center {
    display: flex;
    justify-content: center;
    margin-right: 42%;
    flex-direction: column;
    align-items: center;
}

.adventure-btn-center-txt {
    display: flex;
    justify-content: center;
    margin-right: 42%;
    /* Adjust this to match the width of your floating image */
}

.gold-bullets {
    list-style: disc inside;
}

.gold-bullets li {
    color: inherit;
    /* keep text color normal */
    position: relative;
}

.gold-bullets li::marker {
    color: var(--color-gold, #d4af37);
    /* fallback to gold hex if CSS variable not set */
}

.signup-tagline {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    font-family: var(--font-medieval);
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    color: var(--color-purple-light);
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(151, 114, 251, 0.5);
    letter-spacing: 0.04em;
    font-variant: small-caps;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.signup-section {
    float: none;
    width: 100%;
    box-sizing: border-box;
    padding: 30px 25px 0 25px;
    margin: 20px auto;
    background: rgba(15, 10, 26, 0.7);
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 20px rgba(74, 43, 124, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
    min-height: 0;
    padding-top: 18px;
}

.signup-section .signup-description {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.5;
    max-width: 80%;
    color: var(--color-blue);
}

@media (max-width: 768px) {
    .sidebar-support-btn {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        display: block !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }
}

@media (max-width: 768px) {
    .adventure-btn-center {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    .adventure-btn-center>* {
        margin-left: 0 !important;
        margin-right: 0 !important;
        align-self: center !important;
    }
}

/* Only affect the blog post updates area */
.no-results-container.blog-updates {
    text-align: left !important;
    align-items: stretch;
    padding: 36px 32px 56px 32px;
}

.no-results-container.blog-updates .update-entry {
    display: flex !important;
    align-items: flex-start !important;
    flex-direction: row !important;
    width: 100% !important;
    text-align: left !important;
}

.no-results-container.blog-updates .blog-image-col {
    flex: 0 0 160px !important;
    max-width: 160px !important;
    min-width: 160px !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    align-self: flex-start !important;
}

.no-results-container.blog-updates .blog-image-col img {
    width: 160px;
    height: 160px !important;
    object-fit: cover;
    border-radius: 18px;
    display: block;
    box-shadow: 0 2px 12px 0 #1e0a3c33 !important;
    display: block !important;
    align-self: flex-start !important;
}

.no-results-container.blog-updates .blog-text-col {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    margin-left: 32px !important;
    text-align: left !important;
    align-items: flex-start !important;
}

.no-results-container.blog-updates .blog-title,
.no-results-container.blog-updates .blog-date,
.no-results-container.blog-updates .blog-text-col p {
    text-align: left !important;
    margin: 0 0 8px 0;
}

.no-results-container.blog-updates .read-more-btn {
    color: #fff !important;
    background: rgba(15, 10, 26, 0.7) !important;
    border: 1px solid var(--color-gold) !important;
    border-radius: 12px !important;
    padding: 3px 16px !important;
    font-family: 'Cinzel', serif !important;
    font-size: 0.97rem !important;
    cursor: pointer !important;
    margin-top: 8px !important;
    box-shadow: 0 0 8px 1.5px #d4af3755 !important;
    transition: box-shadow 0.2s, color 0.2s, background 0.2s, border-color 0.2s !important;
}

.no-results-container.blog-updates .read-more-btn:hover {
    background: rgba(30, 10, 60, 0.6) !important;
    color: #fff !important;
    box-shadow: 0 0 16px 2px #d4af37cc !important;
    border-color: #fff !important;
}

@media (max-width: 700px) {
    .no-results-container.blog-updates .update-entry {
        flex-direction: column !important;
    }

    .no-results-container.blog-updates .blog-image-col,
    .no-results-container.blog-updates .blog-image-col img {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        border-radius: 14px !important;
    }

    .no-results-container.blog-updates .blog-text-col {
        margin-left: 0 !important;
    }
}

.no-results-container.blog-updates .update-entry:first-of-type {
    display: flex !important;
    align-items: flex-start !important;
    width: 100% !important;
    text-align: left !important;
}

.no-results-container.blog-updates .update-entry {
    align-items: flex-start !important;
}

.no-results-container.blog-updates .blog-image-col,
.no-results-container.blog-updates .blog-image-col img {
    align-self: flex-start !important;
}

.no-results-container.blog-updates .blog-image-col img {
    box-shadow: none !important;
}

.no-results-container.blog-updates .blog-image-col img,
.no-results-container.blog-updates .blog-image-col img.glow {
    box-shadow: none !important;
    filter: none !important;
}

.no-results-container.blog-updates .update-more-content {
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(.4, 0, .2, 1), opacity 0.4s;
    margin-top: 0;
}

.no-results-container.blog-updates .update-more-content.expanded {
    max-height: 800px;
    /* Should be larger than your largest content */
    opacity: 1;
    margin-top: 10px;
}

/* Mobile: stack image, then text, then button */
@media (max-width: 768px) {
    .no-results-container.blog-updates .update-entry {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .no-results-container.blog-updates .blog-image-col,
    .no-results-container.blog-updates .blog-text-col {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .no-results-container.blog-updates .blog-image-col img {
        display: none !important;
    }
}

@media (max-width: 768px) {

    #signup-form,
    .signup-form {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    #signup-form input,
    #signup-form button,
    .signup-form input,
    .signup-form button {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
}

.user-greeting-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.user-greeting-actions .user-greeting-text {
    margin-bottom: 0;
    display: inline;
}

.user-greeting-actions .user-action-buttons {
    display: flex;
    flex-direction: row;
    gap: 6px;
    margin-top: 0;
}

@media (max-width: 768px) {
    .user-greeting-actions {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }

    .user-greeting-actions .user-greeting-text {
        margin-bottom: 2px;
        display: block;
    }

    .user-greeting-actions .user-action-buttons {
        flex-wrap: wrap;
        width: 100%;
        margin-top: 2px;
    }

    .user-greeting-actions .user-action-buttons a {
        margin-left: 0 !important;
        margin-top: 6px;
        width: auto;
        min-width: 90px;
        text-align: center;
    }
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group.required label:after {
    content: none;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-purple-light);
}

.secondary-label {
    font-size: 0.95rem;
    margin-top: -5px;
    margin-bottom: 10px;
    color: rgba(241, 230, 255, 0.8);
    font-style: italic;
}

.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="number"],
.input-group input[type="date"],
.input-group input[type="time"],
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(15, 10, 26, 0.7);
    border: 1px solid var(--color-purple-dark);
    border-radius: 4px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

.input-group.checkbox {
    display: flex;
    align-items: flex-start;
}

.input-group.checkbox input {
    margin-top: 5px;
    margin-right: 10px;
    min-width: 20px;
    height: 20px;
    appearance: none;
    background-color: rgba(15, 10, 26, 0.7);
    border: 1px solid var(--color-purple-dark);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.input-group.checkbox input:checked {
    background-color: var(--color-purple-dark);
    border-color: var(--color-gold);
}

.input-group.checkbox input:checked:after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-gold);
    font-size: 14px;
}

.input-group.checkbox label {
    display: inline;
    margin-left: 5px;
    font-weight: normal;
    line-height: 1.5;
    color: var(--color-text);
    flex: 1;
}

/* Add new rule for top-level required fields */
.input-group.required>label:first-child:after {
    content: '*';
    color: var(--color-gold);
    margin-left: 5px;
}

/* Ensure asterisk doesn't appear on checkbox or radio labels */
.input-group.checkbox label:after,
.radio-option label:after {
    content: none;
}

/* Save & Restore Button Styles */
.save-button {
    background-color: #896c39;
    margin-right: 10px;
}

.save-button:hover {
    background-color: #a18449;
}

.restore-prompt {
    margin: 15px 0;
    padding: 10px 15px;
    background-color: rgba(28, 24, 33, 0.8);
    border: 1px solid #896c39;
    border-radius: 5px;
}

.restore-prompt p {
    margin: 0;
    font-size: 0.95rem;
}

.restore-prompt button {
    background: rgba(15, 10, 26, 0.7);
    color: var(--color-gold);
    border: 1.5px solid var(--color-gold);
    border-radius: 14px;
    padding: 5px 0;
    font-family: 'Cinzel', serif;
    font-size: 1.08rem;
    font-weight: 400;
    cursor: pointer;
    min-width: 140px;
    text-align: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.restore-prompt button:hover {
    background: var(--color-gold);
    color: #2a1a0a;
    border-color: var(--color-gold);
}

.restore-prompt button:active {
    background: rgba(212, 175, 55, 0.85);
    color: #2a1a0a;
}

/* Save Notification */
.save-notification {
    position: fixed;
    top: 20px;
    right: -300px;
    width: 280px;
    padding: 15px;
    background-color: rgba(28, 24, 33, 0.95);
    color: white;
    border-left: 4px solid #896c39;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    font-family: 'Spectral', serif;
    border-radius: 3px;
}

.save-notification.show {
    right: 20px;
}

/* Error highlighting */
.input-group.error {
    animation: shake 0.5s;
    border-left: 3px solid #e53935;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Form Status Messages */
.form-status-message {
    margin: 20px 0;
    padding: 15px;
    border-radius: 5px;
    font-family: var(--font-body);
}

.form-status-message.submitting {
    background-color: rgba(74, 43, 124, 0.2);
    border: 1px solid var(--color-purple-dark);
    color: var(--color-purple-light);
}

.form-status-message.error {
    background-color: rgba(229, 57, 53, 0.1);
    border: 1px solid #e53935;
    color: #ff8a80;
}

.form-status-message.success {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid #4caf50;
    color: #a5d6a7;
}

.form-status-message p {
    margin: 5px 0;
}

.form-status-message p:first-child {
    font-weight: 600;
}

/* Update submission success styles to match */
.submission-success {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid #4caf50;
    color: #a5d6a7;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
}

.submission-success h3 {
    color: #4caf50;
    font-family: var(--font-medieval);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

/* Rating Scale - Google Forms Style */
.rating-scale {
    margin-top: 15px;
    width: 100%;
}

.rating-headers {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.rating-start {
    flex: 1;
    text-align: right;
    padding-right: 10px;
    font-size: 0.95rem;
    color: var(--color-text);
}

.rating-numbers {
    display: flex;
    justify-content: space-between;
    width: 250px;
    margin: 0 10px;
}

.rating-numbers span {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: var(--color-gold);
}

.rating-end {
    flex: 1;
    text-align: left;
    padding-left: 10px;
    font-size: 0.95rem;
    color: var(--color-text);
}

.rating-options {
    display: flex;
    justify-content: space-between;
    width: 250px;
    margin: 0 auto;
}

.rating-options input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background-color: rgba(15, 10, 26, 0.7);
    border: 2px solid var(--color-purple-dark);
    border-radius: 50%;
    margin: 0;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.rating-options input[type="radio"]:checked {
    background-color: rgba(74, 43, 124, 0.4);
    border-color: var(--color-gold);
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

.rating-options input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: var(--color-gold);
    border-radius: 50%;
}

.rating-options input[type="radio"]:hover {
    border-color: var(--color-purple-light);
    transform: scale(1.05);
}

/* Responsive styling for rating scale */
@media (max-width: 768px) {
    .rating-headers {
        flex-direction: column;
        align-items: flex-start;
    }

    .rating-start,
    .rating-end {
        text-align: left;
        padding: 5px 0;
    }

    .rating-numbers,
    .rating-options {
        width: 100%;
        margin: 5px 0;
    }
}

/* Add edit mode styling */
.edit-mode-message {
    background-color: rgba(151, 111, 207, 0.1);
    border: 1px solid #976fcf;
    color: #c4b3e6;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
}

.edit-mode-message p {
    margin: 0;
}

/* Update success message for edit links */
.submission-success input[type="text"] {
    background: rgba(15, 10, 26, 0.8);
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    font-family: var(--font-body);
    font-size: 0.9rem;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.submission-success input[type="text"]:hover,
.submission-success input[type="text"]:focus {
    background: rgba(15, 10, 26, 0.9);
    border-color: var(--color-purple-light);
    outline: none;
}

/* Ensure asterisk doesn't appear on checkbox or radio labels */
.input-group.checkbox label:after,
.radio-option label:after {
    content: none;
}

/* Radio button styles */
.radio-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.radio-option {
    position: relative;
    width: 100%;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-option label {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    background: rgba(15, 10, 26, 0.7);
    border: 1px solid var(--color-purple-dark);
    border-radius: 4px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked+label {
    background: var(--color-purple-dark);
    border-color: var(--color-gold);
    color: var(--color-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.radio-option label:before {
    content: '';
    width: 16px;
    height: 16px;
    background: rgba(15, 10, 26, 0.7);
    border: 1px solid var(--color-purple-dark);
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked+label:before {
    background: var(--color-gold);
    border-color: var(--color-gold);
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

/* Add style for "Other" text input in radio options */
.radio-option input[type="text"] {
    margin-top: 8px;
    margin-left: 26px;
    width: calc(100% - 26px);
}

/* Hide form sections for multi-page form */
.form-section[data-page]:not([data-page="1"]) {
    display: none;
}

/* Add styles for checkbox groups and error messages */

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.checkbox-group .input-group.checkbox {
    margin-bottom: 0;
    width: 100%;
}

/* Error styles */
.input-group input.invalid,
.input-group textarea.invalid,
.input-group select.invalid,
.radio-options.invalid {
    border-color: #ff6b6b !important;
    box-shadow: 0 0 5px rgba(255, 107, 107, 0.5) !important;
}

.error-message {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: 5px;
}

.error-summary {
    background-color: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.error-summary h4 {
    color: #ff6b6b;
    margin-top: 0;
    margin-bottom: 10px;
}

.error-summary ul {
    margin: 0;
    padding-left: 20px;
}

.submission-error {
    background-color: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Success message */
.success-message {
    background-color: rgba(111, 207, 151, 0.1);
    border: 1px solid #6fcf97;
    color: #6fcf97;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
}

.success-message h3 {
    color: #6fcf97;
    font-family: var(--font-medieval);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

/* Back button styles */
.navigation-button.back-button {
    background-color: rgba(15, 10, 26, 0.7);
}

/* Additional responsive adjustments */
@media (max-width: 768px) {
    .checkbox-group {
        gap: 5px;
    }

    .checkbox-group .input-group.checkbox {
        min-width: auto;
    }
}

.preference-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border: 2px solid var(--color-purple-dark);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.preference-table th,
.preference-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid rgba(74, 43, 124, 0.4);
}

.preference-table th {
    background-color: rgba(74, 43, 124, 0.6);
    font-weight: 600;
    color: var(--color-gold);
    padding: 10px 8px;
    font-family: var(--font-medieval);
    font-size: 0.9rem;
    line-height: 1.3;
}

.preference-table td:first-child {
    text-align: left;
    font-weight: 600;
    min-width: 150px;
    background-color: rgba(74, 43, 124, 0.2);
    color: var(--color-purple-light);
}

.preference-table input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background-color: rgba(15, 10, 26, 0.7);
    border: 2px solid var(--color-purple-dark);
    border-radius: 50%;
    margin: 0 auto;
    display: block;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.preference-table input[type="radio"]:checked {
    background-color: rgba(74, 43, 124, 0.4);
    border-color: var(--color-gold);
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

.preference-table input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: var(--color-gold);
    border-radius: 50%;
}

.preference-table input[type="radio"]:hover {
    border-color: var(--color-purple-light);
    transform: scale(1.05);
}

.preference-table tr:hover {
    background-color: rgba(74, 43, 124, 0.2);
}

@media (max-width: 768px) {
    .preference-table {
        font-size: 0.9rem;
    }

    .preference-table th,
    .preference-table td {
        padding: 6px 4px;
    }

    .preference-table td:first-child {
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .preference-table {
        font-size: 0.8rem;
    }

    .preference-table td:first-child {
        min-width: 80px;
    }

    /* Add responsive styles for preference tables with text in headers */
    .preference-table th {
        font-size: 0.75rem;
        padding: 5px 2px;
        word-break: break-word;
    }
}

/* Save & Restore Button Styles */
.save-button {
    background: rgba(15, 10, 26, 0.7);
    color: var(--color-gold);
    border: 1.5px solid var(--color-gold);
    border-radius: 14px;
    padding: 10px 0;
    font-family: 'Cinzel', serif;
    font-size: 1.08rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 140px;
    text-align: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.save-button:hover {
    background: var(--color-gold);
    color: #2a1a0a;
    border-color: var(--color-gold);
}

.save-button:active {
    background: rgba(212, 175, 55, 0.85);
    color: #2a1a0a;
}

/* Ensure asterisk doesn't appear on checkbox or radio labels */
.input-group.checkbox label:after,
.radio-option label:after {
    content: none;
}

.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(74, 43, 124, 0.6);
}

.navigation-button {
    background: rgba(15, 10, 26, 0.7);
    color: var(--color-gold);
    border: 1.5px solid var(--color-gold);
    border-radius: 14px;
    padding: 10px 0;
    font-family: 'Cinzel', serif;
    font-size: 1.08rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 140px;
    text-align: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    outline: none;
    box-shadow: none;
}

.navigation-button:hover {
    background: var(--color-gold);
    color: #2a1a0a;
    border-color: var(--color-gold);
}

.navigation-button:active {
    background: rgba(212, 175, 55, 0.85);
    color: #2a1a0a;
}

/* --- Class Icons --- */
/* --- Class Icons --- */
.cast-class-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: -40px;
    /* Pull up towards center when inactive (collapsed) */
    z-index: 2;
    position: relative;
    opacity: 0.4;
    /* Faded when inactive */
    transform: translateY(0);
    transition: all 0.4s ease;
}

.class-icon {
    width: 100px;
    height: 100px;
    background-color: var(--cast-accent, var(--color-gold));
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transition: all 0.3s ease;
}

/* Ensure icons are visible even when card is not active */
.cast-profile-card .cast-class-icons {
    /* Override any potential cascading hides if we accidentally matched */
    height: auto;
    overflow: visible;
}

/* When expanded, maybe add a little more space? */
.cast-profile-card.active .cast-class-icons {
    margin-top: 20px;
    /* Restore spacing when active */
    opacity: 1;
    /* Bright and visible */
}

.cast-profile-card.active .class-icon {
    width: 50px;
    height: 50px;
}

/* --- Race/Class Specifics --- */
.cast-profile-race-class {
    color: var(--cast-accent, var(--color-gold));
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    margin-top: 0px;
    /* Gap handled by character margin */
}

.cast-profile-card.active .cast-profile-character {
    margin-bottom: 5px;
    /* Reduce gap to next line */
}

/* --- Cast Section Background --- */
.cast-section-wrapper::before {
    content: "";
    position: absolute;
    top: -20px;
    right: -20px;
    bottom: -20px;
    left: -20px;
    /* Extend slightly to catch blur edges */
    background: url('../images/cast_photos/cast_background.webp') center center / cover no-repeat;
    opacity: 0.3;
    /* Subtle */
    filter: blur(4px);
    z-index: 0;
    pointer-events: none;
    border-radius: 20px;
    /* Soft edges */
}

.cast-section-wrapper .lore-title,
.cast-section-wrapper .cast-section {
    position: relative;
    z-index: 1;
    /* Ensure content sits above background */
}

/* --- Cast Intro Text --- */
.cast-intro-text {
    position: relative;
    z-index: 0;
    /* Lower z-index so cards (z-index 1+) slide over it */
    color: rgba(255, 255, 255, 0.65);
    /* More faded */
    font-family: 'Cinzel', serif;
    font-variant: small-caps;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 10px auto;
    /* Significantly reduced space */
    font-size: 1.6rem;
    line-height: 1.4;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4), 0 0 20px rgba(255, 255, 255, 0.2);
    font-weight: 600;
    pointer-events: none;
    /* Let clicks pass through to cards if they overlap */
}

.cast-intro-text p {
    margin-bottom: 20px;
}

/* --- Hero Section Flex Layout --- */
.hero-section-flex {
    display: flex;
    flex-direction: row;
    align-items: center;
    /* Vertically center content! */
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 30px;
}

.hero-text-content {
    flex: 1;
    text-align: left;
}

.hero-image-content {
    flex: 0 0 40%;
    max-width: 400px;
}

.streaming-image-responsive {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 18px;
    box-shadow: 0 4px 24px #0004;
}

@media (max-width: 900px) {
    .hero-section-flex {
        flex-direction: column-reverse;
        /* Image on top */
        align-items: stretch;
        gap: 20px;
    }

    .hero-image-content {
        flex: auto;
        max-width: 100%;
        margin: 0 auto;
    }
}