/* ══════════════════════════════════════════════════════════════
   My Success — 野球能力値診断（/shindan）
   ・site.css の差分としてのみ機能する。site.css より後に読み込むこと
   ・スマートフォン優先。iPhone Safari を主対象に、タップ領域を大きく取る
   ・ガイド（guide.css）と同系統の紺＋アクセントブルーで統一
   ══════════════════════════════════════════════════════════════ */

.sd-body { background: var(--bg2); }
.sd-main { display: block; }
/* 画面共通の左右セーフマージン。LP・ガイドの .container と同じ 22px に揃える。
   ここを打ち消さないよう、.sd-wrap を併用する要素は padding のショートハンドを
   使わず padding-top / padding-bottom の longhand で指定すること
   （ショートハンドで書くと左右が 0 に戻り、文字が画面端に張り付く）。 */
.sd-wrap {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 22px;
}
.sd-br-sp { display: inline; }

/* ── ヒーロー ───────────────────────────────────── */
.sd-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(152deg, #0b1738 0%, #12245a 55%, #1b3178 100%);
  padding: 30px 0 34px;
  color: #fff;
}
.sd-hero::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(114deg, transparent 0 26px, rgba(255,255,255,.022) 26px 52px);
}
.sd-hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, #4d7bf0 38%, rgba(77,123,240,0) 82%);
}
.sd-hero__eyebrow {
  font-family: 'Bebas Neue', sans-serif;
  font-size: .78rem; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.46); margin: 0 0 10px;
}
.sd-hero__title {
  font-size: 1.75rem; font-weight: 900; line-height: 1.4;
  margin: 0 0 14px; letter-spacing: .01em;
}
.sd-hero__lead {
  font-size: .88rem; line-height: 1.95;
  color: rgba(255,255,255,.74); margin: 0 0 18px;
}
.sd-hero__lead strong { color: #fff; font-weight: 700; }
.sd-hero__badges {
  display: flex; flex-wrap: wrap; gap: 8px;
  list-style: none; margin: 0; padding: 0;
}
.sd-hero__badges li {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  color: #cfdcff;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; padding: 6px 13px;
}

/* ── 最初の画面 ─────────────────────────────────── */
.sd-start-body { padding-top: 26px; padding-bottom: 60px; }

.sd-namebox {
  background: var(--white, #fff);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.sd-namebox__label {
  display: block;
  font-size: .78rem; font-weight: 900; color: var(--text);
  margin-bottom: 10px;
}
.sd-namebox__input {
  width: 100%;
  font-size: 16px;                 /* iOS Safari の自動ズームを防ぐため 16px 未満にしない */
  font-family: inherit;
  color: var(--text);
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.sd-namebox__input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.sd-namebox__note {
  font-size: .74rem; line-height: 1.85; color: var(--text2);
  margin: 12px 0 0;
}
.sd-namebox__note strong { color: var(--text); font-weight: 700; }

.sd-cta { margin-bottom: 14px; padding: 17px 20px; font-size: .96rem; }

.sd-about { font-size: .84rem; line-height: 1.95; color: var(--text2); }
.sd-about h2 {
  font-size: .94rem; font-weight: 900; color: var(--text);
  margin: 30px 0 10px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.sd-about p { margin: 0 0 14px; }
.sd-about strong { color: var(--text); font-weight: 700; }
.sd-about ul { margin: 0 0 14px; padding-left: 1.3em; }
.sd-about li { margin-bottom: 7px; }
.sd-about__note { font-size: .76rem; color: var(--text3); }

/* ── 20問 ───────────────────────────────────────── */
.sd-quiz-head {
  position: sticky; top: 58px; z-index: 20;
  background: rgba(247,248,250,.94);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  padding-top: 14px;
}
.sd-quiz-head__inner {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px;
}
.sd-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: none;
  margin-left: -8px;
  border: none; background: transparent; color: var(--text2);
  border-radius: 50%;
}
.sd-back svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.sd-back:active { background: var(--border); }
.sd-q-count {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.05rem; letter-spacing: .12em; color: var(--accent);
}
.sd-role-note {
  margin-left: auto;
  font-size: .68rem; font-weight: 700; color: var(--text3);
}
.sd-progress {
  height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
  max-width: 620px; margin: 0 auto;
}
.sd-progress i {
  display: block; height: 100%; width: 5%;
  background: linear-gradient(90deg, var(--accent), #4d7bf0);
  border-radius: 2px;
  transition: width .3s var(--ease);
}

.sd-q-card { padding: 34px 0 70px; }
.sd-q-card.is-in { animation: sdIn .26s var(--ease) both; }
@keyframes sdIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.sd-q-title {
  font-size: 1.22rem; font-weight: 900; line-height: 1.65;
  color: var(--text); margin: 0 0 10px;
  text-wrap: pretty;
}
.sd-q-note { font-size: .76rem; color: var(--text3); margin: 0 0 22px; }
.sd-q-title + .sd-q-options { margin-top: 24px; }

.sd-q-options { display: grid; gap: 10px; }
.sd-opt {
  display: block; width: 100%; text-align: left;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 17px 18px;                /* タップ領域を十分に取る */
  min-height: 56px;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(16,24,48,.04);
  transition: border-color .15s, background .15s, transform .12s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.sd-opt__main { display: block; font-size: .92rem; font-weight: 700; line-height: 1.6; }
.sd-opt__sub  { display: block; font-size: .74rem; color: var(--text3); margin-top: 3px; }
@media (hover: hover) {
  .sd-opt:hover { border-color: #cfdcff; background: var(--bg3); }
}
.sd-opt:active { transform: scale(.985); }
.sd-opt.is-picked {
  border-color: var(--accent);
  background: var(--bg3);
  box-shadow: 0 0 0 3px rgba(26,86,219,.14);
}

/* ── 結果 ───────────────────────────────────────── */
.sd-hero--result { padding: 26px 0 30px; }
.sd-r-name { font-size: 1.5rem; font-weight: 900; margin: 0 0 8px; }
.sd-r-type {
  display: inline-block;
  font-size: .8rem; font-weight: 700; color: #cfdcff;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px; padding: 6px 15px; margin: 0 0 18px;
}
.sd-r-overall { display: flex; align-items: center; gap: 14px; }
.sd-r-overall__label {
  font-size: .72rem; font-weight: 700; letter-spacing: .16em;
  color: rgba(255,255,255,.5);
}
.sd-r-overall__num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.4rem; line-height: 1; color: #fff; letter-spacing: .02em;
}
.sd-r-overall__rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 14px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem; line-height: 1; color: #fff;
  margin-left: auto;
}

/* padding ショートハンドで書くと .sd-wrap の左右 22px を打ち消してしまい、
   結果画面だけ文字・能力値・ランクバッジが画面端に張り付く（実機で発覚）。
   縦だけを longhand で指定して左右は .sd-wrap に任せる。 */
.sd-result-body { padding-top: 8px; padding-bottom: 60px; }
.sd-h2 {
  font-size: .82rem; font-weight: 900; letter-spacing: .1em;
  color: var(--text); margin: 34px 0 14px;
  padding-top: 18px; border-top: 1px solid var(--border);
}
.sd-result-body > .sd-h2:first-child { border-top: none; padding-top: 26px; margin-top: 0; }

.sd-abilities { list-style: none; margin: 0; padding: 0; }
.sd-ab {
  display: grid;
  grid-template-columns: 78px 1fr 38px 30px;   /* 能力名 / バー / 数値 / ランク */
  align-items: center; gap: 10px;
  padding: 9px 0;
}
/* 小型端末（iPhone SE 等）ではバーが痩せすぎるので、固定列と間隔だけ詰める。
   4列の構成そのものは維持し、情報は一切落とさない。 */
@media (max-width: 359px) {
  .sd-ab { grid-template-columns: 68px 1fr 34px 28px; gap: 8px; }
  .sd-ab__label { font-size: .8rem; }
  .sd-ab__rank { width: 28px; height: 28px; }
}
.sd-ab__label { font-size: .84rem; font-weight: 700; color: var(--text); }
.sd-ab__bar {
  height: 10px; border-radius: 5px;
  background: var(--border); overflow: hidden;
}
.sd-ab__bar i { display: block; height: 100%; border-radius: 5px; }
.sd-ab__val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.15rem; color: var(--text); text-align: right; letter-spacing: .04em;
}
.sd-ab__rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem; color: #fff;
}

.sd-specials { display: flex; flex-wrap: wrap; gap: 8px; }
.sd-sp {
  font-size: .78rem; font-weight: 700; color: var(--accent);
  background: var(--bg3); border: 1px solid #cfdcff;
  border-radius: 999px; padding: 8px 15px;
}
.sd-sp--neg { color: var(--text3); background: var(--bg2); border-color: var(--border); }

.sd-order { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.sd-order__num {
  font-size: 1.7rem; font-weight: 900; color: var(--accent); flex: none;
}
.sd-order__comment {
  flex: 1 1 240px;
  font-size: .82rem; line-height: 1.9; color: var(--text2); margin: 0;
}

.sd-comment { font-size: .86rem; line-height: 1.95; color: var(--text2); }
.sd-comment p { margin: 0 0 10px; }

.sd-card-box { margin-bottom: 16px; min-height: 120px; }
.sd-card__loading {
  font-size: .8rem; color: var(--text3); text-align: center; padding: 40px 0; margin: 0;
}
.sd-save-note {
  font-size: .72rem; line-height: 1.8; color: var(--text3);
  margin: 0 0 26px; text-align: center;
}
.sd-restart {
  display: block; width: 100%;
  background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 14px;
  font-size: .82rem; font-weight: 700; color: var(--text2);
}
.sd-restart:active { background: var(--bg2); }

/* ── My Success 紹介（最後にだけ・結果より目立たせない）── */
.sd-promo {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(152deg, #0b1738 0%, #12245a 55%, #1b3178 100%);
  border-radius: 20px;
  padding: 30px 22px 0;
  margin: 40px 0 0;
  color: rgba(255,255,255,.72);
}
.sd-promo::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(114deg, transparent 0 26px, rgba(255,255,255,.022) 26px 52px);
}
.sd-promo__eyebrow {
  font-family: 'Bebas Neue', sans-serif;
  font-size: .76rem; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.46); margin: 0 0 9px;
}
.sd-promo__title { font-size: 1.08rem; font-weight: 900; line-height: 1.6; color: #fff; margin: 0 0 12px; }
.sd-promo__lead { font-size: .82rem; line-height: 1.95; margin: 0 0 22px; }
.sd-promo__actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.sd-promo__actions .btn { width: 100%; padding: 15px 18px; font-size: .9rem; }
.sd-promo .btn--ghost {
  background: transparent; color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.3);
}
.sd-promo__note { font-size: .68rem; color: rgba(255,255,255,.46); margin: 0 0 24px; }

/* アプリの能力値画面。ガイドCTA（.guide-promo__shot）と同じ見せ方に揃える：
   下端で切って「続きがある」感じを残し、角丸は上だけ。縦長の実寸(853×1844)が
   そのまま伸びるとCTAが画面外へ押し出されるので高さを固定する。 */
.sd-promo__shot {
  width: 210px; height: 300px;
  margin: 0 auto;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  box-shadow: 0 -2px 40px rgba(0,0,0,.34);
}
.sd-promo__shot img { display: block; width: 100%; height: auto; margin: 0; }

/* ── トースト ───────────────────────────────────── */
.sd-toast {
  position: fixed;
  left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 16px);
  z-index: 200;
  max-width: calc(100vw - 40px);
  background: rgba(16,24,48,.94);
  color: #fff;
  font-size: .8rem; font-weight: 700; line-height: 1.6;
  padding: 13px 20px; border-radius: 999px;
  box-shadow: 0 10px 34px rgba(0,0,0,.28);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s var(--ease);
}
.sd-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── PC ─────────────────────────────────────────── */
@media (min-width: 720px) {
  .sd-br-sp { display: none; }
  .sd-hero { padding: 44px 0 48px; }
  .sd-hero--result { padding: 38px 0 42px; }
  .sd-hero__title { font-size: 2.3rem; }
  .sd-hero__lead { font-size: .95rem; }
  .sd-q-title { font-size: 1.4rem; }
  .sd-q-card { padding: 44px 0 90px; }
  .sd-promo {
    display: grid; grid-template-columns: 1fr 208px;
    gap: 30px; align-items: end;
    padding: 38px 0 0 34px;
  }
  .sd-promo__text { padding-bottom: 34px; }
  /* 本文カラムが620pxのため、CTAの2列表示だとボタン内で日本語が折り返す。
     アプリ画面を横に置くこの段では、ボタンは縦積みのまま全幅で置く。 */
  .sd-promo__note { margin-bottom: 0; }
  .sd-promo__shot { width: 208px; height: 300px; margin: 0 34px 0 0; }
  .sd-ab { grid-template-columns: 92px 1fr 44px 34px; }
}

/* 動きを減らす設定を尊重する */
@media (prefers-reduced-motion: reduce) {
  .sd-q-card.is-in { animation: none; }
  .sd-opt, .sd-progress i, .sd-toast { transition: none; }
}
