/* =========================================================
   ゲーム共通の見た目（上部バー・記事カード・コレクション・トースト）
   各ゲームの世界観（色・フォント）は、それぞれの index.html の <style> で上書きする
   ========================================================= */
body.game { --bar: 52px; min-height: 100vh; user-select: none; -webkit-user-select: none; line-height: 1.6; }
.game-bar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; height: var(--bar); padding: 6px 16px; background: #07070fe6; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); color: var(--ink); font-size: 1rem; }
.game-bar a { color: var(--ink-2); text-decoration: none; }
.game-bar a:hover { color: var(--neon-y); }
.game-bar-brand { display: flex; align-items: center; gap: 10px; }
.game-bar .brand-mark { width: 30px; height: 30px; font-size: 1.05rem; border-radius: 8px; }
.game-bar-back { font-weight: 700; }
.game-bar-name { font: 900 1rem var(--mono); letter-spacing: .24em; color: var(--neon-y); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-bar-nav { margin-left: auto; display: flex; align-items: center; gap: 12px; }
@media (max-width: 560px) { .game-bar-name { display: none; } .game-bar .found-meter span:first-child { display: none; } }

/* 1画面レイアウト：上部バーの下を、ちょうど画面の高さで使う（スクロールしなくてもゲーム全体が見える）
   .game-stage … 縦に「HUD → .game-screen（キャンバス）→ 操作ボタン → 説明」と並べ、余った高さを全部キャンバスに回す
   .game-side  … PC では右の列（はみ出したら列の中だけスクロール）、スマホではゲームの下（ページをスクロールして見る） */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; max-width: 1280px; margin: 0 auto; padding: 12px 16px; height: calc(100vh - var(--bar)); height: calc(100dvh - var(--bar)); }
.game-stage { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.game-screen { position: relative; flex: 1 1 0; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.game-screen > canvas { display: block; touch-action: none; }
.game-stage canvas { touch-action: none; }
.game-side { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; }
@media (max-width: 880px) {
  .game-layout { display: block; height: auto; padding: 8px 10px; }
  .game-stage { height: calc(100vh - var(--bar) - 16px); height: calc(100dvh - var(--bar) - 16px); }
  .game-side { overflow: visible; margin-top: 14px; }
}
/* 横に倒したスマホなど、高さが足りないときは説明文を省く */
@media (max-height: 560px) {
  .game-help { display: none; }
  .game-ov-box { padding: 12px 16px; }
  .game-ov h2 { font-size: 1.3rem; }
  .game-ov p { margin: 2px 0; font-size: 1rem; }
  .game-btn { margin-top: 8px; padding: 8px 18px; }
}

.game-hud { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; margin-bottom: 8px; font: 700 1rem var(--mono); color: var(--muted); }
.game-hud b { color: var(--ink); font-size: 1.15rem; }
.game-help { margin: 6px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.5; }

/* スタート・ゲームオーバーの重ね表示 */
.game-ov { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 12px; pointer-events: none; }
.game-ov[hidden] { display: none; }
.game-ov-box { pointer-events: auto; max-width: min(92%, 440px); max-height: 100%; overflow: auto; padding: 22px 26px; border-radius: 16px; background: #07070fe8; border: 1px solid var(--line-2); backdrop-filter: blur(4px); box-shadow: 0 20px 50px #000a; }
.game-ov h2 { margin: 0 0 6px; font: 900 1.9rem var(--mono); letter-spacing: .06em; color: var(--neon-y); }
.game-ov p { margin: 4px 0; color: var(--ink-2); font-size: 1rem; }
.game-btn { display: inline-block; margin: 12px 4px 0; padding: 10px 22px; border-radius: 999px; border: 0; background: var(--neon-y); color: #111; font: 900 1rem var(--font); cursor: pointer; text-decoration: none; }
.game-btn.sub { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.game-btn:disabled { opacity: .5; cursor: default; }

/* スマホの操作ボタン */
.game-touch { display: none; gap: 8px; margin-top: 8px; flex: none; }
.game-touch button { flex: 1; padding: 14px 0; border-radius: 12px; border: 2px solid var(--line-2); background: var(--panel); color: var(--ink); font: 900 1rem var(--font); touch-action: none; }
.game-touch button:active { background: var(--panel-2); }
@media (hover: none), (max-width: 880px) { .game-touch { display: flex; } .game-help { display: none; } }

/* 記事カード */
.game-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; animation: game-pop .35s ease; }
.game-card-label { padding: 8px 14px; font: 900 1rem var(--mono); letter-spacing: .2em; color: #111; background: var(--neon-y); }
.game-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.game-card-body { padding: 12px 14px 14px; }
.game-card h3 { margin: 0 0 4px; font-size: 1rem; line-height: 1.5; }
.game-card small { color: var(--muted); }
.game-read { display: inline-block; margin-top: 10px; padding: 7px 16px; border-radius: 999px; background: var(--neon-y); color: #111 !important; text-decoration: none; font-weight: 900; font-size: 1rem; }
.game-empty { color: var(--muted); font-size: 1rem; padding: 10px 0; }

/* コレクション */
.game-col-head { display: flex; justify-content: space-between; margin: 16px 0 6px; font: 700 1rem var(--mono); letter-spacing: .2em; color: var(--muted); }
.game-row { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 1rem; line-height: 1.45; animation: game-pop .35s ease; }
.game-row:hover { color: var(--neon-y); }
.game-row img, .game-row > span:first-child { width: 84px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--panel-2); }
.game-row small { display: block; color: var(--muted); font-size: 1rem; margin-top: 2px; }
.game-new { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; background: var(--neon-p); color: #fff; font: 900 1rem var(--mono); }

.game-toast { position: fixed; left: 50%; top: 64px; z-index: 60; transform: translate(-50%, -8px); max-width: 90vw; padding: 8px 16px; border-radius: 999px; background: var(--neon-y); color: #111; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.game-toast.on { opacity: 1; transform: translate(-50%, 0); }
.game-error { margin: 16px; padding: 12px 16px; border-radius: 10px; background: #3a0d1c; color: #ffd0dc; }
.game-noscript { padding: 40px 16px; text-align: center; }
@keyframes game-pop { from { transform: scale(.94); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .game-card, .game-row { animation: none; } .game-toast { transition: none; } }

/* カジノコーナー（07 BLACKJACK・08 POKER・09 SLOT）：チップの説明は常に画面に出す */
.casino-note { margin: 6px 0 0; padding: 6px 10px; border-radius: 8px; background: #0008; color: var(--ink-2); font-size: 1rem; line-height: 1.5; text-align: center; }
.casino-chips { display: inline-flex; align-items: baseline; gap: 6px; font: 700 1rem var(--mono); color: var(--muted); }
.casino-chips b { color: var(--neon-y); font-size: 1.25rem; }
