/* ==========================================================================
   CSS für die interaktive Chronik der Legenden (3D-Buch)
   ========================================================================== */

/* Resets & Globale Variablen */
:root {
    --gold-color: #d4af37;
    --gold-light: #f3e5ab;
    --parchment-bg: radial-gradient(circle at 50% 50%, #fefcf7 0%, #f5eeda 100%);
    --cover-bg: linear-gradient(135deg, #2c1a11 0%, #170d08 100%);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --border-color: #c9b097;
    --text-color: #2c2013;
    --glow-color: rgba(212, 175, 55, 0.4);
}





/* Zurück-Link */


.back-link:hover {
    color: #ffffff;
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

/* Container */
.book-container {
    width: 100%;
    max-width: 1000px;
    display: none !important;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    margin-top: 2rem;
}

.hall-entered .book-container {
    display: flex !important;
}

/* ==========================================================================
   Suchleiste (Search Section)
   ========================================================================== */
.search-section {
    position: relative;
    width: 100%;
    max-width: 550px;
    z-index: 999;
}

.search-box-wrapper {
    position: relative;
    width: 100%;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(20, 15, 12, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50px;
    padding: 0.25rem 0.5rem;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.search-input-container:focus-within,
.search-input-container.active {
    border-color: var(--gold-color);
    box-shadow:
        0 0 20px var(--glow-color),
        0 4px 25px rgba(0, 0, 0, 0.6),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.search-icon {
    width: 20px;
    height: 20px;
    margin-left: 1rem;
    color: rgba(212, 175, 55, 0.6);
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-input-container:focus-within .search-icon {
    color: var(--gold-color);
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 0.8rem 1rem;
    font-size: 1.1rem;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
}

.search-input::placeholder {
    color: rgba(230, 223, 213, 0.4);
}

.clear-btn {
    background: transparent;
    border: none;
    color: rgba(212, 175, 55, 0.6);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0 0.8rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.clear-btn:hover {
    color: #ffffff;
}

/* Autocomplete Vorschläge */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: rgba(28, 20, 16, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    margin-top: 0.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: none;
    backdrop-filter: blur(10px);
    z-index: 1010;
}

.search-suggestions ul {
    list-style: none;
}

.suggestion-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    transition: all 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
    background: rgba(212, 175, 55, 0.15);
}

.suggestion-name {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    color: var(--gold-light);
    font-size: 1.05rem;
}

.suggestion-title {
    font-size: 0.85rem;
    color: rgba(230, 223, 213, 0.6);
}

/* Feedback/Suchstatus */
.search-feedback {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--gold-color);
    min-height: 1.2rem;
    font-style: italic;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-feedback.visible {
    opacity: 1;
}


/* ==========================================================================
   3D Buch Bühne & Container
   ========================================================================== */
.scene {
    width: 900px;
    height: 580px;
    perspective: 1800px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.book {
    position: relative;
    width: 450px;
    /* Breite eines einzelnen Blattes */
    height: 550px;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 1.5s cubic-bezier(0.25, 1, 0.5, 1);
    transform: rotateX(20deg) rotateY(-5deg) translateX(0px);
    /* Geschlossen: Cover ist mittig zentriert */
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
}

/* Offener Zustand des Buch-Containers (Nach rechts versetzt um halbe Blattbreite, damit der Buchrücken mittig bleibt) */
.book.open {
    transform: rotateX(15deg) rotateY(0deg) translateX(225px);
}

/* Lade-Platzhalter im Buch */
.book-loading-placeholder {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--parchment-bg);
    border-radius: 0 15px 15px 0;
    border: 3px solid var(--border-color);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.1);
    color: var(--text-color);
    font-family: 'Cinzel', serif;
    gap: 1.5rem;
    padding: 2rem;
    text-align: center;
}

.book-loading-placeholder p {
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 1px;
    color: #4a341e;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(74, 52, 30, 0.1);
    border-top: 4px solid var(--gold-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.book,
.page {
    outline: none;
}

/* Das physische Blatt (Vorder + Rückseite) */
.page {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    right: 0;
    transform-origin: left center;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 1.4s cubic-bezier(0.645, 0.045, 0.355, 1);
    pointer-events: none;
    /* Verhindert Klicks während der Animation */
    transform: rotateY(0deg) translateX(-0.5px) translateZ(0px);
    /* Ganz leicht nach links verschieben, um Spalt im Buchfalz zu schließen */
    will-change: transform;
}

/* Nur das aktive/vorderste Blatt empfängt Mausereignisse */
.book.closed .page:first-child,
.book.open .page {
    pointer-events: auto;
}

/* Standard z-Indizes für geschlossenes Buch (Blatt 1 oben, Blatt 5 unten) */
.page:nth-child(1) {
    z-index: 5;
}

.page:nth-child(2) {
    z-index: 4;
}

.page:nth-child(3) {
    z-index: 3;
}

.page:nth-child(4) {
    z-index: 2;
}

.page:nth-child(5) {
    z-index: 1;
}

/* Umgeblätterter Zustand (Drehung um die linke Kante) */
.page.flipped {
    transform: rotateY(-180deg) translateX(-0.5px) translateZ(0px);
    /* Verschiebt umgeblättertes Blatt um 0.5px nach rechts (lokal) */
}

/* Erzwungener Z-Index während der Blätteranimation */
.page.flipping {
    z-index: 100 !important;
}

/* Neue z-Indizes für umgeblätterte Blätter (Blatt 1 liegt links ganz unten, Blatt 5 ganz oben) */
.page.flipped:nth-child(1) {
    z-index: 1;
}

.page.flipped:nth-child(2) {
    z-index: 2;
}

.page.flipped:nth-child(3) {
    z-index: 3;
}

.page.flipped:nth-child(4) {
    z-index: 4;
}

.page.flipped:nth-child(5) {
    z-index: 5;
}


/* Gestaltung der Seiten-Vorder- und Rückseite (3D-Karten-Effekt) */
.page-side {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: none;
    will-change: transform;
}

/* Vorderseite schaut nach rechts (Standard) */
.page-side.front {
    transform: rotateY(0deg) translateZ(1px);
    border-radius: 0 12px 12px 0;
}

/* Rückseite ist um 180° gedreht und schaut nach links, wenn umgeblättert */
.page-side.back {
    transform: rotateY(180deg) translateZ(1px);
    border-radius: 12px 0 0 12px;
}

/* ==========================================================================
   Ästhetik: Buchdeckel (Cover)
   ========================================================================== */
.cover-front,
.cover-back {
    background: var(--cover-bg);
    border-radius: 0 15px 15px 0;
    border: 3px solid #140b07;
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.8),
        inset 0 0 10px rgba(212, 175, 55, 0.1);
}

.cover-front {
    border: 3px solid #000000 !important;
}

.cover-back {
    border-radius: 15px 0 0 15px;
    /* Links abgerundet, da es die Rückseite ist */
}

/* Edles Ornament-Design für die Cover */
.cover-design {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(212, 175, 55, 0.15);
    margin: 0;
    border-radius: inherit;
}

.cover-design::before {
    content: '';
    position: absolute;
    top: 15px;
    bottom: 15px;
    left: 15px;
    right: 15px;
    border: 2px solid var(--gold-color);
    border-radius: inherit;
    opacity: 0.65;
    pointer-events: none;
}

/* Corner Ornaments (CSS-gezeichnet) */
.corner-ornament {
    position: absolute;
    width: 25px;
    height: 25px;
    border: 2px solid var(--gold-color);
    pointer-events: none;
}

.corner-ornament.top-left {
    top: 22px;
    left: 22px;
    border-right: none;
    border-bottom: none;
}

.corner-ornament.top-right {
    top: 22px;
    right: 22px;
    border-left: none;
    border-bottom: none;
}

.corner-ornament.bottom-left {
    bottom: 22px;
    left: 22px;
    border-right: none;
    border-top: none;
}

.corner-ornament.bottom-right {
    bottom: 22px;
    right: 22px;
    border-left: none;
    border-top: none;
}

.cover-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.2rem;
    z-index: 5;
}

/* Emblem in der Mitte des Covers */
.seal-emblem {
    width: 110px;
    height: 110px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
    display: block;
    margin: 0 auto;
}

.seal-emblem-small {
    width: 70px;
    height: 70px;
    object-fit: contain;
    opacity: 0.8;
    display: block;
    margin: 0 auto;
}

/* Schriftarten auf dem Cover */
.book-title {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1;
    background: linear-gradient(to bottom, #ffffff 30%, #e6c587 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.8));
}

.book-subtitle {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 1.5rem;
    color: var(--gold-light);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.cover-design .divider {
    width: 80px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--gold-color), transparent);
}

.click-hint {
    font-size: 0.9rem;
    color: rgba(230, 223, 213, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 1.5rem;
    animation: pulseGlow 2.5s infinite ease-in-out;
}

.back-text {
    font-size: 0.85rem;
    color: rgba(230, 223, 213, 0.4);
    letter-spacing: 1px;
}


/* ==========================================================================
   Ästhetik: Pergamentseiten (Parchment Pages)
   ========================================================================== */
.page-parchment {
    background: var(--parchment-bg);
    color: var(--text-color);
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    border: 1.5px solid #140b07;
    /* Solider dunkler Buchseitenschnitt-Rand */
    border-radius: inherit;
    /* Vererbt die jeweilige Abrundung (links/rechts) vom Elternelement */
}

/* Ränder an der Buchfalz (Mitte) ausblenden, damit das Buch natürlich aufgeschlagen wirkt */
.page-side.front.page-parchment {
    border-left: none !important;
}

.page-side.back.page-parchment {
    border-right: none !important;
}

.page-border {
    position: relative;
    width: 100%;
    height: 100%;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2rem 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.page-border::before {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 12px;
    right: 12px;
    border: 1px dashed rgba(201, 176, 151, 0.45);
    pointer-events: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.parchment-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 2;
}

/* Spine-Crease Schatten (Tiefenwirkung im Buchknick) */
/* Vorderseite: Schatten links (Spine) */
.page-side.front::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 35px;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.03) 30%, transparent 100%);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* Rückseite: Schatten rechts (Spine) */
.page-side.back::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 35px;
    height: 100%;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.03) 30%, transparent 100%);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* Aktiviere Schatten auf der linken Seite (wenn umgeblättert) */
.page.flipped .page-side.back::after {
    opacity: 1;
}

/* Aktiviere Schatten auf der rechten Seite (wenn das vorherige Blatt umgeblättert ist) */
.page.flipped+.page .page-side.front::after {
    opacity: 1;
}

/* Eck-Eselsohren-Effekt am Seitenrand (Visual Indicator für Interaktivität) */
.page-side.front::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 16px 16px;
    border-color: transparent transparent rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1);
    pointer-events: none;
    transition: all 0.3s ease;
}

.page:hover .page-side.front::before {
    border-width: 0 0 25px 25px;
}

/* Seitennummerierung */
.page-number {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: rgba(44, 32, 19, 0.5);
    letter-spacing: 1px;
}

/* Ornamente & Trenner */
.ornament-header {
    width: 100%;
    height: 15px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 10" xmlns="http://www.w3.org/2000/svg"><path d="M 0 5 Q 25 0 50 5 Q 75 10 100 5" fill="none" stroke="%23c9b097" stroke-width="1.5"/></svg>');
    background-size: cover;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.ornament-footer {
    width: 80px;
    height: 15px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 50 15" xmlns="http://www.w3.org/2000/svg"><path d="M 0 0 Q 25 15 50 0 M 15 5 H 35" fill="none" stroke="%23c9b097" stroke-width="1.5"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 1.5rem auto 0 auto;
    opacity: 0.6;
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: #4a341e;
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(201, 176, 151, 0.4);
    padding-bottom: 0.5rem;
}

.intro-text {
    font-family: 'Lora', serif;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
    text-align: justify;
    color: #3b2c1e;
}

.instruction-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #574431;
    background: rgba(201, 176, 151, 0.15);
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--border-color);
}


/* ==========================================================================
   Inhaltsverzeichnis (TOC)
   ========================================================================== */
.toc-desc {
    font-size: 0.95rem;
    color: #574431;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 0.5rem;
}

.toc-link {
    width: 100%;
    background: transparent;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    cursor: pointer;
    font-family: 'Lora', serif;
    text-align: left;
    padding: 0.2rem 0;
    transition: color 0.2s ease;
}

.toc-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #3b2c1e;
}

