/* ============================================================
   manareki-tools.css — 歴史ツール共通デザイン（和モダン）
   ============================================================ */

:root {
  --mt-main: #3a3232;
  --mt-dark: #2a2020;
  --mt-accent: #b04a3a;
  --mt-accent-hover: #963e32;
  --mt-accent-pale: #f6e8e5;
  --mt-gold: #a07828;
  --mt-gold-light: #e5c880;
  --mt-light: #f7f2ec;
  --mt-bg: #fbf9f6;
  --mt-border: #ddd4c8;
  --mt-text: #3a3232;
  --mt-sub: #4a4040;
  --mt-muted: #6e6259;
  --mt-focus-ring: #dbb668;
  --mt-success: #2d7d46;
  --mt-error: #c0392b;
  --mt-radius: 8px;
  --mt-shadow: 0 2px 8px rgba(58,50,50,0.08);
  --mt-shadow-lg: 0 4px 20px rgba(58,50,50,0.12);
  --mt-font: 'Hiragino Kaku Gothic ProN','Meiryo','Noto Sans JP',sans-serif;
  /* Tier1 高級化トークン（transform/opacity/box-shadowのみ・CWV非影響） */
  --mt-shadow-press: inset 0 2px 6px rgba(58,50,50,0.12);
  --mt-shadow-glow-success: 0 0 0 3px rgba(45,125,70,0.18);
  --mt-shadow-glow-error: 0 0 0 3px rgba(192,57,43,0.16);
  --mt-ease-pop: cubic-bezier(.34,1.56,.64,1);
  --mt-hero-grad: linear-gradient(135deg,#525a6b 0%,#3a4250 55%,#33414e 100%);
  --mt-card-grad: linear-gradient(180deg,#ffffff 0%,#fdfbf8 100%);
}

/* モーション抑制設定の尊重（全ツール共通） */
@media (prefers-reduced-motion: reduce) {
  .mt-app *, .mt-app *::before, .mt-app *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Reset & Base --- */
.mt-app { font-family: var(--mt-font); color: var(--mt-text); background: var(--mt-bg); }
.mt-app *, .mt-app *::before, .mt-app *::after { box-sizing: border-box; }

/* --- Hero --- */
.mt-hero {
  background: var(--mt-hero-grad);
  color: #fff;
  padding: 40px 20px 32px;
  text-align: center;
  position: relative;
  box-shadow: inset 0 -2px 0 rgba(224,200,128,0.45);
}
.mt-hero-icon { font-size: 40px; margin-bottom: 8px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.mt-hero h1 { font-size: 24px; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.01em; text-shadow: 0 1px 3px rgba(0,0,0,0.22); }
.mt-hero p { font-size: 14px; opacity: 0.88; margin: 0; }

/* --- Container --- */
.mt-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* --- Filter Bar --- */
.mt-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.mt-filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--mt-border);
  border-radius: 20px;
  background: #fff;
  color: var(--mt-muted);
  font-size: 13px;
  cursor: pointer;
  transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s;
  font-family: var(--mt-font);
}
.mt-filter-btn:hover { border-color: var(--mt-accent); color: var(--mt-accent); }
.mt-filter-btn.active {
  background: var(--mt-accent);
  color: #fff;
  border-color: var(--mt-accent);
}

/* --- Cards --- */
.mt-card {
  background: #fff;
  border-radius: var(--mt-radius);
  box-shadow: var(--mt-shadow);
  padding: 24px;
  margin-bottom: 16px;
  border-top: 3px solid var(--mt-accent);
}
.mt-card-flat {
  background: #fff;
  border-radius: var(--mt-radius);
  box-shadow: var(--mt-shadow);
  overflow: hidden;
}

/* --- Badges --- */
.mt-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}
.mt-badge-era { background: var(--mt-light); color: var(--mt-main); }
.mt-badge-level-中学 { background: #e8f5e9; color: #2e7d32; }
.mt-badge-level-高校 { background: #e3f2fd; color: #1565c0; }
.mt-badge-level-両方 { background: #fff8e1; color: #8a6d00; }
.mt-badge-exam { background: var(--mt-accent-pale); color: var(--mt-accent); }

/* Era color badges */
.mt-badge-era-古代 { background: #f3e5d8; color: #7c4a1e; }
.mt-badge-era-飛鳥・奈良 { background: #e8d5c4; color: #6d3a0a; }
.mt-badge-era-平安 { background: #f0dde8; color: #7a2b5a; }
.mt-badge-era-鎌倉 { background: #d8e8d8; color: #2d5a2d; }
.mt-badge-era-室町・戦国 { background: #e0d8c8; color: #5a4a2d; }
.mt-badge-era-江戸 { background: #d8e0f0; color: #2d3a6d; }
.mt-badge-era-明治・大正 { background: #dce8e8; color: #1a4a4a; }
.mt-badge-era-昭和・現代 { background: #e0e0e8; color: #3a3a5a; }

/* --- Buttons --- */
.mt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--mt-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background-color .2s, box-shadow .2s, transform .12s;
  font-family: var(--mt-font);
}
.mt-btn:active { transform: translateY(1px); }
.mt-btn-primary {
  background: linear-gradient(180deg, #bd584a 0%, var(--mt-accent) 100%);
  color: #fff;
  box-shadow: var(--mt-shadow);
}
.mt-btn-primary:hover { background: var(--mt-accent-hover); box-shadow: var(--mt-shadow-lg); }
.mt-btn-primary:active { box-shadow: var(--mt-shadow-press); }
.mt-btn-secondary { background: var(--mt-light); color: var(--mt-main); border: 1px solid var(--mt-border); }
.mt-btn-secondary:hover { background: var(--mt-border); }
.mt-btn-gold { background: var(--mt-gold); color: #fff; }
.mt-btn-gold:hover { background: #8a6820; }

/* --- Progress Bar --- */
.mt-progress {
  width: 100%;
  height: 8px;
  background: var(--mt-light);
  border-radius: 4px;
  overflow: hidden;
}
.mt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mt-accent), var(--mt-gold));
  border-radius: 4px;
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}
/* 上品な光沢（ゆっくり流れる・GPU合成のみ） */
.mt-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: mt-sheen 2.6s ease-in-out infinite;
}
@keyframes mt-sheen { 0%{transform:translateX(-100%)} 60%,100%{transform:translateX(100%)} }

/* --- Section Label --- */
.mt-section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--mt-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mt-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--mt-border);
}

/* --- Empty State --- */
.mt-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--mt-muted);
  font-size: 14px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .mt-hero { padding: 28px 16px 24px; }
  .mt-hero h1 { font-size: 20px; }
  .mt-container { padding: 16px 12px; }
  .mt-card { padding: 16px; }
  .mt-filter-btn { padding: 5px 10px; font-size: 12px; }
}
