/* KataPult — mobile-first Vokabeltrainer. Blaue Palette (Lieblingsfarbe). */
:root {
    --bg: #0c1626;
    --bg-soft: #122036;
    --card: #16243c;
    --card-hi: #1e3252;
    --line: #2c456e;
    --text: #eaf2ff;
    --text-dim: #9fb4d4;
    --accent: #4aa3ff;      /* helles Blau */
    --accent-2: #2f6bf0;    /* tieferes Blau */
    --good: #35c389;
    --bad: #ef5d6e;
    --on-accent: #06182e;   /* dunkler Text auf hellem Blau */
    --radius: 16px;
    --tap: 56px;            /* Mindest-Touchgröße */
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }

/* App-Shell: schmale, zentrierte Spalte fürs Handy */
.app-shell {
    max-width: 560px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 1rem 1.1rem .8rem;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, var(--bg) 70%, transparent);
    z-index: 10;
}
.app-header .logo {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.5px;
    color: var(--accent);
}
.app-header .logo:hover { text-decoration: none; }
.app-header .logo .pult { color: var(--accent-2); }
.logo-img { height: 34px; width: auto; display: block; }
.app-header .spacer { flex: 1; }
.app-header a { color: var(--text-dim); font-size: 1.05rem; }
.logout-form { display: inline; margin: 0; }
.link-btn {
    background: none; border: none; color: var(--text-dim);
    cursor: pointer; font-size: .9rem; min-height: auto; padding: .2rem .4rem;
}
.link-btn:hover { color: var(--accent); }

main { flex: 1; padding: 0 1.1rem 2rem; }

.lang-flow { font-size: .8rem; letter-spacing: 1px; color: var(--accent); font-weight: 700; }

/* Login */
.login-hero { text-align: center; padding: 1.6rem 0 1rem; }
.login-logo-img { width: 120px; height: 120px; object-fit: contain; display: block; margin: 0 auto .3rem; }
.login-logo { font-size: 2.2rem; font-weight: 800; letter-spacing: -.5px; color: var(--accent); }
.login-logo .pult { color: var(--accent-2); }

/* Karten / Listenelemente */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin-bottom: .9rem;
}