.toc-leader {
    flex-grow: 1;
    color: rgba(201, 176, 151, 0.6);
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    margin: 0 0.5rem;
}

.toc-page {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: #7a5f43;
}

.toc-link:hover .toc-name,
.toc-link:hover .toc-page {
    color: #8c1d1d;
    /* Dezenter roter Farbwechsel beim Hover */
    text-shadow: 0 0 1px rgba(140, 29, 29, 0.2);
}

.toc-link:hover .toc-leader {
    color: rgba(140, 29, 29, 0.4);
}


/* ==========================================================================
   Heldensteckbrief-Seiten
   ========================================================================== */
.hero-badge {
    align-self: center;
    background: #4a341e;
    color: #fcf8ed;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.hero-badge-special {
    align-self: center;
    background: #8c1d1d;
    color: #fcf8ed;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.hero-name {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    color: #1e130b;
    text-align: center;
    margin-bottom: 0.3rem;
}

.hero-meta {
    font-size: 0.85rem;
    color: #7a6855;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.2rem;
}

.hero-divider {
    width: 60%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color) 30%, var(--border-color) 70%, transparent);
    align-self: center;
    margin-bottom: 1.5rem;
}

/* Helden-Profil Layout */
.hero-profile {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hero-profile.continuation {
    justify-content: flex-start;
}

.hero-profile.continuation .hero-header {
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    width: 100%;
}

.hero-profile.continuation .hero-name {
    text-align: center;
    margin-bottom: 0;
    width: 100%;
}

.continuation-label {
    text-align: center;
    font-size: 0.85rem;
    font-style: italic;
    color: #7a6855;
    margin-top: -0.2rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.25;
}

.hero-header {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

/* Charakter-Porträtbox */
.char-portrait {
    width: 90px;
    height: 100px;
    background: radial-gradient(circle at 50% 50%, #fefcf7 0%, #e6dfd5 100%);
    border: 2px solid var(--gold-color);
    border-radius: 8px;
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.15);
    padding: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.portrait-svg {
    width: 100%;
    height: 100%;
}

.char-portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.hero-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
}

.hero-info .hero-badge,
.hero-info .hero-badge-special {
    align-self: flex-start;
    margin-bottom: 0.3rem;
}

.hero-info .hero-name {
    text-align: left;
    font-size: 1.8rem;
    margin-bottom: 0.1rem;
    line-height: 1.1;
}

.member-since {
    font-family: 'Lora', serif;
    font-size: 0.85rem;
    color: #7a6855;
    font-style: italic;
}

.hero-motto {
    font-family: 'Lora', serif;
    font-size: 0.8rem;
    font-style: italic;
    color: #8c765c;
    margin-top: 0.3rem;
    line-height: 1.35;
    max-width: 250px;
    opacity: 0.9;
}

/* Errungenschaften Bereich */
.achievements-section {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-top: 0.2rem;
}

.achievements-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: #4a341e;
    margin-bottom: 0.6rem;
    letter-spacing: 1px;
    border-bottom: 1px dashed rgba(201, 176, 151, 0.4);
    padding-bottom: 0.2rem;
}

.achievements-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.4rem 0.6rem;
    background: rgba(201, 176, 151, 0.12);
    border-radius: 4px;
    border-left: 3px solid var(--border-color);
    transition: all 0.2s ease;
}

