/* ==========================================================================
   Hogwarts Buch-Chronik Quiz – Stylesheet
   ========================================================================== */

:root {
    --bg-dark: #0a0b10;
    --bg-surface: #12141f;
    --bg-card: #181b29;
    --bg-parchment: #f9f4e8;
    --bg-parchment-dark: #e8dcc4;
    --border-parchment: #c9b48c;
    
    --gold: #d4af37;
    --gold-light: #f3e5ab;
    --gold-dark: #997a15;
    --accent-red: #8c1515;
    --accent-green: #1b4d3e;
    --accent-purple: #483248;
    --accent-blue: #1a365d;

    --text-light: #f0f2f8;
    --text-muted: #9aa2b8;
    --text-dark: #221c17;
    --text-dark-muted: #5e5348;

    --shadow-deep: 0 20px 40px rgba(0, 0, 0, 0.7);
    --shadow-gold: 0 0 25px rgba(212, 175, 55, 0.35);

    --font-serif: 'Cinzel', serif;
    --font-book: 'Crimson Text', serif;
    --font-sans: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 50% 20%, rgba(212, 175, 55, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 10% 80%, rgba(26, 54, 93, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(140, 21, 21, 0.12) 0%, transparent 50%);
}

/* Partikel-Leuchten im Hintergrund */
#sparks-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Header */
.quiz-header {
    position: relative;
    z-index: 20;
    background: rgba(18, 20, 31, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    padding: 0.85rem 2rem;
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-light);
}

.logo-wand {
    font-size: 1.6rem;
    color: var(--gold);
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.6));
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo-highlight {
    color: var(--gold);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--text-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
    transform: scale(1.05);
}

.btn-admin-link {
    text-decoration: none;
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid var(--gold);
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-admin-link:hover {
    background: var(--gold);
    color: #1a1a24;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* Hauptbühne */
.main-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    padding: 2rem 1.5rem;
}

.quiz-view {
    display: none;
    width: 100%;
    max-width: 1100px;
    animation: fadeIn 0.4s ease forwards;
}

.quiz-view.active {
    display: block;
}

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

/* ==========================================================================
   1. SCHWIERIGKEITSGRAD WAHL (PERGAMENT-SCROLL)
   ========================================================================== */

.parchment-scroll {
    background: var(--bg-surface);
    border: 2px solid var(--gold);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-deep), var(--shadow-gold);
    position: relative;
}

.scroll-emblem {
    font-size: 3rem;
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

.scroll-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    color: var(--gold);
    margin-bottom: 0.8rem;
    letter-spacing: 1px;
}

.scroll-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto 1.8rem auto;
    line-height: 1.6;
}

.rule-box {
    background: rgba(212, 175, 55, 0.08);
    border: 1px dashed var(--gold);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    max-width: 780px;
    margin: 0 auto 2.5rem auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.rule-icon {
    font-size: 1.8rem;
}

.rule-text {
    font-size: 0.95rem;
    color: var(--gold-light);
    line-height: 1.45;
}

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.difficulty-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.difficulty-card:hover {
    transform: translateY(-6px);
    border-color: var(--gold);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.25);
}

.difficulty-card.featured {
    border-color: var(--gold);
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.08) 0%, var(--bg-card) 100%);
}

.featured-ribbon {
    position: absolute;
    top: -11px;
    background: var(--gold);
    color: #111;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.diff-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.diff-icon {
    font-size: 2.4rem;
    margin-bottom: 0.6rem;
}

.diff-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.diff-rank {
    font-size: 0.85rem;
    color: var(--gold-light);
    font-weight: 600;
    margin-bottom: 0.9rem;
}

.diff-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 1.5rem;
    flex: 1;
}

.diff-btn-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold);
    transition: transform 0.2s ease;
}

.difficulty-card:hover .diff-btn-label {
    transform: translateX(4px);
}

