/* ============================================================================
   HEKTOR – Dashboard & Analytics (Bereinigte Grid-Architektur)
   ========================================================================== */

:root {
    --cat-uebergang: #6dbf96;
    --cat-analysis:  #7aaee0;
    --cat-linalg:    #d97a7a;

    /* Globale Panel-Werte, erzwingen Einheitlichkeit */
    --panel-bg: #fdfaf7;
    --panel-border: rgba(30, 67, 73, 0.08);
    --panel-radius: 24px;
}

body.hd-body {
    min-height: 100vh;
    background: radial-gradient(circle at 82% -10%, #faece3 0%, rgba(250,236,227,0) 45%), var(--bg-main);
    background-attachment: fixed;
}

/* Mobile Home-Button (auf dem PC unsichtbar) */
.mobile-home-btn {
    display: none;
}

/* ── Mathematischer Hintergrund (Canvas) ── */
#math-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Banner */
.announcement-banner { position: fixed; top: 83px; left: 0; width: 100%; background-color: var(--primary); padding: 12px 5%; display: flex; align-items: center; justify-content: center; gap: 16px; z-index: 900; border-bottom: 3px solid var(--accent); padding-right: 40px; }
.badge-new { background-color: var(--accent); color: var(--primary); padding: 4px 10px; border-radius: 6px; font-weight: 800; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.announcement-text { font-size: 0.95rem; font-weight: 500; color: rgba(255, 255, 255, 0.9); }
.announcement-link { color: var(--accent); font-weight: 700; text-decoration: none; font-size: 0.95rem; transition: opacity 0.2s ease; }
.announcement-link:hover { opacity: 0.8; text-decoration: underline; }
.close-banner { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: rgba(255, 255, 255, 0.6); font-size: 1.5rem; cursor: pointer; transition: color 0.2s; display: flex; align-items: center; justify-content: center; }
.close-banner:hover { color: white; }

/* Erhöhe den ersten Wert (128px), z.B. auf 250px */
.hd-main { max-width: 1440px; margin: 0 auto; padding: 128px 5% 96px; }



/* Platzhalter für Mobile (Standard: unsichtbar) */
.mobile-media-spacer {
    display: none;
}

/* ── Puristischer Kopf ── */
.hd-head { margin-bottom: 48px; }
.hd-eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.hd-greeting { font-family: 'Fraunces', serif; font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.08; letter-spacing: -0.02em; color: var(--text-main); }
.hd-subline { margin-top: 12px; color: var(--text-muted); font-size: 1.05rem; max-width: 52ch; line-height: 1.6; }

/* ── Das deterministische Haupt-Raster ── */
.hd-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 40px 32px; /* 40px vertikal, 32px horizontal */
    align-items: stretch; /* Zwingt Container der selben Zeile auf exakt dieselbe Höhe */
}

/* ── Das Modul-Konzept (Titel + Karte) ── */
.hd-module { display: flex; flex-direction: column; }
.hd-module-title { font-family: 'Fraunces', serif; font-size: 1.25rem; color: var(--text-main); margin: 0 0 16px 4px; line-height: 1.2; }
.hd-module-title.spacer { opacity: 0; pointer-events: none; user-select: none; } /* Unsichtbarer Platzhalter für perfekte Ausrichtung */

/* ── Die universelle Basis-Karte (Verhindert unterschiedliche Designs) ── */
.hd-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--panel-radius);
    padding: 32px;
    box-shadow: 0 4px 24px rgba(30, 67, 73, 0.03);
    display: flex;
    flex-direction: column;
    flex: 1; /* Dehnt sich aus, um das Raster auszufüllen (Höhensynchronisation) */
    box-sizing: border-box;
    overflow: hidden;
}

.daily-label { font-size: 0.75rem; text-transform: uppercase; font-weight: 800; letter-spacing: 0.08em; color: var(--text-muted); margin: 0; }
.center-label { color: var(--primary); margin-bottom: 16px; text-align: center; }