.achievement-item:hover {
    background: rgba(201, 176, 151, 0.25);
    transform: translateX(3px);
}

.ach-year {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #8c1d1d;
    min-width: 40px;
}

.ach-text {
    font-family: 'Lora', serif;
    font-size: 0.9rem;
    color: #2c2013;
    font-weight: 500;
}

.overflow-hint {
    text-align: right;
    font-family: 'Lora', serif;
    font-size: 0.8rem;
    font-style: italic;
    color: #8c1d1d;
    margin-top: auto;
    padding-top: 0.4rem;
    animation: bounceRight 1.5s infinite alternate ease-in-out;
}

@keyframes bounceRight {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(4px);
    }
}

.hero-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.tag {
    font-size: 0.8rem;
    background: rgba(201, 176, 151, 0.3);
    color: #4a341e;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    border: 1px solid rgba(201, 176, 151, 0.4);
    font-weight: 500;
}

/* Pulse-Effekt zum Hervorheben nach der Suche */
@keyframes pulseHighlight {
    0% {
        box-shadow: inset 0 0 0px rgba(212, 175, 55, 0);
        background-color: var(--parchment-bg);
    }

    30% {
        box-shadow: inset 0 0 25px rgba(212, 175, 55, 0.45);
        background-color: rgba(212, 175, 55, 0.08);
    }

    70% {
        box-shadow: inset 0 0 25px rgba(212, 175, 55, 0.45);
        background-color: rgba(212, 175, 55, 0.08);
    }

    100% {
        box-shadow: inset 0 0 0px rgba(212, 175, 55, 0);
        background-color: var(--parchment-bg);
    }
}

