/* 歯医者さんの待合室むけ はみがきミニゲーム — 見た目
   デザインの方向（2026-10-21 作者）：
   ・マリオペイントのような、色の少ない感じ（ドットの絵・ドットの数字）
   ・方眼の背景で、システマチック。歯医者さんらしい清潔感。少しまじめ風味だけど、おもしろそう
     （参考に見せてもらった：脳トレ・立体ピクロスの箱。⚠️ 絵・ロゴ・字そのものはまねしない）
   ・色は「すみ色・白・方眼の灰色」が土台。青（清潔・医院のサイトの色）を主に、赤は点数など ほんの少し
   ・ゲームの中のものの位置は js が決める */

:root {
  /* 色 */
  --ink: #222222;
  --ink-soft: #55595c;
  --paper: #ffffff;
  --grid: #e4e8ea;      /* 方眼の細い線 */
  --grid-bold: #cdd5d9; /* 5ますごとの線 */
  /* 主の色（清潔）。医院のサイト（2026-10-21 作者が参考に教えてくれた）のロゴの青と紺に合わせた。
     ⚠️ 医院の名前・ロゴは入れない。色だけ */
  --main: #0a649e;
  --main-dk: #102948;   /* タイトルの箱の厚み */
  --main-lt: #d6e6f2;   /* うすい色（しま・札の地） */
  --main-bg: #f4f8fb;   /* 絵の箱の地 */
  --main-xlt: #e9f1f8;  /* しまのもう1色 */
  --red: #e2492f;       /* 点数・目立たせたいところだけ */
  --gray: #d9dcde;

  /* ふちどりと影（ドット風：ぼかさない、かたい影） */
  --sh: 4px 4px 0 var(--ink);
  --sh-s: 3px 3px 0 var(--ink);

  /* 字：見出しは太いゴシック（まじめ風味）、数字と小さな札はドットの字 */
  --font: "M PLUS 1p", "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
  --font-dot: "DotGothic16", "M PLUS 1p", sans-serif;

  /* 方眼（20px ごと・5ますごとに少し濃い線） */
  --graph:
    linear-gradient(var(--grid-bold) 1px, transparent 1px) -1px -1px / 100px 100px,
    linear-gradient(90deg, var(--grid-bold) 1px, transparent 1px) -1px -1px / 100px 100px,
    linear-gradient(var(--grid) 1px, transparent 1px) -1px -1px / 20px 20px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) -1px -1px / 20px 20px,
    var(--paper);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

/* ⚠️ ページ自体はスクロールさせない（iPhone で QR から開くと、少し下にスクロールした状態で
   開いて、上が切れ、下に帯が出た。2026-10-07 見本のときに作者が実機で発見） */
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
/* PC で見たときの、スマホ幅の外がわ（四角い点の方眼） */
body {
  background:
    conic-gradient(at 4px 4px, transparent 75%, var(--main-lt) 0) 0 0 / 28px 28px,
    #f2f6f7;
}

button { font: inherit; color: inherit; touch-action: manipulation; }

/* ---------- 画面の土台（#app） ----------
   スマホは画面いっぱい。PC では まん中にスマホ幅で置く */
/* ⚠️ 高さは 100dvh にしない。画面そのものに貼りつける（position: fixed; 上下左右 0）。
   100dvh は Safari のツールバーの出し入れの途中で計算がずれて、開いた直後だけ上にずれた（2026-10-07） */
.screen {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  font-family: var(--font);
  color: var(--ink);
  background: var(--graph);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
@media (min-width: 481px) {
  .screen { border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); }
}
.screen img { display: block; -webkit-user-drag: none; }
/* ドット絵は、ぼかさずに大きくする */
img[src^="data:image"] { image-rendering: pixelated; }

/* 選ぶ画面と、ゲームの場所 */
.view { position: absolute; inset: 0; }
/* ⚠️ #menu の display:flex より強くしないと、隠しても見えたままになる */
.view[hidden] { display: none !important; }
#stage { touch-action: none; }

/* ---------- ボタン ---------- */
.btn-main, .btn-sub {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 0 20px;
  border: 3px solid var(--ink); border-radius: 0; cursor: pointer;
  font-family: var(--font); font-weight: 900; font-size: 19px; letter-spacing: .06em;
  text-decoration: none;
  box-shadow: var(--sh);
  transition: transform .06s, box-shadow .06s;
}
.btn-main { color: var(--paper); background: var(--main); }
.btn-sub { color: var(--ink); background: var(--paper); }
.btn-main:active, .btn-sub:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- 上の帯（ゲーム中） ---------- */
.hud {
  position: absolute; z-index: 20;
  top: calc(var(--safe-top) + 10px); left: 10px; right: 10px;
  display: flex; align-items: center; gap: 8px;
  pointer-events: none; /* 帯の下でも ねらえるように（もどるだけ押せる） */
}
.hud-back, .hud-score, .hud-shots {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 48px; padding: 0 12px;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: var(--sh-s);
  font-weight: 800; font-size: 14px; white-space: nowrap;
}
.hud-back { cursor: pointer; pointer-events: auto; }
.hud-back:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.hud-score { flex: 1; min-width: 0; }
.hud-score b { font-family: var(--font-dot); font-weight: 400; font-size: 30px; line-height: 1; color: var(--red); }
.hud-shots { padding: 0 10px 0 8px; }
.hud-shots img { height: 32px; width: auto; transform: rotate(20deg); }
.hud-shots b { font-family: var(--font-dot); font-weight: 400; font-size: 22px; }

/* ---------- かめおじぃのふきだし（四角・ふちどり・かたい影） ---------- */
.say-bubble {
  position: relative; display: inline-block;
  padding: 6px 14px 7px;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: var(--sh-s);
  font-weight: 900; font-size: 22px; line-height: 1.3; color: var(--ink);
  white-space: nowrap;
}
/* しっぽ（すみ色の三角の上に白い三角を重ねる）。ふつうは左むき */
.say-bubble::before, .say-bubble::after { content: ""; position: absolute; width: 0; height: 0; border-style: solid; }
.say-bubble::before { left: -15px; top: 50%; margin-top: -10px; border-width: 10px 15px 10px 0; border-color: transparent var(--ink) transparent transparent; }
.say-bubble::after { left: -9px; top: 50%; margin-top: -6px; border-width: 6px 9px 6px 0; border-color: transparent var(--paper) transparent transparent; }
/* 下むきのしっぽ（--tail-x で左右の位置を決める） */
.say-bubble--down::before { left: var(--tail-x, 50%); top: 100%; margin: 0 0 0 -10px; border-width: 15px 10px 0 10px; border-color: var(--ink) transparent transparent transparent; }
.say-bubble--down::after { left: var(--tail-x, 50%); top: 100%; margin: -1px 0 0 -6px; border-width: 9px 6px 0 6px; border-color: var(--paper) transparent transparent transparent; }
/* 右むきのしっぽ（かめおじぃが ふきだしの 右にいるとき。かめおじぃの絵は 左むき） */
.say-bubble--right::before { left: auto; right: -15px; border-width: 10px 0 10px 15px; border-color: transparent transparent transparent var(--ink); }
.say-bubble--right::after { left: auto; right: -9px; border-width: 6px 0 6px 9px; border-color: transparent transparent transparent var(--paper); }
/* 下むきのしっぽを、右から --tail-r の ところに */
.say-bubble--tail-r::before { left: auto; right: var(--tail-r, 30px); margin: 0 -10px 0 0; }
.say-bubble--tail-r::after { left: auto; right: var(--tail-r, 30px); margin: -1px -6px 0 0; }
.say-bubble--s { font-size: 15px; padding: 6px 12px; }
.say-bubble.is-float { position: absolute; z-index: 21; pointer-events: none; white-space: pre; text-align: center; }
.say-bubble.is-float[hidden] { display: none; }
.say-bubble.is-pop { animation: say-pop .25s steps(3); }
@keyframes say-pop { from { transform: scale(.7); } to { transform: scale(1); } }

