/* --- CSS Variables for Easy Theming --- */
:root {
    --bg-parchment: #f4f1ea;
    --bg-dark: #1a1c20;
    --text-dark: #2c2e33;
    --text-light: #f4f1ea;
    --accent-navy: #1e3a5f;
    --accent-gold: #c5a059;
    --accent-red: #8a2be2; /* For magical accents */
    --font-heading: 'Cinzel Decorative', serif;
    --font-body: 'Lato', sans-serif;
}

/* --- Global Reset & Typography --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-parchment);
    color: var(--text-dark);
    font-family: var(--font-body);
    line-height: 1.6;
    /* Subtle parchment texture effect */
    background-image: radial-gradient(#e8e4d9 1px, transparent 1px);
    background-size: 20px 20px;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--accent-navy);
    letter-spacing: 1px;
}

.gold-text { color: var(--accent-gold); }
.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 2rem; }

/* --- Navigation --- */
.main-nav {
    background-color: var(--bg-dark);
    padding: 1rem 0;
    border-bottom: 3px solid var(--accent-gold);
    position: relative;
    z-index: 100;
}

.nav-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 0 2rem;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    z-index: 102;
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: clamp(0.65rem, 0.9vw, 1rem);
    margin: 0 auto;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: normal;
    white-space: nowrap;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-gold);
}

.site-search {
    position: relative;
    flex: 0 0 auto;
    z-index: 103;
}

.site-search-form {
    display: flex;
    align-items: center;
    height: 36px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(197, 160, 89, 0.75);
    border-radius: 20px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.site-search-form:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.3);
}

.site-search-input {
    width: 145px;
    padding: 0 0.75rem;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text-dark);
    font: inherit;
    font-size: 0.9rem;
}

.site-search-input::placeholder { color: #777; }

.site-search-button {
    display: grid;
    width: 36px;
    height: 34px;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-navy);
    cursor: pointer;
}

.site-search-button:hover { color: var(--accent-gold); }

.site-search-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-search-results {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    display: grid;
    width: min(390px, calc(100vw - 2rem));
    max-height: min(70vh, 560px);
    overflow-y: auto;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #d6d1c5;
    border-top: 3px solid var(--accent-gold);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.site-search-results[hidden] { display: none; }

.site-search-status {
    padding: 0.6rem 0.75rem;
    color: #666;
    font-size: 0.85rem;
}

.site-search-result {
    display: grid;
    gap: 0.25rem;
    padding: 0.7rem 0.75rem;
    border-radius: 5px;
    color: var(--text-dark);
    text-decoration: none;
}

.site-search-result:hover,
.site-search-result:focus-visible {
    background: #f4f1ea;
    outline: none;
}

.site-search-result-title {
    color: var(--accent-navy);
    font-weight: 700;
}

.site-search-result-excerpt {
    color: #555;
    font-size: 0.85rem;
    line-height: 1.45;
}

/* --- Campaign Section Navigation --- */
.campaign-nav {
    background: #29313a;
    border-bottom: 1px solid var(--accent-gold);
}

.campaign-nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.campaign-nav-title {
    color: var(--accent-gold);
    font-weight: 700;
    white-space: nowrap;
}

.campaign-nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    list-style: none;
}

.campaign-nav-links a {
    color: var(--text-light);
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
}

.campaign-nav-links a:hover,
.campaign-nav-links a[aria-current="page"] {
    color: var(--accent-gold);
}

/* --- Campaign Directory & Overview Cards --- */
.page-header { text-align: center; margin: 4rem 0 3rem; }
.page-header h1 { font-size: 3rem; margin-bottom: 0.5rem; }
.page-header p { color: #666; font-style: italic; }

.campaign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.campaign-card {
    display: flex;
    flex-direction: column;
    min-height: 230px;
    padding: 2rem;
    background: #fff;
    border: 1px solid #e0dcd0;
    border-top: 5px solid var(--accent-gold);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    color: var(--text-dark);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.campaign-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.campaign-card.current { border-top-color: var(--accent-navy); }

.campaign-status {
    margin-bottom: 0.75rem;
    color: var(--accent-gold);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.campaign-card.current .campaign-status { color: var(--accent-navy); }
.campaign-card-logo {
    display: block;
    width: 100%;
    max-height: 140px;
    object-fit: contain;
    margin: 0.5rem auto 1rem;
    position: relative;
    z-index: 1;
    transform-origin: center center;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s ease;
}
.campaign-card:hover .campaign-card-logo {
    transform: scale(1.1);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.15));
    z-index: 2;
}
.campaign-card-logo:hover {
    transform: scale(1.18);
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.22));
}
.campaign-card h2 { margin: 0 0 0.75rem; color: var(--accent-navy); }
.campaign-card p { line-height: 1.6; }
.campaign-card .campaign-link {
    margin-top: auto;
    padding-top: 1.25rem;
    color: var(--accent-navy);
    font-weight: 700;
}

