/* ================================================================
   VOKABELHELDEN - STUDENT CSS (RPG UPDATE)
   ================================================================ */

:root { 
    --epic: #d946ef; 
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    background: #0a0a1a; 
    color: #fff; 
    min-height: 100vh; 
    overflow-x: hidden; 
}

.screen { 
    display: none; 
    min-height: 100vh; 
    flex-direction: column; 
    align-items: center; 
    padding: 15px; 
}

.screen.active { 
    display: flex; 
}

button { 
    cursor: pointer; 
    font-family: inherit; 
}

input { 
    font-family: inherit; 
}

/* ════════════════════════════════════════════════
   GLOBAL HUD (GOLD & ACHIEVEMENTS)
   ════════════════════════════════════════════════ */
.hud-top-right { 
    position: fixed; 
    top: 12px; 
    right: 12px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    z-index: 1000; 
}

.gold-box { 
    background: rgba(15, 23, 42, 0.85); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    border: 1px solid rgba(251, 191, 36, 0.4); 
    padding: 5px 16px; 
    border-radius: 20px; 
    font-weight: bold; 
    font-size: 0.9em; 
    color: #fbbf24; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

.gold-box.pop { 
    animation: goldPop 0.4s ease-out; 
}

@keyframes goldPop { 
    0% { transform: scale(1); } 
    50% { transform: scale(1.3); } 
    100% { transform: scale(1); } 
}

.achiev-btn-start { 
    background: rgba(255,255,255,0.1); 
    border: 1px solid rgba(255,255,255,0.2); 
    color: #fbbf24; 
    padding: 6px 12px; 
    border-radius: 12px; 
    font-size: 0.85em; 
    text-decoration: none; 
    font-weight: bold; 
    transition: 0.2s; 
    white-space: nowrap; 
    display: block; 
}

.achiev-btn-start:hover { 
    background: rgba(251,191,36,0.2); 
    transform: scale(1.05); 
}

.btn-leave { 
    position: absolute; 
    top: 12px; 
    left: 12px; 
    background: rgba(239,68,68,0.1); 
    border: 1px solid rgba(239,68,68,0.3); 
    color: #ef4444; 
    padding: 6px 12px; 
    border-radius: 12px; 
    font-size: 0.85em; 
    font-weight: bold; 
    z-index: 100; 
    transition: 0.2s; 
}

.btn-leave:hover { 
    background: rgba(239,68,68,0.2); 
    transform: scale(1.05); 
}

/* ════════════════════════════════════════════════
   LOGIN SCREEN (GLASSMORPHISM)
   ════════════════════════════════════════════════ */
#room-entry { 
    justify-content: center; 
    text-align: center; 
    padding: 0; 
    position: relative; 
    min-height: 100vh; 
    overflow: hidden; 
}

.login-bg { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    z-index: 1; 
    filter: brightness(0.85); 
    transition: opacity 0.5s; 
}

.glass-panel { 
    position: relative; 
    z-index: 10; 
    background: rgba(255, 255, 255, 0.12); 
    backdrop-filter: blur(4px); 
    border: 1px solid rgba(255, 255, 255, 0.3); 
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.25); 
    border-radius: 16px; 
    padding: 30px 25px; 
    width: 90%; 
    max-width: 380px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    animation: fadeIn 0.6s ease-out; 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.glass-panel label { 
    color: #fff; 
    text-shadow: 0 1px 4px rgba(0,0,0,0.6); 
    font-size: 0.9em; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    font-weight: bold; 
    text-align: center; 
    margin-bottom: -5px; 
}

.glass-input { 
    width: 100%; 
    background: rgba(0, 0, 0, 0.15); 
    border: 1px solid rgba(255, 255, 255, 0.3); 
    border-radius: 8px; 
    color: #fbbf24; 
    font-size: 1.5em; 
    font-weight: bold; 
    text-align: center; 
    padding: 10px; 
    letter-spacing: 0.15em; 
    text-transform: uppercase; 
    outline: none; 
    transition: all 0.3s ease; 
}

