* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --accent: #3f51b5; --accent-soft: #f5f7ff; }
body.theme-grammar { --accent: #00897b; --accent-soft: #eef7f5; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f0f2f5; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 24px 16px; }
#app { width: 100%; max-width: 640px; }
#header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
#title { font-size: 16px; font-weight: 700; color: #333; }
#mode-toggle { background: #e8eaf0; border: none; border-radius: 20px; padding: 6px 14px; font-size: 13px; cursor: pointer; color: #555; font-weight: 600; }
#header { gap: 8px; }
#mute-btn { background: #e8eaf0; border: none; border-radius: 20px; padding: 6px 12px; font-size: 15px; cursor: pointer; line-height: 1; margin-left: auto; }
#mode-toggle.ru { background: var(--accent); color: white; }
#progress-wrap { margin-bottom: 12px; }
#progress-bar-bg { background: #ddd; border-radius: 4px; height: 5px; }
#progress-bar { background: #4caf50; height: 5px; border-radius: 4px; transition: width 0.3s; }
#progress-row { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: #999; }
#card { background: white; border-radius: 18px; padding: 36px 32px 28px; box-shadow: 0 2px 20px rgba(0,0,0,0.07); margin-bottom: 16px; }
#direction-label, #tag-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #aaa; margin-bottom: 12px; }
#word { font-size: 38px; font-weight: 800; color: #1a1a1a; margin-bottom: 6px; line-height: 1.2; }
#front { font-size: 30px; font-weight: 800; color: #1a1a1a; line-height: 1.3; white-space: pre-wrap; }
#word-hint { font-size: 14px; color: #bbb; margin-bottom: 28px; min-height: 20px; }
#input-area { position: relative; }
#answer-input { width: 100%; padding: 14px 16px; font-size: 18px; border: 2px solid #e0e0e0; border-radius: 12px; outline: none; transition: border-color 0.2s; font-family: inherit; }
#answer-input:focus { border-color: var(--accent); }
#answer-input.correct { border-color: #4caf50; background: #f1fdf3; }
#answer-input.wrong { border-color: #ef5350; background: #fff5f5; }
#answer-input:disabled { opacity: 0.8; }
#submit-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: var(--accent); color: white; border: none; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
#result-area { margin-top: 16px; display: none; }
#result-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; font-size: 14px; font-weight: 700; margin-bottom: 12px; }
#result-badge.correct { background: #e8f5e9; color: #388e3c; }
#result-badge.wrong { background: #ffebee; color: #c62828; }
#correct-answer { font-size: 18px; font-weight: 700; color: #1a1a1a; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
#speak-btn { background: var(--accent-soft); border: none; border-radius: 8px; padding: 3px 9px; font-size: 15px; cursor: pointer; line-height: 1.4; }
#speak-btn:hover { background: #e6e9f5; }
#verb-forms { display: none; font-size: 13px; color: #555; background: #f5f7ff; border-radius: 8px; padding: 7px 11px; margin-bottom: 10px; font-weight: 600; }
#verb-forms.show { display: block; }
#example-sentence { font-size: 14px; color: #777; font-style: italic; line-height: 1.5; margin-bottom: 16px; }
#back { font-size: 17px; color: #333; line-height: 1.6; white-space: pre-wrap; margin-top: 22px; padding-top: 22px; border-top: 2px dashed #eee; display: none; }
#back.show { display: block; }
#reveal-btn { width: 100%; margin-top: 22px; background: var(--accent); color: white; border: none; border-radius: 12px; padding: 15px; font-size: 16px; font-weight: 700; cursor: pointer; }
#override-row, #grade-row { display: flex; gap: 10px; margin-bottom: 4px; }
#grade-row { margin-top: 22px; display: none; }
#grade-row.show { display: flex; }
#override-row button, #grade-row button { flex: 1; padding: 12px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
#btn-ok, #btn-knew { background: #e8f5e9; color: #2e7d32; }
#btn-nok, #btn-forgot { background: #ffebee; color: #c62828; }
#next-hint, #hint { font-size: 12px; color: #bbb; text-align: center; margin-top: 8px; }
#stats-bar { display: flex; gap: 12px; justify-content: center; }
.stat-chip { display: flex; align-items: center; gap: 5px; font-size: 13px; color: #888; background: white; padding: 6px 12px; border-radius: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.green { background: #4caf50; } .dot.red { background: #ef5350; } .dot.blue { background: var(--accent); }
#home-screen { background: white; border-radius: 18px; padding: 40px 32px; box-shadow: 0 2px 20px rgba(0,0,0,0.07); text-align: center; }
#home-screen h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
#home-screen p { color: #888; margin-bottom: 24px; line-height: 1.6; }
.saved-info { background: var(--accent-soft); border-radius: 10px; padding: 16px; margin-bottom: 24px; font-size: 14px; color: #555; line-height: 1.8; text-align: left; }
.home-btn { display: block; width: 100%; padding: 16px; border: none; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; margin-bottom: 12px; text-align: left; }
.home-btn:disabled { opacity: 0.4; cursor: default; }
.home-btn .sub { font-size: 12px; font-weight: 400; opacity: 0.85; display: block; margin-top: 2px; }
#btn-session { background: #00897b; color: white; }
#btn-all { background: var(--accent); color: white; }
#btn-unknown { background: #ef5350; color: white; }
#btn-known { background: #4caf50; color: white; }
#btn-adopt { background: #fff3e0; color: #e65100; }
#btn-reset { background: #f5f5f5; color: #888; font-size: 14px; text-align: center; }
.io-row { display: flex; gap: 10px; }
.io-row .home-btn { background: #f5f5f5; color: #555; font-size: 14px; text-align: center; }
#results-screen { background: white; border-radius: 18px; padding: 40px 32px; box-shadow: 0 2px 20px rgba(0,0,0,0.07); text-align: center; }
#results-screen h2 { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.res-sub { color: #888; margin-bottom: 28px; }
#big-pct { font-size: 72px; font-weight: 900; color: var(--accent); line-height: 1; margin-bottom: 4px; }
.res-stat { font-size: 14px; color: #888; margin-bottom: 28px; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 28px; }
.res-cell { background: var(--accent-soft); border-radius: 12px; padding: 16px 8px; }
.res-cell .val { font-size: 28px; font-weight: 800; }
.res-cell .lbl { font-size: 12px; color: #888; margin-top: 4px; }
.val.green { color: #4caf50; } .val.red { color: #ef5350; } .val.blue { color: var(--accent); }
.res-btn { display: block; width: 100%; padding: 14px; border: none; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; margin-bottom: 10px; }
#res-unknown { background: #ef5350; color: white; }
#res-home { background: #f0f2f5; color: #555; }
#unknown-sec { margin-top: 24px; text-align: left; }
#unknown-sec h3 { font-size: 12px; color: #aaa; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
#unknown-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.utag { background: #fff0f0; color: #c62828; border-radius: 6px; padding: 4px 10px; font-size: 13px; }
.screen { display: none; }
.screen.active { display: block; }
.topbar { width: 100%; max-width: 640px; margin-bottom: 12px; }
.topbar a { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 600; }