.section-source {
    margin: -1rem 0 1.5rem;
    text-align: center;
}

.section-source a {
    color: var(--accent-navy);
    font-weight: 700;
    text-decoration-color: var(--accent-gold);
    text-underline-offset: 3px;
}

.log-section a,
.campaign-card p a,
.location-card p a {
    color: var(--accent-navy);
    text-decoration-color: var(--accent-gold);
    text-underline-offset: 2px;
}

.log-section a:hover,
.campaign-card p a:hover,
.location-card p a:hover { color: #0b2540; }

.cliffhanger-box a {
    color: var(--text-light);
    text-decoration-color: var(--accent-gold);
    text-underline-offset: 2px;
}

.cliffhanger-box a:hover { color: var(--accent-gold); }

.status-debuffs a {
    color: inherit;
    text-decoration-color: var(--accent-gold);
    text-underline-offset: 2px;
}

.status-debuffs a:hover { color: var(--accent-gold); }

.log-section h3 a {
    color: inherit;
    text-decoration-color: var(--accent-gold);
    text-underline-offset: 3px;
}

.campaign-empty-state {
    padding: 2rem;
    background: #fff;
    border-left: 5px solid var(--accent-gold);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    line-height: 1.6;
}

/* --- Mobile Navigation Hamburger --- */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
    z-index: 102;
}

.nav-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--accent-gold);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.toggle-open .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.toggle-open .bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.toggle-open .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* --- Hero Section --- */
.hero {
    /* Replace with your group photo */
    background: url('assets/group-photo.jpg') no-repeat;
    /* This is the magic fix: 50% width (center), 15% height (near the top for faces) */
    background-position: 50% 15%; 
    background-size: cover;
    height: clamp(360px, 42vh, 500px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(26,28,32,0.3), rgba(26,28,32,0.9));
}

.hero-content {
    position: relative;
    z-index: 1;
}

.campaign-title {
    font-size: 3.5rem;
    color: var(--text-light);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 0.5rem;
}

.campaign-tagline {
    max-width: 760px;
    margin: 0 auto 1rem;
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.5;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
}

.campaign-subtitle {
    font-size: 1.2rem;
    color: var(--accent-gold);
    font-weight: 700;
    letter-spacing: 2px;
}

/* --- Status Board (Quest Widget) --- */
.status-board { 
    margin-top: -30px; /* Reduced from -50px so it doesn't clip */
    padding-top: 2rem; /* Adds breathing room at the top */
    position: relative; 
    z-index: 2; 
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-gold);
    display: inline-block;
    padding-bottom: 0.5rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* Increased from 220px */
    gap: 1.5rem;
}

.status-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-top: 4px solid var(--accent-navy);
    display: flex;
    flex-direction: column;
}

.status-card.highlight {
    border-top-color: #8b0000; /* Dark red for threats */
}

/* Style the card headings */
.status-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    line-height: 1.3;
}

/* Style the text inside the cards */
.status-card p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-dark);
}

/* --- Breadcrumbs & Session Pagination --- */
.back-nav {
    margin-bottom: 2rem;
}

.back-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-navy);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: color 0.2s, transform 0.2s;
}

.back-nav a:hover {
    color: var(--accent-gold);
    transform: translateX(-4px);
}

.session-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--accent-gold);
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- Latest Session --- */
.latest-session { margin-top: 4rem; }

.memoriam-section {
    margin: 4rem 0;
    text-align: center;
}

.memorial-card {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem;
    background: #f7f4ed;
    border: 1px solid #e0dcd0;
    border-top: 4px solid var(--accent-gold);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.memorial-card p {
    margin: 0;
    color: #555;
    font-style: italic;
    line-height: 1.6;
}

.session-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    align-items: center;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #e0dcd0;
}

.session-layout.text-only { grid-template-columns: 1fr; }

.session-image img {
    width: 100%;
    border-radius: 6px;
    border: 2px solid var(--accent-gold);
}

.session-summary h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.session-summary p { margin-bottom: 1rem; }

.btn {
    display: inline-block;
    background: var(--accent-navy);
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
    transition: background 0.3s;
}

.btn:hover { background: var(--accent-gold); color: var(--bg-dark); }

