@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@700;900&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap');

/* routes-design-preview.html の海と島の地図をSAMホームへ移植したもの */
:where(.routes-banner, .routes-current-band) {
  --sea-deep: #a9d2e6;
  --sea-mid: #cfe6f0;
  --sea-shallow: #e9f4f8;
  --island: #fbf6ea;
  --island-edge: #e3d7bd;
  --ink: #23283f;
  --ink-soft: #454a63;
  --ai: #5558d9;
  --ai-deep: #4245c4;
  --luna: #5cc0ea;
  --luna-deep: #1d7fae;
  --land-video: #f6ecd8;
  --land-text: #efe4d2;
  --land-shop: #e2efdf;
  --surface: #fbf6ea;
  --font-display: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', sans-serif;
  --font-body: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  --text-xs: clamp(.74rem, .7rem + .18vw, .84rem);
  --text-sm: clamp(.9rem, .85rem + .24vw, 1.02rem);
  --text-base: clamp(1.05rem, .97rem + .36vw, 1.28rem);
  --text-lg: clamp(1.45rem, 1.2rem + 1.1vw, 2.1rem);
  --text-xl: clamp(2rem, 1.5rem + 2.3vw, 3.3rem);
  --space-s: clamp(1rem, .9rem + .4vw, 1.25rem);
  --space-m: clamp(1.5rem, 1.4rem + .7vw, 1.9rem);
  --space-l: clamp(2rem, 1.8rem + .9vw, 2.5rem);
  --space-xl: clamp(3rem, 2.7rem + 1.3vw, 3.75rem);
}

body #samHomeScreen {
  color: var(--ink);
  background: linear-gradient(180deg, #a9d2e6 0%, #cfe6f0 38%, #e9f4f8 68%, #e9f4f8 100%) !important;
}
#samHomeScreen .sh-backdrop { display: none !important; }

.routes-banner,
.routes-banner * { box-sizing: border-box; }
.routes-banner {
  width: min(100%, 1440px);
  min-height: 0;
  margin: 0 auto;
  padding: clamp(2.4rem, 5vw, 4.5rem) clamp(18px, 4vw, 40px) 1rem;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.85;
}
.routes-banner button { font: inherit; }
.routes-banner h2,
.routes-banner h3,
.routes-banner p { margin: 0; }
.routes-banner h2,
.routes-banner h3 { font-family: var(--font-display); font-weight: 900; line-height: 1.25; letter-spacing: .01em; }
.routes-overview { position: relative; }

.routes-intro { max-width: 780px; margin-bottom: clamp(1.8rem, 3vw, 2.8rem); }
.routes-overline {
  margin-bottom: .35rem !important;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .24em;
}
.routes-intro h2 { font-size: var(--text-xl); line-height: 1.1; }
.routes-intro h2 em { position: relative; z-index: 0; font-style: normal; white-space: nowrap; }
.routes-intro h2 em::after {
  content: '';
  position: absolute;
  z-index: -1;
  right: -.05em;
  bottom: .08em;
  left: -.05em;
  height: .36em;
  border-radius: 2px;
  background: var(--luna);
  opacity: .5;
}
.routes-intro p:last-child { max-width: 44ch; margin-top: .7rem; color: var(--ink-soft); }

