﻿:root {
    --primary: #0000cc;
    --slate-800: #1e293b;
    --slate-100: #f1f5f9;
    --gold: #ebaf24;
    --green: #009900;
    --red: #ef4444;
}

body {
    margin: 0;
    font-family: 'Reddit Sans', system-ui, -apple-system, sans-serif;
    background: #fff;
    overflow-x: hidden;
}

/* --- SETUP SCREEN --- */
.setup-screen { max-width: 700px; margin: 0 auto; padding: calc(var(--shell-header-h, 56px) + 30px) 50px 50px; background: var(--slate-100); border-radius: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.05); text-align: center}
.file-input { margin: 20px 0; padding: 25px; border: 2px dashed #cbd5e1; border-radius: 12px; text-align: center; background: white; }

.input-row { display: flex; justify-content: center; gap: 30px; margin: 30px 0; }
.input-row div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.input-row input { width: 70px; padding: 10px; border-radius: 8px; border: 2px solid #ccc; text-align: center; font-size: 1.2rem; font-weight: bold; }

.btn--start { width: 100%; padding: 20px; background: var(--primary); color: white; border: none; border-radius: 15px; font-size: 1.3rem; font-weight: bold; cursor: pointer; }

/* --- QUIZ VIEW --- */
.quiz-setup-title { margin-top: 0; }
.quiz-title { margin: 0; color: var(--slate-800); }
.quiz-task-counter { font-size: 18px; font-weight: bold; color: var(--slate-800); font-family: monospace; }
.btn-ui--menu { min-width: 100px; padding: 10px; }

/* --- COMPACT BATTLE CARDS --- */
.group-card {
    padding: 15px;
    border-radius: 15px;
    color: white;
    position: relative;
    min-height: 160px; /* Reduziert, da nur noch 2 Zeilen */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}

/* Obere Zeile: Gruppe links, Zahl rechts */
.id-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
    font-size: 1.5rem;
    font-weight: bold;
}

.id-badge {
    display: inline-block;
    font-size: 3.5rem;
    font-weight: 900;
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
    min-width: 100px;
    height: 80px;
    line-height: 80px;
    text-align: center;
}

/* Untere Zeile: Minus | Score | Plus */
.score-area {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Verteilt die Elemente: links, mitte, rechts */
    border-top: 1px solid rgba(255,255,255,0.3);
    padding-top: 10px;
}

.score-display {
    font-size: 2.5rem;
    font-weight: 800;
    flex-grow: 1;
    text-align: center;
}

.score-controls { display: contents; } /* Erlaubt die Verteilung via score-area Flexbox */

.btn--score {
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.1rem;
    min-width: 50px; /* Kompakter */
}

.quiz-view { height: 100vh; display: flex; flex-direction: column; padding: 20px; box-sizing: border-box; position: relative; }
.top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

.battle-zone { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin: 0 10% 20px 10%; }
.card-a { background: var(--red); }
.card-b { background: var(--gold); }
.card-c { background: var(--green); }

.btn--plus { background: white; color: #16a34a; padding: 8px 20px; }
.btn--minus { background: rgba(255,255,255,0.2); color: white; padding: 8px 12px; font-size: 0.9rem; }

.back-link {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 20;
    text-decoration: none;
    color: var(--slate-800);
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(148,163,184,0.35);
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 700;
    box-shadow: 0 12px 26px rgba(15,23,42,0.09);
}

.task-area { flex-grow: 1; display: flex; justify-content: center; align-items: center; border: 5px solid var(--slate-100); border-radius: 30px; padding: 40px; text-align: center; background: #fafafa; }
.math-text { font-size: 4.5rem; }
.prep-text { font-size: 3.5rem; color: #94a3b8; font-weight: 300; font-style: italic; }
.sol-text { color: var(--primary); font-weight: 400; }

.control-bar { display: flex; justify-content: center; gap: 15px; margin-top: 20px; }
.btn-ui { padding: 18px 30px; border-radius: 12px; border: none; font-weight: bold; cursor: pointer; font-size: 1.1rem; min-width: 150px; }
.btn-shuffle { background: var(--slate-800); color: white; }
.btn-next { background: var(--primary); color: white; }
.btn-sol { background: #e2e8f0; }

mjx-container[jax="CHTML"][display="true"] {
    margin: 10px 0 0 0 !important;
    font-size: 100% !important;
}

.confetti { position: absolute; border-radius: 2px; top: -20px; pointer-events: none; animation: fall linear forwards; z-index: 10; }
@keyframes fall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(350px) rotate(720deg); opacity: 0; } }
