:root {
    --forest-deep: #16382b;
    --forest-green: #2d6a4f;
    --forest-light: #52b788;
    --forest-pale: #e8f5e9;
    --accent-gold: #f4a261;
    --gold-bright: #ffb703;
    --danger-soft: #e76f51;
    --danger-red: #d90429;
    --bg-page: #f2f7f4;
    --card-bg: #ffffff;
    --text-main: #1d2d26;
    --text-muted: #52796f;
    --border-light: rgba(45, 106, 79, 0.15);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(22, 56, 43, 0.12);
    --shadow-lg: 0 16px 36px rgba(22, 56, 43, 0.18);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Nunito', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 60px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
    color: white;
    padding: 24px 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

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

.brand-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.brand-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.level-badge {
    background: rgba(255, 183, 3, 0.25);
    border: 1px solid #ffd166;
    color: #ffd166;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
}

.header-brand h1 {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0 0 4px 0;
}

.header-brand .subtitle {
    font-size: 1rem;
    opacity: 0.92;
    max-width: 620px;
}

.header-stats {
    display: flex;
    gap: 12px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.stat-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.85;
}

.stat-value {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffd166;
    margin-top: 2px;
}

/* ==========================================================================
   TOOLBAR: THEMENWELTEN, SUCHE & STATUSFILTER
   ========================================================================== */
.filter-toolbar-wrap {
    background: white;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 20px;
}

.filter-toolbar {
    max-width: 1150px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 520px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    opacity: 0.5;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 10px 38px 10px 40px;
    border: 2px solid #d8e2dc;
    border-radius: var(--radius-full);
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    background: #f8fbf9;
    outline: none;
    transition: all 0.2s ease;
}

.search-box input:focus {
    border-color: var(--forest-green);
    background: white;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.btn-clear-search {
    position: absolute;
    right: 12px;
    background: #e2e8f0;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
    color: #4a5568;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clear-search.hidden {
    display: none;
}

.category-pills-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.category-pills-row::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    background: #f0f4f2;
    border: 1px solid #d0ded6;
    color: var(--text-main);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 7px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.cat-pill:hover {
    background: var(--forest-pale);
    border-color: var(--forest-light);
}

.cat-pill.active {
    background: var(--forest-green);
    color: white;
    border-color: var(--forest-green);
    box-shadow: 0 4px 10px rgba(45, 106, 79, 0.2);
}

.status-filters-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.filter-label {
    font-weight: 800;
    color: var(--text-muted);
    margin-right: 4px;
}

.status-btn {
    background: transparent;
    border: none;
    color: #555;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    transition: all 0.2s;
}

.status-btn:hover {
    background: #eef2f0;
}

.status-btn.active {
    background: #2b3a42;
    color: white;
}

/* ==========================================================================
   ALBUM CONTAINER & SETS
   ========================================================================== */
.album-container {
    max-width: 1150px;
    margin: 28px auto 0;
    padding: 0 20px 80px 20px;
}

.set-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 26px 24px;
    margin-bottom: 32px;
    border: 1px solid var(--border-light);
}

.set-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--forest-pale);
    padding-bottom: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 14px;
}

.set-title-group h2 {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.65rem;
    color: var(--forest-deep);
    display: flex;
    align-items: center;
    gap: 10px;
}

.set-title-group p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
    max-width: 700px;
}

.set-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-learn-station {
    background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
    color: white;
    border: none;
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 0.95rem;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.25);
    transition: all 0.2s;
}

.btn-learn-station:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #388664 0%, #245842 100%);
    box-shadow: 0 6px 16px rgba(45, 106, 79, 0.35);
}

.set-meta-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.set-difficulty-badge,
.set-grade-badge {
    font-weight: 800;
    font-size: 0.78rem;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid transparent;
}

