/* --- 1. THE FONT REPOSITORY --- */
/* (I have kept all your @font-face definitions here) */
@font-face {
    font-family: 'Alternate Gothic No1';
    src: url("/static/fonts/alternate_gothic_no1-webfont.4e8a3e774aa8.ttf") format('truetype');
}

@font-face {
    font-family: 'Alternate Gothic No2';
    src: url("/static/fonts/alternate_gothic_no2-webfont.9301668bfaab.ttf") format('truetype');
}

@font-face {
    font-family: 'Alternate Gothic No3';
    src: url("/static/fonts/alternate_gothic_no3-webfont.b85563dea8ca.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Archaic1897';
    src: url("/static/fonts/Archaic1897.78e12df2e282.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Arezzo Pro';
    src: url("/static/fonts/arezzo-pro-cd-regular-webfont.95b67040678e.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Arezzo Pro';
    src: url("/static/fonts/arezzo-pro-cd-light-webfont.9d55c139e960.ttf") format('truetype');
    font-weight: auto;
    font-style: normal;
}

@font-face {
    font-family: 'Baskerville';
    src: url("/static/fonts/baskerville-pro-regular-webfont.e2e645bc81c3.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Baskerville';
    src: url("/static/fonts/baskerville-pro-italic-webfont.3dcd5b235cc3.ttf") format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Baskerville';
    src: url("/static/fonts/baskerville-pro-bold-webfont.a696fab8650f.ttf") format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Baskerville';
    src: url("/static/fonts/baskerville-pro-bolditalic-webfont.5ed2f8c8498c.ttf") format('truetype');
    font-weight: bold;
    font-style: italic;
}

@font-face {
    font-family: 'Bodoni';
    src: url("/static/fonts/bodoni-regular-webfont.fce8ad49d53e.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Cordoba';
    src: url("/static/fonts/cordoba-regular-webfont.c17d1557a2ea.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Cordoba';
    src: url("/static/fonts/cordoba-bold-webfont.4f19174c0999.ttf") format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Fremont Pro';
    src: url("/static/fonts/fremont-pro-regular-webfont.4c40248594e4.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Italian Garamond';
    src: url("/static/fonts/italian-garamond-pro-regular-webfont.cda6eda9bb49.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Italian Garamond';
    src: url("/static/fonts/italian-garamond-pro-italic-webfont.c9e113770737.ttf") format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Italian Garamond';
    src: url("/static/fonts/italian-garamond-pro-bold-webfont.d232c004ca67.ttf") format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Josh Handwriting';
    src: url("/static/fonts/Josh Handwriting.f1d95706f4de.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Korinth Serial';
    src: url("/static/fonts/Korinth Serial-Regular.cdcf8cd049a2.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Korinth Serial';
    src: url("/static/fonts/korinth-serial-regular-webfont.d69b185dd1ef.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Korinth Serial';
    src: url("/static/fonts/korinth-serial-bold-webfont.9e4ee9246ad6.ttf") format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Korinth Serial';
    src: url("/static/fonts/korinth-serial-italic-webfont.f24fd2f22129.ttf") format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Korinth Serial';
    src: url("/static/fonts/korinth-serial-bolditalic-webfont.7796b20748c6.ttf") format('truetype');
    font-weight: bold;
    font-style: italic;
}

@font-face {
    font-family: 'Korinth Serial Light';
    src: url("/static/fonts/korinth-serial-light-webfont.c5773c70ae5d.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Morris Roman';
    src: url("/static/fonts/MorrisRoman-Black.547e779f7be4.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Newcastle';
    src: url("/static/fonts/newcastle-regular-webfont.e0df69bb0bb6.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

/*
@font-face {
    font-family: 'Rundgotisch No1 Pro';
    src: url("/static/fonts/Rundgotisch No1 Pro.398de5854e82.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}
*/
@font-face {
    font-family: 'Alhambra';
    src: url("/static/fonts/ALHAMBRA.b40b6fad6741.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Cardinal';
    src: url("/static/fonts/Cardinal Regular.38c516075c49.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Caesar Dressing';
    src: url("/static/fonts/CaesarDressing-Regular.4afd385fc443.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'FranciscoLucasBriosa';
    src: url("/static/fonts/FranciscoLucas Briosa.f5ca87c3bb67.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Harrington';
    src: url("/static/fonts/Harrington.5fc7a6163c60.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Kohelet';
    src: url("/static/fonts/Kohelet.f1a5185f9aa4.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Mason';
    src: url("/static/fonts/mason.1ab6505e5f6a.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'MedievalSharp';
    src: url("/static/fonts/MedievalSharp-Regular.ab74758f51f4.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Odins Runes';
    src: url("/static/fonts/Odins Runes Pro.03b20296265e.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Quill Sword';
    src: url("/static/fonts/quillsword.38809d672bfb.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

.dashboard-members .membership-character-select {
    min-width: 0;
    height: 2rem;
    min-height: 2rem;
    padding: 0.1rem 1.9rem 0.1rem 0.45rem;
    border: 1px solid rgba(197, 160, 89, 0.38);
    border-radius: 0.4rem;
    background-color: rgba(255, 252, 244, 0.92) !important;
    color: var(--ink-dark);
    font-size: 0.82rem;
    line-height: 1.1;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--ink-dark) 50%),
        linear-gradient(135deg, var(--ink-dark) 50%, transparent 50%);
    background-position:
        calc(100% - 0.9rem) 0.8rem,
        calc(100% - 0.6rem) 0.8rem;
    background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
    background-repeat: no-repeat;
}

.dashboard-members .membership-character-select:focus {
    outline: none;
    border-color: var(--rpg-gold);
    box-shadow: 0 0 0 0.14rem rgba(197, 160, 89, 0.18);
    background-color: rgba(255, 252, 244, 0.96) !important;
}

.dashboard-members .membership-character-select option {
    color: var(--ink-dark);
    background-color: var(--parchment-bg);
}

.dashboard-members .btn-rpg.small,
.dashboard-members .btn-rpg-outline-danger.small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    min-height: 2rem;
    padding: 0.1rem 0.55rem;
    font-size: 0.8rem;
    line-height: 1;
}

.dashboard-members .btn-rpg.small:hover,
.dashboard-members .btn-rpg-outline-danger.small:hover {
    box-shadow: none;
}

@font-face {
    font-family: 'Quill Sword';
    src: url("/static/fonts/quillswordbold.ee179b9856d2.ttf") format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Quill Sword';
    src: url("/static/fonts/quillswordital.f8b2d0f640fb.ttf") format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Quill Sword';
    src: url("/static/fonts/quillswordboldital.e882464bee88.ttf") format('truetype');
    font-weight: bold;
    font-style: italic;
}

@font-face {
    font-family: 'SchaftstiefelKaputt';
    src: url("/static/fonts/SchaftstiefelKaputt.3c8433afb67d.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Tagettes';
    src: url("/static/fonts/Tagettes.e223a6cbabb5.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'The Roman Runes Alliance';
    src: url("/static/fonts/TheRomanRunesAlliance.4fe968b20e8a.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Tolkien';
    src: url("/static/fonts/Tolkien_Regular.a44a5c9cb024.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Vinland';
    src: url("/static/fonts/Vinland.326281551c01.ttf") format('truetype');
}


/* ==========================================================================
   1. THEME VARIABLES & CORE RESET
   ========================================================================== */
:root {
    --rpg-red: #8C1C13;
    --rpg-almond: #E7D7C1;
    --rpg-beaver: #A78A7F;
    --rpg-gold: #c5a059;
    --rpg-gold-dark: #8b6d3b;
    --rpg-boron-red: #8b0000;
    --magical-glow: rgba(197, 160, 89, 0.6); /* --rpg-gold with transparency */
    --ink-dark: #2b1d0e;
    --parchment-texture: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

    --parchment-bg: #f4e4bc;
    --parchment-wing-bg: #e3d3a3;
    --parchment-wing-curl: #cbb78d;
    --parchment-border: #d2b48c;
    --parchment-shadow: rgba(139, 69, 19, 0.15);

    /* Navigation & UI */
    --nav-bg: #3d2b1f;
    --toast-bg: #4a3321;
    --success-green: #78a75a;

    /* Fonts */
    --font-heading: Mason, MedievalSharp, serif;
    --font-main: "Korinth Serial", "Baskerville", serif;
    --font-element: MedievalSharp, serif;
}

:root {
    --bs-tooltip-bg: #2c3e50 !important;         /* Background color */
    --bs-tooltip-color: #ecf0f1;      /* Text color */
    --bs-tooltip-padding-x: 10px;
    --bs-tooltip-padding-y: 5px;
    --bs-tooltip-border-radius: 4px;
    --bs-tooltip-font-size: 0.875rem;
}


body {
    background-color: var(--rpg-almond);
    font-size: 1rem;
    line-height: 1.5;
    font-family: "Korinth Serial", "Baskerville", serif;
    color: var(--ink-dark);
}

/* ==========================================================================
   VISUAL STYLE GUIDE - ARCHIVAL UTILITIES
   ========================================================================== */

@media (min-width: 1200px) {
    .parchment-container {
        border-radius: 0; /* Makes the transition to the wings perfectly flat */
        border-left: none;
        border-right: none;

        width: 100%;
        max-width: 1800px; /* Or 'none' if you want it to fill the whole screen */
        margin-left: auto;
        margin-right: auto;
        display: flex;
        flex-direction: column;
        /* Ensure it doesn't shrink-wrap the table */
        flex-grow: 1;
    }
}

/* 1. The Scribe's Border: Double-lined ink border for important containers */
.border-scribe {
    border: 3px double var(--ink-dark) !important;
    padding: 1.5rem;
    position: relative;
}

.bg-dark-scribe {
    background-color: #2c241e !important; /* Dunkles Tabak-Braun */
    color: var(--rpg-gold) !important; /* Goldene Schrift */
    font-family: 'Crimson Text', serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--rpg-gold) !important;
}

/* 2. The Golden Filigree: A thin gold line often used for section breaks */
.hr-gold {
    height: 2px;
    background: linear-gradient(to right, transparent, var(--rpg-gold), transparent);
    border: none;
    margin: 2rem 0;
}

.bg-light-parchment {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

/* 3. The Wax Seal Shadow: A deep, reddish-brown drop shadow for floating elements */
.shadow-seal {
    box-shadow: 0 4px 15px rgba(140, 28, 19, 0.2), 0 2px 5px rgba(0, 0, 0, 0.4) !important;
}

/* 4. The Aged Text: For secondary information that looks like faded ink */
.text-faded-ink {
    color: var(--ink-dark);
    opacity: 0.65;
    font-style: italic;
    font-family: 'Baskerville', serif;
}

/* 5. The Royal Header Underline: A solid gold line with a diamond in the center */
.header-royal {
    position: relative;
    text-align: center;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.header-royal::after {
    content: '◆';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--rpg-gold);
    background: var(--parchment-bg); /* Match parchment bg */
    padding: 0 10px;
    font-size: 0.8rem;
    z-index: 2;
}

.header-royal::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: var(--rpg-gold);
    z-index: 1;
}


/* ==========================================================================
   2. TYPOGRAPHY & GLOBAL STYLES
   ========================================================================== */

.font-archaic {
    font-family: 'Archaic1897', serif;
}

.font-archaic .bi,
.font-archaic [class^="bi-"],
.font-archaic [class*=" bi-"] {
    font-family: "bootstrap-icons" !important;
    font-style: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    display: inline-block;
    /* Falls die Schriftart sehr dünn ist, hilft manchmal: */
    -webkit-font-smoothing: antialiased;
}

.font-handwriting {
    font-family: 'Josh Handwriting', cursive;
}

.font-runes {
    font-family: 'Odins Runes', sans-serif;
}

/* Global Icon Tweaks */
xxx.bi, xxxi {
    vertical-align: middle;
}

h1, h2, h3, h4, .display-6, .ql-editor h3, .ql-editor h4 {
    font-family: var(--font-heading);
    font-weight: bold;
    margin-bottom: 0.5rem !important;
}


.h1, h1 {
    font-size: calc(1.4rem + 1.5vw);
}
.h2, h2 {
    font-size: calc(1.3rem + .9vw);
}

.h3, h3 {
    font-size: calc(1.2rem + .6vw);
}


h3.bg-dark-scribe {
    background-color: var(--nav-bg) !important; /* Passt zur Navigation */
    color: var(--rpg-gold) !important;
    border-bottom: 2px solid var(--rpg-gold-dark) !important;
    padding: 12px 15px;
    border-radius: 4px 4px 0 0; /* Rundet die oberen Ecken ab */
}


/* ==========================================================================
   3. LAYOUT COMPONENTS (Header, Nav, Parchment, Footer)
   ========================================================================== */

/* Header */
header {
    font-family: var(--font-heading);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.bg-primary {
    background-color: var(--rpg-red) !important;
}

.text-primary {
    color: var(--rpg-red) !important;
}

.container-fluid {
    /* Prevents the 'parchment' from stretching to infinite width on ultra-wides */
    max-width: 1920px;
    margin: 0 auto;
}

/* Navigation */
.site-header {
    position: relative;
    z-index: 2000 !important;
}

.site-header .dropdown {
    position: relative;
    z-index: 2001;
}

.site-header .dropdown-menu {
    z-index: 2002 !important;
}

.site-header .user-menu-trigger {
    font-size: 0.95rem;
    padding: 0.55rem 0.85rem;
}

.auth-form-grid {
    display: grid;
    grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
    gap: 1rem 1.25rem;
    align-items: start;
}

.auth-form-grid-label {
    padding-top: 0.55rem;
}

.auth-form-grid-field .form-control {
    width: 100%;
}

.account-meta-list {
    display: grid;
    gap: 0.8rem;
}

.account-meta-row {
    display: grid;
    grid-template-columns: minmax(9rem, 12rem) minmax(0, 1fr);
    gap: 0.75rem 1rem;
    align-items: start;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(74, 52, 35, 0.14);
}

.account-meta-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.account-meta-label {
    font-family: var(--font-element);
    color: var(--rpg-brown-dark);
    letter-spacing: 0.02em;
}

.account-meta-value {
    color: var(--rpg-dark);
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .auth-form-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .auth-form-grid-label {
        padding-top: 0;
    }

    .account-meta-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

.rpg-navigation {
    background-color: var(--nav-bg);
    border-bottom: 2px solid var(--rpg-gold);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-blend-mode: overlay;
    opacity: 0.98;
}

.rpg-navigation .nav-link {
    font-family: var(--font-element);
    color: var(--rpg-almond) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1.5rem !important;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.rpg-navigation .nav-link:hover,
.rpg-navigation .nav-link.active {
    color: var(--rpg-gold) !important;
    text-shadow: 0 0 5px rgba(197, 160, 89, 0.5);
}

  .rpg-navigation .nav-link.active {
      border-bottom: 2px solid var(--rpg-gold);
  }

  .archive-menu-section {
      margin: 0.4rem 0.9rem 0.25rem;
      padding: 0 0 0.35rem;
      color: var(--rpg-gold-dark);
      font-family: var(--font-element);
      font-size: 0.72rem;
      font-weight: 600;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      border-bottom: 1px solid rgba(139, 109, 59, 0.35);
      opacity: 0.95;
  }

.navbar-toggler {
    border: 1px solid var(--rpg-gold);
}

.text-gold {
    color: var(--rpg-gold);
    font-size: 1.5rem;
}

.sticky-top {
    z-index: 1020;
}

/* Parchment Main Area */
.parchment-container {
    display: flex;
    flex: 1 1 auto; /* Tells the div: "Grow to fill all space, shrink if needed" */
    flex-basis: auto;
    flex-direction: column;
    background-color: var(--parchment-bg);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.05));
    border-radius: 2px;
    background-blend-mode: overlay;
    border: 1px solid var(--parchment-border);
    box-shadow: inset 0 0 40px var(--parchment-shadow);
    margin: 0 auto;
    max-width: 1800px; /* Stop at 1800px so it doesn't get TOO wide */
    min-width: 0; /* Essential for tables to behave */
    padding: 2rem;
    position: relative;
    width: 100%;
    z-index: 2;
}


/* Footer */
footer.footer {
    background-color: #2b1d0e !important;
    border-top: 3px solid var(--rpg-gold);
    color: var(--rpg-almond) !important;
    padding: 0.65rem 0 !important;
    font-size: 0.92rem;
    line-height: 1.25;
}

footer.footer a {
    color: var(--rpg-gold);
    text-decoration: none;
}

footer.footer a:hover {
    color: white;
    text-decoration: underline;
}

footer.footer .text-muted {
    color: rgba(231, 215, 193, 0.6) !important;
}


/* --- SCROLL WINGS SYSTEM --- */

.scroll-wrapper {
    align-items: stretch; /* Makes wings and paper the same height */
    display: flex; /* Put wings and paper in a row */
    justify-content: center;
    align-items: stretch;
    position: relative;
    max-width: 1800px;
    margin: 0 auto;
    min-width: 100%;
    width: 100% !important; /* Force the wrapper to span the whole screen */
}


/* The core parchment remains responsive */
/* Common Wing Styles */
.scroll-wing {
    flex: 0 0 60px; /* Don't grow, don't shrink, stay 60px wide */
    /* width: 40px; /* Width of the rolled edge */
    background-color: var(--parchment-wing-bg); /* Slightly darker than main parchment */
    background-image: var(--parchment-texture); /* Reuse your texture variable */
    border: 1px solid var(--parchment-border);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2), 5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1;
    transition: all 0.3s ease;
}

/* Left Wing: Gradient creates the "curl" shadow on the right */
.wing-left {
    border-right: none;
    background: linear-gradient(to right, var(--parchment-wing-curl) 0%, var(--parchment-bg) 80%, var(--parchment-border) 100%);
    border-radius: 10px 0 0 10px;
}

/* Right Wing: Gradient creates the "curl" shadow on the left */
.wing-right {
    border-left: none;
    background: linear-gradient(to left, var(--parchment-wing-curl) 0%, var(--parchment-bg) 80%, var(--parchment-border) 100%);
    border-radius: 0 10px 10px 0;
}

/* Responsive adjustment: On smaller screens, wings disappear or shrink */
@media (max-width: 1200px) {
    .scroll-wrapper {
        padding: 0 15px;
    }
}

/* ==========================================================================
   4. BUTTONS & UI ELEMENTS
   ========================================================================== */

/* Standard Buttons */
.btn-rpg {
    display: inline-block; /* Sicherstellen, dass Padding korrekt berechnet wird */
    padding: 0.25rem 1.0rem; /* Vertikal 8px, Horizontal 24px */
    background-color: var(--rpg-red);
    color: var(--parchment-bg) !important;
    border: 1px solid var(--rpg-gold);
    font-family: var(--font-element);
    text-decoration: none; /* Falls als <a> genutzt */
    transition: all 0.3s ease;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    border-radius: 2px; /* Ganz leichte Rundung wirkt organischer */
}

.btn-rpg:hover {
    background-color: #a02016;
    color: white !important;
    border-color: #e5c17e;
    transform: translateY(-1px);
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
}

.btn-rpg-outline {
    display: inline-block;
    padding: 0.25rem 1.0rem;
    background-color: transparent;
    color: var(--ink-dark) !important;
    border: 1px solid var(--ink-dark);
    font-family: var(--font-element);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.btn-rpg-outline:hover {
    background-color: var(--ink-dark);
    color: var(--rpg-almond) !important;
}

.btn-rpg-outline-danger {
    display: inline-block;
    padding: 0.25rem 1.0rem;
    background-color: transparent;
    color: var(--rpg-boron-red) !important;
    border: 1px solid var(--rpg-boron-red);
    font-family: var(--font-element);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.btn-rpg-outline-danger:hover {
    background-color: rgba(128, 21, 21, 0.12);
    color: var(--rpg-boron-red) !important;
    border-color: var(--rpg-boron-red);
}

.btn-rpg.danger {
    background-color: var(--rpg-boron-red);
    color: #000000 !important;
}
.btn-rpg.danger:hover {
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
}


.text-danger {
    color: var(--rpg-boron-red) !important; /* Ein schönes Boron-Rot */
}

/* Breadcrumbs (Bookmark Style) */
.archive-breadcrumb {
    display: flex;
    list-style: none;
    padding: 0;
    margin: -2.8rem 0 1.5rem 1rem; /* Margin leicht angepasst für bessere Sichtbarkeit */
    font-family: var(--font-element);
    font-size: 0.9rem;
    position: relative;
    z-index: 10;
}

.breadcrumb-item {
    background: #a02016;
    color: var(--rpg-almond) !important;
    border: 1px solid var(--rpg-gold);
    /* Viel Padding oben schiebt den Text nach unten; wenig unten hält ihn nah an der Spitze */
    padding: 40px 12px 12px 12px !important;
    margin-right: 5px;
    /* Wir machen das Lesezeichen etwas länger für bessere Lesbarkeit */
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% 88%, 0% 100%);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: inline-flex;
    align-items: flex-end; /* Richtet den Inhalt am unteren Ende aus */
    justify-content: center;
    min-width: 90px;
    transform: translateY(5px); /* Standardmäßig leicht heraushängen lassen */
}

.breadcrumb-item:hover {
    transform: translateY(20px); /* Fällt beim Hover weiter nach unten */
    background: var(--rpg-red);
}

.breadcrumb-item.active {
    background: var(--ink-dark);
    border-color: var(--rpg-gold);
    transform: translateY(20px);
}

/* Entferne alle Pins und Bootstrap-Slashes */
.breadcrumb-item::before,
.archive-breadcrumb .breadcrumb-item::before {
    display: none !important;
    content: none !important;
}

.breadcrumb-item a {
    color: var(--rpg-almond) !important;
    text-decoration: none;
}

/* Toasts */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    background: var(--toast-bg);
    color: var(--parchment-bg);
    border: 2px solid var(--rpg-gold);
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.4), 0 4px 20px rgba(0, 0, 0, 0.6);
    padding: 16px 28px;
    border-radius: 4px;
    font-family: var(--font-element), cursive;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.success {
    border-color: var(--success-green);
}

.toast.error {
    border-color: var(--rpg-red);
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ==========================================================================
   5. CALENDAR & DATA TABLES
   ========================================================================== */
.month-title {
    font-family: var(--font-heading), serif;
    color: var(--rpg-red);
    text-align: center;
    border-bottom: 2px solid var(--rpg-gold);
    margin-bottom: 0;
    padding-bottom: 10px;
}

.calendar-table-wrapper {
    border: 1px solid var(--ink-dark);
    background-color: rgba(0, 0, 0, 0.02);
}

.calendar-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.weekday-header {
    font-family: 'MedievalSharp', serif;
    background-color: var(--ink-dark);
    color: var(--rpg-almond) !important;
    text-align: center;
    font-size: 0.8rem;
    padding: 8px 0 !important;
    text-transform: uppercase;
}

.calendar-cell {
    height: 80px;
    border: 1px solid rgba(43, 29, 14, 0.2) !important;
    padding: 8px !important;
    vertical-align: top;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: transparent;
    z-index: 1;
}

.calendar-cell:hover:not(.empty) {
    background-color: rgba(197, 160, 89, 0.1);
    border-color: var(--rpg-gold);
    box-shadow: inset 0 0 0 1px rgba(197, 160, 89, 0.25);
}

.calendar-cell.empty {
    background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(0, 0, 0, 0.03) 5px, rgba(0, 0, 0, 0.03) 10px);
}


.day-number {
    font-family: 'Baskerville', serif;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--ink-dark);
    transition: color 0.2s ease;
}

.calendar-cell:hover .day-number {
    color: var(--rpg-red);
}

.moon-phases {
    position: absolute;
    bottom: 5px;
    right: 5px;
    display: flex;
    gap: 2px;
}

.moon-symbol {
    font-size: 1rem;
    opacity: 0.7;
    filter: sepia(1) saturate(2);
}

/* Generic Data Tables in Content */
.content table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: separate;
    border-spacing: 0;
}


.table {
        background-color: var(--parchment-bg);

}

.content th {
    background-color: rgba(140, 28, 19, 0.1);
    xbackground-color: var(--parchment-bg);
    border-bottom: 2px solid var(--rpg-red);
    padding: 12px;
}

.content td {
    background-color: var(--parchment-bg);
    padding: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   6. BOOTSTRAP OVERRIDES (SPECIFICITY FIXES)
   ========================================================================== */


/* Force Calendar Tables to ignore Bootstrap shadows/bg */
.calendar-table-wrapper .calendar-table {
    border-collapse: separate !important;
    border: 1px solid var(--ink-dark) !important;
}

.calendar-table thead th.weekday-header {
    background-color: var(--ink-dark) !important;
    color: var(--rpg-almond) !important;
    border: 1px solid var(--ink-dark) !important;
}

.calendar-table tbody td.calendar-cell {
    background-color: transparent !important;
    color: var(--ink-dark) !important;
}

.calendar-table tbody td.calendar-cell:hover:not(.empty) {
    background-color: rgba(197, 160, 89, 0.1) !important;
    border-color: var(--rpg-gold) !important;
    box-shadow: inset 0 0 0 1px rgba(197, 160, 89, 0.25) !important;
}

.calendar-table tbody td.calendar-cell[data-day-cell] {
    cursor: pointer;
}

.calendar-table tbody td.calendar-cell.is-active:not(.empty) {
    background-color: rgba(197, 160, 89, 0.14) !important;
    border-color: var(--rpg-gold) !important;
    box-shadow:
        inset 0 0 0 1px rgba(197, 160, 89, 0.3),
        0 0 0 2px rgba(197, 160, 89, 0.18) !important;
}

.calendar-table > :not(caption) > * > * {
    background-color: transparent;
    box-shadow: none !important;
}

.calendar-day-detail-card {
    border: 1px solid rgba(43, 29, 14, 0.25);
    padding: 1rem 1.1rem;
}

.calendar-day-detail-placeholder {
    border: 1px solid rgba(43, 29, 14, 0.18);
    padding: 0.9rem 1rem;
}

.calendar-day-detail-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rpg-beaver);
}

.calendar-day-detail-title {
    font-family: var(--font-heading), serif;
    color: var(--ink-dark);
}

.calendar-day-detail-event {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid rgba(43, 29, 14, 0.15);
    border-radius: 0.35rem;
    background: color-mix(in srgb, var(--event-bg) 14%, rgba(255, 255, 255, 0.45));
    color: var(--ink-dark);
}

.calendar-day-detail-event:hover {
    border-color: rgba(43, 29, 14, 0.3);
    background: color-mix(in srgb, var(--event-bg) 20%, rgba(255, 255, 255, 0.52));
}

.calendar-day-detail-event-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--ink-dark);
}

.calendar-day-detail-event-dot {
    width: 0.7rem;
    height: 0.7rem;
    flex: 0 0 0.7rem;
    border-radius: 50%;
    background: var(--event-bg);
    box-shadow: 0 0 0 1px rgba(43, 29, 14, 0.18);
}

.calendar-day-detail-event-title {
    color: var(--ink-dark);
    font-weight: 600;
}

.calendar-day-detail-related-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 1.35rem;
    color: var(--rpg-red);
    font-size: 0.92rem;
}

/* Force Parchment Form Controls to look archival */
.parchment-container .form-control,
.parchment-container .form-select {
    background-color: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid var(--rpg-beaver) !important;
    color: var(--ink-dark) !important;
    border-radius: 2px;
}

.parchment-container .form-control:focus {
    border-color: var(--rpg-gold) !important;
    background-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 8px rgba(197, 160, 89, 0.3) !important;
}

/* Notes accordion: align with parchment look and feel */
.accordion[id^="notes-accordion-"] .accordion-item {
    border: 1px solid var(--parchment-border) !important;
    background-color: var(--parchment-bg) !important;
    box-shadow: 0 1px 6px var(--parchment-shadow);
    margin-bottom: 0.85rem !important;
}

.accordion[id^="notes-accordion-"] .note-header-bar {
    display: flex;
    align-items: stretch;
}

.accordion[id^="notes-accordion-"] .accordion-button {
    flex: 1 1 auto;
    position: relative;
    background-color: var(--parchment-wing-bg) !important;
    color: var(--ink-dark) !important;
    font-family: var(--font-main);
    border-bottom: 1px solid rgba(139, 109, 59, 0.25);
    padding-left: 2.75rem;
}

.accordion[id^="notes-accordion-"] .accordion-button:not(.collapsed) {
    background-color: var(--parchment-bg) !important;
    color: var(--rpg-red) !important;
    box-shadow: inset 0 -1px 0 rgba(197, 160, 89, 0.35);
}

.accordion[id^="notes-accordion-"] .accordion-button:hover {
    background-color: var(--rpg-almond) !important;
    color: var(--rpg-red) !important;
}

.accordion[id^="notes-accordion-"] .accordion-button:focus {
    border-color: var(--rpg-gold) !important;
    box-shadow: 0 0 0 0.2rem rgba(197, 160, 89, 0.28) !important;
}

.accordion[id^="notes-accordion-"] .accordion-button::after {
    position: absolute;
    left: 0.9rem;
    right: auto;
    margin-left: 0;
    margin-right: 0;
    filter: sepia(40%) saturate(140%) brightness(75%);
}

.accordion[id^="notes-accordion-"] .note-header-actions {
    flex: 0 0 auto;
    align-items: center;
    padding: 0.25rem 0.45rem;
    background-color: var(--parchment-wing-bg);
    border-bottom: 1px solid rgba(139, 109, 59, 0.25);
}

.accordion[id^="notes-accordion-"] .note-header-actions .btn-rpg-outline,
.accordion[id^="notes-accordion-"] .note-header-actions .btn-rpg-outline-danger {
    padding: 0.12rem 0.45rem;
    font-size: 0.78rem;
    line-height: 1.1;
}

.accordion[id^="notes-accordion-"] .note-header-actions .btn-rpg-outline:hover,
.accordion[id^="notes-accordion-"] .note-header-actions .btn-rpg-outline-danger:hover {
    transform: none;
    box-shadow: none;
}

.accordion[id^="notes-accordion-"] .accordion-body {
    background-color: var(--parchment-bg);
    color: var(--ink-dark);
    padding: 0;
}

.accordion[id^="notes-accordion-"] .accordion-body img {
    max-width: 100%;
    height: auto;
}


/* --- Desktop: Hover Effect --- */
@media (min-width: 992px) {
    .navbar-nav .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0; /* Ensures the mouse doesn't leave the trigger area */
    }

    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
    }

    /* Trick: Invisible pseudo-element to bridge the gap between nav and menu */
    .nav-item.dropdown .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -10px;
        left: 0;
        width: 100%;
        height: 10px;
    }
}

/* --- Styling for the Dropdown "Parchment" --- */
/* Combined and Optimized Dropdown Menu */
.rpg-navigation .dropdown-menu {
    background-color: var(--parchment-bg);
    background-image: url("https://www.transparenttextures.com/patterns/handmade-paper.png");
    border: 2px solid var(--rpg-gold);
    border-radius: 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    padding: 0;
    margin-top: 0; /* Ensures the menu sits flush against the nav */

    /* Optimization: Force GPU acceleration for smoother animations */
    transform: translateZ(0);
}

/* Individual items in the sub-menu */
.rpg-navigation .dropdown-item {
    color: var(--ink-dark, #333);
    font-family: 'Baskerville', 'Palatino', serif;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
    /* Optimization: Smooth transition for all hover states */
    transition: padding-left 0.2s ease-in-out, background-color 0.2s ease;
}

/* Hover effect */
.rpg-navigation .dropdown-item:hover {
    background-color: rgba(197, 160, 89, 0.15);
    color: var(--rpg-red);
    padding-left: 1.75rem;
}

/* Clean up borders and dividers */
.rpg-navigation .dropdown-item:last-child {
    border-bottom: none;
}

.rpg-navigation .dropdown-divider {
    border-top: 1px solid var(--rpg-gold-dark);
    opacity: 0.4;
    margin: 0; /* Optimization: Removes unnecessary whitespace in the list */
}

.timeline-actions-menu {
    background-color: var(--parchment-bg);
    border: 1px solid var(--rpg-gold);
    box-shadow: 0 0.5rem 1rem rgba(43, 29, 14, 0.18);
}

.timeline-actions-menu .dropdown-item {
    color: var(--ink-dark);
    font-family: 'Baskerville', 'Palatino', serif;
}

.timeline-actions-menu .dropdown-item:hover,
.timeline-actions-menu .dropdown-item:focus {
    background-color: rgba(197, 160, 89, 0.15);
    color: var(--rpg-red);
}

.timeline-actions-toggle {
    border: 0;
    background: transparent;
    color: rgba(43, 29, 14, 0.65);
    padding: 0.1rem 0.25rem;
    line-height: 1;
    border-radius: 0.35rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.timeline-actions-toggle:hover,
.timeline-actions-toggle:focus-visible {
    background-color: rgba(197, 160, 89, 0.15);
    color: var(--ink-dark);
    outline: none;
}

.timeline-date-label {
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.pagetitle-addition {
    font-size: 0.9rem;
    margin-top: -2px;
}

.pagetitle-context {
    font-size: 0.72em;
    font-weight: 400;
    color: rgba(43, 29, 14, 0.78);
}

.content-width-sm {
    max-width: 42rem;
}

.content-width-md {
    max-width: 760px;
}

.content-width-lg {
    max-width: 900px;
}

.field-relative {
    position: relative;
}

.sort-handle-col {
    width: 40px;
}

.sort-date-col {
    width: 180px;
}

.sort-handle-cell {
    cursor: grab;
}

.sort-handle-cell.is-disabled {
    cursor: default;
}

.calendar-current-date {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(116, 34, 24, 0.18);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 252, 243, 0.95), rgba(239, 225, 193, 0.85));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.calendar-current-date-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rpg-red);
}

.calendar-current-date-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-dark);
}

.rpg-menu-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--rpg-gold), transparent);
    border: none;
    opacity: 0.6;
}


.rpg-badge-lg {
    font-size: 0.95rem !important; /* Ca. 25% größer als Standard */
    padding: 0.45em 0.75em !important;
    font-weight: 500;
    letter-spacing: 0.5px;
    vertical-align: middle;
}


.rpg-content {
    width: 100%;
}

/* Ensure the wrapper stretches wide */
/* Force the inner RPG text to expand */
.rpg-content,
.rpg-content .container-fluid,
.rpg-content .row {
    width: 100% !important;
    max-width: none !important;
}


/* 1. Force the outer container to truly fill the screen */
main.container-fluid,
main.container-fluid > .container-fluid {
    max-width: none !important;
    width: 100% !important;
    padding-left: 10px;
    padding-right: 10px;
}


/* ---- */

.rpg-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-family: var(--font-element);
    font-size: 0.75rem;
    color: white; /* base color, switched by code to match background color based on contrast */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    margin-right: 4px;
}

.rpg-tag .bi-x:hover {
    color: var(--rpg-red);
    transform: scale(1.2);
    transition: transform 0.1s ease;
}

/* Wachssiegel-Punkt */
.rpg-tag-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.3), 1px 1px 2px rgba(0, 0, 0, 0.2);
    vertical-align: middle;
}


/* Für Elemente, die nebeneinander stehen (Karten-Stil) */
.archive-card-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--ink-dark);
    text-decoration: none;
    background-color: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--parchment-border);
    border-radius: 2px;
    transition: all 0.2s ease-out;
    height: 100%; /* Wichtig für gleich hohe Boxen im Grid */
    position: relative;
    overflow: hidden;
}

.archive-card-link:hover {
    color: var(--rpg-red);
    background-color: var(--parchment-bg);
    border-color: var(--rpg-gold);
    /* Ein dezenter "Lift"-Effekt statt Einrücken */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1),
    inset 0 0 10px rgba(197, 160, 89, 0.1);
}

/* Optionaler goldener Akzent-Strich oben statt links */
.archive-card-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--rpg-gold);
    opacity: 0;
    transition: opacity 0.2s ease;
}

  .archive-card-link:hover::before {
      opacity: 1;
  }

  .archive-card-link-compact {
      padding: 0.45rem 0.65rem;
      min-height: 100%;
  }

  .archive-card-link-compact .clickable-name {
      line-height: 1.2;
      word-break: break-word;
  }

  .archive-card-link-compact small {
      line-height: 1.1;
      margin-top: 0.15rem;
  }


/* Spezielle Klasse für Einträge in Listen (Atlas, Charakter-Übersicht) */
.archive-list-link {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    color: var(--ink-dark);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s ease-in-out;
    font-family: 'Baskerville', serif;
    background-color: rgba(0, 0, 0, 0.02);
    margin-bottom: 2px;
}

.archive-list-link:hover {
    color: var(--rpg-red);
    background-color: rgba(197, 160, 89, 0.1); /* Hauch von Gold */
    border-left: 3px solid var(--rpg-gold);
    padding-left: 1.25rem; /* "Einrücken" beim Hover */
    text-shadow: 0 0 1px rgba(140, 28, 19, 0.2);
}

.archive-list-link i {
    color: var(--rpg-gold);
    margin-right: 8px;
    transition: transform 0.2s ease;
}

.archive-list-link:hover i {
    transform: scale(1.2);
}


/* Tom Select an das DSA-Design anpassen */
.ts-control {
    background-color: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid var(--rpg-beaver) !important;
    font-family: 'Baskerville', serif;
}

.ts-dropdown {
    background-color: var(--parchment-bg) !important;
    background-image: var(--parchment-texture);
    border: 2px solid var(--rpg-gold) !important;
    box-shadow: 0 4px 15px var(--parchment-shadow);
}

.ts-dropdown .active {
    background-color: rgba(197, 160, 89, 0.2) !important;
    color: var(--rpg-red) !important;
}

.ts-wrapper.single.ts-single-search .ts-control {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    overflow: hidden;
}

.ts-wrapper.single.ts-single-search .ts-control > .item,
.ts-wrapper.single.ts-single-search .ts-control .dsa-selected-item {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
}

.ts-wrapper.single.ts-single-search .ts-control > input {
    flex: 1 1 2ch;
    min-width: 2ch !important;
    width: 2ch !important;
}


/* Spezielles Styling für den Farbwähler */
.form-control-color {
    width: 60px;
    height: 45px;
    padding: 5px;
    border: 1px solid var(--rpg-gold);
    background: var(--parchment-bg);
    cursor: pointer;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.form-control-color::-webkit-color-swatch {
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}


/* Container für den Color-Picker im Formular */
.border-gold-thin {
    border: 1px solid var(--rpg-gold);
}

.form-control-color {
    padding: 0;
    width: 45px;
    height: 45px;
    border: 1px solid var(--rpg-gold);
    cursor: pointer;
}


.dsa-detail-badge {
    padding: 3px 6px;
    border-radius: 8px;
    font-weight: 400;
    font-size: 1.0rem;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.dsa-detail-badge:hover {
    transform: translateY(-2px);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}


.form-check-input {
    cursor: pointer;
    border: 1px solid #8b6d3b; /* Passend zum DSA-Gold/Braun */
}

.form-check-input:checked {
    background-color: var(--rpg-gold);
    border-color: var(--rpg-gold-dark, #8b6d3b);
}

.form-check-input:focus {
    border-color: var(--rpg-gold);
    box-shadow: 0 0 0 0.25rem rgba(197, 160, 89, 0.25);
}

.location-destroyed-checkbox:checked {
    background-color: #f1d7d7;
    border-color: #8b2f2f;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 5-6'/%3e%3c/svg%3e");
}



.grayscale-effect {
    filter: grayscale(80%);
    transition: filter 0.3s ease;
    background: rgba(255, 255, 255, 0.4) !important;
}

.grayscale-effect:hover {
    filter: grayscale(0%);
    opacity: 1 !important;
}

.shadow-xs {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}


.game-icon {
    font-family: 'game-icons-font' !important;
    speak: never;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: inline-block;
}

/* Erzwungene Stile für Game-Icons */
.game-icon,
[class^="game-icon-"],
[class*=" game-icon-"] {
    font-family: 'game-icons-font' !important;
    display: inline-block !important; /* Verhindert das Kollabieren der Höhe */
    vertical-align: middle;
    line-height: 1;
    width: auto !important; /* Verhindert die 1920px Breite */
    height: auto !important;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Der wichtigste Teil: Sicherstellen, dass der Inhalt geladen wird */
.game-icon-orc-head:before {
    content: "\e900"; /* Beispiel-Unicode, das CSS der Library sollte das eigentlich tun */
}


/* Das Tribute-Menü selbst */
/* Tribute Container (The Dropdown Menu) */
.tribute-container {
    position: absolute !important;
    z-index: 99999 !important;
    width: 280px;
    max-height: 300px;

    background-color: var(--parchment-bg);
    background-image: var(--parchment-texture);
    background-blend-mode: overlay;

    border: 2px solid var(--rpg-gold-dark);
    border-radius: 3px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.4),
    inset 0 0 10px var(--parchment-shadow);
    font-family: var(--font-element), serif; /* Or your preferred DSA font */

    font-size: 80%;
}

.tribute-container ul {
    padding: 0;
    margin: 0;
    list-style: none;

    background-color: var(--parchment-bg);
    background-image: var(--parchment-texture);
    background-blend-mode: overlay;


}

.tribute-container li {
    padding: 12px 15px;
    cursor: pointer;
    color: var(--ink-dark);
    border-bottom: 1px solid var(--parchment-border);
    transition: all 0.2s ease;
}

.tribute-container li:last-child {
    border-bottom: none;
}

/* THE MAGIC: Keyboard Selection & Hover */
/* Tribute uses .highlight when you use arrow keys */
.tribute-container li.highlight,
.tribute-container li:hover {
    background-color: var(--rpg-almond);
    color: var(--rpg-red) !important;
    border-left: 4px solid var(--rpg-red);
    box-shadow: 0 0 10px var(--magical-glow);
    outline: none;
}

/* Styling the Type Labels (Held vs Ort) */
.tribute-container li small {
    display: block;
    font-size: 0.7rem;
    color: var(--rpg-beaver);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.tribute-container li.highlight small {
    color: var(--rpg-gold-dark);
}

/* Scrollbar styling to match the theme */
.tribute-container::-webkit-scrollbar {
    width: 6px;
}
.tribute-container::-webkit-scrollbar-track {
    background: var(--parchment-wing-bg);
}
.tribute-container::-webkit-scrollbar-thumb {
    background: var(--rpg-gold-dark);
}

.rpg-mention {
    color: var(--rpg-red);
    font-weight: bold;
    background-color: var(--parchment-shadow); /* Light brown tint */
    padding: 0 2px;
    border-radius: 3px;
    text-decoration: none;
    border: none;
}

.rpg-mention::first-letter {
    font-size: 0;
    color: transparent;
}

.ql-editor {
    font-family: "Korinth Serial", "Baskerville", serif;
    font-size: 1.00rem;
    line-height: 1.5;
    color: var(--ink-dark);
}

.ql-editor .rpg-mention {
    color: var(--rpg-red) !important;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--rpg-gold);
    padding: 0 2px;
    background-color: rgba(140, 28, 19, 0.05); /* Very faint red tint */
    transition: all 0.2s ease;
}

.ql-editor .rpg-mention:hover {
    color: var(--rpg-gold-dark) !important;
    border-bottom-color: var(--rpg-red);
    background-color: var(--parchment-shadow);
}

/* Die Links im Editor */
.ql-editor a {
    color: var(--rpg-red);
    text-decoration: none;
    border-bottom: 1px dashed #830606;
}

.ql-editor p {
    margin-bottom: 0.75rem !important; /* or whatever spacing your project uses */
}

.ql-divider::before {
    font-family: "bootstrap-icons";
    content: "\F411"; /* This is the 'hr' or 'dash-lg' icon code */
    font-size: 14px;
}

.ql-table-operations {
    background-color: var(--parchment-bg) !important;
    border: 1px solid var(--rpg-gold-dark) !important;
    font-family: serif !important;
}

.ql-table-operations button {
    color: var(--ink-dark) !important;
}

.ql-table-operations button:hover {
    background-color: var(--rpg-almond) !important;
    color: var(--rpg-red) !important;
}

/* Ensure the table operation menu is above everything else */
.ql-table-operations {
    z-index: 1000 !important;
    visibility: visible !important;
    display: block !important;
    background-color: white; /* Or your parchment color */
    border: 1px solid #ccc;
}

/* Fix for Quill 2.0 - the helper dots/menu sometimes hide behind padding */
.ql-container.ql-snow {
    overflow: visible !important;
}


.ql-toolbar button {
    width: auto !important;
    padding: 0 5px !important;
    margin-right: 2px;
}

/* Styling the custom table buttons in the toolbar */
.ql-table-insert-row-below::after { content: "➕Row"; font-size: 11px; font-weight: bold; }
.ql-table-insert-column-right::after { content: "➕Col"; font-size: 11px; font-weight: bold; }
.ql-table-delete-row::after { content: "❌Row"; font-size: 11px; }
.ql-table-delete-column::after { content: "❌Col"; font-size: 11px; }

/* Ensure the buttons have enough width for the text */
.ql-snow.ql-toolbar button[class^="ql-table-"] {
    width: auto !important;
    padding: 0 8px !important;
    border: 1px solid #ccc;
    margin-left: 2px;
    border-radius: 3px;
}


.search-results-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    background-color: #f4e1c1; /* Parchment color */
    border: 1px solid var(--rpg-red);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    margin-top: 5px;
    border-radius: 4px;
    z-index: 9999; /* Ensure it's above everything */
}

.search-result-item {
    display: block;
    padding: 8px 12px;
    color: #4a0000;
    text-decoration: none;
    border-bottom: 1px dotted #ccc;
}

.search-result-item:hover {
    background-color: #e9d1a8;
    color: var(--rpg-red);
}

.search-result-meta {
    font-size: 0.75rem;
    display: block;
    color: #666;
}

/* Style for the keyboard-selected item */
.search-result-item.selected {
    background-color: #e9d1a8;
    color: var(--rpg-red);
    outline: none;
    border-left: 4px solid var(--rpg-red); /* Distinct visual indicator */
}



/* Ensure pagination matches the Parchment theme */
.pagination .page-link {
    background-color: transparent; /* Let the parchment show through */
    color: var(--ink-dark);
    font-family: 'Baskerville', serif;
    border: 1px solid var(--rpg-gold);
    transition: all 0.3s ease;
}

/* Hover state using your gold highlight */
.pagination .page-link:hover {
    background-color: var(--rpg-gold);
    color: white !important;
    border-color: var(--rpg-gold-dark);
}

/* The middle status box using your dark tobacco theme */
.pagination .bg-dark-scribe {
    background-color: var(--ink-dark) !important;
    color: var(--rpg-gold) !important;
    border: 1px solid var(--rpg-red);
}






a[href*="wiki-aventurica.de"] {
  color: #330000;
}
a[href*="wiki-aventurica.de"]::before {
  content: " →";
}
a[href*="garetien.de"] {
  color: #330000;
}
a[href*="garetien.de"]::before {
  content: " →";
}
a[href*="koschwiki.de"] {
  color: #330000;
}
a[href*="koschwiki.de"]::before {
  content: " →";
}

a[href*="wiki.nordmarken.de"] {
  color: #330000;
}
a[href*="wiki.nordmarken.de"]::before {
  content: " →";
}
a[href*="abenteurer.fandom.com"] {
  color: #330000;
}
a[href*="abenteurer.fandom.com"]::before {
  content: " →";
}



.lore-text,
.ql-container.ql-snow{
    background-color: #fbf5e6;
    background-color: #f0f0e0;
    padding: 0.5rem;
    xbackground-color: #00ffff !important;
}

.lore-text {
    border: 1px solid rgba(139, 109, 59, 0.24);
    box-shadow: 0 4px 14px rgba(43, 29, 14, 0.14);
}



/* ??? */
/* Make the dropdown menu look like the rest of Rost */
.dropdown-menu.dsa-navigation {
    border: 1px solid var(--rpg-gold);
    background-color: var(--nav-bg);
}


.bi {
    font-family: "bootstrap-icons" !important;
    font-style: normal !important;
    font-weight: normal !important;
}


.gallery-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.75rem;
}

.gallery-folder-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gallery-folder-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(197, 160, 89, 0.35);
    border-radius: 999px;
    background: rgba(255, 252, 244, 0.72);
    color: var(--text-faded-ink);
    text-decoration: none;
    font-size: 0.9rem;
}

.gallery-folder-chip:hover,
.gallery-folder-chip.active {
    border-color: var(--rpg-gold);
    color: var(--rpg-red);
    background: rgba(255, 248, 232, 0.95);
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 1400px) {
    .gallery-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.gallery-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.32), rgba(0,0,0,0.02)), var(--parchment-bg);
    border: 1px solid var(--rpg-gold);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(44, 24, 16, 0.08);
}

.gallery-card-thumb {
    display: block;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, rgba(72, 50, 40, 0.08), rgba(197, 160, 89, 0.18));
}

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

