/* =========================================================
   アソビバゲームズ 共通CSS
   - games-header.html / games-footer.html / game-screen-template.html 用
   - ゲームエリアは 16:9 を維持して画面内に収める
   ========================================================= */

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

:root {
  --red: #ff2538;
  --blue: #116ff5;
  --yellow: #ffbf00;
  --green: #1db84f;
  --purple: #7048ff;
  --pink: #ff5797;
  --ink: #151b33;
  --muted: #657089;
  --line: #e7ecf7;
  --soft: #f7fbff;
  --card: #ffffff;
  --shadow: rgba(34,52,100,.12);

  --fixed-header-h: 76px;
  --main-pad-x: 16px;
  --main-pad-top: 14px;
  --main-pad-bottom: 30px;
  --stage-max-w: 1920px;
  --stage-max-h: calc(100svh - var(--fixed-header-h) - var(--main-pad-top) - var(--main-pad-bottom));
}

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Zen Maru Gothic", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: #fff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ===== 共通ヘッダー ===== */
.games-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(22,33,60,.08);
  box-shadow: 0 6px 22px rgba(34,52,100,.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.games-header-inner {
  max-width: 1365px;
  min-height: 76px;
  margin: 0 auto;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
}

.games-logo {
  width: 174px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(180deg,#fff,#f7fbff);
  border: 4px solid #fff;
  box-shadow: 0 7px 0 rgba(255,37,56,.12), 0 12px 22px rgba(34,52,100,.12);
  display: grid;
  place-items: center;
  line-height: 1.05;
  transform: rotate(-2deg);
  font-family: "Fredoka", "Zen Maru Gothic", sans-serif;
  font-weight: 700;
}

.games-logo strong {
  display: block;
  font-size: 28px;
  letter-spacing: -.08em;
  background: linear-gradient(90deg,#ff2538,#ffbf00,#1db84f,#116ff5,#7048ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #fff);
}

.games-logo span {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #ffbf00;
  color: #151b33;
  font-size: 15px;
  border: 2px solid #151b33;
}

.games-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.games-nav a {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 58px;
  color: #2f3955;
  font-size: 12px;
  font-weight: 900;
}

.games-nav a .ico {
  font-size: 22px;
}

.games-nav a.active {
  color: var(--red);
}

.games-nav a.active::after {
  content: "";
  width: 30px;
  height: 3px;
  border-radius: 999px;
  background: var(--red);
}

.games-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.back-to-list {
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: linear-gradient(90deg,#116ff5,#2d91ff);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(17,111,245,.22);
}

/* ===== ゲーム画面メイン ===== */
.game-page-main {
  max-width: 100%;
  min-height: calc(100svh - var(--fixed-header-h));
  padding: var(--main-pad-top) var(--main-pad-x) var(--main-pad-bottom);
}

.game-shell {
  max-width: 1920px;
  margin: 0 auto;
}

.game-heading {
  max-width: 1365px;
  margin: 0 auto 12px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.game-heading-main {
  min-width: 0;
}

.game-kicker {
  color: var(--red);
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 4px;
}

.game-title {
  font-size: clamp(25px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -.05em;
}

.game-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.7;
  margin-top: 6px;
}

.game-meta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.game-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #e4eafa;
  color: #2f3955;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(37,68,130,.06);
}

.game-pill.primary {
  color: #fff;
  background: linear-gradient(90deg,#ff2538,#ff5e52);
  border-color: transparent;
}

/* ===== 16:9ゲームエリア ===== */
.game-stage-wrap {
  width: 100%;
  max-width: var(--stage-max-w);
  margin: 0 auto;
  padding: 0;
}

.game-stage {
  /*
    16:9を正しく維持するため、
    画面高さから逆算した最大幅も考慮する。
  */
  width: min(100%, calc(var(--stage-max-h) * 16 / 9), var(--stage-max-w));
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: #000;
  border-radius: 18px;
  border: 5px solid #fff;
  box-shadow:
    0 14px 0 rgba(17,111,245,.06),
    0 26px 48px rgba(34,52,100,.14),
    0 0 0 1px rgba(17,111,245,.08);
}

.game-canvas,
.game-stage > canvas,
.game-stage > iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.game-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(255,255,255,.72);
  background:
    radial-gradient(circle at 20% 20%, rgba(255,37,56,.24), transparent 28%),
    radial-gradient(circle at 80% 35%, rgba(17,111,245,.22), transparent 28%),
    linear-gradient(135deg, #151b33, #05070f);
}

.game-placeholder-title {
  font-family: "Fredoka", "Zen Maru Gothic", sans-serif;
  font-size: clamp(34px, 6vw, 72px);
  font-weight: 700;
  background: linear-gradient(90deg,#ff2538,#ffbf00,#1db84f,#116ff5,#7048ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(255,255,255,.08));
}

.game-placeholder-sub {
  margin-top: 10px;
  color: rgba(255,255,255,.72);
  font-size: 14px;
  font-weight: 900;
}

/* ===== ゲーム下情報 ===== */
.game-info-panel {
  max-width: 1365px;
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 18px;
}

.info-card,
.control-card {
  background: #fff;
  border: 2px solid #e9eef9;
  border-radius: 22px;
  box-shadow: 0 8px 0 rgba(17,111,245,.04), 0 16px 28px rgba(34,52,100,.08);
  padding: 22px;
}

.info-card h2,
.control-card h2 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.04em;
  margin-bottom: 10px;
}

.info-card p,
.info-card li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  font-weight: 800;
}

.info-card ul {
  padding-left: 1.3em;
  margin-top: 8px;
}

.control-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.game-btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid #e4eafa;
  background: #fff;
  color: #2f3955;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37,68,130,.06);
}

.game-btn.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(90deg,#ff2538,#ff5e52);
  box-shadow: 0 8px 0 rgba(191,31,43,.16), 0 16px 24px rgba(255,37,56,.18);
}

kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f7fbff;
  border: 1px solid #dce5f8;
  color: #116ff5;
  font-family: "Fredoka", monospace;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* ===== 共通フッター ===== */
.games-footer {
  position: relative;
  overflow: hidden;
  margin-top: 34px;
  padding: 54px 20px 28px;
  background: #fff;
  border-top: 1px solid #e9eef9;
}

.games-footer::before {
  content: "";
  position: absolute;
  left: -40px;
  right: -40px;
  bottom: -76px;
  height: 150px;
  background: linear-gradient(180deg,#9eea72,#58c96f);
  border-radius: 50% 50% 0 0 / 34% 34% 0 0;
}

.games-footer-inner {
  position: relative;
  z-index: 1;
  max-width: 1365px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 2fr 1.1fr;
  gap: 30px;
  align-items: start;
}

.footer-logo {
  display: inline-block;
  font-family: "Fredoka","Zen Maru Gothic",sans-serif;
  font-size: 30px;
  font-weight: 700;
  background: linear-gradient(90deg,#ff2538,#ffbf00,#1db84f,#116ff5,#7048ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.footer-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  font-weight: 800;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 20px;
}

.footer-col h3 {
  font-size: 13px;
  margin-bottom: 10px;
}

.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin: 7px 0;
}

.footer-copy {
  position: relative;
  z-index: 1;
  max-width: 1365px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

/* ===== レスポンシブ ===== */
@media (max-width: 1180px) {
  .games-header-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
  }

  .games-header-actions {
    display: none;
  }

  :root {
    --fixed-header-h: 148px;
  }

  .game-info-panel,
  .games-footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --fixed-header-h: 126px;
    --main-pad-x: 10px;
    --main-pad-top: 10px;
    --main-pad-bottom: 22px;
  }

  .games-header-inner {
    min-height: 126px;
    padding: 8px 12px;
  }

  .games-logo {
    width: 156px;
    height: 52px;
  }

  .games-logo strong {
    font-size: 24px;
  }

  .games-nav {
    gap: 8px;
  }

  .games-nav a {
    min-width: 46px;
    font-size: 10px;
  }

  .games-nav a .ico {
    font-size: 20px;
  }

  .game-heading {
    margin-bottom: 10px;
  }

  .game-stage {
    border-radius: 14px;
    border-width: 3px;
  }

  .info-card,
  .control-card {
    padding: 18px;
  }

  .footer-cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .games-nav a {
    min-width: 42px;
  }

  .games-nav a .nav-text-short {
    display: none;
  }
}


/* ===== 広告枠 ===== */
.game-layout-with-ads {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr) minmax(0, 160px);
  gap: 14px;
  align-items: start;
}

.game-center-column {
  min-width: 0;
}

.ad-side {
  width: 100%;
  min-height: min(600px, var(--stage-max-h));
  position: sticky;
  top: calc(var(--fixed-header-h) + 12px);
}

.ad-wide {
  width: min(100%, 728px);
  min-height: 90px;
  margin: 28px auto 0;
}

/* 忍者AdMaxを表示する実広告枠：仮置き枠の点線・背景は適用しない */
.game-ad-container {
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  outline: 0;
  overflow: hidden;
}

.game-ad-frame {
  display: block;
  border: 0;
  background: transparent;
}

.game-ad-frame--side {
  width: 160px;
  height: 600px;
}

.game-ad-frame--wide {
  width: 100%;
  max-width: 728px;
  height: 90px;
}

/* ===== クレジット欄 ===== */
.credit-card {
  grid-column: 1 / -1;
  background: #fff;
  border: 2px solid #e9eef9;
  border-radius: 22px;
  box-shadow: 0 8px 0 rgba(17,111,245,.04), 0 16px 28px rgba(34,52,100,.08);
  padding: 20px 22px;
}

.credit-card h2 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.04em;
  margin-bottom: 8px;
}

.credit-card p,
.credit-card li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
  font-weight: 800;
}