/* 海そのもの。額縁も区切り線も置かない */
.routes-map {
  position: relative;
  min-height: 560px;
  aspect-ratio: 1315 / 1196;
}
.routes-map-art {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.routes-terrain { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.routes-coast,
.routes-wave,
.routes-land { display: none; }
.routes-land { stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; opacity: .96; }
.routes-land-video { fill: var(--land-video); }
.routes-land-text { fill: var(--land-text); }
.routes-land-shop { fill: var(--land-shop); }
.routes-coast { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 9; stroke-linejoin: round; }
.routes-wave {
  fill: none;
  stroke: rgba(255,255,255,.72);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: .72;
}
.routes-road {
  fill: none;
  stroke: var(--luna-deep);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 9 11;
  stroke-dashoffset: 900;
  animation: routes-draw 2.6s cubic-bezier(.4,0,.2,1) .3s forwards;
}
@keyframes routes-draw { to { stroke-dashoffset: 0; } }

/* 見本の立て札。8枚のonclick/data-route-signはindex側で既存のまま保持する */
.routes-place {
  position: absolute;
  z-index: 2;
  display: block;
  width: max-content;
  max-width: 16rem;
  transform: translate(-50%, -50%);
  padding: .6rem .85rem .65rem;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--island);
  color: var(--ink);
  box-shadow: 3px 4px 0 rgba(35,40,63,.55);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s ease;
}
.routes-place::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  width: 2px;
  height: 11px;
  transform: translateX(-50%);
  background: var(--ink);
}
.routes-place b { display: block; font-family: var(--font-display); font-size: clamp(1.12rem, 1rem + .45vw, 1.5rem); font-weight: 900; line-height: 1.25; }
.routes-place span { display: block; margin-top: .15rem; color: var(--ink-soft); font-size: clamp(.92rem, .86rem + .2vw, 1.08rem); line-height: 1.55; }
.routes-place-small { padding: .4rem .6rem .45rem; }
.routes-place-small b { font-size: clamp(1rem, .94rem + .3vw, 1.22rem); }
.routes-place-tiktok { left: 18%; top: 68%; }
.routes-place-tiktok { width: 18rem; max-width: 18rem; }
.routes-place-instagram { left: 50%; top: 68%; }
.routes-place-youtube { left: 82%; top: 68%; }
.routes-place-x { left: 13%; top: 88%; }
.routes-place-threads { left: 31%; top: 91%; }
.routes-place-facebook { left: 67%; top: 91%; }
.routes-place-line { left: 91%; top: 96%; }
.routes-place-gmap { left: 82%; top: 82%; }
.routes-place-strengths { left: 50%; top: 90%; }
@media (hover:hover) {
  .routes-place:hover { transform: translate(-50%, -50%) translateY(-3px); box-shadow: 5px 7px 0 rgba(35,40,63,.6); }
}
.routes-place:active { transform: translate(-50%, -50%) translateY(2px); box-shadow: 1px 2px 0 rgba(35,40,63,.5); }

/* ルナは文字に使わず、印と要所の装飾だけにする */
.routes-luna {
  position: absolute;
  z-index: 3;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border: 3px solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0 14%, var(--luna) 42%, var(--luna-deep) 100%);
  box-shadow: 0 0 0 3px rgba(29,127,174,.28), 0 6px 14px -6px rgba(35,40,63,.5);
  cursor: pointer;
  animation: routes-breathe 3.6s ease-in-out infinite;
}
@keyframes routes-breathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(29,127,174,.28), 0 6px 14px -6px rgba(35,40,63,.5); }
  50% { box-shadow: 0 0 0 8px rgba(29,127,174,.16), 0 6px 16px -6px rgba(35,40,63,.55); }
}
.routes-luna:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.routes-luna-branch { left: 43%; top: 47%; }
.routes-luna-shop { left: 71.5%; top: 57%; }
.routes-luna-say {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .06em;
  pointer-events: none;
  white-space: nowrap;
}
.routes-luna-entry { left: 6.5%; top: 38%; }
.routes-luna-say-entry { left: 6.5%; top: 49%; }
.routes-luna-say-branch { left: 43%; top: 57.5%; }
/* 地図の案内役。ルナの印と、本人の姿を一緒に見せる。 */
.routes-luna-character {
  position: relative;
  z-index: 0;
  margin: 0;
  width: clamp(220px, 24vw, 320px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  margin-top: -2.4rem;
  margin-right: 5%;
  margin-bottom: 1rem;
  margin-left: auto;
  transform: rotate(2deg);
  border: 0;
  border-radius: 32px;
  background: var(--sea-mid);
  opacity: .58;
  box-shadow: none;
  filter: saturate(.82);
  pointer-events: none;
}
.routes-luna-character img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* 動画の分かれ道。機能の中身は既存window.samRoutesを使う */
.routes-overview[hidden], .routes-video-branch[hidden], .routes-post-panel[hidden] { display: none; }
.routes-video-branch {
  margin-top: var(--space-xl);
  padding: var(--space-l);
  border: 2.5px solid var(--ai);
  border-radius: 22px;
  background: var(--island);
  box-shadow: 0 10px 0 rgba(85,88,217,.13);
}
.routes-branch-kicker { color: var(--ai-deep); font-size: var(--text-xs); font-weight: 700; }
.routes-video-branch h3 { margin-top: var(--space-s); font-size: var(--text-lg); }
.routes-video-branch > p { margin-top: var(--space-s); color: var(--ink-soft); }
.routes-branch-choices { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--space-s); margin-top: var(--space-m); }
.routes-branch-choice {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-s);
  padding: var(--space-m);
  border: 1.5px solid var(--island-edge);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.routes-branch-choice h4 { margin: 0; font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.35; }
