:root {
  --color-bg:           #f7f4ee;
  --color-surface:      #ffffff;
  --color-primary:      #2d4a1e;
  --color-accent:       #c45c1a;
  --color-text:         #1a1a1a;
  --color-text-sub:     #5a5a5a;
  --color-text-on-dark: #ffffff;
  --color-border:       #ddd8cc;
  --result-katsu-from:   #6b2c0a; --result-katsu-to:     #b84c18;
  --result-soba-from:    #1e4010; --result-soba-to:      #4a7c28;
  --result-kaisen-from:  #0a3060; --result-kaisen-to:    #1565c0;
  --result-volga-from:   #7a3800; --result-volga-to:     #a85700;
  --result-ramen-from:   #5c0a08; --result-ramen-to:     #c0281e;
  --result-wagashi-from: #3a1a50; --result-wagashi-to:   #7b3fa0;
  --result-grad: linear-gradient(135deg, var(--result-katsu-from), var(--result-katsu-to));
}
.result--katsu   { --result-grad: linear-gradient(135deg, var(--result-katsu-from),   var(--result-katsu-to)); }
.result--soba    { --result-grad: linear-gradient(135deg, var(--result-soba-from),    var(--result-soba-to)); }
.result--kaisen  { --result-grad: linear-gradient(135deg, var(--result-kaisen-from),  var(--result-kaisen-to)); }
.result--volga   { --result-grad: linear-gradient(135deg, var(--result-volga-from),   var(--result-volga-to)); }
.result--ramen   { --result-grad: linear-gradient(135deg, var(--result-ramen-from),   var(--result-ramen-to)); }
.result--wagashi { --result-grad: linear-gradient(135deg, var(--result-wagashi-from), var(--result-wagashi-to)); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Zen Maru Gothic', 'Noto Sans JP', 'Hiragino Maru Gothic ProN', 'BIZ UDPGothic', system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.back-link {
  display: inline-block; padding: 8px 16px; font-size: 0.875rem;
  color: var(--color-text-sub); text-decoration: none;
}
.back-link:hover { color: var(--color-primary); }
.cta-banner {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-primary);
}
.cta-banner button {
  width: 100%; min-height: 44px; padding: 10px 16px; border: 0;
  background: transparent; color: var(--color-text-on-dark);
  font: 700 0.875rem 'Zen Maru Gothic', sans-serif; cursor: pointer;
}
.app {
  max-width: 480px; margin: 0 auto; padding: 16px;
  min-height: calc(100vh - 120px);
}
@media (min-width: 600px) { .app { max-width: 560px; padding: 24px; } }
@media (min-width: 1024px) { .app { max-width: 600px; } }

.view { position: relative; }
.view[hidden] { display: none; }

