/* =========================================================
   PHISHFLAG – INSEL-ATMOSPHÄRE, CHARAKTERE, LEVEL-ENGINE & VN-DIALOG
   Modular getrennt für Inseln 1–8 und einfache Sprite-Ersetzung.
   ========================================================= */

/* ---------------------------------------------------------
   1. LEVEL-HALO
   (Ambient-Effekte wie Wellen, Schaum, Möwen und Bootsflagge
    liegen modular in css/island-ambient.css)
   --------------------------------------------------------- */

/* Aktives nächstes Level leuchtet dezent golden */
.level-node.is-current {
    animation: currentNodePulse 1.9s ease-in-out infinite;
}

@keyframes currentNodePulse {
    0%, 100% {
        box-shadow: 0 clamp(2px, 0.38cqw, 7px) 0 #b45309,
                    0 0 0 0 rgba(250, 204, 21, 0.78),
                    0 clamp(4px, 0.7cqw, 14px) clamp(8px, 1.2cqw, 24px) rgba(0, 0, 0, 0.45);
    }
    50% {
        box-shadow: 0 clamp(2px, 0.38cqw, 7px) 0 #b45309,
                    0 0 0 clamp(5px, 0.78cqw, 14px) rgba(250, 204, 21, 0.22),
                    0 clamp(4px, 0.7cqw, 14px) clamp(8px, 1.2cqw, 24px) rgba(0, 0, 0, 0.45);
    }
}

/* ---------------------------------------------------------
   2. CHARAKTERE AUF DER MAP: KRABBE KALLE & AFFE COCO
   --------------------------------------------------------- */
#char-kalle.is-in-dialog {
    opacity: 0.12 !important;
    transform: scale(0.92) !important;
    transition: opacity 0.25s ease, transform 0.25s ease !important;
}

#char-kalle.is-shredding {
    animation: kalleSnip 0.44s ease-in-out !important;
}

@keyframes kalleSnip {
    0%   { transform: scale(1) rotate(0deg); }
    30%  { transform: scale(1.16) rotate(-7deg) translateY(-0.5cqw); }
    65%  { transform: scale(1.12) rotate(7deg) translateY(-0.2cqw); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Affe Coco direkt auf der Hängebrücke (Ebene 1, z-index 8 liegt UNTER Nebel 13/14 & .cloud-tier-group 16) */
.coco-bridge-rig {
    position: absolute;
    left: 54.4%;
    top: 29.6%;
    width: 5.0%;
    z-index: 8;
    cursor: pointer;
    transition: left 1.15s cubic-bezier(0.34, 1.28, 0.64, 1),
                top 1.15s cubic-bezier(0.34, 1.28, 0.64, 1),
                opacity 0.35s ease;
}

.coco-bridge-rig.is-instant,
.coco-bridge-rig.is-instant .coco-body-wrap {
    transition: none !important;
}

.coco-bridge-rig.convinced {
    left: 45.8%;
    top: 34.5%;
}

.coco-contact-shadow {
    position: absolute;
    left: 14%;
    bottom: 2%;
    width: 72%;
    height: 16%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(35, 18, 8, 0.54) 0%, rgba(35, 18, 8, 0.2) 58%, transparent 100%);
    pointer-events: none;
    transform-origin: center;
    animation: cocoShadowPulse 2.4s ease-in-out infinite;
}

.coco-body-wrap {
    position: relative;
    width: 100%;
    transform-origin: 50% 92%;
    animation: cocoBridgeIdle 2.4s ease-in-out infinite;
    transition: transform 0.2s ease;
}

.coco-bridge-rig.convinced:not(.is-instant) .coco-body-wrap {
    animation: cocoHopArc 0.85s cubic-bezier(0.28, 0.84, 0.42, 1),
               cocoBridgeIdle 2.8s ease-in-out 0.85s infinite;
}

.coco-bridge-rig.convinced.is-instant .coco-body-wrap {
    animation: cocoBridgeIdle 2.8s ease-in-out infinite;
}

.coco-sprite {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0.24cqw 0.22cqw rgba(45, 22, 10, 0.42));
    pointer-events: none;
}

