/* ファミコン風レトロゲーム共通スタイル（arcade.css を補完） */

/* ドット絵をにじませず拡大 */
.fc-canvas {
  display: block; width: 100%; height: auto; margin: 0 auto;
  background: #000; border-radius: 6px; touch-action: none;
  image-rendering: pixelated; image-rendering: crisp-edges;
}

/* ブラウン管風スクリーン（走査線＋周辺減光） */
.fc-screen { position: relative; border-radius: 6px; overflow: hidden; }
.fc-screen::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(120% 100% at 50% 45%, transparent 62%, rgba(0,0,0,.32) 100%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
  border-radius: 6px;
}

/* テレビ枠（arc-board を上書きしてレトロ調に） */
.fc-tv {
  background: linear-gradient(160deg, #2b2b33, #17171d 70%);
  border: 1px solid #3a3a46; border-radius: 18px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.06), 0 10px 26px rgba(0,0,0,.45);
}

/* HUD をピクセルゲーム調に */
.fc-hud { font-family: 'Courier New', monospace; letter-spacing: .06em; }
.fc-hud b { color: #f8b800; }

/* 十字パッド＋ABボタン配置（fcController() が #fcPad に注入する標準UI） */
.fc-pad { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.fc-dpad { display: grid; grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(2, 54px); gap: 4px; }
.fc-dpad3 { grid-template-rows: repeat(3, 54px); gap: 3px; }
.fc-dpad .arc-key { max-width: none; padding: 0; height: 54px; font-size: 1.3rem; border-radius: 10px; }
.fc-dpad .sp2 { grid-column: span 3; }
.fc-dpad-c { display: block; align-self: center; justify-self: center; width: 26px; height: 26px;
  border-radius: 50%; background: #101016; border: 1px solid #2c2c38; }
.fc-btns { display: flex; gap: 12px; }
.fc-btn-ab {
  width: 66px; height: 66px; border-radius: 50%; border: none; cursor: pointer;
  background: radial-gradient(circle at 32% 28%, #ff6b6b, #b91c1c 75%);
  color: #fff; font-weight: 800; font-size: 1.05rem;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.35), 0 3px 8px rgba(0,0,0,.4);
  user-select: none; -webkit-user-select: none; touch-action: none;
}
/* パッド全域: 指が滑ってもページをスクロールさせない */
.fc-pad, .fc-pad * { touch-action: none; user-select: none; -webkit-user-select: none; }

/* ── 全画面プレイモード（body.fc-full）: 画面固定＋パッドをゲームに重ねる ── */
body.fc-full { overflow: hidden; }
body.fc-full .arc-board {
  position: fixed; inset: 0; z-index: 9990; margin: 0; padding: 0;
  border: none; border-radius: 0; background: #000;
}
body.fc-full .fc-screen {
  position: absolute; inset: 0; display: flex;
  align-items: flex-start; justify-content: center; background: #000; padding-top: env(safe-area-inset-top);
}
body.fc-full .fc-canvas {
  width: auto !important; height: auto !important;
  max-width: 100vw !important; max-height: calc(100vh - 175px) !important;
}
body.fc-full .arc-overlay { z-index: 9993; }
body.fc-full #fcPad {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9992; margin: 0;
  padding: 6px 14px calc(12px + env(safe-area-inset-bottom));
}
body.fc-full .fc-pad { margin-top: 0; }
body.fc-full .fc-ab-swap, body.fc-full .arc-pad-hint, body.fc-full .fc-btn-label { display: none; }
body.fc-full .fc-dpad button, body.fc-full .fc-btn-ab { opacity: .82; }
#fcFullExit {
  display: none; position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 9995;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid #555;
  background: rgba(20,20,28,.82); color: #ddd; font-size: 16px; cursor: pointer;
}
.fc-btn-ab:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.35); }
.fc-btn-ab.b2 { background: radial-gradient(circle at 32% 28%, #fbbf24, #b45309 75%); color: #1a1a1a; }
.fc-btn-label { text-align: center; color: #888; font-size: .68rem; margin-top: 4px; }

/* A/B入替リンク */
.fc-ab-swap { text-align: right; margin-top: 6px; }
.fc-ab-swap a { color: #667; font-size: .68rem; text-decoration: none; }
.fc-ab-swap a:hover { color: #99a; }

/* 隠しコマンド発動: ゲーセンモード（ネオン縁取り） */
@keyframes fcNeon {
  0%   { box-shadow: 0 0 14px 2px #f83800, inset 0 2px 0 rgba(255,255,255,.06); }
  25%  { box-shadow: 0 0 14px 2px #f8b800, inset 0 2px 0 rgba(255,255,255,.06); }
  50%  { box-shadow: 0 0 14px 2px #00b800, inset 0 2px 0 rgba(255,255,255,.06); }
  75%  { box-shadow: 0 0 14px 2px #3cbcfc, inset 0 2px 0 rgba(255,255,255,.06); }
  100% { box-shadow: 0 0 14px 2px #f83800, inset 0 2px 0 rgba(255,255,255,.06); }
}
.fc-konami { animation: fcNeon 3s linear infinite; }

/* レトロバッジ（一覧やオーバーレイで使用）
   ※ .gc-title のグラデ文字(text-fill-color:transparent)を継承すると見えなくなるので明示的に打ち消す */
.fc-tag {
  display: inline-block; padding: 2px 10px; border-radius: 4px;
  background: #7c2d12 !important; border: 1px solid #f97316;
  color: #fdba74 !important;
  -webkit-text-fill-color: #fdba74 !important;
  -webkit-background-clip: border-box !important; background-clip: border-box !important;
  font-size: .66rem; font-weight: 800; letter-spacing: .12em;
  filter: none; vertical-align: middle;
}

@media (max-width: 380px) {
  .fc-dpad { grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(2, 46px); }
  .fc-dpad3 { grid-template-rows: repeat(3, 46px); }
  .fc-dpad .arc-key { height: 46px; }
  .fc-btn-ab { width: 58px; height: 58px; }
}