.glass-input::placeholder { 
    color: rgba(255, 255, 255, 0.4); 
    font-weight: normal; 
    letter-spacing: 0.05em; 
    font-size: 0.8em; 
    text-transform: none; 
}

.glass-input:focus { 
    border-color: #fbbf24; 
    background: rgba(0, 0, 0, 0.3); 
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3); 
}

#inp-training-code:focus { 
    border-color: #22c55e; 
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3); 
}

.glass-btn { 
    width: 100%; 
    background: rgba(0, 0, 0, 0.35); 
    color: #fbbf24; 
    border: 2px solid rgba(251, 191, 36, 0.6); 
    border-radius: 10px; 
    padding: 14px 10px; 
    font-size: clamp(0.95em, 4vw, 1.1em); 
    font-weight: 900; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    transition: all 0.2s ease; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.9); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); 
}

.glass-btn:hover { 
    background: rgba(251, 191, 36, 0.2); 
    border-color: #fbbf24; 
    transform: scale(1.03); 
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3); 
}

.glass-btn:active { 
    transform: scale(0.97); 
}

.glass-btn.btn-green { 
    background: rgba(20, 40, 20, 0.6); 
    border-color: rgba(34, 197, 94, 0.8); 
    color: #4ade80; 
}

.glass-btn.btn-green:hover { 
    background: rgba(34, 197, 94, 0.25); 
    border-color: #4ade80; 
    color: #fff; 
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4); 
}

.glass-error { 
    color: #ef4444; 
    font-weight: bold; 
    min-height: 1.5em; 
    text-shadow: 0 1px 4px rgba(0,0,0,0.8); 
    font-size: 0.95em; 
}

.secondary-menu { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    margin-top: 25px; 
    border-top: 1px solid rgba(255,255,255,0.15); 
    padding-top: 20px; 
}

.subtle-link { 
    background: rgba(0,0,0,0.3); 
    color: #cbd5e1; 
    text-decoration: none; 
    font-size: 0.95em; 
    font-weight: bold; 
    padding: 12px 15px; 
    border-radius: 8px; 
    border: 1px solid rgba(255,255,255,0.05); 
    transition: all 0.2s ease; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.8); 
}

