/* --- GLOBALE STYLES (Mobile First) --- */
* { box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; padding: 0; }
body { background-color: #f2f2f2; color: #333; overflow-x: hidden; }

/* Animierter Hintergrund für Menüs */
.menu-body { 
    display: flex; flex-direction: column; justify-content: center; align-items: center; 
    min-height: 100vh; padding: 20px;
    background: linear-gradient(-45deg, #46178f, #864cbf, #1368ce, #26890c);
    background-size: 400% 400%; animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container { width: 100%; max-width: 900px; text-align: center; }
h1 { font-size: 2rem; margin-bottom: 15px; color: white; text-shadow: 2px 2px 0px rgba(0,0,0,0.2); }
h3 { font-size: 1.2rem; color: rgba(255,255,255,0.9); margin-bottom: 30px; font-weight: normal; }

/* --- GRIDS (Mobile First) --- */
/* Standard: 1 Spalte für Handys */
.subject-grid { display: grid; grid-template-columns: 1fr; gap: 15px; width: 100%; }
.answers-grid { display: grid; grid-template-columns: 1fr; gap: 12px; width: 100%; margin-top: 20px; padding-bottom: 20px; }

/* Tablet & Desktop: Ab 600px Breite springen wir auf 2 oder mehr Spalten */
@media (min-width: 600px) {
    h1 { font-size: 3rem; }
    h3 { font-size: 1.5rem; margin-bottom: 40px; }
    .subject-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
    .answers-grid.grid-4, .answers-grid.grid-2 { grid-template-columns: 1fr 1fr; gap: 15px; }
}

/* --- KARTEN & BUTTONS --- */
.subject-card {
    background: white; padding: 25px 20px; border-radius: 12px; text-decoration: none;
    color: #333; box-shadow: 0 8px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex; flex-direction: column; justify-content: center; min-height: 120px;
}
.subject-card:hover { transform: translateY(-5px); box-shadow: 0 12px 25px rgba(0,0,0,0.3); }
.subject-card h2 { font-size: 1.5rem; margin-bottom: 8px; }
.subject-card p { opacity: 0.9; font-size: 0.95rem; line-height: 1.4; }

.exit-btn, .next-btn {
    display: inline-block; padding: 12px 24px; font-weight: bold; border-radius: 8px;
    text-decoration: none; cursor: pointer; transition: opacity 0.2s;
}
.next-btn { background: #333; color: white; border: none; font-size: 1.1rem; }
.exit-btn { color: white; border: 2px solid rgba(255,255,255,0.5); margin-top: 20px; }
.exit-btn:hover { background: rgba(255,255,255,0.1); }

/* --- QUIZ UI --- */
.quiz-body { display: flex; flex-direction: column; min-height: 100vh; background-color: #f2f2f2; }
.quiz-header { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 15px; font-weight: bold; font-size: 1rem; background: white; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); z-index: 10;
}
.quiz-header .exit-btn { margin: 0; padding: 8px 15px; background: #e21b3c; color: white; border: none; }
.quiz-container { flex-grow: 1; display: flex; flex-direction: column; align-items: center; padding: 15px; width: 100%; max-width: 1000px; margin: 0 auto; }

.question-text { 
    font-size: 1.5rem; text-align: center; margin: 20px 0; background: white; 
    padding: 25px 15px; border-radius: 10px; width: 100%; box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    color: #333; /* Fix: Erzwingt dunkle Schrift auf dem weissen Kasten */
    text-shadow: none; /* Fix: Entfernt den Schatten, der nur für das Menü gedacht war */
}
@media (min-width: 600px) { .question-text { font-size: 2.2rem; padding: 40px; } }
.timer-bar-container { width: 100%; height: 12px; background: #ddd; border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.timer-bar { height: 100%; background: #864cbf; width: 100%; transition: width 0.1s linear, background-color 0.3s; }

.answer-btn {
    border: none; border-radius: 8px; font-size: 1.2rem; color: white; cursor: pointer;
    display: flex; align-items: center; padding: 18px 15px; box-shadow: inset 0 -4px rgba(0,0,0,0.2);
    transition: filter 0.2s, transform 0.1s; font-weight: bold; min-height: 80px; text-align: left;
}
@media (min-width: 600px) { .answer-btn { font-size: 1.5rem; padding: 25px; } }
.answer-btn:active { transform: translateY(4px); box-shadow: inset 0 0 rgba(0,0,0,0.2); }
.shape { margin-right: 15px; font-size: 1.5rem; }

.btn-red { background-color: #e21b3c; }
.btn-blue { background-color: #1368ce; }
.btn-yellow { background-color: #d89e00; }
.btn-green { background-color: #26890c; }

/* Rechnen Minigame */
.calc-input { width: 100%; padding: 15px; font-size: 1.5rem; border: 3px solid #ccc; border-radius: 10px; text-align: center; }
.submit-btn { justify-content: center; margin-top: 10px; width: 100%; }

/* --- SKELETON LOADING --- */
.skeleton {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    color: transparent !important;
    border-radius: 8px;
    pointer-events: none;
    box-shadow: none !important;
    border: none !important;
}
.skeleton * { visibility: hidden !important; }
.skeleton-dark { background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%); }

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Modal & Summary */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: flex; justify-content: center; align-items: center; z-index: 1000; padding: 20px; }
.modal.hidden { display: none; }
.modal-content { background: white; padding: 30px 20px; border-radius: 15px; text-align: center; width: 100%; max-width: 500px; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes popIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.shake { animation: shake 0.5s; }
@keyframes shake { 0%, 100% {transform: translateX(0);} 20%, 60% {transform: translateX(-10px);} 40%, 80% {transform: translateX(10px);} }

.summary-list { display: flex; flex-direction: column; gap: 15px; width: 100%; text-align: left; max-height: 60vh; overflow-y: auto; padding-right: 5px; }
.summary-item { background: white; padding: 15px; border-radius: 10px; border-left: 6px solid #ccc; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.summary-correct { border-left-color: #26890c; }
.summary-wrong { border-left-color: #e21b3c; }
.summary-q { font-size: 1rem; margin-bottom: 5px; font-weight: bold; }
.summary-status { font-size: 0.9rem; margin-bottom: 5px; font-weight: bold; }
.summary-correct .summary-status { color: #26890c; }
.summary-wrong .summary-status { color: #e21b3c; }
.summary-expl { font-size: 0.85rem; color: #555; }