/* ==========================================================
   40億分の、ふたり。—「ふたりの物語」モード
   既存のピンクの世界観（style.css）を土台に、読みやすさと操作の分かりやすさを高めたデザイン
   ========================================================== */

@font-face {
  font-family: "Futari Sans";
  src: url("fonts/futari-sans-400.woff2?v=1") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Futari Sans";
  src: url("fonts/futari-sans-700.woff2?v=1") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

.tl-wrap {
  --tl-pink: #e2347d;
  --tl-pink-deep: #b8256a;
  --tl-pink-soft: #ffe3ef;
  --tl-pink-mist: #fff3f8;
  --tl-ink: #45203a;
  --tl-muted: #7a5a6d;
  --tl-line: #f1c8db;
  --tl-white: #ffffff;
  --tl-violet: #8f4fb3;
  --tl-teal: #2f8a86;
  --tl-shadow: 0 18px 50px -22px rgba(150, 30, 90, .35);
  --tl-radius: 22px;
  --tl-font: "Futari Sans", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Meiryo", system-ui, -apple-system, sans-serif;
  --tl-ease: cubic-bezier(.2, .8, .2, 1);

  max-width: 560px;
  margin: 0 auto;
  padding: 8px 16px 40px;
  color: var(--tl-ink);
  font-family: var(--tl-font);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
  font-feature-settings: "palt" 1;
  overflow-wrap: anywhere;
  animation: tl-fade .45s var(--tl-ease) both;
}
.tl-wrap *, .tl-wrap *::before, .tl-wrap *::after { box-sizing: border-box; }
.tl-wrap :where(button) { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.tl-wrap :where(h1, h2, h3, p, ol, dl, dd, figure) { margin: 0; padding: 0; }
.tl-wrap :where(ol) { list-style: none; }
.tl-wrap :focus-visible { outline: 3px solid var(--tl-pink); outline-offset: 3px; border-radius: 12px; }

@keyframes tl-fade { from { opacity: 0; transform: translateY(10px); } }
@keyframes tl-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes tl-pop { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* ---------- 共通部品 ---------- */
.tl-eyebrow, .tl-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .16em; color: var(--tl-pink-deep);
}
.tl-h2 { font-size: clamp(24px, 7vw, 32px); font-weight: 700; line-height: 1.35; letter-spacing: .02em; }
.tl-h3 { font-size: 15px; font-weight: 700; color: var(--tl-pink-deep); letter-spacing: .06em; margin-bottom: 8px; }
.tl-h3 span { color: var(--tl-muted); font-weight: 400; margin-left: 6px; }
.tl-micro, .tl-note { font-size: 13px; color: var(--tl-muted); line-height: 1.7; }
.tl-note { margin-top: 28px; padding-top: 16px; border-top: 1px dashed var(--tl-line); }

.tl-cta {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 60px; padding: 14px 24px;
  border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #ff5f9e 0%, var(--tl-pink) 45%, var(--tl-pink-deep) 100%);
  color: #fff !important; font-size: 17px; font-weight: 700; letter-spacing: .06em; line-height: 1.4; text-align: center;
  box-shadow: 0 14px 30px -12px rgba(226, 52, 125, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .15s var(--tl-ease), box-shadow .2s;
}
.tl-cta:hover { box-shadow: 0 18px 36px -12px rgba(226, 52, 125, .85), inset 0 1px 0 rgba(255, 255, 255, .35); }
.tl-cta:active { transform: scale(.98); }
.tl-cta-arrow { font-size: 20px; transition: transform .2s var(--tl-ease); }
.tl-cta:hover .tl-cta-arrow { transform: translateX(4px); }

.tl-ghost {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; padding: 10px 16px; border-radius: 16px;
  border: 1.5px solid var(--tl-line); background: var(--tl-white);
  font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--tl-pink-deep);
  transition: border-color .2s, background .2s, transform .15s;
}
.tl-ghost:hover { border-color: var(--tl-pink); background: var(--tl-pink-mist); }
.tl-ghost:active { transform: scale(.98); }

.tl-link, .tl-text-btn {
  display: inline-block; margin-top: 14px; padding: 8px 4px; min-height: 44px;
  border: 0; background: none; color: var(--tl-pink-deep); font-size: 15px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--tl-line);
}
.tl-text-btn { display: block; margin: 18px auto 0; font-weight: 400; color: var(--tl-muted); font-size: 14px; }

/* ---------- ホーム ---------- */
.tl-home { padding-top: 8px; }
.tl-hero { text-align: center; padding: 18px 4px 6px; }
.tl-title {
  margin-top: 10px; font-size: clamp(38px, 12vw, 58px); font-weight: 700; line-height: 1.12; letter-spacing: .02em;
  background: linear-gradient(120deg, var(--tl-pink-deep) 0%, var(--tl-pink) 55%, #ff7aae 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tl-lead { margin: 16px auto 22px; max-width: 30em; font-size: 16px; color: var(--tl-ink); line-height: 1.85; }
.tl-hero .tl-micro { margin-top: 10px; }

.tl-settings { margin: 16px auto 0; max-width: 420px; text-align: left; border: 1.5px solid var(--tl-line); border-radius: 16px; background: rgba(255, 255, 255, .75); }
.tl-settings summary {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; min-height: 48px;
  font-size: 14px; color: var(--tl-muted); cursor: pointer; list-style: none;
}
.tl-settings summary::-webkit-details-marker { display: none; }
.tl-settings-edit { flex: none; color: var(--tl-pink-deep); font-weight: 700; }
.tl-settings[open] .tl-settings-edit { opacity: .4; }
.tl-settings-body { padding: 4px 16px 16px; display: grid; gap: 12px; }
.tl-field > span { display: block; font-size: 13px; font-weight: 700; color: var(--tl-muted); margin-bottom: 6px; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-chip-btn {
  min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--tl-line); background: #fff;
  font-size: 14px; line-height: 1.3;
}
.tl-chip-btn[aria-pressed="true"] { background: var(--tl-pink); border-color: var(--tl-pink); color: #fff; font-weight: 700; }

.tl-hero-art { margin: 18px -16px 0; }
.tl-hero-art .pink-universe { margin: 0 auto; max-width: 480px; }

.tl-how { display: grid; gap: 10px; margin-top: 18px; }
.tl-how li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, .8); border: 1px solid var(--tl-line); font-size: 15px; }
.tl-how b { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--tl-pink-soft); color: var(--tl-pink-deep); font-size: 15px; }

.tl-long {
  display: grid; gap: 2px; margin-top: 22px; padding: 18px 20px; border-radius: var(--tl-radius);
  background: linear-gradient(135deg, #fff, var(--tl-pink-mist)); border: 1.5px solid var(--tl-line);
  color: var(--tl-ink); text-decoration: none; box-shadow: var(--tl-shadow);
  transition: transform .2s var(--tl-ease), border-color .2s;
}
.tl-long:hover { transform: translateY(-2px); border-color: var(--tl-pink); }
.tl-long-title { font-weight: 700; font-size: 16px; }
.tl-long-desc { font-size: 14px; color: var(--tl-muted); }
.tl-long-cta { margin-top: 6px; color: var(--tl-pink-deep); font-weight: 700; font-size: 14px; }
.tl-long-small { padding: 14px 18px; box-shadow: none; text-align: center; }
.tl-long-small .tl-long-title { color: var(--tl-pink-deep); font-size: 15px; }

/* ---------- 出会い ---------- */
.tl-meet { text-align: center; padding-top: 10px; }
.tl-meet .tl-h2 { margin: 6px 0 18px; }
.tl-person {
  display: grid; grid-template-columns: 1fr; overflow: hidden; text-align: left;
  border-radius: 26px; background: #fff; box-shadow: var(--tl-shadow); border: 1px solid var(--tl-line);
  animation: tl-rise .6s .05s var(--tl-ease) both;
}
.tl-person-art { position: relative; height: 230px; background: var(--tl-pink-soft); overflow: hidden; }
.tl-person-art svg { position: absolute; left: 50%; top: 0; width: 240px; height: 270px; transform: translateX(-50%); }
.tl-person-body { padding: 18px 20px 20px; }
.tl-person-place { font-size: 13px; font-weight: 700; color: var(--tl-pink-deep); letter-spacing: .04em; }
.tl-person-name { margin-top: 4px; font-size: 30px; font-weight: 700; line-height: 1.25; }
.tl-person-name small { margin-left: 10px; font-size: 15px; font-weight: 400; color: var(--tl-muted); }
.tl-person-job { color: var(--tl-muted); font-size: 15px; }
.tl-person-quote { margin: 12px 0 14px; padding-left: 14px; border-left: 3px solid var(--tl-pink); font-size: 16px; line-height: 1.75; }
.tl-person-facts { display: grid; gap: 8px; }
.tl-person-facts div { display: grid; grid-template-columns: 6.5em 1fr; gap: 10px; font-size: 14px; }
.tl-person-facts dt { color: var(--tl-pink-deep); font-weight: 700; }
.tl-hint { margin: 18px 4px; font-size: 14px; color: var(--tl-muted); }

/* ---------- 場面 ---------- */
.tl-play { padding-top: 4px; }
.tl-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tl-bar-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tl-bar-who b { display: block; font-size: 15px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-bar-who small { display: block; font-size: 12px; color: var(--tl-muted); white-space: nowrap; }
.tl-mini { position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: var(--tl-pink-soft); border: 2px solid #fff; box-shadow: 0 4px 12px -4px rgba(150, 30, 90, .4); }
.tl-mini svg { position: absolute; left: 50%; top: -2px; width: 52px; height: 58px; transform: translateX(-50%); }
.tl-dots { display: flex; gap: 5px; flex: none; }
.tl-dots li { width: 9px; height: 9px; border-radius: 50%; background: var(--tl-line); transition: background .3s, transform .3s; }
.tl-dots li.done { background: var(--tl-pink); }
.tl-dots li.now { background: var(--tl-pink-deep); transform: scale(1.35); }

.tl-meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.tl-meter { min-width: 0; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, .85); border: 1px solid var(--tl-line); }
.tl-meter-label { display: block; font-size: 12px; font-weight: 700; color: var(--tl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.tl-meter-label i { font-style: normal; margin-right: 4px; color: var(--tl-pink); }
.tl-meter-track { display: block; height: 7px; margin-top: 4px; border-radius: 99px; background: var(--tl-pink-soft); overflow: hidden; }
.tl-meter-fill { display: block; height: 100%; border-radius: inherit; transition: width .9s var(--tl-ease); }
.tl-meter-0 .tl-meter-fill { background: linear-gradient(90deg, #ff8ab8, var(--tl-pink)); }
.tl-meter-1 .tl-meter-fill { background: linear-gradient(90deg, #c38be0, var(--tl-violet)); }
.tl-meter-2 .tl-meter-fill { background: linear-gradient(90deg, #7fd1c9, var(--tl-teal)); }
.tl-meter-1 .tl-meter-label i { color: var(--tl-violet); }
.tl-meter-2 .tl-meter-label i { color: var(--tl-teal); }

.tl-scene {
  position: relative; padding: 20px 20px 22px; border-radius: var(--tl-radius);
  background: #fff; border: 1px solid var(--tl-line); box-shadow: var(--tl-shadow);
  animation: tl-rise .5s var(--tl-ease) both;
}
.tl-scene::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 5px; border-radius: var(--tl-radius) var(--tl-radius) 0 0;
  background: linear-gradient(90deg, #ff8ab8, var(--tl-pink), var(--tl-violet));
}
.tl-scene-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tl-scene-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 999px;
  background: var(--tl-pink-soft); color: var(--tl-pink-deep); font-size: 13px; font-weight: 700;
}
.tl-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tl-scene-time { font-size: 13px; color: var(--tl-muted); }
.tl-scene-title { margin-top: 12px; font-size: clamp(21px, 6vw, 25px); font-weight: 700; line-height: 1.45; }
.tl-scene-body { margin-top: 8px; font-size: 16px; line-height: 1.85; color: #563049; }

.tl-prompt { margin: 18px 4px 10px; font-size: 14px; font-weight: 700; color: var(--tl-pink-deep); letter-spacing: .08em; }
.tl-choices { display: grid; gap: 10px; }
.tl-choice {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 16px;
  border-radius: 18px; border: 1.5px solid var(--tl-line); background: #fff;
  text-align: left; font-size: 16px; font-weight: 700; line-height: 1.5;
  box-shadow: 0 6px 16px -12px rgba(150, 30, 90, .5);
  transition: border-color .2s, transform .15s var(--tl-ease), background .2s, opacity .25s, box-shadow .2s;
  animation: tl-rise .45s var(--tl-ease) both;
}
.tl-choice:nth-child(2) { animation-delay: .06s; }
.tl-choice:nth-child(3) { animation-delay: .12s; }
.tl-choice:hover:not(:disabled) { border-color: var(--tl-pink); box-shadow: 0 10px 22px -14px rgba(226, 52, 125, .8); }
.tl-choice:active:not(:disabled) { transform: scale(.985); }
.tl-choice-key {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--tl-pink-soft); color: var(--tl-pink-deep); font-size: 14px; font-weight: 700;
}
.tl-choice-text { min-width: 0; }
.tl-last { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: #f3e8ff; color: var(--tl-violet); font-size: 11px; font-weight: 700; vertical-align: 2px; }
.tl-choice.is-picked { border-color: var(--tl-pink); background: var(--tl-pink-mist); animation: tl-pop .3s var(--tl-ease); }
.tl-choices:has(.is-picked) .tl-choice:not(.is-picked) { opacity: .35; }
.tl-keyhint { margin-top: 10px; font-size: 12px; color: var(--tl-muted); text-align: center; }
@media (hover: none) { .tl-keyhint { display: none; } }

.tl-reaction { margin-top: 14px; animation: tl-rise .5s var(--tl-ease) both; }
.tl-picked { padding: 10px 14px; border-radius: 14px; background: var(--tl-pink); color: #fff; font-weight: 700; font-size: 15px; line-height: 1.5; margin-left: 32px; position: relative; }
.tl-picked::before { content: "✓"; position: absolute; left: -28px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--tl-pink-soft); color: var(--tl-pink-deep); font-size: 12px; display: grid; place-items: center; }
.tl-react-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; }
.tl-react-face { position: relative; flex: none; width: 56px; height: 56px; border-radius: 50%; overflow: visible; }
.tl-react-face svg { width: 56px; height: 56px; border-radius: 50%; background: var(--tl-pink-soft); border: 2px solid #fff; box-shadow: 0 6px 14px -6px rgba(150, 30, 90, .5); object-fit: cover; }
.tl-bubble {
  position: relative; flex: 1; min-width: 0; padding: 14px 16px; border-radius: 6px 20px 20px 20px;
  background: #fff; border: 1px solid var(--tl-line); box-shadow: var(--tl-shadow); font-size: 16px; line-height: 1.8;
}
.tl-bubble-who { font-size: 12px; font-weight: 700; color: var(--tl-pink-deep); letter-spacing: .06em; margin-bottom: 2px; }
.tl-affinity { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--tl-line); font-size: 14px; }
.tl-affinity.good { color: var(--tl-pink-deep); }
.tl-affinity.good::before { content: "♥ "; }
.tl-affinity.bad { color: var(--tl-violet); }
.tl-affinity.bad::before { content: "… "; }
.tl-reaction.is-cool .tl-bubble { border-color: #e2d3ec; }
.tl-deltas { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.tl-delta { padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; line-height: 1.6; }
.tl-delta.up { background: var(--tl-pink-soft); color: var(--tl-pink-deep); }
.tl-delta.down { background: #efe7f4; color: #6b4a80; }
.tl-next { margin-top: 18px; }

.tl-hearts { position: absolute; left: 50%; top: 0; pointer-events: none; }
.tl-hearts i { position: absolute; font-style: normal; color: var(--tl-pink); font-size: 16px; opacity: 0; animation: tl-heart 1.4s var(--tl-ease) forwards; }
.tl-hearts i:nth-child(1) { left: -18px; animation-delay: .1s; }
.tl-hearts i:nth-child(2) { left: -4px; font-size: 20px; animation-delay: .25s; }
.tl-hearts i:nth-child(3) { left: 10px; animation-delay: .4s; }
@keyframes tl-heart { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-36px) scale(1.1); } }

/* ---------- 結果 ---------- */
.tl-result { padding-top: 6px; }
.tl-new-ending { text-align: center; color: var(--tl-pink-deep); font-weight: 700; font-size: 14px; letter-spacing: .08em; margin-bottom: 10px; animation: tl-rise .5s var(--tl-ease) both; }
.tl-shared { margin-bottom: 16px; padding: 16px; border-radius: 18px; background: #fff; border: 1.5px dashed var(--tl-pink); text-align: center; }
.tl-shared p { font-size: 14px; color: var(--tl-muted); margin-bottom: 12px; }
.tl-shared-actions { display: grid; gap: 8px; }

.tl-card {
  position: relative; overflow: hidden; padding: 22px 22px 0; border-radius: 28px;
  background: radial-gradient(circle at 100% 0%, #ffc1da 0, transparent 45%), radial-gradient(circle at 0% 100%, #ffd9ea 0, transparent 50%), linear-gradient(160deg, #fff7fb, #ffe6f1);
  border: 1.5px solid var(--tl-line); box-shadow: 0 30px 60px -30px rgba(150, 30, 90, .55);
  animation: tl-rise .7s var(--tl-ease) both;
}
.tl-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-card-game { font-size: 15px; font-weight: 700; color: var(--tl-pink-deep); }
.tl-card-no { padding: 3px 12px; border-radius: 99px; background: var(--tl-pink); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.tone-apart .tl-card-no { background: #9a3d77; }
.tone-open .tl-card-no { background: #c2336f; }
.tl-card-tone { margin-top: 16px; font-size: 13px; font-weight: 700; color: var(--tl-pink-deep); letter-spacing: .1em; }
.tl-card-tone::before { content: "— "; }
.tl-card-title { margin-top: 4px; font-size: clamp(27px, 8vw, 38px); font-weight: 700; line-height: 1.3; letter-spacing: .01em; color: var(--tl-ink); }
.tl-card-catch { margin-top: 10px; font-size: 16px; color: #6f4a60; }
.tl-card-who { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.tl-card-face { position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--tl-pink-soft); border: 3px solid #fff; box-shadow: 0 6px 14px -6px rgba(150, 30, 90, .5); }
.tl-card-face svg { position: absolute; left: 50%; top: -4px; width: 76px; height: 86px; transform: translateX(-50%); }
.tl-card-who b { display: block; font-size: 17px; line-height: 1.35; }
.tl-card-who small { display: block; font-size: 13px; color: var(--tl-muted); }
.tl-card-style { margin-top: 16px; padding: 12px 16px; border-radius: 16px; background: rgba(255, 255, 255, .85); border: 1px solid var(--tl-line); }
.tl-card-style small { display: block; font-size: 12px; font-weight: 700; color: var(--tl-pink-deep); }
.tl-card-style b { font-size: 18px; }
.tl-card-foot { display: grid; gap: 2px; margin: 20px -22px 0; padding: 16px 22px 18px; background: linear-gradient(120deg, var(--tl-pink), var(--tl-pink-deep)); color: #fff; }
.tl-card-foot span { font-weight: 700; font-size: 15px; line-height: 1.5; }
.tl-card-foot b { font-weight: 400; font-size: 13px; opacity: .9; letter-spacing: .04em; }

.tl-share { display: grid; gap: 10px; margin-top: 16px; }
.tl-btn-x {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; padding: 12px 20px;
  border: 0; border-radius: 999px; background: #14171a; color: #fff !important; font-size: 17px; font-weight: 700; letter-spacing: .04em;
  box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .6); transition: transform .15s, background .2s;
}
.tl-btn-x:hover { background: #000; }
.tl-btn-x:active { transform: scale(.98); }
.tl-btn-x svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.tl-share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.tl-again { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.tl-again-btn {
  display: grid; gap: 2px; align-content: center; min-height: 76px; padding: 12px 14px; border-radius: 18px; text-align: left;
  border: 1.5px solid var(--tl-pink); background: #fff; transition: transform .15s, background .2s;
}
.tl-again-btn b { font-size: 16px; line-height: 1.4; color: var(--tl-pink-deep); }
.tl-again-btn small { font-size: 12px; color: var(--tl-muted); line-height: 1.4; }
.tl-again-btn.is-new { background: var(--tl-pink); border-color: var(--tl-pink); }
.tl-again-btn.is-new b, .tl-again-btn.is-new small { color: #fff; }
.tl-again-btn:hover { transform: translateY(-2px); }

.tl-block { margin-top: 22px; padding: 20px; border-radius: var(--tl-radius); background: #fff; border: 1px solid var(--tl-line); }
.tl-block p { font-size: 16px; line-height: 1.85; }
.tl-block .tl-h3 + p { margin-bottom: 16px; }
.tl-style-desc { padding: 12px 14px; border-radius: 14px; background: var(--tl-pink-mist); font-size: 15px !important; }
.tl-style-desc b { color: var(--tl-pink-deep); }
.tl-log { display: grid; gap: 10px; counter-reset: none; }
.tl-log li { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--tl-pink-mist); }
.tl-log-key li { background: #fff; border: 1.5px solid var(--tl-pink); }
.tl-log-scene { font-size: 12px; font-weight: 700; color: var(--tl-pink-deep); }
.tl-log-choice { font-size: 15px; font-weight: 700; line-height: 1.5; }
.tl-log .tl-deltas { margin-top: 4px; }
.tl-all { margin-top: 12px; }
.tl-all summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--tl-pink-deep); font-weight: 700; font-size: 14px; }
.tl-all[open] summary { margin-bottom: 8px; }
.tl-hint-next { margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, #f6ecff, var(--tl-pink-mist)); font-size: 15px !important; }
.tl-hint-next span { display: block; font-size: 12px; font-weight: 700; color: var(--tl-violet); letter-spacing: .06em; }

.tl-collection { margin-top: 22px; }
.tl-found { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tl-found li { display: flex; align-items: center; min-height: 56px; padding: 10px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; font-weight: 700; }
.tl-found li.is-found { background: #fff; border: 1.5px solid var(--tl-pink); color: var(--tl-ink); }
.tl-found li.is-found.tone-apart { border-color: #c48ab0; }
.tl-found li.is-found.tone-open { border-color: #e783ad; }
.tl-found li.is-locked { justify-content: center; background: rgba(255, 255, 255, .55); border: 1.5px dashed var(--tl-line); color: #b998ab; font-weight: 400; }
.tl-home .tl-found { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
.tl-home .tl-found li { min-height: 42px; justify-content: center; padding: 0; font-size: 0; }
.tl-home .tl-found li::after { content: "♥"; font-size: 16px; color: var(--tl-pink); }
.tl-home .tl-found li.is-locked::after { content: "♡"; color: #d9b3c6; }

/* モーダル内 */
.tl-preview { display: block; width: 100%; max-width: 420px; height: auto; margin: 12px auto; border-radius: 16px; box-shadow: 0 16px 40px -20px rgba(0, 0, 0, .5); }
.tl-copy-area { width: 100%; min-height: 150px; padding: 12px; margin-top: 10px; border-radius: 12px; border: 1px solid #edcbdc; font: 15px/1.7 system-ui, sans-serif; }

/* ---------- PC ---------- */
@media (min-width: 900px) {
  .tl-view-result { max-width: 980px; }
  .tl-result { display: grid; grid-template-columns: 440px 1fr; gap: 32px; align-items: start; }
  .tl-result-main { position: sticky; top: 16px; }
  .tl-result-side > .tl-block:first-child { margin-top: 0; }
  .tl-view-home { max-width: 1040px; }
  .tl-home { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; align-items: center; }
  .tl-home .tl-hero { text-align: left; }
  .tl-home .tl-lead { margin-left: 0; }
  .tl-home .tl-settings { margin-left: 0; }
  .tl-home .tl-hero-art { margin: 0; grid-row: 1; grid-column: 2; }
  .tl-home .tl-how, .tl-home .tl-collection, .tl-home .tl-long, .tl-home .tl-note { grid-column: 1 / -1; }
  .tl-home .tl-how { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 小さな画面 ---------- */
@media (max-width: 360px) {
  .tl-wrap { padding-left: 12px; padding-right: 12px; }
  .tl-meters { gap: 6px; }
  .tl-meter { padding: 6px 8px; }
  .tl-again, .tl-share-row { grid-template-columns: 1fr; }
  .tl-person-facts div { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  .tl-wrap, .tl-wrap * { animation: none !important; transition: none !important; }
  .tl-hearts { display: none; }
}

/* 結果カードは、保存される画像と同じ書体にそろえる */
.tl-card :where(h1, h2, h3), .tl-h3, .tl-person-name small { font-family: var(--tl-font); }

/* 画面の高さが低い端末（X内ブラウザなど）では、場面と選択肢を一画面に収める */
@media (max-height: 760px) {
  .tl-meters { margin: 8px 0; gap: 6px; }
  .tl-meter { padding: 5px 8px; }
  .tl-meter-label { font-size: 11px; }
  .tl-meter-track { height: 5px; margin-top: 2px; }
  .tl-mini { width: 36px; height: 36px; }
  .tl-scene { padding: 14px 16px 16px; }
  .tl-scene-title { margin-top: 8px; font-size: 20px; line-height: 1.4; }
  .tl-scene-body { font-size: 15px; line-height: 1.7; margin-top: 4px; }
  .tl-prompt { margin: 10px 4px 6px; font-size: 13px; }
  .tl-choices { gap: 8px; }
  .tl-choice { min-height: 54px; padding: 9px 14px; font-size: 15px; line-height: 1.45; }
  .tl-choice-key { width: 28px; height: 28px; font-size: 13px; }
  .tl-cta { min-height: 54px; }
}

/* スマホでは結果カードを詰めて、シェアボタンを近くに */
@media (max-width: 599px) {
  .tl-card { padding: 18px 18px 0; border-radius: 24px; }
  .tl-card-tone { margin-top: 10px; }
  .tl-card-title { font-size: clamp(24px, 6.8vw, 30px); }
  .tl-card-catch { margin-top: 6px; font-size: 15px; line-height: 1.6; }
  .tl-card-who { margin-top: 12px; }
  .tl-card-face { width: 52px; height: 52px; }
  .tl-card-face svg { width: 62px; height: 70px; }
  .tl-card-style { margin-top: 12px; padding: 10px 14px; }
  .tl-card-style b { font-size: 16px; }
  .tl-card-foot { margin: 16px -18px 0; padding: 12px 18px 14px; }
  .tl-card-foot span { font-size: 14px; }
}
.tl-card-title, .tl-scene-title, .tl-title, .tl-h2, .tl-found li span { word-break: auto-phrase; }

/* 思い出のひとこと・心に響いた選択 */
.tl-echo {
  margin-top: 12px; padding: 10px 14px; border-radius: 6px 16px 16px 16px;
  background: linear-gradient(135deg, #f6ecff, var(--tl-pink-mist)); border: 1px solid #ead7f3;
  font-size: 15px; line-height: 1.65; color: #4b2a55;
  animation: tl-rise .5s .15s var(--tl-ease) both;
}
.tl-echo-who { display: block; font-size: 12px; font-weight: 700; color: var(--tl-violet); letter-spacing: .04em; }
.tl-echo-who::before { content: "♡ "; }
.tl-card-hits { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 12px; padding: 8px 14px; border-radius: 14px; background: rgba(226, 52, 125, .08); }
.tl-card-hits span { font-size: 13px; font-weight: 700; color: var(--tl-pink-deep); line-height: 1.4; }
.tl-card-hits b { flex: none; font-size: 20px; color: var(--tl-pink); }
.tl-memories { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tl-memories li { position: relative; padding: 10px 12px 10px 34px; border-radius: 14px; background: var(--tl-pink-mist); font-size: 15px; line-height: 1.55; }
.tl-memories li::before { content: "♥"; position: absolute; left: 12px; top: 10px; color: var(--tl-pink); }

/* ==========================================================
   じっくり版（40年モード）のスマホ表示
   場面と選択肢を先に見せ、任意の「育成」「寄り道」パネルはその下へ
   ========================================================== */
@media (max-width: 899px) {
  #app > .enter:has(.play-layout) { display: flex; flex-direction: column; }
  #app > .enter:has(.play-layout) > .game-top { order: 1; }
  #app > .enter:has(.play-layout) > .chapter-track { order: 2; }
  #app > .enter:has(.play-layout) > .life-steps { order: 3; }
  #app > .enter:has(.play-layout) > .player-age-line { order: 4; }
  #app > .enter:has(.play-layout) > .play-layout { order: 5; }
  #app > .enter:has(.play-layout) > .rpg-panel { order: 6; margin-top: 18px; }
  #app > .enter:has(.play-layout) > .episode-panel { order: 7; }
  #app > .enter:has(.play-layout) > * { order: 8; }
  .stage-card .scene-strip { height: 72px; }
  .life-steps li { padding-top: 6px; padding-bottom: 6px; }
}
@media (max-width: 380px) {
  .tl-meter-label { white-space: normal; overflow: visible; text-overflow: clip; font-size: 11px; line-height: 1.3; min-height: 2.6em; display: flex; align-items: flex-end; }
}

/* じっくり版の結果：表紙のすぐ下に「共有」と「もう一度」を置く（内容はすべてそのまま） */
@media (max-width: 899px) {
  .life-album { display: flex; flex-direction: column; }
  .life-album > * { order: 10; }
  .life-album > .shared-banner { order: 0; }
  .life-album > .album-cover { order: 1; }
  .life-album > .album-share { order: 2; }
  .life-album > .album-replay { order: 3; }
  .life-album > .first-page { order: 4; }
  .life-album > .album-afterword { order: 5; }
  .life-album > .memory-album { order: 6; }
  .life-album > .life-collection { order: 7; }
  .life-album > .album-full { order: 8; }
}
@media (max-width: 380px) {
  .tl-meter-label { overflow-wrap: normal; word-break: normal; }
  .tl-meter-label i { display: none; }
}

/* ==========================================================
   じっくり版：相手の年代だけを選ぶ開始画面（v23）
   ========================================================== */
.setup23 .band-panel { margin-top: 8px; }
.setup23 .band-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0 12px; }
.setup23 .band-option {
  display: grid; gap: 2px; justify-items: start; text-align: left;
  min-height: 72px; padding: 12px 16px; border-radius: 18px;
  border: 1.5px solid var(--line, #edcbdc); background: #fff; color: var(--ink, #48213b);
  font: inherit; cursor: pointer; transition: border-color .2s, background .2s, transform .15s;
}
.setup23 .band-option b { font-size: 20px; font-weight: 700; line-height: 1.3; }
.setup23 .band-option small { font-size: 13px; color: var(--muted, #816577); }
.setup23 .band-option:hover { border-color: #e2347d; }
.setup23 .band-option:active { transform: scale(.98); }
.setup23 .band-option.active { border-color: #e2347d; background: linear-gradient(135deg, #ff5f9e, #e2347d 55%, #b8256a); color: #fff; box-shadow: 0 12px 26px -14px rgba(226, 52, 125, .8); }
.setup23 .band-option.active small { color: rgba(255, 255, 255, .9); }
.setup23 .band-option:focus-visible { outline: 3px solid #e2347d; outline-offset: 3px; }
.setup23 .rpg-optional > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--gold, #bd296d); }
.setup23 .rpg-optional:not([open]) { padding-top: 6px; padding-bottom: 6px; }
.choice .last-choice { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: #f3e8ff; color: #8f4fb3; font-size: 11px; font-weight: 700; vertical-align: 2px; }
@media (prefers-reduced-motion: reduce) { .setup23 .band-option { transition: none; } }
.tl-long-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.tl-long-cta { border: 0; background: none; padding: 8px 0; min-height: 44px; text-align: left; color: var(--tl-pink-deep); font-weight: 700; font-size: 15px; cursor: pointer; }
.tl-long-resume { color: var(--tl-violet); }
.tl-long-cta:focus-visible { outline: 3px solid var(--tl-pink); outline-offset: 2px; border-radius: 8px; }
.setup23 .band-option b { font-size: clamp(16px, 4.8vw, 20px); word-break: keep-all; overflow-wrap: normal; }