.subtle-link:hover { 
    background: rgba(0,0,0,0.5); 
    transform: translateY(-2px); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); 
}
.subtle-link.yellow:hover { color: #fbbf24; border-color: rgba(251,191,36,0.3); }
.subtle-link.blue:hover { color: #60a5fa; border-color: rgba(96,165,250,0.3); }
.subtle-link.green:hover { color: #4ade80; border-color: rgba(74,222,128,0.3); }
.subtle-link.purple:hover { color: #a78bfa; border-color: rgba(167,139,250,0.3); }

/* ════════════════════════════════════════════════
   JOIN SCREEN
   ════════════════════════════════════════════════ */
#join { 
    justify-content: flex-start; 
    padding-top: 55px; 
} 

.join-title { 
    font-size: 1.8em; 
    color: #fbbf24; 
    text-shadow: 0 0 15px rgba(251,191,36,0.3); 
    margin-bottom: 5px; 
}

.join-room-badge { 
    background: rgba(251,191,36,0.15); 
    border: 1px solid rgba(251,191,36,0.3); 
    border-radius: 8px; 
    padding: 4px 16px; 
    font-size: 0.85em; 
    color: #fbbf24; 
    margin-bottom: 15px; 
    letter-spacing: 0.15em; 
}

.join-form { 
    width: 100%; 
    max-width: 360px; 
}

.form-group { 
    margin-bottom: 16px; 
}

.form-group label { 
    display: block; 
    font-size: 0.85em; 
    color: #94a3b8; 
    margin-bottom: 6px; 
}

.form-group input[type="text"] { 
    width: 100%; 
    padding: 12px 15px; 
    border-radius: 10px; 
    border: 2px solid #334155; 
    background: #1e293b; 
    color: #fff; 
    font-size: 1.1em; 
    text-align: center; 
}

.class-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 6px; 
}

.class-btn { 
    background: rgba(255,255,255,0.06); 
    border: 2px solid transparent; 
    border-radius: 10px; 
    padding: 10px 4px; 
    text-align: center; 
    color: #fff; 
    transition: 0.3s; 
}

.class-btn.selected { 
    border-color: #fbbf24; 
    background: rgba(251,191,36,0.15); 
}

.class-btn .cb-icon { 
    font-size: 1.5em; 
    display: block; 
}

.class-btn .cb-name { 
    font-size: 0.7em; 
    margin-top: 3px; 
    display: block; 
}

.avatar-selector { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 20px; 
    padding: 5px 0; 
}

.avatar-btn { 
    background: rgba(30, 41, 59, 0.8); 
    border: 2px solid #3b82f6; 
    color: #60a5fa; 
    width: 44px; 
    height: 44px; 
    border-radius: 50%; 
    font-size: 1.2em;
    display: flex;
    justify-content: center;
    align-items: center; 
    transition: all 0.2s ease;
}

.avatar-btn:active {
    transform: scale(0.9);
    background: #3b82f6;
    color: #fff;
}

.avatar-preview { 
    height: 22vh; 
    min-height: 120px; 
    max-height: 220px; 
    width: auto; 
    object-fit: contain; 
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
}

.btn-join { 
    width: 100%; 
    padding: 14px; 
    border: none; 
    border-radius: 12px; 
    font-size: 1.3em; 
    font-weight: bold; 
    background: linear-gradient(135deg, #22c55e, #16a34a); 
    color: #fff; 
    margin-top: 10px; 
}

.btn-join:disabled { 
    opacity: 0.4; 
    cursor: not-allowed; 
}

.join-error { 
    color: #ef4444; 
    text-align: center; 
    font-size: 0.85em; 
    margin-top: 8px; 
    min-height: 20px; 
}

/* ════════════════════════════════════════════════
   WAITING SCREEN
   ════════════════════════════════════════════════ */
#waiting { 
    justify-content: center; 
    text-align: center; 
    position: relative; 
}

.wait-icon { 
    font-size: 3em; 
    animation: bounce 1s infinite; 
}

@keyframes bounce { 
    0%, 100% { transform: translateY(0); } 
    50% { transform: translateY(-10px); } 
}

.wait-text { 
    font-size: 1.1em; 
    color: #94a3b8; 
    margin-top: 15px; 
}

.wait-name { 
    font-size: 1.3em; 
    font-weight: bold; 
    color: #fbbf24; 
    margin-top: 10px; 
}

/* ════════════════════════════════════════════════
   RPG UPDATE: PLAY SCREEN & UI ELEMENTE
   ════════════════════════════════════════════════ */
#play { 
    padding: 45px 10px 20px; 
    justify-content: flex-start; 
} 

/* Level & AP Leiste Header */
.play-header { 
    width: 100%; 
    max-width: 400px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 5px; 
}

.play-name { 
    font-weight: bold; 
    font-size: 0.9em; 
    color: #cbd5e1; 
}

.play-streak { 
    color: #f97316; 
    font-weight: bold; 
    font-size: 0.9em; 
}

.ap-container { 
    display: flex; 
    gap: 4px; 
    justify-content: center; 
    margin-bottom: 8px; 
}

.ap-crystal { 
    font-size: 1.1em; 
    transition: 0.3s; 
    filter: drop-shadow(0 0 2px rgba(59,130,246,0.5)); 
}

.ap-crystal.active { 
    opacity: 1; 
    transform: scale(1.1); 
}

.ap-crystal.empty { 
    opacity: 0.25; 
    filter: grayscale(1); 
}

/* HP & Status */
.hp-bar-container { 
    width: 100%; 
    max-width: 400px; 
    margin-bottom: 8px; 
}

.hp-bar-outer { 
    width: 100%; 
    height: 18px; 
    background: #1e293b; 
    border-radius: 9px; 
    overflow: hidden; 
    border: 1px solid #334155; 
}

.hp-bar-fill { 
    height: 100%; 
    border-radius: 8px; 
    transition: width 0.5s; 
}

.hp-text { 
    font-size: 0.75em; 
    text-align: center; 
    margin-top: 2px; 
    color: #94a3b8; 
}

.shield-badge { 
    background: rgba(59,130,246,0.2); 
    border: 1px solid #3b82f6; 
    border-radius: 8px; 
    padding: 4px 12px; 
    font-size: 0.8em; 
    margin-bottom: 6px; 
    display: none; 
}

.shield-badge.visible { 
    display: inline-block; 
}

/* Powerups */
.powerup-box { 
    background: rgba(251,191,36,0.1); 
    border: 1px solid rgba(251,191,36,0.3); 
    border-radius: 10px; 
    padding: 10px; 
    width: 100%; 
    max-width: 400px; 
    margin-bottom: 8px; 
    text-align: center; 
    display: none; 
}

.powerup-box.visible { 
    display: block; 
}

.risk-btn { 
    background: linear-gradient(135deg, #f59e0b, #d97706); 
    color: #fff; 
    border: none; 
    padding: 6px 16px; 
    border-radius: 8px; 
    font-weight: bold; 
    font-size: 0.9em; 
    margin-top: 6px; 
}

.risk-btn:disabled { 
    opacity: 0.4; 
    cursor: not-allowed; 
}

/* Vokabel Karte */
.vocab-card { 
    background: rgba(255,255,255,0.06); 
    border-radius: 14px; 
    padding: 15px; 
    width: 100%; 
    max-width: 400px; 
    text-align: center; 
    border: 1px solid rgba(255,255,255,0.1); 
}

.vc-label { 
    font-size: 0.75em; 
    color: #94a3b8; 
    margin-bottom: 5px; 
}

.vc-word { 
    font-size: 1.5em; 
    font-weight: bold; 
    margin-bottom: 5px; 
}

.vc-image { 
    max-width: 240px; 
    max-height: 160px; 
    border-radius: 10px; 
    margin: 5px auto; 
    display: none; 
    border: 2px solid rgba(255,255,255,0.1); 
}

.vc-timer { 
    font-size: 2em; 
    font-weight: bold; 
    color: #fbbf24; 
    margin: 5px 0; 
}

.vc-timer.urgent { 
    color: #ef4444; 
    animation: pulse 0.5s infinite; 
}

@keyframes pulse { 
    0%, 100% { opacity: 1; } 
    50% { opacity: 0.5; } 
}

.answer-input { 
    width: 100%; 
    padding: 12px; 
    border-radius: 10px; 
    border: 2px solid #334155; 
    background: #1e293b; 
    color: #fff; 
    font-size: 1.1em; 
    text-align: center; 
    margin-top: 5px; 
    outline: none; 
    transition: 0.3s; 
}

.answer-input:focus { 
    border-color: #fbbf24; 
    background: #0f172a; 
}

.mc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

.synonym-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 480px) {
    .mc-grid, .synonym-grid {
        grid-template-columns: 1fr;
    }
}
.mc-btn { 
    padding: 12px 8px; 
    border: 2px solid #334155; 
    border-radius: 10px; 
    background: #1e293b; 
    color: #fff; 
    font-size: 0.95em; 
    font-weight: bold; 
    text-align: center; 
}

.mc-btn.selected { 
    border-color: #fbbf24; 
    background: rgba(251,191,36,0.15); 
}

.btn-submit { 
    width: 100%; 
    max-width: 400px; 
    padding: 14px; 
    border: none; 
    border-radius: 12px; 
    font-size: 1.2em; 
    font-weight: bold; 
    background: linear-gradient(135deg, #ef4444, #dc2626); 
    color: #fff; 
    margin-top: 12px; 
}

/* ════════════════════════════════════════════════
   DAS NEUE HYBRID MENÜ (SWIPE / TAB)
   ════════════════════════════════════════════════ */
.action-wrapper { 
    width: 100%; 
    max-width: 400px; 
    margin-top: 12px; 
}

.action-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: rgba(30, 41, 59, 0.8); 
    padding: 6px 15px; 
    border-radius: 10px 10px 0 0; 
    border: 1px solid #334155; 
    border-bottom: none; 
    cursor: pointer; 
    user-select: none; 
}

.action-nav-arrow { 
    color: #94a3b8; 
    font-weight: bold; 
    font-size: 1.2em; 
}

.action-title { 
    font-weight: bold; 
    font-size: 0.85em; 
    color: #fbbf24; 
    text-transform: uppercase; 
    letter-spacing: 0.1em; 
}

.action-slider { 
    display: flex; 
    overflow-x: auto; 
    scroll-snap-type: x mandatory; 
    scroll-behavior: smooth; 
    background: rgba(15, 23, 42, 0.6); 
    border: 1px solid #334155; 
    border-radius: 0 0 10px 10px; 
    padding: 10px; 
    gap: 0; 
    scrollbar-width: none; 
}

.action-slider::-webkit-scrollbar { 
    display: none; 
}

.swipe-page { 
    min-width: 100%; 
    scroll-snap-align: center; 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 8px; 
}

/* Die Action Buttons (Skills & Items) */
.action-btn { 
    background: rgba(0,0,0,0.5); 
    border: 2px solid #475569; 
    border-radius: 10px; 
    padding: 10px 4px; 
    color: #fff; 
    text-align: center; 
    position: relative; 
    transition: 0.2s; 
    user-select: none; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    min-height: 75px; 
}

.action-btn .ac-icon { 
    font-size: 2.2em; 
    display: block; 
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8)); 
    margin-bottom: 4px;
}

