/* サウンドノベル（読まなくてもわかる記事ゲーム） */

/* 記事本文の中に置く前提。広告に見えないよう、サイトの配色に合わせる */
.novel-wrap {
  margin: 0 0 2.2em;
}
.entry-content .novel-wrap > p {
  margin: 0 0 .9em;
}
.entry-content .novel-wrap .novel-after {
  margin: .9em 0 0;
  font-size: 90%;
  color: #666;
}

/* 「ゲームでわかる」「記事を読む」の選択 */
.novel-choose {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 0 14px;
}
.entry-content .novel-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 15px 16px;
  border: 2px solid #58d85f;
  border-radius: 8px;
  background: #fff;
  color: #2b2b33;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s;
}
.entry-content .novel-pick .ic {
  flex: 0 0 auto;
  font-size: 30px;
  line-height: 1;
}
.entry-content .novel-pick .tx {
  display: block;
  min-width: 0;
}
.entry-content .novel-pick b {
  display: block;
  font-size: 17px;
  line-height: 1.4;
}
.entry-content .novel-pick small {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #6b6b74;
}
.entry-content .novel-pick.is-game {
  background: #58d85f;
  color: #fff;
  box-shadow: 0 3px 0 #3aa844;
}
.entry-content .novel-pick.is-game small { color: rgba(255, 255, 255, .9); }
.entry-content .novel-pick:active { transform: translateY(2px); }
.entry-content .novel-pick.is-game:active { box-shadow: 0 1px 0 #3aa844; }

/* ゲームを始めたら、選択ボタンは控えめにする */
.novel-choose.is-started .novel-pick.is-game { display: none; }

@media (min-width: 600px) {
  .novel-choose { grid-template-columns: 1fr 1fr; }
  .novel-choose.is-started { grid-template-columns: 1fr; }
}

.novel {
  --nv-ink: #2b2b33;
  --nv-paper: #fffdf8;
  --nv-accent: #58d85f;   /* サイトのメインカラー */
  --nv-accent2: #4b99b5;  /* サイトのサブカラー */
  --nv-ok: #35a06b;
  --nv-ng: #e05b6a;
  position: relative;
  margin: 0;
  border: 3px solid var(--nv-accent);
  border-radius: 10px;
  overflow: hidden;
  background: #1b1c26;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
               "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.novel *,
.novel *::before,
.novel *::after { box-sizing: border-box; }

/* 記事本文のスタイル（見出し装飾・リストの飾り等）がゲーム内に効かないようにする */
.entry-content .novel h3,
.entry-content .novel h4 {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 700;
  line-height: 1.4;
}
.entry-content .novel h3::before, .entry-content .novel h3::after,
.entry-content .novel h4::before, .entry-content .novel h4::after {
  content: none;
  display: none;
}
.entry-content .novel ul,
.entry-content .novel ol {
  margin: 0;
  padding: 0;
  list-style: none;
  background: none;
  border: 0;
}
.entry-content .novel li {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
}
.entry-content .novel li::before,
.entry-content .novel li::after {
  content: none;
  display: none;
}
.entry-content .novel p { margin: 0; }
.entry-content .novel a { text-decoration: none; }
.entry-content .novel button { font-family: inherit; }

/* ---------------------------------------------------------------- ヘッダー */

.nv-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, .35);
  font-size: 12px;
  line-height: 1.4;
}
.nv-bar .nv-label {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  letter-spacing: .04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-btn-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.nv-btn-icon:active { transform: scale(.92); }
.nv-btn-icon[aria-pressed="true"] { background: var(--nv-accent); }

.nv-progress {
  height: 3px;
  background: rgba(255, 255, 255, .15);
}
.nv-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--nv-accent), var(--nv-accent2));
  transition: width .35s ease;
}

/* ------------------------------------------------------------------ 舞台 */