.coco-map-badge {
    position: absolute;
    right: -10%;
    top: 4%;
    background: rgba(15, 23, 42, 0.92);
    border: 1.8px solid #facc15;
    border-radius: 999px;
    padding: 0.14cqw 0.34cqw;
    font-size: clamp(9px, 0.92cqw, 14px);
    line-height: 1.1;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.coco-bridge-rig.is-hidden-under-clouds {
    pointer-events: none;
    cursor: default;
}

.coco-bridge-rig.is-in-dialog {
    opacity: 0.14 !important;
}

.coco-bridge-rig:not(.is-hidden-under-clouds):hover .coco-body-wrap {
    transform: scale(1.08);
}

@keyframes cocoBridgeIdle {
    0%, 100% { transform: translateY(0) scale(1, 1) rotate(0deg); }
    25%      { transform: translateY(-0.24cqw) scale(0.985, 1.028) rotate(-1.5deg); }
    50%      { transform: translateY(0.03cqw) scale(1.018, 0.982) rotate(0deg); }
    75%      { transform: translateY(-0.22cqw) scale(0.99, 1.022) rotate(1.5deg); }
}

@keyframes cocoShadowPulse {
    0%, 100% { transform: scale(1); opacity: 0.92; }
    25%, 75% { transform: scale(0.86); opacity: 0.68; }
    50%      { transform: scale(1.05); opacity: 1; }
}

@keyframes cocoHopArc {
    0%   { transform: translateY(0) scale(1.06, 0.92); }
    35%  { transform: translateY(-2.4cqw) scale(0.95, 1.08) rotate(-6deg); }
    75%  { transform: translateY(-0.6cqw) scale(1.02, 0.98) rotate(3deg); }
    100% { transform: translateY(0) scale(1, 1) rotate(0deg); }
}

.coco-tooltip {
    position: absolute;
    left: 56.5%;
    top: 27.5%;
    transform: translate(-50%, -100%);
    background: linear-gradient(180deg, #fffef9 0%, #f1f5f9 100%);
    color: #0f172a;
    border: 3px solid #1e293b;
    border-radius: 14px;
    padding: clamp(7px, 0.85cqw, 11px) clamp(11px, 1.3cqw, 16px);
    font-size: clamp(11px, 1.05cqw, 14px);
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 4px 0 #0f172a, 0 12px 24px rgba(2, 12, 27, 0.42);
    z-index: 36;
    pointer-events: auto;
    cursor: pointer;
    transition: left 0.4s ease, top 0.4s ease;
}

.coco-tooltip.is-convinced {
    left: 48.2%;
    top: 32.5%;
    border-color: #16a34a;
}

.coco-tooltip[hidden] {
    display: none !important;
}

/* ---------------------------------------------------------
   3. BRIEFHAUFEN NEBEN KRABBE KALLE, BRIEFKASTEN & SCHREDDER-FX
   --------------------------------------------------------- */
.kalle-mail-pile {
    position: absolute;
    left: 28.6%;
    top: 58.6%;
    width: 4.5%;
    height: 4.2%;
    z-index: 9;
    pointer-events: none;
}

.washed-letter {
    position: absolute;
    width: 32%;
    height: auto;
    filter: drop-shadow(0 0.14cqw 0.12cqw rgba(120, 53, 15, 0.5));
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease, filter 0.25s ease;
    transform-origin: center;
}

.washed-letter[data-letter-index="0"] { left: 4%;  top: 22%; transform: rotate(-18deg) scaleY(0.76); }
.washed-letter[data-letter-index="1"] { left: 34%; top: 10%; transform: rotate(12deg) scaleY(0.76); }
.washed-letter[data-letter-index="2"] { left: 56%; top: 32%; transform: rotate(-8deg) scaleY(0.76); }
.washed-letter[data-letter-index="3"] { left: 18%; top: 50%; transform: rotate(19deg) scaleY(0.76); }
.washed-letter[data-letter-index="4"] { left: 46%; top: 54%; transform: rotate(-13deg) scaleY(0.76); }

.washed-letter.is-active-letter {
    filter: drop-shadow(0 0 0.5cqw #facc15) drop-shadow(0 0.2cqw 0.2cqw rgba(120, 53, 15, 0.52));
    transform: scale(1.24) scaleY(0.92) rotate(0deg);
    z-index: 3;
}

.washed-letter.fly-to-kalle {
    transform: translate(-15%, -195%) scale(0.22) rotate(-32deg) !important;
    opacity: 0 !important;
}

.washed-letter.fly-to-safe {
    transform: translate(-115%, -18%) scale(0.26) rotate(12deg) !important;
    opacity: 0 !important;
}

.washed-letter.is-cleared {
    display: none !important;
}

.kalle-safe-box {
    position: absolute;
    left: 24.4%;
    top: 57.5%;
    width: 4.3%;
    height: auto;
    z-index: 9;
    pointer-events: none;
    filter: drop-shadow(0 0.28cqw 0.24cqw rgba(120, 53, 15, 0.45));
    transition: opacity 0.35s ease, transform 0.25s ease;
}

.kalle-safe-box.is-hidden {
    opacity: 0;
}

.kalle-safe-box.pulse-pop {
    animation: safeBoxPop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.kalle-safe-box .mailbox-flag {
    transform-box: fill-box;
    transform-origin: bottom center;
    transform: rotate(-70deg);
    transition: transform 0.35s cubic-bezier(0.22, 1.4, 0.36, 1);
}

.kalle-safe-box.has-mail .mailbox-flag {
    transform: rotate(0deg);
}

@keyframes safeBoxPop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.2) translateY(-0.2cqw); }
    100% { transform: scale(1); }
}

.kalle-safe-box svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.safe-box-count {
    position: absolute;
    right: -12%;
    top: -14%;
    min-width: 36%;
    padding: 0.08cqw 0.28cqw;
    border-radius: 999px;
    background: #16a34a;
    border: 1.5px solid #ffffff;
    color: #ffffff;
    font-size: clamp(8px, 0.72cqw, 12px);
    font-weight: 900;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.kalle-shred-fx {
    position: absolute;
    left: 26.8%;
    top: 45.6%;
    width: 9.5%;
    height: 10.5%;
    z-index: 24;
    pointer-events: none;
    overflow: visible;
}

.shred-letter-burst {
    position: absolute;
    left: 33%;
    top: 32%;
    width: 36%;
    height: 28%;
    pointer-events: none;
}

.shred-half {
    position: absolute;
    inset: 0;
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0.12cqw 0.12cqw rgba(15, 23, 42, 0.25));
}

.shred-half--left {
    transform-origin: 35% 50%;
    animation: shredHalfLeft 0.56s cubic-bezier(0.22, 0.88, 0.36, 1) forwards;
}

.shred-half--right {
    transform-origin: 65% 50%;
    animation: shredHalfRight 0.56s cubic-bezier(0.22, 0.88, 0.36, 1) forwards;
}

.shred-confetti {
    position: absolute;
    left: 48%;
    top: 44%;
    background-color: var(--paper, #ffffff);
    background-image: repeating-linear-gradient(
        180deg,
        transparent 0 28%,
        rgba(100, 116, 139, 0.22) 28% 40%,
        transparent 40% 100%
    );
    border: 1px solid rgba(30, 41, 59, 0.22);
    border-radius: 1.5px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
    z-index: 2;
    opacity: 0;
    will-change: transform, opacity;
    animation: shredPaperFlutter 1.05s cubic-bezier(0.16, 0.84, 0.36, 1) forwards;
}

.shred-confetti--strip {
    border-radius: 1px;
}

.shred-confetti--corner {
    clip-path: polygon(0 0, 100% 14%, 86% 100%, 8% 88%);
    border: none;
    filter: drop-shadow(0 0 0.6px rgba(15, 23, 42, 0.45));
}

.shred-confetti--scrap {
    clip-path: polygon(10% 0, 95% 8%, 100% 88%, 62% 100%, 0 76%);
    border: none;
    filter: drop-shadow(0 0 0.6px rgba(15, 23, 42, 0.45));
}

.snip-callout {
    position: absolute;
    left: 50%;
    top: -16%;
    z-index: 6;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #fb7185 0%, #e11d48 100%);
    color: #ffffff;
    border: 2.5px solid #0f172a;
    border-radius: 999px;
    padding: 0.2cqw 0.68cqw;
    font-size: clamp(9px, 0.9cqw, 14px);
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 3px 0 #881337, 0 6px 14px rgba(0, 0, 0, 0.35);
    animation: snipPopUp 0.92s ease-out forwards;
}

@keyframes shredHalfLeft {
    0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
    45%  { opacity: 1; transform: translate(-1.1cqw, -0.9cqw) rotate(-22deg) scale(1.06); }
    100% { opacity: 0; transform: translate(-2.2cqw, 0.4cqw) rotate(-42deg) scale(0.75); }
}

@keyframes shredHalfRight {
    0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
    45%  { opacity: 1; transform: translate(1.1cqw, -0.9cqw) rotate(24deg) scale(1.06); }
    100% { opacity: 0; transform: translate(2.2cqw, 0.5cqw) rotate(44deg) scale(0.75); }
}

@keyframes shredPaperFlutter {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(0.7);
    }
    28% {
        opacity: 1;
        transform: translate(calc(var(--sx, 2cqw) * 0.65), var(--sy, -3cqw)) rotate(calc(var(--sr, 120deg) * 0.45)) scaleX(0.85) scale(1.05);
    }
    62% {
        opacity: 0.94;
        transform: translate(calc(var(--sx, 2cqw) * 1.08), calc(var(--sy, -3cqw) * 0.2 + var(--fy, 3cqw) * 0.45)) rotate(calc(var(--sr, 120deg) * 0.85)) scaleX(-0.65) scale(0.95);
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--sx, 2cqw) * 1.25), var(--fy, 4cqw)) rotate(var(--sr, 120deg)) scaleX(0.75) scale(0.48);
    }
}

