/* game/game.css：ゲーム一覧・個別ページ共通のデザイン */

.game-section {
  padding: 58px 0 84px;
}

.game-collection-lead {
  margin: 0 0 42px;
  color: var(--pencil);
  font-size: 15px;
  line-height: 1.9;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 28px;
}

.game-card {
  position: relative;
  display: flex;
  min-height: 360px;
  flex-direction: column;
  padding: 30px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.76);
  border: 2px solid var(--ink);
  border-radius: 9px 3px 8px 2px / 3px 8px 2px 9px;
  box-shadow: 5px 6px 0 rgba(22, 21, 15, 0.14);
}

.game-card:nth-child(even) {
  transform: rotate(0.45deg);
}

.game-card-number {
  position: absolute;
  top: 16px;
  right: 20px;
  margin: 0;
  color: rgba(22, 21, 15, 0.16);
  font-size: 54px;
  line-height: 1;
}

.game-card h2 {
  position: relative;
  margin: 28px 0 22px;
  font-size: clamp(25px, 4vw, 36px);
  line-height: 1.3;
}

.game-card > p:not(.game-card-number) {
  margin: 0 0 24px;
  color: var(--pencil);
  font-size: 14px;
  line-height: 1.9;
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.game-card-tags li {
  padding: 4px 11px;
  background: var(--yellow);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 12px;
}

.game-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 15px 18px;
  background: var(--ink);
  color: white;
  border: 2px solid var(--ink);
  font-size: 15px;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.game-card-link:hover {
  background: var(--yellow);
  color: var(--ink);
  transform: translateY(-3px);
}

.game-description {
  margin: 0 0 28px;
}

.game-description p {
  margin: 0 0 14px;
  color: var(--pencil);
  font-size: 15px;
  line-height: 1.9;
}

.game-description p:last-child {
  margin-bottom: 0;
}

.game-orientation-note {
  display: inline-block;
  margin: 0 0 32px;
  padding: 4px 14px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  transform: rotate(-1deg);
}

/* 版の表記。縦画面推奨の隣に並べる。
   同じ黄色にすると「推奨」と強さが並んでしまい、どちらも読まれなくなるので、
   こちらは線と文字だけの控えめな見た目にしてある。
   傾きは隣と逆向き(+1deg)。同じ向きだと平行に揃って手書きらしさが消える。 */
.game-version {
  display: inline-block;
  margin: 0 0 32px 10px;
  padding: 4px 14px;
  border: 2px solid var(--pencil);
  border-radius: 999px;
  color: var(--pencil);
  font-size: 13px;
  transform: rotate(1deg);
}

.game-frame-wrap {
  display: flex;
  justify-content: center;
}

.game-frame {
  position: relative;
  width: min(100%, 800px);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.84);
  border: 2px solid var(--ink);
  border-radius: 9px 3px 8px 2px / 3px 8px 2px 9px;
  box-shadow: 5px 6px 0 rgba(22, 21, 15, 0.14);
}

.game-frame--landscape {
  width: min(100%, 960px);
  aspect-ratio: 8 / 5;
}

/* 9:16 のゲーム用。既定の 1/1 だと縦長の画面が入りきらず、
   iframe の中でスクロールしないと下の操作が見えない。
   幅ではなく高さを基準にして、画面からはみ出さないようにする。 */
.game-frame--portrait {
  width: auto;
  max-width: 100%;
  height: min(78vh, 880px);
  aspect-ratio: 9 / 16;
}

.game-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.game-launch-button {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: var(--yellow);
  border: 0;
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(18px, 4vw, 24px);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.game-launch-button:hover {
  background: var(--ink);
  color: var(--yellow);
}

.game-launch-button span[aria-hidden] {
  font-size: 1.4em;
  transition: transform 160ms ease;
}

.game-launch-button:hover span[aria-hidden] {
  transform: translateX(3px);
}

.game-newtab-wrap {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.game-newtab-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.84);
  border: 2px solid var(--ink);
  border-radius: 7px 3px 9px 2px / 3px 8px 2px 9px;
  box-shadow: 3px 4px 0 rgba(22, 21, 15, 0.12);
  font-size: 15px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.game-newtab-button:hover {
  background: var(--yellow);
  box-shadow: 5px 6px 0 var(--ink);
  transform: translateY(-3px);
}

.game-section .back-link {
  display: inline-block;
  margin-top: 54px;
  color: var(--pencil);
}

@media (max-width: 780px) {
  .game-section {
    padding: 48px 0 69px;
  }

  .game-collection-lead {
    margin-bottom: 32px;
    font-size: 13px;
  }

  .game-grid {
    gap: 22px;
  }

  .game-card {
    min-height: 320px;
    padding: 24px;
  }

  .game-card:nth-child(even) {
    transform: none;
  }

  .game-description {
    margin-bottom: 22px;
  }

  .game-description p {
    font-size: 13px;
  }

  .game-orientation-note,
  .game-version {
    margin-bottom: 24px;
  }

  .game-newtab-button {
    width: 100%;
    justify-content: center;
  }

  .game-section .back-link {
    margin-top: 42px;
  }
}