.highlight-pulse {
    animation: pulseHighlight 2s ease-in-out;
}


/* ==========================================================================
   Steuerungstasten unter dem Buch
   ========================================================================== */
.book-controls {
    display: flex;
    justify-content: center;
    gap: 2rem;
    width: 100%;
}

.nav-btn {
    background: rgba(20, 15, 12, 0.8);
    color: var(--gold-color);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 0.8rem 1.6rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    touch-action: manipulation;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    background: var(--gold-color);
    color: #000000;
    border-color: var(--gold-color);
    box-shadow: 0 0 15px var(--glow-color);
    transform: translateY(-2px);
}

.nav-btn:hover#prev-btn svg {
    transform: translateX(-3px);
}

.nav-btn:hover#next-btn svg {
    transform: translateX(3px);
}

.nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: rgba(230, 223, 213, 0.1);
    color: rgba(230, 223, 213, 0.3);
}


/* ==========================================================================
   Keyframe-Animationen
   ========================================================================== */
@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.35;
    }

    50% {
        opacity: 0.8;
    }
}


/* ==========================================================================
   Responsive Webdesign (RWD)
   ========================================================================== */
@media (max-width: 960px) {
    .scene {
        width: 100%;
        height: auto;
        min-height: 520px;
        perspective: 1200px;
    }

    .book {
        width: 360px;
        height: 480px;
        transform: rotateX(10deg) rotateY(-5deg) translateX(0px);
        /* Geschlossen zentriert */
    }

    .book.open {
        transform: rotateX(10deg) rotateY(0deg) translateX(180px);
        /* Offen zentriert */
    }

    .hero-name {
        font-size: 1.8rem;
    }

    .book-title {
        font-size: 2.8rem;
    }
}