/* ── Z1: Fortschritt & XP ── */
.hd-progress { justify-content: space-between; }
.hd-progress-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.hd-progress-top h2 { font-family: 'Fraunces', serif; font-size: 1.3rem; color: var(--text-main); margin: 0; }
.hd-progress-figures { display: flex; align-items: baseline; gap: 12px; }
.hd-progress-figures .pct { font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.hd-progress-figures .count { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }

.hd-bar { height: 12px; width: 100%; background: rgba(30, 67, 73, 0.06); border-radius: 50px; overflow: hidden; }
.hd-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #f7b48f); border-radius: 50px; transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1); }

.hd-cats { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 20px; }
.hd-cat { display: flex; align-items: center; gap: 9px; font-size: 0.88rem; color: var(--text-muted); }
.hd-cat .dot { width: 10px; height: 10px; border-radius: 50%; }
.hd-cat[data-cat="uebergang"] .dot { background: var(--cat-uebergang); }
.hd-cat[data-cat="analysis"]  .dot { background: var(--cat-analysis); }
.hd-cat[data-cat="linalg"]    .dot { background: var(--cat-linalg); }
.hd-cat strong { color: var(--text-main); font-weight: 700; }

.hd-xp { justify-content: space-between; }
.gami-header { display: flex; justify-content: space-between; align-items: center; }
.gami-header .label { font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); font-weight: 800; letter-spacing: 0.08em; }
.value-level { font-family: 'Geist', sans-serif; font-size: 0.9rem; font-weight: 700; color: var(--primary); background: rgba(249, 160, 119, 0.12); padding: 4px 12px; border-radius: 8px; }

