/* ==========================================================
   ジャンルハブページ 共通スタイル
   ========================================================== */

:root {
  --color-bg: #12121f;
  --color-bg-alt: #1a1a2e;
  --color-surface: #21213a;
  --color-primary: #6c5ce7;
  --color-primary-hover: #5a4bd1;
  --color-accent: #ffd93d;
  --color-text: #eaeaf5;
  --color-text-muted: #a3a3bf;
  --color-border: #33334d;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

/* ---------- ヘッダー ---------- */
.seo-breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.6rem 1.2rem 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.seo-breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.seo-breadcrumb a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

.hub-header {
  background: linear-gradient(135deg, var(--color-bg-alt), #26264a);
  border-bottom: 1px solid var(--color-border);
  padding: 1.4rem 1.5rem 1.6rem;
}

.hub-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hub-header__back {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
  font-size: 1.2rem;
  color: var(--color-text);
}

.hub-header__icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 auto;
}

.hub-header__title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
}

.hub-header__tagline {
  margin: 0.2rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ---------- 言語切替 ---------- */
.lang-switcher {
  margin-left: auto;
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.8rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  align-self: center;
}

/* ---------- RTL(アラビア語等)最低限対応 ---------- */
html[dir="rtl"] .game-card,
html[dir="rtl"] .hub-footer {
  text-align: right;
}

html[dir="rtl"] .lang-switcher {
  margin-left: 0;
  margin-right: auto;
}

/* ---------- 広告スペース ---------- */
.ad-slot {
  max-width: var(--max-width);
  margin: 1.5rem auto;
  padding: 1.2rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  text-align: center;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot--top, .ad-slot--bottom {
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

@media (min-width: 1140px) {
  .ad-slot--top, .ad-slot--bottom {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---------- メイン ---------- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hub-intro {
  padding: 1.6rem 0 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

/* ---------- ゲームグリッド ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  padding: 1.5rem 0 1rem;
}

@media (min-width: 640px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1rem 1.3rem;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.game-card:hover, .game-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: 0 12px 24px rgba(108, 92, 231, 0.25);
}

.game-card--placeholder {
  opacity: 0.55;
}

.game-card__icon {
  width: 76px;
  height: 76px;
  object-fit: contain;
  margin-bottom: 0.7rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.game-card__title {
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.game-card__desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin: 0;
  flex-grow: 1;
}

.game-card__badge {
  margin-top: 0.8rem;
  font-size: 0.68rem;
  font-weight: bold;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.game-card__badge--play {
  color: #12121f;
  background: var(--color-accent);
}

.game-card__badge--soon {
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--color-border);
}

/* ---------- フッター ---------- */
.hub-footer {
  margin-top: 2.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  padding: 1.5rem;
  text-align: center;
}

.hub-footer a {
  text-decoration: none;
  color: var(--color-primary);
  font-weight: bold;
  font-size: 0.9rem;
}

/* ---------- トースト ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 20px);
  background: var(--color-primary);
  color: #fff;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: bold;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  white-space: nowrap;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
