/* ============================================================
   base.css — サイト全体の共通スタイル
   全ページで <link rel="stylesheet" href="/css/base.css"> を読み込むこと
   （common.css を読み込むゲームページは @import 経由で自動適用）
   ============================================================ */

/* ── Base font size ── */
:root {
  --base-font-size: 125%;  /* 1rem = 20px（シニア向け拡大） */
}

html {
  font-size: var(--base-font-size);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Color tokens (dark = default) ── */
:root {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --border: #2a2a50;
  --text: #e8e8f0;
  --text-sub: #8888aa;
  --accent: #a0c4ff;
}

html[data-theme="light"] {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-sub: #64748b;
  --accent: #2563eb;
}

/* ── Body base ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  touch-action: manipulation;
}

/* ── Top toolbar (share + theme) ── */
.top-toolbar {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 500;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Share buttons (X / Threads) ── */
.share-btn {
  display: inline-block;
  border-radius: 20px;
  padding: 6px 8px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-family: inherit;
  text-decoration: none;
  color: #fff;
  border: none;
  cursor: pointer;
}
.share-btn-x       { background: #000; }
.share-btn-threads { background: #1a1a1a; display: none; }

/* ── Theme toggle ── */
#theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}

/* ── Scroll to top button ── */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 900;
}
.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
}