/* Mobiltelefone (Einseitiges Layout oder Zoom-Out) */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .back-link {
        position: static;
        margin-bottom: 1rem;
        align-self: flex-start;
    }

    .book-container {
        gap: 2rem;
    }

    /* Mobil: Wir flachen das Buch ab und skalieren es, um auf kleinere Displays zu passen */
    .scene {
        width: 290px;
        /* Breite einer einzelnen Buchseite */
        height: 520px;
        /* Erhöhte fixe Höhe, damit der Text immer passt */
        min-height: 520px;
        position: relative;
    }

    .page {
        transform: none !important;
        touch-action: manipulation;
    }

    .book {
        width: 290px;
        height: 520px;
        transform: none !important;
        touch-action: manipulation;
    }

    .book.open {
        transform: none !important;
    }

    .cover-design {
        padding: 1.5rem;
    }

    .seal-emblem {
        width: 80px;
        height: 80px;
    }

    .book-title {
        font-size: 2.2rem;
    }

    .page-parchment {
        padding: 1rem;
    }

    .page-border {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }

    .intro-text,
    .hero-text {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .toc-name {
        font-size: 0.95rem;
    }

    .toc-page {
        font-size: 0.85rem;
    }

    .hero-name {
        font-size: 1.4rem;
    }

    .hero-badge,
    .hero-badge-special {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
        margin-bottom: 0.4rem;
    }

    .hero-meta {
        font-size: 0.75rem;
        margin-bottom: 0.6rem;
    }

    .hero-divider {
        margin-bottom: 0.8rem;
    }
}

/* ==========================================================================
   Lightbox für Charakterporträts in Großansicht
   ========================================================================== */