.set-difficulty-badge.diff-entdecker {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.set-difficulty-badge.diff-forscher {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.set-difficulty-badge.diff-experte {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

.set-progress-badge {
    background: var(--forest-pale);
    color: var(--forest-green);
    font-weight: 800;
    font-size: 0.85rem;
    padding: 5px 14px;
    border-radius: var(--radius-full);
}

.set-progress-badge.completed {
    background: linear-gradient(135deg, #ffd166, #ffb703);
    color: #432800;
}

/* ==========================================================================
   CARDS GRID (IPAD QUERFORMAT ca. 16:9)
   ========================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 22px;
}

.album-card {
    position: relative;
    border-radius: var(--radius-md);
    aspect-ratio: 16 / 10;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease;
    box-shadow: var(--shadow-sm);
    border: 3px solid #d8e2dc;
    background: #e9ecef;
    user-select: none;
}

.album-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.album-card.unlocked {
    border-color: var(--forest-light);
    box-shadow: 0 8px 20px rgba(45, 106, 79, 0.18);
}

.album-card.unlocked:hover {
    box-shadow: 0 12px 28px rgba(45, 106, 79, 0.3);
}

.card-img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.album-card:hover .card-img-cover {
    transform: scale(1.05);
}

.card-overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 14px 10px;
    background: linear-gradient(0deg, rgba(15, 34, 25, 0.9) 0%, rgba(15, 34, 25, 0.5) 70%, transparent 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-overlay-name {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
}

.card-overlay-action {
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.25);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(4px);
}

.card-corner-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(22, 56, 43, 0.85);
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.album-card.locked {
    background: linear-gradient(135deg, #2b3a42 0%, #1a252c 100%);
    border-color: #495867;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 16px;
}

.locked-icon-wrap {
    width: 58px;
    height: 58px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.album-card.locked:hover .locked-icon-wrap {
    transform: scale(1.15) rotate(-5deg);
    background: rgba(82, 183, 136, 0.2);
    border-color: var(--forest-light);
}

.locked-title {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e6ed;
    margin-bottom: 4px;
}

.locked-cta {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffd166;
    background: rgba(255, 209, 102, 0.15);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.album-card.cooldown {
    border-color: var(--danger-soft);
    background: linear-gradient(135deg, #3a2220 0%, #201312 100%);
    cursor: not-allowed;
}

.cooldown-badge {
    background: rgba(231, 111, 81, 0.95);
    color: white;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    box-shadow: 0 4px 10px rgba(217, 4, 41, 0.3);
}

.master-set-banner {
    margin-top: 24px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff1c2 100%);
    border: 2px dashed #f4a261;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.master-set-banner.unlocked {
    background: linear-gradient(135deg, #fffaeb 0%, #ffeaa7 100%);
    border: 2px solid #ffd166;
    box-shadow: 0 6px 16px rgba(255, 183, 3, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.master-set-banner.unlocked:hover {
    transform: scale(1.01);
}

.master-banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.master-banner-icon {
    font-size: 2.2rem;
    background: white;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.master-banner-info h3 {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.15rem;
    color: #6a4c00;
}

.master-banner-info p {
    font-size: 0.85rem;
    color: #8c6800;
}

.btn-banner-inspect {
    background: #ffb703;
    color: #3b2600;
    border: none;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-banner-inspect:hover {
    background: #ffa200;
}

.empty-search-state {
    text-align: center;
    background: white;
    padding: 48px 24px;
    border-radius: var(--radius-lg);
    border: 2px dashed #cbd5e1;
    margin: 20px 0;
}

.empty-search-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.empty-search-state h3 {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.4rem;
    color: var(--text-main);
}

.empty-search-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 6px;
}

/* ==========================================================================
   LERN-MODUS / FORSCHER-STATION MODAL
   ========================================================================== */
.learn-dialog {
    max-width: 900px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: #fdfdfd;
}

.learn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
    color: white;
}

.learn-header-info {
    display: flex;
    flex-direction: column;
}

.learn-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    display: inline-block;
    width: fit-content;
    margin-bottom: 4px;
}

.learn-header h2 {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.55rem;
}

.learn-header .btn-icon-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.learn-tabs-scroll {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #edf4f0;
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    scrollbar-width: thin;
}

.learn-tab-btn {
    background: white;
    border: 1px solid #c9d9cf;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-family: 'Nunito', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.learn-tab-btn:hover {
    border-color: var(--forest-green);
    background: #f5fbf7;
}

.learn-tab-btn.active {
    background: var(--forest-green);
    color: white;
    border-color: var(--forest-green);
    box-shadow: 0 4px 10px rgba(45, 106, 79, 0.25);
}

.learn-body {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.learn-media-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.learn-image-wrap {
    position: relative;
    border-radius: var(--radius-md);
    aspect-ratio: 16 / 10;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 3px solid var(--forest-light);
    background: #111;
}

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

.learn-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(22, 56, 43, 0.85);
    color: #ffd166;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.learn-sub-facts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.learn-content-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

.learn-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--forest-pale);
    padding-bottom: 10px;
}

.learn-title-row h3 {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.55rem;
    color: var(--forest-deep);
}

.learn-text-box {
    background: #fbfdfc;
    border: 1px solid #e2ece6;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

/* Didaktischer Lesetext: Natürlich, ohne künstliche Markierungen */
.learn-reading-text {
    font-size: 1.06rem;
    line-height: 1.65;
    color: #24332b;
}

.learn-secret-box {
    background: #fff8e7;
    border-left: 4px solid var(--gold-bright);
    padding: 12px 16px;
    border-radius: 6px;
}

.learn-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #f8fbf9;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 12px;
}

.learn-nav-group {
    display: flex;
    gap: 10px;
}

.btn-nav-step {
    background: white;
    border: 1px solid #cbd5e1;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #475569;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav-step:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.btn-learn-quiz-cta {
    background: linear-gradient(135deg, #f4a261 0%, #e76f51 100%);
    color: white;
    border: none;
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.1rem;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(231, 111, 81, 0.35);
    transition: all 0.2s;
}

.btn-learn-quiz-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(231, 111, 81, 0.45);
}

/* ==========================================================================
   MODAL SYSTEM & 3D FLIP-CARD
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(14, 28, 22, 0.75);
    backdrop-filter: blur(6px);
}

.modal-dialog {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    box-shadow: var(--shadow-lg);
    z-index: 2001;
    overflow: hidden;
    animation: modalPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPopIn {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #f8fbf9;
    border-bottom: 1px solid var(--border-light);
}

.modal-hint {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--forest-green);
}

.btn-icon-close {
    background: #edf2f7;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    color: #4a5568;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.btn-icon-close:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

/* 3D Flip Card */
.card-dialog {
    max-width: 680px;
    background: #fdfdfd;
}

.flip-card-stage {
    perspective: 1200px;
    padding: 24px;
    display: flex;
    justify-content: center;
    background: radial-gradient(circle, #f4fbf7 0%, #e6f4ed 100%);
}

.flip-card-inner {
    position: relative;
    width: 100%;
    max-width: 580px;
    aspect-ratio: 16 / 10;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.4, 0.2, 0.2, 1);
    cursor: pointer;
}

.flip-card-inner.flipped {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.flip-card-front {
    background: #111;
    border: 4px solid #ffd166;
}

.card-frame {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card-header-bar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    z-index: 2;
}

.card-badge {
    background: rgba(22, 56, 43, 0.85);
    color: #ffd166;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-number-badge {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.card-image-wrap {
    width: 100%;
    height: 100%;
    position: relative;
}

.card-hires-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-shine-fx {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-25deg);
    animation: foilShine 4.5s infinite;
    pointer-events: none;
}

@keyframes foilShine {
    0%, 75% { left: -100%; }
    100% { left: 200%; }
}

.card-footer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 16px;
    background: linear-gradient(0deg, rgba(14, 28, 22, 0.95) 0%, rgba(14, 28, 22, 0.6) 70%, transparent 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

.card-front-title {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.card-flip-prompt {
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.25);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

/* Rückseite im Modal */
.flip-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #ffffff 0%, #f7faf8 100%);
    border: 4px solid var(--forest-green);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
}

.card-back-frame {
    padding: 16px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.back-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--forest-pale);
    padding-bottom: 8px;
}

.back-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--forest-green);
}