.xp-meta { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 10px; }
.xp-meta .label { font-size: 0.8rem; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; }
.xp-meta .value { font-family: 'Geist', monospace; font-size: 1.05rem; font-weight: 700; color: var(--text-main); }
.xp-bar-bg { background: rgba(30, 67, 73, 0.06); height: 14px; border-radius: 50px; overflow: hidden; }
.xp-bar-fill-gradient { background: linear-gradient(90deg, #6dbf96, var(--accent)); height: 100%; width: 0%; border-radius: 50px; transition: width 1s ease; }

/* ── Z2: Fokus & Streak ── */
.hd-continue {
    flex-direction: row; /* Stellt das horizontale Layout wieder her */
    align-items: center;
    gap: 36px; /* Abstand zwischen Icon, Text und Buttons vergrößert (vorher 28px) */
    background: var(--primary);
    color: #fff;
    border: none;
    position: relative;
}
.hd-continue::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent 45%, #000 100%); -webkit-mask-image: linear-gradient(90deg, transparent 45%, #000 100%); }

/* Vergrößertes Badge (76px statt 60px) */
a.hd-continue-badge { width: 76px; height: 76px; border-radius: 18px; flex: none; display: grid; place-items: center; background: rgba(249, 160, 119, 0.18); border: 1px solid rgba(249, 160, 119, 0.4); position: relative; z-index: 2; cursor: pointer; transition: transform 0.2s ease; }
a.hd-continue-badge:hover { transform: scale(1.08); border-color: var(--accent); }
a.hd-continue-badge svg { width: 34px; height: 34px; stroke: var(--accent); } /* Vergrößertes Icon (34px statt 26px) */
a.hd-continue-badge[data-cat="uebergang"] { background: rgba(109,191,150,0.16); border-color: rgba(109,191,150,0.4); }
a.hd-continue-badge[data-cat="uebergang"] svg { stroke: var(--cat-uebergang); }
a.hd-continue-badge[data-cat="analysis"]  { background: rgba(122,174,224,0.16); border-color: rgba(122,174,224,0.4); }
a.hd-continue-badge[data-cat="analysis"]  svg { stroke: var(--cat-analysis); }
a.hd-continue-badge[data-cat="linalg"]    { background: rgba(217,122,122,0.16); border-color: rgba(217,122,122,0.4); }
a.hd-continue-badge[data-cat="linalg"]    svg { stroke: var(--cat-linalg); }

/* Skalierte Typografie */
.hd-continue-text { flex: 1 1 auto; min-width: 0; position: relative; z-index: 1; }
.hd-continue-kicker { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.hd-continue-title { font-family: 'Fraunces', serif; font-size: 1.85rem; line-height: 1.15; margin-bottom: 8px; color: #fff; } /* Titel von 1.55rem auf 1.85rem vergrößert */
.hd-continue-meta { font-size: 1.0rem; color: rgba(255, 255, 255, 0.72); line-height: 1.5; }

/* Skalierte Buttons */
.hd-continue-actions { display: flex; flex-direction: column; gap: 12px; flex: none; position: relative; z-index: 1; }
.hd-btn-light { background: var(--accent); color: var(--primary); text-align: center; text-decoration: none; padding: 16px 28px; border-radius: 50px; font-weight: 700; font-size: 1.02rem; white-space: nowrap; transition: transform 0.2s ease, box-shadow 0.2s ease; } /* Button massiver gemacht */
.hd-btn-light:hover { background: #fbb389; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(249, 160, 119, 0.28); }
.hd-link-ghost { color: rgba(255, 255, 255, 0.82); text-decoration: none; font-size: 0.9rem; font-weight: 500; text-align: center; }
.hd-link-ghost:hover { color: #fff; text-decoration: underline; }

.streak-showcase { display: flex; align-items: center; gap: 16px; padding: 8px 0; margin-bottom: 16px; }
.streak-flame { font-size: 3rem; line-height: 1; filter: drop-shadow(0 4px 12px rgba(249,160,119,0.3)); animation: flamePulse 2s infinite alternate ease-in-out; }
.streak-info { display: flex; flex-direction: column; gap: 4px; }
.streak-count { font-family: 'Fraunces', serif; font-size: 2.5rem; font-weight: 800; color: var(--primary); line-height: 1; }

.calendar-divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, rgba(30,67,73,0.1) 20%, rgba(30,67,73,0.1) 80%, transparent); margin: 0 0 20px 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day { background: rgba(30, 67, 73, 0.03); border: 1px solid var(--panel-border); border-radius: 10px; padding: 8px 2px; text-align: center; display: flex; flex-direction: column; gap: 8px; transition: all 0.2s ease; }
.calendar-day .day-name { font-size: 0.75rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; }
.calendar-day .day-status { font-size: 0.9rem; color: rgba(30, 67, 73, 0.15); }
.calendar-day.completed { background: rgba(249, 160, 119, 0.12); border-color: var(--accent); }
.calendar-day.completed .day-name { color: var(--primary); font-weight: 700; }
.calendar-day.completed .day-status { color: #6dbf96; }

/* ── Z3: Schnellzugriff & Meme ── */
/* Festes 2-Spalten-Raster verhindert, dass Karten kleiner werden (springen), wenn das Fenster breiter wird */
.hd-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.hd-card { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 20px; padding: 24px 20px; text-decoration: none; display: flex; flex-direction: column; gap: 12px; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.hd-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(30, 67, 73, 0.08); border-color: rgba(249, 160, 119, 0.5); }
.hd-card-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(249, 160, 119, 0.12); }
.hd-card-icon svg { width: 22px; height: 22px; stroke: var(--primary); }
.hd-card h3 { font-family: 'Fraunces', serif; font-size: 1.15rem; color: var(--text-main); margin: 0; }
.hd-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; flex: 1; margin: 0; }
.hd-card-cta { font-size: 0.85rem; font-weight: 700; color: var(--accent); display: inline-flex; gap: 6px; transition: gap 0.2s; }
.hd-card:hover .hd-card-cta { gap: 10px; }

/* ── NEUES MEME-DESIGN (Flach, Beige, Interaktiv) ── */
.hd-meme-panel {
    /* Hintergrund und Rahmen wurden entfernt, damit das Standard-Beige von .hd-panel greift */
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1), padding 0.4s ease, opacity 0.3s ease;
    max-height: 800px; /* <-- HIER: Wert erhöhen, damit die Box mit dem Schnellzugriff aufschließen kann */
    opacity: 1;
}

.hd-meme-panel.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
}

.meme-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-bg);
    border: none;
    cursor: pointer;
    position: relative;
    min-height: 60px; /* Reduziert, damit die Box sich exakt dem Bild anpasst */
    width: 100%;
}

/* Bild & Canvas in den normalen Dokumentenfluss bringen, damit die Container-Höhe adaptiv ist */
.meme-container img,
.meme-container canvas {
    position: relative;
    display: block;
    width: 100%;
    height: auto; /* Höhe skaliert natürlich mit der Breite/Proportion des Memes */
    object-fit: contain;
    border-radius: 8px;
    transition: opacity 0.1s ease;
}

