/* LapKa — оформление. Стиль «стикер из манги»: жирный контур, сдвинутая тень, пастель. */

/* ---------- темы ---------- */
:root, [data-theme="sakura"] {
  --bg: #ffeef4; --bg2: #ffd9e6; --card: #ffffff; --soft: #fff4f8; --ink: #3b2a3f; --muted: #8a6f86;
  --pri: #ff8fb3; --pri-2: #ffc2d6; --pri-ink: #3b2a3f; --acc: #ffd166; --line: #f5cddb; --edge: #3b2a3f; --doodle: #ff7fa8;
  --ok: #58c98b; --ok-bg: #dff7e8; --bad: #ff6b6b; --bad-bg: #ffe3e3; --doodle-op: .17;
}
[data-theme="matcha"] { --bg: #f1f7e7; --bg2: #dcecc8; --card: #fff; --soft: #f6faef; --ink: #2f3a2a; --muted: #6f7f66; --pri: #9ad97b; --pri-2: #cfeebd; --pri-ink: #2f3a2a; --acc: #ffb86b; --line: #d3e6bf; --edge: #2f3a2a; --doodle: #6bbf59; }
[data-theme="lavender"] { --bg: #f3eeff; --bg2: #e1d6ff; --card: #fff; --soft: #f8f5ff; --ink: #33294d; --muted: #7c6f9b; --pri: #b9a2ff; --pri-2: #ddd2ff; --pri-ink: #33294d; --acc: #ff9ecd; --line: #dbd0fb; --edge: #33294d; --doodle: #9b7bff; }
[data-theme="peach"] { --bg: #fff3e8; --bg2: #ffe0c7; --card: #fff; --soft: #fff8f1; --ink: #46301f; --muted: #94745c; --pri: #ffa97a; --pri-2: #ffd4ba; --pri-ink: #46301f; --acc: #ffd35c; --line: #f6d6ba; --edge: #46301f; --doodle: #ff8f5c; }
[data-theme="ramune"] { --bg: #e9f6ff; --bg2: #cfe9fb; --card: #fff; --soft: #f3faff; --ink: #1f3447; --muted: #5f7d94; --pri: #7cc8ff; --pri-2: #bfe3ff; --pri-ink: #1f3447; --acc: #ffd166; --line: #c3def1; --edge: #1f3447; --doodle: #3fa7f5; }
[data-theme="night"] { --bg: #1d1b3a; --bg2: #2b2760; --card: #2c2958; --soft: #37336d; --ink: #f5efff; --muted: #aaa3d8; --pri: #ff8fc7; --pri-2: #7a4f8f; --pri-ink: #2a1533; --acc: #ffd166; --line: #48438f; --edge: #0d0b22; --doodle: #9d94ff; --ok-bg: #1d4a37; --bad-bg: #5a2530; --doodle-op: .13; color-scheme: dark; }
[data-theme="yokai"] { --bg: #17121d; --bg2: #2a1f3a; --card: #2a2136; --soft: #352a44; --ink: #f3ecff; --muted: #a797bf; --pri: #b990ff; --pri-2: #5b4480; --pri-ink: #1c1230; --acc: #5ee6c8; --line: #4b3c60; --edge: #08050c; --doodle: #b388ff; --ok-bg: #17463c; --bad-bg: #55232b; --doodle-op: .12; color-scheme: dark; }

/* ---------- основа ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg);
  font: 500 16px/1.5 "Nunito", ui-rounded, "SF Pro Rounded", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  background-image: radial-gradient(circle at 8% 4%, var(--bg2), transparent 38%), radial-gradient(circle at 96% 92%, var(--bg2), transparent 42%);
  background-attachment: fixed; overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
h2 { font-size: 22px; font-weight: 800; line-height: 1.2; }
h3 { font-size: 20px; font-weight: 800; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.jp { font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif; font-weight: 600; }
.jp.xl { font-size: 104px; line-height: 1.1; }
.jp.lg { font-size: 60px; line-height: 1.25; }
.jp.md { font-size: 38px; line-height: 1.4; }
.jp.sm { font-size: 27px; line-height: 1.5; }
ruby rt { font-size: .38em; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.ro { color: var(--muted); font-weight: 700; letter-spacing: .03em; font-size: 15px; }
.tok { display: inline-block; margin: 0 .09em; border-bottom: 3px dotted var(--line); }
.muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ic { width: 22px; height: 22px; flex: none; }
.grow { flex: 1; }
.dim { opacity: .25; }
kbd { font: 700 12px/1 inherit; border: 2px solid currentColor; border-radius: 6px; padding: 2px 6px; opacity: .6; margin-left: 4px; }

#bg { position: fixed; inset: 0; z-index: 0; color: var(--doodle); opacity: var(--doodle-op); pointer-events: none; }
#bg svg { display: block; }
#app { position: relative; z-index: 1; display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

/* ---------- карточки и кнопки ---------- */
.card { background: var(--card); border: 2.5px solid var(--edge); border-radius: 24px; box-shadow: 0 5px 0 var(--edge); padding: 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h b { font-size: 17px; font-weight: 800; }
.card-h .jp { color: var(--pri); font-size: 15px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 9px 18px;
  border: 2.5px solid var(--edge); border-radius: 16px; background: var(--pri); color: var(--pri-ink); font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 0 var(--edge); transition: transform .08s, box-shadow .08s, filter .15s; white-space: nowrap; user-select: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.btn:disabled { background: var(--soft); color: var(--muted); border-color: var(--line); box-shadow: 0 4px 0 var(--line); cursor: not-allowed; filter: none; }
.btn.big { min-height: 54px; padding: 12px 26px; font-size: 18px; border-radius: 18px; }
.btn.sm { min-height: 36px; padding: 4px 12px; font-size: 14px; border-radius: 12px; box-shadow: 0 3px 0 var(--edge); }
.btn.sm .ic { width: 16px; height: 16px; }
.btn.ghost { background: var(--card); color: var(--ink); }
.btn.acc { background: var(--acc); color: #3b2a3f; }
.btn.ok { background: var(--ok); color: #123524; }
.btn.danger { background: var(--bad); color: #3f1010; }
.btn.wide { width: 100%; white-space: normal; }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 2.5px solid var(--edge); background: var(--card); box-shadow: 0 3px 0 var(--edge); flex: none; transition: transform .08s, box-shadow .08s; }
.iconbtn:active { transform: translateY(3px); box-shadow: none; }
.linkbtn { background: none; border: 0; color: var(--muted); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--soft); font-weight: 700; font-size: 14px; }
.chip .jp { font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.pick { border-color: var(--edge); background: var(--card); padding: 9px 14px; font-size: 15px; box-shadow: 0 3px 0 var(--edge); }
.chip.pick.on { background: var(--pri); color: var(--pri-ink); transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.tag { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); border: 2px solid var(--line); white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ink); border-color: var(--ok); }
.bar { height: 10px; border-radius: 99px; background: var(--soft); border: 2px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--pri); border-radius: 99px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.bar.big { height: 16px; border-color: var(--edge); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 2.5px solid var(--edge); box-shadow: 0 3px 0 var(--edge); font-weight: 800; font-size: 15px; white-space: nowrap; }
.pill .ic { width: 18px; height: 18px; color: var(--muted); }
.pill.hot .ic { color: #ff7a3d; fill: #ffc24d; }
.pill.petal .ic { color: var(--pri); fill: var(--pri-2); }
.pill.lvl .lv { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 99px; background: var(--acc); color: #3b2a3f; font-size: 13px; }
.lv-bar { width: 54px; height: 8px; border-radius: 9px; background: var(--soft); border: 1.5px solid var(--line); overflow: hidden; }
.lv-bar i { display: block; height: 100%; background: var(--acc); }
.bubble { position: relative; background: var(--soft); border: 2.5px solid var(--edge); border-radius: 18px; padding: 12px 16px; font-weight: 600; }
.bubble.big { padding: 18px 22px; font-size: 17px; }
.bubble.mini { position: absolute; left: 2px; top: -26px; padding: 3px 10px; font-size: 13px; font-weight: 800; white-space: nowrap; background: var(--acc); color: #3b2a3f; border-radius: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-weight: 700; font-size: 14px; }
.field input, .field textarea, select, input[type=time], .type-in, .name-in {
  width: 100%; padding: 11px 14px; border: 2.5px solid var(--edge); border-radius: 14px; background: var(--card); font-weight: 600; font-size: 16px; outline: 0;
}
.field input:focus, .field textarea:focus, .type-in:focus, .name-in:focus { box-shadow: 0 0 0 4px var(--pri-2); }
.field input.jp { font-size: 20px; }
.field small { font-weight: 500; }
textarea { resize: vertical; }
.grid2f { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3f { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { padding: 8px 16px; border-radius: 999px; border: 2.5px solid var(--edge); background: var(--card); font-weight: 800; box-shadow: 0 3px 0 var(--edge); }
.tab.on { background: var(--pri); color: var(--pri-ink); transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.backlink { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--muted); margin-bottom: 12px; }
.empty { text-align: center; color: var(--muted); padding: 36px 20px; }
.mascot { display: block; flex: none; }

/* ---------- боковое меню ---------- */
#side { position: sticky; top: 0; height: 100vh; padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; }
.logo { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.logo b { display: block; font-size: 25px; font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.logo small { font-size: 11px; color: var(--muted); letter-spacing: .06em; }
#side nav { display: flex; flex-direction: column; gap: 6px; }
#side nav a, #tabbar a { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 16px; font-weight: 800; border: 2.5px solid transparent; color: var(--muted); transition: background .15s, color .15s; }
#side nav a:hover { background: var(--card); color: var(--ink); }
#side nav a.on { background: var(--pri); color: var(--pri-ink); border-color: var(--edge); box-shadow: 0 4px 0 var(--edge); }
.dot { margin-left: auto; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; background: var(--acc); color: #3b2a3f; border: 2px solid var(--edge); font-size: 12px; display: grid; place-items: center; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 8px; font-weight: 600; }
#tabbar { display: none; }

/* ---------- основная область ---------- */
#main { padding: 26px 32px 80px; max-width: 1180px; width: 100%; }
#main.in { animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); font-weight: 600; margin-top: 4px; max-width: 560px; }
.h-jp { color: var(--pri); font-size: .7em; margin-left: 6px; }
.statbar { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- главная ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.hello { grid-column: 1; display: flex; gap: 16px; align-items: center; background: linear-gradient(135deg, var(--card) 55%, var(--pri-2)); overflow: hidden; }
.hello-cat { animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
.hello-body { flex: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hello-jp { font-weight: 800; color: var(--muted); font-size: 14px; margin-bottom: 2px; }
.hello-jp .jp { color: var(--pri); font-size: 17px; }
.hello .bubble { background: var(--card); }
.home-side { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 20px; }
.track { grid-column: 1; min-width: 0; }
.goal { display: flex; align-items: center; gap: 16px; }
.goal b { font-size: 19px; font-weight: 800; }
.ring-bg { fill: none; stroke: var(--soft); stroke-width: 9; }
.ring { fill: none; stroke: var(--pri); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .8s; }
.goal text { font-size: 22px; font-weight: 800; fill: var(--ink); }
.task { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-weight: 700; font-size: 14.5px; }
.task-c { width: 24px; height: 24px; border-radius: 9px; border: 2.5px solid var(--edge); display: grid; place-items: center; flex: none; background: var(--card); }
.task-c .ic { width: 15px; height: 15px; stroke-width: 3.5; }
.task.done .task-c { background: var(--ok); color: #123524; }
.task.done .task-b > div:first-child { text-decoration: line-through; color: var(--muted); }
.task-b { flex: 1; min-width: 0; }
.task-b .bar { height: 7px; margin-top: 5px; border-width: 1.5px; }
.task-r { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; color: var(--muted); font-size: 13px; }
.task-r .ic { width: 15px; height: 15px; color: var(--pri); }
.hw .btn, .hw > .muted { margin-top: 10px; }
.wod-b { width: 100%; border: 2.5px dashed var(--line); background: var(--soft); border-radius: 16px; padding: 12px; text-align: center; }
.wod-ru { font-weight: 800; margin-top: 2px; }
.sec-tabs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 4px 12px; margin: 0 -4px; scrollbar-width: none; }
.sec-tabs::-webkit-scrollbar { display: none; }
.sec-tab { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 18px; border: 2.5px solid var(--edge); background: var(--card); box-shadow: 0 4px 0 var(--edge); font-weight: 800; text-align: left; flex: none; }
.sec-tab > .jp { width: 38px; height: 38px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; font-size: 21px; }
.sec-tab small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.sec-tab.on { background: var(--pri); color: var(--pri-ink); transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.sec-tab.on > .jp { background: var(--card); color: var(--ink); }
.sec-tab.on small { color: inherit; opacity: .75; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 6px; }
.sec-head > div:first-child { flex: 1; min-width: 0; }
.sec-head .bar { margin-top: 10px; max-width: 360px; }
.path { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 38px 0 20px; }
.node-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; transform: translateX(var(--dx)); }
.node { position: relative; width: 88px; height: 82px; border-radius: 30px; border: 3px solid var(--edge); background: var(--card); box-shadow: 0 7px 0 var(--edge); display: grid; place-items: center; transition: transform .1s, box-shadow .1s; }
.node:hover { transform: translateY(-2px); box-shadow: 0 9px 0 var(--edge); }
.node:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--edge); }
.node-g { font-size: 36px; line-height: 1; white-space: nowrap; display: grid; place-items: center; }
.node-g.two { font-size: 27px; }
.node-g.small { font-size: 21px; font-weight: 800; }
.node.done { background: var(--pri); color: var(--pri-ink); }
.node.cur { background: var(--acc); color: #3b2a3f; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 7px 0 var(--edge), 0 0 0 10px color-mix(in srgb, var(--acc) 35%, transparent); } }
.node.lock { background: var(--soft); color: var(--muted); border-color: var(--line); box-shadow: 0 7px 0 var(--line); }
.node-badge { position: absolute; right: -8px; top: -10px; width: 30px; height: 30px; border-radius: 50%; background: var(--acc); color: #3b2a3f; border: 2.5px solid var(--edge); display: grid; place-items: center; font-weight: 900; font-size: 15px; }
.node-t { font-weight: 800; font-size: 14px; max-width: 190px; text-align: center; background: var(--bg); padding: 1px 10px; border-radius: 99px; }
.node-cat { position: absolute; left: -84px; top: 14px; animation: bob 2.4s ease-in-out infinite; }

/* ---------- окна ---------- */
#modal { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 18px; background: color-mix(in srgb, var(--edge) 55%, transparent); overflow-y: auto; }
#modal.on { display: grid; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal-box { position: relative; width: min(600px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; animation: popin .22s cubic-bezier(.2, 1.3, .4, 1); }
.modal-box.small { width: min(440px, 100%); }
.modal-box.wide { width: min(780px, 100%); }
@keyframes popin { from { transform: scale(.92) translateY(10px); opacity: 0; } }
.modal-x { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; z-index: 2; }
.modal-box h3 { margin: 0 44px 8px 0; }
.modal-box .row.end { margin-top: 18px; }
.sheet { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.sheet h3 { margin: 0; }
.sheet-g { width: 96px; height: 90px; border-radius: 30px; background: var(--pri); color: var(--pri-ink); border: 3px solid var(--edge); box-shadow: 0 6px 0 var(--edge); display: grid; place-items: center; font-size: 44px; }
.sheet-g.small { font-size: 24px; }
.sheet .chips { justify-content: center; }
#toasts { position: fixed; z-index: 90; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: var(--ink); color: var(--bg); font-weight: 800; padding: 11px 20px; border-radius: 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); animation: popin .25s; text-align: center; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .35s; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti i { position: absolute; top: -20px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: .9; } }

/* ---------- урок ---------- */
#overlay { position: fixed; inset: 0; z-index: 40; display: none; background: var(--bg); background-image: radial-gradient(circle at 10% 0, var(--bg2), transparent 40%), radial-gradient(circle at 95% 100%, var(--bg2), transparent 40%); overflow-y: auto; }
#overlay.on { display: block; }
.lesson, .game { min-height: 100%; display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; padding: 16px 18px 0; }
.l-top { display: flex; align-items: center; gap: 14px; min-height: 48px; }
.l-bar { flex: 1; height: 18px; border-radius: 99px; background: var(--card); border: 2.5px solid var(--edge); overflow: hidden; }
.l-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--pri), var(--pri) 10px, var(--pri-2) 10px, var(--pri-2) 20px); border-radius: 99px; transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.l-combo { min-width: 58px; text-align: right; }
.combo { display: inline-flex; align-items: center; gap: 2px; font-weight: 900; font-size: 18px; color: #e8590c; }
.combo .ic { fill: #ffd43b; width: 20px; height: 20px; }
.combo.pop { animation: popin .3s; }
.l-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px 0 26px; }
.l-body.in { animation: slide .28s ease both; }
@keyframes slide { from { opacity: 0; transform: translateX(26px); } }
.l-foot { position: sticky; bottom: 0; margin: 0 -18px; padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: flex-end; gap: 16px; border-top: 2.5px solid transparent; }
.l-foot .btn { min-width: 170px; }
.l-fb { flex: 1; min-width: 0; }
.l-foot.ok { background: var(--ok-bg); border-color: var(--ok); animation: up .22s; }
.l-foot.no { background: var(--bad-bg); border-color: var(--bad); animation: up .22s; }
.l-foot.ok .btn { background: var(--ok); color: #123524; }
.l-foot.no .btn { background: var(--bad); color: #3f1010; }
@keyframes up { from { transform: translateY(100%); } }
.fb-t { font-weight: 900; font-size: 18px; }
.fb-t .jp { font-size: 20px; margin-right: 4px; }
.fb-s { font-weight: 700; margin-top: 2px; }
.fb-s .jp { font-size: 20px; }
.fb-mn { font-size: 14px; margin-top: 4px; font-weight: 600; opacity: .9; }
.l-q { display: flex; flex-direction: column; gap: 20px; align-items: center; width: 100%; }
.q-title { text-align: center; }
.q-card { min-width: 220px; max-width: 100%; text-align: center; padding: 22px 32px; position: relative; }
.q-card.slim { padding: 14px 60px 14px 24px; }
.q-card .say { position: absolute; right: 10px; top: 50%; margin-top: -22px; }
.q-ro { font-size: 60px; font-weight: 900; letter-spacing: .02em; line-height: 1.2; }
.q-ru { font-size: 24px; font-weight: 800; }
.q-sub { color: var(--muted); font-weight: 700; margin-top: 4px; }
.q-audio { display: flex; align-items: center; gap: 14px; }
.audio-big { width: 116px; height: 108px; border-radius: 34px; border: 3px solid var(--edge); background: var(--pri); color: var(--pri-ink); box-shadow: 0 7px 0 var(--edge); display: grid; place-items: center; }
.audio-big .ic { width: 50px; height: 50px; }
.audio-big:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--edge); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 560px; }
.opts.wide { grid-template-columns: 1fr; max-width: 520px; }
.opt { position: relative; min-height: 62px; padding: 12px 16px 12px 44px; border-radius: 18px; border: 2.5px solid var(--edge); background: var(--card); box-shadow: 0 5px 0 var(--edge); font-weight: 800; font-size: 19px; text-align: center; transition: transform .08s, box-shadow .08s, background .12s; color: var(--ink); }
.opts.wide .opt { font-size: 17px; text-align: left; }
.opts.jpopts .opt { font-size: 30px; min-height: 76px; }
.opt .key { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); color: var(--muted); font-size: 12px; display: grid; place-items: center; font-weight: 800; }
.opt:hover:not(:disabled) { background: var(--soft); }
.opt:active:not(:disabled), .opt.sel { transform: translateY(3px); box-shadow: 0 2px 0 var(--edge); }
.opt.sel { background: var(--pri-2); }
.opt.ok { background: var(--ok); color: #123524; }
.opt.no { background: var(--bad); color: #3f1010; animation: shake .35s; }
.opt:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.shake { animation: shake .3s; }
.type-in { max-width: 420px; text-align: center; font-size: 26px; font-weight: 800; padding: 14px; border-radius: 18px; box-shadow: 0 5px 0 var(--edge); }
.type-in.ok { background: var(--ok-bg); border-color: var(--ok); }
.type-in.no { background: var(--bad-bg); border-color: var(--bad); }
.b-line { min-height: 74px; width: 100%; max-width: 620px; border-bottom: 3px dashed var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 8px 0 12px; }
.b-line.ok .tile { background: var(--ok); color: #123524; }
.b-line.no .tile { background: var(--bad); color: #3f1010; }
.b-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 620px; }
.tile { display: inline-flex; flex-direction: column; align-items: center; min-width: 52px; padding: 7px 13px; border-radius: 15px; border: 2.5px solid var(--edge); background: var(--card); box-shadow: 0 4px 0 var(--edge); color: var(--ink); }
.tile .jp { font-size: 25px; line-height: 1.3; }
.tile small { font-size: 11px; color: var(--muted); font-weight: 700; }
.tile.used { opacity: .25; box-shadow: none; transform: translateY(4px); cursor: default; }
.tile.on { background: var(--pri-2); }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; max-width: 560px; }
.m-col { display: flex; flex-direction: column; gap: 12px; }
.opt.m { padding: 10px 14px; min-height: 64px; font-size: 16px; display: grid; place-items: center; }
.opt.m .jp { font-size: 28px; }
.opt.m.ok { opacity: .45; box-shadow: none; transform: translateY(5px); }
.l-tip, .mn { display: flex; align-items: flex-start; gap: 12px; }
.l-tip { align-items: center; }
.tip-text { line-height: 1.65; }
.tip-text .jp { font-size: 1.2em; color: var(--ink); background: var(--pri-2); padding: 0 6px; border-radius: 8px; }
[data-theme="night"] .tip-text .jp, [data-theme="yokai"] .tip-text .jp { background: var(--pri-2); }
.l-intro { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.i-card { position: relative; text-align: center; }
.l-intro .i-card { min-width: 280px; max-width: 100%; padding: 30px 62px 22px; }
.l-intro .say { position: absolute; right: 12px; top: 12px; }
.i-read { font-size: 34px; font-weight: 900; color: var(--pri); letter-spacing: .04em; }
.i-mean { font-size: 22px; font-weight: 800; margin-top: 4px; }
.i-readings { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 8px; font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif; font-weight: 600; }
.i-readings b { font-family: inherit; font-size: 11px; background: var(--soft); border: 2px solid var(--line); border-radius: 7px; padding: 1px 6px; margin-right: 4px; color: var(--muted); }
.i-ex { margin-top: 10px; padding-top: 10px; border-top: 2px dashed var(--line); font-weight: 600; }
.i-ex .jp { font-size: 22px; }
.i-ex .rd { color: var(--muted); font-size: 14px; }
.i-frame { max-width: min(420px, 100%); max-height: 220px; border-radius: 18px; border: 2.5px solid var(--edge); box-shadow: 0 5px 0 var(--edge); object-fit: cover; }
.mn { max-width: 560px; width: 100%; }
.mn .bubble { flex: 1; }
.mynote { margin-top: 8px; padding-top: 8px; border-top: 2px dashed var(--line); color: var(--muted); }
.l-result { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 0 40px; width: 100%; }
.res-cat { animation: bob 2s ease-in-out infinite; }
.res-sub { color: var(--muted); font-weight: 700; }
.res-stats { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.stat { min-width: 104px; padding: 12px 14px; border-radius: 20px; border: 2.5px solid var(--edge); box-shadow: 0 5px 0 var(--edge); background: var(--card); }
.stat b { display: block; font-size: 28px; font-weight: 900; line-height: 1.1; }
.stat span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat.a { background: var(--acc); color: #3b2a3f; } .stat.a span { color: #6b5a3a; }
.stat.d { background: var(--pri-2); }
.res-lines { display: flex; flex-direction: column; gap: 6px; font-weight: 700; background: var(--card); border: 2.5px dashed var(--line); border-radius: 18px; padding: 12px 20px; }
.res-wrong { max-width: 560px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.res-wrong .kicker { width: 100%; }

/* ---------- повторение ---------- */
.rev-main { display: flex; gap: 18px; align-items: center; }
.rev-main > div:last-child { display: flex; flex-direction: column; gap: 12px; }
.box-row { display: grid; grid-template-columns: 96px 1fr 34px; gap: 10px; align-items: center; font-weight: 700; font-size: 14px; padding: 4px 0; }
.box-row b { text-align: right; }
.boxes { margin-bottom: 10px; }

/* ---------- справочник ---------- */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 5px; border: 2px solid var(--edge); vertical-align: -2px; margin-right: 5px; }
.lv0 { background: var(--card); } .lv1 { background: var(--pri-2); } .lv2 { background: var(--pri); } .lv3 { background: var(--acc); }
.dict { display: flex; flex-direction: column; gap: 18px; }
.dict-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.dict-cols > div:last-child { display: flex; flex-direction: column; gap: 18px; padding: 0; background: none; border: 0; box-shadow: none; }
.kgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.kgrid.y { grid-template-columns: repeat(4, 1fr); }
.kcell, .wcell { border: 2.5px solid var(--edge); border-radius: 14px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 3px 0 var(--edge); color: var(--ink); transition: transform .08s; }
.kcell.lv2, .wcell.lv2 { color: var(--pri-ink); } .kcell.lv3, .wcell.lv3 { color: #3b2a3f; }
.kcell:hover, .wcell:hover { transform: translateY(-2px); }
.kcell .jp { font-size: 25px; line-height: 1.25; }
.kcell small, .wcell small { font-size: 11px; font-weight: 700; opacity: .7; }
.kcell.empty { border: 0; box-shadow: none; background: none; }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.wgrid.gram { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.wcell { padding: 10px 8px; text-align: center; }
.wcell .jp { font-size: 20px; line-height: 1.3; }
.wgrid.kanji .wcell .jp { font-size: 34px; }
.wcell small { line-height: 1.25; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.icard { display: flex; flex-direction: column; gap: 14px; }
.icard-top { display: flex; align-items: center; justify-content: center; gap: 16px; background: var(--soft); border: 2.5px solid var(--edge); border-radius: 20px; padding: 18px; }
.icard-btns { display: flex; flex-direction: column; gap: 8px; }
.icard .field { margin: 0; }
.trace canvas { width: 100%; max-width: 280px; aspect-ratio: 1; display: block; margin: 0 auto 12px; background: var(--card); border: 2.5px solid var(--edge); border-radius: 20px; touch-action: none; cursor: crosshair; }
.trace .row { justify-content: center; }

/* ---------- профиль ---------- */
.me { display: flex; flex-direction: column; gap: 20px; max-width: 900px; }
.me-head { display: flex; gap: 20px; align-items: center; background: linear-gradient(135deg, var(--card) 50%, var(--pri-2)); }
.me-info { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.name-in { font-size: 26px; font-weight: 900; padding: 4px 10px; border-color: transparent; background: transparent; max-width: 340px; }
.name-in:hover { border-color: var(--line); }
.name-in:focus { border-color: var(--edge); background: var(--card); }
.rank { font-weight: 800; }
.rank .jp { background: var(--acc); color: #3b2a3f; padding: 1px 9px; border-radius: 9px; border: 2px solid var(--edge); margin-right: 4px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-c { padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat-c .ic { color: var(--pri); }
.stat-c b { font-size: 26px; font-weight: 900; line-height: 1.1; }
.stat-c span { font-size: 13px; color: var(--muted); font-weight: 700; }
.cal { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; max-width: 520px; }
.cal i { aspect-ratio: 1; border-radius: 6px; background: var(--soft); border: 1.5px solid var(--line); }
.cal i.l1 { background: var(--pri-2); border-color: var(--pri); } .cal i.l2 { background: var(--pri); border-color: var(--edge); } .cal i.l3 { background: var(--acc); border-color: var(--edge); }
.cal i.fut { opacity: .3; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ach { border: 2.5px dashed var(--line); border-radius: 18px; padding: 12px; text-align: center; display: flex; flex-direction: column; gap: 2px; opacity: .55; filter: grayscale(1); }
.ach.on { border-style: solid; border-color: var(--edge); background: var(--soft); opacity: 1; filter: none; box-shadow: 0 4px 0 var(--edge); }
.ach-i { font-size: 30px; line-height: 1.2; font-family: "Apple Color Emoji", "Hiragino Maru Gothic ProN", sans-serif; font-weight: 700; }
.ach b { font-size: 14px; }
.ach small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.shop-i { border: 2.5px solid var(--edge); border-radius: 20px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: var(--soft); }
.shop-i.on { background: var(--pri-2); box-shadow: 0 4px 0 var(--edge); }
.shop-i b { font-size: 14px; }
.shop-i small { line-height: 1.3; }
.freeze { width: 84px; height: 84px; display: grid; place-items: center; color: #4dabf7; }
.freeze .ic { width: 50px; height: 50px; fill: #d0ebff; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; margin-bottom: 16px; }
.theme { border: 2.5px solid var(--edge); border-radius: 18px; padding: 10px; background: var(--card); display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 4px 0 var(--edge); color: var(--ink); }
.theme.on { background: var(--pri); color: var(--pri-ink); transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.theme .sw { width: 100%; height: 44px; border-radius: 11px; border: 2px solid var(--edge); display: flex; align-items: flex-end; justify-content: center; gap: 6px; padding: 6px; }
.theme .sw i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .35); }
.theme b { font-size: 14px; } .theme .jp { font-size: 13px; opacity: .7; }
.sets { display: flex; flex-direction: column; margin-bottom: 14px; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 2px dashed var(--line); }
.set b { display: block; } .set small { color: var(--muted); font-size: 13px; }
.set select, .set input[type=time] { width: auto; padding: 8px 12px; font-size: 15px; }
.sw-in { appearance: none; -webkit-appearance: none; width: 54px; height: 30px; border-radius: 99px; border: 2.5px solid var(--edge); background: var(--soft); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.sw-in::after { content: ""; position: absolute; left: 3px; top: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--edge); transition: transform .15s; }
.sw-in:checked { background: var(--pri); }
.sw-in:checked::after { transform: translateX(24px); }
.sw-in:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- знакомство ---------- */
.ob { max-width: 640px; margin: 0 auto; min-height: 100%; padding: 26px 20px 30px; display: flex; flex-direction: column; gap: 22px; }
.ob-dots { display: flex; gap: 8px; justify-content: center; }
.ob-dots i { width: 34px; height: 10px; border-radius: 9px; border: 2px solid var(--edge); background: var(--card); }
.ob-dots i.on { background: var(--pri); } .ob-dots i.done { background: var(--acc); }
.ob-page { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; animation: slide .3s; }
.ob-page h1 .jp { color: var(--pri); font-size: 40px; }
.ob-cat { animation: bob 2.6s ease-in-out infinite; }
.lead { font-size: 18px; font-weight: 600; max-width: 520px; }
.ob .field { width: 100%; max-width: 340px; text-align: left; }
.ob .name-in { border-color: var(--edge); background: var(--card); text-align: center; max-width: none; box-shadow: 0 4px 0 var(--edge); }
.ob .chips { justify-content: center; }
.ob .themes { width: 100%; }
.ob .col { width: 100%; max-width: 420px; }
.goals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 460px; }
.goal-b { border: 2.5px solid var(--edge); border-radius: 20px; background: var(--card); box-shadow: 0 5px 0 var(--edge); padding: 14px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.goal-b b { font-size: 18px; } .goal-b span { font-weight: 700; } .goal-b small { color: var(--muted); font-weight: 700; }
.goal-b.on { background: var(--pri); color: var(--pri-ink); transform: translateY(3px); box-shadow: 0 2px 0 var(--edge); }
.goal-b.on small { color: inherit; opacity: .7; }

/* ---------- аниме-зал ---------- */
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.an-card { position: relative; display: flex; flex-direction: column; gap: 3px; min-height: 196px; padding: 16px; border-radius: 24px; border: 2.5px solid var(--edge); box-shadow: 0 6px 0 var(--edge); color: #fff; background: linear-gradient(150deg, var(--c1), var(--c2)); overflow: hidden; transition: transform .12s, box-shadow .12s; }
.an-card:hover { transform: translateY(-3px) rotate(-.6deg); box-shadow: 0 9px 0 var(--edge); }
.an-card::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .22) 1.6px, transparent 1.8px); background-size: 12px 12px; mask-image: linear-gradient(120deg, transparent 40%, #000); -webkit-mask-image: linear-gradient(120deg, transparent 40%, #000); }
.an-card > * { position: relative; }
.an-glyph { font-size: 70px; line-height: 1; font-weight: 800; text-shadow: 3px 4px 0 rgba(0, 0, 0, .28); margin-bottom: auto; }
.an-card b { font-size: 18px; font-weight: 900; line-height: 1.2; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.an-jp { font-size: 13px; opacity: .92; }
.an-card small { font-size: 12px; font-weight: 800; opacity: .9; }
.an-prog { height: 8px; border-radius: 9px; background: rgba(0, 0, 0, .28); overflow: hidden; margin-top: 6px; }
.an-prog i { display: block; height: 100%; background: #fff; border-radius: 9px; }
.an-fav { position: absolute !important; right: 14px; top: 10px; font-style: normal; font-size: 22px; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.an-card.my { background: var(--card); color: var(--ink); border-style: dashed; }
.an-card.my::before { display: none; }
.an-card.my .an-glyph { color: var(--pri); text-shadow: none; }
.an-card.my b { text-shadow: none; }
.an-hero { display: flex; gap: 22px; align-items: center; padding: 24px; border-radius: 26px; border: 2.5px solid var(--edge); box-shadow: 0 6px 0 var(--edge); background: linear-gradient(140deg, var(--c1), var(--c2)); color: #fff; margin-bottom: 20px; }
.an-hero .an-glyph { font-size: 120px; margin: 0; }
.an-hero > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.an-hero h1, .an-hero p { text-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.an-hero p { font-weight: 600; max-width: 600px; }
.an-title { display: flex; align-items: center; gap: 12px; font-size: 26px; }
.an-title rt { color: rgba(255, 255, 255, .85); }
.an-title .iconbtn { color: var(--ink); width: 38px; height: 38px; }
.an-hero.my { background: var(--card); color: var(--ink); }
.an-hero.my h1, .an-hero.my p { text-shadow: none; }
.an-hero.my .an-glyph { color: var(--pri); text-shadow: none; }
.ph-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.ph { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ph-img { width: 100%; max-height: 190px; object-fit: cover; border-bottom: 2.5px solid var(--edge); }
.ph-main { position: relative; padding: 18px 64px 12px 20px; flex: 1; }
.ph-main .say { position: absolute; right: 14px; top: 14px; }
.ph-ru { font-weight: 800; font-size: 17px; margin-top: 4px; }
.ph-note { color: var(--muted); font-size: 14px; margin-top: 6px; font-weight: 600; }
.ph-note.mine { color: var(--ink); }
.ph-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; background: var(--soft); border-top: 2px dashed var(--line); }
.scene-form .thumb { height: 54px; border-radius: 10px; border: 2px solid var(--edge); }
.scene-form .i-card, .scene-play .i-card { background: var(--soft); border: 2.5px solid var(--edge); border-radius: 18px; padding: 14px; margin: 10px 0; }
.player { aspect-ratio: 16 / 9; width: 100%; border-radius: 18px; overflow: hidden; border: 2.5px solid var(--edge); background: #000; }
.player iframe, .player video { width: 100%; height: 100%; border: 0; display: block; }
.scene-play { display: flex; flex-direction: column; gap: 8px; }

/* ---------- игры ---------- */
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.g-card { text-align: left; display: flex; flex-direction: column; gap: 8px; color: var(--ink); transition: transform .12s, box-shadow .12s; }
.g-card:hover { transform: translateY(-3px) rotate(.5deg); box-shadow: 0 8px 0 var(--edge); }
.g-ic { width: 70px; height: 66px; border-radius: 22px; background: var(--gc); border: 2.5px solid var(--edge); box-shadow: 0 4px 0 var(--edge); display: grid; place-items: center; font-size: 34px; }
.g-t { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.g-t b { font-size: 20px; font-weight: 900; } .g-t .jp { color: var(--pri); font-size: 14px; }
.g-card p { color: var(--muted); font-weight: 600; font-size: 15px; flex: 1; }
.g-best { font-weight: 800; font-size: 13px; color: var(--muted); }
.game { padding-bottom: 18px; height: 100%; }
.g-name { font-size: 18px; font-weight: 900; }
.g-hud { margin-left: auto; display: flex; gap: 8px; }
.g-hud .pill.hearts { color: var(--bad); letter-spacing: 2px; }
.g-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-top: 16px; min-height: 0; }
.g-menu { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.g-menu .col { width: 100%; max-width: 400px; }
.rain { position: relative; flex: 1; min-height: 340px; border: 2.5px solid var(--edge); border-radius: 26px; background: linear-gradient(var(--card), var(--soft)); overflow: hidden; box-shadow: 0 5px 0 var(--edge); }
.rain-sky { position: absolute; inset: 0; }
.rain-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: repeating-linear-gradient(90deg, var(--pri), var(--pri) 14px, var(--pri-2) 14px, var(--pri-2) 28px); border-top: 2.5px solid var(--edge); }
.drop { position: absolute; top: 0; width: 60px; height: 54px; margin-left: -30px; border-radius: 18px; border: 2.5px solid var(--edge); background: var(--card); box-shadow: 0 4px 0 var(--edge); display: grid; place-items: center; font-size: 27px; will-change: transform; }
.drop.pop { background: var(--ok); scale: 1.3; opacity: 0; transition: scale .25s, opacity .25s; }
.drop.miss { background: var(--bad); color: #3f1010; font-size: 20px; line-height: 1; grid-auto-flow: row; }
.drop.miss small { font: 800 12px/1 inherit; font-family: inherit; }
.rain-in { display: flex; justify-content: center; padding: 16px 0 4px; }
.mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; }
.mem-c { aspect-ratio: 1; border-radius: 20px; border: 2.5px solid var(--edge); background: var(--pri); box-shadow: 0 5px 0 var(--edge); position: relative; color: var(--pri-ink); padding: 6px; overflow: hidden; }
.mem-f, .mem-b { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .15s, transform .25s; padding: 6px; }
.mem-f .ic { width: 40%; height: 40%; opacity: .55; }
.mem-b { opacity: 0; transform: rotateY(90deg); font-weight: 800; font-size: 14px; line-height: 1.2; color: var(--ink); text-align: center; overflow-wrap: anywhere; }
.mem-b.jp { font-size: 26px; }
.mem-b.short { font-size: 24px; font-weight: 900; }
.mem-c.on, .mem-c.ok { background: var(--card); }
.mem-c.on .mem-f, .mem-c.ok .mem-f { opacity: 0; }
.mem-c.on .mem-b, .mem-c.ok .mem-b { opacity: 1; transform: none; }
.mem-c.ok { background: var(--ok-bg); border-color: var(--ok); box-shadow: 0 2px 0 var(--ok); transform: translateY(3px); }
.quiz, .blitz { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.q-timer { width: 100%; max-width: 560px; height: 12px; border-radius: 99px; border: 2.5px solid var(--edge); background: var(--card); overflow: hidden; }
.q-timer i { display: block; height: 100%; width: 100%; background: var(--acc); transition: width .1s linear; }
.q-after { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 560px; min-height: 60px; }
.blitz .q-card { min-width: min(420px, 100%); min-height: 210px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.bz-eq { color: var(--muted); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.bz-ru { font-size: 24px; font-weight: 900; }
.bz-msg { min-height: 30px; font-weight: 800; }
.bz-msg .miss { color: var(--bad); } .bz-msg .jp { font-size: 20px; }

/* ---------- планшет и телефон ---------- */
@media (max-width: 1100px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .home-side { grid-column: 1; grid-row: auto; position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
  .grid2, .dict-cols { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  #app { grid-template-columns: 1fr; }
  #side { display: none; }
  #main { padding: 18px 14px 110px; }
  #tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 2.5px solid var(--edge); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  #tabbar a { flex: 1; flex-direction: column; gap: 1px; padding: 6px 2px; font-size: 10.5px; border: 0; border-radius: 14px; text-align: center; min-width: 0; }
  #tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  #tabbar a.on { background: var(--pri); color: var(--pri-ink); }
  #tabbar .dot { position: absolute; top: 0; right: 14%; min-width: 20px; height: 20px; font-size: 10px; margin: 0; }
  #toasts { bottom: 92px; }
  h1 { font-size: 25px; }
  .hello { flex-direction: column; text-align: center; }
  .hello .row { justify-content: center; }
  .hello .btn.big { white-space: normal; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .me-head, .an-hero, .rev-main { flex-direction: column; text-align: center; }
  .an-hero .row, .rev-main .row { justify-content: center; }
  .an-title { justify-content: center; }
  .name-in { text-align: center; max-width: none; }
  .ph-list { grid-template-columns: 1fr; }
  .jp.xl { font-size: 84px; } .jp.lg { font-size: 46px; } .jp.md { font-size: 30px; } .jp.sm { font-size: 22px; }
  .q-ro { font-size: 46px; }
  .l-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .l-foot .btn { width: 100%; }
  .opts.jpopts .opt { font-size: 24px; }
  .opt { font-size: 17px; padding-left: 16px; }
  .opt .key { display: none; }
  .sec-head { flex-direction: column; align-items: stretch; }
  .node-wrap { transform: translateX(calc(var(--dx) * .72)); }
  .grid2f, .grid3f { grid-template-columns: 1fr; }
  .set { flex-wrap: wrap; }
  kbd { display: none; }
  .mem { gap: 8px; } .mem-b { font-size: 12px; } .mem-b.jp { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