/* ---------- ゲームを選ぶ画面 ---------- */
#menu {
  display: flex; flex-direction: column;
  overflow-x: hidden; overflow-y: auto;
  /* かめおじぃの場所の高さ。背の低いスマホでは小さくして、カードと口コミが画面に入るようにする
     614px＝ほかの部分の高さ（すきま 14px こみ）。縦長のスマホほど かめおじぃが 大きくなる（2026-10-24 作者） */
  --hero-h: clamp(90px, calc(100vh - 614px), 250px);
}
/* svh＝ツールバーが出ているときの いちばん小さい高さ。開いた直後でも値が変わらない */
@supports (height: 1svh) {
  #menu { --hero-h: clamp(90px, calc(100svh - 614px), 250px); }
}
.menu-head { margin: calc(var(--safe-top) + 16px) 12px 0; text-align: center; }
.menu-title { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* 上の小さな一行（下に かぎかっこの線） */
.menu-kicker {
  position: relative; padding: 0 12px 5px;
  font-weight: 800; font-size: 13px; letter-spacing: .08em;
  border-bottom: 2px solid var(--ink);
}
.menu-kicker::before, .menu-kicker::after { content: ""; position: absolute; bottom: -2px; width: 2px; height: 9px; background: var(--ink); }
.menu-kicker::before { left: 0; }
.menu-kicker::after { right: 0; }
/* タイトルの文字を、1字ずつ箱にのせる（箱には右下に厚み） */
.title-tiles { display: flex; gap: 7px; margin-top: 2px; --tile: clamp(50px, 15vw, 64px); }
.title-tile {
  width: var(--tile); height: var(--tile); display: grid; place-items: center;
  background: var(--main); color: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 0 var(--main-dk), 5px 5px 0 3px var(--ink);
  font-weight: 900; font-size: calc(var(--tile) * .62); line-height: 1;
}
.title-tile:nth-child(2) { transform: translateY(-3px); }
.title-tile:nth-child(4) { transform: translateY(-2px); }
.title-sub { margin-top: 6px; font-weight: 900; font-size: clamp(24px, 7.4vw, 32px); letter-spacing: .1em; line-height: 1; }

/* かめおじぃは 右がわに 大きく、ふきだしは 左上（かめおじぃの絵は 左むき。2026-10-21 作者）。
   かめおじぃの 下半分は カードの うしろに かくれる（2026-10-24 作者の 見本の 大きさ）。
   見える高さ＝ --hero-h ＋ 2px。絵の 上から 77%（手と 白衣の すそ あたり）まで 見えるように 大きさを 決める。
   clip-path は 下だけ 切る（上・左右は ふわふわ ゆれても 切れないように あけておく） */
.menu-hero {
  position: relative; flex: none; height: calc(var(--hero-h) + 6px); margin-top: 8px; clip-path: inset(-60px -60px 0 -60px);
  --kame-h: calc((var(--hero-h) + 2px) / .77);
  --kame-w: calc(var(--kame-h) * .8); /* 絵は 512×640 */
  --say-fs: clamp(15px, calc(var(--hero-h) * .078), 18px);
}
.menu-hero-kame { position: absolute; top: 4px; right: 4px; height: var(--kame-h); width: auto; max-width: none; }
/* ふきだしは、しっぽの先が かめおじぃの 歯ブラシの あたりに くるように 寄せる（せまい画面では 左はしで 止める）。
   ふきだしの 幅は「あそぶかのう？」7字ぶん＋わく */
.menu-say {
  position: absolute; z-index: 1; top: 7%; font-size: var(--say-fs);
  left: max(12px, calc(100% - 4px - var(--kame-w) * .92 - 15px - var(--say-fs) * 7 - 30px));
}

.menu-cards { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 12px 0 10px; }
.card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 0 0 12px; border: 3px solid var(--ink); border-radius: 0; background: var(--paper);
  box-shadow: var(--sh); cursor: pointer; font-family: var(--font); color: var(--ink); text-align: center;
  transition: transform .06s, box-shadow .06s;
}
.card:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.card-icon {
  position: relative; width: 100%; height: 78px; display: flex; align-items: center; justify-content: center; gap: 2px;
  border-bottom: 3px solid var(--ink);
  background:
    linear-gradient(var(--main-lt) 1px, transparent 1px) -1px -1px / 12px 12px,
    linear-gradient(90deg, var(--main-lt) 1px, transparent 1px) -1px -1px / 12px 12px,
    var(--main-bg);
}
.card-icon img { height: auto; }
.card-name { padding: 0 4px; font-weight: 900; font-size: 15px; line-height: 1.25; }
/* keep-all：言葉の途中で折り返さず、空白のところで折り返す */
.card-desc { padding: 0 6px; font-weight: 700; font-size: 11px; line-height: 1.55; color: var(--ink-soft); word-break: keep-all; overflow-wrap: anywhere; }
/* まだ作っていないゲーム */
.card.is-soon { cursor: default; }
.card.is-soon:active { transform: none; box-shadow: var(--sh); }
.card.is-soon > :not(.card-soon) { opacity: .45; }
.card-soon {
  position: absolute; top: 50px; left: 50%; transform: translateX(-50%) rotate(-8deg);
  padding: 2px 8px; background: var(--paper); border: 2px solid var(--red); color: var(--red);
  font-family: var(--font-dot); font-size: 12px; white-space: nowrap;
}
/* 「きろくを みる」：ひかえめ（うすい字・細いわく・影なし）。口コミのボタンより目立たせない */
.record-btn {
  align-self: center; display: flex; align-items: center; gap: 10px;
  margin-top: 14px; min-height: 40px; padding: 0 16px;
  background: rgba(255,255,255,.8); border: 2px solid var(--gray); border-radius: 0; cursor: pointer;
  font-family: var(--font); font-weight: 800; font-size: 13px; color: var(--ink-soft);
}
.record-btn:active { background: var(--main-bg); }
.record-btn-sub { font-family: var(--font-dot); font-weight: 400; font-size: 13px; color: #8a9196; }
.menu-space { flex: 1; min-height: 14px; }

/* いちばん下：おうちの方への口コミのボタン（ななめのしま） */
/* しまもようが ゆっくり ながれて、目がいくように（2026-10-21 作者）。
   しまの くりかえし（よこ 28.28px＝20px÷sin45°）ぶん ずらすと、つなぎめなく ループする */
.review {
  padding: 12px 16px calc(var(--safe-bottom) + 12px);
  border-top: 3px solid var(--ink);
  background: repeating-linear-gradient(-45deg, var(--main-lt) 0 10px, var(--main-xlt) 10px 20px) 0 0 / 28.284px 28.284px;
  animation: stripe-flow 2.4s linear infinite;
  text-align: center;
}
@keyframes stripe-flow { to { background-position: 28.284px 0; } }
@media (prefers-reduced-motion: reduce) { .review { animation: none; } }
.review-note { margin: 8px 0 0; font-weight: 800; font-size: 13px; color: var(--ink-soft); }
/* ボタン：左に 赤い屋根の 家、まん中に「おうちの方へ」と 本文の 2行、右に › */
.review-btn {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 50px; padding: 10px 12px;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--main-dk);
  color: var(--ink); text-decoration: none; text-align: left;
}
.review-btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--main-dk); }
.review-icon { flex: none; width: 33px; }
.review-icon img { width: 33px; height: auto; animation: k-bob 1.4s steps(2) infinite; }
.review-btn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.review-btn-to { font-weight: 900; font-size: clamp(17px, 4.8vw, 20px); line-height: 1.3; color: var(--main); }
.review-btn-msg { font-weight: 800; font-size: clamp(13px, 3.6vw, 15px); line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }

