/* s21-30 r58（2026-11-14）：通常レインボーの新しい絵と、スターレインボー（ステージ31から）の見た目。ルールは engine.mjs */
/* r58：通常レインボーの絵を差し替え（受け取った絵 received/r58/304、白い背景を透明にして余白を切っただけ）。大きさ・効果は今まで通り */
.art-rainbow { background-image: url('rainbow-soft-v1.webp?v=1'); }
.tile .art-rainbow { width: 102%; height: 102%; } /* 横長の絵なので、ほかの特殊ピースと同じくらいに見える大きさ */
/* r58：スターレインボー（received/r58/305）。盤面ではレインボーと同じ大きさ。生まれたばかりの1個（まだ変身させていない）は星がやさしく光る */
.art-star { background-image: url('star-rainbow-v1.webp?v=1'); }
.tile .art-star { width: 104%; height: 104%; }
.tile.star1 { position: relative; }
.tile.star1::after {
  content: ''; position: absolute; inset: 6%; pointer-events: none; border-radius: 30%;
  background: radial-gradient(circle at 30% 30%, #fff8c8e6 0 4%, transparent 9%), radial-gradient(circle at 74% 62%, #fff4b0cc 0 3%, transparent 8%), radial-gradient(circle at 22% 70%, #fffbe0cc 0 3%, transparent 7%);
  animation: star-twinkle 1.6s ease-in-out infinite;
}
@keyframes star-twinkle { 0%, 100% { opacity: 0; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.05); } }
.tile.star-born { animation: star-born .5s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes star-born { 0% { transform: scale(.4); filter: brightness(1.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); filter: none; } }
.star-spark { position: absolute; width: 14%; aspect-ratio: 1; margin: -7% 0 0 -7%; pointer-events: none; z-index: 5;
  background: radial-gradient(circle, #fffbe0 0 18%, #ffe27a99 30%, transparent 62%); border-radius: 50%; animation: star-spark .6s ease-out forwards; }
@keyframes star-spark { 0% { transform: translate(0, 0) scale(.5); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tile.star1::after, .tile.star-born { animation: none; } }
/* r58：ステージ一覧の「スターレインボー」チュートリアル（一覧の絵の下の小さなボタン） */
.tut-menu-star { display: block; margin: 8px auto 0; } /* r62：4項目の一覧の絵に入ったので使わなくなった（念のため残す） */

/* r59（2026-11-14）：スター＋スターの「光が走る」演出（app.mjs の starCrossFx）。淡い金色で、まぶしすぎないように中心だけ白く、ふちはやわらかく消える */
.star-beam { position: absolute; pointer-events: none; z-index: 6; border-radius: 999px; box-shadow: 0 0 10px #ffd27a66; }
.star-beam.h { background: linear-gradient(to bottom, transparent, #ffe6a080 25%, #fffbeae0 50%, #ffe6a080 75%, transparent); }
.star-beam.v { background: linear-gradient(to right, transparent, #ffe6a080 25%, #fffbeae0 50%, #ffe6a080 75%, transparent); }
/* r60（2026-11-14）：スターのドッキングの手応え。.star-contact＝当たった所の小さな光（スター＋ブロック／特殊ピース）、
   .star-charge＝スター＋スターで光をためる丸い光。どちらも淡い金色で、点滅はしない（app.mjs が1回だけ動かす） */
.star-contact, .star-charge { position: absolute; pointer-events: none; z-index: 6; border-radius: 50%; transform: translate(-50%, -50%); }
.star-contact { background: radial-gradient(circle, #fffbeaee 0 16%, #ffe6a0aa 34%, transparent 66%); }
.star-charge { background: radial-gradient(circle, #fffdf2f0 0 14%, #ffe8a8bb 32%, #ffd88a55 52%, transparent 70%); }

/* r62（2026-11-14）：ステージ31からのチュートリアル一覧（4項目の絵 tutorial/tut-menu-star-v1.webp 1170×1345。絵は受け取ったまま）。
   絵の枠の外の白は、角を丸く切り取って見せない（絵は変えない）。透明なボタンの位置は絵の各行・× に合わせた割合 */
#modal:has(.tut-menu.m4):not(#tm-a):not(#tm-b):not(#tm-c) { width: min(calc(100vw - 24px), calc((100vh - 40px) * 0.87), 440px); }
@supports (height: 100svh) { #modal:has(.tut-menu.m4):not(#tm-a):not(#tm-b):not(#tm-c) { width: min(calc(100vw - 24px), calc((100svh - 40px) * 0.87), 440px); } }
.tut-menu.m4 { aspect-ratio: 1170 / 1345; filter: drop-shadow(0 8px 18px #1d16304d); }
.tut-menu.m4 .tut-menu-art { filter: none; clip-path: inset(2.7% 1.1% 3.5% 1.1% round 9% / 7.8%); }
.tut-menu.m4 .tmh-star   { left: 3.8%; top: 18.2%; width: 92.3%; height: 17.6%; }
.tut-menu.m4 .tmh-basic  { left: 3.8%; top: 37.0%; width: 92.3%; height: 16.6%; }
.tut-menu.m4 .tmh-hammer { left: 3.8%; top: 54.6%; width: 92.3%; height: 16.7%; }
.tut-menu.m4 .tmh-box    { left: 3.8%; top: 72.5%; width: 92.3%; height: 17.5%; }
.tut-menu.m4 .tmh-close  { left: 84.2%; top: 4.2%; width: 11%; height: 9.6%; border-radius: 50%; }

/* r62：スターレインボーのチュートリアルの説明の絵（「つぎへ」を押すまで出したまま）。上のチュートリアルの枠（スキップ・やめる）より下に重ねる */
.st-plate { position: fixed; inset: 0; z-index: 9080; background: rgba(30, 16, 48, .42); display: grid; place-items: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) 8px max(12px, env(safe-area-inset-bottom, 0px)); box-sizing: border-box;
  animation: st-plate-in .28s ease-out both; }
.st-plate.out { animation: st-plate-out .22s ease-in both; }
.st-plate-box { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(calc(100vw - 16px), 520px); }
.st-plate-box img { display: block; width: 100%; height: auto; max-width: none; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  filter: drop-shadow(0 6px 14px #1d163055); animation: st-plate-pop .42s cubic-bezier(.3, 1.4, .5, 1) both; }
.st-plate .st-next, .st-plate .st-next:active { min-width: 168px; margin: 0; padding: 12px 34px; border: 3px solid #fff; border-radius: 999px;
  font: 800 20px/1.1 "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif; letter-spacing: .08em; color: #fff;
  background: linear-gradient(#ffb15c, #f07f22); box-shadow: 0 4px 0 #b85a14, 0 6px 14px #0003; cursor: pointer; transition: opacity .25s, transform .1s; -webkit-tap-highlight-color: transparent; }
.st-plate .st-next:active { transform: translateY(2px); box-shadow: 0 2px 0 #b85a14, 0 3px 8px #0003; }
.st-plate .st-next:disabled { opacity: .45; cursor: default; }
@keyframes st-plate-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes st-plate-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes st-plate-pop { from { transform: scale(.86); opacity: 0; } to { transform: none; opacity: 1; } }
/* r63（2026-11-15 ユーザー指示）：チュートリアルの上の枠の文字（STEP 表示・案内の文・スキップ・やめる）を、ゲームの丸い太字（--ui-font：英数字 Fredoka＋日本語 M PLUS Rounded 1c）に統一。
   すべてのチュートリアルに効く（文の中身・ボタンの働き・終わりのプレートは変えない）。変わる文は画像ではなく文字のまま */
.tut-panel .tut-step { justify-self: center; font: 800 12.5px/1.25 var(--ui-font, "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif);
  color: #fff; letter-spacing: .06em; padding: 4px 14px 5px; border-radius: 999px; background: linear-gradient(#ffb866, #f2862b); box-shadow: 0 2px 0 #c7651a; text-shadow: 0 1px 0 #c7651a99; }
.tut-panel .tut-msg { font: 800 17px/1.45 var(--ui-font, "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif); color: #6b3f78; text-shadow: 0 1px 0 #fff; }
@media (max-width: 720px) { .tut-panel .tut-msg { font-size: 16px; } }
.tut-panel:not(.done) .tut-btns button { font: 800 14px/1 var(--ui-font, "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif); letter-spacing: .04em;
  padding: 9px 18px; border-radius: 999px; border: 2px solid #fff; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tut-panel:not(.done) .tut-btns .tut-skip { background: linear-gradient(#fff5df, #ffd79b); color: #7a4314; box-shadow: 0 3px 0 #d79a52; }
.tut-panel:not(.done) .tut-btns .tut-quit { background: linear-gradient(#fff0f6, #f8c8dc); color: #a03f6e; box-shadow: 0 3px 0 #d78bb0; }
.tut-panel:not(.done) .tut-btns button:active { transform: translateY(2px); box-shadow: 0 1px 0 #c79a6a; }
/* スターレインボーの練習の案内（app.mjs の stMsg）：次にすること＝白い吹き出し、できた時＝ピンク。出る時に小さく弾む */
.tut-panel .tut-msg.st-do { justify-self: center; padding: 6px 14px; border-radius: 14px; background: #fffdf8; box-shadow: 0 0 0 2px #f6cfe0, 0 2px 6px #b0607f22; }
.tut-panel .tut-msg.st-ok { color: #d43d86; }
.tut-panel .tut-msg.st-pop { animation: st-msg-pop .38s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes st-msg-pop { from { transform: scale(.88); opacity: 0; } to { transform: none; opacity: 1; } }
.st-plate .st-next { font-family: var(--ui-font, "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif) !important; }
@media (prefers-reduced-motion: reduce) { .tut-panel .tut-msg.st-pop { animation: none; } }
/* r62：操作する2個をやわらかく光らせる（強い点滅はしない） */
#board .tile.st-blink { z-index: 1; animation: st-blink 1.3s ease-in-out infinite; }
@keyframes st-blink { 0%, 100% { filter: brightness(1) drop-shadow(0 0 0 #ffe6a000); } 50% { filter: brightness(1.18) drop-shadow(0 0 7px #ffe08ae6) drop-shadow(0 0 2px #fff8dc); } }
@media (prefers-reduced-motion: reduce) { .st-plate, .st-plate.out, .st-plate-box img { animation: none; } #board .tile.st-blink { animation: none; filter: drop-shadow(0 0 6px #ffe08ae6); } }