.gallery-card-placeholder,
.gallery-detail-placeholder {
    min-height: 14rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rpg-gold-dark);
    background:
        radial-gradient(circle at top, rgba(197, 160, 89, 0.22), transparent 50%),
        linear-gradient(180deg, rgba(72, 50, 40, 0.08), rgba(0, 0, 0, 0.03));
}

.gallery-card-placeholder .bi,
.gallery-detail-placeholder .bi {
    font-size: 2.5rem;
}

.gallery-card-body {
    padding: 0.6rem 0.65rem 0.7rem;
}

.gallery-card-title {
    margin: 0 0 0.25rem;
    font-family: var(--font-element);
    font-size: 0.98rem;
    line-height: 1.25;
}

.gallery-card-title a {
    color: var(--ink-dark);
    text-decoration: none;
}

.gallery-card-title a:hover {
    color: var(--rpg-red);
}

.gallery-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.gallery-detail-frame {
    background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(0,0,0,0.04)), var(--parchment-bg);
    border: 1px solid var(--rpg-gold);
    border-radius: 0.6rem;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(44, 24, 16, 0.1);
    padding: 0.75rem;
}

.gallery-detail-stage-wrap {
    display: flex;
    justify-content: center;
}

.gallery-detail-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.gallery-detail-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 75vh;
    background: rgba(0, 0, 0, 0.04);
}

