/* ============================================================
   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 {
  padding: 0 14px 40px;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Header ── */
header {
  text-align: center;
  padding: 64px 0 16px;
}
header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
header p {
  font-size: 0.88rem;
  color: var(--text-sub);
  margin-top: 3px;
  letter-spacing: 0.5px;
}

/* ── 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.82rem;
  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 に移動済み ── */

/* ── Intro screen (multi-screen apps) ── */
.screen { display: none; }
.screen.active { display: block; }

.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.82rem;
  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.9rem;
  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.85rem;
  color: var(--primary);
  text-decoration: none;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 16px 0;
  font-size: 0.82rem;
  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: 12px 14px;
  background: var(--bg);
  border-radius: 12px;
}
.history-date {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-bottom: 4px;
}
.history-del {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 0.9rem;
  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.78rem;
  line-height: 1.85;
  color: var(--text-sub);
}
