/* r99（2026-11-29）：クリスマスツリーの画面（xmas-tree.mjs）。ゲームの上に画面いっぱいに重ねる。ツリーの中身は xmas-tree/tree.html（iframe） */
dialog.xtree { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #120f17; overflow: hidden; outline: none; }
dialog.xtree::backdrop { background: #120f17; }
/* r100d：閉じている間（起動〜♪の選択の間）も、見えないまま描いておく（iPhone は表示されていない所の読み込み・絵の準備が進まないことがあるため）。
   透明・いちばん奥・触れない。開いた時（showModal）は通常どおり。閉じた後は .xtree-preload が外れて描画もやめる */
dialog.xtree.xtree-preload:not([open]) { display: block; opacity: 0; z-index: -1; pointer-events: none; }
/* r100c：ツリーの画面はふわっと出す。準備中（xtree-waiting）は絵の代わりに案内を出し、準備ができたら絵へ切り替える */
dialog.xtree[open] { animation: xtree-in .45s ease; } /* 終わった後は効果を残さない（閉じる時のフェード xtree-out を邪魔しない） */
@keyframes xtree-in { from { opacity: 0; } to { opacity: 1; } }
.xtree-frame { transition: opacity .5s ease; }
dialog.xtree.xtree-waiting .xtree-frame { opacity: 0; }
.xtree-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff7ea; opacity: 0; pointer-events: none; transition: opacity .4s ease;
  font: 700 15px/1.4 "Hiragino Maru Gothic ProN", "M PLUS Rounded 1c", system-ui, sans-serif; letter-spacing: .04em; text-align: center; padding: 0 24px; }
dialog.xtree.xtree-waiting .xtree-wait { opacity: 1; }
.xtree-wait-star { font-size: 34px; color: #f4d58b; text-shadow: 0 0 14px #ffd98a; animation: xtree-twinkle 1.4s ease-in-out infinite; }
@keyframes xtree-twinkle { 0%, 100% { opacity: .45; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }
/* r100：演出の後、Tap to Start の画面へやわらかく移る */
dialog.xtree { transition: opacity .45s ease; }
dialog.xtree.xtree-out, dialog.xtree.xtree-out::backdrop { opacity: 0; transition: opacity .45s ease; }
.xtree-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #120f17; }
.xtree-back { position: absolute; z-index: 2; left: calc(10px + env(safe-area-inset-left, 0px)); top: calc(10px + env(safe-area-inset-top, 0px));
  appearance: none; -webkit-appearance: none; border: 1px solid #e9b94999; border-radius: 999px; padding: 8px 14px; background: #1d120ed9; color: #fff7ea;
  font: 700 14px/1.2 "Hiragino Maru Gothic ProN", "M PLUS Rounded 1c", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
.xtree-back::before { content: '← '; }
.xtree-back:active { transform: scale(.96); }
/* スタート画面のボタン【仮】：Garden のボタンの下（絵のプレゼントの上）に重ねる文字のボタン */
.halloween-title .xtree-sign { position: absolute; left: 50%; top: 89.6%; transform: translateX(-50%); z-index: 3; appearance: none; -webkit-appearance: none;
  border: 2px solid #f4d58b; border-radius: 999px; padding: 7px 18px; background: #1d3b2bd9; color: #fff7ea; white-space: nowrap;
  font: 700 15px/1.2 "Hiragino Maru Gothic ProN", "M PLUS Rounded 1c", system-ui, sans-serif; box-shadow: 0 3px 10px #0006; -webkit-tap-highlight-color: transparent; }
.halloween-title .xtree-sign:active { transform: translateX(-50%) scale(.96); }
/* 確認版だけ（data-check）：日付を選ぶパネル */
/* r99b：左下の「🧪 21〜50」（高さ約 40px）と重ならないよう、その上に置く */
.xtree-test { position: absolute; z-index: 3; left: 0; right: 0; bottom: calc(54px + env(safe-area-inset-bottom, 0px)); padding: 6px 8px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; justify-content: center;
  background: #000b; color: #fff; font: 12px/1.3 system-ui, sans-serif; }
.xtree-test button, .xtree-test select { font: inherit; border-radius: 999px; border: 1px solid #fff6; background: #333; color: #fff; padding: 5px 10px; }
.xtree-test .xtree-test-main { background: #e9b949; color: #2b1b14; border-color: #e9b949; font-weight: 700; }
.xtree-test-info { width: 100%; text-align: center; opacity: .85; }
.xtree-test.xtree-test-fold > :not([data-a=fold]) { display: none; }