.back-title-group h3 {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.3rem;
    color: var(--forest-deep);
}

.btn-audio-pill {
    background: var(--forest-pale);
    color: var(--forest-green);
    border: 1px solid var(--forest-light);
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    pointer-events: auto;
    z-index: 10;
}

.btn-audio-pill:hover {
    background: var(--forest-green);
    color: white;
}

.btn-audio-pill.speaking {
    background: #ffd166;
    color: #432800;
    animation: audioPulse 1s infinite alternate;
}

@keyframes audioPulse {
    from { transform: scale(1); }
    to { transform: scale(1.06); }
}

.steckbrief-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.fact-box {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.fact-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.fact-info {
    display: flex;
    flex-direction: column;
}

.fact-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.fact-text {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--forest-deep);
    line-height: 1.2;
}

.secret-box {
    background: #fff8e7;
    border-left: 4px solid var(--gold-bright);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 4px;
}

.secret-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #b7791f;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.secret-text {
    font-size: 0.85rem;
    color: #5c3c00;
    line-height: 1.35;
    font-weight: 600;
}

.back-footer {
    text-align: center;
}

.back-hint {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.card-actions-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    background: #f8fbf9;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.btn-action-primary {
    background: var(--forest-green);
    color: white;
    border: none;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
}

.btn-action-primary:hover {
    background: #1b4332;
    transform: translateY(-2px);
}

