/* ふーっとチャレンジ！ S0 : 画面枠・縦向き案内 */
html, body {
  margin: 0; padding: 0; height: 100%;
  background: #000;               /* 黒帯（初期試作のみ許可。完成版デザインとしては未確定） */
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
}
#stage {
  position: fixed; inset: 0;
  height: 100vh; height: 100dvh;
  box-sizing: border-box;
  /* ノッチ・ホームバー等のセーフエリアを避ける */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  display: flex; align-items: center; justify-content: center;
}
#game {
  display: block; position: absolute; left: 0; top: 0;   /* 画面全体を覆う（セーフエリアの外も背景で埋める） */
  touch-action: none;             /* ドラッグ操作とスクロール・ズームを競合させない */
  -webkit-user-select: none; user-select: none;
}

/* 開発用デバッグボタン（?debug=1 のときだけJSが生成） */
#debugbar {
  position: fixed; left: 6px; top: 50%; transform: translateY(-50%); z-index: 5;
  display: flex; flex-direction: column; gap: 6px;
}
#debugbar button {
  font-size: 12px; padding: 4px 8px; border-radius: 6px;
  border: 1px solid #fff8; background: #000a; color: #fff;
}

/* 縦向き案内 */
#rotate-guide {
  display: none; position: fixed; inset: 0; z-index: 10;
  background: #1d3b2a; color: #fff; text-align: center;
  flex-direction: column; align-items: center; justify-content: center;
}
#rotate-guide .phone {
  width: 64px; height: 112px; border: 7px solid #fff; border-radius: 14px;
  margin-bottom: 28px; animation: turn 2.4s ease-in-out infinite;
  position: relative;
}
#rotate-guide .phone::after {
  content: ""; position: absolute; left: 50%; bottom: 7px; width: 18px; height: 4px;
  margin-left: -9px; background: #fff; border-radius: 2px;
}
#rotate-guide .main { font-size: 26px; font-weight: 700; line-height: 1.5; margin: 0 0 14px; }
#rotate-guide .sub  { font-size: 15px; line-height: 1.6; margin: 0; opacity: .85; }
@keyframes turn {
  0%, 20%  { transform: rotate(0deg); }
  60%, 100% { transform: rotate(-90deg); }
}
@media (orientation: portrait) and (max-width: 900px) {
  #rotate-guide { display: flex; }
}

/* ホーム画面追加の案内（通常表示で画面が低いときだけ、画面中央に表示。タップで閉じる） */
#hint {
  position: fixed; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: 62vw; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.82); color: #fff; font-size: 15px; line-height: 1.5; font-weight: 700;
  padding: 10px 10px 10px 16px; border-radius: 18px; border: 2px solid #fff6;
}
#hint[hidden] { display: none; }
#hint button {
  flex: none; min-width: 64px; height: 44px; border-radius: 22px; border: 0;
  background: #ff8a1f; color: #fff; font-size: 16px; font-weight: 800;
}
