:root {
    --primary: #7c3aed;
    --primary-dark: #5b21b6;
    --accent: #ec4899;
    --correct: #10b981;
    --correct-dark: #059669;
    --wrong: #ef4444;
    --wrong-dark: #dc2626;
    --bg: #f6f4fd;
    --ink: #241c3b;
    --ink-soft: #6b6180;
    --card-line: #e7e1f7;
}

* { box-sizing: border-box; }

html, body {
    background: var(--bg);
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    color: var(--ink);
}

.app-shell {
    max-width: 560px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

/* ---------- header ---------- */
.app-header {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 20;
}
.app-header h1 {
    font-size: 1.05rem;
    font-weight: bold;
    margin: 0;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    user-select: none;
}
.app-header h1:active { opacity: 0.8; }
.header-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    font-size: 0.95rem;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.3); color: #fff; }

#mainArea { flex: 1; padding: 20px 16px 8px; }

/* ---------- start screen ---------- */
.hero-copy { text-align: center; margin-bottom: 18px; }
.lead-sub { font-size: 1.15rem; font-weight: bold; margin-bottom: 6px; }
.lead-sub strong { color: var(--primary); }
.lead-desc { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }

.stat-mini-row {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}
.stat-mini {
    flex: 1;
    background: #fff;
    border: 1px solid var(--card-line);
    border-radius: 14px;
    padding: 10px 6px;
    text-align: center;
}
.stat-mini-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}
.stat-mini-value small { font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.stat-mini-label { font-size: 0.68rem; color: var(--ink-soft); }

.option-card {
    background: #fff;
    border: 1px solid var(--card-line);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 20px;
}
.option-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--ink);
}
.option-card .option-title:not(:first-child) { margin-top: 18px; }

.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    flex: 1;
    min-width: 70px;
    padding: 10px 8px;
    border-radius: 999px;
    border: 1.5px solid var(--card-line);
    background: #fff;
    color: var(--ink-soft);
    font-weight: 700;
    font-size: 0.88rem;
    transition: all .15s;
}
.chip.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    color: #fff;
}

/* モード選択と各オプション */
.mode-group .chip { font-size: 0.84rem; }
.mode-desc {
    font-size: 0.74rem;
    color: var(--ink-soft);
    margin: 8px 2px 0;
    line-height: 1.5;
    min-height: 1.1em;
}
.opt-block { margin-top: 18px; }

.opt-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--card-line);
}
.opt-toggle-label { font-size: 0.86rem; font-weight: 700; color: var(--ink); display: flex; flex-direction: column; }
.opt-toggle-sub { font-size: 0.7rem; font-weight: 500; color: var(--ink-soft); margin-top: 3px; }

.switch { position: relative; display: inline-block; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #d7cfee;
    border-radius: 999px;
    transition: .2s;
}
.switch-slider::before {
    content: '';
    position: absolute;
    height: 22px; width: 22px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .switch-slider { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:disabled + .switch-slider { cursor: not-allowed; opacity: 0.5; }

/* 準備中（非活性）オプション */
.opt-disabled { opacity: 0.6; }
.opt-disabled .switch-slider { cursor: not-allowed; }
.soon-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    color: #b45309;
    background: #fff3d6;
    border-radius: 999px;
    padding: 1px 7px;
    margin-left: 4px;
    vertical-align: middle;
}

.btn-start {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.28);
}
.btn-start:active { transform: scale(0.98); }

.storage-note {
    font-size: 0.72rem;
    color: var(--ink-soft);
    text-align: center;
    margin: 14px 4px 0;
    line-height: 1.5;
}

/* ---------- quiz screen ---------- */
.quiz-topbar { margin-bottom: 16px; }
.quiz-progress { height: 8px; border-radius: 999px; background: #e7e1f7; }
.quiz-progress .progress-bar {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    transition: width .3s ease;
}
.quiz-topbar-nums {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--ink-soft);
    font-weight: 700;
}
.score-badge { color: var(--primary); }
.combo-badge {
    background: #fff1e0;
    color: #c2410c;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
}

.word-card {
    position: relative;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.12);
    padding: 22px 20px 26px;
    text-align: center;
    margin-bottom: 16px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.score-popup {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 900;
    color: var(--correct-dark);
    pointer-events: none;
    animation: scorePopupFloat .9s ease forwards;
    z-index: 5;
}
@keyframes scorePopupFloat {
    0% { opacity: 0; transform: translate(-50%, -30%) scale(0.8); }
    25% { opacity: 1; transform: translate(-50%, -55%) scale(1.1); }
    75% { opacity: 1; transform: translate(-50%, -70%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -85%) scale(1); }
}
.word-card.flash-correct { animation: flashCorrect .5s ease; }
.word-card.flash-wrong { animation: flashWrong .5s ease; }
@keyframes flashCorrect {
    0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    50% { box-shadow: 0 0 0 10px rgba(16,185,129,0.15); }
    100% { box-shadow: 0 6px 24px rgba(124, 58, 237, 0.12); }
}
@keyframes flashWrong {
    0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
    50% { box-shadow: 0 0 0 10px rgba(239,68,68,0.15); }
    100% { box-shadow: 0 6px 24px rgba(124, 58, 237, 0.12); }
}

