*,
*::before,
*::after {
  box-sizing: border-box;
}

/* コントローラーUI参考: 黒ベース + アクセント枠（Phaser タイトルと同系） */
:root {
  --ui-bg: #0a0a0a;
  --frame-color: #555555;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--ui-bg);
  color: #e8eaef;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo",
    "Segoe UI", sans-serif;
  overflow: hidden;
  /* タッチ中のページ移動・ズームを無効化 */
  touch-action: none;
  -ms-touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/*
 * 企画書「720px × 480px のアスペクト比」を守り、
 * Phaser 3 の Scale.FIT がブラウザいっぱいに拡大 (縦横比維持) する
 * ための親コンテナ。
 */
#game {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--ui-bg);
}

#game canvas {
  display: block;
  margin: 0 auto;
  /* UI・テキストをドット状に粗くしない（ゲーム内スプライトは NEAREST を個別適用） */
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
  touch-action: none;
}

/* 和水コン接続／切断の一時表示（canvas より前面） */
#nagomi-toast {
  position: fixed;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  max-width: min(92vw, 420px);
  padding: 10px 18px;
  background: rgba(20, 24, 32, 0.92);
  color: #e8eaef;
  border: 1px solid var(--frame-color, #555);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
  z-index: 1000000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  text-align: center;
}
#nagomi-toast.nagomi-toast--visible {
  opacity: 1;
}