.routes-branch-choice p { color: var(--ink-soft); font-size: var(--text-sm); }
.routes-branch-choice strong { color: var(--ai-deep); font-size: var(--text-sm); }
.routes-branch-back { margin-top: var(--space-m); border: 0; border-bottom: 3px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; font-family: var(--font-display); font-size: var(--text-sm); font-weight: 900; }

.routes-post-panel { margin-top: var(--space-m); padding: var(--space-m); border: 1.5px solid var(--island-edge); border-radius: 22px; background: var(--island); }
.routes-post-panel h4 { margin: 0; font-family: var(--font-display); font-size: var(--text-lg); }
.routes-post-panel p { margin-top: 4px; color: var(--ink-soft); font-size: var(--text-sm); }
.routes-post-form { display: grid; grid-template-columns: 1fr auto; gap: var(--space-s); align-items: end; margin-top: var(--space-s); }
.routes-post-form label { display: grid; gap: 4px; color: var(--ink); font-size: var(--text-sm); font-weight: 700; }
.routes-post-form select, .routes-post-form textarea { width: 100%; padding: .8em 1em; border: 1.5px solid var(--island-edge); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--text-sm); }
.routes-post-submit { border: 0; border-radius: 999px; padding: .9em 1.4em; background: var(--ai); color: var(--surface); box-shadow: 0 5px 0 var(--ai-deep); cursor: pointer; font-family: var(--font-display); font-size: var(--text-base); font-weight: 900; }
.routes-post-submit:disabled { cursor: wait; opacity: .65; }
.routes-post-results { display: grid; gap: var(--space-s); margin-top: var(--space-m); }
.routes-post-result { padding: var(--space-s); border: 1.5px solid var(--island-edge); border-radius: 16px; background: var(--surface); }
.routes-post-result h5 { margin: 0; font-family: var(--font-display); font-size: var(--text-base); }
.routes-post-result pre { margin: var(--space-s) 0; white-space: pre-wrap; color: var(--ink); font: inherit; font-size: var(--text-sm); line-height: 1.75; }
.routes-copy { border: 2px solid var(--ink); border-radius: 999px; padding: .55em 1em; background: transparent; color: var(--ink); cursor: pointer; font-family: var(--font-display); font-size: var(--text-sm); font-weight: 900; }
.routes-status { margin-top: var(--space-s); color: var(--ink-soft); font-size: var(--text-sm); }

/* 海から浅瀬へ続く。道具9枚のレイアウトはこの下で既存のまま使う */
.routes-tools-label { margin: var(--space-xl) 0 var(--space-m); padding-bottom: var(--space-s); }
.routes-tools-label h3 { font-size: var(--text-lg); }
.routes-tools-label p { margin-top: 4px; color: var(--ink-soft); font-size: var(--text-sm); }

.routes-current-band {
  position: fixed;
  top: var(--space-s);
  left: 50%;
  z-index: 9500;
  display: flex;
  width: min(calc(100% - var(--space-m)), 1060px);
  align-items: center;
  gap: var(--space-s);
  transform: translateX(-50%);
  padding: .7em var(--space-s);
  border: 1.5px solid var(--island-edge);
  border-radius: 999px;
  background: var(--island);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(35,40,63,.12);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}
.routes-current-band .routes-band-mark { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--luna); box-shadow: 0 0 0 4px rgba(92,192,234,.48); }
.routes-current-band .routes-band-copy { min-width: 0; flex: 1; }
.routes-current-band strong { font-family: var(--font-display); }
.routes-current-band button { flex: none; border: 0; border-bottom: 2px solid var(--ink); padding: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: var(--text-sm); font-weight: 700; }