.credit-card ul {
  padding-left: 1.3em;
  margin-top: 6px;
}

.credit-card[hidden] {
  display: none !important;
}

/* 広い画面では、横幅よりゲーム表示サイズを優先。
   サイド広告でゲームが小さくなりすぎる場合は自動で下配置へ切替。 */
@media (max-width: 1320px) {
  .game-layout-with-ads {
    grid-template-columns: 1fr;
  }

  .ad-side {
    display: none;
  }
}

@media (max-width: 775px) {
  .ad-wide {
    position: relative;
    left: 50%;
    width: 320px;
    max-width: 100vw;
    min-height: 100px;
    transform: translateX(-50%);
  }

  .game-ad-frame--wide {
    width: 320px;
    max-width: none;
    height: 100px;
  }
}

@media (max-width: 720px) {
  .ad-wide {
    min-height: 100px;
    border-radius: 14px;
  }

  .credit-card {
    padding: 18px;
  }
}

/* ============================================================
   広告位置調整：左右バナーを画面端ではなくゲームエリア横に寄せる
   - 以前: 1920px幅のグリッド左右端に広告が配置され、端寄せに見えやすい
   - 修正: flexで「左広告 + ゲームエリア + 右広告」を中央寄せ
============================================================ */
.game-layout-with-ads{
  width:100%;
  max-width:none;
  margin:0 auto;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  gap:14px;
}

