:root { --ink:#25272d; --paper:#fbf7f0; --coral:#7f3ea8; --coral-light:#a96bd0; --mint:#b8e0d1; --line:#e9e1d6; }
* { box-sizing:border-box; }
body { margin:0; background:#f4ede3; color:var(--ink); font-family:Arial,"Helvetica Neue",sans-serif; }
button { font:inherit; -webkit-tap-highlight-color:transparent; cursor:pointer; }
.app-shell { min-height:100svh; max-width:500px; margin:auto; padding:18px 20px calc(86px + env(safe-area-inset-bottom)); background:var(--paper); overflow:hidden; }
.topbar { display:flex; align-items:center; justify-content:space-between; }.brand { display:flex; align-items:center; gap:8px; font-weight:800; letter-spacing:-.8px; font-size:20px; }.brand-mark { display:grid; place-items:center; width:34px; height:34px; border-radius:11px; background:var(--coral); color:white; font-size:22px; }.brand-light { color:var(--coral); }.topbar-actions { position:relative; display:flex; align-items:center; gap:8px; }.account { max-width:142px; overflow:hidden; border:1px solid var(--line); border-radius:99px; padding:8px 11px; background:#fffdfa; color:#625d56; font-size:12px; font-weight:800; text-overflow:ellipsis; white-space:nowrap; }.account.signed-in { color:#1b7047; border-color:#9bd8b5; background:#eaf7ef; }.account-menu { position:absolute; z-index:20; top:45px; right:0; display:grid; min-width:164px; padding:5px; border:1px solid var(--line); border-radius:13px; background:#fffdfa; box-shadow:0 12px 30px rgba(61,49,33,.16); }.account-menu[hidden] { display:none; }.account-menu button { border:0; border-radius:9px; padding:10px 11px; background:transparent; color:var(--ink); font-size:13px; font-weight:700; text-align:left; }.account-menu button:hover { background:#f7f1e9; }.account-menu button + button { color:#a33b30; }
.auth-dialog { width:min(calc(100% - 32px),420px); padding:22px; border:0; border-radius:22px; background:#fffdfa; color:var(--ink); box-shadow:0 20px 60px rgba(37,39,45,.26); }.auth-dialog::backdrop { background:rgba(37,39,45,.38); backdrop-filter:blur(3px); }.auth-dialog-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }.auth-dialog h2 { margin:0; font-size:24px; letter-spacing:-.8px; }.dialog-close { display:grid; place-items:center; width:32px; height:32px; border:1px solid var(--line); border-radius:50%; background:transparent; color:#79736a; font-size:24px; line-height:1; }.auth-copy { margin:11px 0 17px; color:#777168; font-size:13px; line-height:1.4; }.google-button { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; padding:13px; border:1px solid var(--line); border-radius:13px; background:#fff; color:#3b3b3b; font-size:14px; font-weight:800; }.google-button .google-mark { display:grid; place-items:center; width:20px; height:20px; border-radius:50%; background:#4285f4; color:#fff; font-size:13px; font-family:Arial,sans-serif; }.auth-divider { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:10px; margin:17px 0; color:#999188; font-size:11px; }.auth-divider::before,.auth-divider::after { height:1px; background:var(--line); content:""; }.auth-tabs { display:grid; grid-template-columns:1fr 1fr; gap:5px; padding:4px; border-radius:12px; background:#f3ece3; }.auth-tabs button { border:0; border-radius:8px; padding:8px; background:transparent; color:#7c766e; font-size:12px; font-weight:800; }.auth-tabs button.active { background:#fffdfa; color:var(--ink); box-shadow:0 1px 3px rgba(61,49,33,.1); }.auth-form { display:grid; gap:11px; margin-top:16px; }.auth-form label { display:grid; gap:6px; color:#665f57; font-size:12px; font-weight:800; }.auth-form input { width:100%; padding:12px; border:1px solid var(--line); border-radius:11px; background:#fff; color:var(--ink); font:inherit; font-size:14px; }.auth-form input:focus { outline:2px solid rgba(127,62,168,.27); border-color:var(--coral); }.auth-form .primary-button { margin-top:3px; }.auth-error { margin:0; color:#a33b30; font-size:12px; line-height:1.35; }.password-reset { display:block; margin:14px auto 0; border:0; background:transparent; color:var(--coral); font-size:12px; font-weight:800; text-decoration:underline; }
.intro { padding:22px 3px 13px; }.eyebrow { margin:0 0 6px; text-transform:uppercase; color:var(--coral); font-size:11px; font-weight:800; letter-spacing:1.3px; }.intro h1 { margin:0; font-size:clamp(29px,7.8vw,38px); letter-spacing:-1.55px; line-height:1.04; }.intro h1 em { color:var(--coral); font-style:normal; }.subcopy { max-width:355px; color:#74716b; font-size:13px; line-height:1.4; margin:10px 0 0; }.study-plan { display:none; }
.progress-card { padding:14px 15px 12px; border:1px solid var(--line); border-radius:18px; background:#fffdfa; box-shadow:0 7px 18px rgba(59,48,34,.04); }.progress-title { display:flex; justify-content:space-between; margin-bottom:8px; font-size:14px; font-weight:750; }.progress-title strong { color:var(--coral); }.track { height:8px; overflow:hidden; border-radius:99px; background:#eee8df; }.fill { height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--coral),var(--coral-light)); transition:width .35s ease; }.progress-card p { margin:8px 0 0; color:#79756e; font-size:12px; }.progress-card b { color:var(--ink); }
.tabs { display:flex; gap:7px; overflow-x:auto; margin:16px -2px 12px; padding:1px 2px; scrollbar-width:none; }.tabs::-webkit-scrollbar { display:none; }.tabs button { white-space:nowrap; border:1px solid var(--line); border-radius:99px; padding:8px 12px; background:transparent; color:#77736c; font-size:13px; font-weight:700; }.tabs button.active { color:#fff; background:var(--ink); border-color:var(--ink); }
.quiz { padding:0 2px; }.kana-card { position:relative; display:grid; place-items:center; height:min(36vw,172px); min-height:142px; margin:8px 0 10px; overflow:hidden; border-radius:22px; background:var(--mint); box-shadow:inset 0 0 0 1px rgba(39,98,81,.08); transition:background .3s ease; }.kana-card[data-row="0"] { background:#b8e0d1; }.kana-card[data-row="1"] { background:#bfdcf3; }.kana-card[data-row="2"] { background:#d6c8ef; }.kana-card[data-row="3"] { background:#f5c8b8; }.kana-card[data-row="4"] { background:#f4d8a9; }.kana-card[data-row="5"] { background:#f1c2d3; }.kana-card[data-row="6"] { background:#d4e8ae; }.kana-card[data-row="7"] { background:#c8e7e3; }.kana-card[data-row="8"] { background:#cbd5ee; }.kana-card[data-row="9"] { background:#e6d1b6; }.kana-card>span { z-index:1; font-family:"Hiragino Sans","Yu Gothic",sans-serif; font-size:min(25vw,112px); font-weight:500; line-height:1; }.kana-card i { position:absolute; border-radius:50%; background:rgba(255,255,255,.28); }.decor-one { width:135px; height:135px; top:-72px; left:-34px; }.decor-two { width:82px; height:82px; right:-21px; bottom:-34px; }
.answers { display:grid; gap:9px; }.answer { display:flex; align-items:center; gap:13px; width:100%; min-height:55px; padding:10px 14px; border:1px solid var(--line); border-radius:15px; background:#fffdfa; color:var(--ink); font-size:17px; font-weight:800; text-align:left; text-transform:lowercase; }.answer:active { transform:scale(.985); }.answer span { display:grid; place-items:center; width:25px; height:25px; border-radius:8px; background:#f1ebe2; color:#847e75; font-size:11px; }.answer.correct { background:#e2f5ea; border-color:#8fcfae; color:#1b7047; }.answer.correct span { background:#9bd8b5; color:#145335; }.answer.wrong { background:#ffe8e4; border-color:#f3aaa0; color:#a33b30; }.answer.wrong span { background:#f3b1a7; color:#8f2b21; }
.hint { display:flex; align-items:center; justify-content:center; gap:7px; margin:19px 0 0; color:#888177; font-size:12px; text-align:center; }.hint > span:first-child { color:var(--coral); }
.kana-reference { padding:31px 15px 16px; }.section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }.section-heading .eyebrow { margin-bottom:4px; }.section-heading h2 { margin:0; font-size:23px; letter-spacing:-.8px; }.progress-key { flex:none; padding:5px 8px; border-radius:99px; background:#f3ece3; color:#837c73; font-size:10px; font-weight:800; }.reference-copy { margin:11px 0 18px; color:#79756e; font-size:12px; line-height:1.42; }.kana-tables { display:grid; gap:20px; }.kana-table { overflow:hidden; border:1px solid var(--line); border-radius:15px; background:#fffdfa; }.kana-table-title { display:flex; align-items:center; justify-content:space-between; margin:0; padding:10px 11px; background:#f7f1e9; font-size:14px; }.kana-table-title span { color:#8a847a; font-size:11px; font-weight:500; }.kana-grid { display:grid; grid-template-columns:23px repeat(5,minmax(0,1fr)); gap:5px; padding:7px; }.kana-column-label { display:grid; place-items:center; min-height:18px; color:#8c867c; font-size:10px; font-weight:800; text-transform:uppercase; }.kana-row-label { display:grid; align-items:center; color:#8c867c; font-size:10px; font-weight:800; text-transform:uppercase; }.kana-cell { min-width:0; min-height:59px; padding:5px 3px 6px; border:1px solid #eee6dc; border-radius:9px; background:#fff; text-align:center; }.kana-cell.row-tone-0 { background:#edf8f4; border-color:#c3e8db; }.kana-cell.row-tone-1 { background:#eef7fd; border-color:#c8e4f5; }.kana-cell.row-tone-2 { background:#f4effb; border-color:#ddcff2; }.kana-cell.row-tone-3 { background:#fdf0ea; border-color:#f5d0c1; }.kana-cell.row-tone-4 { background:#fdf7e8; border-color:#f2dfa9; }.kana-cell.row-tone-5 { background:#fceef4; border-color:#edccdb; }.kana-cell.row-tone-6 { background:#f4fae9; border-color:#d8eab4; }.kana-cell.row-tone-7 { background:#edf9f8; border-color:#c8e9e5; }.kana-cell.row-tone-8 { background:#f0f3fc; border-color:#d1daf1; }.kana-cell.row-tone-9 { background:#faf3ec; border-color:#ead7c1; }.kana-cell-character { display:block; font-family:"Hiragino Sans","Yu Gothic",sans-serif; font-size:24px; line-height:1; }.kana-cell-reading { display:block; min-height:12px; margin:3px 0 4px; color:#777168; font-size:9px; font-weight:700; }.kana-cell-track { height:4px; overflow:hidden; border-radius:99px; background:rgba(114,108,99,.16); }.kana-cell-fill { height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--coral),var(--coral-light)); transition:width .35s ease; }.kana-cell.empty { border-color:transparent; background:transparent; }
.bottom-nav { position:fixed; z-index:10; bottom:0; left:50%; display:grid; grid-template-columns:repeat(3,1fr); width:min(500px,100%); padding:8px 20px calc(8px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:rgba(255,253,250,.94); box-shadow:0 -7px 20px rgba(61,49,33,.07); backdrop-filter:blur(12px); transform:translateX(-50%); }.bottom-nav button { display:grid; justify-items:center; gap:3px; border:0; border-radius:12px; padding:5px; background:transparent; color:#878078; font-size:11px; font-weight:800; }.bottom-nav svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:1.8; }.bottom-nav button.active { color:var(--coral); background:#f3e8fa; }
.exam-intro { padding:31px 3px 0; }.exam-intro h1, .exam-result h1 { margin:0; font-size:clamp(31px,8.7vw,42px); letter-spacing:-1.8px; line-height:1.02; }.exam-intro h1 em { color:var(--coral); font-style:normal; }.exam-options { display:grid; gap:9px; margin-top:22px; }.exam-options button { display:flex; align-items:center; gap:12px; width:100%; padding:12px; border:1px solid var(--line); border-radius:16px; background:#fffdfa; color:var(--ink); text-align:left; }.exam-options button:active { transform:scale(.985); }.exam-option-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; background:var(--mint); font-family:"Hiragino Sans","Yu Gothic",sans-serif; font-size:21px; }.exam-option-icon + span { display:grid; gap:3px; }.exam-options b { font-size:15px; }.exam-options small { color:#817b72; font-size:11px; }.chevron { margin-left:auto; color:var(--coral); font-size:28px; font-weight:400; }.exam-history { margin-top:31px; padding:17px 14px; border:1px solid var(--line); border-radius:18px; background:#fffdfa; }.exam-history .section-heading { align-items:center; }.exam-history h2 { font-size:17px; }.history-clear { border:0; padding:3px; background:transparent; color:var(--coral); font-size:11px; font-weight:800; }.history-empty { margin:13px 0 0; color:#878078; font-size:12px; }.history-list { display:grid; gap:7px; margin-top:12px; }.history-row { display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:9px; padding:8px 9px; border-radius:10px; background:#f7f1e9; font-size:12px; }.history-row span { color:#817b72; }.history-row b { color:var(--coral); font-size:14px; }.history-row time { color:#999188; font-size:10px; }.exam-run { padding:28px 2px 0; }.exam-status { display:flex; justify-content:space-between; margin-bottom:9px; color:#827c73; font-size:12px; font-weight:800; }.exam-status strong { color:var(--coral); font-variant-numeric:tabular-nums; }.exam-abandon { display:block; margin:18px auto 0; border:0; background:transparent; color:#9a746d; font-size:12px; text-decoration:underline; }.exam-result { padding:62px 3px 0; text-align:center; }.result-score { display:grid; gap:6px; margin:29px 0 15px; padding:26px; border-radius:24px; background:var(--mint); }.result-score strong { font-size:54px; letter-spacing:-3px; line-height:1; }.result-score span { color:#4a685e; font-size:13px; font-weight:700; }.result-meta { display:flex; justify-content:center; gap:9px; color:#827c73; font-size:12px; }.result-meta span + span { padding-left:9px; border-left:1px solid var(--line); }.result-meta b { color:var(--ink); }.primary-button { width:100%; margin-top:30px; padding:15px; border:0; border-radius:15px; background:var(--ink); color:#fff; font-size:15px; font-weight:800; }
.profile-screen { padding:28px 3px 0; }.profile-header h1 { margin:0; font-size:clamp(31px,8.7vw,42px); letter-spacing:-1.8px; line-height:1.02; }.profile-header .subcopy { overflow-wrap:anywhere; }.profile-back { margin:0 0 22px; border:0; padding:0; background:transparent; color:#777168; font-size:13px; font-weight:800; }.profile-actions { display:grid; gap:12px; margin-top:25px; }.profile-action { padding:17px; border:1px solid var(--line); border-radius:18px; background:#fffdfa; }.profile-action h2 { margin:0; font-size:17px; }.profile-action p { margin:7px 0 14px; color:#777168; font-size:12px; line-height:1.4; }.secondary-button,.danger-button { width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:11px; background:#fff; color:var(--ink); font-size:13px; font-weight:800; }.language-picker { display:grid; grid-template-columns:1fr 1fr; gap:7px; }.language-picker button { border:1px solid var(--line); border-radius:11px; padding:10px; background:#fff; color:#777168; font-size:13px; font-weight:800; }.language-picker button.active { border-color:var(--ink); background:var(--ink); color:#fff; }.danger-zone { border-color:#f3aaa0; }.danger-zone h2 { color:#a33b30; }.danger-button { border-color:#e86552; background:#fff2ef; color:#a33b30; }.profile-message { margin:2px 3px; color:#1b7047; font-size:13px; line-height:1.4; }.profile-message.error { color:#a33b30; }
@media (min-width:501px) { body { padding:12px 0; }.app-shell { border-radius:28px; box-shadow:0 16px 48px rgba(61,49,33,.12); }.bottom-nav { bottom:12px; width:460px; border:1px solid var(--line); border-radius:18px; } }
@media (max-height:760px) and (max-width:500px) { .app-shell { padding-top:14px; }.intro { padding-top:17px; }.intro h1 { font-size:28px; }.subcopy { font-size:12px; }.hint { display:none; }.answers { gap:7px; }.answer { min-height:49px; }.bottom-nav { padding-top:6px; padding-bottom:calc(6px + env(safe-area-inset-bottom)); } }
@media (min-width:900px) {
  body { min-height:100vh; padding:28px; background:radial-gradient(circle at 14% 12%,#fffaf2 0 18%,transparent 42%),#eee7dc; }
  .app-shell { width:min(1200px,calc(100vw - 56px)); max-width:none; min-height:calc(100vh - 56px); margin:0 auto; padding:28px 46px 42px; border-radius:32px; box-shadow:0 22px 70px rgba(61,49,33,.14); overflow:visible; }
  .topbar { min-height:48px; }
  .brand { font-size:22px; }
  .brand-mark { width:40px; height:40px; border-radius:13px; font-size:26px; }
  .account { max-width:220px; padding:10px 15px; font-size:13px; }
  .account-menu { top:51px; }
  .bottom-nav { position:fixed; z-index:12; top:34px; bottom:auto; left:50%; grid-template-columns:repeat(3,auto); width:auto; padding:5px; border:1px solid var(--line); border-radius:16px; background:rgba(255,253,250,.9); box-shadow:0 8px 24px rgba(61,49,33,.1); transform:translateX(-50%); }
  .bottom-nav button { display:flex; align-items:center; gap:7px; padding:8px 13px; font-size:12px; }
  .bottom-nav svg { width:19px; height:19px; }
  .learn-screen.active { display:grid; grid-template-columns:minmax(330px,.88fr) minmax(440px,1.12fr); grid-template-areas:"intro quiz" "progress quiz" "tabs quiz" "hint quiz"; column-gap:66px; align-items:start; }
  .intro { grid-area:intro; padding:58px 0 24px; }
  .intro h1 { max-width:465px; font-size:clamp(42px,4vw,58px); letter-spacing:-2.4px; line-height:1; }
  .subcopy { max-width:430px; margin-top:16px; font-size:16px; line-height:1.45; }
  .progress-card { grid-area:progress; padding:19px 20px 17px; border-radius:20px; }
  .progress-title { margin-bottom:11px; font-size:15px; }
  .progress-card p { margin-top:10px; font-size:13px; }
  .tabs { grid-area:tabs; margin:24px 0 0; }
  .tabs button { padding:10px 15px; font-size:14px; }
  .hint { grid-area:hint; justify-content:flex-start; margin:19px 0 0; text-align:left; }
  .quiz { grid-area:quiz; align-self:center; width:100%; padding:42px 0 0; }
  .kana-card { height:300px; min-height:300px; margin:0 0 14px; border-radius:30px; }
  .kana-card > span { font-size:178px; }
  .decor-one { width:235px; height:235px; top:-122px; left:-58px; }
  .decor-two { width:145px; height:145px; right:-38px; bottom:-57px; }
  .answers { grid-template-columns:repeat(3,1fr); gap:11px; }
  .answer { min-height:64px; padding:11px 14px; border-radius:16px; font-size:18px; }
  .answer span { flex:none; }
  .kana-reference { padding:55px 0 28px; }
  .section-heading h2 { font-size:30px; }
  .reference-copy { max-width:580px; font-size:14px; }
  .kana-tables { grid-template-columns:repeat(2,minmax(0,1fr)); gap:26px; }
  .kana-grid { grid-template-columns:28px repeat(5,minmax(0,1fr)); gap:7px; padding:11px; }
  .kana-cell { min-height:72px; padding:8px 4px; }
  .kana-cell-character { font-size:31px; }
  .kana-cell-reading { margin-top:5px; font-size:11px; }
  .exam-screen { width:min(820px,100%); margin:0 auto; }
  .exam-intro { padding-top:58px; }
  .exam-intro h1,.exam-result h1 { font-size:48px; }
  .exam-options { grid-template-columns:repeat(3,1fr); gap:12px; }
  .exam-options button { min-height:94px; align-items:flex-start; }
  .exam-options .chevron { display:none; }
  .exam-run { padding-top:52px; }
  .exam-run .kana-card { margin-top:16px; }
  .exam-run .answers { grid-template-columns:repeat(3,1fr); }
  .exam-history { margin-top:38px; }
  .profile-screen { width:min(820px,100%); margin:0 auto; padding-top:58px; }
  .profile-header h1 { font-size:48px; }
  .profile-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
  .profile-action:last-of-type { grid-column:span 2; }
  .auth-dialog { width:min(420px,100%); }
}

/* Красный оставлен только для необратимого действия. */
.danger-button { border-color:#d45555; background:#fff0f0; color:#a33b30; }
