/* r98b（2026-11-23）：絵を正面向きの新しい3コマ（v2）に。r98（2026-11-22）：ステージ41〜50 の「びっくり箱」。絵は受け取った3コマ（jackbox_3states_69A99E8F）から切り出した theme/jackbox/*.webp。
   マスの絵：j2＝リボン付き、j1＝リボンが外れた箱。演出（#fx の上）：出る時の「ポンッ！」・リボンが飛ぶ・ハズレのいたずらワンコ・当たりのハート +5（ハートは仮の絵） */
#board .tile.jack > .jack-art, .jk-pop > .jack-art, .bx-fx > .jack-art {
  display: block; width: calc(100% + 2px); height: calc(100% + 2px); margin: -1px;
  background-position: center; background-size: contain; background-repeat: no-repeat;
  filter: drop-shadow(0 2px 1px #6a1a3a70);
}
.jk-pop > .jack-art, .bx-fx > .jack-art { position: absolute; inset: 0; }
.jack-art.j2 { background-image: url('theme/jackbox/jack-2-v5.webp'); }
.jack-art.j1 { background-image: url('theme/jackbox/jack-1-v5.webp'); }
#board .tile.jack.jack-wait { visibility: hidden; }
/* 出る時の「ポンッ！」 */
.jk-pop { z-index: 5; }
.jk-burst { position: absolute; inset: -45%; border-radius: 50%; background: radial-gradient(circle, #fff8d8 0%, #ffd2e6cc 32%, #ff8ab800 68%); }
.jk-pon { position: absolute; left: 50%; top: -8%; white-space: nowrap; font: 900 15px/1 var(--ui-font, "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif);
  color: #ff4f86; -webkit-text-stroke: 3px #fff; paint-order: stroke fill; text-shadow: 0 2px 3px #7a1d4a55; }
/* 1回目：飛んでいくリボン */
.jk-ribbon { z-index: 6; pointer-events: none; user-select: none; }
/* ハズレ：いたずらワンコ（バネで下から伸びる） */
.jk-lose { z-index: 6; pointer-events: none; user-select: none; transform-origin: 50% 100%; filter: drop-shadow(0 3px 3px #3a1b0855); }
/* 当たり：ハート +5（画面の上に置いて手数の数字へ飛ぶ） */
.jk-heart { position: fixed; z-index: 9500; pointer-events: none; filter: drop-shadow(0 4px 6px #a01a4a55); }
.jk-heart svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* r98o：金色のぷっくりハート（絵）。縦横比は app.mjs の HEART_ASPECT で箱の大きさを合わせてある。影は金色に合う茶色に（前はピンクのハートに合わせた赤紫） */
.jk-heart > img { display: block; width: 100%; height: 100%; max-width: none; pointer-events: none; user-select: none; -webkit-user-select: none; }
.jk-heart { filter: drop-shadow(0 4px 6px #7a4a0055); }
.moves.jk-bump strong { display: inline-block; animation: jk-bump .8s cubic-bezier(.3, 1.6, .5, 1) both; color: #ff3f7c; }
@keyframes jk-bump { 0% { transform: scale(1); } 30% { transform: scale(1.55); } 100% { transform: scale(1); } }
/* チュートリアルの説明カード（説明の絵がまだ無いので、文字と箱の絵＝仮） */
.jk-card { background: #fffaf2; border: 4px solid #ff9cc0; border-radius: 22px; padding: 16px 18px 18px; box-shadow: 0 8px 22px #1d163055; color: #5a2a3a;
  width: min(calc(100vw - 32px), 420px) !important; box-sizing: border-box; text-align: center; animation: st-plate-pop .42s cubic-bezier(.3, 1.4, .5, 1) both; }
.st-plate-box.jk-card img { width: 46%; max-width: 170px; filter: none; animation: none; }
.jk-card h3 { margin: 0; font: 900 21px/1.25 var(--ui-font, "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif); color: #e2457c; }
.jk-card p { margin: 0; font: 700 15.5px/1.6 var(--ui-font, "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif); }
/* チュートリアル一覧（ステージ41〜50）の下の「びっくり箱」ボタン */
.tut-menu-jack { display: flex; align-items: center; justify-content: center; gap: 8px; width: 86%; margin: 6px auto 2px; padding: 8px 12px; border-radius: 999px;
  border: 3px solid #fff; background: linear-gradient(#ff8db6, #f0598f); color: #fff; font: 900 18px/1.2 var(--ui-font, "M PLUS Rounded 1c", system-ui, sans-serif); box-shadow: 0 4px 0 #b8336a, 0 6px 12px #0003; }
.tut-menu-jack img { width: 38px; height: 38px; }
/* 確認ページだけのボタンが増えたので、パネルは画面の高さに収めてスクロール */
.chk-s21-panel { max-height: calc(100vh - 90px); overflow-y: auto; }
@media (prefers-reduced-motion: reduce) { .moves.jk-bump strong, .jk-card { animation: none; } }
/* r98c：当たりの時、リボンが外れた箱の絵（j1）を ふた（上 28%）と 箱（下）に分けて、ふたがパカッと開く */
.jk-win { z-index: 6; }
.jk-win > .jk-base { clip-path: inset(53.4% 0 0 0); } /* r98d：新しい絵（v3）ではふちの帯の下が 53.4% */
.jk-win > .jk-lid { clip-path: inset(0 0 46.6% 0); transform-origin: 8% 32%; }
/* r98d：ハズレ＝右のコマを2枚重ね。上＝ふたとワンコ（箱のふち --rim を支点に伸びる・箱の後ろから出る）、下＝箱（前のふちから下） */
.jk-lose > img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; user-select: none; -webkit-user-select: none; }
.jk-lose > .jk-lose-top { z-index: 1; clip-path: inset(0 0 calc(100% - var(--rim)) 0); transform-origin: 50% var(--rim); filter: drop-shadow(0 3px 3px #3a1b0855); }
.jk-lose > .jk-lose-box { z-index: 2; clip-path: inset(var(--rim) 0 0 0); transform-origin: 50% 100%; }
.jk-lose > .jk-burst { z-index: 0; inset: auto; left: 10%; width: 80%; top: calc(var(--rim) - 40%); height: 80%; }
/* r98e：ハズレの前に、閉じた箱（j1 v4）のふた（上 --lid）が奥の左を支点にパカッと開く */
.jk-lidwrap { z-index: 7; }
.jk-lidwrap > .jk-base { clip-path: inset(var(--lid) 0 0 0); }
.jk-lidwrap > .jk-lid { clip-path: inset(0 0 calc(100% - var(--lid)) 0); transform-origin: 8% 32%; }
/* r98h：ハートは最大の大きさで描いておき、縮めた所から拡大する（拡大でぼやけない）。動きは GPU でなめらかに */
.jk-heart { will-change: transform, opacity; backface-visibility: hidden; }
/* r98i：当たりのハートの手前に重ねる箱の前の面（ふたの下の辺から下）。ハートは周りのブロックより手前（z 9500）、これはさらに手前 */
.jk-heart-cover { position: fixed; z-index: 9501; pointer-events: none; }
.jk-heart-cover > .jack-art { position: absolute; inset: 0; display: block; background-position: center; background-size: contain; background-repeat: no-repeat; clip-path: inset(var(--lid) 0 0 0); filter: drop-shadow(0 2px 1px #6a1a3a70); }
/* r98j：当たりのハートが出ている間、箱のあったマスは空けておく */
#board .tile.jk-hold { visibility: hidden; }
/* r98k：+5 のカウントアップ。1ずつ増えるたびに数字が小さく「パッ」と弾む（最後の1回は今までの大きな弾み jk-bump） */
.moves.jk-tick strong { display: inline-block; animation: jk-tick .14s ease-out both; color: #ff3f7c; }
@keyframes jk-tick { 0% { transform: scale(1.32); } 100% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .moves.jk-tick strong { animation: none; } }
/* r98x：びっくり箱のれんしゅう専用。閉じた箱がカタカタ震えて、上に大きな ❓（中身は見せない） */
.jk-secret { z-index: 7; pointer-events: none; overflow: visible; }
/* r98y：❓は箱の後ろ（z 0）から上へせり上がる。位置と動きは app.mjs（jackSecretFx） */
.jk-secret > .jk-q { position: absolute; left: 50%; top: 0; z-index: 0; line-height: 1; font-style: normal; font-weight: 900; pointer-events: none; user-select: none;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 2px #fff) drop-shadow(0 3px 4px #7a1d4a66); transform-origin: 50% 90%; will-change: transform; }
.jk-secret > .jack-art { z-index: 1; }
/* r98（2026-11-25）：ステージ41〜50 のチュートリアル一覧＝5項目の絵（tutorial/tut-menu-jack-v1.webp 1170×1668）。
   上の4枚は 4項目の絵（1170×1345、star-rainbow.css の .m4）と同じ画素・同じ位置なので、位置（%）は .m4 の値 ×1345÷1668。5枚目＝不透明な枠 y1232〜1541 */
#modal:has(.tut-menu.m5):not(#tm-a):not(#tm-b):not(#tm-c) { width: min(calc(100vw - 24px), calc((100vh - 40px) * 0.70), 440px); }
@supports (height: 100svh) { #modal:has(.tut-menu.m5):not(#tm-a):not(#tm-b):not(#tm-c) { width: min(calc(100vw - 24px), calc((100svh - 40px) * 0.70), 440px); } }
.tut-menu.m5 { aspect-ratio: 1170 / 1668; filter: drop-shadow(0 8px 18px #1d16304d); }
.tut-menu.m5 .tut-menu-art { filter: none; clip-path: inset(2.18% 1.1% 2.82% 1.1% round 9% / 6.29%); }
.tut-menu.m5 .tmh-star   { left: 3.8%; top: 14.68%; width: 92.3%; height: 14.19%; }
.tut-menu.m5 .tmh-basic  { left: 3.8%; top: 29.84%; width: 92.3%; height: 13.39%; }
.tut-menu.m5 .tmh-hammer { left: 3.8%; top: 44.03%; width: 92.3%; height: 13.47%; }
.tut-menu.m5 .tmh-box    { left: 3.8%; top: 58.46%; width: 92.3%; height: 14.11%; }
.tut-menu.m5 .tmh-jack   { left: 3.8%; top: 73.86%; width: 92.3%; height: 18.53%; }
.tut-menu.m5 .tmh-close  { left: 84.2%; top: 3.39%; width: 11%; height: 7.74%; border-radius: 50%; }
