/* ==========================================
   ホームページ（ゲーム一覧）
   共通部分は game-base.css
   ========================================== */
:root {
  --color-pink: #f472b6;
  --color-star: #fbbf24;
}

.home {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: grid;
  gap: 24px;
}

/* ==========================================
   Hero
   ========================================== */
.hero {
  display: flex;
  align-items: center;
  gap: 16px;
}
.hero__tento {
  flex: none;
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  animation: hero-bounce 1.2s ease-in-out infinite;
}
@keyframes hero-bounce {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}
.fx-reduced .hero__tento { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .hero__tento { animation: none; }
}
.hero__title {
  margin: 0;
  font-size: clamp(22px, 6vw, 32px);
  letter-spacing: .02em;
}
.hero__lead {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-muted);
}

/* ==========================================
   Cards
   ========================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cards > li { display: flex; }

.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-panel);
  transition: transform .15s ease, border-color .2s ease;
}
.card:hover,
.is-gamepad .card:focus { border-color: var(--color-border-strong); transform: translateY(-2px); }
.card:active { transform: scale(.99); }
.fx-reduced .card { transition: none; }

.card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0c1426;
}
.card__thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.card__thumb--shooter { background: radial-gradient(110% 90% at 50% 100%, rgba(6, 182, 212, .18), transparent 70%), #070d1f; }
.card__thumb--rhythm { background: radial-gradient(120% 90% at 50% 0%, rgba(124, 58, 237, .35), transparent 70%), #0a0520; }

/* 8パズル：実際の絵を正方形の盤面にして 3×3 に区切って見せる */
.card__thumb--puzzle { background: radial-gradient(90% 90% at 50% 50%, #16233f, #0c1426); }
.card__puzzle {
  position: absolute;
  top: 8%;
  bottom: 8%;
  left: 50%;
  translate: -50% 0;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: url("../../eight-puzzle/assets/images/picture.webp") center / cover no-repeat;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.card__puzzle::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent calc(33.33% - 1.5px), #0c1426 calc(33.33% - 1.5px) calc(33.33% + 1.5px), transparent calc(33.33% + 1.5px),
      transparent calc(66.66% - 1.5px), #0c1426 calc(66.66% - 1.5px) calc(66.66% + 1.5px), transparent calc(66.66% + 1.5px)),
    linear-gradient(180deg, transparent calc(33.33% - 1.5px), #0c1426 calc(33.33% - 1.5px) calc(33.33% + 1.5px), transparent calc(33.33% + 1.5px),
      transparent calc(66.66% - 1.5px), #0c1426 calc(66.66% - 1.5px) calc(66.66% + 1.5px), transparent calc(66.66% + 1.5px));
}
.card__hole {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 33.33%;
  height: 33.33%;
  background: #0c1426;
  z-index: 1;
}

.card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
}
.card__genre { margin: 0; font-size: 12px; font-weight: 700; color: var(--color-accent-light); }
.card__title { margin: 0; font-size: 20px; }
.card__desc { margin: 0; font-size: 14px; line-height: 1.6; color: var(--color-muted); }
.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}
.card__meta li {
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--color-muted);
}
.card__best {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-star);
  font-variant-numeric: tabular-nums;
}
.card__play {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  margin-top: auto;
  padding: 0 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
  color: var(--color-on-accent);
  font-weight: 800;
}
.card__play::after { content: "→"; }
.card__body > .card__play { margin-top: 10px; }

.home-footer {
  display: grid;
  gap: 4px;
  text-align: center;
  font-size: 12px;
  color: var(--color-muted);
}
.home-footer p { margin: 0; }
