/* 値はすべて spec_lock.md から。ここにない値を足すときは先に spec_lock.md を直す */
:root {
  --bg: #FFFFFF;
  --surface: #FAFAFA;
  --ink: #262626;
  --ink-sub: #8E8E8E;
  --line: #DBDBDB;
  --action: #0095F6;
  --grad-1: #FEDA75;
  --grad-2: #FA7E1E;
  --grad-3: #D62976;
  --grad-4: #962FBF;
  --grad-5: #4F5BD5;
  --accent: var(--grad-3);
  --grad: linear-gradient(45deg, var(--grad-1), var(--grad-2), var(--grad-3), var(--grad-4), var(--grad-5));

  --font: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;

  --fs-display: 72px;
  --fs-title: 22px;
  --fs-body: 15px;
  --fs-small: 12px;

  --r-card: 12px;
  --r-btn: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }

.screen {
  display: none;
  min-height: 100dvh;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  flex-direction: column;
}
.screen.is-active { display: flex; animation: fade 400ms ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* アバター（グラデーションのリング付き） */
.ring { flex: none; border-radius: 50%; padding: 2px; background: var(--grad); }
.ring > span {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 2px solid var(--bg); background: var(--surface);
  width: 100%; height: 100%; font-size: var(--fs-small); font-weight: 700; color: var(--ink-sub);
}
.story .ring > span { font-size: var(--fs-title); }

/* ---------- S1（L-feed） ---------- */
.feed { padding: 0; }
.feed-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.feed-logo { font-size: var(--fs-title); font-weight: 700; }
.feed-icons { display: flex; gap: 16px; }
.feed-icons svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.stories { display: flex; gap: 14px; padding: 12px 16px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.story { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: var(--fs-small); color: var(--ink); }
.story .ring { width: 64px; height: 64px; }

.timeline { list-style: none; padding-bottom: 180px; }
.post {
  padding: 12px 0 16px;
  opacity: 0; transform: translateY(12px);
  animation: rise 500ms ease forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
.post-head { display: flex; align-items: center; gap: 10px; padding: 0 16px 10px; font-size: var(--fs-body); font-weight: 700; }
.post-head .ring { width: 34px; height: 34px; }
.post-photo {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3; font-size: var(--fs-display);
  background: linear-gradient(135deg, color-mix(in srgb, var(--a) 35%, var(--bg)), color-mix(in srgb, var(--b) 35%, var(--bg)));
}
.icons { display: flex; gap: 14px; }
.icons svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.post-actions { padding: 10px 16px 6px; }
.post-likes { padding: 0 16px; font-size: var(--fs-body); font-weight: 700; }
.post-caption { padding: 2px 16px 0; font-size: var(--fs-body); }
.post-caption b { margin-right: 6px; }
.post-time { padding: 4px 16px 0; font-size: var(--fs-small); color: var(--ink-sub); }

.ask {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
  text-align: center;
  animation: fade 400ms ease;
}
.ask-text { font-size: var(--fs-body); font-weight: 700; margin-bottom: 14px; }

/* ---------- 共通 ---------- */
.kicker { font-size: var(--fs-small); color: var(--ink-sub); }
.q { font-size: var(--fs-title); font-weight: 700; line-height: 1.5; margin: 36px 0 28px; }
.title { font-size: var(--fs-title); font-weight: 700; line-height: 1.5; }
.sub { font-size: var(--fs-small); color: var(--ink-sub); margin-top: 8px; }
.note { font-size: var(--fs-small); color: var(--ink-sub); text-align: center; margin-top: 16px; }

.foot { margin-top: auto; padding-top: 20px; }
.btn {
  display: block; width: 100%; padding: 12px;
  background: var(--action); color: var(--bg); font-weight: 700;
  border-radius: var(--r-btn);
}
.btn + .btn, .btn + .btn-quiet { margin-top: 8px; }
.btn-quiet {
  display: block; width: 100%; padding: 12px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-btn); color: var(--ink);
}

.age-wrap { display: flex; align-items: baseline; justify-content: center; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.age-select {
  appearance: none; -webkit-appearance: none;
  font-family: var(--font); font-weight: 700; font-size: var(--fs-display); line-height: 1;
  color: var(--ink); background: none; border: 0; text-align: center; text-align-last: center;
  width: 3em;
}
.age-unit { font-size: var(--fs-title); font-weight: 700; }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  text-align: left; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-btn);
  font-size: var(--fs-body); font-weight: 700;
}
.choice:active, .choice.is-selected { border-color: var(--ink); }

/* ---------- S3 / S5（L-people） ---------- */
/* 場面ごとに行数が変わると下の人型が上下に跳ねるので、2行ぶんの高さを取っておく */
.lead { margin-top: 16px; text-wrap: balance; min-height: 3em; }
.quote-post.is-blank { visibility: hidden; }
.phrase { display: inline-block; }
.count { margin: 2px 0 8px; font-weight: 700; }
.count .num { font-size: var(--fs-display); line-height: 1; }
.count .num.is-accent { color: var(--accent); }
.count .unit { font-size: var(--fs-title); margin-left: 6px; }
.crowd { position: relative; width: 88%; margin: 8px auto; aspect-ratio: 10 / 11; }
.legend { display: flex; gap: 16px; justify-content: center; font-size: var(--fs-small); color: var(--ink-sub); margin-bottom: 8px; }
.legend i { display: inline-block; width: 8px; margin-right: 6px; vertical-align: -2px; }
.legend i svg { width: 100%; height: auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.4; }
.legend .on { color: var(--ink); }
.legend .accent { color: var(--accent); }
.legend .on svg, .legend .accent svg { fill: currentColor; }
.legend .off { color: var(--line); }

/* S3のSNS投稿 */
.quote-post {
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-card);
  animation: fade 400ms ease;
}
.quote-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); font-weight: 700; margin-bottom: 6px; }
.quote-head .ring { width: 28px; height: 28px; }
.quote-head .likes { margin-left: auto; font-weight: 400; color: var(--ink-sub); }
.quote-text { font-size: var(--fs-body); line-height: 1.6; min-height: 3.2em; }

/* ---------- S6（L-card） ---------- */
.card { width: 100%; max-height: 64dvh; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg); }