.list-row {
    display: flex;
    align-items: center;
    gap: .8rem;
    width: 100%;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    margin-bottom: .7rem;
    min-height: var(--tap);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.list-row:hover { background: var(--card-hi); text-decoration: none; }
.list-row .title { font-weight: 700; font-size: 1.05rem; }
.list-row .sub { color: var(--text-dim); font-size: .85rem; }
.list-row .grow { flex: 1; }
.badge {
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 800;
    font-size: .8rem;
    border-radius: 999px;
    padding: .15rem .6rem;
    min-width: 1.8rem;
    text-align: center;
}
.badge.muted { background: var(--line); color: var(--text-dim); }

/* Buttons — große Touch-Flächen */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: var(--tap);
    padding: .8rem 1.1rem;
    border: none;
    border-radius: var(--radius);
    background: var(--card-hi);
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    border: 1px solid var(--line);
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: none; }
.btn-good { background: var(--good); color: #06210f; border: none; }
.btn-bad { background: var(--bad); color: #2a0c06; border: none; }
.btn-ghost { background: transparent; }
.btn.sm { min-height: 42px; width: auto; padding: .45rem .8rem; font-size: .9rem; }
.btn-row { display: flex; gap: .7rem; }
.btn-row .btn { flex: 1; }

/* Formulare */
label { display: block; font-size: .85rem; color: var(--text-dim); margin: .6rem 0 .25rem; }
input[type=text], input[type=password], textarea, select {
    width: 100%;
    min-height: var(--tap);
    padding: .7rem .9rem;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
}
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, monospace; font-size: .9rem; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.field-row { display: flex; gap: .7rem; }
.field-row > div { flex: 1; }

/* Quiz */
.quiz-prompt {
    text-align: center;
    padding: 1.6rem 1rem;
    margin: .5rem 0 1.2rem;
}
.quiz-prompt .lang-tag { color: var(--text-dim); font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; }
.quiz-prompt .word { font-size: 2.1rem; font-weight: 800; margin: .3rem 0; color: var(--accent); }
.quiz-prompt .ask { color: var(--text-dim); }

.choice {
    width: 100%;
    text-align: left;
    margin-bottom: .7rem;
    min-height: var(--tap);
    font-size: 1.05rem;
}
.choice.correct { background: var(--good); color: #06210f; border: none; }
.choice.wrong { background: var(--bad); color: #2a0c06; border: none; }

.speak-btn {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 40px; height: 40px;
    min-height: 40px;
    font-size: 1.05rem;
    cursor: pointer;
    color: var(--accent);
    flex: none;
}
.speak-btn:hover { background: var(--card-hi); }

.progress-bar { height: 8px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; margin-bottom: 1rem; }
.progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.feedback { text-align: center; font-weight: 700; padding: .6rem; border-radius: 12px; margin: .4rem 0; }
.feedback.ok { color: var(--good); }
.feedback.no { color: var(--bad); }

/* Reveal — alle drei Sprachen nach der Antwort */
.reveal { text-align: left; }
.reveal-line {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--line);
}
.reveal-line:last-child { border-bottom: none; }
.lang-code {
    font-size: .7rem; font-weight: 800;
    background: var(--bg-soft); border: 1px solid var(--line);
    border-radius: 6px; padding: .15rem .45rem;
    color: var(--text-dim); min-width: 2.1rem; text-align: center;
}
.reveal-word { font-weight: 700; flex: 1; }
.reveal-line.is-answer .reveal-word { color: var(--accent); }
.reveal-line.is-bonus .reveal-word { color: var(--good); }
.bonus-tag {
    font-size: .62rem; background: var(--good); color: #06210f;
    border-radius: 99px; padding: .1rem .45rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .5px;
}
.speak-group { display: flex; gap: .35rem; }

/* Buchstaben-Modus (Spell) */
.spell-build {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap;
    min-height: 62px; padding: .5rem 1rem; margin-bottom: 1rem;
    font-size: 1.7rem; font-weight: 800; letter-spacing: 4px; color: var(--accent);
    background: var(--bg-soft); border: 1px dashed var(--line); border-radius: 12px;
}
.spell-placeholder { color: var(--text-dim); font-size: 1rem; font-weight: 400; letter-spacing: normal; }
.letter-tiles { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 1rem; }
.tile {
    min-width: 48px; height: 54px; padding: 0 .6rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
    border: none; border-radius: 10px; font-size: 1.35rem; font-weight: 800; cursor: pointer;
}
.tile.used { opacity: .22; pointer-events: none; }
.tile:active { transform: translateY(1px); }

/* Lückentext (Cloze) */
.cloze { font-size: 1.3rem; line-height: 1.7; font-weight: 600; }
.cloze .blank {
    display: inline-block; min-width: 70px; text-align: center;
    border-bottom: 3px solid var(--accent); color: var(--accent); font-weight: 800;
    padding: 0 .3rem;
}

/* Admin: Beispielsätze */
.badge.ok { background: var(--good); color: #06210f; }
.sentence-panel { border-top: 1px solid var(--line); margin-top: .7rem; padding-top: .6rem; }
.sentence-row {
    display: flex; align-items: center; gap: .4rem;
    padding: .4rem 0; border-bottom: 1px solid var(--line);
}
.sentence-row:last-of-type { border-bottom: none; }
.sentence-row .grow { flex: 1; font-size: .92rem; }

/* Gamification-Banner */
.stats-banner {
    display: flex; align-items: center; gap: 1rem;
    background: linear-gradient(135deg, var(--card), var(--card-hi));
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: .8rem 1rem; margin-bottom: 1rem;
}
.stat-level { flex: 1; min-width: 0; }
.lvl-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; }
.lvl { font-weight: 800; color: var(--accent); }
.xp-text { font-size: .75rem; color: var(--text-dim); }
.xp-bar { height: 8px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.xp-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.stat-pills { display: flex; flex-direction: column; gap: .4rem; }
.pill {
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: 99px;
    padding: .25rem .7rem; font-size: .82rem; font-weight: 800; white-space: nowrap; text-align: center;
}
.pill.done { background: var(--good); color: #06210f; border: none; }

/* Tricky-words Karte hebt sich leicht ab */
.list-row.tricky { background: linear-gradient(135deg, #2a2440, var(--card)); border-color: #5a4a8a; }

/* Diktat-Hörbuttons groß */
.dictation-row { display: flex; justify-content: center; gap: .9rem; margin: .8rem 0; }
.dictation-row .speak-btn { width: 66px; height: 66px; min-height: 66px; font-size: 1.7rem; }

.muted { color: var(--text-dim); }
.center { text-align: center; }
.notice { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; }
.notice.error { border-color: var(--bad); color: #ffc9cf; }
.notice.ok { border-color: var(--good); color: #c2f0d2; }
.small { font-size: .85rem; }
.row-actions { display: flex; gap: .5rem; }
.box-pill { font-size: .75rem; color: var(--text-dim); }

hr { border: none; border-top: 1px solid var(--line); margin: 1.2rem 0; }
