/* サンタの道を作れ game.css — style.css（デザイナー）に足りないゲーム固有の配置だけ */

html, body {
  overflow: hidden;
  touch-action: none;
}

.screen--stages { touch-action: pan-y; }

/* 準備中: ヒントと「しゅっぱつ！」 */
.ready {
  position: absolute;
  top: calc(var(--hud-h) + 72px + var(--safe-top));
  left: 50%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(480px, 86vw);
  transform: translateX(-50%);
  pointer-events: none;
}
.ready[hidden] { display: none; }
.ready .hint {
  position: static;
  max-width: 100%;
  transform: none;
  --tx: 0;
}
.ready__go { pointer-events: auto; min-width: 180px; }

.hud__clock { display: none; }

.sheet__actions--clear #btn-next { flex: 1 1 100%; }
.sheet__actions--clear .btn--small { flex: 1 1 40%; padding: 6px 8px; white-space: nowrap; }
.sheet__santa { margin: -6px auto -4px; width: 104px; height: 104px; }

.howto {
  margin: 4px 0 0;
  padding-left: 1.4em;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}
.howto li + li { margin-top: 6px; }

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--tray-h) + 28px + var(--safe-bottom));
  z-index: 40;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--c-ink);
  color: #fff;
  font-weight: 800;
  transform: translateX(-50%);
}
.toast[hidden] { display: none; }

.tray:empty { display: none; }
.drag-ghost[hidden] { display: none; }

@media (max-height: 420px) {
  .ready { top: calc(var(--hud-h) + 66px + var(--safe-top)); gap: 6px; }
  .ready .hint { padding: 5px 12px; font-size: 13px; }
  .ready__go { min-height: 44px; padding: 6px 20px; font-size: 17px; }
  .sheet__actions { margin-top: 10px; gap: 8px; }
  .sheet--clear { width: min(620px, 100%); padding: 10px 16px 12px; }
  .sheet--clear .result__list { grid-template-columns: repeat(3, 1fr); }
  .sheet--clear .result__row { flex-wrap: wrap; justify-content: center; gap: 2px 6px; font-size: 12px; }
  .sheet--clear .result__row .num { margin-left: 0; }
  .sheet__actions--clear #btn-next { flex: 1 1 0; min-height: 44px; font-size: 17px; }
  .sheet__actions--clear .btn--small { flex: 1 1 0; }
  .result__stars { margin: 2px 0 6px; }
  .result__row { padding: 3px 10px; }
}

@media (orientation: portrait) {
  .ready { top: calc(var(--hud-h) + 80px + var(--safe-top)); }
}

/* style.css の `.screen > :not(.screen__bg) { position: relative }` をプレイ画面の重ね部品で打ち消す */
.screen--play > .play__canvas,
.screen--play > .hud,
.screen--play > .tray,
.screen--play > .overlay,
.screen--play > .ready,
.screen--play > .rotate-tip,
.screen--play > .toast { position: absolute; }
.screen--play > .drag-ghost { position: fixed; }
.app > .overlay { z-index: 30; }

@media (max-width: 480px) {
  .hud__stage { padding-right: 4px; }
  .hud__stage-name { display: none; }
}

/* 画面切替の translateY やフォーカス移動で .app がスクロールしてずれるのを防ぐ */
.app { overflow: clip; }

.sheet__actions .btn { white-space: nowrap; }
@media (max-width: 480px) {
  .sheet__actions .btn { padding-left: 12px; padding-right: 12px; }
  .sheet--fail .sheet__actions .btn { font-size: 16px; }
}

/* 詰んだときの「やりなおす？」 */
.screen--play > .stuck {
  position: absolute;
  left: 50%;
  top: 40%;
  z-index: 15;
  transform: translateX(-50%);
  animation: pop-in var(--dur-mid) var(--ease-pop) both;
  --tx: -50%;
}
.stuck[hidden] { display: none; }
.stuck .btn { min-width: 200px; }

/* 失敗: あとどれくらいだったか */
.fail__progress {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 900;
  color: var(--c-red);
}

/* クリア: 家の演出が見えるよう下に寄せ、上は暗くしない */
#ov-clear {
  place-items: end center;
  background: linear-gradient(rgba(11, 20, 56, 0) 30%, rgba(11, 20, 56, 0.55));
}
#clear-best[hidden] { display: none; }
#clear-best { margin-left: 6px; }

/* 縦向き: 横向きの案内はミニマップ・ヒントの下（地面に重ならない位置）へ */
@media (orientation: portrait) {
  .screen--play > .rotate-tip { top: calc(var(--hud-h) + 236px + var(--safe-top)); bottom: auto; }
}
