:root {
  --ink: #254e70;
  --text: #456371;
  --muted: #6b7f89;
  --sky: #eaf8ff;
  --paper: #ffffff;
  --coral: #ef629a;
  --coral-dark: #bd3f72;
  --gold: #ffdd59;
  --line: #d8e9ef;
  --shadow: 0 18px 44px rgba(37, 78, 112, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 221, 89, 0.22), transparent 24rem),
    radial-gradient(circle at 88% 18%, rgba(239, 98, 154, 0.14), transparent 22rem),
    linear-gradient(180deg, #f7fcff 0%, #eef8fb 48%, #fff7f4 100%);
  color: var(--text);
  font-family: "DM Sans", Arial, sans-serif;
  line-height: 1.6;
}

body.story-locale-ja { font-family: "Noto Sans JP", "DM Sans", Arial, sans-serif; }
body.story-locale-ko { font-family: "Noto Sans KR", "DM Sans", Arial, sans-serif; }
body.story-locale-cn { font-family: "Noto Sans SC", "DM Sans", Arial, sans-serif; }
body.story-locale-tw { font-family: "Noto Sans TC", "DM Sans", Arial, sans-serif; }

a { color: var(--ink); }

.story-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.story-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(216, 233, 239, 0.82);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.story-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  color: var(--ink);
  font-family: "Nunito", Arial, sans-serif;
  font-weight: 900;
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.story-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.story-header nav a {
  padding: 0.5rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.story-main { padding: clamp(1rem, 3vw, 2.25rem) 0 3rem; }

.story-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(310px, 0.78fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid #f2d9df;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(234, 248, 255, 0.82)), var(--paper);
  box-shadow: var(--shadow);
}

.kicker {
  display: inline-flex;
  margin: 0 0 0.75rem;
  padding: 0.38rem 0.68rem;
  border-radius: 999px;
  background: #fff1f6;
  color: var(--coral-dark);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin-top: 0;
  color: var(--ink);
  font-family: "Nunito", Arial, sans-serif;
  line-height: 1.14;
}

.story-locale-ja h1,
.story-locale-ja h2,
.story-locale-ja h3,
.story-locale-ko h1,
.story-locale-ko h2,
.story-locale-ko h3,
.story-locale-cn h1,
.story-locale-cn h2,
.story-locale-cn h3,
.story-locale-tw h1,
.story-locale-tw h2,
.story-locale-tw h3 {
  font-family: inherit;
}

h1 {
  max-width: 13ch;
  margin-bottom: 0.75rem;
  font-size: clamp(2.25rem, 5.4vw, 4.1rem);
}

.hero-lead {
  max-width: 58ch;
  margin: 0 0 1.15rem;
  color: #3f5d6d;
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
}

.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.story-btn,
.choice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.72rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: 900 0.95rem/1.2 "DM Sans", Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(37, 78, 112, 0.16);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.story-btn:hover,
.story-btn:focus-visible,
.choice-btn:hover,
.choice-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(37, 78, 112, 0.22);
  outline: none;
}

.story-btn--secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, #e8f6ff, #fff);
  box-shadow: inset 0 0 0 1px rgba(37, 78, 112, 0.08);
}

.hero-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
}

.hero-card__note {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  padding: 0.78rem 0.85rem;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(37, 78, 112, 0.16);
}

.story-stage {
  display: grid;
  grid-template-columns: minmax(0, 0.74fr) minmax(330px, 1fr);
  gap: 1rem;
  margin-top: 1.2rem;
  align-items: start;
}

.story-panel,
.reflection-panel,
.tool-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(37, 78, 112, 0.08);
}

.story-panel { overflow: hidden; }

.scene-top {
  padding: 1rem;
  background: linear-gradient(135deg, #fff, var(--sky));
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.48rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #dfeef3;
}

.progress-fill {
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  transition: width 0.34s ease;
}

.scene-body { padding: clamp(1rem, 3vw, 1.45rem); }

.scene-title {
  margin-bottom: 0.45rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.scene-text {
  margin: 0;
  color: #3e5c6b;
  font-size: 1.06rem;
}

.destiny-thought {
  margin: 1rem 0 0;
  padding: 0.85rem 0.9rem;
  border-left: 4px solid var(--coral);
  border-radius: 0 12px 12px 0;
  background: #fff5f8;
  color: var(--ink);
  font-weight: 800;
}

.choices {
  display: grid;
  gap: 0.72rem;
  margin-top: 1.15rem;
}

.choice-btn {
  justify-content: flex-start;
  min-height: 64px;
  width: 100%;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(216, 233, 239, 0.95), 0 8px 18px rgba(37, 78, 112, 0.06);
}

.choice-btn strong {
  display: block;
  margin-bottom: 0.1rem;
  color: var(--ink);
  font-size: 1rem;
}

.choice-btn span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.story-side {
  display: grid;
  gap: 1rem;
}

.reflection-panel,
.tool-card { padding: 1rem; }

.feeling-meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.34rem;
  margin-top: 0.72rem;
}

.feeling-dot {
  min-height: 42px;
  border-radius: 12px;
  background: #e4eef3;
  box-shadow: inset 0 0 0 1px rgba(37, 78, 112, 0.06);
  transition: background 0.24s ease, transform 0.24s ease;
}

.feeling-dot.is-filled {
  background: linear-gradient(135deg, #9ecff0, #ef629a);
  transform: translateY(-2px);
}

.reflection-list {
  display: grid;
  gap: 0.58rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.reflection-list li {
  padding: 0.72rem;
  border-radius: 13px;
  background: var(--sky);
  color: var(--ink);
  font-weight: 800;
}

.tool-card {
  background: radial-gradient(circle at 12% 0%, rgba(255, 221, 89, 0.18), transparent 34%), #fff;
}

.tool-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.tool-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.42rem 0.68rem;
  border: 1px solid #f0ccd9;
  border-radius: 999px;
  background: #fff4f8;
  color: var(--coral-dark);
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
}

.completion-card {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #f1fbf7, #fff7df);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(37, 78, 112, 0.08);
}

.completion-card.is-visible { display: block; }

@media (max-width: 860px) {
  .story-hero,
  .story-stage { grid-template-columns: 1fr; }

  .hero-card { order: -1; }

  .hero-card img { max-height: 360px; }
}

@media (max-width: 580px) {
  .story-shell { width: min(100% - 1.2rem, 460px); }

  .story-header__inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.65rem 0;
  }

  .story-header nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
  }

  h1 { font-size: 2.35rem; }

  .story-actions,
  .story-btn { width: 100%; }

  .hero-card__note {
    position: static;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after { transition: none !important; }
}