.game-center-column{
  width:min(100%, calc(var(--stage-max-h) * 16 / 9), var(--stage-max-w));
  max-width:var(--stage-max-w);
  min-width:0;
  flex:0 1 auto;
}

.game-stage-wrap{
  width:100%;
  max-width:none;
}

.game-stage{
  width:100%;
}

.ad-side{
  flex:0 0 160px;
  width:160px;
}

/* サイド広告込みで窮屈になる画面では、ゲーム表示を優先して左右広告を非表示 */
@media (max-width: 1320px){
  .game-layout-with-ads{
    display:block;
  }

  .game-center-column{
    width:100%;
    max-width:var(--stage-max-w);
    margin:0 auto;
  }

  .ad-side{
    display:none !important;
  }
}

/* =========================================================
   スマートフォン縦画面 / 共通全画面表示
============================================================ */
.games-fullscreen-control {
  position: absolute;
  z-index: 9000;
  top: 10px;
  right: 10px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 12px;
  color: #fff;
  background: rgba(6,22,48,.78);
  box-shadow: 0 7px 20px rgba(0,0,0,.22);
  font: 900 18px/1 system-ui,sans-serif;
  cursor: pointer;
  backdrop-filter: blur(9px);
}

.games-fullscreen-control:focus-visible {
  outline: 3px solid #70e8ff;
  outline-offset: 2px;
}

