/* ことばの架け橋 — 鳥の子色 × 墨 × 藍 */
:root {
  --paper: #f3e7cf;
  --paper-hi: #fbf4e3;
  --paper-lo: #e6d5b2;
  --ink: #211d1a;
  --ink-2: #4a433c;
  --ai: #24476b;
  --ai-deep: #18324d;
  --asagi: #3f7d95;
  --gold: #b68a2c;
  --shu: #a8432f;
  --line: rgba(33, 29, 26, .16);
  --f-brush: "Yuji Syuku", "Shippori Mincho B1", serif;
  --f-tile: "Klee One", "Zen Kaku Gothic New", sans-serif;
  --f-ui: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  --f-num: "Shippori Mincho B1", "Yu Mincho", serif;
  --r-tile: 9px;
  --r-btn: 4px;
  --shadow-paper: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 2px 0 rgba(120, 96, 60, .28), 0 6px 14px -8px rgba(60, 40, 20, .35);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.3, 1.45, .5, 1);
  --sa-t: env(safe-area-inset-top, 0px);
  --sa-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
html { background: var(--ai-deep); }
body {
  font-family: var(--f-ui); color: var(--ink); line-break: strict; overflow: hidden;
  font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 50% 100%, transparent 18px, rgba(255, 255, 255, .06) 19px 21px, transparent 22px 28px, rgba(255, 255, 255, .05) 29px 31px, transparent 32px) 0 0 / 64px 32px,
    var(--ai-deep);
}
button, a { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { text-decoration: none; }
img { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; flex: none; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
h1, h2, h3, .kp { font-feature-settings: "palt"; word-break: keep-all; overflow-wrap: normal; }
p { word-break: normal; }

.app { position: relative; height: 100dvh; width: 100%; max-width: 430px; margin: 0 auto; overflow: hidden; background: var(--paper); isolation: isolate; }
.app::before { /* 和紙の繊維 */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background:
    radial-gradient(ellipse 40% 2px at 20% 30%, rgba(160, 130, 90, .14), transparent),
    radial-gradient(ellipse 30% 1.5px at 70% 60%, rgba(160, 130, 90, .12), transparent),
    radial-gradient(ellipse 25% 1.5px at 40% 85%, rgba(160, 130, 90, .12), transparent);
}
@media (min-width: 600px) { .app { box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 30px 80px rgba(0, 0, 0, .5); } }

/* ---------- 画面 ---------- */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; background: var(--paper); }
.screen.is-on { display: flex; }
.screen.is-enter { animation: enter .34s var(--ease-out); }
@keyframes enter { from { opacity: 0; transform: translateX(18px); } }
.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 16px calc(28px + var(--sa-b)); }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-btn); font-weight: 700; font-size: 15px;
  transition: transform .09s, box-shadow .09s, background .2s; user-select: none; word-break: keep-all;
}
.btn svg { width: 22px; height: 22px; }
.btn:active { transform: translateY(2px) scale(.985); }
.btn--ai { background: var(--ai); color: var(--paper-hi); box-shadow: 0 3px 0 var(--ai-deep), 0 10px 20px -10px rgba(24, 50, 77, .8); }
.btn--ai:active { box-shadow: 0 1px 0 var(--ai-deep); }
.btn--paper { background: var(--paper-hi); color: var(--ink); box-shadow: var(--shadow-paper); border: 1px solid var(--line); }
.btn--danger { background: var(--shu); color: #fff; box-shadow: 0 3px 0 #7a2e20; }
.btn--text { min-height: 44px; padding: 0 10px; color: var(--ai); font-weight: 700; }
.btn--l { min-height: 54px; width: 100%; font-size: 16px; }
.btn--xl { min-height: 62px; width: 100%; font-size: 18px; letter-spacing: .06em; }
.btn--sq { width: 52px; min-width: 52px; padding: 0; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); transition: transform .1s, background .2s; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { transform: scale(.9); background: rgba(33, 29, 26, .08); }
:focus-visible { outline: 2px solid var(--ai); outline-offset: 2px; }

/* ---------- タイトル ---------- */
.screen--title { background: var(--paper) url(/app-development/apps/a008/img/title.webp) center bottom / cover no-repeat; }
.title__bar { display: flex; justify-content: flex-end; padding: calc(6px + var(--sa-t)) 8px 0; }
.title__bar .icon-btn { background: rgba(251, 244, 227, .9); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.title__logo { position: relative; flex: 1; min-height: 0; padding: 0 24px; }
.logo {
  position: absolute; right: 30px; top: 0; writing-mode: vertical-rl; font-family: var(--f-brush); font-weight: 400;
  color: var(--ink); line-height: 1.05; letter-spacing: .04em; display: flex; gap: 6px;
}
.logo__a { font-size: 30px; padding-top: 6px; color: var(--ink); }
.logo__b { font-size: clamp(64px, 19vw, 84px); }
.seal {
  position: absolute; right: 116px; top: clamp(180px, 43vw, 220px); width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--shu); color: #fff6ea; font-family: var(--f-brush); font-size: 21px; border-radius: 4px; transform: rotate(-4deg);
  box-shadow: inset 0 0 0 2px rgba(255, 246, 234, .35);
}
.title__lead {
  position: absolute; left: 22px; top: 18px; width: 9.5em; font-family: var(--f-tile); font-weight: 600; font-size: 16px; line-height: 1.85; color: var(--ink);
  word-break: keep-all; background: rgba(243, 231, 207, .92); padding: 8px 12px; border-radius: 3px; border-left: 3px solid var(--ai);
}
.title__lead span { display: inline-block; }
.title__bottom { padding: 0 20px calc(22px + var(--sa-b)); display: grid; gap: 12px; }
.title__best {
  justify-self: center; display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 14px; border-radius: 99px;
  background: rgba(251, 244, 227, .95); font-size: 14px; color: var(--ink-2); box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}
.title__best b { font-size: 20px; color: var(--ink); }
.title__sub { display: flex; gap: 10px; }
.title__sub .btn { flex: 1; }
.title__sub .btn--sq { flex: none; }

/* ---------- プレイ ---------- */
.screen--play { background: var(--paper); user-select: none; -webkit-user-select: none; }
.hud { display: flex; align-items: center; gap: 8px; padding: calc(6px + var(--sa-t)) 6px 4px 14px; }
.hud__river { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.hud__k { font-family: var(--f-brush); font-size: 20px; color: var(--ink); white-space: nowrap; }
.hud__sun { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.hud__sun svg { width: 18px; height: 18px; color: var(--ai); }
.hud__sun b { font-size: 17px; color: var(--ink); min-width: 2.7em; }
.hud__sun.is-low svg, .hud__sun.is-low b { color: var(--shu); }
.hud__sun.is-low b { animation: beat 1s infinite; }
@keyframes beat { 0%, 100% { transform: none; } 12% { transform: scale(1.15); } }
.hud__score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; padding-right: 4px; }
.hud__score .hud__k { font-size: 14px; color: var(--ink-2); font-family: var(--f-ui); }
.hud__score b { font-size: 24px; }
.hud__btns { display: flex; }

.river { position: relative; margin: 2px 12px 0; height: clamp(150px, 27dvh, 240px); flex: none; border-radius: 6px; overflow: hidden; background: #efe2c6; box-shadow: 0 0 0 1px rgba(33, 29, 26, .22), 0 8px 18px -12px rgba(0, 0, 0, .45); }
.river__cv { display: block; width: 100%; height: 100%; }
.river__len {
  position: absolute; left: 8px; bottom: 8px; display: flex; align-items: baseline; gap: 2px; padding: 2px 10px; border-radius: 3px;
  background: rgba(251, 244, 227, .94); font-size: 14px; color: var(--ink-2);
}
.river__len b { font-size: 20px; color: var(--ai); }
.river__len .num:not(b) { font-size: 15px; color: var(--ink); }
.river__unit { margin-left: 2px; }
.river__warn {
  position: absolute; right: 8px; top: 8px; display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 3px;
  background: var(--ai); color: var(--paper-hi); font-size: 14px; font-weight: 700; word-break: keep-all;
  opacity: 0; transform: translateY(-6px); transition: .25s var(--ease-out); pointer-events: none;
}
.river__warn.is-on { opacity: 1; transform: none; animation: warn 0.8s infinite alternate; }
@keyframes warn { to { background: var(--ai-deep); } }
.river__warn svg { width: 18px; height: 18px; }
.banner {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); text-align: center; pointer-events: none;
  background: var(--paper-hi); padding: 8px 22px 10px; border-radius: 2px; box-shadow: 0 6px 20px -6px rgba(0, 0, 0, .4);
  border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); opacity: 0; min-width: 62%;
}
.banner.is-on { animation: banner var(--bd, 1.8s) var(--ease-out) forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -40%) scaleX(.6); } 14%, 80% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -56%); } }
.banner__k { font-family: var(--f-brush); font-size: 30px; line-height: 1.3; color: var(--ink); white-space: nowrap; }
.banner__t { font-size: 14px; font-weight: 700; color: var(--ai); word-break: keep-all; }