@keyframes snipPopUp {
    0%   { opacity: 0; transform: translate(-50%, 6px) scale(0.7); }
    25%  { opacity: 1; transform: translate(-50%, -4px) scale(1.08); }
    100% { opacity: 0; transform: translate(-50%, -20px) scale(0.95); }
}

/* ---------------------------------------------------------
   4. VISUAL-NOVEL-DIALOGSYSTEM (CLASH-OF-CLANS-STIL OHNE RAHMEN)
   --------------------------------------------------------- */
.vn-dialog-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 22, 42, 0.34) 0%, rgba(8, 22, 42, 0.72) 100%);
    z-index: 95;
    display: none;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}

.vn-dialog-overlay.is-open {
    display: flex;
}

.vn-char-stage {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.vn-char-figure {
    position: absolute;
    bottom: 0;
    height: clamp(195px, 37vh, 380px);
    width: auto;
    max-width: 34vw;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transform-origin: bottom center;
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), filter 0.28s ease;
    pointer-events: none;
}

.vn-char-left {
    left: clamp(6px, 1.8vw, 42px);
}

.vn-char-right {
    right: clamp(6px, 1.8vw, 42px);
}

.vn-char-figure.is-active {
    opacity: 1;
    z-index: 4;
    transform: translateY(0) scale(1.03);
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.56));
}