/*
  全画面は各ゲームに共通する主要操作です。
  小さな個別UIでも24px程度に縮むことがあるため、タッチ端末では
  見た目の調和を保ちつつ、40px四方の操作領域を確保します。
*/
@media (pointer: coarse), (max-width: 720px), (orientation: landscape) and (max-height: 600px) {
  .game-stage [data-games-fullscreen="true"].games-fullscreen-control-target {
    box-sizing: border-box !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center !important;
    flex: 0 0 40px !important;
    line-height: 1 !important;
  }
}

.games-orientation-hint {
  position: absolute;
  z-index: 8999;
  right: 50%;
  bottom: 8px;
  display: none;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: #f5fbff;
  background: rgba(5,20,44,.82);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(50%);
  backdrop-filter: blur(8px);
}

body.games-faux-fullscreen-active {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}

body.games-faux-fullscreen-active::before {
  position: fixed;
  z-index: 2147482998;
  inset: 0;
  content: "";
  background: #020713;
}

/*
  論理解像度が明示されたゲームCanvasは、親領域へcontain配置する。
  端末比率に合わせたwidth/height同時伸縮によるキャラクター・円形の変形を防ぐ。
*/
.games-canvas-host {
  position: relative;
}

canvas.games-canvas-fit[data-games-aspect-fit="true"] {
  position: absolute !important;
  inset: 50% auto auto 50% !important;
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 100% !important;
  aspect-ratio: var(--games-canvas-ratio) !important;
  transform: translate(-50%, -50%) !important;
  transform-origin: center !important;
}

.game-stage.games-faux-fullscreen {
  position: fixed !important;
  z-index: 2147483000 !important;
  top: 50% !important;
  left: 50% !important;
  width: min(100vw, calc(100svh * 16 / 9)) !important;
  max-width: none !important;
  height: min(100svh, calc(100vw * 9 / 16)) !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  aspect-ratio: 16 / 9 !important;
  box-shadow: none !important;
  transform: translate(-50%, -50%) !important;
}

