:root {
  color-scheme: dark;
  --bg: #11131c;
  --panel: #1a1d29;
  --panel-raised: #202432;
  --line: rgba(255, 255, 255, .075);
  --text: #f5f4f8;
  --muted: #9a9daf;
  --green: #cbf27a;
  --green-ink: #1b2612;
  --violet: #c6adff;
  --blue: #a7cbff;
  --red: #ff9a9a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(ellipse at 82% -10%, rgba(116, 87, 190, .14), transparent 34rem), var(--bg); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.app-shell { width: min(100% - 32px, 760px); min-height: 100vh; margin: 0 auto; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
.topbar { height: 74px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark, .profile-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; color: var(--green-ink); background: var(--green); font-size: 15px; font-weight: 900; letter-spacing: -.08em; }
.brand strong { display: block; font-size: 15px; letter-spacing: -.04em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.icon-button { border: 1px solid var(--line); border-radius: 13px; width: 40px; height: 40px; background: var(--panel); font-size: 19px; cursor: pointer; }
.offline-banner { display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin: 2px 0 22px; border: 1px solid rgba(203, 242, 122, .16); border-radius: 12px; color: #d3efaa; background: rgba(203, 242, 122, .06); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(203, 242, 122, .7); }
.notice { position: sticky; z-index: 4; top: 8px; padding: 11px 14px; margin: 10px 0; border: 1px solid rgba(255, 154, 154, .35); border-radius: 12px; color: #ffd2d2; background: #351f28; font-size: 13px; }
.screen { display: none; animation: appear .2s ease-out; }
.screen.active { display: block; }
.screen[hidden], [hidden] { display: none !important; }
@keyframes appear { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 2px 23px; }
.eyebrow { margin: 0 0 8px; color: #9296aa; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 6vw, 36px); letter-spacing: -.065em; line-height: 1.08; }
h2 { margin-bottom: 0; font-size: 18px; letter-spacing: -.04em; }
.accent { color: var(--green); }
.muted { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.streak-pill { display: grid; grid-template-columns: 19px auto; align-items: center; min-width: 76px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.035); }
.streak-pill span { grid-row: span 2; color: #ffc966; font-size: 15px; }
.streak-pill strong { font-size: 17px; line-height: 1; }
.streak-pill small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.daily-card { padding: 18px 18px 16px; border: 1px solid rgba(203, 242, 122, .2); border-radius: 20px; background: linear-gradient(130deg, rgba(203,242,122,.12), rgba(91,103,54,.08) 67%, rgba(255,255,255,.025)); }
.daily-top, .daily-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.daily-top .eyebrow { margin-bottom: 5px; }
.daily-top h2 { font-size: 20px; }
.daily-badge { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 14px; color: var(--green); background: rgba(203,242,122,.12); font-size: 20px; }
.progress-track { height: 7px; margin: 18px 0 10px; overflow: hidden; border-radius: 8px; background: rgba(255,255,255,.1); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .3s ease; }
.daily-bottom { color: #a9acb9; font-size: 10px; }
.daily-bottom strong { color: var(--green); font-size: 11px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 29px 2px 13px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading h2 { font-size: 17px; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode-card { position: relative; display: flex; flex-direction: column; min-height: 145px; padding: 15px; border: 1px solid transparent; border-radius: 18px; text-align: left; cursor: pointer; transition: transform .18s, filter .18s; }
.mode-card:active, .practice-mode:active { transform: scale(.985); }
.mode-primary { color: #202818; background: linear-gradient(140deg, #d8f59b, #b9e36a); }
.mode-violet { color: #f0e9ff; border-color: rgba(198,173,255,.13); background: linear-gradient(140deg, #332c46, #242231); }
.mode-blue { color: #e7f2ff; border-color: rgba(167,203,255,.13); background: linear-gradient(140deg, #28374a, #202633); }
.mode-dark { color: #f2e7db; border-color: var(--line); background: linear-gradient(140deg, #373027, #24232a); }
.mode-icon { display: grid; place-items: center; width: 29px; height: 29px; margin-bottom: 14px; border-radius: 10px; background: rgba(0,0,0,.1); font-size: 16px; font-weight: 700; }
.mode-title { max-width: 92%; font-size: 14px; font-weight: 800; letter-spacing: -.035em; }
.mode-subtitle { max-width: 88%; margin-top: 5px; opacity: .68; font-size: 10px; line-height: 1.45; }
.mode-arrow { position: absolute; top: 15px; right: 15px; opacity: .68; font-size: 15px; }
.compact-heading { margin-top: 27px; }
.text-button { padding: 7px 0 3px 8px; border: 0; color: var(--green); background: transparent; font-size: 11px; cursor: pointer; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.stat-card { display: flex; flex-direction: column; min-height: 91px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.stat-symbol { display: grid; place-items: center; width: 23px; height: 23px; margin-bottom: 9px; border-radius: 8px; font-size: 13px; }
.symbol-green { color: var(--green); background: rgba(203,242,122,.1); }
.symbol-purple { color: var(--violet); background: rgba(198,173,255,.1); }
.symbol-yellow { color: #ffd282; background: rgba(255,210,130,.1); }
.stat-card strong { font-size: 18px; letter-spacing: -.04em; }
.stat-card > span:last-child { margin-top: 3px; color: var(--muted); font-size: 9px; }
.word-of-day { display: flex; align-items: center; justify-content: space-between; margin-top: 17px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(130deg, rgba(255,255,255,.035), transparent); }
.word-of-day .eyebrow { margin-bottom: 7px; }
.word-of-day h2 { margin-bottom: 4px; color: var(--green); font-size: 21px; }
.word-star { color: #d0bdff; font-size: 25px; }
.page-heading { padding: 23px 2px 18px; }
.page-heading .eyebrow { margin-bottom: 9px; }
.search-box { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); color: var(--muted); }
.search-box > span { font-size: 23px; line-height: 1; }
.search-box input { flex: 1; width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #777b8d; }
.search-box kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; color: #777b8d; font-size: 10px; }
.filter-row { display: flex; gap: 7px; padding: 14px 0 5px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--panel); font-size: 10px; cursor: pointer; }
.filter-chip.active { border-color: rgba(203,242,122,.35); color: var(--green); background: rgba(203,242,122,.08); }
.result-count { padding: 11px 2px 8px; color: #85899c; font-size: 10px; }
.word-list { display: grid; gap: 7px; }
.word-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 63px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.word-row-main { min-width: 0; }
.word-row strong { display: block; overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.word-row small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.word-tag { flex: 0 0 auto; padding: 5px 7px; border: 1px solid rgba(203,242,122,.12); border-radius: 7px; color: #c4d6a5; background: rgba(203,242,122,.045); font-size: 8px; }
.empty-state { padding: 25px 14px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); text-align: center; font-size: 12px; }
.practice-intro { padding: 17px; margin: 3px 0 12px; border: 1px solid rgba(198,173,255,.16); border-radius: 18px; background: linear-gradient(125deg, rgba(198,173,255,.09), rgba(255,255,255,.02)); }
.intro-icon { display: grid; place-items: center; width: 31px; height: 31px; margin-bottom: 12px; border-radius: 10px; color: var(--violet); background: rgba(198,173,255,.12); font-size: 16px; }
.practice-intro h2 { margin-bottom: 5px; font-size: 16px; }
.practice-intro p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.practice-mode-list { display: grid; gap: 8px; }
.practice-mode { position: relative; display: flex; align-items: center; gap: 12px; min-height: 65px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 15px; text-align: left; background: var(--panel); cursor: pointer; }
.practice-mode-icon { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 11px; color: var(--green); background: rgba(203,242,122,.08); font-size: 16px; }
.practice-mode:nth-child(2) .practice-mode-icon { color: var(--violet); background: rgba(198,173,255,.08); }
.practice-mode:nth-child(3) .practice-mode-icon { color: var(--blue); background: rgba(167,203,255,.08); }
.practice-mode:nth-child(4) .practice-mode-icon { color: #ffd282; background: rgba(255,210,130,.08); }
.practice-mode > span:nth-child(2) { display: grid; gap: 4px; }
.practice-mode strong { font-size: 12px; }
.practice-mode small { color: var(--muted); font-size: 10px; }
.study-header { display: flex; align-items: center; gap: 12px; padding: 4px 0 14px; }
.study-exit { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--panel); cursor: pointer; }
.study-meta { flex: 1; }
.study-meta strong { display: block; font-size: 11px; }
.study-meta small { color: var(--muted); font-size: 9px; }
.study-counter { color: var(--green); font-size: 11px; font-weight: 800; }
.study-progress { height: 4px; margin-bottom: 16px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.09); }
.study-progress span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .25s ease; }
.question-card { padding: 22px 18px; border: 1px solid var(--line); border-radius: 21px; background: linear-gradient(140deg, rgba(255,255,255,.045), rgba(255,255,255,.015)); text-align: center; }
.question-label { margin-bottom: 10px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.question-word { margin: 0 0 9px; overflow-wrap: anywhere; color: var(--text); font-size: clamp(26px, 8vw, 39px); font-weight: 850; letter-spacing: -.07em; line-height: 1.1; }
.question-hint { margin: 0; color: var(--muted); font-size: 11px; }
.answer-options { display: grid; gap: 8px; margin-top: 13px; }
.answer-option { width: 100%; min-height: 47px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); text-align: left; font-size: 12px; cursor: pointer; }
.answer-option:hover { border-color: rgba(203,242,122,.35); }
.answer-option.correct { border-color: #8bc960; color: #dbffc1; background: rgba(112,164,68,.15); }
.answer-option.incorrect { border-color: #b86170; color: #ffd0d0; background: rgba(184,97,112,.14); }
.answer-option:disabled { cursor: default; }
.feedback { min-height: 27px; padding: 10px 2px 2px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.feedback.good { color: var(--green); }
.feedback.bad { color: #ffaaaa; }
.next-button, .primary-button { width: 100%; min-height: 47px; border: 0; border-radius: 14px; color: var(--green-ink); background: var(--green); font-size: 12px; font-weight: 800; cursor: pointer; }
.next-button:disabled { opacity: .4; cursor: default; }
.card-face { display: grid; place-items: center; min-height: 230px; padding: 20px; border: 1px solid rgba(198,173,255,.2); border-radius: 21px; background: radial-gradient(ellipse at center, rgba(198,173,255,.1), rgba(255,255,255,.018)); text-align: center; cursor: pointer; }
.card-face .question-word { color: var(--violet); }
.card-reveal { display: grid; gap: 9px; color: var(--green); font-size: 21px; font-weight: 800; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 11px; }
.card-actions button { min-height: 46px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); font-size: 11px; font-weight: 700; cursor: pointer; }
.card-actions .know-button { border-color: rgba(203,242,122,.24); color: var(--green); background: rgba(203,242,122,.07); }
.session-done { padding: 26px 18px; border: 1px solid rgba(203,242,122,.2); border-radius: 20px; background: rgba(203,242,122,.05); text-align: center; }
.done-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 15px; border-radius: 18px; color: var(--green-ink); background: var(--green); font-size: 24px; }
.session-done h2 { margin-bottom: 7px; font-size: 22px; }
.session-done p { margin: 0 0 17px; color: var(--muted); font-size: 12px; }
.profile-summary { display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); }
.profile-summary h2 { margin-bottom: 5px; font-size: 14px; }
.profile-avatar { flex: 0 0 43px; width: 43px; height: 43px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.profile-stats > div { display: grid; gap: 7px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.profile-stats > div span { color: var(--muted); font-size: 10px; }
.profile-stats > div strong { font-size: 18px; }
.data-actions { display: grid; gap: 8px; margin-top: 17px; }
.secondary-button, .danger-button { min-height: 44px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); text-align: left; font-size: 11px; cursor: pointer; }
.danger-button { border-color: rgba(255,154,154,.16); color: #ffaaaa; }
.privacy-note { margin: 15px 3px 0; color: #74788b; font-size: 10px; line-height: 1.6; }
.bottom-nav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 760px); margin: 0 auto; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); border: 1px solid rgba(255,255,255,.06); border-bottom: 0; border-radius: 20px 20px 0 0; background: rgba(25,27,38,.96); backdrop-filter: blur(18px); }
.nav-item { display: grid; justify-items: center; gap: 5px; padding: 3px 0; border: 0; color: #777b8c; background: transparent; cursor: pointer; }
.nav-item > span { font-size: 19px; line-height: 1; }
.nav-item small { font-size: 9px; }
.nav-item.active { color: var(--green); }
.nav-practice { display: grid; place-items: center; width: 29px; height: 26px; border-radius: 9px; color: var(--green-ink); background: var(--green); font-size: 15px !important; }
.nav-item.active .nav-practice { color: var(--green-ink); }

@media (min-width: 680px) {
  .app-shell { padding-top: 8px; }
  .welcome-row { padding-top: 30px; }
  .mode-card { min-height: 158px; padding: 18px; }
  .word-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-nav { bottom: 12px; border: 1px solid var(--line); border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
