/* クリスマス版 r2（2026-11-08）：ステージクリア・失敗の結果画面を、受け取ったクリスマスの絵（高画質版）にする（見た目だけ）。
   r1 は 1 枚の絵を左右に分けた絵（幅 約 610px）。r2 は 1 枚ずつの高画質の絵（クリア 1002×1482、あと少し 1008×1490）。
   秋版（result-autumn.css）を写して、絵・位置・色をクリスマスの絵に合わせたもの。秋版のファイルは変えていない。
   result-xmas.mjs が結果画面の時だけ #modal に .rx-clear／.rx-fail（.rx-select／.rx-final も）を付ける。
   絵（theme/xmas-result/*-v2.webp）
     ・外側は透明。スコア欄は最初から空（「スコア」の文字だけ）。クリアの「のこり 🐾 手でクリア」は肉球を消して、そこに手数を出す
     ・星は絵の星の上に、金・白の星を重ねる
     ・select＝オレンジのボタンの文字を消した版、final＝さらに一言も消した版
   ボタン・アンケートは、今までのボタンそのもの（#next／#again／#choose／.survey-link）を、絵のボタンの上に透明で重ねる。位置は絵に対する割合。
   大きさ：秋版と同じ決め方（画面の幅−16px／画面の高さ−16px に収まる大きさ、最大 460px）。「あと少し！」は「ステージクリア！」と同じ倍率。 */
#modal.rx:not(#rx-a):not(#rx-b) {
  --rx-c: min(calc(100vw - 16px), calc((100vh - 16px) * 1002 / 1482), 460px);
  --rx-w: var(--rx-c);
  width: var(--rx-w); max-width: none; max-height: none; padding: 0; overflow: visible;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
#modal.rx-fail:not(#rx-a):not(#rx-b) { --rx-w: calc(var(--rx-c) * 1008 / 1002); }
@supports (height: 100svh) {
  #modal.rx:not(#rx-a):not(#rx-b) { --rx-c: min(calc(100vw - 16px), calc((100svh - 16px) * 1002 / 1482), 460px); }
}
#modal.rx:not(#rx-a):not(#rx-b) #modalBody {
  position: relative; width: 100%; height: calc(var(--rx-w) * 1482 / 1002); aspect-ratio: auto; padding: 0; margin: 0;
  background: url('theme/xmas-result/result-clear-xmas-v2.webp?v=1') center / 100% 100% no-repeat;
  filter: drop-shadow(0 10px 22px #0a1a2a55);
}
#modal.rx-select:not(#rx-a):not(#rx-b) #modalBody { background-image: url('theme/xmas-result/result-clear-select-xmas-v2.webp?v=1'); }
#modal.rx-final:not(#rx-a):not(#rx-b) #modalBody { background-image: url('theme/xmas-result/result-clear-final-xmas-v2.webp?v=1'); }
#modal.rx-fail:not(#rx-a):not(#rx-b) #modalBody { height: calc(var(--rx-w) * 1490 / 1008); background: url('theme/xmas-result/result-fail-xmas-v2.webp?v=1') center / 100% 100% no-repeat; }

/* 絵に描いてある文字・3匹は表に出さない（読み上げ用には残す） */
#modal.rx:not(#rx-a):not(#rx-b) .modalimg { display: none; }
#modal.rx:not(#rx-a):not(#rx-b) .medal, #modal.rx:not(#rx-a):not(#rx-b) h2, #modal.rx:not(#rx-a):not(#rx-b) #modalBody > p:not(.rx-moves):not(.rx-sub) {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ゲームの値：スコア（スコア欄の「スコア」の文字の下。絵の文字と同じこげ茶） */
#modal.rx:not(#rx-a):not(#rx-b) .resultscore {
  position: absolute; margin: 0; padding: 0; border: 0; background: none; box-shadow: none;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fredoka', 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', ui-rounded, system-ui, sans-serif;
  font-weight: 700; line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: #6e1206; text-shadow: 0 1px 0 #fff8;
}
#modal.rx-clear:not(#rx-a):not(#rx-b) .resultscore { left: 23.05%; top: 56.01%; width: 53.39%; height: 5.06%; font-size: calc(var(--rx-w) * .072); }
#modal.rx-fail:not(#rx-a):not(#rx-b) .resultscore { left: 25.10%; top: 59.60%; width: 49.50%; height: 4.50%; font-size: calc(var(--rx-w) * .066); }

/* ゲームの値：のこり手数。「のこり」「手でクリア」は絵の文字のまま、肉球を消した所に数字だけ（赤） */
#modal.rx:not(#rx-a):not(#rx-b) .rx-moves, #modal.rx:not(#rx-a):not(#rx-b) .rx-sub {
  position: absolute; margin: 0; display: flex; align-items: center; justify-content: center; white-space: nowrap;
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', ui-rounded, system-ui, sans-serif; font-weight: 800; line-height: 1;
}
#modal.rx:not(#rx-a):not(#rx-b) .rx-moves { left: 42.42%; top: 61.67%; width: 6.89%; height: 3.31%; overflow: visible; }
#modal.rx:not(#rx-a):not(#rx-b) .rx-moves span { display: none; }
#modal.rx:not(#rx-a):not(#rx-b) .rx-moves b {
  font-family: 'Fredoka', 'M PLUS Rounded 1c', ui-rounded, sans-serif; font-weight: 700; font-size: calc(var(--rx-w) * .047); color: #d42a10;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 #fff8;
}
#modal.rx:not(#rx-a):not(#rx-b) .rx-sub { left: 17.17%; top: 48.85%; width: 66.27%; height: 3.24%; font-size: calc(var(--rx-w) * .038); color: #6b2090; }

