
:root {
  color-scheme: dark;
  --bg: #0f1216;
  --bg-elevated: #171b21;
  --bg-card: #1b2029;
  --border: #2a2f3a;
  --text: #e6e9ef;
  --text-muted: #9aa3b2;
  --accent: #66c0f4;
  --accent-strong: #4dd0e1;
  --badge-popular: #2e7d32;
  --badge-japan-only: #c2410c;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.site-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.site-title:hover { text-decoration: none; color: var(--accent); }

.site-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-nav a { color: var(--text-muted); font-size: 0.92rem; white-space: nowrap; }
.site-nav a:hover { color: var(--accent); }

.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  margin-top: 40px;
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer-inner p { margin: 4px 0; }

.page-intro h1 { font-size: 1.5rem; margin-bottom: 6px; }
.page-intro p { color: var(--text-muted); margin-top: 0; font-size: 0.92rem; }

.static-page h2 { margin-top: 28px; font-size: 1.15rem; }
.static-page p { color: var(--text); }

/* ランキングリスト */
.rank-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 44px 120px 1fr 130px;
  gap: 14px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.rank-num {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.rank-thumb-link { display: block; line-height: 0; }

.thumb, .thumb-placeholder {
  width: 120px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: #262b35;
  display: block;
}
.thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.rank-info { min-width: 0; }
.rank-title {
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.rank-title:hover { color: var(--accent); text-decoration: underline; }
.rank-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-stats { text-align: right; }
.stat-main { font-size: 1.15rem; font-weight: 700; color: var(--accent-strong); }
.stat-unit { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); margin-left: 2px; }
.stat-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  color: #fff;
  vertical-align: middle;
}
.badge-popular { background: var(--badge-popular); }
.badge-japan-only { background: var(--badge-japan-only); }

/* 個別ページ */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

.game-detail-head {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 24px;
}
.thumb-large {
  width: 320px;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}
.thumb-large.thumb-placeholder {
  width: 320px;
  height: 150px;
  font-size: 2.4rem;
}
.game-detail-head-info { flex: 1; min-width: 240px; }
.game-detail-head-info h1 { margin-top: 0; margin-bottom: 10px; font-size: 1.4rem; }
.game-desc { color: var(--text-muted); font-size: 0.92rem; }

.store-link {
  display: inline-block;
  margin-top: 10px;
  padding: 9px 18px;
  background: var(--accent);
  color: #06121a;
  font-weight: 700;
  border-radius: 6px;
}
.store-link:hover { background: var(--accent-strong); text-decoration: none; }

.game-detail-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.9rem;
}
.detail-table caption {
  text-align: left;
  font-weight: 700;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.detail-table th, .detail-table td {
  text-align: left;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}
.detail-table th {
  color: var(--text-muted);
  font-weight: 500;
  width: 40%;
  white-space: nowrap;
}

/* レスポンシブ */
@media (max-width: 640px) {
  .rank-row {
    grid-template-columns: 32px 90px 1fr;
    grid-template-areas:
      "num thumb info"
      "num thumb stats";
  }
  .rank-num { grid-area: num; }
  .rank-thumb-link { grid-area: thumb; }
  .rank-info { grid-area: info; }
  .rank-stats { grid-area: stats; text-align: left; margin-top: 4px; }
  .thumb, .thumb-placeholder { width: 90px; height: 42px; }
  .rank-title { white-space: normal; }

  .game-detail-tables { grid-template-columns: 1fr; }
  .site-nav { gap: 12px; }
}