.gallery-detail-focus-marker {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(164, 20, 20, 0.85);
    box-shadow: 0 0 0 2px rgba(44, 24, 16, 0.35);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.gallery-sidebar-frame {
    background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(0,0,0,0.04)), var(--parchment-bg);
    border: 1px solid var(--rpg-gold);
    border-radius: 0.6rem;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(44, 24, 16, 0.08);
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-sidebar-link {
    display: block;
    text-decoration: none;
}

.gallery-sidebar-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.04);
}

.gallery-selection-preview {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    padding: 0.6rem;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.12));
    border-radius: 0.65rem;
    background: rgba(255, 248, 232, 0.45);
}

.gallery-selection-thumb {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    overflow: hidden;
    border-radius: 0.45rem;
    background: rgba(0, 0, 0, 0.05);
}

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

.gallery-selection-body {
    min-width: 0;
}

.gallery-selection-body a {
    word-break: break-word;
}

.relation-entry-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.relation-row-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.relation-row-list-tight {
    margin-top: 0;
}

.relation-row-item {
    border: 1px solid rgba(108, 79, 42, 0.18);
    border-radius: 0.45rem;
    padding: 0.45rem 0.55rem;
    background: rgba(255, 248, 232, 0.42);
}

.relation-row-main {
    flex: 1 1 auto;
}