/* --- Footer --- */
footer {
    background: var(--bg-dark);
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 3px solid var(--accent-gold);
}

/* --- Responsive Design --- */
@media (max-width: 960px) {
    .nav-container { justify-content: space-between; }
    .nav-links { margin: 0; }
    .site-search { margin-left: auto; margin-right: 0.75rem; }
    .site-search-input { width: 100px; }
    .campaign-nav-container { flex-direction: column; gap: 0.5rem; padding: 0.75rem 1rem; }
    .campaign-nav-links { gap: 0.75rem 1rem; }
    .nav-toggle { display: flex; }
    .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-dark);
        padding: 1.5rem 2rem;
        gap: 1.25rem;
        border-bottom: 3px solid var(--accent-gold);
        transform: translateY(-150%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        box-shadow: 0 10px 20px rgba(0,0,0,0.4);
        z-index: 101;
    }
    .nav-links.nav-active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    .campaign-title { font-size: 2.3rem; }
    .session-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .nav-container { gap: 0.5rem; padding: 0 1rem; }
    .logo { font-size: 1rem; }
    .site-search { margin-right: 0.5rem; }
    .site-search-input { width: 68px; padding: 0 0.5rem; font-size: 0.82rem; }
    .site-search-button { width: 30px; }
    .site-search-results {
        position: fixed;
        right: 0.5rem;
        width: min(390px, calc(100vw - 1rem));
    }
}

@media (max-width: 360px) {
    .nav-container { gap: 0.25rem; padding: 0 0.5rem; }
    .logo { font-size: 0.85rem; }
    .site-search { margin-right: 0.25rem; }
    .site-search-input { width: 44px; padding: 0 0.35rem; font-size: 0.78rem; }
    .site-search-button { width: 28px; }
    .nav-toggle { padding: 0.25rem; }
    .nav-toggle .bar { width: 22px; }
}
/* --- Character Codex Styles --- */
.codex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.char-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: var(--text-dark);
    border: 1px solid #e0dcd0;
}

.char-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    border-color: var(--accent-gold);
}

.char-card-img {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: contain;
    background-color: var(--bg-dark);
    padding: 8px;
    box-sizing: border-box;
    border-bottom: 3px solid var(--accent-gold);
}

.char-card-content { padding: 1.5rem; }
.char-card-content h3 { margin-bottom: 0.25rem; font-size: 1.5rem; }
.char-card-content .class-title { color: #777; font-style: italic; font-size: 0.9rem; margin-bottom: 1rem; }
.char-card-content p { font-size: 0.95rem; line-height: 1.5; }

.codex-section { margin-top: 4rem; }
.codex-section .codex-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* --- Individual Character Profile Styles --- */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-top: 3rem;
}

.profile-sidebar {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e0dcd0;
    height: fit-content;
}

.sheet-viewer {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: 8px;
    border: 2px solid var(--accent-gold);
}

.sheet-viewer a {
    display: block;
    cursor: zoom-in;
}

.sheet-viewer img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    transition: opacity 0.2s;
}

.sheet-viewer a:hover img {
    opacity: 0.92;
}

.sheet-hint {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
}

.profile-main h2 {
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.profile-main h2:first-child { margin-top: 0; }

.incident-tracker {
    background: #fff;
    border-left: 5px solid #8b0000;
    padding: 1.5rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.incident-tracker li { margin-bottom: 0.75rem; line-height: 1.6; }

@media (max-width: 768px) {
    .profile-layout { grid-template-columns: 1fr; }
}

/* --- Character Profile Switcher --- */
.char-switcher {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--accent-gold);
    gap: 1rem;
    flex-wrap: wrap;
}

.char-switcher .btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
}

/* --- Lightbox Modal --- */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(10, 12, 16, 0.9);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.lightbox-dialog {
    position: relative;
    z-index: 1001;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image-container {
    overflow: auto;
    max-height: 85vh;
    border: 3px solid var(--accent-gold);
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.7);
    background: #111;
}

.lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -45px;
    right: 0;
    background: transparent;
    border: none;
    color: var(--accent-gold);
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s, color 0.2s;
}

.lightbox-close:hover {
    color: #fff;
    transform: scale(1.15);
}

.lightbox-caption {
    color: var(--text-light);
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-top: 0.75rem;
    text-align: center;
}

/* --- Active Afflictions Tracker (Home) --- */
.affliction-section {
    margin-top: 3.5rem;
}

.affliction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.affliction-card {
    background: #fff;
    padding: 1.25rem;
    border-radius: 8px;
    border-left: 4px solid #8b0000;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.affliction-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.affliction-hero {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--accent-navy);
    margin-bottom: 0.25rem;
}