.meme-container:active img {
    opacity: 0.3;
}

.meme-hint {
    text-align: center;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted); /* Auf dunkle Schrift gewechselt für den beigen Hintergrund */
    font-weight: 700;
}

/* ── Z4: Abzeichen & Zitat ── */
.hd-badges {
    padding: 24px;
    overflow: visible !important; /* Verhindert das Abschneiden von Tooltips durch das globale Panel-Overflow */
}

.badge-grid-main {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.badge-item-main {
    position: relative;
    min-width: 0;
    background: rgba(30, 67, 73, 0.02);
    border: 2px solid transparent;
    padding: 16px 8px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    opacity: 0.4;
    filter: grayscale(100%);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer; /* Normaler Zeiger, kein Fragezeichen mehr */
}

/* Stacking-Context: Verhindert, dass nachfolgende Grid-Items den Tooltip überlagern */
.badge-item-main:hover,
.badge-item-main:focus,
.badge-item-main:active {
    z-index: 100;
}

.badge-item-main.unlocked {
    background: #ffffff;
    opacity: 1;
    filter: grayscale(0%);
    border-color: rgba(249, 160, 119, 0.3);
    box-shadow: 0 4px 12px rgba(30, 67, 73, 0.05);
}

.badge-item-main.unlocked:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(249, 160, 119, 0.2);
}

/* Tooltip-Logik (Nach unten gerichtet, zieht leicht in das Badge hinein) */
.badge-item-main::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% - 6px); /* Zieht den Tooltip in das Badge hinein, um Platzverletzungen unten zu vermeiden */
    left: 50%;
    transform: translateX(-50%) translateY(-10px); /* Startposition für das Einsliden */
    background: #1E4349;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    width: max-content;
    max-width: 180px;
    text-align: center;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 999;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

/* Kleiner Pfeil für den Tooltip (Zeigt nun nach oben zum Badge) */
.badge-item-main::before {
    content: '';
    position: absolute;
    top: calc(100% - 12px); /* 2px Overlap: Verschmilzt den Pfeil nahtlos mit der Box und eliminiert Subpixel-Gaps */
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    border-width: 0 8px 8px; /* Invertiert die Pfeilrichtung */
    border-style: solid;
    border-color: transparent transparent #1E4349 transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1000; /* Zwingt den Pfeil über den Border der Box (999) */
    pointer-events: none;
}

/* Anzeige bei Mouse-Hover ODER Touch-Fokus (Mobile Klick) - Auf alle Badges ausgeweitet */
.badge-item-main:hover::after,
.badge-item-main:focus::after,
.badge-item-main:active::after,
.badge-item-main:hover::before,
.badge-item-main:focus::before,
.badge-item-main:active::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Verstecke den nativen Browser-Fokusrahmen (Tooltip übernimmt das Feedback) */
.badge-item-main:focus {
    outline: none;
}


/* Innere Elemente für saubere Hover-Events sperren */
.badge-icon-main {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 2px;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.badge-name-main {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    width: 100%;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    line-height: 1.2;
    pointer-events: none;
}

/* Zeigt im eingeklappten Zustand exakt 10 Badges (2 Reihen à 5) auf dem PC */
.badge-grid-main.collapsed .badge-item-main:nth-child(n+11) {
    display: none;
}

/* Styling für den ausgelagerten Button oben rechts */
.btn-toggle-badges-out { background: none; border: none; color: var(--primary); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 0; opacity: 0.6; transition: opacity 0.2s ease, color 0.2s ease; }
.btn-toggle-badges-out:hover { opacity: 1; color: var(--accent); }
.btn-toggle-badges-out .toggle-arrow { width: 16px; height: 16px; transition: transform 0.3s; }

/* Container-Wraps für die entkoppelte untere Hälfte (Masonry-Style) */
.hd-col-wrapper {
    display: flex;
    flex-direction: column;
    gap: 40px; /* Synchronisiert mit dem vertikalen Grid-Gap (40px) */
}

/* Sichert das Layout gegen das JS align-self ab, damit Container in den Flex-Spalten nicht schrumpfen */
.hd-col-wrapper > .hd-module {
    width: 100%;
}

.hd-badges {
    padding: 24px 24px 16px 24px;
    overflow: visible !important; /* Zwingend nötig, damit Tooltips am oberen Rand nicht abgeschnitten werden */
}

/* ── Zitat & Tipp Box (Wiederherstellung des Designs) ── */
.hd-quote {
    padding: 0; /* Hebt das universelle Panel-Padding auf, damit Farben bis zum Rand gehen */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Verhindert, dass farbige Ecken über den Panel-Radius ragen */
}

.quote-section {
    background: #1E4349; /* HEKTOR Dunkelgrün */
    color: #ffffff;
    padding: 32px;
    flex: 1;
}

.quote-section .daily-label {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    display: block;
}

.quote-text {
    font-family: 'Fraunces', serif;
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.4;
    margin: 16px 0;
}

.quote-author {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #F9A077; /* HEKTOR Orange */
    text-align: right;
    font-weight: 700;
}

.tip-section {
    background: var(--panel-bg); /* Nutzt das globale Beige des Themes */
    padding: 32px;
    flex: 1;
}

.tip-section .daily-label {
    color: var(--text-muted);
    margin-bottom: 12px;
    display: block;
}

.tip-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-main);
}