.relation-row-label {
    font-family: var(--font-element);
    line-height: 1.15;
}

.relation-direction-badge {
    font-size: 0.66rem;
    letter-spacing: 0.02em;
    min-width: 1.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.35rem;
}

.relation-direction-badge .bi {
    font-size: 0.78rem;
    line-height: 1;
}

.relation-row-description {
    margin-top: 0.2rem;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.relation-row-actions {
    display: flex;
    gap: 0.2rem;
    flex: 0 0 auto;
}

.relation-row-action {
    width: 1.6rem;
    height: 1.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-width: 0;
    border-width: 1px;
}

.relation-row-action .bi {
    font-size: 0.78rem;
}

.relation-entry-grid {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

.relation-graph-filter-segments {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--rpg-gold);
    border-radius: 999px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(0, 0, 0, 0.04)),
        var(--parchment-bg);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 1px 4px rgba(43, 29, 14, 0.08);
}

.relation-graph-filter-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5.2rem;
    padding: 0.24rem 0.8rem;
    margin: 0;
    cursor: pointer;
    color: var(--ink-dark);
    font-family: var(--font-element);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    background: transparent;
    border-right: 1px solid rgba(139, 109, 59, 0.35);
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.relation-graph-filter-segments .relation-graph-filter-label:last-of-type {
    border-right: 0;
}

