/* ==========================================================
   スキマにサクッとゲームズ - style.css
   ========================================================== */

: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;
  --header-height: auto;
}

* {
  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;
}

/* ---------- ヘッダー ---------- */
.site-header {
  background: linear-gradient(135deg, var(--color-bg-alt), #26264a);
  border-bottom: 1px solid var(--color-border);
  padding: 2.2rem 1.5rem 1.8rem;
  text-align: center;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  font-size: 1.7rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.02em;
}

/* サイト名が長いため、狭い画面では1行に収まるまで縮める */
@media (max-width: 479px) {
  .logo {
    font-size: 1.32rem;
    letter-spacing: 0;
  }
}

.tagline {
  margin: 0.6rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ---------- 言語切替 ---------- */
.lang-switcher {
  margin-top: 0.8rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

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

html[dir="rtl"] .legal-table th,
html[dir="rtl"] .legal-table td {
  text-align: right;
}

/* ---------- 広告スペース ---------- */
.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: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot--top,
.ad-slot--bottom {
  /* 中央寄せを保ちつつ、狭い画面でも左右1.5rem以上のガターを確保する */
  margin-left: max(1.5rem, calc((100% - var(--max-width)) / 2));
  margin-right: max(1.5rem, calc((100% - var(--max-width)) / 2));
}

.ad-slot--middle {
  margin: 3rem auto;
}

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

.intro,
.about {
  padding: 2rem 0 1rem;
}

.intro h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.about h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.intro p,
.about p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* ---------- 更新情報 ---------- */
.news {
  padding: 0.5rem 0 0.5rem;
}

.news[hidden] {
  display: none;
}

.news__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.news__title {
  font-size: 1.1rem;
  margin: 0;
}

.news__more {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.news__more:hover,
.news__more:focus-visible {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.news__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  overflow: hidden;
}

.news__item + .news__item {
  border-top: 1px solid var(--color-border);
}

.news__link {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.85rem 1.1rem;
  text-decoration: none;
  color: var(--color-text);
  transition: background 0.2s ease;
}

.news__link:hover,
.news__link:focus-visible {
  background: rgba(108, 92, 231, 0.14);
}

.news__date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.news__genre {
  font-size: 0.7rem;
  color: var(--color-accent);
  border: 1px solid rgba(255, 217, 61, 0.35);
  background: rgba(255, 217, 61, 0.08);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  flex-shrink: 0;
}

.news__text {
  font-size: 0.92rem;
  flex: 1 1 12rem;
  min-width: 0;
}

.news__new {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #12121f;
  background: var(--color-accent);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  flex-shrink: 0;
}

/* ---------- 運営者のつぶやき ---------- */
.activity {
  padding: 0.5rem 0 2rem;
}

.activity[hidden] {
  display: none;
}

.activity__card {
  position: relative;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem 1.4rem;
  overflow: hidden;
}

.activity__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
}

.activity__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  margin: 0;
}

.activity__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: activity-pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes activity-pulse {
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .activity__pulse { animation: none; }
}

.activity__tag {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  flex-shrink: 0;
}

.activity__body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.activity__body::-webkit-scrollbar {
  width: 6px;
}

.activity__body::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.activity__item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.activity__item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.activity__date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.activity__theme {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(108, 92, 231, 0.14);
  border: 1px solid rgba(108, 92, 231, 0.35);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
}

/* 日英対訳カラム（日本語ページのみ2カラム。狭い画面では縦に積む） */
.activity__cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

@media (min-width: 720px) {
  .activity__body--bilingual .activity__cols {
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
  }
}

.activity__col {
  min-width: 0;
}

/* 2カラム時は言語の境目に区切り線を入れる */
@media (min-width: 720px) {
  .activity__body--bilingual .activity__col + .activity__col {
    border-left: 1px solid var(--color-border);
    padding-left: 1.4rem;
  }
}

@media (max-width: 719px) {
  .activity__body--bilingual .activity__col + .activity__col {
    border-top: 1px solid var(--color-border);
    padding-top: 0.9rem;
  }
}

.activity__lang {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0 0.35rem;
  margin-bottom: 0.35rem;
}

.activity__text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.75;
  white-space: pre-wrap;
}

/* ---------- ジャンルカードグリッド ---------- */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  padding: 1.5rem 0 1rem;
}

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

@media (min-width: 960px) {
  .genre-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.genre-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.8rem 1rem 1.4rem;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

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

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

.genre-card__title {
  font-size: 1rem;
  margin: 0 0 0.4rem;
  font-weight: 700;
}

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

.genre-card__badge {
  margin-top: 0.9rem;
  font-size: 0.7rem;
  font-weight: bold;
  color: #12121f;
  background: var(--color-accent);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

/* ---------- フッター ---------- */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  padding-bottom: 2rem;
}

.footer-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  font-size: 0.85rem;
}

.footer-nav a {
  text-decoration: none;
  color: var(--color-text-muted);
}

.footer-nav a:hover {
  color: var(--color-text);
}

.footer-copy {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  margin: 1.2rem 0 0;
}