.lightbox {
    display: none;
    /* Standardmäßig ausblenden */
    position: fixed;
    z-index: 10000;
    /* Ganz oben über allen Elementen */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 17, 10, 0.85);
    /* Warmer, dunkler Überzug */
    backdrop-filter: blur(10px);
    /* Premium Weichzeichnungseffekt */
    opacity: 0;
    transition: opacity 0.3s ease;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox.show {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 75%;
    border: 3px solid var(--gold-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.show .lightbox-content {
    transform: scale(1);
}

.lightbox-caption {
    margin: 1.5rem auto 0 auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #fcf8ed;
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 45px;
    color: #fcf8ed;
    font-size: 45px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    user-select: none;
    line-height: 1;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--gold-color);
    text-decoration: none;
}

/* Zeige an, dass das Porträt klickbar ist */
.char-portrait img.char-portrait-img {
    cursor: zoom-in;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.char-portrait img.char-portrait-img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* ==========================================================================
   Eintragungsformular (Helden-Registrierung)
   ========================================================================== */
.submission-section {
    margin-top: 60px;
    width: 100%;
    /* max-width und zentrierung wandern zur card, damit die section die volle breite (wie halle_inner) hat */
    padding-bottom: 80px;
    position: relative;
}

.submission-card {
    background: rgba(18, 14, 10, 0.85);
    border: 1px solid var(--gold-color);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(197, 160, 89, 0.1);
    border-radius: 12px;
    padding: 40px;
    position: relative;
    backdrop-filter: blur(10px);

    /* Von submission-section hierher verschoben, um die Formular-Breite zu begrenzen: */
    width: calc(100% - 40px);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.submission-card::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(197, 160, 89, 0.2);
    border-radius: 8px;
    pointer-events: none;
}

.form-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold-color);
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.form-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #c9b195;
    text-align: center;
    max-width: 600px;
    margin: 0 auto 30px auto;
    line-height: 1.6;
}

.submission-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--gold-color);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
    background: rgba(30, 24, 18, 0.7);
    border: 1px solid rgba(197, 160, 89, 0.4);
    border-radius: 6px;
    padding: 12px 16px;
    color: #f5edd6;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.form-group textarea {
    resize: vertical;
    min-height: 40px;
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold-color);
    box-shadow: 0 0 10px rgba(197, 160, 89, 0.3);
    background: rgba(30, 24, 18, 0.9);
}

.checkbox-group {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    background: rgba(30, 24, 18, 0.4);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid rgba(197, 160, 89, 0.2);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    color: #e5d7bc;
    font-size: 0.95rem;
    user-select: none;
    transition: color 0.2s;
}

.checkbox-label:hover {
    color: var(--gold-color);
}

.checkbox-note {
    font-size: 0.78rem;
    color: #c9b195;
    opacity: 0.85;
    font-style: italic;
    margin-left: 4px;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid var(--gold-color);
    border-radius: 3px;
    background: rgba(18, 14, 10, 0.8);
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: var(--gold-color);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #120e0a;
    font-size: 12px;
    font-weight: bold;
}

.dynamic-details-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dynamic-category-card {
    background: rgba(30, 24, 18, 0.5);
    border: 1px dashed rgba(197, 160, 89, 0.4);
    border-radius: 8px;
    padding: 20px;
    animation: fadeInSlide 0.3s ease-out forwards;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.category-card-header {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--gold-color);
    font-weight: 700;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
    padding-bottom: 5px;
}

.category-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 15px;
}

@media (max-width: 500px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}

.form-group select {
    background: rgba(30, 24, 18, 0.7);
    border: 1px solid rgba(197, 160, 89, 0.4);
    border-radius: 6px;
    padding: 12px 16px;
    color: #f5edd6;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.form-group select:focus {
    outline: none;
    border-color: var(--gold-color);
}