/* ---------- 始める前の「やり方」カード ---------- */
.howto-wrap { position: absolute; inset: 0; z-index: 40; cursor: pointer; background: rgba(255,255,255,.55); }
.howto {
  position: absolute; left: 18px; right: 18px; top: 50%; transform: translateY(-50%);
  padding: 0 18px 18px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
  display: flex; flex-direction: column; gap: 14px; text-align: center;
}
.howto-pic {
  margin: 0 -18px; height: clamp(104px, 17vh, 140px); height: clamp(104px, 17svh, 140px);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  border-bottom: 3px solid var(--ink);
  background:
    linear-gradient(var(--main-lt) 1px, transparent 1px) -1px -1px / 16px 16px,
    linear-gradient(90deg, var(--main-lt) 1px, transparent 1px) -1px -1px / 16px 16px,
    var(--main-bg);
}
.howto-pic img { height: 56%; width: auto; }
.howto-pic img[src*="brush"], .howto-pic img[data-tall] { height: 76%; }
.howto-pic .arrow { font-family: var(--font-dot); font-size: 28px; color: var(--main); }
.howto-title { margin: 0; font-weight: 900; font-size: 26px; letter-spacing: .04em; }
.howto-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.howto-steps li { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.howto-steps .n {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--main); color: var(--paper); border: 2px solid var(--ink);
  font-family: var(--font-dot); font-size: 17px;
}
.howto-note { margin: 0; padding: 8px 10px; background: var(--main-lt); font-weight: 700; font-size: 13px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.howto-start { margin-top: 2px; }

/* ---------- おわりの画面 ---------- */
.result { position: absolute; inset: 0; z-index: 30; }
.result-veil { position: absolute; inset: 0; background: rgba(255,255,255,.62); }
.result-card {
  position: absolute; left: 18px; right: 18px; top: 50%; transform: translateY(-50%);
  max-height: calc(100% - 20px); overflow-y: auto;
  padding: 18px 18px 20px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.result-head { display: flex; flex-direction: row-reverse; align-items: center; gap: 18px; width: 100%; }
.result-kame { position: relative; flex: none; width: 104px; height: 130px; display: flex; justify-content: center; }
.result-kame img { position: relative; height: 100%; width: auto; max-width: none; }
.result-say { flex: 1; min-width: 0; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; padding: 8px 12px; text-align: left; }
.result-score { margin: 2px 0 0; display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 6px; font-weight: 900; font-size: 24px; }
.result-score b { font-family: var(--font-dot); font-weight: 400; font-size: 60px; color: var(--red); line-height: 1; }
.result-line { margin: 0; font-weight: 800; font-size: 16px; }
.result-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.result-best, .result-goal {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 10px;
  border: 2px solid var(--ink);
  font-weight: 700; font-size: 12px;
}
.result-best { background: var(--main-lt); }
.result-goal { background: var(--paper); border-style: dashed; }
.result-best b, .result-goal b { font-family: var(--font-dot); font-weight: 400; font-size: 19px; }
/* しんきろく！の赤いはんこ（点数の上に ななめに）
   ⚠️ カードの外にはみ出させると、カードのスクロールで切れる */
.result-badge {
  margin: 2px 0 -8px;
  padding: 5px 14px; background: var(--red); color: var(--paper);
  border: 3px solid var(--ink); box-shadow: var(--sh-s);
  font-weight: 900; font-size: 18px; letter-spacing: .04em; transform: rotate(8deg);
  animation: badge-in .5s steps(5);
}
@keyframes badge-in { from { transform: rotate(8deg) scale(2.2); opacity: 0; } to { transform: rotate(8deg) scale(1); opacity: 1; } }
.result-kame.is-happy img { animation: kame-hop .5s steps(4) 3; }
@keyframes kame-hop { 50% { transform: translateY(-12px); } }
/* きょうの スタンプ */
.result-stamp { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; }
.result-stamp-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--red); background: var(--paper); transform: rotate(-12deg);
  animation: stamp-in .45s steps(4);
}
.result-stamp-mark img { width: 22px; height: auto; }
@keyframes stamp-in { from { transform: rotate(-12deg) scale(2); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }
.result-btns { display: flex; flex-direction: column; gap: 14px; width: 100%; margin-top: 6px; }

/* ---------- ゲーム共通の動き ---------- */
/* 👆 指の手本 */
.guide-finger { position: absolute; z-index: 30; height: auto; pointer-events: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
/* 「+10」など、すぐ消える文字（ドットの字・白いふち） */
.pop {
  position: absolute; z-index: 20; transform: translate(-50%, -50%);
  font-family: var(--font-dot); color: var(--main); font-size: 24px; white-space: nowrap;
  text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff, 2px 2px #fff, -2px -2px #fff, 2px -2px #fff, -2px 2px #fff;
  pointer-events: none;
  animation: pop-up .7s steps(7) forwards;
}
.pop.is-big { font-size: 34px; color: var(--red); }
@keyframes pop-up {
  from { opacity: 1; margin-top: 0; }
  70% { opacity: 1; }
  to { opacity: 0; margin-top: -34px; }
}

/* ---------- 歯ブラシで GO！ ---------- */
.bgo { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.bgo-form { position: absolute; inset: 0; pointer-events: none; }
/* むしばきんの あな */
.bgo-hole {
  position: absolute; transform: translate(-50%, -50%);
  background: var(--ink); border-radius: 50%;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--gray);
}
/* 箱から下に出たぶんは見えない＝あなに かくれている */
.bgo-germbox { position: absolute; overflow: hidden; }
.bgo-germbox img { will-change: transform; }
.bgo-sweet { position: absolute; transition: transform .25s steps(4), opacity .25s steps(4); }
.bgo-sweet.is-in { animation: sweet-in .4s steps(5); }
@keyframes sweet-in { from { transform: scale(0); } to { transform: scale(1); } }
.bgo-sweet.is-out { transform: scale(1.5); opacity: 0; }
.bgo-kame { position: absolute; z-index: 3; object-fit: contain; pointer-events: none; }
.bgo-cup, .bgo-loaded { position: absolute; z-index: 3; pointer-events: none; }
.bgo-loaded { transform-origin: 50% 85%; transition: opacity .15s; }
.bgo-aim { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
.bgo-bullet { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; }
.bgo-say { max-width: calc(100% - 16px); }
/* きらきら：四方に とびちる */
.bgo-spark { position: absolute; z-index: 6; width: 16px; height: 16px; margin: -8px 0 0 -8px; pointer-events: none; animation: spark .6s steps(6) forwards; }
@keyframes spark {
  from { transform: translate(0, 0) scale(.6); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; }
}
/* 当たった むしばきんが、くるくる まわって とんでいく */
.bgo-flyaway { position: absolute; z-index: 6; pointer-events: none; animation: flyaway .85s ease-in forwards; }
@keyframes flyaway {
  to { transform: translate(calc(var(--dx) * 70px), -140px) rotate(calc(var(--dx) * 540deg)) scale(.6); opacity: 0; }
}

/* ---------- きろくの画面 ---------- */
.rec { position: absolute; inset: 0; }
.rec-title {
  flex: 1; display: flex; align-items: center; justify-content: center; height: 48px;
  background: var(--main); color: var(--paper); border: 3px solid var(--ink); box-shadow: var(--sh-s);
  font-weight: 900; font-size: 20px; letter-spacing: .3em;
}
/* 中身だけ たてにスクロールできる */
.rec-body {
  position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--safe-top) + 72px);
  overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch;
  padding: 4px 14px calc(var(--safe-bottom) + 24px);
  display: flex; flex-direction: column; gap: 16px;
}
.rec-stampcard, .rec-game { background: var(--paper); border: 3px solid var(--ink); box-shadow: var(--sh); padding: 12px 12px 14px; }
.rec-h { margin: 0 0 10px; display: flex; align-items: baseline; justify-content: space-between; font-weight: 900; font-size: 17px; }
.rec-h small { font-family: var(--font-dot); font-weight: 400; font-size: 13px; color: var(--ink-soft); }
.rec-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rec-cell {
  position: relative; aspect-ratio: 1 / 1.15; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 2px dashed var(--grid-bold); background: var(--main-bg);
}
.rec-num { font-family: var(--font-dot); font-size: 16px; color: #b3bcc1; }
.rec-cell.is-on { border-style: solid; border-color: var(--ink); background: var(--paper); }
/* はんこ：赤い まる の中に 歯 */
.rec-stamp {
  display: grid; place-items: center; width: 70%; aspect-ratio: 1; border-radius: 50%;
  border: 3px solid var(--red); transform: rotate(var(--rot, -8deg));
}
.rec-stamp img { width: 58%; height: auto; }
.rec-date { font-family: var(--font-dot); font-size: 11px; color: var(--ink-soft); line-height: 1; }
.rec-stampcard.is-full .rec-cell.is-on { background: #fff6e0; }
.rec-kame { display: flex; flex-direction: row-reverse; align-items: center; gap: 16px; margin-top: 12px; }
.rec-kame img { width: 64px; height: auto; flex: none; }
.rec-say { white-space: pre-line; line-height: 1.5; }
.rec-game-name { margin: 0 0 10px; font-weight: 900; font-size: 17px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.rec-game.is-soon { box-shadow: none; border-color: var(--gray); }
.rec-game.is-soon .rec-game-name { color: #9aa1a5; border-color: var(--gray); }
.rec-empty { margin: 0; font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.rec-game.is-soon .rec-empty { font-family: var(--font-dot); font-weight: 400; color: #9aa1a5; }
.rec-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rec-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 4px; background: var(--main-lt); border: 2px solid var(--ink); }
.rec-stat span { font-weight: 700; font-size: 11px; }
.rec-stat b { font-family: var(--font-dot); font-weight: 400; font-size: 28px; line-height: 1.1; color: var(--ink); }
.rec-stat:first-child b { color: var(--red); }
.rec-sub { margin: 12px 0 4px; font-weight: 700; font-size: 11px; color: var(--ink-soft); }
/* さいきんの 5かい：ドットの棒グラフ（方眼の上） */
.rec-bars {
  display: flex; align-items: flex-end; gap: 10px; height: 96px; padding: 18px 8px 0;
  border-bottom: 3px solid var(--ink);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 -1px / 12px 12px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) -1px 0 / 12px 12px,
    var(--paper);
}
.rec-bar { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.rec-bar-num { position: relative; font-family: var(--font-dot); font-size: 12px; line-height: 1; margin-bottom: 3px; }
.rec-bar-fill { width: 100%; max-width: 34px; background: var(--main-lt); border: 2px solid var(--ink); border-bottom: 0; }
.rec-bar.is-last .rec-bar-fill { background: var(--main); }
.rec-bar.is-last .rec-bar-num { color: var(--main); }
.rec-goal { margin: 10px 0 0; font-weight: 800; font-size: 13px; text-align: right; }
.rec-goal b { font-family: var(--font-dot); font-weight: 400; font-size: 20px; color: var(--red); }
.rec-foot { margin: 0; text-align: center; font-weight: 700; font-size: 11px; color: var(--ink-soft); }

/* もらった しょうじょう（記録の画面のスタンプカードの下） */
.rec-certs { margin-top: 12px; padding-top: 10px; border-top: 2px dashed var(--grid-bold); }
.rec-certs-h { margin: 0 0 8px; font-weight: 800; font-size: 13px; }
.rec-certs-h b { font-family: var(--font-dot); font-weight: 400; font-size: 18px; color: var(--red); }
.rec-certs-empty { margin: 0; font-weight: 700; font-size: 12px; color: var(--ink-soft); }
.rec-certs-list { display: flex; flex-wrap: wrap; gap: 8px; }
/* 小さな賞状（さわると大きく見られる） */
.rec-cert {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 64px; height: 76px; padding: 4px; cursor: pointer;
  background: #fffdf6; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  outline: 2px solid var(--main); outline-offset: -6px;
  font-family: var(--font);
}
.rec-cert:active { transform: translate(2px, 2px); box-shadow: none; }
.rec-cert-t { font-weight: 900; font-size: 13px; }
.rec-cert-r { font-weight: 700; font-size: 9px; line-height: 1.3; color: var(--main); word-break: keep-all; }

/* ---------- しょうじょう（画面の中だけ。本物の景品ではない） ---------- */
.cert-wrap {
  position: absolute; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 16px);
  background: rgba(34,34,34,.72); overflow-y: auto;
}
/* 賞状とボタンは、きらきらの星より手前（星が字にかぶらないように） */
.cert, .cert-close { position: relative; z-index: 1; }
.cert {
  position: relative; width: 100%; max-width: 360px; padding: 10px;
  background: #fffdf6; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
  animation: cert-in .5s steps(5);
}
@keyframes cert-in { from { transform: scale(.5) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.cert-in {
  padding: 16px 14px 12px; text-align: center;
  border: 6px double var(--main);
  background:
    linear-gradient(rgba(10,100,158,.06) 1px, transparent 1px) -1px -1px / 16px 16px,
    linear-gradient(90deg, rgba(10,100,158,.06) 1px, transparent 1px) -1px -1px / 16px 16px;
}
.cert-corner { position: absolute; width: 22px; height: 22px; }
.cert-corner--0 { left: -11px; top: -11px; }
.cert-corner--1 { right: -11px; top: -11px; }
.cert-corner--2 { left: -11px; bottom: -11px; }
.cert-corner--3 { right: -11px; bottom: -11px; }
.cert-no { margin: 0; text-align: right; font-family: var(--font-dot); font-size: 12px; color: var(--ink-soft); }
.cert-title { margin: 2px 0 0; font-weight: 900; font-size: 34px; letter-spacing: .28em; padding-left: .28em; }
.cert-rank {
  display: inline-block; margin: 10px 0 12px; padding: 4px 14px;
  background: var(--main); color: var(--paper); border: 3px solid var(--ink); box-shadow: var(--sh-s);
  font-weight: 900; font-size: 20px; letter-spacing: .06em;
}
.cert-body { margin: 0; text-align: left; font-weight: 700; font-size: 14px; line-height: 1.9; word-break: keep-all; overflow-wrap: anywhere; }
.cert-date { margin: 10px 0 0; text-align: right; font-family: var(--font-dot); font-size: 13px; }
.cert-sign { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.cert-sign img { width: 48px; height: auto; }
.cert-sign-name { font-weight: 900; font-size: 16px; }
/* 赤いはんこ */
.cert-hanko {
  display: grid; place-items: center; width: 42px; height: 42px;
  border: 3px solid var(--red); color: var(--red); border-radius: 4px; transform: rotate(8deg);
  font-weight: 900; font-size: 15px; line-height: 1; writing-mode: vertical-rl; letter-spacing: .05em;
}
.cert-note { margin: 8px 2px 0; text-align: right; font-weight: 700; font-size: 11px; color: var(--ink-soft); }
.cert-close { max-width: 360px; }
/* まわりで きらきら */
.cert-twinkle { position: absolute; z-index: 0; width: 14px; height: 14px; pointer-events: none; opacity: 0; animation: twinkle 1.8s steps(6) infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.5); } 40% { opacity: 1; transform: scale(1.2); } 70% { opacity: .6; transform: scale(.9); } }

/* ---------- 歯の おそうじ ---------- */
.cln { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.cln-base, .cln-dirt { position: absolute; pointer-events: none; }
.cln-base { z-index: 1; }
.cln-dirt { z-index: 2; }
/* のこり時間：10この ます（6びょうで 1こ 消える）。タイムアタックに見えないよう、数字は出さない */
.hud-time {
  display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 10px;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: var(--sh-s);
  font-weight: 800; font-size: 12px; white-space: nowrap;
}
.hud-time i { display: grid; grid-template-columns: repeat(5, 7px); gap: 2px; }
.hud-time em { display: block; width: 7px; height: 9px; background: var(--main); }
.hud-time em.is-off { background: var(--gray); }
.hud-time i.is-end em:not(.is-off) { background: var(--red); }
.cln .hud-score b { color: var(--main); }
/* むしばきん（歯の上で ゆらゆら） */
.cln-germ { position: absolute; z-index: 4; transform: translate(-50%, -50%); pointer-events: none; animation: germ-bob 1.2s steps(2) infinite; }
.cln-germ.is-boss { z-index: 5; transition: left .3s steps(3), top .3s steps(3); }
.cln-germ.is-hit { animation: germ-shake .16s steps(2) infinite; }
@keyframes germ-bob { 50% { transform: translate(-50%, calc(-50% - 3px)); } }
@keyframes germ-shake { 0% { transform: translate(calc(-50% - 3px), -50%); } 100% { transform: translate(calc(-50% + 3px), -50%); } }
/* ゆびに ついてくる 歯ブラシ */
.cln-brush { position: absolute; left: 0; top: 0; z-index: 8; pointer-events: none; transform-origin: 60% 16%; transition: opacity .15s; }
/* あわ */
.cln-foam {
  position: absolute; z-index: 7; margin: -8px 0 0 -8px; border-radius: 50%; pointer-events: none;
  background: var(--paper); border: 2px solid #9fb4c2;
  animation: foam .7s steps(5) forwards;
}
@keyframes foam { to { transform: translateY(-22px) scale(1.3); opacity: 0; } }
.cln-say { max-width: calc(100% - 120px); white-space: pre; }
/* みがきのこしの 場所の名前 */
.cln-tag {
  position: absolute; z-index: 9; transform: translate(-50%, -100%);
  padding: 3px 8px; background: var(--paper); border: 2px solid var(--red); color: var(--red);
  font-weight: 900; font-size: 13px; white-space: nowrap; pointer-events: none;
  animation: badge-in .4s steps(4);
}
.cln-fx { position: absolute; z-index: 3; pointer-events: none; }
/* きょうの ばしょ（口の地図つき） */
.cln-label {
  position: absolute; z-index: 6; left: 12px; right: 12px; height: 42px;
  display: flex; align-items: center; gap: 8px; padding: 0 10px 0 6px;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: var(--sh-s);
  pointer-events: none;
}
.cln-map { width: 52px; height: 32px; flex: none; }
.cln-label span { font-weight: 800; font-size: 12px; color: var(--ink-soft); }
.cln-label b { margin-left: auto; padding: 2px 10px; background: var(--main); color: var(--paper); font-weight: 900; font-size: 16px; letter-spacing: .04em; }
/* 場所の名前（はじめに 大きく） */
.pop.is-stage { font-family: var(--font); font-weight: 900; font-size: 32px; color: var(--main); animation: stage-pop 1.1s steps(6) forwards; }
@keyframes stage-pop {
  0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
/* 歯が まるごと きれいになったときの ピカーン */
.cln-shine {
  position: absolute; z-index: 5; pointer-events: none;
  background: rgba(255,255,255,.95); mix-blend-mode: screen;
  animation: shine .8s steps(4) forwards;
}
.cln-shine.is-all { background: rgba(255,255,230,.9); }
@keyframes shine { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
/* きれいな歯の にっこり顔 */
.cln-face { position: absolute; z-index: 3; pointer-events: none; animation: face-in .5s steps(4); }
@keyframes face-in { from { transform: scale(0); } to { transform: scale(1); } }
/* シャカシャカ ×12 */
.cln-combo {
  position: absolute; z-index: 9; transform: translate(-50%, -50%); pointer-events: none;
  padding: 3px 10px; background: var(--paper); border: 3px solid var(--ink); box-shadow: var(--sh-s);
  font-family: var(--font-dot); font-size: 17px; white-space: nowrap; color: var(--main);
}
.cln-combo.is-hot { color: var(--red); animation: combo-hot .3s steps(2) infinite; }
@keyframes combo-hot { 50% { transform: translate(-50%, -50%) scale(1.1); } }

/* パーフェクト（金色） */
.result-badge.is-gold { background: #f6c935; color: var(--ink); }
.rec-goal.is-perfect { color: #b8860b; }
.rec-perfects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rec-pf {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
  border: 2px dashed var(--grid-bold); background: var(--main-bg);
  font-weight: 700; font-size: 10px; line-height: 1.3; text-align: center; color: #9aa1a5; word-break: keep-all;
}
.rec-pf i { font-style: normal; font-family: var(--font-dot); font-size: 18px; line-height: 1; color: #d4d9dc; }
.rec-pf.is-on { border: 2px solid var(--ink); background: #fff6d6; color: var(--ink); }
.rec-pf.is-on i { color: #e0a800; }
.rec-allpf { margin: 10px 0 0; padding: 8px 10px; background: #fff6d6; border: 2px solid var(--ink); font-weight: 800; font-size: 13px; line-height: 1.6; }
.rec-allpf small { display: block; text-align: right; font-size: 11px; color: var(--ink-soft); }

/* ---------- フロスの たからさがし ---------- */
.fls { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.fls-base { position: absolute; z-index: 1; pointer-events: none; }
/* まだ 見ていない すきまの「？」 */
.fls-q {
  position: absolute; z-index: 3; transform: translate(-50%, -50%); pointer-events: none;
  width: 22px; height: 26px; display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--ink);
  font-family: var(--font-dot); font-size: 15px; color: var(--main);
  animation: q-blink 1.2s steps(2) infinite;
}
@keyframes q-blink { 50% { transform: translate(-50%, calc(-50% - 3px)); } }
.fls-done {
  position: absolute; z-index: 2; transform: translate(-50%, -50%); pointer-events: none;
  width: 10px; height: 10px; background: #f6c935; border: 2px solid var(--ink);
}
.fls-pick { position: absolute; left: 0; top: 0; z-index: 8; pointer-events: none; transition: opacity .12s; }
/* シュッシュッの のこり（6この ます） */
.fls-meter {
  position: absolute; z-index: 9; transform: translate(-50%, -100%); pointer-events: none;
  display: flex; gap: 3px; padding: 4px 6px; background: var(--paper); border: 2px solid var(--ink);
}
.fls-meter.is-top { transform: translate(-50%, 0); }
.fls-meter i { display: block; width: 9px; height: 9px; background: var(--gray); }
.fls-meter i.is-on { background: var(--main); }
.pop.is-small { font-size: 16px; color: var(--ink-soft); }
/* 出てきたもの */
.fls-item { position: absolute; z-index: 7; pointer-events: none; animation: item-pop .45s steps(5); }
@keyframes item-pop { from { transform: scale(0) translateY(20px); } 70% { transform: scale(1.2); } to { transform: scale(1); } }
.fls-new {
  position: absolute; z-index: 9; transform: translate(-50%, -50%) rotate(-6deg); pointer-events: none;
  padding: 2px 8px; background: var(--red); color: var(--paper); border: 2px solid var(--ink);
  font-weight: 900; font-size: 13px; white-space: nowrap; animation: badge-in .4s steps(4);
}
/* みつけたもの（左下の トレー） */
.fls-tray { position: absolute; z-index: 4; padding: 6px 8px 8px; background: var(--paper); border: 3px solid var(--ink); box-shadow: var(--sh-s); }
.fls-tray-h { display: block; margin-bottom: 4px; font-weight: 800; font-size: 11px; color: var(--ink-soft); }
.fls-tray-in { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; min-height: 64px; }
.fls-slot { display: grid; place-items: center; height: 30px; background: var(--main-bg); border: 1px dashed var(--grid-bold); opacity: 0; }
.fls-slot.is-in { opacity: 1; animation: face-in .3s steps(3); }
.fls-slot img { max-width: 26px; max-height: 24px; width: auto; height: auto; }
.fls-say { max-width: calc(100% - 16px); }
/* 記録の画面：たからの ずかん */
.rec-zukan { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rec-zk {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 4px;
  border: 2px dashed var(--grid-bold); background: var(--main-bg); text-align: center;
}
.rec-zk img { height: 24px; width: auto; max-width: 40px; filter: brightness(0); opacity: .18; }
.rec-zk em { font-style: normal; font-weight: 700; font-size: 9.5px; line-height: 1.3; color: #9aa1a5; word-break: keep-all; }
.rec-zk small { font-family: var(--font-dot); font-size: 10px; color: var(--ink-soft); }
.rec-zk.is-on { border: 2px solid var(--ink); background: var(--paper); }
.rec-zk.is-on img { filter: none; opacity: 1; }
.rec-zk.is-on em { color: var(--ink); }
/* ⚠️ display:flex より強くしないと、hidden にしても見えたままになる */
.fls-meter[hidden] { display: none; }
/* フロス：とれた よごれ（数だけ） */
.rec-dirt { display: flex; flex-wrap: wrap; gap: 6px; }
.rec-dt { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: var(--main-bg); border: 2px solid var(--grid-bold); font-weight: 700; font-size: 11px; }
.rec-dt img { height: 16px; width: auto; }
.rec-dt b { font-family: var(--font-dot); font-weight: 400; font-size: 15px; }
/* ずかんの ミニかめおじぃ（本物の絵）は、まだのときも かげに */
.rec-zk img { object-fit: contain; }
/* よごれの かたまり（ごっそり）：くっついて 出て、ぽとっと 落ちる */
.fls-gunk { position: absolute; z-index: 7; pointer-events: none; animation: gunk-out 1s ease-in forwards; }
@keyframes gunk-out {
  0% { transform: scale(.4); }
  20% { transform: scale(1.3) translateY(-10px); }
  45% { transform: scale(1.1) translate(calc(var(--dx) * 20px), -26px) rotate(calc(var(--dx) * 20deg)); }
  100% { transform: translate(calc(var(--dx) * 50px), 160px) rotate(calc(var(--dx) * 120deg)); opacity: 0; }
}
.fls-dirt { position: absolute; z-index: 2; pointer-events: none; }
.fls-fx { position: absolute; z-index: 6; pointer-events: none; }
.fls-meter span { font-weight: 800; font-size: 10px; margin-right: 2px; align-self: center; }
.fls-floss { position: absolute; z-index: 5; pointer-events: none; }

/* 医院の名前（ホームの いちばん上・口コミの上） */
.menu-kicker.is-clinic { font-weight: 900; font-size: 15px; letter-spacing: .06em; }
.review-clinic { margin: 0 0 8px; font-weight: 900; font-size: clamp(16px, 4.8vw, 20px); letter-spacing: .03em; color: var(--main); }
.review-clinic[hidden] { display: none; }
/* 背の低い スマホ（iPhone SE など）：メニューが スクロールしないで 入るように、少しずつ 小さく
   ⚠️ メニューが スクロールできると、iPhone で 上が 切れて 見えることが あった（2026-10-07） */
@media (max-height: 700px) {
  #menu { --hero-h: clamp(90px, calc(100vh - 541px), 250px); }
  .menu-head { margin-top: calc(var(--safe-top) + 10px); }
  .title-tiles { --tile: 48px; }
  .title-sub { font-size: 24px; margin-top: 2px; }
  .card-icon { height: 64px; }
  .card { padding-bottom: 8px; gap: 4px; }
  .record-btn { margin-top: 8px; min-height: 34px; }
  .review { padding-top: 8px; }
  .review-btn { min-height: 44px; }
  .review-note { margin-top: 3px; }
}
@supports (height: 1svh) {
  @media (max-height: 700px) { #menu { --hero-h: clamp(90px, calc(100svh - 541px), 250px); } }
}

/* ---------- 演出（2026-10-24 Claude Design の案から） ---------- */
/* にじ色の むしばきん */
.is-rainbow { animation: rainbow 1.2s linear infinite; }
@keyframes rainbow { to { filter: hue-rotate(360deg) saturate(1.4); } }
.cln-germ.is-rainbow { animation: germ-bob 1.2s steps(2) infinite, rainbow 1.2s linear infinite; }
/* ドットの 光（四角が はじける） */
.bgo-ray { position: absolute; z-index: 9; width: 0; height: 0; pointer-events: none; }
.bgo-ray i { position: absolute; left: 0; top: 0; display: block; border: 2px solid var(--ink); animation: ray-out .6s cubic-bezier(.2,.8,.4,1) forwards; }
.bgo-ray.is-far i { animation-name: ray-out-far; }
@keyframes ray-out { 0% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(-46px) scale(.2); opacity: 0; } }
@keyframes ray-out-far { 0% { transform: translateY(0) scale(1.2); opacity: 1; } 100% { transform: translateY(-80px) scale(.3); opacity: 0; } }
/* 当たったとき：並びが ガタッ、甘いものが ゆらっ、当たったものは くるっと回って 消える */
.bgo-form.is-rattle { animation: form-rattle .26s steps(3); }
@keyframes form-rattle { 0%, 100% { translate: 0 0; } 33% { translate: -5px 2px; } 66% { translate: 4px -2px; } }
.bgo-sweet.is-wobble { animation: sweet-wobble .42s steps(4); }
@keyframes sweet-wobble { 0%, 100% { rotate: 0deg; } 25% { rotate: -9deg; } 50% { rotate: 7deg; } 75% { rotate: -4deg; } }
.bgo-sweet.is-out { transform: none; opacity: 1; animation: sweet-out .45s ease-out forwards; }
@keyframes sweet-out {
  0% { transform: scale(1); }
  30% { transform: translateY(-10%) scale(1.35) rotate(-12deg); }
  100% { transform: translateY(-40%) scale(0) rotate(40deg); opacity: 0; }
}

/* ---------- 記録が 出るときの 動き（2026-10-24 Claude Design の案から） ----------
   ⚠️ transform を もう 使っている ところは、translate・scale・rotate（べつの 書き方）で 動かして ぶつからないように */
@keyframes k-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes k-dropin { 0% { opacity: 0; translate: 0 -40px; } 60% { opacity: 1; translate: 0 6px; } 100% { opacity: 1; translate: 0 0; } }
@keyframes k-bubblein { 0% { opacity: 0; scale: .3; } 70% { opacity: 1; scale: 1.08; } 100% { opacity: 1; scale: 1; } }
@keyframes k-float { 0%, 100% { translate: 0 0; rotate: -2deg; } 50% { translate: 0 -8px; rotate: 2deg; } }
@keyframes k-popin { 0% { opacity: 0; scale: .5; } 70% { opacity: 1; scale: 1.08; } 100% { opacity: 1; scale: 1; } }
@keyframes k-spin { to { rotate: 360deg; } }
@keyframes k-confetti { 0% { transform: translateY(-40px) rotate(0); } 100% { transform: translateY(105vh) rotate(720deg); } }
@keyframes k-grow { 0% { transform: scaleY(0); } 70% { transform: scaleY(1.06); } 100% { transform: scaleY(1); } }
@keyframes k-unroll { 0% { opacity: 0; transform: scale(.85, .04); } 55% { opacity: 1; transform: scale(1.02, 1.04); } 100% { transform: scale(1, 1); } }
@keyframes k-twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.55) rotate(45deg); opacity: .6; } }
@keyframes k-glint { 0%, 70% { transform: translateX(-140%) skewX(-20deg); } 100% { transform: translateX(260%) skewX(-20deg); } }
@keyframes k-new { 0%, 100% { transform: rotate(8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.15); } }
@keyframes k-screenin { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes k-badge { 0% { opacity: 0; transform: translateY(-50px) rotate(-30deg) scale(1.4); } 60% { opacity: 1; transform: translateY(4px) rotate(-3deg) scale(.95); } 100% { opacity: 1; transform: translateY(0) rotate(-6deg) scale(1); } }
@keyframes k-slam { 0% { opacity: 0; transform: scale(2.6) rotate(-25deg); } 55% { opacity: 1; transform: scale(.88) rotate(-6deg); } 75% { transform: scale(1.06) rotate(-9deg); } 100% { opacity: 1; transform: scale(1) rotate(-12deg); } }
@keyframes k-slam-rot { 0% { opacity: 0; transform: scale(2.6) rotate(calc(var(--rot, -8deg) - 20deg)); } 55% { opacity: 1; transform: scale(.88) rotate(var(--rot, -8deg)); } 75% { transform: scale(1.06) rotate(calc(var(--rot, -8deg) - 3deg)); } 100% { opacity: 1; transform: scale(1) rotate(var(--rot, -8deg)); } }
@keyframes k-slam-hanko { 0% { opacity: 0; transform: scale(2.6) rotate(-15deg); } 55% { opacity: 1; transform: scale(.88) rotate(10deg); } 75% { transform: scale(1.06) rotate(6deg); } 100% { opacity: 1; transform: scale(1) rotate(8deg); } }

/* ボタン：押すと しずんで、はなすと ぽよんと もどる */
.btn-main, .btn-sub { transition: transform .22s cubic-bezier(.34,1.9,.5,1), box-shadow .22s cubic-bezier(.34,1.9,.5,1); }
.btn-main:active, .btn-sub:active { transition-duration: .04s; }

/* 紙ふぶき（おわりの画面・しょうじょう） */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: 0; display: block; border: 2px solid var(--ink); animation: k-confetti 3s linear infinite both; }

/* おわりの画面 */
.result-veil { animation: k-fade .25s both; }
.result-card { animation: k-dropin .5s cubic-bezier(.34,1.5,.5,1) both; }
.result-say { transform-origin: 100% 50%; animation: k-bubblein .4s cubic-bezier(.34,1.6,.5,1) .3s both; }
.result-kame img { transform-origin: 50% 100%; animation: k-float 2.4s ease-in-out infinite; }
.result-kame.is-happy img { animation: kame-hop .5s steps(4) 3, k-float 2.4s ease-in-out 1.5s infinite; }
.result-score { position: relative; isolation: isolate; }
.result-rays {
  position: absolute; z-index: -1; left: 50%; top: 55%; width: 300px; height: 300px; margin: -150px 0 0 -150px;
  border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(214,230,242,.9) 0 12deg, transparent 12deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation: k-spin 8s linear infinite;
}
.result.is-perfect .result-rays { background: repeating-conic-gradient(rgba(246,201,53,.45) 0 12deg, transparent 12deg 24deg); }
.result-badge { visibility: hidden; animation: none; transform: rotate(-6deg); }
.result-badge.is-show { visibility: visible; animation: k-badge .55s cubic-bezier(.34,1.5,.5,1) both; }
.result-stamp { visibility: hidden; }
.result-stamp.is-show { visibility: visible; }
.result-stamp-mark { animation: none; }
.result-stamp.is-show .result-stamp-mark { animation: k-slam .55s cubic-bezier(.3,1.3,.5,1) both; }
.result-stamp.is-show .result-stamp-text { animation: k-fade .3s .35s both; }

/* 記録の画面 */
.rec { animation: k-screenin .25s both; }
.rec-stampcard, .rec-game { animation: k-dropin .45s cubic-bezier(.34,1.5,.5,1) both; }
.rec-stamp.is-new { animation: k-slam-rot .55s cubic-bezier(.3,1.3,.5,1) .6s both; }
.rec-say { transform-origin: 100% 50%; animation: k-bubblein .4s cubic-bezier(.34,1.6,.5,1) .5s both; }
.rec-kame img { transform-origin: 50% 100%; animation: k-float 3.6s ease-in-out infinite; }
.rec-cert { position: relative; overflow: hidden; }
.rec-glint { position: absolute; top: 0; bottom: 0; left: 0; width: 30%; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(246,201,53,.55), transparent); animation: k-glint 3.2s ease-in-out 1s infinite; }
.rec-bars { position: relative; }
.rec-goal-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--red); opacity: .7; pointer-events: none; }
.rec-bar-fill { transform-origin: 50% 100%; animation: k-grow .5s cubic-bezier(.34,1.5,.5,1) both; }
.rec-bar-num { animation: k-fade .3s both; }
.rec-zk { position: relative; animation: k-popin .35s cubic-bezier(.34,1.6,.5,1) both; }
.rec-new {
  position: absolute; top: -9px; right: -7px; padding: 1px 5px;
  background: var(--red); color: var(--paper); border: 2px solid var(--ink);
  font-family: var(--font-dot); font-weight: 400; font-size: 10px; line-height: 1.3;
  animation: k-new 1.2s ease-in-out infinite;
}
.rec-pf.is-on i { display: inline-block; animation: k-twinkle 1.6s steps(3) infinite; }

/* しょうじょう */
.cert-wrap { animation: k-fade .25s both; }
.cert { animation: k-unroll .65s cubic-bezier(.34,1.3,.5,1) both; }
.cert-corner { animation: k-twinkle 1.2s steps(3) infinite; }
.cert-title span { display: inline-block; animation: k-dropin .45s cubic-bezier(.34,1.6,.5,1) both; }
.cert-title span.is-small { font-size: .7em; }
.cert-rank { animation: k-popin .45s cubic-bezier(.34,1.6,.5,1) 1.05s both; }
.cert-body { animation: k-fade .5s 1.25s both; }
.cert-date { animation: k-fade .5s 1.35s both; }
.cert-hanko { animation: k-slam-hanko .5s cubic-bezier(.3,1.3,.5,1) 1.7s both; }
.cert-close { animation: k-fade .3s 1.4s both; }

/* ---------- ホームと共通の動き（2026-10-24 Claude Design の案から） ----------
   ⚠️ もとの transform（タイトルの箱の 高さちがい・押したときの しずみ）と ぶつからないように、
      translate / rotate / scale を 別べつに 動かす
   ⚠️ 口コミの帯は、下から 出すと メニューが 一瞬 スクロールできてしまう。clip-path で 下から 見せて、
      せり上がる中身は 帯の中で 切る（overflow: hidden。ないと iPhone SE で 38px はみ出した） */
@keyframes k-hop { 0%, 34%, 100% { translate: 0 0; rotate: 0deg; scale: 1; } 6% { translate: 0 -14px; rotate: -4deg; } 12% { translate: 0 0; rotate: 0deg; scale: 1.08 .9; } 16% { translate: 0 -4px; scale: 1; } 20% { translate: 0 0; } }
@keyframes k-sway { 0%, 50%, 100% { rotate: 0deg; } 25% { rotate: -.8deg; } 75% { rotate: .8deg; } }
@keyframes k-wipeup { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes k-riseup { 0% { opacity: 0; translate: 0 50px; } 70% { opacity: 1; translate: 0 -5px; } 100% { opacity: 1; translate: 0 0; } }
@keyframes k-shine { 0%, 72% { transform: translateX(-120%) skewX(-20deg); } 88%, 100% { transform: translateX(520%) skewX(-20deg); } }
@keyframes k-nudge { 0%, 80%, 100% { translate: 0 0; } 86% { translate: 5px 0; } 92% { translate: 0 0; } 96% { translate: 3px 0; } }
@keyframes k-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
@keyframes k-hit { 0%, 52%, 100% { translate: 0 0; rotate: 0deg; } 58% { translate: 6px 0; rotate: 8deg; } 66% { translate: -2px 0; rotate: 0deg; } 74% { translate: 0 0; } }
@keyframes k-updown { 0%, 100% { translate: 0 -4px; } 50% { translate: 0 4px; } }
@keyframes k-pulse { 0%, 100% { scale: 1; } 50% { scale: 1.03; } }

/* 上：医院の名前 → は・み・が・き の箱が 順に 落ちてきて、そのあと ときどき 順に はねる */
.menu-kicker { animation: k-dropin .5s cubic-bezier(.34,1.5,.5,1) both; }
.title-tile { transform-origin: 50% 100%; animation: k-dropin .5s cubic-bezier(.34,1.6,.5,1) both, k-hop 4.2s ease-in-out 1s infinite; }
.title-tile:nth-child(1) { animation-delay: .05s, 1s; }
.title-tile:nth-child(2) { animation-delay: .12s, 1.14s; }
.title-tile:nth-child(3) { animation-delay: .19s, 1.28s; }
.title-tile:nth-child(4) { animation-delay: .26s, 1.42s; }
.title-sub { animation: k-popin .45s cubic-bezier(.34,1.6,.5,1) .4s both; }

/* かめおじぃは ふわふわ、ふきだしは ぽんと 出る */
.menu-hero-kame { transform-origin: 50% 100%; animation: k-float 3.6s ease-in-out infinite; }
.menu-say { transform-origin: 100% 50%; animation: k-bubblein .4s cubic-bezier(.34,1.6,.5,1) .7s both; }

/* カード：順に ぽんと 出て、そのあと ほんの少し ゆれる。押すと しずんで、ぽよんと もどる */
.card { transform-origin: 50% 100%; animation: k-popin .5s cubic-bezier(.34,1.6,.5,1) both, k-sway 6s ease-in-out infinite; transition: transform .22s cubic-bezier(.34,1.9,.5,1), box-shadow .22s cubic-bezier(.34,1.9,.5,1); }
.card:active { transition-duration: .04s; }
.card:nth-child(1) { animation-delay: .45s, 1.3s; }
.card:nth-child(2) { animation-delay: .55s, 2.1s; }
.card:nth-child(3) { animation-delay: .65s, 2.9s; }
.ci-hit { animation: k-hit 2.4s ease-in-out infinite; }
.ci-bob { animation: k-bob 1s steps(2) infinite; }
.ci-twinkle { animation: k-twinkle 1.4s steps(3) infinite; }
.ci-updown { animation: k-updown 1.2s ease-in-out infinite; }
.record-btn { animation: k-fade .4s .8s both; }

/* 口コミの帯：下から あらわれて、中身が せり上がる。ボタンには ときどき 光が 走り、› が ちょんちょん 動く */
.review { overflow: hidden; animation: stripe-flow 2.4s linear infinite, k-wipeup .5s cubic-bezier(.3,1,.5,1) .85s both; }
.review > * { animation: k-riseup .55s cubic-bezier(.34,1.4,.5,1) .95s both; }
.review > .review-btn { animation-delay: 1.06s; }
.review > .review-note { animation-delay: 1.14s; }
.review-btn { position: relative; overflow: hidden; transition: transform .22s cubic-bezier(.34,1.9,.5,1), box-shadow .22s cubic-bezier(.34,1.9,.5,1); }
.review-btn:active { transition-duration: .04s; }
.review-btn > span { position: relative; }
.review-btn > .review-shine {
  position: absolute; top: 0; bottom: 0; left: 0; width: 22%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(160,200,232,.9), transparent);
  transform: translateX(-120%) skewX(-20deg);
  animation: k-shine 6s ease-in-out 2.4s infinite both;
}
.review-arrow { flex: none; font-weight: 900; font-size: 24px; line-height: 1; color: var(--main); animation: k-nudge 6s ease-in-out 2.4s infinite; }

/* やり方カード：上から 落ちてきて、①②③が 順に 出る。「はじめる」が ゆっくり 息をする */
.howto-wrap { animation: k-fade .2s both; }
.howto { animation: k-dropin .5s cubic-bezier(.34,1.5,.5,1) both; }
.howto-steps li { animation: k-popin .35s cubic-bezier(.34,1.6,.5,1) .3s both; }
.howto-steps li:nth-child(2) { animation-delay: .42s; }
.howto-steps li:nth-child(3) { animation-delay: .54s; }
.howto-start { animation: k-pulse 1.4s ease-in-out .9s infinite; }

/* 「動きを へらす」設定の スマホでは、動きを すぐ おわらせる */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
/* ⚠️ 回る光（.result-rays）が 文字に かぶらないように、ほかの 行も 前に 出しておく */
.result-head, .result-badge, .result-line, .result-sub, .result-stamp, .result-btns { position: relative; z-index: 1; }