.action-btn .ac-name { 
    font-size: 0.85em; 
    font-weight: bold; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    width: 100%; 
    color: #f8fafc;
}

.action-btn .ac-cost { 
    font-size: 0.8em; 
    color: #cbd5e1; 
    margin-top: 4px; 
    font-weight: 900;
}

/* Zustände der Action-Buttons */
.action-btn:not(.disabled):not(.empty):active { 
    transform: scale(0.95); 
}

.action-btn.disabled { 
    opacity: 0.55; 
    filter: grayscale(0.8); 
    border-style: solid; 
    border-color: #334155; 
    cursor: not-allowed;
}

.action-btn.disabled .ac-cost {
    color: #ef4444; 
}

.action-btn.empty { 
    opacity: 0.15; 
    border-style: dashed; 
    border-color: #334155;
    cursor: default; 
}

.action-btn.armed { 
    border-color: #fbbf24; 
    background: rgba(251,191,36,0.25); 
    box-shadow: 0 0 15px rgba(251,191,36,0.5), inset 0 0 10px rgba(251,191,36,0.2); 
    transform: scale(1.05) translateY(-2px); 
    z-index: 2; 
}

.action-btn.armed .ac-name { 
    color: #fbbf24; 
}

.action-btn.armed .ac-cost { 
    color: #fbbf24; 
}