.word-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pos-badge {
    background: #f0ebfc;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    min-height: 22px;
}
.speak-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--card-line);
    background: #fff;
    color: var(--primary);
}
.speak-btn:active { background: #f0ebfc; }

.word-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--ink);
    padding: 18px 4px;
    word-break: break-word;
}

.btn-reveal {
    align-self: center;
    padding: 12px 28px;
    border: none;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
}

/* ---------- 穴埋め（cloze） ---------- */
.cloze-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 6px 2px;
    text-align: left;
}
.cloze-ja {
    font-size: 0.95rem;
    color: var(--ink);
    font-weight: 600;
    line-height: 1.6;
}
.cloze-en {
    font-size: 1.15rem;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.7;
    letter-spacing: .01em;
}
.cloze-blank {
    color: var(--accent);
    font-weight: 800;
    letter-spacing: .08em;
    white-space: nowrap;
}
.cloze-answer {
    color: var(--primary);
    font-weight: 800;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 1px;
}
.cloze-hint {
    font-size: 0.82rem;
    color: var(--primary);
    background: #f4f1fc;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 700;
}

/* ---------- 選択クイズ ---------- */
.choice-area { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.choice-btn {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--card-line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    font-weight: 700;
    font-size: 0.95rem;
    text-align: left;
    transition: all .12s;
}
.choice-btn:active { transform: scale(0.99); }
.choice-btn:not(:disabled):hover { border-color: var(--primary); background: #faf8ff; }
.choice-btn:disabled { opacity: 1; }
.choice-btn.choice-correct {
    border-color: var(--correct);
    background: #e9fbf4;
    color: var(--correct-dark);
}
.choice-btn.choice-wrong {
    border-color: var(--wrong);
    background: #fdeceb;
    color: var(--wrong-dark);
}

/* ---------- 連想画像 ---------- */
.word-image-wrap {
    position: relative;
    margin-bottom: 14px;
    border-radius: 12px;
    overflow: hidden;
    background: #f0ebfc;
    text-align: center;
}
.word-image-wrap img {
    display: block;
    width: 100%;
    max-height: 190px;
    object-fit: cover;
}
.word-image-credit {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 7px;
    border-radius: 999px;
}

/* ---------- これまでの正答率 ---------- */
.word-accuracy {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink-soft);
    background: #f4f1fc;
    border-radius: 10px;
    padding: 7px 10px;
    margin-bottom: 12px;
}
.word-accuracy strong { color: var(--primary); font-size: 0.95rem; }
.word-accuracy .wa-sub { color: var(--ink-3, #8b8b8b); font-weight: 500; margin-left: 2px; }

.meaning-block { text-align: left; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.meaning-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    margin-bottom: 14px;
}
.example-block {
    background: #f8f6fe;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.example-en { font-size: 0.92rem; color: var(--ink); margin-bottom: 4px; }
.example-ja { font-size: 0.82rem; color: var(--ink-soft); }

.btn-hint {
    display: block;
    width: 100%;
    padding: 11px;
    border: 1.5px dashed var(--primary);
    border-radius: 12px;
    background: #fff;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 10px;
}
.btn-hint:disabled { opacity: 0.6; }

.hint-area {
    background: linear-gradient(135deg, #fdf4ff, #fbe8ff);
    border: 1px solid #f0d6fb;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #6b1d8a;
    white-space: pre-wrap;
}
.hint-area .hint-loading { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.hint-area .hint-error { color: var(--wrong-dark); }
.spinner-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
    display: inline-block; animation: dotPulse 1s infinite ease-in-out;
}
@keyframes dotPulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.answer-buttons { display: flex; gap: 10px; margin-top: auto; }
.btn-answer {
    flex: 1;
    padding: 14px 8px;
    border-radius: 14px;
    border: none;
    font-weight: 800;
    font-size: 0.95rem;
    color: #fff;
}
.btn-wrong { background: linear-gradient(135deg, var(--wrong), var(--wrong-dark)); }
.btn-correct { background: linear-gradient(135deg, var(--correct), var(--correct-dark)); }
.btn-answer:disabled { opacity: 0.5; }

.btn-next {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 16px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
}

/* ---------- リスニング（聞き流し） ---------- */
.listen-head { text-align: center; margin-bottom: 16px; }
.listen-title { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.listen-sub { font-size: 0.76rem; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }

.listen-prep { text-align: center; color: var(--ink-soft); font-weight: 700; padding: 40px 0; font-size: 0.9rem; }
.listen-error {
    background: #fef2f2; color: var(--wrong-dark);
    border-radius: 12px; padding: 14px; font-size: 0.85rem; line-height: 1.6; margin-top: 10px;
}

.listen-player {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.12);
    padding: 24px 18px 18px;
}
.listen-now { text-align: center; min-height: 84px; display: flex; flex-direction: column; justify-content: center; }
.listen-now-word { font-size: 2rem; font-weight: 800; color: var(--ink); word-break: break-word; }
.listen-now-meaning { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin-top: 6px; }

.listen-progress { height: 6px; border-radius: 999px; background: #e7e1f7; margin: 18px 0 6px; overflow: hidden; }
.listen-bar { height: 100%; width: 0; background: linear-gradient(135deg, var(--primary), var(--accent)); transition: width .25s linear; }
.listen-time { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--ink-soft); font-weight: 700; }

.listen-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 6px; }
.listen-ctrl {
    width: 46px; height: 46px; border-radius: 50%;
    border: 1.5px solid var(--card-line); background: #fff; color: var(--ink-soft); font-size: 1rem;
}
.listen-ctrl.is-on { border-color: transparent; background: #f0ebfc; color: var(--primary); }
.listen-ctrl:active { transform: scale(0.94); }
.listen-play {
    width: 66px; height: 66px; border-radius: 50%; border: none;
    background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}
.listen-play:active { transform: scale(0.96); }

.listen-list { margin-top: 16px; max-height: 42vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.listen-item {
    display: flex; align-items: baseline; gap: 10px; text-align: left;
    padding: 9px 12px; border-radius: 10px; border: none; background: transparent; width: 100%;
}
.listen-item .li-word { font-weight: 800; font-size: 0.95rem; color: var(--ink); }
.listen-item .li-meaning { font-size: 0.8rem; color: var(--ink-soft); }
.listen-item.active { background: #f4f1fc; }
.listen-item.active .li-word { color: var(--primary); }

/* ---------- result screen ---------- */
.result-card {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.12);
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 20px;
}
.result-rank {
    width: 84px;
    height: 84px;
    line-height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 2.4rem;
    font-weight: 900;
    margin: 0 auto 12px;
}
.result-new-best {
    display: inline-block;
    background: #fff7e0;
    color: #b45309;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.result-score { font-size: 2.6rem; font-weight: 900; color: var(--ink); }
.result-score-unit { font-size: 1.1rem; font-weight: 700; color: var(--ink-soft); margin-left: 4px; }
.result-stats-row {
    display: flex;
    margin-top: 20px;
    border-top: 1px solid var(--card-line);
    padding-top: 18px;
}
.result-stat { flex: 1; }
.result-stat-value { display: block; font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.result-stat-label { font-size: 0.72rem; color: var(--ink-soft); }

.btn-secondary-wide {
    display: block;
    width: 100%;
    padding: 13px;
    margin-top: 10px;
    border: 1.5px solid var(--card-line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink-soft);
    font-weight: 700;
}

/* ---------- footer ---------- */
.app-footer {
    text-align: center;
    font-size: 0.72rem;
    color: var(--ink-soft);
    padding: 22px 16px 28px;
}
.app-footer a { color: var(--primary); text-decoration: none; }

/* ---------- ヘッダのスペーサー（タイトル中央寄せ用） ---------- */
.header-spacer { background: transparent !important; pointer-events: none; }

/* ---------- メニュー（左ドロワー） ---------- */
.menu-overlay {
    position: fixed; inset: 0; background: rgba(36, 28, 59, 0.5);
    z-index: 60; display: flex; justify-content: flex-start;
}
.menu-drawer {
    width: 80%; max-width: 320px; background: #fff; height: 100%;
    display: flex; flex-direction: column; padding: 8px 0;
    box-shadow: 4px 0 24px rgba(0,0,0,.15); animation: drawerIn .2s ease;
}
@keyframes drawerIn { from { transform: translateX(-30px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.menu-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--card-line);
    font-weight: 800; color: var(--primary);
}
.menu-drawer-head .header-icon-btn { background: #f0ebfc; color: var(--ink); }
.menu-item {
    display: flex; align-items: center; gap: 14px; width: 100%;
    padding: 16px 20px; border: none; background: #fff; text-align: left;
    font-size: 0.98rem; font-weight: 700; color: var(--ink); text-decoration: none;
    border-bottom: 1px solid #f2eff9;
}
.menu-item:active { background: #f7f5fd; }
.menu-ico { width: 22px; text-align: center; color: var(--primary); }

/* ---------- 設定 ---------- */
.set-row { margin-bottom: 20px; }
.set-label {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.88rem; font-weight: 700; color: var(--ink); margin-bottom: 8px;
}
.set-val { color: var(--primary); font-weight: 800; }
.set-range {
    width: 100%; -webkit-appearance: none; appearance: none;
    height: 6px; border-radius: 999px; background: #e7e1f7; outline: none;
}
.set-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent)); cursor: pointer; box-shadow: 0 2px 6px rgba(124,58,237,.35);
}
.set-range::-moz-range-thumb {
    width: 22px; height: 22px; border: none; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent)); cursor: pointer;
}
.set-scale { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--ink-soft); margin-top: 4px; }
.set-sub { font-size: 0.7rem; color: var(--ink-soft); margin: 4px 0 0; line-height: 1.5; }

.ja-voice-row { display: flex; gap: 10px; align-items: stretch; }
.set-select {
    flex: 1; min-width: 0; padding: 11px 12px; border: 1.5px solid var(--card-line); border-radius: 12px;
    background: #fff; color: var(--ink); font-size: 0.9rem; font-weight: 700; appearance: auto;
}
.set-sample-btn {
    flex-shrink: 0; width: 46px; border: none; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
}
.set-sample-btn:disabled { opacity: 0.7; }
.set-sample-btn:active { transform: scale(0.96); }
.set-note { font-size: 0.74rem; color: var(--ink-soft); line-height: 1.6; margin-top: 8px; }

/* ---------- このアプリについて ---------- */
.about-body { font-size: 0.88rem; line-height: 1.7; color: var(--ink); }
.about-lead { text-align: center; margin-bottom: 18px; }
.about-appname { font-size: 1.15rem; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.about-lead p { font-size: 0.82rem; color: var(--ink-soft); margin: 0; text-align: left; }
.about-h {
    font-size: 0.9rem; font-weight: 800; color: var(--ink);
    margin: 20px 0 8px; padding-left: 10px; border-left: 3px solid var(--primary);
}
.about-p { margin: 0 0 6px; font-size: 0.84rem; }
.about-p a, .about-lead a { color: var(--primary); font-weight: 700; text-decoration: none; }
.about-credit { margin: 4px 0 6px; padding-left: 4px; list-style: none; }
.about-credit li {
    font-size: 0.84rem; font-weight: 700; padding: 4px 0 4px 22px; position: relative;
}
.about-credit li::before {
    content: '\f0a1'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; left: 0; color: var(--accent); font-size: 0.72rem; top: 6px;
}
.about-note { font-size: 0.76rem; color: var(--ink-soft); margin: 6px 0 0; }
.about-foot { text-align: center; font-size: 0.74rem; color: var(--ink-soft); margin-top: 22px; }

.vv-credit-list { margin: 10px 0; display: flex; flex-direction: column; }
.vv-credit-line {
    font-size: 0.9rem; font-weight: 700; color: var(--ink);
    padding: 7px 12px; border-bottom: 1px solid #f2eff9;
}
.vv-credit-line:nth-child(odd) { background: #faf8fe; }

/* ---------- history modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(36, 28, 59, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 50;
}
.modal-box {
    background: var(--bg);
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    border-radius: 22px 22px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--card-line);
    flex-shrink: 0;
}
.modal-header-row h2 { font-size: 1.05rem; font-weight: 800; margin: 0; }
.modal-header-row .header-icon-btn { background: #f0ebfc; color: var(--ink); }
.modal-body { padding: 16px 18px 26px; overflow-y: auto; }

.modal-subtitle { font-size: 0.9rem; font-weight: 800; margin: 20px 0 10px; }

.mastered-block { margin-bottom: 4px; }
.mastered-label { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.mastered-progress { height: 10px; border-radius: 999px; background: #e7e1f7; }
.mastered-progress .progress-bar { background: linear-gradient(135deg, var(--correct), var(--correct-dark)); }

.weak-list, .session-list { display: flex; flex-direction: column; gap: 8px; }
.weak-item, .session-item {
    background: #fff;
    border: 1px solid var(--card-line);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}
.weak-item .w-word { font-weight: 800; }
.weak-item .w-meaning { color: var(--ink-soft); font-size: 0.78rem; }
.weak-item .w-rate { color: var(--wrong-dark); font-weight: 800; font-size: 0.8rem; }
.session-item .s-date { color: var(--ink-soft); font-size: 0.78rem; }
.session-item .s-score { font-weight: 800; color: var(--primary); }
.empty-note { color: var(--ink-soft); font-size: 0.82rem; text-align: center; padding: 14px 0; }

.btn-reset {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 22px;
    border: none;
    border-radius: 14px;
    background: #fef2f2;
    color: var(--wrong-dark);
    font-weight: 700;
    font-size: 0.88rem;
}

.screen { animation: fadeIn .2s ease; }
