@charset "utf-8";

/* ========== ゲームページ専用スタイル ========== */

/* ゲームステージ（本体表示エリア） */
.game-stage {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 28px;
  aspect-ratio: 840 / 1080;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  position: relative;
  border: 3px solid #00E667;
}

/* ゲームコンテナ（Phaser parent） */
#game-container {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  background: #000;
}

#game-container canvas {
  display: block !important;
  margin: 0 auto !important;
  max-width: 100%;
  max-height: 100%;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
}

/* 全画面表示中のスタイル */
.game-stage:fullscreen,
.game-stage:-webkit-full-screen,
.game-stage:-moz-full-screen {
  max-width: none;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: #000;
}

.game-stage:fullscreen #game-container,
.game-stage:-webkit-full-screen #game-container {
  width: 100%;
  height: 100%;
}

/* ========== iOS 等向け 擬似全画面 ========== */
html.is-pseudo-fullscreen,
html.is-pseudo-fullscreen body {
  overflow: hidden !important;
  height: 100% !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-overflow-scrolling: auto;
}

html.is-pseudo-fullscreen body > header,
html.is-pseudo-fullscreen body > footer,
html.is-pseudo-fullscreen .ponna-ticker,
html.is-pseudo-fullscreen .site-nav,
html.is-pseudo-fullscreen .game-page-title,
html.is-pseudo-fullscreen .game-info {
  display: none !important;
}

html.is-pseudo-fullscreen .page-frame {
  max-width: none !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: #000 !important;
  flex: none !important;
}

html.is-pseudo-fullscreen #mainbox,
html.is-pseudo-fullscreen #contentsbox {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  text-align: center;
}

html.is-pseudo-fullscreen .game-stage {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  width: 100vw !important;
  height: 100% !important;
  height: 100dvh !important;
  max-width: none !important;
  margin: 0 !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: #000 !important;
  z-index: 9990;
}

html.is-pseudo-fullscreen .game-stage #game-container,
html.is-pseudo-fullscreen .game-stage #game-wrapper {
  width: 100% !important;
  height: 100% !important;
}

/* 擬似全画面中は終了ボタンを画面下部に固定表示 */
html.is-pseudo-fullscreen .btn-fullscreen {
  position: fixed !important;
  left: 50% !important;
  bottom: max(12px, env(safe-area-inset-bottom, 12px)) !important;
  transform: translateX(-50%) !important;
  z-index: 10000;
  max-width: min(320px, calc(100% - 32px));
  margin: 0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  opacity: 0.92;
}

html.is-pseudo-fullscreen .btn-fullscreen:active {
  transform: translateX(-50%) translateY(2px) !important;
}

/* 全画面ボタン */
.btn-fullscreen {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 28px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(180deg, #00E667 0%, #00b050 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 140, 60, 0.45);
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-fullscreen:hover {
  background: linear-gradient(180deg, #2ef07a 0%, #00c960 100%);
  transform: translateY(-1px);
}

.btn-fullscreen:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 140, 60, 0.45);
}

.btn-fullscreen:focus-visible {
  outline: 3px solid #00E667;
  outline-offset: 3px;
}

/* ゲーム説明・遊び方セクション */
.game-info {
  text-align: left;
  max-width: 640px;
  margin: 0 auto 32px;
  padding: 0 4px;
}

.game-info h2 {
  display: inline-block;
  margin: 0 0 12px;
  padding: 8px 22px;
  background-color: #00E667;
  border-radius: 999px;
  color: #fff;
  font-size: 1.15rem;
  font-weight: bold;
  box-shadow: 0 3px 0 rgba(0, 180, 80, 0.4);
  letter-spacing: 0.04em;
}

.game-info h3 {
  margin: 20px 0 8px;
  padding-left: 12px;
  border-left: 4px solid #00E667;
  font-size: 1.05rem;
  color: #222;
}

.game-info p {
  margin: 0 0 12px;
  line-height: 1.7;
  color: #333;
  font-size: 0.95rem;
}

.game-info ul,
.game-info ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
  line-height: 1.75;
  color: #333;
  font-size: 0.95rem;
}

.game-info li {
  margin-bottom: 6px;
}

.game-info .howto-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fff8e6;
  border: 1px solid #f0d78c;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #5a4a20;
}

/* ゲームタイトル（ページ内見出し） */
.game-page-title {
  margin: 4px 0 16px;
  font-size: 1.4rem;
  font-weight: bold;
  color: #222;
  text-align: center;
}

/* 戻るリンクなど */
.game-back-link {
  display: inline-block;
  margin: 8px 0 20px;
  font-size: 0.9rem;
  color: #00b050;
  text-decoration: none;
  font-weight: bold;
}

.game-back-link:hover {
  text-decoration: underline;
}

/* ナビの「ゲーム一覧」をカレントにしない場合の調整は不要 */

/* レスポンシブ */
@media screen and (max-width: 480px) {
  .game-stage {
    max-width: 100%;
    border-radius: 8px;
    border-width: 2px;
  }

  .btn-fullscreen {
    max-width: 100%;
    font-size: 0.95rem;
    padding: 11px 18px;
  }

  .game-info h2 {
    font-size: 1.05rem;
    padding: 7px 18px;
  }

  .game-page-title {
    font-size: 1.2rem;
  }
}

/* タッチデバイス向け：全画面ボタンを少し大きく */
@media (hover: none) and (pointer: coarse) {
  .btn-fullscreen {
    min-height: 48px;
  }
}