.vn-char-figure.is-dimmed {
    opacity: 0.52;
    z-index: 2;
    transform: translateY(14px) scale(0.91);
    filter: brightness(0.72) grayscale(22%) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

.vn-portrait-img,
.vn-avatar-svg {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: bottom center;
    display: block;
}

.vn-bubble-dock {
    position: relative;
    z-index: 6;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 clamp(14px, 3vw, 32px) clamp(20px, 4vh, 42px);
    pointer-events: none;
}

.vn-speech-bubble {
    pointer-events: auto;
    position: relative;
    width: min(620px, 50vw);
    background: linear-gradient(180deg, #fffef9 0%, #f1f7fd 100%);
    color: #0f172a;
    border: 4px solid #1e293b;
    border-radius: 26px;
    padding: clamp(16px, 2.2vw, 24px) clamp(18px, 2.4vw, 26px) clamp(14px, 1.9vw, 20px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.95),
        0 8px 0 #0f172a,
        0 22px 46px rgba(2, 12, 27, 0.62);
}

.vn-bubble-pointer {
    position: absolute;
    bottom: 28px;
    width: 22px;
    height: 22px;
    background: #f4f8fd;
    transform: rotate(45deg);
    pointer-events: none;
}

.vn-speech-bubble.is-speaker-left .vn-bubble-pointer {
    left: -13px;
    border-left: 4px solid #1e293b;
    border-bottom: 4px solid #1e293b;
    border-top: none;
    border-right: none;
}

.vn-speech-bubble.is-speaker-left .vn-bubble-pointer::after {
    content: none;
}

.vn-speech-bubble.is-speaker-right .vn-bubble-pointer {
    right: -13px;
    border-top: 4px solid #1e293b;
    border-right: 4px solid #1e293b;
    border-left: none;
    border-bottom: none;
}

.vn-speech-bubble.is-speaker-right .vn-bubble-pointer::after {
    content: none;
}

.vn-bubble-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.vn-speaker-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 15px;
    border-radius: 999px;
    border: 2.5px solid #0f172a;
    font-size: clamp(12px, 1.15vw, 14px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 3px 0 #0f172a;
}

.vn-speech-bubble.is-speaker-left .vn-speaker-tag {
    background: linear-gradient(180deg, #fb7185 0%, #e11d48 100%);
    color: #ffffff;
}

.vn-speech-bubble[data-speaker-id="coco"] .vn-speaker-tag {
    background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
    color: #ffffff;
}

.vn-speech-bubble.is-speaker-right .vn-speaker-tag {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
    color: #ffffff;
}

.vn-step-pill {
    font-size: 0.82rem;
    font-weight: 900;
    color: #334155;
    background: #e2e8f0;
    border: 2px solid #cbd5e1;
    padding: 3px 11px;
    border-radius: 999px;
}

.vn-bubble-text {
    margin: 0 0 15px;
    font-size: clamp(14.5px, 1.38vw, 18px);
    line-height: 1.5;
    min-height: 3.1em;
    font-weight: 600;
    color: #0f172a;
}

.vn-bubble-actions {
    display: flex;
    justify-content: flex-end;
}

.vn-next-btn {
    background: linear-gradient(180deg, #fde047 0%, #f59e0b 100%);
    color: #0f172a;
    border: 2.5px solid #0f172a;
    border-radius: 14px;
    padding: 10px 20px;
    font-size: clamp(13px, 1.25vw, 15px);
    font-weight: 900;
    cursor: pointer;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 4px 0 #b45309;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.vn-next-btn:hover {
    transform: translateY(-2px);
}

.vn-next-btn:active {
    transform: translateY(3px);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 1px 0 #b45309;
}

.vn-lesson .vn-bubble-actions {
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.vn-later-btn {
    border: 0;
    padding: 9px 5px;
    background: transparent;
    color: #475569;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.vn-lesson .vn-next-btn:disabled {
    background: #e2e8f0;
    color: #475569;
    box-shadow: 0 3px 0 #94a3b8;
    transform: none;
    cursor: default;
}

.vn-practice {
    margin-bottom: 12px;
}

.vn-practice .le-mail-inner {
    padding-block: 10px;
    overflow-wrap: anywhere;
}

.vn-practice .le-mail-body + .le-mail-body {
    margin-top: 6px;
}

.vn-practice-mark.le-evidence-mark {
    color: #075985;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.vn-practice-choices:not(:empty) {
    display: grid;
    gap: 7px;
}

#vn-practice-example:not([hidden]) + .vn-practice-choices:not(:empty) {
    margin-top: 10px;
}

.vn-practice-choices .le-btn {
    min-height: 38px;
    padding: 6px 10px;
    text-align: left;
    font-size: 0.88rem;
}

.vn-practice-reply {
    margin: 9px 0 0;
    border-left: 3px solid #eab308;
    padding: 3px 8px;
    background: #fffbeb;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.38;
}

.vn-practice-reply:empty { display: none; }

@media (max-width: 760px), (max-height: 560px) {
    .vn-lesson .vn-speech-bubble {
        max-height: calc(100dvh - 55px);
        overflow: auto;
    }

    .vn-lesson .vn-bubble-pointer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .vn-lesson .vn-char-figure,
    .vn-lesson .vn-next-btn { transition: none; }
}

@media (max-width: 980px) and (min-width: 761px) {
    .vn-speech-bubble {
        width: min(460px, 46vw);
    }
    .vn-char-figure {
        height: clamp(165px, 31vh, 260px);
    }
}

@media (max-width: 760px) {
    .vn-lesson .vn-bubble-dock {
        padding-bottom: clamp(50px, 16dvh, 133px);
    }

    .vn-lesson .vn-speech-bubble {
        max-height: calc(100dvh - clamp(60px, 18dvh, 145px));
    }

    .vn-lesson .vn-char-figure {
        height: clamp(100px, 18dvh, 153px);
    }

    .vn-char-figure {
        height: clamp(150px, 27vh, 220px);
        max-width: 64vw;
    }
    .vn-char-figure.is-dimmed {
        opacity: 0;
        transform: translateY(30px) scale(0.85);
    }
    .vn-bubble-dock {
        padding: 0 12px clamp(154px, 27.5vh, 224px);
    }
    .vn-speech-bubble {
        width: min(370px, 94vw);
        border-radius: 20px;
    }
    .vn-speech-bubble.is-speaker-left .vn-bubble-pointer,
    .vn-speech-bubble.is-speaker-right .vn-bubble-pointer {
        width: 22px;
        height: 22px;
        bottom: -13px;
        border-top: none;
        border-left: none;
        border-right: 4px solid #1e293b;
        border-bottom: 4px solid #1e293b;
    }
    .vn-speech-bubble.is-speaker-left .vn-bubble-pointer {
        left: 48px;
        right: auto;
    }
    .vn-speech-bubble.is-speaker-right .vn-bubble-pointer {
        right: 48px;
        left: auto;
    }
}

/* ---------------------------------------------------------
   5. MODULARE LEVEL-ENGINE (LEVEL 1, 2, 4, 5 + LEVEL 3 DOCK)
   --------------------------------------------------------- */
.ui-close-btn {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    border: 2.5px solid #0f172a;
    background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 0 #94a3b8;
    transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
    padding: 0;
}

.ui-close-btn:hover {
    background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
    color: #b91c1c;
    transform: translateY(-1px);
}

.ui-close-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #94a3b8;
}

.ui-close-btn[hidden] {
    display: none !important;
}

.ui-close-btn--floating {
    position: absolute;
    top: 14px;
    right: 14px;
}

.level-engine-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 16, 36, 0.78);
    backdrop-filter: blur(5px);
    z-index: 88;
    display: none;
    justify-content: center;
    align-items: center;
    padding: clamp(10px, 2vh, 20px);
    overflow-y: auto;
}

.level-engine-backdrop.is-open {
    display: flex;
}

.level-engine-card {
    background: linear-gradient(180deg, #fffef9 0%, #f1f7fd 100%);
    color: #0f172a;
    width: min(640px, 94vw);
    max-height: 94dvh;
    overflow-y: auto;
    border-radius: 26px;
    border: 4px solid #1e293b;
    padding: clamp(16px, 2.4vw, 24px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.95),
        0 8px 0 #0f172a,
        0 26px 60px rgba(2, 12, 27, 0.62);
    margin: auto;
}

.level-engine-card.shake-wrong {
    animation: leWrongShake 0.38s ease-in-out;
}

@keyframes leWrongShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-8px); }
    40%      { transform: translateX(7px); }
    60%      { transform: translateX(-5px); }
    80%      { transform: translateX(4px); }
}

.le-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.le-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.le-header-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.le-title {
    margin: 0;
    font-size: clamp(1.08rem, 2vw, 1.34rem);
    color: #0f172a;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.le-step-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.le-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: #cbd5e1;
    border: 1.5px solid #94a3b8;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.le-dot.is-current {
    background: #38bdf8;
    border-color: #0369a1;
    transform: scale(1.22);
}

.le-dot.is-done-right {
    background: #22c55e;
    border-color: #15803d;
}

