/* Raj in JP · minimal washi-paper website */
:root {
  --paper: #fbf6f3;
  --paper-2: #f7ebe9;
  --card: #fffcfb;
  --ink: #2a2124;
  --muted: #7a6a6e;
  --line: #efdcdc;
  --shu: #cf5476;          /* sakura pink (deep) */
  --shu-soft: rgba(207, 84, 118, .09);
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px rgba(60, 40, 20, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171214; --paper-2: #1d1619; --card: #231b1e; --ink: #f1e6e9; --muted: #b29fa5; --line: #36292d;
    --shu: #f08aa6; --shu-soft: rgba(240, 138, 166, .12); --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #171214; --paper-2: #1d1619; --card: #231b1e; --ink: #f1e6e9; --muted: #b29fa5; --line: #36292d;
  --shu: #f08aa6; --shu-soft: rgba(240, 138, 166, .12); --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.7; overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.container { width: min(1120px, 100% - 40px); margin-inline: auto; }
.shu { color: var(--shu); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 15px;
  transition: border-color .2s, transform .2s, filter .2s; white-space: nowrap;
}
.btn:hover { border-color: var(--shu); transform: translateY(-1px); }
.btn.primary { background: var(--shu); border-color: var(--shu); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #2a1219; }
.btn svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.sm { padding: 7px 16px; font-size: 14px; }
.more { display: inline-block; margin-top: 18px; font-weight: 700; color: var(--shu); }
.more:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid transparent; transition: background .3s, border-color .3s; }
.nav.scrolled { background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-color: var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: "Shippori Mincho", serif; font-weight: 700; font-size: 20px; }
.mini-seal { font-family: "Shippori Mincho", serif; font-weight: 700; font-size: 11px; color: #fff; background: var(--shu); padding: 3px 5px; border-radius: 3px; letter-spacing: .08em; }
.menu { display: flex; gap: 32px; font-size: 15px; color: var(--muted); }
.menu a { position: relative; transition: color .2s; }
.menu a:hover { color: var(--ink); }
.menu a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1.5px; background: var(--shu); transform: scaleX(0); transition: transform .25s; }
.menu a:hover::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-size: 15px; }
.theme:hover { border-color: var(--shu); }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: inline; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding: 72px 0 88px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.kicker { display: flex; align-items: center; gap: 12px; font-size: 14px; letter-spacing: .3em; color: var(--shu); margin-bottom: 18px; }
.kicker .line { width: 36px; height: 1.5px; background: var(--shu); }
h1 { font-family: "Shippori Mincho", serif; font-weight: 700; font-size: clamp(40px, 5.6vw, 68px); line-height: 1.12; letter-spacing: .01em; }
.lead { margin-top: 22px; font-size: 18px; color: var(--muted); max-width: 540px; }
.lead b { color: var(--ink); }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 34px; margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--line); }
.stats dt { font-family: "Shippori Mincho", serif; font-weight: 700; font-size: 26px; line-height: 1.1; }
.stats dd { font-size: 13px; color: var(--muted); }
.hero-art { position: relative; width: min(380px, 100%); aspect-ratio: 1; justify-self: center; display: grid; place-items: center; }
.enso { position: absolute; inset: -6%; width: 112%; height: 112%; overflow: visible; }
.enso path { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; opacity: .8;
  stroke-dasharray: 560; stroke-dashoffset: 560; animation: draw 1.8s cubic-bezier(.6,.1,.3,1) .2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero-art .avatar { width: 84%; height: 84%; border-radius: 50%; box-shadow: var(--shadow); opacity: 0; animation: fade 1s ease .5s forwards; }
.hero-art .seal { position: absolute; right: 6%; bottom: 8%; }
.seal {
  font-family: "Shippori Mincho", serif; font-weight: 700; font-size: 14px; line-height: 1.15; color: #fff; background: var(--shu);
  border-radius: 4px; padding: 7px 7px; writing-mode: vertical-rl; transform: rotate(-5deg) scale(0);
  animation: stamp .45s cubic-bezier(.3,1.6,.5,1) 1.4s forwards;
}
@keyframes stamp { to { transform: rotate(-5deg) scale(1); } }
@keyframes fade { to { opacity: 1; } }
.vertical { position: absolute; right: max(16px, calc(50% - 640px)); top: 80px; writing-mode: vertical-rl; font-family: "Shippori Mincho", serif; letter-spacing: .5em; color: var(--muted); opacity: .45; font-size: 15px; }

/* ---------- links strip ---------- */
.strip { border-block: 1px solid var(--line); background: var(--paper-2); }
.links { display: grid; grid-template-columns: repeat(4, 1fr); }
.links a { padding: 22px 24px; border-right: 1px solid var(--line); transition: background .2s; position: relative; }
.links a:first-child { border-left: 1px solid var(--line); }
.links a::after { content: "›"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 20px; transition: transform .2s, color .2s; }
.links a:hover { background: var(--card); }
.links a:hover::after { color: var(--shu); transform: translate(4px, -50%); }
.links b { display: block; font-size: 16px; }
.links small { color: var(--muted); font-size: 13px; }

/* ---------- blocks ---------- */
.block { padding: 96px 0; }
.block.alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.head { margin-bottom: 38px; max-width: 640px; }
.label { display: inline-block; font-size: 12px; font-weight: 700; color: var(--shu); border: 1px solid var(--shu); border-radius: 3px; padding: 1px 7px; letter-spacing: .12em; margin-bottom: 10px; }
h2 { font-family: "Shippori Mincho", serif; font-weight: 700; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.2; }
.head p { color: var(--muted); margin-top: 8px; font-size: 16.5px; }

/* reels (Instagram embeds) */
.reels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.reels .instagram-media { min-width: 0 !important; width: 100% !important; max-width: 100% !important; margin: 0 !important; border-radius: 14px !important; border: 1px solid var(--line) !important; box-shadow: var(--shadow) !important; background: var(--card) !important; }
.reels blockquote.instagram-media { padding: 0 !important; overflow: hidden; }
.reel-fallback { display: block; position: relative; }
.reel-fallback img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }
.reel-fallback .cap { position: absolute; left: 0; right: 0; bottom: 44px; padding: 40px 16px 6px; color: #fff; font-weight: 700; font-size: 15px; line-height: 1.4; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.reel-fallback .play { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 16px 14px; color: #fff; font-weight: 700; font-size: 13.5px; background: rgba(0,0,0,.65); }
.reels iframe.instagram-media { min-height: 560px; }

/* YouTube */
.yt { display: grid; grid-template-columns: repeat(2, minmax(0, 300px)) 1fr; gap: 24px; align-items: center; }
.yt-frame { position: relative; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #000; box-shadow: var(--shadow); }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-side { padding-left: 16px; }
.yt-side h3 { font-family: "Shippori Mincho", serif; font-size: 26px; margin-bottom: 8px; }
.yt-side p { color: var(--muted); margin-bottom: 22px; }
.yt-side .more { display: block; }

/* free sheets */
.sheets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.sheet { position: relative; display: flex; flex-direction: column; padding: 30px 28px 26px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: border-color .2s, transform .2s; overflow: hidden; }
.sheet:hover { border-color: var(--shu); transform: translateY(-3px); }
.sheet .big { font-family: "Shippori Mincho", serif; font-weight: 700; font-size: 64px; line-height: 1; color: var(--shu); margin-bottom: 18px; }
.sheet b { font-size: 19px; }
.sheet small { color: var(--muted); font-size: 14px; margin-top: 4px; flex: 1; }
.sheet .dl { margin-top: 20px; font-weight: 700; font-size: 14px; color: var(--shu); }
.sheet::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; border: 1px solid var(--line); }

/* about */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 64px; align-items: center; }
.about p { color: var(--muted); margin-top: 14px; font-size: 16.5px; max-width: 600px; }
.about .motto { font-family: "Shippori Mincho", serif; font-size: 22px; color: var(--ink); }
.about .motto span { font-family: "Zen Kaku Gothic New", sans-serif; font-size: 14px; color: var(--muted); margin-left: 8px; }
.about .collab a { color: var(--shu); font-weight: 700; }
.facts { list-style: none; display: grid; gap: 12px; }
.facts li { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.facts b { font-size: 22px; }

/* footer */
footer { padding: 56px 0 44px; text-align: center; }
.foot { display: grid; justify-items: center; gap: 10px; }
footer .seal { writing-mode: horizontal-tb; animation: none; transform: rotate(-5deg); text-align: center; }
.jp-line { font-family: "Shippori Mincho", serif; font-size: 17px; letter-spacing: .35em; margin-top: 6px; }
footer nav { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; font-size: 14px; color: var(--muted); }
footer nav a:hover { color: var(--shu); }
footer small { color: var(--muted); font-size: 12px; opacity: .8; }

/* reveal */
.block, .strip, footer { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.block.in, .strip.in, footer.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .menu { display: none; }
  .hero { padding: 40px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { width: min(260px, 70%); grid-row: 1; }
  .hero-text { text-align: center; }
  .kicker { justify-content: center; }
  .lead { margin-inline: auto; }
  .cta { justify-content: center; }
  .stats { grid-template-columns: repeat(2, 1fr); justify-content: stretch; gap: 22px; text-align: center; }
  .vertical { display: none; }
  .links { grid-template-columns: repeat(2, 1fr); }
  .links a:nth-child(3) { border-left: 1px solid var(--line); }
  .links a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .reels { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; }
  .yt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yt-side { grid-column: 1 / -1; padding: 8px 0 0; text-align: center; }
  .sheets { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .block { padding: 72px 0; }
}
@media (max-width: 520px) {
  .container { width: calc(100% - 32px); }
  .links { grid-template-columns: 1fr; }
  .links a, .links a:first-child, .links a:nth-child(3) { border-left: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .links a:last-child { border-bottom: 0; }
  .yt { gap: 12px; }
  .lead { font-size: 16.5px; }
  .brand { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .enso path { animation: none; stroke-dashoffset: 0; }
  .hero-art .avatar { animation: none; opacity: 1; }
  .seal { animation: none; transform: rotate(-5deg); }
  .block, .strip, footer { opacity: 1; transform: none; transition: none; }
}

/* ---------- sakura petals ---------- */
#sakura { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 40; }

/* ---------- brand logos ---------- */
.links a { display: flex; align-items: center; gap: 14px; padding-right: 44px; }
.logo { flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; }
.logo svg { width: 22px; height: 22px; fill: #fff; }
.logo.l-yt { background: #ff0033; }
.logo.l-ig { background: radial-gradient(circle at 30% 110%, #ffd776 0%, #f9774c 28%, #d6249f 58%, #6a3cf0 100%); }
.logo.l-bc { background: linear-gradient(135deg, #8b5cf6, #c084fc); }
.logo.l-an { background: linear-gradient(135deg, #e0577d, #f59fb6); }
footer nav a { display: inline-flex; align-items: center; gap: 6px; }
footer nav svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- 4 study sheets ---------- */
.sheets { grid-template-columns: repeat(4, 1fr); gap: 20px; }
.sheet { padding: 26px 22px 22px; }
.sheet .big { font-size: 54px; display: flex; align-items: baseline; gap: 8px; }
.sheet .big i { font-style: normal; font-size: 16px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
@media (max-width: 1080px) { .sheets { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .sheets { grid-template-columns: 1fr; } }

/* ---------- kanji practice ---------- */
.kp { max-width: 760px; }
.kp-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.kp-levels { display: inline-flex; gap: 8px; }
.kp-levels button {
  display: grid; justify-items: center; min-width: 64px; padding: 8px 12px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; font-size: 16px; line-height: 1.2;
}
.kp-levels button small { font-size: 11px; font-weight: 500; color: var(--muted); }
.kp-levels button:hover { border-color: var(--shu); }
.kp-levels button[aria-pressed="true"] { background: var(--shu); border-color: var(--shu); color: #fff; }
.kp-levels button[aria-pressed="true"] small { color: rgba(255,255,255,.85); }
.kp-modes { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); }
.kp-modes button { border: 0; background: none; font: inherit; font-size: 14.5px; font-weight: 700; padding: 8px 16px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.kp-modes button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
:root[data-theme="dark"] .kp-levels button[aria-pressed="true"] { color: #2a1219; }

/* flashcard (3D flip) */
.kp-cards { display: grid; justify-items: center; gap: 16px; }
.fc-scene { width: min(420px, 100%); aspect-ratio: 4 / 3.4; perspective: 1200px; }
.fc { position: relative; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit;
  transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3,.7,.3,1); }
.fc.flipped { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; padding: 24px; border-radius: 22px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); backface-visibility: hidden; -webkit-backface-visibility: hidden; text-align: center; }
.fc-front { background: linear-gradient(160deg, var(--card), var(--shu-soft)); }
.fc-back { transform: rotateY(180deg); }
.fc-lv { position: absolute; top: 16px; left: 16px; }
.fc-k { font-family: "Shippori Mincho", serif; font-weight: 700; font-size: clamp(110px, 24vw, 150px); line-height: 1; }
.fc-hint { position: absolute; bottom: 14px; font-size: 12.5px; color: var(--muted); }
.fc-k-small { font-family: "Shippori Mincho", serif; font-weight: 700; font-size: 44px; line-height: 1; color: var(--shu); }
.fc-m { font-family: "Shippori Mincho", serif; font-weight: 700; font-size: 26px; line-height: 1.25; }
.fc-read { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: 17px; color: var(--shu); }
.fc-read small { font-size: 11px; color: var(--muted); margin-right: 6px; font-family: "Zen Kaku Gothic New", sans-serif; }
.fc-ex { font-size: 14px; color: var(--muted); max-width: 320px; }
.fc-ex b { font-family: "Shippori Mincho", serif; color: var(--ink); font-size: 17px; }
.fc-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.fc-controls .btn { cursor: pointer; font-family: inherit; color: var(--ink); }
.fc-count { min-width: 80px; text-align: center; font-weight: 700; color: var(--muted); font-size: 14px; }
.fc-learn { cursor: pointer; font-family: inherit; }

/* kanji quiz */
.kq { border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 22px; text-align: center; }
.kq[hidden], .kp-cards[hidden], .kq-after[hidden] { display: none; }
.kq-ask { font-weight: 700; color: var(--muted); font-size: 14px; }
.kq-k { font-family: "Shippori Mincho", serif; font-weight: 700; font-size: 120px; line-height: 1.15; }
.kq-k.pop { animation: qpop .35s cubic-bezier(.3,1.5,.5,1); }
.kq-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.kq-opt { font-size: 16.5px; padding: 16px 10px; }
.kq-fb { min-height: 28px; margin-top: 14px; font-weight: 700; }
.kq-fb.ok { color: #3d9a52; } .kq-fb.no { color: var(--shu); }
.kq-fb span { font-weight: 500; color: var(--muted); }
.kq-after { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.kq-after .btn { cursor: pointer; font-family: inherit; }
.kq-after .btn:not(.primary) { color: var(--ink); }
.kq-stats { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.kq-stats b { color: var(--ink); }
.km-ex li.none { color: var(--muted); font-size: 14px; }

.lv { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; color: #fff; white-space: nowrap; }
.lv-n5 { background: #4c9a6a; } .lv-n4 { background: #3f86b5; } .lv-n3 { background: #c98a2e; }

/* kanji pop-up */
.kmodal {
  width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 30px 30px 24px; border: 1px solid var(--line);
  border-radius: 22px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(40, 10, 20, .25); overflow: auto;
}
.kmodal::backdrop { background: rgba(30, 15, 20, .45); backdrop-filter: blur(3px); }
.kmodal[open] { animation: kin .3s ease; }
@keyframes kin { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.km-close { position: absolute; top: 14px; right: 16px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.km-top { display: grid; grid-template-columns: 170px 1fr; gap: 24px; align-items: center; margin-bottom: 8px; }
.km-stroke { display: grid; gap: 8px; justify-items: center; }
.km-stroke svg { width: 170px; height: 170px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.km-stroke .grid { stroke: var(--line); stroke-width: .6; stroke-dasharray: 2 2; fill: none; }
.km-stroke .st { fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.km-replay { border: 0; background: none; color: var(--shu); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.km-badges { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.km-sc { font-size: 13px; color: var(--muted); }
.km-info h3 { font-family: "Shippori Mincho", serif; font-size: 26px; line-height: 1.25; padding-right: 30px; }
.km-k { font-size: 40px; }
.km-m { text-transform: capitalize; }
.km-read { display: grid; gap: 4px; margin-top: 10px; }
.km-read div { display: flex; gap: 10px; align-items: baseline; }
.km-read dt { font-size: 12px; color: var(--muted); min-width: 82px; }
.km-read dd { font-size: 17px; color: var(--shu); }
.kmodal h4 { font-family: "Shippori Mincho", serif; font-size: 16px; margin: 18px 0 6px; display: flex; align-items: center; gap: 10px; }
.kmodal h4::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.km-h { color: var(--ink); font-size: 15.5px; }
.km-p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.km-p span { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-size: 13px; color: var(--muted); }
.km-p span.whole { background: var(--shu-soft); border-color: transparent; }
.km-p b { font-family: "Shippori Mincho", serif; font-size: 22px; color: var(--ink); }
.km-p i { font-style: normal; color: var(--shu); font-weight: 700; }
.km-ex { list-style: none; display: grid; gap: 6px; }
.km-ex li { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--paper); }
.km-ex b { font-family: "Shippori Mincho", serif; font-size: 19px; }
.km-ex span { color: var(--shu); font-size: 14px; }
.km-ex em { font-style: normal; color: var(--muted); font-size: 14px; }
.km-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.km-reel[hidden], .km-h[hidden], .km-hh[hidden] { display: none; }
.km-stroke .fallback { fill: var(--ink); font-family: "Shippori Mincho", serif; }
.km-note { font-style: normal; color: var(--muted); font-size: 14px; }
.km-random { cursor: pointer; font-family: inherit; color: var(--ink); }
.km-credit { margin-top: 16px; font-size: 11px; color: var(--muted); opacity: .8; }

/* ---------- kana quiz ---------- */
.quiz { max-width: 640px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 22px; }
.q-top { display: grid; gap: 12px; }
.q-choose { font-size: 14px; font-weight: 700; color: var(--muted); }
.q-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.q-tabs button {
  display: grid; justify-items: center; gap: 2px; padding: 12px 8px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; font-weight: 700;
  transition: border-color .15s, background .15s, color .15s;
}
.q-tabs button span { font-family: "Shippori Mincho", serif; font-size: 24px; line-height: 1.2; color: var(--shu); }
.q-tabs button:hover { border-color: var(--shu); }
.q-tabs button[aria-pressed="true"] { background: var(--shu); border-color: var(--shu); color: #fff; }
.q-tabs button[aria-pressed="true"] span { color: #fff; }
:root[data-theme="dark"] .q-tabs button[aria-pressed="true"], :root[data-theme="dark"] .q-tabs button[aria-pressed="true"] span { color: #2a1219; }
.q-toggle { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.q-toggle input { accent-color: var(--shu); width: 18px; height: 18px; }
.q-stage { text-align: center; padding: 26px 0 8px; }
.q-char { font-family: "Shippori Mincho", serif; font-weight: 700; font-size: 120px; line-height: 1.1; min-height: 132px; }
.q-char.pop { animation: qpop .35s cubic-bezier(.3,1.5,.5,1); }
@keyframes qpop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.q-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.q-opt {
  position: relative; font: inherit; font-size: 20px; font-weight: 700; padding: 14px 6px; border-radius: 14px; cursor: pointer;
  background: var(--paper); color: var(--ink); border: 1.5px solid var(--line); transition: border-color .15s, transform .15s, background .15s;
}
.q-opt kbd { position: absolute; top: 5px; left: 8px; font: 11px/1 "Zen Kaku Gothic New", sans-serif; color: var(--muted); opacity: .7; }
.q-opt:hover:not(:disabled) { border-color: var(--shu); transform: translateY(-2px); }
.q-opt:disabled { cursor: default; }
.q-opt.right { background: #e3f4e6; border-color: #3d9a52; color: #1d6b31; }
.q-opt.wrong { background: #fbe4e7; border-color: #d0485f; color: #a12a3e; animation: shake .35s; }
:root[data-theme="dark"] .q-opt.right { background: #1d3424; color: #8fdca0; }
:root[data-theme="dark"] .q-opt.wrong { background: #3a1d23; color: #f19aab; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .q-opt.right { background: #1d3424; color: #8fdca0; }
  :root:not([data-theme="light"]) .q-opt.wrong { background: #3a1d23; color: #f19aab; }
}
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.q-feedback { min-height: 28px; margin-top: 14px; font-weight: 700; font-size: 15px; }
.q-feedback.ok { color: #3d9a52; }
.q-feedback.no { color: var(--shu); }
.q-feedback a { text-decoration: underline; text-underline-offset: 3px; }
.q-bottom { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.q-bottom b { color: var(--ink); }
.q-skip { margin-left: auto; border: 0; background: none; font: inherit; font-weight: 700; color: var(--shu); cursor: pointer; }

@media (max-width: 720px) {
  .kp-bar { flex-direction: column; align-items: stretch; }
  .kp-levels { display: grid; grid-template-columns: repeat(4, 1fr); }
  .kp-modes { display: grid; grid-template-columns: 1fr 1fr; }
  .kq-opts { grid-template-columns: 1fr; }
  .kq-k { font-size: 100px; }
  .km-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .km-badges, .km-read div { justify-content: center; }
  .km-info h3 { padding-right: 0; }
  .kmodal { padding: 26px 18px 20px; }
  .q-opts { grid-template-columns: repeat(2, 1fr); }
  .q-char { font-size: 104px; }
  .quiz { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { .kmodal[open], .q-char.pop, .kq-k.pop, .q-opt.wrong { animation: none; } .fc { transition: none; } }