/*
  スマートフォン横画面では16:9のレターボックスを解除し、端末の表示領域を
  ゲームステージとしてすべて使用する。ゲーム本体は各ページのレスポンシブ
  レイアウトまたはCanvasのリサイズ処理で縦横比を保つ。
*/
@media (orientation: landscape) and (max-height: 600px) {
  /* ページ内の横画面では、縦にスクロールできるため横幅を優先します。
     各ゲームが画面高だけを基準に縮小されるのを防ぎます。 */
  .game-center-column,
  .game-stage-wrap {
    width: 100% !important;
    max-width: none !important;
  }

  .game-stage:not(.games-faux-fullscreen) {
    width: 100% !important;
    max-width: none !important;
  }

  /* 正方形盤面は横幅だけで拡大すると下段が切れるため、利用可能な高さにも収める。 */
  .game-stage:not(.games-faux-fullscreen) .games-square-fit {
    width: auto !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    align-self: center !important;
    justify-self: center !important;
  }

  .game-stage.games-faux-fullscreen,
  .game-stage:fullscreen,
  .game-stage:-webkit-full-screen {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    width: 100dvw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    aspect-ratio: auto !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .game-stage.games-faux-fullscreen > :first-child,
  .game-stage:fullscreen > :first-child,
  .game-stage:-webkit-full-screen > :first-child {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
  }

  /* 固定解像度Canvasは論理解像度の比率を保ったまま中央配置する。 */
  .game-stage.games-faux-fullscreen .games-canvas-fit,
  .game-stage:fullscreen .games-canvas-fit,
  .game-stage:-webkit-full-screen .games-canvas-fit {
    position: absolute !important;
    inset: 50% auto auto 50% !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    height: 100% !important;
    max-height: 100% !important;
    aspect-ratio: var(--games-canvas-ratio, 16 / 9) !important;
    transform: translate(-50%, -50%) !important;
    transform-origin: center !important;
  }

  .games-canvas-fit-4x3 {
    --games-canvas-ratio: 4 / 3;
  }

  /* DOMで組み上げた正方形盤面も、画面内へ比率を保って収める。 */
  .game-stage.games-faux-fullscreen .games-square-fit,
  .game-stage:fullscreen .games-square-fit,
  .game-stage:-webkit-full-screen .games-square-fit {
    width: auto !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    align-self: center !important;
    justify-self: center !important;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  /* 個別ページが後段で .game-stage の比率を指定していても、全画面では端末全面を優先する。 */
  .game-stage.games-faux-fullscreen,
  .game-stage:fullscreen,
  .game-stage:-webkit-full-screen {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    width: 100dvw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    aspect-ratio: auto !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .game-stage.games-faux-fullscreen > :first-child,
  .game-stage:fullscreen > :first-child,
  .game-stage:-webkit-full-screen > :first-child {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
  }

  .game-stage.game-stage--portrait-stack {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: 9 / 14 !important;
  }

  .game-stage.game-stage--portrait-expand {
    width: 100% !important;
    max-width: 100% !important;
    height: var(--game-portrait-height, 560px) !important;
    max-height: none !important;
    aspect-ratio: auto !important;
  }

  .game-stage.game-stage--portrait-expand > :first-child {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
  }

  .game-stage--portrait-stack > :first-child > [class*="-shell"] {
    grid-template-columns: minmax(0,1fr) !important;
    grid-template-rows: minmax(0,1fr) clamp(150px,42vw,184px) !important;
  }

  .game-stage--portrait-stack > :first-child > [class*="-shell"] > [class*="-side"] {
    display: grid !important;
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    grid-template-rows: none !important;
    grid-auto-flow: row !important;
    grid-auto-rows: minmax(28px,auto) !important;
    align-content: start !important;
    gap: 4px !important;
    padding: 6px !important;
    overflow: auto !important;
  }

  .game-stage--portrait-stack > :first-child > [class*="-shell"] > [class*="-side"] > [class*="-brand"] {
    grid-column: 1 / -1 !important;
  }

  .game-stage--portrait-stack.games-faux-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    aspect-ratio: auto !important;
    transform: none !important;
  }


  .game-stage--portrait-expand.games-faux-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    aspect-ratio: auto !important;
    transform: none !important;
  }

  .game-stage--portrait-expand > .np-stage .np-grid {
    --np-cell: min(8.8vw, 36px) !important;
  }

  .game-stage.games-faux-fullscreen:not(.game-stage--portrait-stack):not(.game-stage--portrait-expand) .games-orientation-hint {
    display: block;
  }
}

/* ============================================================
   2026 header / footer refresh
   - indexのゲームポータルデザインと視覚統一
============================================================ */
:root {
  --fixed-header-h: 64px;
}

.games-header {
  border-bottom: 1px solid #dfe4ed;
  box-shadow: 0 3px 12px rgba(22,37,68,.06);
  background: rgba(255,255,255,.97);
}

.games-header-inner {
  width: min(1480px, calc(100% - 32px));
  max-width: none;
  min-height: 64px;
  padding: 0;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
}

.games-logo {
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  transform: none;
  white-space: nowrap;
}

.games-logo .games-brand-mark,
.footer-brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 3px;
  flex: 0 0 auto;
  padding: 5px;
  border-radius: 6px;
  background: #101a35;
  transform: rotate(-3deg);
}

.games-logo .games-brand-mark i,
.footer-brand-mark i {
  display: block;
  border-radius: 2px;
}

