/* s21-30 r1（2026-11-07）：ステージ21〜30 の障害物「肉球の焼印入り木箱」。
   1 マスに収まる木箱（耐久 2＝×の補強板つき、1＝肉球の焼印）。ブロックの色の面は付けない（木箱の絵だけ）。
   壊れる演出（板が外れる・本体が開く）は app.mjs の boxFx が #fx の上に重ねる。押せる範囲・重なり順は今のタイルのまま */
#board .tile.box {
  background: radial-gradient(circle at 50% 62%, #00000030, transparent 72%) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
#board .tile.box > .box-art {
  display: block; width: 100%; height: 100%;
  background-position: center; background-size: contain; background-repeat: no-repeat; /* 絵は下の .b2/.b1/.bo（shorthand だと絵が消えるので使わない） */
  filter: drop-shadow(0 2px 1px #2a140a80);
}
.box-art.b2 { background-image: url('theme/boxes/box-2-v3.png'); }
.box-art.b1 { background-image: url('theme/boxes/box-1-v3.png'); }
.box-art.bo { background-image: url('theme/boxes/box-open-v3.png'); }
/* s21-30 r2：新しい木箱の絵（正面・ほぼ正方形）。通常ブロックと同じくらいに見えるよう少しだけ内側へ */
/* r3：木箱の外形を通常ブロックと同じ大きさに（絵は 3 状態とも同じ正方形・角を少し丸くした v3） */
#board .tile.box > .box-art { width: calc(100% + 2px); height: calc(100% + 2px); margin: -1px; } /* タイルの枠（1px）の分も広げて、通常ブロックの外形と同じ大きさに */
/* s21-30 r2：GOAL 欄に 5 つ並ぶ時（GOAL 3＋キャンディ＋木箱）。スマホは 2 列だと 3 段目が欄の外に出て見えなかった → 3 列 2 段に */
@media (max-width: 720px) {
  #targets[data-n="5"] { grid-template-columns: repeat(3, auto); gap: 4px 7px; }
}
/* r3（ユーザー指示）：GOAL 欄を見やすく。アイコンはひと回り大きく（スマホ 23→27px、+17%）、数字は大きく太く。5 つ並んでも 2 段に収まる大きさ */
@media (max-width: 720px) {
  #targets .target { font-size: 18px; font-weight: 900; gap: 3px; letter-spacing: -.2px; line-height: 1; }
  #targets .mini { width: 27px; height: 27px; }
  #targets[data-n="5"] .target { font-size: 17px; gap: 2px; }
  #targets[data-n="5"] .mini { width: 26px; height: 26px; }
  .goals .hudlabel { margin-bottom: 3px; }
}
/* s21-30 r4：GOAL 欄が広がった分、左の 3 匹の枠が狭くなり、絵（125×--u）の左右が切れていた。
   絵の倍率を「枠の中の幅に収まる大きさ」までに制限する（収まる時は今までと同じ倍率＝変わらない）。
   GOAL が 5 つの時だけ、GOAL 欄の内側の余白とすき間を少し詰めて 3 匹の枠を広げる（アイコン・数字の大きさは r3 のまま） */
@media (max-width: 720px) {
  .mobile-dogs { container-type: inline-size; padding-left: 1px; padding-right: 1px; }
  .mobile-dogs > img, .mobile-dogs.idle-ready > .idle-dogs { --u: min(clamp(1px, calc((100vw - 214px) / 125), 1.16px), calc((100cqw - 1px) / 125)); }
  .play:has(#targets[data-n="5"]) { column-gap: 5px; }
  .hud:has(#targets[data-n="5"]) { gap: 5px; }
  .goals:has(#targets[data-n="5"]) { padding-left: 6px; padding-right: 6px; }
  #targets[data-n="5"] { column-gap: 5px; }
}
/* s21-30 r5（ユーザー指示）：上部のロゴを画面の真ん中に。
   ロゴの箱（.brand）は左右のボタンの間の真ん中にあり、右の「遊び方／チュートリアル」（約 75px）が左の ♪（58px）より広いぶん、
   390px の画面で約 9px 左に寄っていた。ロゴの絵（::after）だけを上部の段（.topbar＝画面の幅いっぱい）を基準に置き直す。
   絵の大きさ・デザイン、押せる範囲（.brand の箱）、上部の段の高さは今まで通り */
@media (max-width: 720px) {
  .topbar { position: relative; }
  .topbar .brand { position: static; }
  .topbar .brand::after { left: 50%; top: calc(env(safe-area-inset-top, 0px) + 1px); transform: translateX(-50%); }
}
@media (max-width: 350px) {
  #targets .target, #targets[data-n="5"] .target { font-size: 15px; }
  #targets .mini, #targets[data-n="5"] .mini { width: 23px; height: 23px; }
}
/* r3：キャンディの GOAL アイコン＝紫のキャンディのクッキー（季節に関係なく共通）。盤面のキャンディの絵・ルールは変えない */
.mini.candy-mini { background: url('theme/goal/goal-candy-v1.png') center / contain no-repeat !important; box-shadow: none !important; border-radius: 0; font-size: 0; }
.candy-target.done .mini.candy-mini { filter: grayscale(.4); }
.box-target .box-mini { box-shadow: none; background-color: transparent; }
.left-note { font-weight: 800; color: #b74864; }
/* ステージを始めた時に木箱を 3 回ふわっと光らせる（キャンディの点滅と同じ考え方） */
#board.box-hint .tile.box > .box-art { animation: box-hint 1.2s ease-in-out 3; }
@keyframes box-hint { 0%, 100% { filter: drop-shadow(0 2px 1px #2a140a80); } 50% { filter: drop-shadow(0 0 6px #ffe39a) brightness(1.18); } }
/* GOAL の並びの「残りの木箱」 */
.box-target .box-mini { display: inline-block; width: 22px; height: 22px; background: url('theme/boxes/box-2-v3.png') center / contain no-repeat; vertical-align: middle; }

/* 演出（#fx の上）：1 回目＝×の板 2 本が外れて飛ぶ、2 回目＝本体が開いて中身が出る */
.bx-fx { position: absolute; pointer-events: none; }
.bx-plank {
  position: absolute; left: 50%; top: 50%; width: 112%; height: 17%; margin: -8.5% 0 0 -56%;
  border-radius: 6px; background: linear-gradient(#f0a54e, #d37a28 55%, #b5601a);
  box-shadow: inset 0 1px 1px #ffd9a0, inset 0 -2px 2px #8a440f, 0 2px 3px #3a1b0866;
}
.bx-plank::before, .bx-plank::after { content: ''; position: absolute; top: 22%; width: 13%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #b9bcc3 55%, #7c808a); }
.bx-plank::before { left: 4%; } .bx-plank::after { right: 4%; }
.bx-chip { position: absolute; width: 16%; height: 9%; border-radius: 3px; background: linear-gradient(#eaa052, #b9671f); box-shadow: 0 1px 1px #5a2a0a80; }
.bx-shell { position: absolute; inset: 0; background: center / contain no-repeat; filter: drop-shadow(0 2px 1px #2a140a80); }
.bx-glow { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, #fff6c8 0%, #ffd25a99 35%, #ffd25a00 70%); }
/* r4：木箱から出たリン・クウ・ランの「Thanks!」（app.mjs の boxThanks） */
.bx-thanks { z-index: 4; pointer-events: none; user-select: none; filter: drop-shadow(0 2px 2px #3a1b0855); }
.tile.bx-new { animation: bx-new .34s cubic-bezier(.25, 1.6, .5, 1) both; }
@keyframes bx-new { 0% { transform: scale(.4); filter: brightness(1.6); } 100% { transform: scale(1); filter: none; } }
.tile.bx-shake { animation: bx-shake .12s linear 1; }
@keyframes bx-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-2px) rotate(-3deg); } 75% { transform: translateX(2px) rotate(3deg); } }
/* s21-30 r1b：確認ページだけの「🧪 21〜30」（app.mjs が data-check の時だけ作る） */
.chk-s21 { position: fixed; z-index: 2147483000; left: calc(8px + env(safe-area-inset-left, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); font: 700 13px/1.3 system-ui, sans-serif; }
.chk-s21 button, .chk-s21 button:active { font: inherit; transform: none; border-radius: 10px; border: 1px solid #fff9; background: #3b2a55e6; color: #fff; padding: 8px 12px; min-height: 40px; box-shadow: 0 2px 6px #0005; }
.chk-s21-panel { position: absolute; left: 0; bottom: 48px; width: min(300px, calc(100vw - 16px)); padding: 10px; border-radius: 14px; background: #fffaf2f5; color: #3a2a20; box-shadow: 0 6px 18px #0006; }
.chk-s21-panel[hidden] { display: none; }
.chk-s21-panel p { margin: 0 0 8px; }
.chk-s21-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.chk-s21-grid button { padding: 8px 0; background: #c8792b; }
.chk-s21-row { display: flex; gap: 6px; margin-top: 8px; }
.chk-s21-row button { flex: 1; }
.chk-s21-note { margin: 8px 0 0 !important; font-size: 12px; color: #6b5a4a; min-height: 1.2em; }
@media (prefers-reduced-motion: reduce) { #board.box-hint .tile.box > .box-art, .tile.bx-new, .tile.bx-shake { animation: none; } }

/* s21-30 r7（2026-11-08）：木箱のれんしゅう。キャンディの練習と同じく、狙う木箱を柔らかく3回光らせる（tutorial-r20.css の candy-focus と同じ動き。大きさ・位置は変えない） */
#board .tile.box.candy-focus { animation: candy-focus .9s ease-in-out .35s 3; }