/* ==========================================================================
   2. DAS BÜCHERREGAL (3D SHELF)
   ========================================================================== */

.shelf-header {
    text-align: center;
    margin-bottom: 2rem;
}

.selected-diff-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold);
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--gold-light);
    margin-bottom: 0.8rem;
}

.btn-text-action {
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.85rem;
}

.shelf-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.shelf-instruction {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 650px;
    margin: 0 auto;
}

.bookshelf-stage {
    perspective: 1200px;
    margin: 2rem 0;
}

.bookshelf-frame {
    background: #1c1510;
    border: 12px solid #362419;
    border-radius: 12px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8), var(--shadow-deep);
    padding: 2.5rem 1.5rem 0 1.5rem;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) #22160f;
}

.bookshelf-frame::-webkit-scrollbar {
    height: 8px;
}
.bookshelf-frame::-webkit-scrollbar-track {
    background: #22160f;
}
.bookshelf-frame::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.books-container {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.1rem;
    min-height: 380px;
    padding-bottom: 10px;
    min-width: fit-content;
}

/* Einzelnes 3D Buch */
.book-item {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.book-item.locked {
    cursor: not-allowed;
    filter: brightness(0.68) contrast(0.92);
}

.book-item.unlocked:hover {
    transform: translateY(-16px) scale(1.02);
}

.book-item.active-target .book-3d {
    animation: targetPulse 2.4s infinite ease-in-out;
}

@keyframes targetPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    }
    50% {
        box-shadow: 0 0 35px rgba(212, 175, 55, 0.85);
    }
}

.book-3d {
    width: 78px;
    position: relative;
    border-radius: 4px 6px 6px 4px;
    box-shadow: 6px 6px 20px rgba(0, 0, 0, 0.7);
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
}

/* Realistische Buchhöhen für alle 7 Bände */
#shelf-book-1 .book-3d { height: 285px; }
#shelf-book-2 .book-3d { height: 295px; }
#shelf-book-3 .book-3d { height: 305px; }
#shelf-book-4 .book-3d { height: 325px; }
#shelf-book-5 .book-3d { height: 335px; }
#shelf-book-6 .book-3d { height: 315px; }
#shelf-book-7 .book-3d { height: 325px; }