.games-logo .games-brand-mark i:nth-child(1),
.footer-brand-mark i:nth-child(1) { background: #f33636; }
.games-logo .games-brand-mark i:nth-child(2),
.footer-brand-mark i:nth-child(2) { background: #ffbe18; }
.games-logo .games-brand-mark i:nth-child(3),
.footer-brand-mark i:nth-child(3) { background: #12b9dc; }
.games-logo .games-brand-mark i:nth-child(4),
.footer-brand-mark i:nth-child(4) { background: #18a957; }

.games-logo .games-brand-text {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #101a35;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.04em;
}

.games-logo .games-brand-text > span {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: inherit;
}

.games-logo .games-brand-text > span:nth-child(1) { color: #f33636; }
.games-logo .games-brand-text > span:nth-child(2) { color: #f08b19; }
.games-logo .games-brand-text > span:nth-child(3) { color: #0879bd; }
.games-logo .games-brand-text > span:nth-child(4) { color: #18a957; }

.games-nav {
  height: 64px;
  gap: 26px;
  flex-wrap: nowrap;
}

.games-nav a {
  position: relative;
  min-width: 0;
  height: 64px;
  display: inline-flex;
  grid-template: none;
  gap: 7px;
  color: #101a35;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.games-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 0;
  width: auto;
  height: 3px;
  border-radius: 0;
  background: #f33636;
  transition: left .18s ease, right .18s ease;
}

.games-nav a:hover::after,
.games-nav a:focus-visible::after {
  left: 0;
  right: 0;
}

.games-nav a .ico {
  font-size: 17px;
  line-height: 1;
}

.back-to-list {
  height: 40px;
  padding: 0 16px;
  border: 1px solid #cfd6e2;
  border-radius: 6px;
  color: #101a35;
  background: #fff;
  font-size: 12px;
  box-shadow: none;
}

.back-to-list:hover,
.back-to-list:focus-visible {
  border-color: #f33636;
  color: #f33636;
  background: #fff5f5;
}

.game-breadcrumb {
  width: min(1365px, calc(100% - 32px));
  min-height: 38px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: #7b8498;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.game-breadcrumb a {
  color: #4d5a73;
}

.game-breadcrumb a:hover,
.game-breadcrumb a:focus-visible {
  color: #f33636;
}

.game-breadcrumb [aria-current="page"] {
  overflow: hidden;
  color: #101a35;
  text-overflow: ellipsis;
}

.games-footer {
  margin-top: 40px;
  padding: 40px 20px 22px;
  border-top: 1px solid #dfe4ed;
  background: #f7f8fa;
}

.games-footer::before {
  display: none;
}

.games-footer-inner {
  max-width: 1480px;
  grid-template-columns: 1.15fr 2fr .9fr;
  gap: 38px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  background: none;
  color: #101a35;
  -webkit-text-fill-color: currentColor;
  font-size: 21px;
}

.footer-brand-name {
  font-weight: 900;
}

.footer-text {
  color: #64708a;
  font-size: 12px;
  line-height: 1.8;
  font-weight: 700;
}

.footer-col h3 {
  color: #101a35;
  font-size: 13px;
  font-weight: 900;
}

.footer-col a {
  color: #64708a;
  font-weight: 700;
}

.footer-col a:hover,
.footer-col a:focus-visible {
  color: #f33636;
}

.footer-copy {
  max-width: 1480px;
  padding-top: 18px;
  border-top: 1px solid #e1e5ec;
  color: #7b8498;
  font-weight: 700;
}

@media (max-width: 1180px) {
  :root { --fixed-header-h: 108px; }

  .games-header-inner {
    min-height: 108px;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 56px 44px;
    justify-items: stretch;
    gap: 0 14px;
  }

  .games-logo { grid-column: 1; grid-row: 1; }

  .games-header-actions {
    display: flex;
    grid-column: 3;
    grid-row: 1;
  }

  .games-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 44px;
    justify-content: space-between;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .games-nav::-webkit-scrollbar { display: none; }

  .games-nav a {
    height: 44px;
    font-size: 11px;
  }

  .games-footer-inner {
    grid-template-columns: 1fr 2fr;
  }

  .games-footer-inner > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  :root { --fixed-header-h: 104px; }

  .games-header-inner {
    width: min(100% - 24px, 680px);
    min-height: 104px;
    padding: 0;
    grid-template-rows: 56px 40px;
  }

  .games-logo .games-brand-mark {
    width: 30px;
    height: 30px;
  }

  .games-logo .games-brand-text { font-size: 20px; }

  .back-to-list {
    height: 36px;
    padding: 0 12px;
    font-size: 11px;
  }

  .games-nav {
    height: 40px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    overflow-x: visible;
  }

  .games-nav a {
    height: 40px;
    min-width: 0;
    justify-content: center;
    gap: 3px;
    font-size: 9px;
  }

  .games-nav a .ico { font-size: 14px; }

  .game-breadcrumb {
    width: min(100% - 24px, 680px);
    min-height: 34px;
    font-size: 10px;
  }

  .games-footer-inner,
  .footer-cols {
    grid-template-columns: 1fr;
  }

  .games-footer-inner > :last-child { grid-column: auto; }
}

@media (max-width: 420px) {
  .games-nav a .nav-text-short { display: inline; }
}

/* ============================================================
   広告追従解除：左右バナーをスクロール追従させない
   右バナーだけ sticky が効くケースを防ぐため、左右とも通常配置に固定
============================================================ */
.ad-side{
  position:static !important;
  top:auto !important;
  align-self:flex-start;
}
