/* =============================================
   Chloe Sisters Portal v2 ── 「星降る森の道しるべ」
   ティーナ世界観の踏襲を完全に廃止、村全体の中立 UI
   2026-05-06 design_lib 三人体制
   ============================================= */

:root {
  /* ベース：夜の森 */
  --c-night: #0a1218;
  --c-night-deep: #050a0e;
  --c-forest: #1a2a1f;

  /* ランタン暖色 */
  --c-lantern: #d97a3a;
  --c-lantern-glow: #f5b878;
  --c-amber: #e6c08a;
  --c-cream: #f5e8c8;

  /* 三姉妹色（平等） */
  --c-chloe:    #9b6dba;     /* 紫紺×ピンクの中間（長女・クロエ） */
  --c-tina:     #6dba78;     /* 緑（次女・ティーナ） */
  --c-krokochan: #d96d9e;    /* ピンク（末っ子・クロコちゃん） */

  --c-shadow: rgba(0, 0, 0, 0.65);

  --font-jp: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --font-mono: "Source Code Pro", "Menlo", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body.portal-v2 {
  font-family: var(--font-jp);
  background: var(--c-night-deep);
  color: var(--c-cream);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
a { color: inherit; text-decoration: none; }

/* ========== ステージ：森の三叉路背景 ========== */
.stage {
  position: fixed; inset: 0;
  z-index: 0;
}
.stage-bg {
  position: absolute; inset: 0;
  background-image: url('/assets/signpost.png');
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  background-color: var(--c-night-deep);
}
@media (max-aspect-ratio: 4/5) {
  .stage-bg {
    background-image: url('/assets/signpost_portrait.png');
    background-position: center center;
  }
}

/* ランタンの暖色オーラ（中央〜下部） */
.lantern-glow {
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 50% 40% at 50% 55%,
    rgba(217, 122, 58, 0.22) 0%,
    rgba(217, 122, 58, 0.10) 35%,
    rgba(217, 122, 58, 0) 65%
  );
  mix-blend-mode: screen;
  animation: lantern-flicker 5.5s ease-in-out infinite;
  z-index: 2;
}
@keyframes lantern-flicker {
  0%, 100% { opacity: 0.92; transform: scale(1); }
  20%      { opacity: 1.0;  transform: scale(1.04); }
  50%      { opacity: 0.78; transform: scale(0.98); }
  75%      { opacity: 0.96; transform: scale(1.02); }
}

/* 月の青白い光（左上 or 右上） */
.moon-glow {
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle 220px at 18% 18%,
    rgba(245, 232, 200, 0.10) 0%,
    rgba(245, 232, 200, 0) 70%
  );
  mix-blend-mode: screen;
  z-index: 2;
}

/* ========== ホタル（DOM で複数生成・CSS animation） ========== */
.fireflies { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.firefly {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 255, 130, 0.95) 0%, rgba(150, 220, 100, 0.45) 50%, rgba(0,0,0,0) 80%);
  filter: blur(0.5px);
  opacity: 0;
  animation:
    firefly-blink 3.5s ease-in-out infinite,
    firefly-float 18s linear infinite;
}
@keyframes firefly-blink {
  0%, 100% { opacity: 0; }
  20%      { opacity: 0.95; }
  50%      { opacity: 0.55; }
  80%      { opacity: 0.85; }
}
@keyframes firefly-float {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(40px, -30px); }
  50%  { transform: translate(70px, -10px); }
  75%  { transform: translate(30px, 25px); }
  100% { transform: translate(0, 0); }
}

/* ========== 上部チップ ========== */
.top-chip {
  position: fixed;
  top: 1.6vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 0.45em 1em;
  border-radius: 999px;
  background: rgba(10, 18, 24, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 232, 200, 0.18);
  color: var(--c-cream);
  font-size: 13px;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
  box-shadow: 0 4px 18px var(--c-shadow);
  display: flex; gap: 0.5em; align-items: center;
  white-space: nowrap;
}
.top-chip .chip-icon { font-size: 14px; }

/* ========== 中央：道標エリア ========== */
.signpost-area {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12vh 5vw 10vh;
  pointer-events: none;
  text-align: center;
}
.signpost-area > * { pointer-events: auto; }