.submit-btn {
    background: linear-gradient(135deg, #c5a059 0%, #9e7d3b 100%);
    border: none;
    border-radius: 6px;
    padding: 16px 32px;
    color: #120e0a;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.3s, filter 0.2s;
    box-shadow: 0 8px 20px rgba(197, 160, 89, 0.2);
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(197, 160, 89, 0.4);
    filter: brightness(1.1);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-icon {
    transform: translate(3px, -3px);
}

.form-feedback {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    margin-top: 10px;
    padding: 12px;
    border-radius: 6px;
    display: none;
}

.form-feedback.success {
    display: block;
    background: rgba(46, 125, 50, 0.15);
    border: 1px solid #2e7d32;
    color: #81c784;
}

.form-feedback.error {
    display: block;
    background: rgba(198, 40, 40, 0.15);
    border: 1px solid #c62828;
    color: #e57373;
}

.form-feedback.info {
    display: block;
    background: rgba(197, 160, 89, 0.15);
    border: 1px solid var(--gold-color);
    color: #e5d7bc;
}

.book-container * {
    box-sizing: border-box;
}

.info-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 12px;
    font-style: normal;
    font-family: Arial, sans-serif;
    cursor: help;
    margin-left: 6px;
    transition: background 0.2s, transform 0.2s;
    font-weight: bold;
}

.info-icon:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.grecaptcha-badge {
    visibility: hidden !important;
}


/* Ambient Fliegende Bücher über die ganze Seite */
.ambient-books {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 5;
    /* Hinter Modal, aber über dem Hintergrund */
    overflow: hidden;
}

.book-anim {
    position: absolute;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
    opacity: 0.85;
    will-change: transform;
}

/* Weniger, aber dafür langsamere und versetztere Bücher für mehr Ruhe */
.b1 {
    top: 25%;
    left: -200px;
    width: 220px;
    /* Vorderste Ebene, größer und schneller */
    animation: fly-across-1 18s linear infinite;
    animation-delay: 0s;
}

.b2 {
    top: 40%;
    left: -200px;
    width: 110px;
    /* Mittlere Ebene */
    animation: fly-across-2 25s linear infinite;
    animation-delay: 5s;
}

.b3 {
    top: 50%;
    left: -250px;
    width: 70px;
    /* Hinterste Ebene, klein */
    animation: fly-across-3 45s linear infinite;
    animation-delay: 2s;
}

@keyframes fly-across-1 {
    0% {
        transform: translateX(0) translateY(0) rotate(-10deg);
    }

    50% {
        transform: translateX(50vw) translateY(-120px) rotate(5deg);
    }

    100% {
        transform: translateX(calc(100vw + 400px)) translateY(80px) rotate(-15deg);
    }
}

@keyframes fly-across-2 {
    0% {
        transform: translateX(0) translateY(0) rotate(5deg);
    }

    33% {
        transform: translateX(33vw) translateY(130px) rotate(-8deg);
    }

    66% {
        transform: translateX(66vw) translateY(-110px) rotate(2deg);
    }

    100% {
        transform: translateX(calc(100vw + 400px)) translateY(30px) rotate(12deg);
    }
}

@keyframes fly-across-3 {
    0% {
        transform: translateX(0) translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateX(50vw) translateY(150px) rotate(10deg);
    }

    100% {
        transform: translateX(calc(100vw + 400px)) translateY(-100px) rotate(-5deg);
    }
}

@media (max-width: 1300px) {
    .ambient-books {
        opacity: 0.3;
        /* Auf Handys etwas blasser, damit es nicht stört */
    }
}

/* Hintergrundbild hinter dem Formular */
.submission-section {
    position: relative;
    /* Wichtig für die absolute Positionierung des Bildes */
}

.submission-background-image {
    position: absolute;
    top: -450px;
    /* Überlappt weiter in den oberen Bereich (Halle Inner) */
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    /* Volle Bildschirmbreite */
    max-width: 100vw;
    z-index: -1;
    /* Hinter das Formular (submission-card) */
    pointer-events: none;
    opacity: 1;
    /* Volle Deckkraft, keine Verdunkelung mehr */
    object-fit: cover;
    /* Verhindert Verzerrungen, wenn das Bild breitgezogen wird */
}

@media (max-width: 960px) {
    .submission-background-image {
        width: 100vw;
    }
}

@media (max-width: 768px) {
    .submission-background-image {
        top: -250px;
        /* Auch auf mobilen Geräten weiter nach oben ziehen */
        width: 290px;
        /* Auf Handys so breit wie die mobile Buchszene */
    }
}

/* Fliegende Wörter (Lore/Chronik) */
.floating-word {
    position: absolute;
    font-family: 'Cinzel', serif;
    color: #e6c587;
    /* Ruhiger Gold-Parchment Ton ohne Leuchten */
    pointer-events: none;
    white-space: nowrap;
    animation: word-drop linear forwards;
    will-change: transform, opacity;
    letter-spacing: 2px;
}

@keyframes word-drop {
    0% {
        transform: translate(-50%, -50%);
        opacity: 0;
    }

    5% {
        transform: translate(-50%, -40%);
        opacity: 0.9;
        animation-timing-function: ease-in;
    }

    100% {
        transform: translate(-50%, 300px);
        opacity: 0;
    }
}