﻿* { margin: 0; padding: 0; box-sizing: border-box; }
button { touch-action: manipulation; }


body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.7;
  overflow-x: hidden;
}

header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem 0;
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  font-size: 1.2rem;
  font-weight: bold;
  color: #4f46e5;
  text-decoration: none;
}

main {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* ━━━ ヒーロー ━━━ */
.hero {
  text-align: center;
  padding: 2rem 0 1.25rem;
}

.hero-icon { font-size: 2.5rem; margin-bottom: 0.4rem; }

h1 {
  font-size: 1.75rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.05rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.description {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.8;
}

/* ━━━ ヒーローバッジ ━━━ */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.badge {
  display: inline-block;
  padding: 5px 13px;
  background: #e0e7ff;
  color: #3730a3;
  border: 1.5px solid #a5b4fc;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ━━━ カード共通 ━━━ */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid #e0e0e0;
}

/* ━━━ ゲームラッパー ━━━ */
.game-wrap {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e0e0e0;
  padding: 1.5rem;
  margin-bottom: 1rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ━━━ 設定 ━━━ */
.setting-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.setting-label {
  font-size: 0.85rem;
  font-weight: bold;
  color: #666;
  min-width: 3rem;
}

.btn-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.stab {
  padding: 0.35rem 0.8rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fafafa;
  font-size: 0.82rem;
  font-family: inherit;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
}

.stab:hover { border-color: #4f46e5; color: #4f46e5; }
.stab.active { background: #4f46e5; border-color: #4f46e5; color: #fff; font-weight: bold; }

.best-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 1rem;
  background: #eef2ff;
  border-radius: 8px;
  border: 1px solid #c7d2fe;
}

.best-label { font-size: 0.85rem; color: #3730a3; }
.best-value { font-size: 1.4rem; font-weight: 900; color: #4f46e5; line-height: 1; }
.best-unit  { font-size: 0.82rem; color: #3730a3; }

.session-row {
  text-align: center;
  font-size: 0.9rem;
  font-weight: bold;
  color: #4f46e5;
  margin-bottom: 0.75rem;
}

.primary-btn {
  display: block;
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.15s;
  letter-spacing: 0.05em;
}

.primary-btn:hover { opacity: 0.9; }

/* ━━━ フラッシュ表示 ━━━ */
.flash-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.flash-number {
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 900;
  color: #1e1b4b;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  min-height: 1.2em;
  transition: opacity 0.06s;
  letter-spacing: -0.02em;
}

.flash-number.countdown {
  color: #4f46e5;
  font-size: clamp(3rem, 14vw, 5rem);
}

.flash-progress {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
  min-height: 1.4em;
}

/* ━━━ 入力エリア ━━━ */
.input-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.input-prompt {
  font-size: 1rem;
  font-weight: bold;
  color: #666;
  margin-bottom: 0.5rem;
}

.answer-display {
  font-size: 3rem;
  font-weight: 900;
  color: #4f46e5;
  min-width: 4ch;
  text-align: center;
  border-bottom: 3px solid #4f46e5;
  padding-bottom: 2px;
  margin-bottom: 0.5rem;
}

.answer-display.empty {
  color: #c7d2fe;
  border-color: #c7d2fe;
}

.result-msg {
  font-size: 1rem;
  font-weight: bold;
  min-height: 1.6rem;
  margin-bottom: 0.6rem;
  text-align: center;
}

.result-msg.correct { color: #10b981; }
.result-msg.wrong   { color: #ef4444; }

/* 数字パッド */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 280px;
  width: 100%;
  margin-bottom: 0.75rem;
}

.num-btn {
  aspect-ratio: 1.4;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.num-btn:hover { background: #eef2ff; border-color: #4f46e5; }
.num-btn:active { transform: scale(0.94); background: #e0e7ff; }

.del-btn { background: #f9fafb; color: #555; font-size: 1rem; }

.ok-btn {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  border-color: #4f46e5;
  color: #fff;
}

.ok-btn:hover { opacity: 0.9; }

/* 下部ボタン */
.input-btns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 280px;
  margin-bottom: 0.75rem;
}

.next-btn {
  padding: 0.65rem;
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.15s;
}

.next-btn:hover { opacity: 0.9; }

.back-btn {
  padding: 0.55rem;
  background: #f9fafb;
  color: #666;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.back-btn:hover { border-color: #4f46e5; color: #4f46e5; }

.session-label {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: bold;
}

/* ━━━ Amazon ━━━ */
.amazon-card h2 { margin-bottom: 0.25rem; }
.amazon-note { font-size: 0.82rem; color: #999; margin-bottom: 1rem; }
.amazon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.amazon-item {
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 0.9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.amazon-item:hover {
  border-color: #FF9900;
  box-shadow: 0 2px 8px rgba(255,153,0,0.15);
  transform: translateY(-1px);
}
.amazon-item-icon { font-size: 1.7rem; margin-bottom: 0.35rem; }
.amazon-item-name { font-size: 0.88rem; font-weight: bold; margin-bottom: 0.2rem; }
.amazon-item-desc { font-size: 0.76rem; color: #888; line-height: 1.5; margin-bottom: 0.45rem; }
.amazon-item-link { font-size: 0.78rem; color: #FF9900; font-weight: bold; }

/* ━━━ 遊び方 ━━━ */
.how-item { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #f0f0f0; }
.how-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.how-item h3 { font-size: 0.9rem; font-weight: bold; margin-bottom: 0.3rem; color: #4f46e5; }
.how-item p { font-size: 0.875rem; color: #666; line-height: 1.7; }
.link { color: #4f46e5; text-decoration: none; font-weight: bold; }
.link:hover { text-decoration: underline; }

.hidden { display: none; }

footer {
  text-align: center;
  padding: 2rem;
  color: #999;
  font-size: 0.875rem;
}
footer a { color: #999; text-decoration: none; margin: 0 0.5rem; }
footer a:hover { color: #4f46e5; }
footer p { margin-bottom: 0.3rem; }

/* ━━━ レスポンシブ ━━━ */

/* ─── Tips grid (rank-tracker 統一パターン) ──────── */
.tips-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.tip-item { display: flex; gap: .65rem; }
.tip-icon { font-size: 1.4rem; flex-shrink: 0; }
.tip-text strong { display: block; font-weight: 700; margin-bottom: .15rem; font-size: .88rem; }
.tip-text p { font-size: .8rem; color: #78716c; line-height: 1.55; }
@media (max-width: 480px) {
  h1 { font-size: 1.4rem; }
  .game-wrap { padding: 1.1rem; min-height: 260px; }
  .numpad { max-width: 260px; gap: 5px; }
  .num-btn { font-size: 1.2rem; }
  .answer-display { font-size: 2.4rem; }
  .input-btns { max-width: 260px; }

  .tips-grid { grid-template-columns: 1fr; }
  .scene-grid { grid-template-columns: 1fr; }
}

.amazon-notice {
  font-size: 0.72rem;
  color: #bbb;
  margin-top: 0.2rem;
}

/* ━━━ 活用シーン ━━━ */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.scene-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  background: #eef2ff;
  border: 1.5px solid #c7d2fe;
  border-radius: 12px;
}
.scene-icon { font-size: 1.7rem; flex-shrink: 0; }
.scene-body strong { display: block; font-size: .88rem; font-weight: 700; color: #3730a3; margin-bottom: .2rem; }
.scene-body p { font-size: .78rem; color: #4b5563; line-height: 1.55; margin: 0; }

/* ━━━ 関連ツール ━━━ */
.related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}
.related-tool-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .85rem 1rem;
  border: 1.5px solid #e8edf5;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.related-tool-item:hover { border-color: #4f46e5; box-shadow: 0 2px 8px rgba(79,70,229,.1); }
.related-tool-icon { font-size: 1.6rem; flex-shrink: 0; }
.related-tool-item strong { display: block; font-size: .88rem; font-weight: 700; color: #4f46e5; margin-bottom: .2rem; }
.related-tool-item p { font-size: .76rem; color: #888; line-height: 1.5; margin: 0; }

/* ━━━ FAQ ━━━ */
.faq-list { display: flex; flex-direction: column; }
.faq-item { padding: .9rem 0; border-bottom: 1px solid #f0f0f0; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q { font-size: .9rem; font-weight: 700; color: #4f46e5; margin-bottom: .35rem; }
.faq-a { font-size: .85rem; color: #555; line-height: 1.75; }