.relation-graph-filter-input:checked + .relation-graph-filter-label {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.12)),
        var(--rpg-boron-red);
    color: var(--parchment-bg);
    box-shadow: inset 0 0 0 1px rgba(197, 160, 89, 0.45);
}

.relation-graph-filter-input:focus-visible + .relation-graph-filter-label {
    position: relative;
    z-index: 1;
    box-shadow: inset 0 0 0 1px var(--rpg-gold), 0 0 0 2px rgba(197, 160, 89, 0.22);
}

.relation-graph-filter-label:hover {
    background-color: rgba(139, 109, 59, 0.08);
}

.gallery-picker-modal .modal-dialog,
.quill-gallery-picker-modal .modal-dialog {
    max-width: min(980px, calc(100vw - 2rem));
    margin: 1rem auto;
}

.gallery-picker-modal .modal-content,
.quill-gallery-picker-modal .modal-content {
    max-height: calc(100vh - 2rem);
    background-color: var(--parchment-bg);
    background-image:
        var(--parchment-texture),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.05));
    background-blend-mode: overlay;
    border: 1px solid var(--parchment-border);
    box-shadow: inset 0 0 40px var(--parchment-shadow);
}

.gallery-picker-modal .modal-header,
.gallery-picker-modal .modal-body,
.quill-gallery-picker-modal .modal-header,
.quill-gallery-picker-modal .modal-body {
    background: transparent;
    padding: 1rem;
}