.btn-action-listen {
    background: #f4a261;
    color: #432800;
}

.btn-action-listen:hover {
    background: #e76f51;
    color: white;
}

.btn-action-listen.speaking {
    background: #ffd166;
    animation: audioPulse 1s infinite alternate;
}

.btn-action-secondary {
    background: #edf2f7;
    color: #4a5568;
    border: none;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-action-secondary:hover {
    background: #e2e8f0;
}

/* ==========================================================================
   QUIZ & CELEBRATION MODALS
   ========================================================================== */
.quiz-dialog {
    max-width: 580px;
}

.quiz-header {
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
    color: white;
    padding: 20px 24px;
    position: relative;
}

.quiz-badge-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.quiz-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.progress-pill {
    font-size: 0.78rem;
    font-weight: 800;
    color: #ffd166;
}

.quiz-header h2 {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.5rem;
}

.quiz-header .btn-icon-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.quiz-body {
    padding: 24px;
}

.question-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--forest-pale);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border-left: 5px solid var(--forest-green);
}

.question-text {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--forest-deep);
    flex: 1;
    line-height: 1.4;
}

.btn-speak-icon {
    background: white;
    border: 2px solid var(--forest-light);
    color: var(--forest-green);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-speak-icon:hover {
    background: var(--forest-green);
    color: white;
    transform: scale(1.1);
}

.btn-speak-icon.speaking {
    background: #ffd166;
    animation: audioPulse 0.8s infinite alternate;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-quiz-option {
    background: white;
    border: 2px solid #d8e2dc;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    text-align: left;
    font-family: 'Nunito', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.btn-quiz-option:hover {
    border-color: var(--forest-light);
    background: var(--forest-pale);
    transform: translateX(4px);
}

.btn-quiz-option.correct {
    background: #d8f3dc;
    border-color: #52b788;
    color: #1b4332;
}

.btn-quiz-option.wrong {
    background: #ffe3e3;
    border-color: #e76f51;
    color: #b7094c;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-5px); }
}

.quiz-footer {
    padding: 14px 24px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    background: #fafcfb;
    flex-wrap: wrap;
    gap: 12px;
}

.quiz-fair-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.btn-text-cancel {
    background: none;
    border: none;
    font-family: 'Nunito', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #718096;
    cursor: pointer;
    text-decoration: underline;
}

.btn-text-cancel:hover {
    color: var(--danger-soft);
}

/* Master Dialog */
.master-dialog {
    max-width: 560px;
    background: linear-gradient(180deg, #fffbee 0%, #ffffff 100%);
    text-align: center;
    padding: 32px 24px;
}

.master-crown {
    font-size: 3.5rem;
    display: inline-block;
    animation: bounceCrown 1.2s infinite alternate;
}

@keyframes bounceCrown {
    from { transform: translateY(0) rotate(-5deg); }
    to { transform: translateY(-10px) rotate(5deg); }
}

.master-header h2 {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 2rem;
    color: #5c3c00;
    margin-top: 4px;
}

.master-congrats-sub {
    font-size: 0.95rem;
    color: #8c6800;
    margin-top: 4px;
}

.master-showcase-card {
    margin: 22px auto;
    max-width: 440px;
    border: 4px solid #ffd166;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(255, 183, 3, 0.35);
    background: white;
    cursor: pointer;
    transition: transform 0.25s ease;
}

.master-showcase-card:hover {
    transform: scale(1.03);
}

.master-glow-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.master-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.master-ribbon {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, #ffd166, #ff9f1c);
    color: #432800;
    font-weight: 900;
    font-size: 0.78rem;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.master-info-box {
    padding: 14px;
    background: #fffdf5;
}

.master-info-box h3 {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.3rem;
    color: #5c3c00;
}

.master-info-box p {
    font-size: 0.88rem;
    color: #6a4c00;
    margin-top: 4px;
}

.master-click-hint {
    margin-top: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #e76f51;
}

.btn-celebrate {
    background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
    color: white;
    border: none;
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.2rem;
    padding: 14px 34px;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(45, 106, 79, 0.3);
    transition: all 0.2s;
}

.btn-celebrate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(45, 106, 79, 0.4);
}

/* ==========================================================================
   RESPONSIVE (IPAD & MOBILE)
   ========================================================================== */
@media (max-width: 820px) {
    .learn-body {
        grid-template-columns: 1fr;
    }
    .learn-image-wrap {
        max-width: 400px;
        margin: 0 auto;
    }
    .learn-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .learn-nav-group {
        justify-content: space-between;
    }
    .btn-learn-quiz-cta {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-stats {
        width: 100%;
    }
    .stat-card {
        flex: 1;
    }
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .flip-card-stage {
        padding: 12px;
    }
    .card-dialog {
        max-height: 95vh;
        overflow-y: auto;
    }
}

/* ==========================================================================
   USER SESSION, LOGIN & FORSCHER-PASS STYLES
   ========================================================================== */

.user-session-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(2, 132, 199, 0.2);
}

.student-profile-header-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.student-profile-header-btn:hover {
    background: rgba(2, 132, 199, 0.08);
}

.student-avatar-badge {
    font-size: 1.6rem;
    line-height: 1;
}

.student-info-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.student-name-text {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.2;
}

.student-school-text {
    font-size: 0.75rem;
    color: var(--forest-green);
    font-weight: 700;
}

.btn-session-logout {
    font-size: 0.78rem;
    font-weight: 700;
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-session-logout:hover {
    background: #fee2e2;
    color: #dc2626;
}

.btn-open-login {
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--forest-mid) 100%);
    color: white;
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-open-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.35);
}

.btn-teacher-workspace-link {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-teacher-workspace-link:hover {
    background: #bae6fd;
    color: #0284c7;
}

.app-alert-banner {
    max-width: 1400px;
    margin: 12px auto 0 auto;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.app-alert-banner.alert-danger {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-close-btn {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: inherit;
    cursor: pointer;
    padding: 0 4px;
}

/* Auth Dialog Modal */
.auth-dialog {
    max-width: 440px;
    padding: 28px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-soft);
    box-shadow: var(--shadow-lg);
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--forest-pale);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.auth-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.form-group-field label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
}

.auth-input {
    padding: 12px 14px;
    border: 2px solid var(--border-soft);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--forest-green);
    box-shadow: 0 0 0 3px rgba(46, 117, 89, 0.15);
}

.auth-submit-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.btn-auth-primary {
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--forest-mid) 100%);
    color: white;
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(46, 117, 89, 0.25);
    transition: all 0.2s;
}

