/* ==========================================================
   ge-mu.online ポータル共通スタイル(サーバーレンダリングページ用)
   スマホ最優先・quiz SPA(main.css)とトーンを揃える
   ========================================================== */

:root {
  --c-primary: #4f46e5;
  --c-bg: #f4f5fb;
  --c-surface: #ffffff;
  --c-text: #1e1b3a;
  --c-sub: #6b7280;
  --c-ok: #10b981;
  --c-ng: #ef4444;
  --radius: 18px;
  --shadow: 0 4px 20px rgba(30, 27, 74, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDGothic", Meiryo, system-ui, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- ヘッダー / フッター ---------- */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--c-surface);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-head__logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--c-primary);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-head__logo span { color: var(--c-text); }

.site-head__nav {
  display: flex;
  gap: 14px;
  align-items: center;
}

.site-head__nav a {
  color: var(--c-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.site-head__cta {
  background: var(--c-primary);
  color: #fff !important;
  padding: 7px 16px;
  border-radius: 999px;
}

.site-head__user { color: var(--c-primary) !important; }

.site-main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.site-foot {
  background: var(--c-surface);
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  text-align: center;
}

.site-foot__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-bottom: 10px;
}

.site-foot__links a {
  color: var(--c-sub);
  font-size: 12px;
  text-decoration: none;
}

.site-foot__copy { color: var(--c-sub); font-size: 11px; }

/* ---------- 汎用 ---------- */

.page-title { font-size: 22px; margin-bottom: 16px; }

.card {
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--c-primary), #7c3aed);
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

.btn--ghost {
  background: var(--c-surface);
  color: var(--c-primary);
  box-shadow: var(--shadow);
}

.notice { color: var(--c-ok); font-size: 13px; margin-bottom: 10px; font-weight: 700; }
.error { color: var(--c-ng); font-size: 13px; margin-bottom: 10px; font-weight: 700; }

.form label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 6px; }

.form input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid #dfe3f0;
  border-radius: 12px;
  font-size: 16px; /* iOSズーム防止 */
  background: #fbfcff;
}

.form input:focus { outline: none; border-color: var(--c-primary); }

.form .btn { margin-top: 20px; }

.form__hint { font-size: 12px; color: var(--c-sub); margin-top: 4px; }

.auth-alt { text-align: center; font-size: 13px; margin-top: 16px; color: var(--c-sub); }
.auth-alt a { color: var(--c-primary); font-weight: 700; }

/* ---------- ポータル: ゲームカード ---------- */

.hero {
  text-align: center;
  padding: 18px 0 22px;
}

.hero h1 { font-size: 26px; line-height: 1.4; }
.hero h1 span { color: var(--c-primary); }
.hero p { color: var(--c-sub); font-size: 14px; margin-top: 6px; }

.game-grid { display: grid; gap: 16px; }

.game-card {
  display: block;
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--c-text);
  transition: transform 0.15s ease;
}

.game-card:active { transform: scale(0.98); }

.game-card__thumb { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; display: block; }

.game-card__body { padding: 14px 16px 16px; }

.game-card__head { display: flex; align-items: center; gap: 10px; }

.game-card__title { font-size: 18px; font-weight: 800; }

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
}

.badge--live { background: var(--c-ok); }
.badge--dev { background: #f59e0b; }
.badge--coming { background: #94a3b8; }

.game-card__tagline { color: var(--c-sub); font-size: 13px; margin-top: 6px; line-height: 1.6; }

/* ---------- ランキング ---------- */

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }

.tabs a {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--c-sub);
  background: var(--c-surface);
  box-shadow: var(--shadow);
}

.tabs a.is-active { background: var(--c-primary); color: #fff; }

.rank-list { list-style: none; }

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--c-surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.rank-row__pos { font-size: 16px; font-weight: 800; width: 44px; color: var(--c-primary); }
.rank-row:nth-child(1) .rank-row__pos { font-size: 20px; }
.rank-row__name { flex: 1; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row__score { font-weight: 800; font-variant-numeric: tabular-nums; }
.rank-row__meta { font-size: 11px; color: var(--c-sub); }

.empty { text-align: center; color: var(--c-sub); padding: 30px 0; font-size: 14px; }

/* ---------- マイページ ---------- */

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }

.stat-box {
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 6px;
  text-align: center;
}

.stat-box b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat-box span { font-size: 11px; color: var(--c-sub); }

.history { list-style: none; }

.history li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px solid #eceef6;
  font-size: 13px;
}

.history__date { color: var(--c-sub); width: 84px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.history__game { flex: 1; font-weight: 700; }
.history__dev { font-weight: 800; color: var(--c-primary); }

.share-mini {
  border: none;
  background: #111;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.txn { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 4px; border-bottom: 1px solid #eceef6; }
.txn__delta { font-weight: 800; color: var(--c-ok); }

/* ---------- アーカイブ / 記事系 ---------- */

.archive-list { list-style: none; display: grid; gap: 8px; }

.archive-list a {
  display: block;
  background: var(--c-surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 13px 16px;
  text-decoration: none;
  color: var(--c-text);
  font-weight: 700;
  font-size: 14px;
}

.q-item { margin-bottom: 14px; }
.q-item__body { font-weight: 700; margin-bottom: 8px; line-height: 1.7; }
.q-item__choices { list-style: none; display: grid; gap: 6px; margin-bottom: 8px; }
.q-item__choices li { padding: 9px 12px; border-radius: 10px; background: #f2f3fa; font-size: 14px; }
.q-item__choices li.is-answer { background: #d9f5ea; font-weight: 700; }
.q-item__exp { font-size: 13px; color: var(--c-sub); line-height: 1.7; }

.prose { line-height: 2; font-size: 14px; }
.prose h2 { font-size: 16px; margin: 22px 0 8px; }
.prose p, .prose ul { margin-bottom: 12px; }
.prose ul { padding-left: 20px; }