.preview { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 4px 18px; flex: none; }
.preview__word { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-family: var(--f-tile); font-weight: 600; }
.preview__k { font-size: 30px; letter-spacing: .12em; color: var(--ink); white-space: nowrap; }
.preview__k.is-ok { color: var(--ai); animation: ok .4s var(--ease-spring); }
@keyframes ok { from { transform: scale(1.25); } }
.preview__kanji { font-family: var(--f-brush); font-size: 22px; color: var(--ink-2); white-space: nowrap; }
.preview__hint { font-family: var(--f-ui); font-weight: 500; font-size: 15px; color: var(--ink-2); word-break: keep-all; }
.preview__word.is-bad .preview__k { color: var(--ink-2); text-decoration: line-through 2px var(--shu); animation: shake .36s; }
.preview__gain span { display: inline-block; padding: 3px 12px; border-radius: 99px; background: var(--ai); color: var(--paper-hi); font-weight: 700; font-size: 16px; white-space: nowrap; }
.preview__gain span.is-gold { background: #7c5a12; }
.preview__gain span.is-why { background: transparent; color: var(--shu); padding: 0; font-size: 15px; }

.boardwrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 12px; }
.board { position: relative; touch-action: none; border-radius: 8px; clip-path: inset(-10px); }
.board.is-hit { animation: hit .24s; }
@keyframes hit { 30% { transform: scale(1.025); } }
.board__ink { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; }
.board__ink path { fill: none; stroke: var(--ai); stroke-opacity: .42; stroke-linecap: round; stroke-linejoin: round; }
.tile {
  position: absolute; left: 0; top: 0; width: var(--cell); height: var(--cell); padding: 4px; z-index: 2;
  transition: transform .34s var(--ease-spring);
}
.tile__ch {
  position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: var(--r-tile); background: var(--paper-hi);
  box-shadow: var(--shadow-paper); border: 1px solid rgba(33, 29, 26, .12); transition: background .12s, transform .12s, color .12s;
  font-family: var(--f-tile); font-weight: 600; font-size: calc(var(--cell) * .46); line-height: 1; color: var(--ink);
}
.big .tile__ch { font-size: calc(var(--cell) * .56); }
.tile.is-on .tile__ch { background: var(--ai); color: var(--paper-hi); transform: scale(1.07); box-shadow: 0 4px 12px -4px rgba(24, 50, 77, .7); border-color: var(--ai-deep); }
.tile.is-gold .tile__ch {
  background:
    radial-gradient(circle at 25% 30%, rgba(255, 250, 225, .9) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 65%, rgba(255, 250, 225, .7) 0 1.5px, transparent 2.5px),
    linear-gradient(135deg, #ecd79c, #d2ad57 55%, #e6c97e);
  border-color: rgba(124, 90, 18, .5);
}
.tile.is-gold.is-on .tile__ch { background: #6e4f10; }
.tile.is-hint .tile__ch { animation: hint 1s infinite; }
@keyframes hint { 50% { box-shadow: 0 0 0 3px var(--ai), var(--shadow-paper); background: #e4ebf1; } }
.tile.is-shake { animation: shake .36s; }
@keyframes shake { 20% { translate: -6px 0; } 40% { translate: 5px 0; } 60% { translate: -4px 0; } 80% { translate: 2px 0; } }
.tile.is-taken .tile__ch { animation: taken .32s var(--d, 0ms) ease-in forwards; }
@keyframes taken { to { opacity: 0; transform: scale(.4) rotate(-8deg); filter: blur(3px); } }
.tile.is-rewrite .tile__ch { animation: rewrite .5s; }
@keyframes rewrite { 0% { opacity: 0; transform: rotateY(90deg); } 100% { opacity: 1; } }
.blot { position: absolute; z-index: 1; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; pointer-events: none; animation: blot .6s ease-out both;
  background: radial-gradient(circle, rgba(33, 29, 26, .55) 0 35%, rgba(33, 29, 26, .18) 60%, transparent 72%); }
.blot--gold { background: radial-gradient(circle, rgba(182, 138, 44, .7) 0 35%, rgba(182, 138, 44, .2) 60%, transparent 72%); }
@keyframes blot { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(5.5); opacity: 0; } }

.tools { display: flex; gap: 8px; padding: 8px 12px calc(10px + var(--sa-b)); flex: none; }
.tool {
  flex: 1; min-height: 56px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 6px;
  padding: 6px 10px; border-radius: 6px; background: var(--paper-lo); color: var(--ink); text-align: left; position: relative;
  box-shadow: inset 0 -2px 0 rgba(120, 96, 60, .25); transition: transform .09s;
}
.tool:active { transform: scale(.96); }
.tool:disabled { opacity: .5; }
.tool svg { grid-row: span 2; width: 24px; height: 24px; color: var(--ai); }
.tool__t { font-size: 13px; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.tool__n, .tool__c { font-size: 14px; line-height: 1.2; color: var(--ink-2); }
.tool__c { font-family: var(--f-num); font-weight: 800; }

.demo {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; padding: 14px 16px calc(14px + var(--sa-b)); display: none; gap: 10px;
  background: linear-gradient(to top, var(--paper) 70%, rgba(243, 231, 207, 0));
}
.demo.is-on { display: grid; }
.demo__tag { justify-self: center; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ai); }
.demo__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--shu); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.is-demo .tools { visibility: hidden; }

.pause { position: absolute; inset: 0; z-index: 20; display: none; place-items: center; padding: 20px; background: rgba(24, 22, 20, .62); }
.pause.is-on { display: grid; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.pause__card { width: 100%; max-width: 340px; background: var(--paper); border-radius: 6px; padding: 22px 20px 12px; display: grid; gap: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); border-top: 4px solid var(--ink); }
.pause__k { font-size: 14px; font-weight: 700; color: var(--ai); text-align: center; }
.pause__title { font-family: var(--f-brush); font-weight: 400; font-size: 28px; text-align: center; line-height: 1.3; }
.pause__title span { display: inline-block; }
.pause__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 8px; }
.pause__stats div { background: var(--paper-hi); border-radius: 4px; padding: 6px 10px; text-align: center; }
.pause__stats dt { font-size: 13px; color: var(--ink-2); }
.pause__stats dd { font-size: 22px; }
.pause__stats small { font-size: 14px; margin-left: 2px; font-family: var(--f-ui); }
.pause__row { display: flex; justify-content: space-between; }

/* ---------- 上部バー ---------- */
.topbar { display: flex; align-items: center; gap: 4px; padding: calc(4px + var(--sa-t)) 6px 4px; flex: none; border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar__title { flex: 1; text-align: center; font-family: var(--f-brush); font-weight: 400; font-size: 22px; }
.topbar__spacer { width: 44px; }
.topbar--clear { border-bottom: 0; }
.sec-h { font-family: var(--f-brush); font-weight: 400; font-size: 20px; margin: 22px 2px 10px; display: flex; align-items: center; gap: 10px; }
.sec-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 言葉帳 ---------- */
.whead { display: flex; align-items: center; gap: 16px; padding: 14px 4px 6px; }
.whead__ring {
  --p: 0; flex: none; width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center; line-height: 1.05;
  background: radial-gradient(closest-side, var(--paper) 80%, transparent 81%), conic-gradient(var(--ai) calc(var(--p) * 1%), var(--paper-lo) 0);
}
.whead__ring b { font-size: 28px; color: var(--ai); }
.whead__of { font-size: 13px; color: var(--ink-2); }
.whead__k { font-family: var(--f-brush); font-size: 22px; line-height: 1.4; }
.whead__t { font-size: 14px; color: var(--ink-2); word-break: keep-all; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper-hi); font-size: 14px; font-weight: 700; white-space: nowrap; }
.chips button[aria-selected="true"] { background: var(--ink); color: var(--paper-hi); border-color: var(--ink); }
.wrow { margin-top: 18px; }
.wrow__h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 700; }
.wrow__k { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper-hi); font-family: var(--f-brush); font-weight: 400; font-size: 20px; }
.wrow__t { font-size: 16px; }
.wrow__n { margin-left: auto; font-size: 15px; color: var(--ink-2); }
.wgrid { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; min-width: 52px; padding: 4px 10px; border-radius: 4px; line-height: 1.2; }
button.wchip { background: var(--paper-hi); box-shadow: var(--shadow-paper); border: 1px solid var(--line); transition: transform .1s; }
button.wchip:active { transform: scale(.94); }
.wchip__k { font-family: var(--f-tile); font-weight: 600; font-size: 18px; letter-spacing: .06em; }
.wchip__j { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.wchip--blank { flex-direction: row; gap: 3px; border: 1px dashed rgba(33, 29, 26, .28); min-height: 44px; }
.wchip--blank i { width: 13px; height: 13px; border-radius: 2px; background: var(--paper-lo); }
.wseeds { margin-top: 10px; padding: 10px 12px; border-radius: 4px; border: 1px dashed rgba(33, 29, 26, .25); }
.wseeds__k { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.wseeds__k b { color: var(--ink); font-size: 15px; }
.wseeds__row { display: flex; flex-wrap: wrap; gap: 4px; }
.wseeds__row i { width: calc(var(--l) * 6px + 4px); height: 8px; border-radius: 2px; background: var(--paper-lo); }
.empty { display: none; text-align: center; padding: 10px 6px 20px; }
.empty.is-on { display: block; }
.empty img { width: 100%; height: auto; border-radius: 4px; margin-bottom: 12px; }
.empty__t { font-family: var(--f-brush); font-size: 21px; word-break: keep-all; }
.empty__d { font-size: 14px; color: var(--ink-2); word-break: keep-all; }

/* ---------- リザルト ---------- */
.screen--result .topbar { position: absolute; left: 0; right: 0; top: 0; z-index: 3; background: transparent; }
.screen--result .topbar .icon-btn { background: rgba(251, 244, 227, .92); }
.screen--result .topbar__title { visibility: hidden; }
.screen--result .scroll { padding: 0 0 calc(96px + var(--sa-b)); }
.rhero { position: relative; height: 300px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 20px 22px; text-align: center; background: var(--paper) center 30% / cover no-repeat; }
.rhero.is-clear { background-image: url(/app-development/apps/a008/img/clear.webp); }
.rhero.is-dusk { background-image: url(/app-development/apps/a008/img/dusk.webp); }
.rhero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(243, 231, 207, 0) 45%, var(--paper) 96%); pointer-events: none; }
.rhero > * { position: relative; z-index: 1; }
.rhero__k { display: inline-block; font-size: 14px; font-weight: 700; color: var(--paper-hi); background: var(--ai); padding: 2px 12px; border-radius: 2px; word-break: keep-all; }
.rhero__t { font-family: var(--f-brush); font-weight: 400; font-size: 30px; line-height: 1.35; margin-top: 6px; background: var(--paper); padding: 0 12px; border-radius: 2px; }
.rhero__seal[hidden] { display: none !important; }
.rhero__seal {
  position: absolute; right: 22px; top: 70px; width: 58px; height: 58px; display: grid; place-items: center; z-index: 2;
  border: 3px solid var(--shu); color: var(--shu); background: rgba(251, 244, 227, .9); font-family: var(--f-brush); font-size: 19px; border-radius: 50%;
  transform: rotate(-12deg); animation: stamp .5s .5s var(--ease-spring) both;
}
@keyframes stamp { from { transform: rotate(-12deg) scale(2.4); opacity: 0; } }
.rcard { padding: 0 16px; }
.rscore { display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 6px 0 12px; }
.rscore__k { font-size: 15px; color: var(--ink-2); }
.rscore > b { font-size: 54px; line-height: 1; color: var(--ink); }
.rscore__best { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.rscore__best b { font-size: 16px; color: var(--ink); }
.rstats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rstats div { padding: 10px 4px; text-align: center; }
.rstats div + div { border-left: 1px solid var(--line); }
.rstats dt { font-size: 13px; color: var(--ink-2); }
.rstats dd b { font-size: 26px; }
.rstats small { font-size: 14px; margin-left: 2px; }
.rlong { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 12px 14px; background: var(--paper-hi); border-radius: 4px; box-shadow: var(--shadow-paper); }
.rlong__k { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.rlong__w { display: flex; align-items: baseline; gap: 10px; }
.rlong__kana { font-family: var(--f-tile); font-weight: 600; font-size: 22px; color: var(--ai); letter-spacing: .08em; }
.rlong__kanji { font-family: var(--f-brush); font-size: 18px; }
.tanzaku { list-style: none; display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; margin: 0 -16px; scrollbar-width: thin; }
.tz {
  flex: none; width: 46px; min-height: 150px; padding: 12px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--paper-hi); border-radius: 2px; box-shadow: var(--shadow-paper); position: relative;
}
.tz::before { content: ""; position: absolute; top: -6px; left: 50%; width: 1px; height: 8px; background: var(--ink-2); }
.tz:nth-child(3n+2) { background: #e3ecf2; }
.tz--long { background: #efe0b4; }
.tz__k { writing-mode: vertical-rl; font-family: var(--f-tile); font-weight: 600; font-size: 19px; letter-spacing: .12em; }
.tz__j { writing-mode: vertical-rl; font-family: var(--f-brush); font-size: 14px; color: var(--ink-2); margin-top: auto; }
.hist { list-style: none; }
.hist__i { display: grid; grid-template-columns: 3.4em 1fr auto 4.6em; align-items: baseline; gap: 8px; padding: 12px 4px; border-bottom: 1px dashed var(--line); font-size: 15px; }
.hist__d { color: var(--ink-2); font-size: 15px; }
.hist__r { font-weight: 700; word-break: keep-all; }
.hist__w { color: var(--ink-2); white-space: nowrap; }
.hist__s { text-align: right; font-size: 18px; }
.hist__i.is-best .hist__s { color: var(--shu); }
.hist__empty { padding: 14px 4px; color: var(--ink-2); font-size: 15px; list-style: none; }
.ractions { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; padding: 14px 16px calc(14px + var(--sa-b)); background: linear-gradient(to top, var(--paper) 72%, rgba(243, 231, 207, 0)); }
.ractions .btn--l { flex: 1; width: auto; }
.ractions .btn--sq { height: 54px; }

/* ---------- 設定 ---------- */
.howto { list-style: none; display: grid; gap: 12px; }
.howto__c { display: grid; grid-template-columns: 96px 1fr; gap: 12px; background: var(--paper-hi); border-radius: 4px; padding: 10px; box-shadow: var(--shadow-paper); }
.howto__c img { width: 96px; height: 96px; object-fit: cover; border-radius: 3px; }
.howto__b h3 { font-family: var(--f-brush); font-weight: 400; font-size: 19px; line-height: 1.35; margin-bottom: 2px; }
.howto__no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper-hi); font-size: 14px; margin-bottom: 4px; }
.howto__b p { font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.group { background: var(--paper-hi); border-radius: 4px; box-shadow: var(--shadow-paper); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 8px 14px; }
.row + .row { border-top: 1px solid var(--line); }
.row__l { display: flex; flex-direction: column; font-weight: 700; font-size: 15px; line-height: 1.4; }
.row__l small { font-weight: 500; font-size: 13px; color: var(--ink-2); }
.row--btn { width: 100%; justify-content: flex-start; color: var(--shu); font-weight: 700; }
.row--btn svg { width: 22px; height: 22px; }
.switch { width: 54px; height: 32px; border-radius: 99px; background: #cbbd9e; position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .25s var(--ease-spring); }
.switch[aria-checked="true"] { background: var(--ai); }
.switch[aria-checked="true"] i { transform: translateX(22px); }
.about { padding: 16px; display: grid; gap: 12px; }
.about__head { display: flex; align-items: center; gap: 14px; }
.about__head img { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.about__name { font-family: var(--f-brush); font-size: 22px; line-height: 1.3; }
.about__ver { font-size: 14px; color: var(--ink-2); }
.about__note { font-size: 14px; line-height: 1.75; color: var(--ink); }
.about__k { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.techs { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.techs li { font-size: 13px; padding: 3px 10px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); white-space: nowrap; }
.about__cta { justify-content: space-between; }

/* ---------- シート・トースト・スプラッシュ ---------- */
.scrim { position: absolute; inset: 0; z-index: 40; background: rgba(24, 22, 20, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.is-on { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; padding: 10px 20px calc(20px + var(--sa-b)); display: grid; gap: 10px;
  background: var(--paper); border-radius: 14px 14px 0 0; transform: translateY(105%); transition: transform .32s var(--ease-out); visibility: hidden;
}
.sheet.is-on { transform: none; visibility: visible; }
.sheet__grab { justify-self: center; width: 40px; height: 4px; border-radius: 9px; background: rgba(33, 29, 26, .25); margin-bottom: 6px; }
.sheet h2 { font-family: var(--f-brush); font-weight: 400; font-size: 23px; line-height: 1.4; }
.sheet p { font-size: 15px; color: var(--ink-2); }
.wd__kana { font-family: var(--f-tile); font-weight: 600; font-size: 18px; color: var(--ai) !important; letter-spacing: .2em; text-align: center; }
.wd__kanji { text-align: center; font-size: 52px !important; line-height: 1.2 !important; }
.wd__meta { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--paper-hi); border-radius: 4px; margin: 4px 0 6px; }
.wd__meta div { text-align: center; padding: 8px 4px; }
.wd__meta div + div { border-left: 1px solid var(--line); }
.wd__meta dt { font-size: 13px; color: var(--ink-2); }
.wd__meta dd { font-size: 14px; }
.wd__meta dd b { font-size: 22px; margin-right: 2px; }
.toast {
  position: absolute; left: 50%; bottom: calc(90px + var(--sa-b)); z-index: 50; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper-hi); font-size: 14px; font-weight: 700; padding: 10px 18px; border-radius: 4px; max-width: calc(100% - 32px);
  transition: .25s var(--ease-out); word-break: keep-all;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.splash { position: absolute; inset: 0; z-index: 90; display: none; place-content: center; justify-items: center; gap: 16px; background: var(--paper); }
.splash.is-on { display: grid; animation: splash .9s forwards; }
@keyframes splash { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
.splash img { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.splash p { font-family: var(--f-brush); font-size: 26px; }
.noscript, .jsfail { position: absolute; inset: auto 16px 40px; z-index: 99; padding: 14px; background: var(--ink); color: var(--paper-hi); border-radius: 4px; font-size: 15px; }
.jsfail { display: none; }
.jsfail.is-on { display: block; }

@media (max-height: 700px) {
  .river { height: clamp(120px, 22dvh, 170px); }
  .preview { min-height: 48px; }
  .preview__k { font-size: 26px; }
  .tool { min-height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .banner.is-on { animation: none; opacity: 1; }
}
.nw { white-space: nowrap; }
