/* ── kamen-story2.css ──────────────────────────────────────────────── */

.story2-shell .content-panel {
  max-width: 768px;
}

/* ── Hero select grid ─────────────────────────────────────────────── */
/* 改善1: 主人公を「自分で選ぶ」カードUI */

.hero-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.hero-select-card {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  color: #fff;
  border-radius: 12px;
  padding: 16px 14px;
  text-align: left;
  cursor: pointer;
  transition: transform .18s, border-color .18s, background .18s, box-shadow .18s;
}

.hero-select-card:hover,
.hero-select-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255,220,150,.6);
  background: rgba(255,255,255,.13);
  box-shadow: 0 4px 20px rgba(255,200,100,.12);
  outline: none;
}

.hero-select-card:active {
  transform: translateY(0);
}

.hero-select-card strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 7px;
  color: #ffeebb;
}

.hero-select-card span {
  display: block;
  color: rgba(255,255,255,.62);
  font-size: 11.5px;
  line-height: 1.6;
}

/* ── VN-style narrative ───────────────────────────────────────────── */
/* 改善2: story/dialogue 行が累積表示、タップで続ける */

.vn-screen {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.vn-content {
  margin: 16px 0;
}

.vn-content.vn-pre-q {
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.vn-line {
  margin: 0 0 10px;
  line-height: 1.75;
  animation: vnFadeIn .4s ease both;
}

.vn-story {
  color: rgba(255,255,255,.85);
  font-size: 15px;
}

.vn-dialogue {
  color: #fff;
  font-size: 15px;
}

.vn-speaker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,220,150,.85);
  letter-spacing: .06em;
  margin-right: 6px;
  vertical-align: middle;
}

/* 最新行は少し明るく */
.vn-latest {
  color: #fff;
}

.vn-latest.vn-story {
  color: rgba(255,255,255,.95);
}

/* タップ継続ヒント */
.tap-hint {
  margin-top: 20px;
  color: rgba(255,220,150,.55);
  font-size: 13px;
  letter-spacing: .05em;
  text-align: center;
  animation: tapBlink 1.8s ease-in-out infinite;
}

@keyframes vnFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes tapBlink {
  0%, 100% { opacity: .4; }
  50%       { opacity: 1; }
}

/* ── Question card extras ─────────────────────────────────────────── */
/* 改善3: 質問ラベルをシーン内選択肢に（aLabel/bLabel） */
/* 改善4: 仮面進捗ドット */

.mask-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 14px;
}

.q-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  transition: background .3s, border-color .3s;
}

.q-dot.filled {
  background: rgba(255,220,150,.75);
  border-color: rgba(255,220,150,.9);
  box-shadow: 0 0 6px rgba(255,200,80,.4);
}

.q-lead {
  font-size: 13.5px;
  color: rgba(255,255,255,.72);
  line-height: 1.7;
  margin: 0 0 10px;
  font-style: italic;
}

.q-prompt {
  font-size: 15px;
  color: rgba(255,220,150,.9);
  margin: 0 0 14px;
  line-height: 1.55;
}

/* ── Ending screen ────────────────────────────────────────────────── */
/* 改善5: 感情的クライマックスを独立させたドラマチック画面 */

.ending-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: 32px 16px 40px;
}

.ending-mask-icon {
  font-size: 52px;
  margin-bottom: 20px;
  animation: endingFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(255,220,150,.3));
}

@keyframes endingFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.ending-from {
  font-size: 13.5px;
  color: rgba(255,255,255,.58);
  letter-spacing: .06em;
  margin: 0 0 12px;
}

/* story2-ending-word はミステリCSSに定義済み。ここでは中央寄せのみ上書き */
.ending-screen .story2-ending-word {
  text-align: center;
  margin: 6px 0 20px;
}

.ending-hero-note {
  font-size: 12px;
  color: rgba(255,255,255,.44);
  margin: 0 0 28px;
  letter-spacing: .04em;
}

.ending-btn {
  min-width: 200px;
  animation: endingBtnPulse 2.4s ease-in-out infinite;
}

@keyframes endingBtnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,220,150,.0); }
  50%       { box-shadow: 0 0 0 8px rgba(255,220,150,.12); }
}

/* ── Result detail ────────────────────────────────────────────────── */
/* 改善6: 結果を簡潔に。ending wordの小さいバージョンを先頭に */

.result-ending-word-sm {
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 700;
  color: #ffd98a;
  line-height: 1.4;
  text-align: center;
  margin: 4px 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255,220,150,.2);
  border-radius: 10px;
  background: rgba(255,200,80,.06);
}

/* ── Legacy: mask note chips ──────────────────────────────────────── */

.story2-mask-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.story2-mask-note span {
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(0,0,0,.2);
  border-radius: 999px;
  color: rgba(255,255,255,.76);
  font-size: 11px;
  padding: 5px 9px;
}

/* ── Ending word (used in ending screen & old result) ─────────────── */

.story2-ending-word {
  color: #ffd98a;
  font-size: clamp(24px, 7vw, 44px);
  font-weight: 800;
  line-height: 1.35;
  margin: 18px 0;
}

/* ── Result subtitle ──────────────────────────────────────────────── */

.story2-result-subtitle {
  color: rgba(255,255,255,.7);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  margin-bottom: 6px;
}

/* ── Name input ───────────────────────────────────────────────────── */

.story2-name-input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.1);
  color: #fff;
  border-radius: 8px;
  padding: 13px 14px;
  font: inherit;
  margin: 8px 0 14px;
  outline: none;
  box-sizing: border-box;
}

.story2-name-input::placeholder {
  color: rgba(255,255,255,.48);
}

.story2-name-input:focus {
  border-color: rgba(255,220,150,.7);
  box-shadow: 0 0 0 3px rgba(255,220,150,.12);
}

/* ── Route grid (legacy, kept for compatibility) ──────────────────── */

.story2-route-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.story2-route {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: 8px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: transform .16s, border-color .16s, background .16s;
}

.story2-route:hover {
  transform: translateY(-1px);
  border-color: rgba(255,220,150,.55);
  background: rgba(255,255,255,.12);
}

.story2-route strong {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 6px;
}

.story2-route span {
  display: block;
  color: rgba(255,255,255,.68);
  font-size: 12px;
  line-height: 1.55;
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 520px) {
  .hero-select-grid {
    grid-template-columns: 1fr;
  }

  .story2-route-grid {
    grid-template-columns: 1fr;
  }

  .ending-screen {
    min-height: 50vh;
  }
}