.routes-place:focus-visible,
.routes-branch-choice:focus-visible,
.routes-post-submit:focus-visible,
.routes-branch-back:focus-visible,
.routes-current-band button:focus-visible { outline: 3px solid var(--luna-deep); outline-offset: 3px; }

@media (max-width: 860px) {
  .routes-map { aspect-ratio: auto; min-height: 0; padding: 1rem; display: grid; gap: .6rem; }
  .routes-terrain, .routes-luna, .routes-luna-say { display: none; }
  .routes-map-art { position: relative; inset: auto; grid-column: 1 / -1; width: 100%; height: auto; object-fit: contain; }
  .routes-luna-character { position: relative; top: auto; right: auto; z-index: 0; width: 132px; margin: 0 auto .35rem; transform: rotate(2deg); opacity: .48; }
  .routes-place { position: static; width: 100%; max-width: none; transform: none; box-shadow: none; }
  .routes-place::after { display: none; }
  .routes-place-small { padding: .6rem .85rem .65rem; }
  .routes-place-small b { font-size: var(--text-base); }
}
@media (max-width: 800px) {
  .routes-branch-choices { grid-template-columns: 1fr; }
  .routes-post-form { grid-template-columns: 1fr; }
  .routes-post-submit { width: 100%; }
}
@media (max-width: 520px) {
  .routes-banner { padding-inline: var(--space-s); }
  .routes-current-band { border-radius: 18px; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .routes-road, .routes-luna { animation: none; }
  .routes-road { stroke-dashoffset: 0; }
  .routes-place, .routes-branch-choice, .routes-post-submit { transition: none; }
}

/* ── 「もっと本格的な動画を作りたい方へ」＝上の海から溢れ出た川（2026-09-05 座長案） ──
   上から見た地図。海が数か所からこぼれ、その1本がここへ流れ込んでいる。
   青は島マップ画像から実測（#3ca8e4〜#7fd0f2）。文字は島の名札と同じく白い札に載せる。 */
#samHomeScreen .sh-river {
  --river-deep: #3ca8e4;
  --river-mid: #48b4e4;
  --river-shallow: #7fd0f2;
  --bank: #efe4d2;
  position: relative;
  margin-top: -6px;
  padding: 30px 20px 30px;
  border: 0;
  color: var(--ink);
  font-family: var(--font-body);
  isolation: isolate;
}
/* 川そのもの（岸・水・白い波打ち際） */
#samHomeScreen .sh-river-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  border-radius: 14px;
  overflow: hidden;
}
#samHomeScreen .sh-river > *:not(.sh-river-map) { position: relative; z-index: 1; }
/* 水面のさざなみ（川の上だけ） */
#samHomeScreen .sh-river-ripple {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(112deg,
    rgba(255,255,255,0) 0 22px,
    rgba(255,255,255,.5) 22px 25px,
    rgba(255,255,255,0) 25px 52px);
  opacity: .45;
}
#samHomeScreen .sh-river-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(15,70,110,.55);
  margin-bottom: 12px;
  text-align: center;
}
#samHomeScreen .sh-river-note {
  width: min(100%, 78%);
  margin-left: auto;
  margin-right: auto;
  background: #fbf6ea;
  border-radius: 10px;
  padding: 10px 13px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(20,70,110,.22);
}
#samHomeScreen .sh-river-note p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--ink); }
#samHomeScreen .sh-river-note p + p { margin-top: 4px; }
#samHomeScreen .sh-river-links { display: grid; gap: 9px; width: min(100%, 78%); margin: 0 auto; }
#samHomeScreen .sh-river-links a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  padding: 9px 13px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(20,70,110,.22);
  transition: transform .18s ease, box-shadow .18s ease;
}
#samHomeScreen .sh-river-links a:hover,
#samHomeScreen .sh-river-links a:focus-visible {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(20,70,110,.3);
}
#samHomeScreen .sh-river-links .sh-river-name { display: block; font-size: 13px; line-height: 1.6; }
#samHomeScreen .sh-river-links .sh-river-url {
  display: block; font-size: 11px; line-height: 1.5;
  color: var(--luna-deep); margin-left: 1em;
}
