:root {
  --bg: #FFF6EC;
  --dot: #F5E4CE;
  --ink: #4A3A2C;
  --ink-soft: #8A7663;
  --accent: #FF7A59;
  --star-on: #FFB020;
  --star-off: #E5DACB;
  --card-bg: #FFFFFF;
  --radius: 20px;
  --shadow: 0 4px 14px rgba(120, 84, 40, 0.10);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ---------- 一覧 ---------- */
.site-header { text-align: center; padding: 40px 16px 8px; }
.site-header h1 {
  font-size: 2rem; font-weight: 800; margin: 0;
  color: var(--accent);
  text-shadow: 2px 2px 0 #FFE3D4;
}
.header-emoji { display: inline-block; transform: rotate(-8deg); }
.tagline { margin: 4px 0 0; color: var(--ink-soft); font-weight: 700; }
.count {
  display: inline-block; margin: 12px 0 0; padding: 4px 16px;
  background: #FFFFFF; border-radius: 999px; font-size: 0.85rem;
  color: var(--ink-soft); box-shadow: var(--shadow);
}
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  max-width: 960px; margin: 0 auto; padding: 24px 16px 48px;
}
.recipe-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card-bg); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
  border: 3px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.recipe-card:hover, .recipe-card:active {
  transform: translateY(-3px) rotate(-0.4deg);
  border-color: var(--accent-border, #FFD4C4);
}
.card-emoji {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center;
  font-size: 1.8rem;
}
.card-body { min-width: 0; }
.card-body h2 { font-size: 1.05rem; font-weight: 800; margin: 2px 0 4px; }
.card-comment {
  margin: 6px 0 0; font-size: 0.85rem; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 8px; font-size: 0.78rem; color: var(--ink-soft);
}

/* ---------- 共通パーツ ---------- */
.stars { letter-spacing: 2px; font-size: 0.95rem; }
.stars .on { color: var(--star-on); }
.stars .off { color: var(--star-off); }
.badge {
  background: #FFF0C2; border-radius: 999px; padding: 1px 10px;
  font-size: 0.75rem; font-weight: 700; color: #9A7B1E;
}
.chip {
  background: #FFFFFF; border: 1.5px solid #EFE2D0; border-radius: 999px;
  padding: 2px 12px; font-size: 0.8rem; color: var(--ink-soft);
}
.footer {
  text-align: center; padding: 24px 16px 40px;
  color: var(--ink-soft); font-size: 0.85rem; font-weight: 700;
}

/* ---------- 詳細 ---------- */
.detail { max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; }
.back {
  display: inline-block; margin-bottom: 12px; font-weight: 700;
  color: var(--accent); background: #FFFFFF; border-radius: 999px;
  padding: 6px 18px; box-shadow: var(--shadow); font-size: 0.9rem;
}
.back:hover { transform: translateX(-2px); }
.detail-hero {
  text-align: center; background: var(--card-bg);
  border-radius: var(--radius); padding: 28px 20px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.hero-emoji { font-size: 3.2rem; line-height: 1; margin-bottom: 8px; }
.detail-hero h1 { font-size: 1.5rem; font-weight: 800; margin: 0 0 10px; }
.meta {
  display: flex; gap: 8px; justify-content: center; align-items: center;
  flex-wrap: wrap;
}
.rating-note { font-size: 0.8rem; color: var(--ink-soft); }
.comment {
  margin: 14px auto 0; max-width: 480px;
  background: #FFF6EC; border-radius: 14px; padding: 10px 16px;
  font-size: 0.9rem; color: var(--ink-soft);
}
.card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card h2 {
  font-size: 1.1rem; font-weight: 800; margin: 0 0 12px;
  display: flex; align-items: center; gap: 6px;
}
.servings {
  font-size: 0.78rem; font-weight: 700; color: var(--ink-soft);
  background: #FFF0C2; border-radius: 999px; padding: 2px 12px; margin-left: 4px;
}

.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 2px; border-bottom: 1.5px dashed #F0E4D3;
}
.ingredients li:last-child { border-bottom: none; }
.ing-name { font-weight: 700; }
.ing-dots { flex: 1; }
.ing-amount { color: var(--ink-soft); font-size: 0.92rem; white-space: nowrap; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative;
  padding: 10px 0 10px 46px; border-bottom: 1.5px dashed #F0E4D3;
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #FFF;
  font-weight: 800; display: grid; place-items: center; font-size: 0.95rem;
}

.callout-tips { background: #FFFBEB; border: 2px solid #FFE9A8; }
.callout-var { background: #F3FBF2; border: 2px solid #CBE8C8; }
.callout ul { margin: 0; padding-left: 20px; }
.callout li { margin: 4px 0; }

.history {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 4px 22px; margin-bottom: 16px;
}
.history summary {
  cursor: pointer; font-weight: 800; padding: 14px 0;
  display: flex; align-items: center; gap: 8px; list-style: none;
}
.history summary::-webkit-details-marker { display: none; }
.history summary::after { content: '▾'; margin-left: auto; color: var(--ink-soft); transition: transform 0.2s; }
.history[open] summary::after { transform: rotate(180deg); }
.history-entry {
  border-left: 3px solid #FFD4C4; padding: 2px 0 10px 16px; margin: 0 0 12px 6px;
}
.history-entry h3 { font-size: 0.95rem; margin: 0 0 4px; color: var(--accent); }
.history-entry ul { margin: 0; padding-left: 18px; font-size: 0.9rem; color: var(--ink-soft); }

@media (max-width: 480px) {
  .site-header h1 { font-size: 1.6rem; }
  .grid { grid-template-columns: 1fr; }
}