/* ── Footer ── */
.footer-action { background-color: var(--primary); color: white; padding: 40px 5% 40px 5%; text-align: center; position: relative; z-index: 10; margin-top: 64px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; max-width: 1440px; margin: 0 auto; } /* Zwingend synchronisiert mit .hd-main */
.footer-links { display: flex; gap: 32px; }
.footer-links a { color: rgba(255, 255, 255, 0.5); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

/* ── Mobile Layout (Einspaltig) ── */
@media (max-width: 1000px) {
    /* Zwingt die Karten auf Mobile untereinander, da auto-fit entfernt wurde */
    .hd-grid {
        grid-template-columns: 1fr;
    }

    .navbar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        height: 70px !important;
        min-height: 70px !important;
        max-height: 70px !important;
        padding: 0 16px !important;
        box-sizing: border-box !important;
        position: fixed !important; /* Fixiert die Navbar am oberen Rand */
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
    }

    /* NEU: Das Styling & Positionierung für den Home-Button */
    .mobile-home-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute; /* Klebt den Button unabhängig vom zentrierten Logo fest */
        left: 16px;
        top: 50%;
        transform: translateY(-50%); /* Exakte vertikale Zentrierung */
        width: 42px;
        height: 42px;
        color: var(--primary);
        background: rgba(30, 67, 73, 0.05); /* Leichter Touch-Hintergrund */
        border-radius: 12px;
        transition: all 0.2s ease;
    }

    .mobile-home-btn svg {
        width: 20px;
        height: 20px;
    }

    .mobile-home-btn:active {
        background: rgba(30, 67, 73, 0.1);
        transform: translateY(-50%) scale(0.95); /* Schöner Druck-Effekt */
    }

    /* Banner */
    .announcement-banner {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--primary);
        padding: 12px 5%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 16px;
        z-index: 900;
        border-bottom: 3px solid var(--accent);
        padding-right: 40px;
    }

    .badge-new {
        background-color: var(--accent);
        color: var(--primary);
        padding: 4px 10px;
        border-radius: 6px;
        font-weight: 800;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .announcement-text {
        font-size: 0.75rem;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.9);
    }

    .announcement-link {
        color: var(--accent);
        font-weight: 700;
        text-decoration: none;
        font-size: 0.75rem;
        transition: opacity 0.2s ease;
    }

    .announcement-link:hover {
        opacity: 0.8;
        text-decoration: underline;
    }

    .close-banner {
        position: absolute;
        right: 0px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.6);
        font-size: 1.5rem;
        cursor: pointer;
        transition: color 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .close-banner:hover {
        color: white;
    }

    .nav-brand {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        /* NEU: Stellt sicher, dass Bild und Text mittig nebeneinander stehen */
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }

    /* NEU: Verkleinert das Logo-Icon (den März-Vogel) */
    .brand-icon {
        height: 28px !important;
        width: auto !important;
        transform: translateY(3px) !important;
    }

    /* NEU: Verkleinert die Schrift "März.Akademie" */
    .brand-text-dark,
    .brand-text-light {
        font-size: 1.2rem !important;
        line-height: normal !important;
    }

    .nav-links {
        display: none !important;
    }

    .hd-main { padding-top: 108px; }

    /* Aktiviert den unsichtbaren 100px Abstand auf Mobile */
    .mobile-media-spacer {
        display: block;
        height: 60px;
        width: 100%;
        pointer-events: none; /* Verhindert, dass das leere Feld versehentlich Klicks blockiert */
    }

    /* Aufbrechen in eine Single-Column mit korrekter Sortierung */
    .hd-dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .hd-module-title.spacer { display: none; } /* Leere Header verschwinden auf Mobile restlos */

    .hd-col-wrapper { display: contents; } /* Löst die Spalten auf Mobile auf, Container fließen als Kinder zurück ins Grid */

    /* Strikte Neusortierung der Reihenfolge per expliziter IDs (verhindert nth-child DOM Fehler) */
    .hd-dashboard-grid > :nth-child(1) { order: 1; } /* Progress */
    .hd-dashboard-grid > :nth-child(2) { order: 2; } /* XP / Rang */
    .hd-dashboard-grid > :nth-child(3) { order: 3; } /* Fokus */
    .hd-dashboard-grid > :nth-child(4) { order: 4; } /* Streak */
    #module-quick { order: 5; }
    #module-meme { order: 6; }
    #module-badges { order: 7; }
    #module-quote { order: 8; }

    /* Modul-Anpassungen für Mobile: Meme Box Optimierung */
    .hd-meme-panel { padding: 16px; }
    .meme-container { min-height: 240px; }

    /* Modul-Anpassungen für Mobile */
    .hd-continue { flex-direction: column; align-items: stretch; gap: 16px; padding: 24px; }
    a.hd-continue-badge { display: none; }
    .hd-continue-actions { flex-direction: column; width: 100%; gap: 12px; }
    .hd-btn-light, .hd-link-ghost { width: 100%; box-sizing: border-box; text-align: center; }
    .hd-link-ghost { padding: 6px 0; }

    /* HD Card Media fix */
    .hd-card {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr); /* HIER: minmax(0, 1fr) statt 1fr zwingt das Grid, bei Platzmangel zu schrumpfen */
        grid-template-rows: auto auto auto;
        column-gap: 16px;
        row-gap: 12px;
        text-align: left;
    }

    .hd-card-icon {
        grid-column: 1;
        grid-row: 1; /* Befreit Zeile 2 und 3, bleibt starr oben links */
        align-self: center; /* Richtet das Icon vertikal mittig zum Titel aus */
    }

    /* Update für den Titel */
    .hd-card h3 {
        grid-column: 2;
        grid-row: 1;
        font-size: 1.05rem;
        align-self: center;

        /* NEU: Erlaubt das Umbrechen langer Wörter */
        min-width: 0;
        overflow-wrap: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
    }

    .hd-card p {
        grid-column: 1 / -1; /* Spant über die gesamte Breite (Spalte 1 und 2) */
        grid-row: 2;
        margin: 0;
    }

    .hd-card-cta {
        grid-column: 1 / -1; /* Auch der Aktions-Link nutzt nun den vollen unteren Bereich */
        grid-row: 3;
    }

    /* Footer Mobile */
    .footer-action { padding: 48px 5% 40px 5%; margin-top: 48px; }
    .footer-bottom { flex-direction: column; gap: 24px; }
    .footer-brand { margin-bottom: 8px; }
    .footer-links {
        display: flex; flex-direction: row; flex-wrap: wrap;
        justify-content: center; align-items: center; gap: 12px 24px;
    }
}

@media (max-width: 800px) {
    .badge-grid-main { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .badge-item-main { padding: 12px 4px; border-radius: 12px; }
    .badge-icon-main { font-size: 1.6rem; }
    .badge-name-main { font-size: 0.7rem; }
    /* Versteckt ab dem 7. Element im kollabierten Zustand (zeigt genau 2 Reihen à 3 Badges auf Mobile) */
    .badge-grid-main.collapsed .badge-item-main:nth-child(n+7) { display: none; }
}

@media(max-width: 500px) {
    .badge-new {
        display: none;
    }

    .close-banner {
        right: 10px;
    }
}