/* どのゲームでも共通の土台（スマホ縦画面・タッチ前提） */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0f172a; color: #fff;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  -webkit-text-size-adjust: 100%; }
/* ゲーム画面：スクロール・拡大・文字選択・長押しメニューを止める */
body.game { overflow: hidden; position: fixed; inset: 0; overscroll-behavior: none; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
#app { position: fixed; inset: 0; display: flex; justify-content: center; align-items: center; }
#stage { position: relative; overflow: hidden; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.overlay { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(15,23,42,.66); text-align: center; padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom); }
.overlay.show { display: flex; }
.overlay h2 { margin: 0 0 12px; }

.btn { display: block; width: min(280px, 80%); margin: 6px 0; padding: 13px; border: 0; border-radius: 12px;
  font: inherit; font-size: 17px; font-weight: 800; color: #fff; background: #334155; box-shadow: 0 4px 0 #1e293b; touch-action: manipulation; }
.btn.primary { background: #16a34a; box-shadow: 0 4px 0 #166534; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #1e293b; }
.btn[hidden] { display: none; }
.link-btn { color: #cbd5e1; font-size: 15px; padding: 10px; text-decoration: none; }
.icon-btn { position: absolute; top: calc(env(safe-area-inset-top) + 4px); right: 8px; width: 44px; height: 40px; border: 0;
  border-radius: 10px; background: rgba(15,23,42,.55); color: #fff; font-size: 18px; font-weight: 900; display: none; touch-action: manipulation; }
.icon-btn.show { display: block; }
button { touch-action: manipulation; }
