:root {
    --bg: #0f1115;
    --bg-soft: #161a22;
    --card: #1c212b;
    --card-2: #232a37;
    --border: #2c3444;
    --text: #e8eaf0;
    --muted: #98a1b3;
    --accent: #e0405e;      /* Japan-Rot */
    --accent-2: #ff5b76;
    --ok: #35c88a;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background:
        radial-gradient(1200px 600px at 50% -10%, #1b2130 0%, var(--bg) 55%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    line-height: 1.5;
}

.app {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 18px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-jp {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text);
}
.brand-de { font-size: 13px; color: var(--muted); letter-spacing: .5px; }

.link {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: .15s;
}
.link:hover { color: var(--text); border-color: var(--border); background: var(--bg-soft); }

/* Screens */
.screen { display: none; flex: 1; }
.screen.active { display: flex; flex-direction: column; }

/* Cards */
.card {
    background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 34px 30px;
}
.card.center { text-align: center; }
.card h1 { margin: 6px 0 8px; font-size: 26px; }
.card h2 { margin: 0 0 10px; font-size: 22px; }

.count-badge {
    display: inline-block;
    font-size: 13px;
    color: var(--accent-2);
    background: rgba(224,64,94,.12);
    border: 1px solid rgba(224,64,94,.3);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}

/* Buttons */
.btn {
    appearance: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    color: var(--text);
    background: var(--card-2);
    border: 1px solid var(--border);
    padding: 12px 22px;
    border-radius: 12px;
    transition: transform .08s ease, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: #2a3140; border-color: #3a4256; }
.btn:active { transform: translateY(1px); }
.btn.primary {
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 20px rgba(224,64,94,.35);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.big { font-size: 17px; padding: 15px 30px; width: 100%; max-width: 320px; }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--bg-soft); }

.btn-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 18px 0 8px;
}
.card.center .btn.big { margin: 18px auto 0; }

/* Quiz */
.quiz-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.progress { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

.progress-bar {
    height: 6px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 18px;
}
#progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .25s ease;
}

.quiz-card { text-align: center; padding: 40px 26px; }
.label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--muted);
    margin-bottom: 8px;
}
.prompt { margin-bottom: 4px; }
.ans { margin-bottom: 0; }
/* Große Hiragana-Darstellung (als Frage oder Antwort) */
.jp-big {
    font-size: 52px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 3px;
    line-height: 1.2;
}
/* Deutsche Darstellung (als Frage oder Antwort) */
.de-big {
    font-size: 34px;
    font-weight: 700;
}
.q-de {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 4px;
}
.divider {
    height: 1px;
    background: var(--border);
    margin: 26px auto;
    max-width: 220px;
}
.a-jp {
    font-size: 52px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 3px;
    line-height: 1.2;
}
.a-reading {
    font-size: 22px;
    color: var(--accent-2);
    margin-top: 6px;
    letter-spacing: 1px;
}

.quiz-actions {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

/* Ende */
.done-icon {
    width: 68px; height: 68px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(53,200,138,.15);
    border: 2px solid var(--ok);
    color: var(--ok);
    font-size: 34px;
    display: flex; align-items: center; justify-content: center;
}

/* Empty */
.empty { text-align: center; }
.empty .btn { margin-top: 16px; text-decoration: none; display: inline-block; }

/* Utils */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.footer {
    margin-top: auto;
    padding-top: 26px;
    text-align: center;
}

/* Import-Seite */
.form-card textarea {
    width: 100%;
    min-height: 260px;
    resize: vertical;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
}
.form-card textarea:focus { outline: none; border-color: var(--accent); }
.radio-row { display: flex; gap: 20px; margin: 16px 0; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); }
.radio-row input { accent-color: var(--accent); }
.notice {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
}
.notice.ok { background: rgba(53,200,138,.12); border: 1px solid rgba(53,200,138,.35); color: #9be9c6; }
.vocab-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 14px;
}
.vocab-table th, .vocab-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}
.vocab-table th { color: var(--muted); font-weight: 600; }
.vocab-table td.jp { font-size: 18px; }
.vocab-table td.rd { color: var(--accent-2); }

@media (max-width: 480px) {
    .a-jp, .jp-big { font-size: 42px; }
    .q-de, .de-big { font-size: 28px; }
    .card { padding: 26px 20px; }
}