.affliction-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: bold;
    color: #8b0000;
    background: #ffe6e6;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.affliction-desc {
    font-size: 0.9rem;
    line-height: 1.45;
    color: #444;
}

.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 1.5rem;
}

.location-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 5px solid var(--accent-navy);
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.campaign-illustration {
    max-width: 760px;
    margin: 1.5rem auto;
}

.campaign-illustration a {
    display: block;
}

.campaign-illustration img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #e0dcd0;
    border-radius: 6px;
}

.campaign-illustration figcaption {
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.4;
}

.location-card .campaign-illustration,
.campaign-card .campaign-illustration {
    margin: 1.25rem 0 0;
}

.portrait-illustration {
    max-width: 420px;
    margin-left: 0;
}

.cliffhanger-box .campaign-illustration figcaption {
    color: var(--text-light);
}

.location-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--accent-navy);
}

.location-badge {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--accent-gold);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.location-badge a {
    color: inherit;
    text-decoration-color: rgba(197, 160, 89, 0.55);
    text-underline-offset: 2px;
}

.location-badge a:hover { color: var(--accent-navy); }

.session-appearances {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border-left: 4px solid var(--accent-gold);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.session-appearances h2 {
    margin-bottom: 0.75rem;
    font-size: 1.35rem;
}

.session-appearance-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    list-style: none;
}

.session-appearance-list a {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border: 1px solid #d6d1c5;
    border-radius: 20px;
    color: var(--accent-navy);
    font-size: 0.9rem;
    text-decoration: none;
}

.session-appearance-list a:hover {
    background: var(--accent-navy);
    border-color: var(--accent-navy);
    color: var(--text-light);
}

/* --- Session Loot & Resource Changes Tracking --- */
.session-block {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e0dcd0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 3.5rem;
    overflow: hidden;
}

.session-block-header {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--accent-gold);
    flex-wrap: wrap;
    gap: 1rem;
}

.session-block-header h2 {
    color: var(--text-light);
    margin: 0;
    font-size: 1.5rem;
}

.session-block-header .session-tag {
    background: var(--accent-gold);
    color: var(--bg-dark);
    font-weight: bold;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.session-block-header .session-source-link {
    display: inline-block;
    margin-top: 0.4rem;
    color: var(--accent-gold);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.session-block-header .session-source-link:hover { color: var(--text-light); }

/* Group Summary Roll-up */
.group-summary-box {
    background: #fbf9f4;
    padding: 1.75rem 2rem;
    border-bottom: 2px dashed #e0dcd0;
}

.group-summary-box h3 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--accent-navy);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.25rem;
}