/* Buchrücken Farben */
.spine-book-1 {
    background: linear-gradient(90deg, #570d0d 0%, #8c1515 40%, #a81c1c 70%, #570d0d 100%);
    border: 1px solid #c79d30;
}
.spine-book-2 {
    background: linear-gradient(90deg, #0e3026 0%, #1b4d3e 40%, #256653 70%, #0e3026 100%);
    border: 1px solid #a3d9a5;
}
.spine-book-3 {
    background: linear-gradient(90deg, #2d1e2d 0%, #483248 40%, #5d425d 70%, #2d1e2d 100%);
    border: 1px solid #d4af37;
}
.spine-book-4 {
    background: linear-gradient(90deg, #0f213a 0%, #1a365d 40%, #254d84 70%, #0f213a 100%);
    border: 1px solid #ff8c00;
}
.spine-book-5 {
    background: linear-gradient(90deg, #4d0b0c 0%, #7b1113 40%, #9e191c 70%, #4d0b0c 100%);
    border: 1px solid #ff5722;
}
.spine-book-6 {
    background: linear-gradient(90deg, #0f211c 0%, #1e3f36 40%, #2a584c 70%, #0f211c 100%);
    border: 1px solid #c5a059;
}
.spine-book-7 {
    background: linear-gradient(90deg, #0c0c12 0%, #171720 40%, #282836 70%, #0c0c12 100%);
    border: 1px solid #e2e8f0;
}

.book-spine {
    width: 100%;
    height: 100%;
    border-radius: 4px 6px 6px 4px;
    padding: 1.2rem 0.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.spine-gold-emboss {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    color: var(--gold-light);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.spine-num {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
    border-bottom: 1px solid var(--gold);
    padding-bottom: 3px;
    width: 36px;
    text-align: center;
}

.spine-title {
    font-family: var(--font-serif);
    font-size: 0.8rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    letter-spacing: 1.5px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    max-height: 170px;
}

.spine-crest {
    font-size: 1.4rem;
}

/* Buch-Cover (im Regal verborgen / nur bei Übergang sichtbar) */
.book-cover {
    display: none;
}

.book-meta {
    margin-top: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.badge-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-unlocked {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    color: #2ecc71;
}

.badge-locked {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    color: #e74c3c;
}

.book-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Regal-Unterseite */
.shelf-board-bottom {
    position: relative;
    z-index: 10;
    height: 32px;
    background: linear-gradient(180deg, #513624 0%, #362419 60%, #22160f 100%);
    border-top: 3px solid #84593b;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.9);
}

.shelf-gold-trim {
    height: 3px;
    background: var(--gold);
    opacity: 0.4;
}

.shelf-stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.stat-bubble {
    background: var(--bg-surface);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 0.6rem 1.4rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
}

.stat-bubble-label {
    color: var(--text-muted);
}

.stat-bubble-val {
    color: var(--gold);
    font-weight: 700;
}

/* ==========================================================================
   3. DAS AUFGESCHLAGENE BUCH (QUIZ GRIMOIRE)
   ========================================================================== */

.book-opened-backdrop {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-control-bar {
    width: 100%;
    max-width: 1040px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.active-book-tag {
    font-family: var(--font-serif);
    color: var(--gold);
    font-size: 1.15rem;
    font-weight: 700;
}

.active-diff-indicator {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--gold-light);
}

/* Das physische aufgeschlagene Grimoire */
.grimoire-book {
    width: 100%;
    max-width: 1040px;
    min-height: 580px;
    background: var(--bg-parchment);
    color: var(--text-dark);
    border-radius: 12px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.85),
        0 0 30px rgba(212, 175, 55, 0.25),
        inset 0 0 60px rgba(160, 130, 90, 0.4);
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    border: 8px solid #3d2b1f;
}

/* Buchfalz in der Mitte */
.grimoire-binding {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 30px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, 
        rgba(0, 0, 0, 0.3) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(0, 0, 0, 0.3) 100%);
    box-shadow: 
        -5px 0 10px rgba(0,0,0,0.15),
        5px 0 10px rgba(0,0,0,0.15);
    z-index: 10;
    pointer-events: none;
}

.grimoire-page {
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.page-left {
    border-right: 1px solid rgba(138, 110, 75, 0.25);
    background: linear-gradient(90deg, #f3edd9 0%, #faf6eb 90%, #e2d7c0 100%);
}

.page-right {
    background: linear-gradient(90deg, #e2d7c0 0%, #faf6eb 10%, #f3edd9 100%);
}

/* Zierecken */
.page-corner {
    position: absolute;
    width: 25px;
    height: 25px;
    border-color: rgba(180, 140, 75, 0.4);
    pointer-events: none;
}
.page-corner.top-left { top: 15px; left: 15px; border-top: 2px solid; border-left: 2px solid; }
.page-corner.bottom-left { bottom: 15px; left: 15px; border-bottom: 2px solid; border-left: 2px solid; }
.page-corner.top-right { top: 15px; right: 15px; border-top: 2px solid; border-right: 2px solid; }
.page-corner.bottom-right { bottom: 15px; right: 15px; border-bottom: 2px solid; border-right: 2px solid; }

/* Linke Seite Gestaltung */
.chapter-header-box {
    text-align: center;
    margin-top: 0.5rem;
}

.crest-icon {
    font-size: 2.5rem;
    margin-bottom: 0.4rem;
}

.book-subtitle-tag {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dark-muted);
}

.chapter-number-display {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-red);
    margin-top: 0.4rem;
    letter-spacing: 1px;
}

.chapter-title-display {
    font-family: var(--font-book);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 0.3rem;
    color: var(--text-dark);
}

.chapter-lore-divider {
    text-align: center;
    margin: 1rem 0;
    position: relative;
}

.chapter-lore-divider::before, .chapter-lore-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: var(--border-parchment);
}
.chapter-lore-divider::before { left: 0; }
.chapter-lore-divider::after { right: 0; }

.chapter-status-summary {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-parchment);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.progress-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-dark-muted);
    margin-bottom: 0.5rem;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: #d8cbb0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-dark) 100%);
    transition: width 0.4s ease;
}

.chapter-quote-box {
    background: rgba(255, 255, 255, 0.4);
    border-left: 3px solid var(--gold);
    padding: 0.9rem 1.1rem;
    border-radius: 0 6px 6px 0;
    margin-top: 0.8rem;
    font-style: italic;
    position: relative;
}

.quote-mark {
    font-size: 2rem;
    color: var(--gold);
    line-height: 0;
    position: absolute;
    top: 15px;
    left: 4px;
}

.quote-text {
    font-family: var(--font-book);
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.4;
    padding-left: 12px;
}

.quote-author {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-dark-muted);
    margin-top: 0.3rem;
    font-style: normal;
}

.page-footer-left, .page-footer-right {
    text-align: center;
    font-family: var(--font-book);
    font-size: 0.85rem;
    color: var(--text-dark-muted);
    border-top: 1px solid rgba(138, 110, 75, 0.2);
    padding-top: 0.5rem;
}

/* Rechte Seite Gestaltung */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-badge {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-red);
}

.streak-counter {
    font-size: 0.85rem;
    font-weight: 700;
    color: #b35900;
}

.question-container {
    margin: 1rem 0 1.5rem 0;
    min-height: 90px;
}

.question-text {
    font-family: var(--font-book);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1612;
}

/* 4 Antwort-Optionen */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.option-btn {
    background: #ffffff;
    border: 1.5px solid var(--border-parchment);
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.option-btn:hover {
    background: #fffdf5;
    border-color: var(--gold-dark);
    transform: translateX(4px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.opt-key {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eee5d3;
    color: #4a3c2c;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.opt-text {
    font-family: var(--font-book);
    font-size: 1.15rem;
    color: #261f18;
    line-height: 1.3;
}

/* Feedback-Zustände der Buttons */
.option-btn.selected-correct {
    background: #e8f8ed;
    border-color: #27ae60;
}
.option-btn.selected-correct .opt-key {
    background: #27ae60;
    color: #fff;
}

.option-btn.selected-wrong {
    background: #fdeeed;
    border-color: #e74c3c;
}
.option-btn.selected-wrong .opt-key {
    background: #e74c3c;
    color: #fff;
}

/* ==========================================================================
   FREITEXT ANTWORTEN (SCHWIERIGKEITSGRAD SCHWER)
   ========================================================================== */

.freetext-container {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.freetext-label {
    font-family: var(--font-book);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
}

.freetext-input-group {
    display: flex;
    gap: 0.6rem;
}

.freetext-input {
    flex: 1;
    background: #ffffff;
    border: 2px solid var(--border-parchment);
    border-radius: 8px;
    padding: 0.85rem 1.1rem;
    font-family: var(--font-book);
    font-size: 1.25rem;
    color: var(--text-dark);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    outline: none;
    transition: all 0.2s ease;
}

.freetext-input:focus {
    border-color: var(--gold-dark);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}

.btn-submit-freetext {
    padding: 0.85rem 1.4rem;
    white-space: nowrap;
}

.freetext-hint {
    font-size: 0.85rem;
    color: var(--text-dark-muted);
    font-style: italic;
}

/* ==========================================================================
   FEEDBACK MODAL
   ========================================================================== */

.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 16, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.feedback-overlay.active {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.feedback-card {
    background: var(--bg-surface);
    border: 2px solid var(--gold);
    border-radius: 16px;
    max-width: 580px;
    width: 100%;
    padding: 2.2rem;
    box-shadow: var(--shadow-deep), var(--shadow-gold);
    text-align: center;
}

.feedback-header {
    margin-bottom: 1.2rem;
}

.feedback-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.feedback-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    letter-spacing: 0.5px;
}

.feedback-card.is-correct .feedback-title {
    color: #2ecc71;
}

.feedback-card.is-wrong .feedback-title {
    color: #e74c3c;
}

.feedback-message {
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

.lore-explanation-box {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.2rem;
    text-align: left;
    margin-bottom: 1.8rem;
}

.lore-explanation-box strong {
    color: var(--gold);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.3rem;
}

.lore-explanation-box p {
    font-family: var(--font-book);
    font-size: 1.05rem;
    color: #e2e4ec;
    line-height: 1.45;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, #b89025 100%);
    color: #12141f;
    border: none;
    border-radius: 10px;
    padding: 0.85rem 1.8rem;
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    background: linear-gradient(135deg, #e3c457 0%, var(--gold) 100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--gold);
}

/* Band-Abschluss Modal */
.book-completed-card {
    border-color: #2ecc71;
    box-shadow: var(--shadow-deep), 0 0 35px rgba(46, 204, 113, 0.4);
}

.trophy-crest {
    font-size: 3.5rem;
    margin-bottom: 0.8rem;
    animation: bounceTrophy 1.5s infinite alternate ease-in-out;
}

@keyframes bounceTrophy {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.congrats-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 0.8rem;
}

.congrats-text {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 2rem;
}

/* ==========================================================================
   ADMIN BEREICH (EXCEL-PFLEGE)
   ========================================================================== */

.admin-container {
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

.admin-header-title {
    margin-bottom: 2rem;
}

.admin-header-title h1 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.admin-header-title p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 800px;
    line-height: 1.5;
}

.admin-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.admin-card {
    background: var(--bg-surface);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 14px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.card-icon {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
}

.admin-card h2 {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    color: var(--gold);
    margin-bottom: 0.6rem;
}

.admin-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 1.5rem;
    flex: 1;
}

.upload-dropzone {
    border: 2px dashed rgba(212, 175, 55, 0.4);
    border-radius: 10px;
    padding: 1.8rem 1rem;
    text-align: center;
    background: rgba(212, 175, 55, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

.file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.4rem;
}

.dropzone-label {
    display: block;
    font-weight: 600;
    color: var(--text-light);
    font-size: 1rem;
}

.dropzone-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.upload-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: var(--gold);
    font-size: 0.95rem;
}

.spinner-circle {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(212, 175, 55, 0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.stats-overview-box {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1.8rem 2rem;
    margin-bottom: 2.5rem;
}

.stats-overview-box h2 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--gold);
    margin-bottom: 1.2rem;
}

.stats-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-pill {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.8rem 1.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.pill-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold);
}

.pill-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alert-box {
    padding: 1rem 1.4rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert-box.success {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid #2ecc71;
    color: #a3e9be;
}

.alert-box.error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid #e74c3c;
    color: #f1a9a0;
}

.guide-box {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 2rem;
}

.guide-box h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--gold);
    margin-bottom: 1.2rem;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.guide-table th, .guide-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.guide-table th {
    color: var(--gold);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.02);
}

.guide-table code {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

/* ==========================================================================
   RESPONSIVITÄT
   ========================================================================== */

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

    .grimoire-book {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .grimoire-binding {
        display: none;
    }

    .page-left {
        border-right: none;
        border-bottom: 2px dashed var(--border-parchment);
    }

    .admin-cards-grid {
        grid-template-columns: 1fr;
    }

    .books-container {
        gap: 0.8rem;
    }

    .book-3d {
        width: 70px;
        height: 260px;
    }
}