.village-title {
  font-family: "Cormorant Garamond", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  margin: 0 0 0.2em 0;
  color: var(--c-cream);
  text-shadow:
    0 0 24px rgba(245, 232, 200, 0.45),
    0 0 8px rgba(217, 122, 58, 0.35);
  opacity: 0;
  animation: fade-in-up 1.6s ease-out 0.4s forwards;
}
.village-subtitle {
  font-family: var(--font-jp);
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  letter-spacing: 0.32em;
  color: var(--c-amber);
  margin: 0 0 8vh 0;
  opacity: 0;
  animation: fade-in-up 1.6s ease-out 1.0s forwards;
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== 3 矢印 ========== */
.signpost-arrows {
  display: flex;
  flex-direction: row;
  gap: clamp(1.2rem, 3vw, 3rem);
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
  opacity: 0;
  animation: fade-in-up 1.8s ease-out 1.6s forwards;
}
.arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  padding: 1.3em 1.4em 1.1em;
  min-width: 11em;
  background: rgba(10, 18, 24, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(245, 232, 200, 0.25);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(245, 232, 200, 0.08),
    0 8px 24px var(--c-shadow);
  color: var(--c-cream);
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.3s,
    background 0.3s;
  position: relative;
  overflow: hidden;
}
.arrow::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, currentColor 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.arrow:hover, .arrow:focus-visible {
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    inset 0 0 0 1px currentColor,
    0 12px 32px var(--c-shadow);
}
.arrow:hover::before, .arrow:focus-visible::before { opacity: 0.18; }

.arrow-glyph {
  font-size: 1.8rem;
  line-height: 1;
  text-shadow: 0 0 10px currentColor;
}
.arrow-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
}
.arrow-name {
  font-family: var(--font-jp);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--c-cream);
}
.arrow-role {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--c-amber);
  opacity: 0.85;
}
.arrow-status {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  margin-top: 0.3em;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  background: rgba(0,0,0,0.3);
  font-family: var(--font-mono);
}

/* テーマカラー：3 姉妹平等に色分け */
.arrow-chloe     { color: var(--c-chloe); }
.arrow-tina      { color: var(--c-tina); }
.arrow-krokochan { color: var(--c-krokochan); }

/* ========== welcome ライン ========== */
.welcome-line {
  margin-top: 6vh;
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  color: var(--c-amber);
  letter-spacing: 0.14em;
  min-height: 1.4em;
  font-family: var(--font-mono);
  opacity: 0.9;
}
.welcome-line::after {
  content: "▍";
  color: var(--c-lantern-glow);
  margin-left: 2px;
  animation: cursor-blink 1.1s steps(2) infinite;
}
@keyframes cursor-blink { 50% { opacity: 0; } }

/* ========== 下部チップ ========== */
.bottom-chip {
  position: fixed;
  bottom: 1.6vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 0.4em 1em;
  border-radius: 999px;
  background: rgba(10, 18, 24, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 232, 200, 0.15);
  color: var(--c-amber);
  font-size: 12px;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  display: flex; gap: 0.6em; align-items: center;
  box-shadow: 0 4px 18px var(--c-shadow);
}
.bottom-chip .chip-link {
  color: var(--c-cream);
  transition: color 0.2s;
}
.bottom-chip .chip-link:hover { color: var(--c-lantern-glow); }
.bottom-chip .chip-sep { opacity: 0.5; }

/* ========== レスポンシブ ========== */
@media (max-width: 720px) {
  .signpost-area { padding: 8vh 4vw 9vh; }
  .signpost-arrows {
    flex-direction: column;
    gap: 0.9rem;
    width: 100%;
  }
  .arrow {
    flex-direction: row;
    align-items: center;
    text-align: left;
    min-width: 0;
    padding: 0.9em 1.1em;
    gap: 0.9em;
  }
  .arrow-glyph { font-size: 1.6rem; }
  .arrow-info { align-items: flex-start; flex: 1; }
  .arrow-status { margin-top: 0.15em; }
  .top-chip { font-size: 11px; }
  .bottom-chip { font-size: 11px; padding: 0.35em 0.8em; }
  .village-subtitle { margin-bottom: 4vh; letter-spacing: 0.22em; }
  .welcome-line { margin-top: 3vh; font-size: 0.78rem; }
}

@media (max-aspect-ratio: 9/16) {
  .signpost-area { padding-top: 6vh; padding-bottom: 8vh; }
  .village-title { margin-top: 2vh; }
  .signpost-arrows { gap: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lantern-glow, .firefly { animation: none !important; }
  .village-title, .village-subtitle, .signpost-arrows { animation: none; opacity: 1; transform: none; }
}