/* タイトル画面 */
#view-intro { padding-top: 24px; text-align: center; }
.mountains { position: absolute; bottom: -20px; left: 0; right: 0; pointer-events: none; z-index: 0; }
#app-title {
  font-size: 2rem; font-weight: 900; color: var(--color-primary);
  margin: 16px 0 8px; line-height: 1.2;
}
.lead { font-size: 1.375rem; font-weight: 700; margin: 8px 0; }
.sub { font-size: 0.9375rem; color: var(--color-text-sub); margin: 4px 0 24px; }
.emoji-band {
  font-size: 2rem; letter-spacing: 0.15em; margin: 24px 0 32px; user-select: none;
}
.btn-primary {
  display: inline-block; min-height: 56px; padding: 0 40px;
  background: var(--color-primary); color: var(--color-text-on-dark);
  border: 0; border-radius: 28px; font: 700 1rem 'Zen Maru Gothic', sans-serif;
  cursor: pointer; box-shadow: 0 4px 12px rgba(45,74,30,0.30);
  transition: transform 120ms ease-out, box-shadow 200ms ease-out, background 200ms ease-out;
}
.btn-primary:hover { background: #3a5e28; box-shadow: 0 6px 20px rgba(45,74,30,0.40); }
.btn-primary:active { transform: scale(0.95); }
.note { font-size: 0.875rem; color: var(--color-text-sub); margin-top: 16px; }

/* 設問画面 */
.progress-wrap { margin-bottom: 20px; }
.progress-track {
  height: 8px; background: var(--color-border); border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 100%; background: var(--color-accent); border-radius: 4px;
  transform: scaleX(0); transform-origin: left center;
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-text {
  margin: 8px 0 0; font-size: 0.875rem; font-weight: 700;
  color: var(--color-primary); text-align: right;
}
.q-card {
  background: var(--color-surface); padding: 20px 16px; border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
}
.q-card.slide-out { animation: slideOutLeft 180ms ease-out forwards; }
.q-card.slide-in { animation: slideInRight 260ms cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes slideOutLeft { to { transform: translateX(-40px); opacity: 0; } }
@keyframes slideInRight { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.q-title { font-size: 1.375rem; font-weight: 700; margin: 0 0 20px; line-height: 1.4; }
.q-choices { display: flex; flex-direction: column; gap: 12px; }
.choice-btn {
  min-height: 56px; padding: 12px 16px; background: var(--color-surface);
  border: 1.5px solid var(--color-border); border-radius: 12px;
  color: var(--color-text); font: 700 1rem 'Zen Maru Gothic', sans-serif;
  text-align: left; cursor: pointer;
  transition: transform 80ms ease-out, background 180ms ease-out, border-color 180ms ease-out, opacity 180ms ease-out, box-shadow 180ms ease-out;
}
@media (min-width: 600px) { .choice-btn { min-height: 60px; } }
@media (min-width: 1024px) { .choice-btn { min-height: 64px; font-size: 1.0625rem; } }
.choice-btn:hover { border-color: var(--color-primary); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.choice-btn.selected {
  background: var(--color-primary); color: var(--color-text-on-dark);
  border-color: var(--color-primary); transform: scale(1.02);
}
.choice-btn.selected::after { content: " ✓"; font-weight: 900; }
.choice-btn.disabled { opacity: 0.4; pointer-events: none; }

/* 結果画面 */
.result-card {
  background: var(--color-surface); border-radius: 20px; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.14);
}
.result-hero {
  background: var(--result-grad); color: var(--color-text-on-dark);
  padding: 28px 20px 24px; text-align: center;
}
.result-emoji {
  font-size: clamp(4rem, 20vw, 7rem); line-height: 1; margin-bottom: 8px;
  display: block;
  animation: resultBounce 450ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes resultBounce { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.result-name {
  font-size: clamp(1.75rem, 8vw, 2.5rem); font-weight: 900;
  margin: 4px 0 8px; line-height: 1.1;
}
.result-catch { font-size: 1rem; font-weight: 700; margin: 4px 0 16px; opacity: 0.92; }
.result-area {
  display: inline-block; padding: 6px 14px; background: rgba(0,0,0,0.25);
  color: var(--color-text-on-dark); border-radius: 20px;
  font-size: 0.875rem; font-weight: 700;
}
.result-hero .result-catch,
.result-hero .result-area { animation: fadeSlideUp 300ms ease-out both; }
.result-hero .result-catch { animation-delay: 150ms; }
.result-hero .result-area { animation-delay: 250ms; }
@keyframes fadeSlideUp { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.result-body { padding: 20px 16px; }
.result-reason { font-size: 0.9375rem; line-height: 1.7; margin: 0 0 14px; white-space: pre-line; }
.result-trivia {
  font-size: 0.875rem; color: var(--color-text-sub); line-height: 1.6;
  background: var(--color-bg); border-left: 3px solid var(--color-primary);
  border-radius: 0 8px 8px 0; padding: 12px 14px; margin: 0 0 20px;
}
.share-row {
  display: flex; gap: 8px; margin-bottom: 16px;
  animation: fadeSlideUp 250ms ease-out 350ms both;
}
.btn-share {
  flex: 1; min-height: 52px; display: flex; align-items: center; justify-content: center;
  gap: 8px; border-radius: 10px; text-decoration: none;
  font: 700 0.9375rem 'Zen Maru Gothic', sans-serif; cursor: pointer;
  transition: transform 100ms ease-out, opacity 180ms ease-out;
}
.btn-share:active { transform: scale(0.96); }
.btn-x { background: #000; color: #fff; }
.btn-line { background: #04a044; color: #fff; }
.btn-retry {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 44px; background: transparent;
  border: 1.5px solid var(--color-border); border-radius: 22px;
  color: var(--color-text-sub); font: 700 0.875rem 'Zen Maru Gothic', sans-serif;
  cursor: pointer; transition: background 180ms ease-out;
}
.btn-retry:hover { background: var(--color-border); }

/* フォーカス */
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--color-accent); outline-offset: 2px;
}

/* フッタ */
.site-footer {
  max-width: 480px; margin: 24px auto 0; padding: 16px;
  font-size: 0.875rem; color: var(--color-text-sub); text-align: center;
}
.site-footer p { margin: 4px 0; }

/* 低モーション配慮 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0.01ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0.01ms !important;
  }
}