.gallery-picker-modal .modal-body,
.quill-gallery-picker-modal .modal-body {
    overflow: auto;
}

.gallery-picker-modal .form-control,
.quill-gallery-picker-modal .form-control {
    background-color: rgba(255, 248, 232, 0.95);
    border-color: var(--rpg-gold);
    color: var(--ink-dark, #2d2216);
}

.gallery-picker-modal .form-control:focus,
.quill-gallery-picker-modal .form-control:focus {
    background-color: rgba(255, 248, 232, 0.98);
    border-color: var(--rpg-gold);
    box-shadow: 0 0 0 0.15rem rgba(197, 160, 89, 0.22);
}

.gallery-picker-modal .gallery-grid,
.quill-gallery-picker-modal .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.85rem;
}

.gallery-picker-modal .gallery-card-thumb,
.quill-gallery-picker-modal .gallery-card-thumb {
    aspect-ratio: 4 / 3;
    position: relative;
}

.gallery-picker-modal .gallery-card-title,
.quill-gallery-picker-modal .gallery-card-title {
    font-size: 0.98rem;
    line-height: 1.2;
    margin-bottom: 0.1rem;
}

.gallery-picker-modal .gallery-card-body,
.quill-gallery-picker-modal .gallery-card-body {
    padding: 0.25rem 0.4rem 0.2rem;
}

.gallery-picker-modal .gallery-picker-actions,
.quill-gallery-picker-modal .gallery-picker-actions {
    position: absolute;
    right: 0.55rem;
    bottom: 0.55rem;
    display: flex;
    gap: 0.4rem;
    z-index: 2;
}

.gallery-picker-modal .gallery-picker-action,
.quill-gallery-picker-modal .gallery-picker-action {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 999px;
    background: var(--rpg-red);
    color: #fff !important;
    border: 1px solid rgba(255, 248, 220, 0.38);
    box-shadow: 0 0.2rem 0.55rem rgba(0, 0, 0, 0.28);
}

.gallery-picker-modal .gallery-picker-action:hover,
.gallery-picker-modal .gallery-picker-action:focus,
.quill-gallery-picker-modal .gallery-picker-action:hover,
.quill-gallery-picker-modal .gallery-picker-action:focus {
    background: var(--rpg-boron-red);
    color: #fff !important;
    border-color: rgba(255, 248, 220, 0.52);
}

.ql-toolbar .ql-gallery-image .bi {
    font-size: 1rem;
    line-height: 1;
}
[id^="timeline-era-"],
[id^="timeline-element-"] {
  scroll-margin-top: 6rem;
}
