/* public/css/game.css */
/* Version: RESULT LIST UPDATE (Unified Protocol) 🟥🟩 */

/* --- SETTINGS BAR --- */
.settings-bar {
    display: flex; justify-content: center; gap: 20px; align-items: center;
    background: rgba(255,255,255,0.5); padding: 15px; border-radius: 12px;
    margin-bottom: 25px; border: 1px solid rgba(255,255,255,0.6); flex-wrap: wrap;
}
.settings-bar > div { display: flex; align-items: center; gap: 8px; }
#voiceSelect { font-size: 0.8rem !important; padding: 6px 10px; line-height: 1.3; max-width: 200px; border: 1px solid #cbd5e1; border-radius: 6px; background-color: #fff; cursor: pointer; height: auto; }
#rateSlider { vertical-align: middle; cursor: pointer; margin: 0; }

/* --- LISTE --- */
#card-list {
    display: flex; flex-direction: column; width: 100%; gap: 0; 
}

/* --- BASIS KARTE --- */
.task-card {
    order: 50; 
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    display: flex; align-items: center; gap: 15px;
    transition: all 0.3s ease;
    margin-bottom: 12px; 
}

/* Audio Buttons */
.btn-audio-group { display: flex; gap: 8px; flex-shrink: 0; }
.btn-speak, .btn-example { width: 42px; height: 42px; border-radius: 8px; border: 1px solid #cbd5e1; background: #f1f5f9; color: #475569; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.btn-speak:hover { background: #3b82f6; color: white; border-color: #3b82f6; }
.btn-example:hover { background: #8b5cf6; color: white; border-color: #8b5cf6; }

/* Input Feld */
.app_ansage-input { flex-grow: 1; font-size: 1.2rem; padding: 10px 15px; border: 2px solid #e2e8f0; border-radius: 8px; outline: none; font-family: inherit; transition: background-color 0.2s, border-color 0.2s; }
.app_ansage-input:focus { border-color: #3b82f6; background: #fff; }


/* --- ERGEBNIS-MODUS (Allgemein) --- */
/* Gemeinsame Styles für fertige Karten (egal ob rot oder grün) */
.task-card.solved-correctly,
.task-card.solved-wrong {
    order: -1; /* Beide nach oben sortieren */
    margin-bottom: 0;
    padding: 8px 12px;
    min-height: 0;
    opacity: 1;
    border-radius: 0; /* Ecken erstmal eckig machen */
    
    /* Innen-Linien */
    border-top: none;
}

/* Buttons ausblenden */
.task-card.solved-correctly .btn-audio-group, .task-card.solved-wrong .btn-audio-group { display: none !important; }


/* --- ZUSTAND: RICHTIG (Grün) --- */
.task-card.solved-correctly {
    background-color: #f0fdf4; 
    border-left: 1px solid #bbf7d0;
    border-right: 1px solid #bbf7d0;
    border-bottom: 1px solid #dcfce7;
}
.task-card.solved-correctly input {
    background-color: transparent !important; border: none !important;
    color: #15803d; font-weight: bold; padding: 0; margin: 0;
    box-shadow: none; pointer-events: none; height: auto; font-size: 1.1rem !important;
}
.task-card.solved-correctly::before { content: '✅'; font-size: 1.1rem; margin-right: 8px; }


/* --- ZUSTAND: FALSCH ABER BEENDET (Rot) --- */
.task-card.solved-wrong {
    background-color: #fef2f2; 
    border-left: 1px solid #fecaca;
    border-right: 1px solid #fecaca;
    border-bottom: 1px solid #fee2e2;
}
.task-card.solved-wrong::before { content: '❌'; font-size: 1.1rem; margin-right: 8px; }

/* Text-Darstellung im roten Block */
.correction-display { font-size: 1.1rem; color: #334155; }
.correction-display s { color: #ef4444; opacity: 0.8; margin-right: 8px; text-decoration-color: #ef4444; }
.correction-display b { color: #15803d; font-weight: 700; }


/* --- RUNDE ECKEN LOGIK (Für den ganzen Block) --- */

/* Erstes Element im Ergebnis-Block (egal ob rot oder grün) */
.task-card.is-first-result {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    border-top: 1px solid; /* Farbe wird unten spezifisch gesetzt */
}
.task-card.solved-correctly.is-first-result { border-top-color: #bbf7d0 !important; }
.task-card.solved-wrong.is-first-result     { border-top-color: #fecaca !important; }

/* Letztes Element im Ergebnis-Block */
.task-card.is-last-result {
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
    border-bottom: 1px solid;
}
.task-card.solved-correctly.is-last-result { border-bottom-color: #bbf7d0 !important; }
.task-card.solved-wrong.is-last-result     { border-bottom-color: #fecaca !important; }


/* --- INTERAKTIV: FEHLER (Während Spiel) --- */
.task-card.has-error {
    order: 100; 
    border-color: #fca5a5; background-color: #fff1f2;
    animation: shake 0.4s ease-in-out;
    margin-top: 12px; margin-bottom: 12px; border-radius: 10px; /* Hier rund bleiben */
}
.task-card.has-error input { border-color: #ef4444; background-color: #fff1f2; color: #991b1b; font-weight: bold; }

/* --- INTERAKTIV: KORREKTUR --- */
.task-card.is-correcting {
    order: 100; 
    background-color: #ffffff; border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    margin-top: 12px; margin-bottom: 12px; border-radius: 10px;
}

.reveal-on-focus:not(:focus)::placeholder { color: transparent !important; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.action-buttons { margin-top: 30px; display: flex; justify-content: center; gap: 15px; }

/* Meisterprüfungs-Button – Gold, exklusiv */
.btn.btn-mastery {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn.btn-mastery:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
}

@media (max-width: 600px) {
    .settings-bar { flex-direction: column; align-items: stretch; gap: 15px; }
    .settings-bar > div { justify-content: space-between; }
    #voiceSelect { width: 100%; max-width: 60%; }
}