.action-btn .ac-uses { 
    position: absolute; 
    top: -6px; 
    right: -6px; 
    background: #0f172a; 
    border: 2px solid #3b82f6; 
    color: #3b82f6; 
    font-size: 0.75em; 
    padding: 2px 6px; 
    border-radius: 8px; 
    font-weight: 900; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.8); 
}

/* Overlay nach der Antwort */
.answered-overlay { 
    display: none; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    width: 100%; 
    max-width: 400px; 
    padding: 30px; 
    text-align: center; 
}

.answered-overlay.visible { 
    display: flex; 
}

/* ════════════════════════════════════════════════
   RESULT, ENDE UND SCHATTENWELT
   ════════════════════════════════════════════════ */
#result, #end { 
    justify-content: center; 
    text-align: center; 
}

.result-icon, .end-icon { 
    font-size: 4em; 
    margin-bottom: 10px; 
}

.result-main { 
    font-size: 1.4em; 
    font-weight: bold; 
    margin-bottom: 8px; 
}

.result-main.correct { color: #22c55e; }
.result-main.wrong { color: #ef4444; }

.result-detail { 
    font-size: 0.95em; 
    color: #94a3b8; 
    line-height: 1.6; 
}

.result-answer { 
    background: rgba(255,255,255,0.06); 
    border-radius: 10px; 
    padding: 10px; 
    margin-top: 10px; 
    font-size: 1em; 
}

.end-title-s { 
    font-size: 2em; 
    margin-bottom: 10px; 
}

.end-title-s.victory { color: #fbbf24; }
.end-title-s.defeat { color: #ef4444; }

/* SCHATTENWELT UI (Ersetzt den alten Dead-Screen) */
#dead { 
    justify-content: center; 
    text-align: center; 
    position: relative; 
}

.dead-bg { 
    position: absolute; 
    top:0; 
    left:0; 
    width:100%; 
    height:100%; 
    background: radial-gradient(circle, #2a0a2a 0%, #0a000a 100%); 
    z-index: -1; 
}

.shadow-skulls { 
    display: flex; 
    justify-content: center; 
    gap: 8px; 
    margin-bottom: 15px; 
}

.shadow-skull { 
    font-size: 2em; 
    opacity: 0.2; 
    filter: grayscale(1); 
    transition: 0.4s; 
}

.shadow-skull.lit { 
    opacity: 1; 
    filter: drop-shadow(0 0 10px #ef4444); 
}

.shadow-card { 
    border-color: #ef4444 !important; 
    background: rgba(20, 0, 0, 0.6) !important; 
}

/* ACHIEVEMENTS LIST */
.end-achiev-card { 
    background: rgba(255,255,255,0.1); 
    border: 1px solid rgba(251, 191, 36, 0.5); 
    border-radius: 8px; 
    padding: 8px 12px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    animation: popIn 0.5s ease-out backwards; 
    text-align: left; 
    margin-bottom: 8px; 
}

@keyframes popIn { 
    from { transform: scale(0); opacity: 0; } 
    to { transform: scale(1); opacity: 1; } 
}

.end-achiev-card img { 
    width: 35px; 
    height: 35px; 
    object-fit: contain; 
}

.end-achiev-title { 
    color: #fbbf24; 
    font-weight: bold; 
    font-size: 0.95em; 
}

/* 💥 HURT ANIMATION (Weißer Flash & Knockback mit 0.5s Pause & Fadeout) */
.hurt-anim-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: transparent; z-index: 9999; pointer-events: none;
    display: flex; justify-content: center; align-items: center;
}

.hurt-anim-overlay.flash-white {
    animation: fadeOutWhite 0.6s ease-out forwards;
}

@keyframes fadeOutWhite {
    0% { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(4px); }
    100% { background: transparent; backdrop-filter: blur(0px); }
}

.hurt-anim-container {
    transform: scale(1.5);
}

.hurt-anim-container.knockback {
    animation: hurtKnockback 1.9s linear forwards;
}

.hurt-anim-sprite {
    height: 45vh; object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.8)); /* Roter Schatten */
}

/* 1.9s Gesamt: 
   0 - 0.4s (ca. 21%): Initialer Flash, Wackeln & zurück zur Mitte 
   0.4s - 0.9s (21% - 47%): Figur steht 0.5s vollkommen still 
   0.9s - 1.9s (47% - 100%): 1s sanfter Fade Out (Brightness & Opacity auf 0) */
@keyframes hurtKnockback {
    0% { transform: scale(1.5) translate(0, 0) rotate(0deg); filter: brightness(2) invert(1); opacity: 1; } 
    8% { transform: scale(1.4) translate(-20px, 10px) rotate(-10deg); filter: sepia(1) hue-rotate(-50deg) saturate(5); opacity: 1; } 
    16% { transform: scale(1.45) translate(15px, -5px) rotate(5deg); filter: none; opacity: 1; }
    21% { transform: scale(1.4) translate(0, 0) rotate(0deg); filter: none; opacity: 1; } /* Stillstand Beginn */
    47% { transform: scale(1.4) translate(0, 0) rotate(0deg); filter: brightness(1); opacity: 1; } /* Stillstand Ende / Fade Out Beginn */
    100% { transform: scale(1.4) translate(0, 0) rotate(0deg); filter: brightness(0); opacity: 0; } /* Fade to Black */
}

/* ── NEUE AUFGABENTYPEN STYLING ── */

#task-special-container { width: 100%; margin-top: 15px; position: relative; }

/* Matching */
.match-task { display: flex; justify-content: space-between; gap: 40px; position: relative; padding: 10px 0; }
.match-column { display: flex; flex-direction: column; gap: 10px; flex: 1; z-index: 2; }
.match-btn { 
    background: #1e293b; border: 2px solid #334155; border-radius: 8px; padding: 12px 8px; 
    text-align: center; font-weight: bold; font-size: 0.9em; cursor: pointer; transition: 0.2s;
    min-height: 45px; display: flex; align-items: center; justify-content: center;
}
.match-btn.selected { border-color: #3b82f6; background: rgba(59, 130, 246, 0.2); }
.match-btn.matched { opacity: 1; border-color: currentColor; color: #fff; transform: scale(0.98); }
.match-btn.matched[data-color="green"] { background: rgba(34, 197, 94, 0.2); color: #4ade80; border-color: #22c55e; }
.match-btn.matched[data-color="blue"] { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border-color: #3b82f6; }
.match-btn.matched[data-color="yellow"] { background: rgba(251, 191, 36, 0.2); color: #fbbf24; border-color: #f59e0b; }
.match-btn.matched[data-color="orange"] { background: rgba(249, 115, 22, 0.2); color: #fb923c; border-color: #ea580c; }
.match-btn.matched[data-color="lightblue"] { background: rgba(6, 182, 212, 0.2); color: #22d3ee; border-color: #0891b2; }
.match-btn.matched[data-color="pink"] { background: rgba(236, 72, 153, 0.2); color: #f472b6; border-color: #db2777; }

.match-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* Wahr / Falsch */
.tf-task { display: flex; gap: 15px; margin-top: 10px; }
.tf-btn { 
    flex: 1; padding: 20px; border-radius: 12px; border: 3px solid #334155; 
    font-size: 1.2em; font-weight: 900; cursor: pointer; transition: 0.2s; color: #fff;
}
.tf-btn.true { background: rgba(34, 197, 94, 0.1); border-color: #22c55e; }
.tf-btn.false { background: rgba(239, 68, 68, 0.1); border-color: #ef4444; }
.tf-btn.selected { transform: scale(1.05); box-shadow: 0 0 20px currentColor; }

/* Schüttelsätze */
.shuffle-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 100px; padding: 10px; background: rgba(0,0,0,0.2); border-radius: 8px; }
.shuffle-item { 
    background: #1e293b; border: 2px solid #3b82f6; border-radius: 6px; padding: 8px 15px; 
    cursor: grab; font-weight: bold; color: #fff; user-select: none;
}

/* Lückentexte */
.cloze-input-inline:focus, #answer-input:focus { 
    outline: none !important; 
    border: 2px solid #3b82f6 !important; 
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    background: rgba(30, 41, 59, 0.9) !important;
}

.cloze-input-inline {
    background: rgba(0,0,0,0.3);
    border: 1px solid #334155;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 1.1em;
    text-align: center;
    transition: all 0.2s;
}
.cloze-drop { 
    display: inline-block; min-width: 80px; min-height: 30px; border-bottom: 2px dashed #3b82f6; 
    vertical-align: middle; margin: 0 5px; background: rgba(59, 130, 246, 0.1); border-radius: 4px;
}
.cloze-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; border-top: 1px solid #334155; padding-top: 15px; }
.cloze-item { background: #3b82f6; color: #fff; padding: 5px 12px; border-radius: 4px; cursor: grab; font-weight: bold; }

/* Kuckucksei & Fehler-Detektor */
.odd-grid, .error-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.odd-btn, .error-btn { 
    background: #1e293b; border: 2px solid #334155; border-radius: 8px; padding: 15px 10px; 
    color: #fff; font-weight: bold; cursor: pointer; transition: 0.2s;
}
.odd-btn.selected, .error-btn.selected { border-color: #fbbf24; background: rgba(251, 191, 36, 0.2); }
.monster-bubble { 
    background: #7f1d1d; color: #fff; padding: 15px; border-radius: 12px; position: relative; 
    margin-bottom: 10px; border: 2px solid #ef4444; font-style: italic;
}
.monster-bubble::after { 
    content: ''; position: absolute; bottom: -10px; left: 20px; 
    border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid #ef4444; 
}

/* ── SEQUENCING & ORDER ── */
.order-list { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 400px; margin: 0 auto; }
.order-item { 
    background: #1e293b; border: 2px solid #3b82f6; border-radius: 8px; padding: 12px; 
    font-weight: bold; text-align: center; cursor: grab; user-select: none;
}

/* ── KATEGORISIEREN (GROUP) ── */
.group-task { display: flex; flex-direction: column; gap: 20px; width: 100%; }
.group-targets { display: flex; gap: 10px; justify-content: center; }
.group-target { 
    flex: 1; min-height: 120px; background: rgba(255,255,255,0.05); border: 2px dashed #475569; 
    border-radius: 10px; display: flex; flex-direction: column; overflow: hidden;
}
.group-target-label { background: #334155; padding: 5px; font-size: 0.8em; font-weight: bold; text-transform: uppercase; color: #94a3b8; }
.group-target-content { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 5px; min-height: 80px; }
.group-pool { 
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 15px; 
    background: rgba(0,0,0,0.2); border-radius: 10px; min-height: 60px;
}
.group-item { background: #3b82f6; color: #fff; padding: 8px 15px; border-radius: 6px; cursor: grab; font-weight: bold; font-size: 0.9em; }

/* ── ANAGRAMM ── */
.anagram-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 10px; }
.anagram-letter { 
    width: 40px; height: 45px; background: #1e293b; border: 2px solid #fbbf24; border-radius: 6px; 
    display: flex; align-items: center; justify-content: center; font-size: 1.4em; font-weight: 900; 
    color: #fbbf24; cursor: grab; user-select: none;
}

/* ── IMAGE MC ── */
.image-mc-task { width: 100%; max-width: 800px; margin: 0 auto; }
.image-mc-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
    gap: 15px; 
    padding: 10px; 
}
.image-mc-btn { 
    background: #1e293b; border: 3px solid #334155; border-radius: 12px; overflow: hidden; 
    aspect-ratio: 3/2; cursor: pointer; transition: 0.2s; position: relative;
    padding: 0;
}
.image-mc-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-mc-btn.selected { border-color: #3b82f6; transform: scale(1.05); box-shadow: 0 0 15px rgba(59, 130, 246, 0.5); }
.image-mc-btn:hover { border-color: #4b5563; transform: translateY(-2px); }

@media (max-width: 600px) {
    .image-mc-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ── SYNONYM / ANTONYM ── */
.synonym-task { width: 100%; margin-top: 10px; }
.synonym-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.synonym-btn { 
    background: #1e293b; border: 2px solid #334155; border-radius: 10px; padding: 12px 8px; 
    color: #fff; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 0.95em;
}
.synonym-btn.selected { border-color: #fbbf24; background: rgba(251, 191, 36, 0.2); }
.synonym-btn:hover { border-color: #4b5563; }
/* ------------------------------------------------
   SHADOWWORLD / REVIVE STYLES
   ------------------------------------------------ */
.shadow-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 30%, rgba(127, 29, 29, 0.4) 100%);
    pointer-events: none; z-index: 1; display: none;
}
.shadow-indicator {
    display: none; flex-direction: column; align-items: center;
    background: rgba(69, 10, 10, 0.8); border: 2px solid #ef4444;
    border-radius: 12px; padding: 8px 15px; margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6), inset 0 0 10px rgba(239, 68, 68, 0.3);
    z-index: 5;
}
.shadow-skulls { display: flex; gap: 8px; justify-content: center; }
.shadow-skull { 
    font-size: 1.4em; filter: grayscale(1) opacity(0.3); 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.shadow-skull.active { filter: grayscale(0) opacity(1); transform: scale(1.2); }

#play.is-dead .shadow-overlay, 
#play.is-dead .shadow-indicator { display: flex; }

#play.is-dead .vocab-card { border-color: #ef4444; background: rgba(69, 10, 10, 0.4); }
#play.is-dead .vc-timer { border-color: #ef4444; background: #450a0a; }
#play.is-dead .btn-submit { background: linear-gradient(135deg, #7f1d1d, #450a0a); border-color: #ef4444; }
#play.is-dead .action-wrapper,
#play.is-dead .hp-bar-container,
#play.is-dead .shield-badge,
#play.is-dead .powerup-box { display: none !important; }