.metric-pill {
    background: #fff;
    padding: 1.1rem 1.25rem;
    border-radius: 8px;
    border-left: 5px solid var(--accent-gold);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.metric-pill.negative { border-left-color: #8b0000; }
.metric-pill.positive { border-left-color: #2e8b57; }
.metric-pill.debt { border-left-color: #dc2626; }

.metric-title {
    font-size: 0.78rem;
    color: #777;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.metric-val {
    font-size: 1.35rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--accent-navy);
    line-height: 1.2;
}

.metric-val .roll-count-suffix {
    font-family: var(--font-body);
    font-size: 0.75em;
}

.metric-pill.negative .metric-val { color: #8b0000; }
.metric-pill.positive .metric-val { color: #2e8b57; }
.metric-pill.debt .metric-val { color: #dc2626; }

.metric-sub {
    font-size: 0.82rem;
    color: #666;
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* Individual Character Deltas */
.character-deltas-section {
    padding: 2rem;
}

.character-deltas-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--accent-navy);
}

.character-deltas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.5rem;
}

.char-delta-card {
    background: #faf8f5;
    border: 1px solid #e8e3d8;
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.char-delta-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.char-delta-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--accent-navy);
}

.char-delta-header .char-class {
    font-size: 0.8rem;
    color: #777;
    font-style: italic;
}

.delta-entry-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.delta-entry {
    font-size: 0.9rem;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.delta-badge {
    font-size: 0.72rem;
    font-weight: bold;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    white-space: nowrap;
    margin-top: 1px;
}

.badge-spent { background: #fee2e2; color: #991b1b; }
.badge-gained { background: #dcfce7; color: #166534; }
.badge-used { background: #fef3c7; color: #92400e; }
.badge-held { background: #e0e7ff; color: #3730a3; }
.badge-none { background: #f3f4f6; color: #6b7280; }
.treasury-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0 3.5rem 0;
}

.coin-card {
    background: #fff;
    padding: 1.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    text-align: center;
    border-top: 5px solid var(--accent-gold);
    transition: transform 0.2s, box-shadow 0.2s;
}

.coin-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}

.coin-card.gold-coin { border-top-color: #d4af37; }
.coin-card.silver-coin { border-top-color: #a8a9ad; }
.coin-card.copper-coin { border-top-color: #b87333; }
.coin-card.debt-card { border-top-color: #8b0000; }

.coin-icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.coin-amount {
    font-size: 2.2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--accent-navy);
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.coin-card.debt-card .coin-amount {
    color: #8b0000;
}

.coin-label {
    font-size: 0.85rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

/* Loot Controls & Search */
.loot-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e0dcd0;
}

.loot-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    background: var(--bg-parchment);
    border: 1px solid #d0cbbe;
    color: var(--text-dark);
    padding: 0.45rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent-navy);
    color: var(--text-light);
    border-color: var(--accent-navy);
}

.loot-search {
    padding: 0.5rem 1.25rem;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 0.9rem;
    width: 250px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: var(--font-body);
}

.loot-search:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 8px rgba(197, 160, 89, 0.4);
}

/* Inventory Cards Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

.item-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    border-left: 5px solid var(--accent-gold);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}

.item-card.magic { border-left-color: #8a2be2; }
.item-card.quest { border-left-color: #d4af37; }
.item-card.consumable { border-left-color: #2e8b57; }
.item-card.valuable { border-left-color: #e67e22; }

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.35rem;
    gap: 0.5rem;
}

.item-header h3 {
    font-size: 1.25rem;
    color: var(--accent-navy);
    margin: 0;
}

.item-badge {
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-magic { background: #f3e8ff; color: #6b21a8; }
.badge-quest { background: #fef9c3; color: #854d0e; }
.badge-consumable { background: #dcfce7; color: #166534; }
.badge-valuable { background: #ffedd5; color: #9a3412; }

.item-carrier {
    font-size: 0.85rem;
    font-style: italic;
    color: #666;
    margin-bottom: 0.75rem;
}

.item-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #444;
    margin-bottom: 1.25rem;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0ece1;
    padding-top: 0.75rem;
    font-size: 0.85rem;
    color: #777;
}

.item-value {
    font-weight: bold;
    color: var(--accent-navy);
}

/* Ledger Transaction Table */
.ledger-section {
    margin-top: 3.5rem;
}

.ledger-table-wrap {
    background: #fff;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    border: 1px solid #e0dcd0;
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.ledger-table th {
    background: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-heading);
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.ledger-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0ece1;
    font-size: 0.92rem;
}

.ledger-table tr:hover td {
    background: #faf8f3;
}

.tx-positive { color: #166534; font-weight: bold; }
.tx-negative { color: #8b0000; font-weight: bold; }
.tx-debt { color: #b91c1c; font-weight: bold; }

/* --- Chronicle & Session Log Shared Styles --- */
.chronicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.session-index-card {
    display: block;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    border-left: 5px solid var(--accent-gold);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: var(--text-dark);
}

.session-index-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border-left-color: var(--accent-navy);
}

.session-index-card.locked {
    opacity: 0.6;
    border-left-color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

.session-number {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
}

.session-index-card h3 {
    margin: 0.5rem 0;
    font-size: 1.5rem;
    color: var(--accent-navy);
}

.session-date {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 1rem;
    font-style: italic;
}

.session-teaser {
    line-height: 1.6;
}

.campaign-archive {
    margin-bottom: 4rem;
}

.campaign-archive-header {
    margin-bottom: 1.5rem;
}

.campaign-archive-header h2 {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-gold);
    color: var(--accent-navy);
    font-family: var(--font-heading);
    font-size: 2rem;
}

.campaign-archive-header p {
    color: #666;
    font-style: italic;
}

/* Session Logs */
.log-header {
    text-align: center;
    margin: 3rem 0 2rem 0;
}

.log-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.log-meta {
    color: #666;
    font-style: italic;
    margin-bottom: 2rem;
}

.log-section {
    margin-bottom: 3rem;
}

.log-section h2 {
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.highlight-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--accent-navy);
}

.highlight-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-body);
    color: var(--accent-navy);
}

.cliffhanger-box {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--accent-gold);
    text-align: center;
}

.cliffhanger-box h2 {
    color: var(--accent-gold);
    border-bottom: none;
}

.cliffhanger-quote {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    font-style: italic;
    margin: 1rem 0;
}

.status-debuffs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.debuff-tag {
    background: #8b0000;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}