/* ゲームの値：星（絵の星から切り出した金・白の星を、絵の星の位置に重ねる） */
#modal.rx:not(#rx-a):not(#rx-b) .rx-stars { position: absolute; inset: 0; pointer-events: none; }
#modal.rx:not(#rx-a):not(#rx-b) .rx-stars i { position: absolute; background: center / 100% 100% no-repeat; }
#modal.rx:not(#rx-a):not(#rx-b) .rx-stars i.gold { background-image: url('theme/xmas-result/star-gold-xmas-v2.webp?v=1'); }
#modal.rx:not(#rx-a):not(#rx-b) .rx-stars i.pale { background-image: url('theme/xmas-result/star-pale-xmas-v2.webp?v=1'); }
#modal.rx:not(#rx-a):not(#rx-b) .rx-stars i.gold.s0 { left: 28.44%; top: 32.78%; width: 14.47%; height: 8.86%; }
#modal.rx:not(#rx-a):not(#rx-b) .rx-stars i.gold.s1 { left: 43.01%; top: 32.46%; width: 14.77%; height: 9.04%; }
#modal.rx:not(#rx-a):not(#rx-b) .rx-stars i.gold.s2 { left: 57.88%; top: 32.85%; width: 14.37%; height: 8.80%; }
#modal.rx:not(#rx-a):not(#rx-b) .rx-stars i.pale.s0 { left: 28.34%; top: 32.73%; width: 14.68%; height: 8.97%; }
#modal.rx:not(#rx-a):not(#rx-b) .rx-stars i.pale.s1 { left: 42.89%; top: 32.39%; width: 15.01%; height: 9.18%; }
#modal.rx:not(#rx-a):not(#rx-b) .rx-stars i.pale.s2 { left: 57.78%; top: 32.79%; width: 14.57%; height: 8.91%; }

/* ボタン：絵のボタンの上に透明で重ねる（文字は読み上げ用に残し、見えなくする）。ボタンの間のすき間までは少し広げて押しやすく */
#modal.rx:not(#rx-a):not(#rx-b) #modalBody button, #modal.rx:not(#rx-a):not(#rx-b) #modalBody .survey-link {
  position: absolute; display: block; margin: 0; padding: 0; min-height: 0; border: 0; border-radius: 999px;
  background: transparent; box-shadow: none; color: transparent; text-shadow: none; font-size: 0; overflow: hidden;
  -webkit-tap-highlight-color: transparent; cursor: pointer;
}
#modal.rx:not(#rx-a):not(#rx-b) #modalBody .survey-link { border-radius: calc(var(--rx-w) * .04); }
#modal.rx:not(#rx-a):not(#rx-b) #modalBody .survey-link b, #modal.rx:not(#rx-a):not(#rx-b) #modalBody .survey-link small { font-size: 0; color: transparent; }
#modal.rx:not(#rx-a):not(#rx-b) #modalBody button:active, #modal.rx:not(#rx-a):not(#rx-b) #modalBody .survey-link:active { background: #5a2a0a1f; }
/* iPhone が開いた時に自動で選ぶ枠線は出さない（秋版の「あと少し！」と同じ理由） */
#modal.rx:not(#rx-a):not(#rx-b) #modalBody button:focus, #modal.rx:not(#rx-a):not(#rx-b) #modalBody .survey-link:focus { outline: none; }
#modal.rx-clear:not(#rx-a):not(#rx-b) #next { left: 14.77%; top: 66.26%; width: 69.46%; height: 7.29%; }
#modal.rx-clear:not(#rx-a):not(#rx-b) #again { left: 14.77%; top: 73.68%; width: 69.46%; height: 6.88%; }
#modal.rx-clear:not(#rx-a):not(#rx-b) .survey-link { left: 10.48%; top: 80.97%; width: 78.34%; height: 9.18%; }
#modal.rx-fail:not(#rx-a):not(#rx-b) #again { left: 16.77%; top: 65.64%; width: 66.47%; height: 7.52%; }
#modal.rx-fail:not(#rx-a):not(#rx-b) #choose { left: 16.77%; top: 73.29%; width: 66.47%; height: 6.85%; }
#modal.rx-fail:not(#rx-a):not(#rx-b) .survey-link { left: 11.21%; top: 80.54%; width: 77.58%; height: 9.26%; }
/* ステージ10・20・30：オレンジのボタンの文字は「ステージを選んで遊ぶ」（絵の文字を消した版の上に、文字を出す） */
#modal.rx-select:not(#rx-a):not(#rx-b) #modalBody #next {
  display: flex; align-items: center; justify-content: center; gap: .4em; font-size: calc(var(--rx-w) * .054);
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', ui-rounded, system-ui, sans-serif; font-weight: 800; color: #fff;
  text-shadow: 0 0 2px #7a1a04, 0 2px 0 #8a2404, 1px 1px 0 #7a1a04, -1px -1px 0 #7a1a04, 1px -1px 0 #7a1a04, -1px 1px 0 #7a1a04;
}