.le-dot.is-done-wrong {
    background: #ef4444;
    border-color: #991b1b;
}

.le-progress {
    background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
    color: #075985;
    border: 2px solid #0284c7;
    border-radius: 999px;
    padding: 4px 12px;
    font-weight: 900;
    font-size: 0.82rem;
    white-space: nowrap;
}

.le-subtitle {
    margin: 0 0 12px;
    color: #475569;
    font-size: 0.91rem;
    font-weight: 600;
    line-height: 1.42;
}

.le-mail-card {
    background: #ffffff;
    border: 3px solid #1e293b;
    border-radius: 18px;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 5px 0 #cbd5e1, 0 10px 20px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.le-mail-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
    border-bottom: 2px solid #94a3b8;
}

.le-mail-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.le-mail-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid rgba(15, 23, 42, 0.35);
}

.le-mail-dots span:nth-child(1) { background: #ef4444; }
.le-mail-dots span:nth-child(2) { background: #facc15; }
.le-mail-dots span:nth-child(3) { background: #22c55e; }

.le-mail-app-label {
    font-size: 0.76rem;
    font-weight: 900;
    color: #334155;
    letter-spacing: 0.02em;
}

.le-mail-inner {
    padding: 13px 16px 15px;
}

.le-mail-card.is-result-right {
    border-color: #16a34a;
    box-shadow: 0 5px 0 #86efac, 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.le-mail-card.is-result-wrong {
    border-color: #dc2626;
    box-shadow: 0 5px 0 #fca5a5, 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.le-mail-meta {
    font-size: 0.85rem;
    color: #475569;
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 9px;
    word-break: break-word;
}

.le-mail-sender-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.le-mail-from {
    font-family: Consolas, "Courier New", monospace;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 2px 8px;
    border-radius: 7px;
    color: #0f172a;
    font-weight: 700;
}

.le-mail-subject {
    font-size: 1.04rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 7px;
}

.le-mail-body {
    margin: 0;
    color: #334155;
    font-size: 0.93rem;
    line-height: 1.48;
    white-space: pre-line;
}

.le-mail-link {
    margin-top: 10px;
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
    background: #e0f2fe;
    border: 1.5px solid #7dd3fc;
    color: #075985;
    padding: 6px 10px;
    border-radius: 9px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.8rem;
    font-weight: 700;
}

.le-mail-link[hidden] {
    display: none !important;
}

/* Level 4: Interaktiver E-Mail-Inspektor (Lupe für Absender & Link) */
.le-inspect-btn {
    border: 2px solid #0284c7;
    background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
    color: #075985;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 2px 0 #7dd3fc;
    transition: transform 0.12s ease, background 0.15s ease;
    white-space: nowrap;
}

.le-inspect-btn:hover {
    transform: translateY(-1px);
}

.le-inspect-btn.is-checked {
    background: linear-gradient(180deg, #fef9c3 0%, #fde047 100%);
    border-color: #ca8a04;
    color: #713f12;
    box-shadow: 0 2px 0 #eab308;
}

.le-inspect-btn[hidden] {
    display: none !important;
}

.le-link-inspect-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border-radius: 11px;
    background: #f0f9ff;
    border: 2px dashed #38bdf8;
}

.le-link-inspect-row[hidden] {
    display: none !important;
}

.le-link-inspect-row .le-mail-link {
    margin-top: 0;
}

.le-inspector-box {
    margin-top: 8px;
    padding: 8px 11px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    color: #78350f;
    font-size: 0.81rem;
    font-weight: 800;
    line-height: 1.4;
    animation: lePopIn 0.2s ease-out;
}

.le-inspector-box code {
    font-family: Consolas, "Courier New", monospace;
    background: rgba(255, 255, 255, 0.75);
    padding: 1px 6px;
    border-radius: 5px;
    word-break: break-all;
}

.le-inspector-box[hidden] {
    display: none !important;
}

.le-inspect-tip {
    margin-top: 9px;
    font-size: 0.79rem;
    font-weight: 800;
    color: #0369a1;
    background: #e0f2fe;
    border-radius: 9px;
    padding: 5px 10px;
    display: inline-block;
}

.le-inspect-tip[hidden] {
    display: none !important;
}

/* Level 5: Interaktiver E-Mail-Anhang-Scanner */
.le-attach-box {
    margin-top: 10px;
    border-radius: 13px;
    border: 2.5px solid #94a3b8;
    background: #f8fafc;
    padding: 10px 12px;
}

.le-attach-box[hidden] {
    display: none !important;
}

.le-attach-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.le-attach-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
    word-break: break-all;
}

.le-scan-btn {
    border: 2px solid #0f172a;
    background: linear-gradient(180deg, #fde047 0%, #f59e0b 100%);
    color: #0f172a;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 3px 0 #b45309;
    transition: transform 0.1s ease;
    white-space: nowrap;
}

.le-scan-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.le-scan-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.le-scan-progress {
    margin-top: 8px;
    height: 7px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.le-scan-progress[hidden] {
    display: none !important;
}

.le-scan-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8 0%, #facc15 100%);
    transition: width 0.32s ease-out;
}

.le-scan-result {
    margin-top: 9px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #1e293b;
    animation: lePopIn 0.2s ease-out;
}

.le-scan-result[hidden] {
    display: none !important;
}

.le-scan-result div + div {
    margin-top: 3px;
}

.le-scan-result code {
    font-family: Consolas, "Courier New", monospace;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 5px;
    font-weight: 800;
    word-break: break-all;
}

.le-question-prompt {
    margin: 13px 0 9px;
    font-size: 0.92rem;
    font-weight: 900;
    color: #1e293b;
    text-align: center;
}

.le-choices {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.le-btn {
    flex: 1 1 160px;
    border: 2.5px solid #0f172a;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 0.96rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.le-btn:hover {
    transform: translateY(-2px);
}

.le-btn:active {
    transform: translateY(3px);
    box-shadow: none !important;
}

.le-btn-safe {
    background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
    color: #ffffff;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 4px 0 #14532d;
}

.le-btn-phish {
    background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
    color: #ffffff;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.32), 0 4px 0 #9a3412;
}

.le-btn-primary {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
    color: #ffffff;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 4px 0 #075985;
    width: 100%;
}

.le-btn-ghost {
    background: linear-gradient(180deg, #f1f5f9 0%, #cbd5e1 100%);
    color: #1e293b;
    box-shadow: 0 4px 0 #64748b;
}

.le-feedback {
    margin-top: 12px;
    border-radius: 14px;
    padding: 12px 14px;
    text-align: left;
    border: 3px solid #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    animation: lePopIn 0.24s cubic-bezier(0.22, 1.3, 0.36, 1);
}

.le-feedback.is-right {
    border-color: #16a34a;
    background: linear-gradient(135deg, #ecfdf5 0%, #dcfce7 100%);
}

.le-feedback-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.le-feedback-badge {
    font-size: 0.96rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: #b91c1c;
}

.le-feedback.is-right .le-feedback-badge {
    color: #15803d;
}

.le-feedback-bonus {
    font-size: 0.8rem;
    font-weight: 900;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: #b91c1c;
}

.le-feedback.is-right .le-feedback-bonus {
    color: #15803d;
}

@keyframes lePopIn {
    0%   { opacity: 0; transform: scale(0.94); }
    100% { opacity: 1; transform: scale(1); }
}

.le-feedback p {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 0.91rem;
    line-height: 1.44;
    font-weight: 600;
}

.le-summary {
    text-align: center;
    padding: 12px 6px 6px;
}

.le-summary h3 {
    margin: 0 0 8px;
    font-size: 1.32rem;
    font-weight: 900;
    color: #0f172a;
}

.le-summary.is-failed h3 {
    color: #b91c1c;
}

.le-summary p {
    margin: 0 0 18px;
    color: #334155;
    font-weight: 600;
    line-height: 1.5;
}

.le-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.le-summary-actions .le-btn[hidden] {
    display: none !important;
}

.sorter-score-pill {
    background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 2px solid #16a34a;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.8rem;
    font-weight: 900;
    white-space: nowrap;
}

.sorter-summary {
    text-align: center;
    padding: 12px 6px 4px;
}

.sorter-summary h4 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 900;
    color: #b91c1c;
}

.sorter-summary p {
    margin: 0 0 16px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.48;
}

.sorter-summary[hidden],
.sorter-play-area[hidden] {
    display: none !important;
}

.level-engine-card.is-investigation .le-choices[hidden],
.level-engine-card.is-investigation #le-next-btn[hidden] {
    display: none;
}

.le-case-guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    margin-bottom: 9px;
    text-align: left;
}

.le-case-guide[hidden] {
    display: none;
}

#le-case-actions {
    margin-top: 12px;
}

.is-investigation .le-mail-sender-row > div {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
}

.is-investigation .le-mail-from {
    min-width: 0;
    overflow-wrap: anywhere;
}

.le-case-guide p,
.le-case-reference {
    margin: 0;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.4;
}

.le-case-count {
    padding: 3px 8px;
    border: 1px solid #eab308;
    border-radius: 999px;
    background: #fef9c3;
    color: #713f12;
    font-size: 0.8rem;
    font-weight: 900;
    white-space: nowrap;
}

.le-case-count span {
    display: inline-block;
    animation: leEvidenceCount 0.22s ease-out;
}

@keyframes leEvidenceCount {
    from { transform: translateY(2px) scale(1.25); }
    to { transform: translateY(0) scale(1); }
}

.le-evidence-mark,
.le-evidence-inspect {
    appearance: none;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.le-evidence-mark {
    display: inline;
    border-radius: 3px;
    padding: 0.1em 0;
    background: transparent;
}

.le-evidence-mark:not(:disabled):hover {
    box-shadow: 0 2px 0 #94a3b8;
}

.le-evidence-mark:focus-visible,
.le-evidence-inspect:focus-visible,
.le-case-review h3:focus-visible {
    outline: 2px solid #0369a1;
    outline-offset: 2px;
}

.le-evidence-mark:disabled {
    cursor: default;
    opacity: 1;
}

.le-evidence-mark[aria-pressed="true"] {
    --marker-ink: #fde047bb;
    background: linear-gradient(178deg, transparent 12%, var(--marker-ink) 16% 86%, transparent 91%) 0 100% / 100% 100% no-repeat;
    animation: leEvidenceStroke 0.25s ease-out;
}

.le-evidence-mark[data-review="matched"] { --marker-ink: #86efaccf; }
.le-evidence-mark[data-review="extra"] { --marker-ink: #fca5a5d9; }

@keyframes leEvidenceStroke {
    from { background-size: 0 100%; }
    to { background-size: 100% 100%; }
}

.le-evidence-link {
    color: #075985;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.le-evidence-inspect {
    width: 30px;
    min-height: 28px;
    padding: 0;
    border-radius: 6px;
    background: #e0f2fe;
    text-align: center;
    font-size: 0.8rem;
    vertical-align: middle;
}

.le-evidence-inspect:hover,
.le-evidence-inspect[aria-expanded="true"] {
    background-color: #bae6fd;
}

.le-case-file {
    width: fit-content;
    max-width: 100%;
    margin-top: 10px;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #f1f5f9;
    font: 700 0.82rem Consolas, "Courier New", monospace;
}

.le-case-preview {
    overflow-wrap: anywhere;
    margin-bottom: 0;
}

.le-case-reference {
    margin-top: 12px;
    text-align: left;
    overflow-wrap: anywhere;
}

.le-case-review {
    margin-top: 12px;
    padding: 10px 12px;
    border: 2px solid #eab308;
    border-radius: 14px;
    background: #fffbeb;
    text-align: left;
    font-size: 0.88rem;
    line-height: 1.42;
}

.le-case-review.is-solved {
    border-color: #16a34a;
    background: #ecfdf5;
    animation: lePopIn 0.24s ease-out;
}

.le-case-review.is-solved h3::after {
    display: inline-block;
    content: " ✨";
    animation: leEvidenceCount 0.36s ease-out;
}

.le-case-review h3,
.le-case-final-review h4,
.le-case-final-review h5 {
    margin: 0 0 4px;
    font-size: 0.99rem;
}

.le-case-review p {
    margin: 0;
}

.le-case-review-action {
    margin: 8px 0;
}

.le-case-review-action .le-btn {
    min-height: 38px;
    padding: 7px 10px;
}

.le-case-review ul,
.le-case-final-review ul {
    margin: 5px 0 0;
    padding-left: 1.25em;
}

.le-case-review ul:empty { display: none; }
.le-case-review li + li,
.le-case-final-review li + li { margin-top: 4px; }
.le-case-review .le-case-hint { margin-top: 7px; font-weight: 700; }

.le-case-final-review {
    margin-top: 19px;
    padding-top: 12px;
    border-top: 2px solid #e2e8f0;
    text-align: left;
    font-size: 0.88rem;
    line-height: 1.42;
}

.le-case-final-review > ol {
    margin: 9px 0 0;
    padding-left: 1.4em;
}

.le-case-final-review > ol > li + li { margin-top: 12px; }

@media (max-width: 480px) {
    .le-case-guide { flex-wrap: wrap; }
}

@media (pointer: coarse) {
    .le-evidence-mark:not(:disabled):not([aria-pressed="true"]) {
        text-decoration-line: underline;
        text-decoration-style: dotted;
        text-decoration-color: #94a3b8;
        text-underline-offset: 0.19em;
    }

    .le-evidence-inspect { width: 38px; min-height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    .le-evidence-mark[aria-pressed="true"],
    .le-case-count span,
    .le-case-review.is-solved,
    .le-case-review.is-solved h3::after,
    .is-investigation .le-feedback { animation: none; }
    .is-investigation .le-mail-card { transition: none; }
}

.wrack-beacon,
.wrack-raft-flag {
    position: absolute;
    z-index: 8;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.7s ease;
}

.wrack-beacon {
    left: 72.1%;
    top: 7%;
    width: clamp(12px, 3cqw, 52px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, #fff7cc 0 14%, #facc14a8 32%, transparent 70%);
}

.wrack-beacon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 26%;
    width: 24cqw;
    height: 1.5cqw;
    background: linear-gradient(90deg, #fef08ab8, #facc1440 62%, transparent);
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
    transform-origin: left center;
}

.wrack-beacon.is-lit,
.wrack-raft-flag.is-ready {
    opacity: 1;
}

.wrack-beacon.is-lit::after {
    animation: wrack-beacon-sweep 7s ease-in-out infinite alternate;
}

@keyframes wrack-beacon-sweep {
    from { transform: rotate(-10deg); }
    to   { transform: rotate(6deg); }
}

.wrack-raft-flag {
    left: 85%;
    bottom: 17%;
    width: 0.45cqw;
    height: 3.5cqw;
    border-radius: 3px;
    background: #78350f;
}

.wrack-raft-flag::after {
    content: "";
    position: absolute;
    top: 4%;
    left: 100%;
    width: 2.35cqw;
    height: 1.75cqw;
    background: linear-gradient(140deg, #fde047, #f59e0b);
    clip-path: polygon(0 0, 100% 12%, 70% 46%, 98% 77%, 0 100%);
    filter: drop-shadow(0 1px 1px #78350f);
}

@media (prefers-reduced-motion: reduce) {
    .wrack-beacon,
    .wrack-raft-flag {
        transition: none;
    }

    .wrack-beacon.is-lit::after {
        animation: none;
    }
}

/* ---------------------------------------------------------
   6. LEVEL 3 – SCHREDDER-KRABBE DOCK (ZENTRIERTER, LÄSST KALLE LINKS SICHTBAR!)
   --------------------------------------------------------- */
.level3-sorter-dock {
    position: fixed;
    inset: 0;
    z-index: 86;
    pointer-events: none;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(64px, 8vh, 84px) clamp(16px, 3vw, 40px) clamp(16px, 3vh, 30px) clamp(190px, 28vw, 350px);
}

@media (min-width: 1440px) {
    .level3-sorter-dock {
        padding-left: clamp(120px, 14vw, 220px);
    }
}

.level3-sorter-dock.is-open {
    display: flex;
}

.sorter-panel {
    pointer-events: auto;
    width: min(520px, 52vw);
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    background: linear-gradient(180deg, #fffef9 0%, #f1f7fd 100%);
    color: #0f172a;
    border: 4px solid #1e293b;
    border-radius: 26px;
    padding: clamp(16px, 2.1vw, 22px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.95),
        0 8px 0 #0f172a,
        0 26px 56px rgba(2, 18, 38, 0.6);
}

.sorter-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.sorter-head-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sorter-head h3 {
    margin: 0;
    font-size: clamp(1.04rem, 1.6vw, 1.24rem);
    color: #0f172a;
    font-weight: 900;
}

.sorter-count {
    background: linear-gradient(180deg, #fef08a 0%, #fde047 100%);
    color: #78350f;
    border: 2px solid #0f172a;
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 0.82rem;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 2px 0 #b45309;
}

.sorter-hint {
    margin: 0 0 11px;
    font-size: 0.87rem;
    color: #475569;
    font-weight: 700;
}

.sorter-letter-card {
    background: #ffffff;
    border: 3px dashed #0284c7;
    border-radius: 17px;
    padding: 13px 15px;
    cursor: grab;
    box-shadow: 0 4px 0 #bae6fd, 0 8px 18px rgba(15, 23, 42, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.sorter-letter-card:hover {
    transform: translateY(-2px);
    border-color: #0ea5e9;
}

.sorter-letter-card:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.sorter-letter-card .le-mail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.83rem;
    margin-bottom: 7px;
    padding-bottom: 7px;
}

.sorter-drag-grip {
    font-size: 0.78rem;
    font-weight: 900;
    color: #0284c7;
    background: #e0f2fe;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
}

.sorter-letter-card .le-mail-subject {
    font-size: 1rem;
    margin-bottom: 6px;
}

.sorter-letter-card .le-mail-body {
    font-size: 0.89rem;
}

.sorter-zones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 13px;
}

.sorter-drop-zone {
    border: 3px solid #0f172a;
    border-radius: 16px;
    padding: 12px 10px;
    text-align: center;
    font-weight: 900;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.sorter-drop-zone:hover,
.sorter-drop-zone.drag-over {
    transform: translateY(-2px) scale(1.02);
}

.sorter-drop-zone:active {
    transform: translateY(2px);
}

.drop-zone-phish {
    background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.65), 0 4px 0 #dc2626;
}

.drop-zone-phish.drag-over {
    background: linear-gradient(180deg, #fecaca 0%, #fca5a5 100%);
}

.drop-zone-safe {
    background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.65), 0 4px 0 #16a34a;
}

.drop-zone-safe.drag-over {
    background: linear-gradient(180deg, #bbf7d0 0%, #86efac 100%);
}

.sorter-feedback {
    margin-top: 12px;
    padding: 10px 13px;
    border-radius: 13px;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.4;
    background: #fef2f2;
    border: 2.5px solid #dc2626;
    color: #991b1b;
}

.sorter-feedback.is-ok {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #166534;
}

@media (max-width: 820px) {
    .level3-sorter-dock {
        align-items: flex-end;
        justify-content: center;
        padding: 10px;
    }
    .sorter-panel {
        width: min(500px, 95vw);
        max-height: 58dvh;
        padding: 12px 14px;
        border-radius: 20px;
    }
    .sorter-hint {
        margin-bottom: 7px;
        font-size: 0.78rem;
    }
    .sorter-letter-card {
        padding: 9px 11px;
    }
    .sorter-zones {
        gap: 8px;
        margin-top: 9px;
    }
    .sorter-drop-zone {
        padding: 9px 6px;
        font-size: 0.82rem;
    }
}

/* ---------------------------------------------------------
   7. EASTER EGGS AUF DER INSELKARTE
   --------------------------------------------------------- */
.egg-hotspot {
    position: absolute;
    left: 49.8%;
    top: 82.2%;
    width: 5.8%;
    height: 7.4%;
    transform: translate(-50%, -50%);
    z-index: 9;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 12px;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.egg-hotspot:not(.is-claimed):hover {
    filter: drop-shadow(0 0 0.6cqw rgba(250, 204, 21, 0.85));
    transform: translate(-50%, -50%) scale(1.06);
}

.egg-hotspot.is-claimed {
    cursor: default;
    pointer-events: none;
}

.egg-toast {
    position: absolute;
    left: 49.8%;
    top: 76%;
    transform: translate(-50%, -50%);
    z-index: 38;
    background: rgba(15, 23, 42, 0.94);
    color: #fde047;
    border: 2px solid #facc15;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: clamp(11px, 1.05cqw, 14px);
    font-weight: 900;
    white-space: nowrap;
    pointer-events: none;
    animation: eggFloatUp 1.5s ease-out forwards;
}

@keyframes eggFloatUp {
    0%   { opacity: 0; transform: translate(-50%, 0); }
    18%  { opacity: 1; transform: translate(-50%, -1.4cqh); }
    80%  { opacity: 1; transform: translate(-50%, -3.2cqh); }
    100% { opacity: 0; transform: translate(-50%, -4.4cqh); }
}

/* ---------------------------------------------------------
   8. LEVEL 4 & 5 – COCO SNACK- & ZUFRIEDENHEITS-LEISTE + DETEKTIV-BOXEN
   --------------------------------------------------------- */
.le-coco-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #fefce8 100%);
    border: 3px solid #16a34a;
    border-radius: 18px;
    padding: 11px 14px;
    margin-bottom: 13px;
    box-shadow: 0 4px 0 #86efac, 0 8px 16px rgba(21, 128, 61, 0.12);
}

.le-coco-bar[hidden] {
    display: none !important;
}

.le-coco-avatar-wrap {
    position: relative;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
    border: 2.5px solid #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.le-coco-avatar {
    width: 92%;
    height: 92%;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.le-coco-avatar.is-munching {
    animation: cocoMunch 0.52s cubic-bezier(0.22, 1.35, 0.36, 1);
}

@keyframes cocoMunch {
    0%   { transform: scale(1) rotate(0deg); }
    35%  { transform: scale(1.22) rotate(-7deg); }
    70%  { transform: scale(1.12) rotate(6deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.le-coco-info {
    flex: 1 1 auto;
    min-width: 0;
}

.le-coco-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.le-coco-mood {
    font-size: 0.78rem;
    font-weight: 900;
    padding: 2px 9px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    border: 1.5px solid #fca5a5;
}

.le-coco-mood.mood-1 {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.le-coco-mood.mood-2 {
    background: #e0f2fe;
    color: #075985;
    border-color: #7dd3fc;
}

.le-coco-mood.mood-3 {
    background: #dcfce7;
    color: #166534;
    border-color: #4ade80;
}

.le-coco-slots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.95rem;
    font-weight: 900;
    color: #334155;
}

.le-coco-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    filter: grayscale(1);
    opacity: 0.48;
    transform: scale(0.9);
    transition: transform 0.25s cubic-bezier(0.22, 1.35, 0.36, 1), opacity 0.25s ease, filter 0.25s ease, background 0.25s ease;
}

.le-coco-slot.is-filled {
    background: #fef08a;
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.06);
}

.le-coco-count-text {
    font-size: 0.8rem;
    margin-left: 3px;
    color: #1e293b;
}

.le-coco-meter-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-bottom: 5px;
}

.le-coco-meter-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f97316 0%, #facc15 50%, #22c55e 100%);
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.le-coco-quote {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
}

.le-flying-snack {
    position: fixed;
    z-index: 120;
    font-size: 1.75rem;
    line-height: 1;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.7);
    transition: left 0.56s cubic-bezier(0.22, 1, 0.36, 1),
                top 0.56s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.56s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.18s ease 0.42s;
}

.le-mail-realurl {
    margin-top: 7px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #fef3c7;
    border: 1.5px solid #f59e0b;
    color: #78350f;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.8rem;
    font-weight: 700;
    word-break: break-all;
}

.le-mail-realurl[hidden],
.le-mail-attachment[hidden] {
    display: none !important;
}

.le-mail-attachment {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 9px;
    background: #f1f5f9;
    border: 2px solid #94a3b8;
    color: #0f172a;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    font-weight: 800;
    word-break: break-all;
}


