/* r25（2026-10-30）：ステージ20クリア後の画面（stage20-clear.mjs が開く <dialog class="stage20-clear">）。
   ステージ10の THANK YOU（finale-autumn.css）と同じ作り：絵は縦横比を保って画面に収め（切らない）、余った所は同じ絵をぼかして敷く。 */
dialog.stage20-clear {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden;
  background: #7a3d1a; color: inherit;
}
dialog.stage20-clear::backdrop { background: transparent; }
dialog.stage20-clear::before {
  content: ''; position: absolute; inset: -40px;
  background: var(--s20-bg) center / cover no-repeat;
  filter: blur(18px) brightness(.75);
}
dialog.stage20-clear[open] { display: grid; place-items: center; animation: s20-in .45s ease-out both; }
@keyframes s20-in { from { opacity: 0; } to { opacity: 1; } }
/* r26：できるだけ画面の上から下まで広げる。足りない分は左右を少しだけ切る（左右それぞれ最大 4%＝3匹の毛先と飾りの外側まで。文字・3匹・ボタンは切らない）。
   それでも縦が余る背の高い画面では、上下に同じ絵のぼかしが見える */
.s20-art {
  position: relative; flex: none;
  width: min(max(100vw, calc(100vh * 1024 / 1536)), calc(100vw / .92));
  width: min(max(100vw, calc(100dvh * 1024 / 1536)), calc(100vw / .92));
}
.s20-art img { display: block; width: 100%; height: 100%; }
.s20-garden {
  position: absolute; padding: 0; border: 0; background: transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent; border-radius: 999px; overflow: hidden;
}
.s20-garden:focus-visible { outline: 3px solid #fff8ee; outline-offset: 2px; }
.s20-garden:active { background: rgba(255, 255, 255, .12); }
/* 押したくなるように、ときどき光がすっと横切る（THANK YOU と同じ） */
.s20-garden::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -30%; width: 22%; pointer-events: none;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 240, .55), rgba(255, 255, 255, 0));
  transform: skewX(-18deg); animation: s20-shine 3.2s ease-in-out 1.2s infinite;
}
@keyframes s20-shine { 0% { left: -30%; } 45%, 100% { left: 115%; } }
/* 閉じる（右上の ×。結果の画面に戻る）。r26：Coming Soon の × と同じデザイン（丸い半透明のクリーム色＋濃い茶色の ×）。絵の上に重ねるだけで、絵は縮めない */
.s20-close {
  position: absolute; z-index: 2;
  top: max(12px, calc(env(safe-area-inset-top, 0px) + 6px)); right: max(12px, calc(env(safe-area-inset-right, 0px) + 6px));
  width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, .75); background: rgba(255, 246, 226, .78); color: #4a2a14;
  font: 800 24px/1 system-ui, sans-serif; box-shadow: 0 2px 8px rgba(60, 30, 10, .25);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); -webkit-tap-highlight-color: transparent;
}
.s20-close::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; } /* 押せる範囲を少し広く（約60px） */
.s20-close:active { transform: scale(.94); }
@media (prefers-reduced-motion: reduce) { dialog.stage20-clear[open], .s20-garden::after { animation: none; } .s20-garden::after { display: none; } }

/* r26：画面より広い時も真ん中に置く（左右を同じだけ切る）。grid の中央寄せは、はみ出すと左に寄るため */
.s20-art { justify-self: start; margin-left: 50%; translate: -50% 0; }
dialog.stage20-clear[open] { grid-template-columns: 100%; grid-template-rows: 100%; } /* 列の幅を画面の幅にする（そうしないと列が絵の幅になり、真ん中に置けない） */
.s20-art { align-self: center; }