.btn-auth-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(46, 117, 89, 0.35);
}

.btn-auth-secondary {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-auth-secondary:hover {
    background: #e2e8f0;
}

.auth-help-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    background: var(--forest-pale);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    line-height: 1.5;
    margin-top: 4px;
}

/* Forscher-Pass / Profile Dialog */
.profile-dialog {
    max-width: 480px;
    padding: 28px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 2px solid var(--gold-pale);
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.15);
}

.profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #fef3c7;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.profile-avatar-large {
    font-size: 2.8rem;
    background: #fef3c7;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fde68a;
}

.profile-rank-card {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    border: 2px solid #facc15;
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    margin-bottom: 20px;
}

.profile-rank-badge {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.4rem;
    color: #854d0e;
    font-weight: 700;
}

.profile-rank-sub {
    font-size: 0.85rem;
    color: #a16207;
    margin-top: 4px;
}

.profile-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.profile-stat-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.profile-stat-val {
    display: block;
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--forest-deep);
}

.profile-stat-lbl {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.profile-save-status {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 0.82rem;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: 20px;
}

.profile-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-profile-logout {
    color: #dc2626;
    background: #fee2e2;
    border: 1px solid #fecaca;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-profile-logout:hover {
    background: #fca5a5;
    color: #991b1b;
}

.btn-profile-close {
    background: var(--forest-green);
    color: white;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
}

/* Footer Links */
.app-page-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-soft);
    padding: 24px 20px;
    margin-top: 60px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-inner a {
    color: var(--forest-green);
    text-decoration: none;
}

.footer-inner a:hover {
    text-decoration: underline;
}

.footer-links {
    display: flex;
    gap: 12px;
}

.app-alert-banner.alert-success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* Password Change in Student Profile */
.profile-password-box {
    margin-top: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    background: #f8fafc;
    padding: 12px 14px;
}

.btn-toggle-pw-change {
    width: 100%;
    background: transparent;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0369a1;
    cursor: pointer;
    padding: 2px 0;
}

.btn-toggle-pw-change:hover {
    color: #0284c7;
}

.profile-pw-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
}

.btn-save-pw {
    background: var(--forest-green);
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    margin-top: 6px;
    transition: all 0.2s ease;
}

.btn-save-pw:hover {
    background: var(--forest-deep);
}