/* ============================================================
   common.css — サイト共通スタイル
   耳鳴り周波数チェックを基準に統一
   全ゲームページで <link rel="stylesheet" href="/css/common.css">
   ============================================================ */

/* ── Base font (base.css で一元管理) ── */
@import url('/css/base.css?v=2');

/* ── Game-specific color tokens (extend base.css tokens) ── */
:root {
  --primary: #60a5fa;
  --primary-light: #1e3a5f;
  --primary-dark: #93c5fd;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --left-color: #a78bfa;
  --left-light: #2d1b69;
  --right-color: #22d3ee;
  --right-light: #0e4a52;
  --radius: 18px;
  --shadow: 0 1px 4px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
}

html[data-theme="light"] {
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --left-color: #7c3aed;
  --left-light: #ede9fe;
  --right-color: #0891b2;
  --right-light: #cffafe;
  --shadow: 0 1px 4px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
}

/* ── Body (game pages) ── */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 14px 48px;
  max-width: 480px;
  margin: 0 auto;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

/* ── Header ── */
header,
.header {
  text-align: center;
  padding: 64px 16px 6px;
}
header h1,
.header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
header p,
.header p {
  font-size: 0.88rem;
  color: var(--text-sub);
}
.header-tip {
  font-size: 0.88rem;
  color: var(--text-sub);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  margin: 8px auto 0;
  max-width: 340px;
  text-align: center;
  line-height: 1.5;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

/* ── Fixed top-left: back link ── */
.back-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ── top-toolbar, share-btn, #theme-toggle → base.css に移動済み ── */

/* ── Info card ── */
.info-card {
  width: min(92vw, 360px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 8px 0;
}
.info-card h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.info-card p {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.6;
}

/* ── Result card ── */
.result-card {
  width: min(92vw, 360px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}
.result-icon { font-size: 2.4rem; margin-bottom: 8px; }
.result-score,
.result-time {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}
.result-rank {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.result-detail {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 16px;
}
.result-share-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

/* ── History card ── */
.history-card {
  width: min(92vw, 360px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 8px;
}
.history-card h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 10px;
}

/* ── Buttons (primary / secondary) ── */
.btn-primary {
  display: block;
  width: min(92vw, 360px);
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin: 8px 0;
  transition: opacity 0.15s;
}
.btn-primary:active { opacity: 0.8; }
.btn-secondary {
  display: block;
  width: min(92vw, 360px);
  padding: 12px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-sub);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin: 4px 0;
  transition: border-color 0.15s;
}

/* ── Screens (multi-screen apps) ── */
.screen { display: none; flex-direction: column; align-items: center; }
.screen.active { display: flex; }

.intro-icon  { font-size: 3.2rem; text-align: center; margin-bottom: 16px; }
.intro-title { font-size: 1.1rem; font-weight: 700; text-align: center; margin-bottom: 16px; }
.intro-text  { font-size: 0.88rem; line-height: 1.85; color: var(--text-sub); margin-bottom: 12px; }

.intro-warning {
  background: var(--surface);
  border: 1px solid var(--warning);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 0.88rem;
  line-height: 1.85;
  color: var(--text);
}
.intro-warning strong { color: var(--warning); }

/* ── Primary action button ── */
.start-btn,
.retry-btn {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--primary);
  color: white;
  margin-top: 20px;
  font-family: inherit;
  transition: transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.start-btn:active,
.retry-btn:active { transform: scale(0.97); }

/* ── Save button (dashed) ── */
.save-btn {
  width: 100%;
  padding: 12px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
  margin-top: 14px;
  font-family: inherit;
}
.save-btn:active { background: var(--primary-light); }

/* ── Home link (footer) ── */
.home-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--primary);
  text-decoration: none;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 16px 0;
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.85;
}

/* ── History (shared pattern) ── */
.history-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.history-item:last-child { border-bottom: none; }
.history-date {
  font-size: 0.88rem;
  color: var(--text-sub);
}
.history-empty {
  font-size: 0.88rem;
  color: var(--text-sub);
  text-align: center;
  padding: 8px 0;
}
.history-del {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  font-family: inherit;
}
.history-del:active { background: rgba(255,255,255,0.05); }

/* ── Result note ── */
.result-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 16px;
  font-size: 0.88rem;
  line-height: 1.85;
  color: var(--text-sub);
}

/* ============================================================
   埋め込みモード（?embed=1）
   記事ページのiframe内では、ヘッダー・フッター・履歴を隠して
   ゲーム画面だけが見えるようにする
   ============================================================ */
html[data-embed="true"] .top-nav,
html[data-embed="true"] .back-link,
html[data-embed="true"] .top-toolbar,
html[data-embed="true"] header,
html[data-embed="true"] .header,
html[data-embed="true"] .header-tip,
html[data-embed="true"] footer,
html[data-embed="true"] .history-section,
html[data-embed="true"] .history-card,
html[data-embed="true"] #shareX,
html[data-embed="true"] #theme-toggle {
  display: none !important;
}
html[data-embed="true"] body {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}