.nv-stage {
  position: relative;
  min-height: 230px;
  padding: 14px 12px 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4%;
  overflow: hidden;
  background: linear-gradient(180deg, #cfe6f5 0%, #eaf4fb 55%, #f6efe4 100%);
  transition: background .5s ease;
}
.nv-stage[data-bg="hallway"]  { background: linear-gradient(180deg, #dfe7f0 0%, #f2f5f8 60%, #e6e1d6 100%); }
.nv-stage[data-bg="phone"]    { background: linear-gradient(180deg, #26304a 0%, #3d4a6b 100%); }
.nv-stage[data-bg="sunset"]   { background: linear-gradient(180deg, #ffd7a8 0%, #ffb3a7 55%, #f7c9b6 100%); }
.nv-stage[data-bg="think"]    { background: linear-gradient(180deg, #efe6fb 0%, #f8f2ff 100%); }

/* 教室の窓（背景の飾り） */
.nv-stage::before {
  content: "";
  position: absolute;
  left: 6%;
  top: 12px;
  width: 34%;
  height: 42%;
  border: 5px solid rgba(255, 255, 255, .65);
  border-radius: 4px;
  background: rgba(255, 255, 255, .28);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
  opacity: .9;
}
.nv-stage[data-bg="phone"]::before,
.nv-stage[data-bg="think"]::before { display: none; }

.nv-chara {
  position: relative;
  z-index: 1;
  width: 40%;
  max-width: 150px;
  transition: transform .35s ease, opacity .35s ease, filter .35s ease;
}
.nv-chara svg { display: block; width: 100%; height: auto; }
.nv-chara[data-state="off"]     { opacity: 0; transform: translateY(14px); }
.nv-chara[data-state="dim"]     { filter: grayscale(.55) brightness(.85); transform: scale(.94); }
.nv-chara[data-state="active"]  { transform: translateY(-4px) scale(1.03); }
.nv-chara[data-state="away"]    { transform: translateX(12%) rotate(4deg); filter: grayscale(.3); }

.nv-name {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  padding: 1px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
}

/* 場面を表す大きな絵記号 */
.nv-emoji {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 12px;
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .25));
  animation: nv-pop .4s ease;
}
@keyframes nv-pop {
  from { transform: scale(.4) rotate(-12deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}

/* ------------------------------------------------------------ セリフ窓 */

.nv-text {
  position: relative;
  min-height: 104px;
  padding: 14px 16px 34px;
  background: rgba(12, 13, 20, .92);
  font-size: 16px;
  line-height: 1.75;
}
.nv-speaker {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--nv-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.nv-speaker[data-who="haru"]  { background: var(--nv-accent2); color: #10333a; }
.nv-speaker[data-who="navi"]  { background: #ffd166; color: #4a3a05; }
.nv-speaker[data-who="none"]  { display: none; }
.nv-line { margin: 0; word-break: break-word; }

/* セリフ中はどこをタップしても進めることを示す */
.nv-stage,
.nv-text { cursor: pointer; }

.nv-next {
  position: absolute;
  right: 14px;
  bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  font-size: 12px;
  color: rgba(255, 255, 255, .85);
  animation: nv-blink 1.4s infinite;
}
@keyframes nv-blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ------------------------------------------------------------ 選択肢 */

.nv-choices {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #14151d;
}
.nv-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 14px;
  border: 2px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  background: #232533;
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.nv-choice:active { transform: scale(.985); }
.nv-choice .ic { flex: 0 0 auto; font-size: 24px; line-height: 1; }
.nv-choice.is-ok { border-color: var(--nv-ok); background: rgba(53, 160, 107, .22); }
.nv-choice.is-ng { border-color: var(--nv-ng); background: rgba(224, 91, 106, .2); }
.nv-choice[disabled] { cursor: default; opacity: .85; }

.nv-question {
  padding: 12px 14px 0;
  background: #14151d;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}

/* --------------------------------------------------------- カード一覧 */

.nv-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px;
  background: #14151d;
}
.nv-card {
  padding: 12px 8px;
  border-radius: 12px;
  background: #232533;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(8px);
  animation: nv-in .35s ease forwards;
}
.nv-card .ic { display: block; font-size: 30px; line-height: 1.2; margin-bottom: 2px; }
@keyframes nv-in { to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ 結果画面 */

.nv-result {
  padding: 20px 16px 8px;
  text-align: center;
  background: linear-gradient(180deg, #232742, #14151d);
}
.nv-result .ic { font-size: 56px; line-height: 1; }
.nv-result h4 {
  margin: 8px 0 4px;
  font-size: 19px;
  color: #ffd166;
}
.nv-result p { margin: 0 0 6px; font-size: 14.5px; line-height: 1.75; }

.nv-summary {
  padding: 4px 12px 12px;
  background: #14151d;
}
.nv-summary li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 8px;
  padding: 11px 12px;
  border-radius: 10px;
  background: #232533;
  font-size: 14px;
  line-height: 1.6;
  list-style: none;
}
.nv-summary ul { margin: 0; padding: 0; }
.nv-summary .ic { flex: 0 0 auto; font-size: 22px; line-height: 1.3; }

.nv-safety {
  margin: 0 12px 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 209, 102, .14);
  border: 1px solid rgba(255, 209, 102, .4);
  font-size: 13.5px;
  line-height: 1.7;
}

.nv-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 14px;
}
.nv-action {
  display: block;
  padding: 13px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.nv-action.primary { background: linear-gradient(90deg, var(--nv-accent), #ff9d7a); }

/* ------------------------------------------------------------ 開始画面 */

/* 開始画面は明るい配色にして、記事の中の一部として見えるようにする */
.nv-title {
  padding: 22px 18px 20px;
  text-align: center;
  background: #f5fbf5;
  color: var(--nv-ink);
}
.nv-title .nv-kicker {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 12px;
  border-radius: 4px;
  background: var(--nv-accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
}
.novel .nv-title h3 {
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 19px;
  line-height: 1.5;
  color: var(--nv-ink);
  text-align: center;
}
.novel .nv-title h3::before,
.novel .nv-title h3::after { display: none; }
.nv-title p {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.75;
  color: #555;
}
.nv-start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 34px;
  border: 0;
  border-radius: 6px;
  background: var(--nv-accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 #3aa844;
}
.nv-start:active { transform: translateY(2px); box-shadow: 0 1px 0 #3aa844; }
.nv-note {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: #777;
  line-height: 1.6;
}

/* --------------------------------------------------------------- 画面幅 */

@media (min-width: 600px) {
  .nv-stage { min-height: 290px; }
  .nv-chara { max-width: 180px; }
  .nv-text  { font-size: 17px; }
  .nv-cards { grid-template-columns: repeat(3, 1fr); }
  .nv-title h3 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .novel * { animation: none !important; transition: none !important; }
}
