/* Eastern Zodiac — Night Shrine theme */
/* Mystical-but-Grounded · Mode A: 夜の神社系 */

:root {
  --indigo-deep: #0A1428;
  --indigo: #142544;
  --indigo-mid: #1E3A5F;
  --indigo-soft: #2C4A75;
  --gold: #C9A961;
  --gold-bright: #E5C97D;
  --gold-soft: rgba(201, 169, 97, 0.4);
  --vermilion: #A02028;
  --vermilion-deep: #6B0F14;
  --sumi: #050912;
  --washi: #F5F1E8;
  --washi-warm: #EFE8D6;
  --text-light: #E5DFD0;
  --text-muted: rgba(229, 223, 208, 0.6);
  --text-dim: rgba(229, 223, 208, 0.4);
  --line-gold: rgba(201, 169, 97, 0.25);
  --line-faint: rgba(201, 169, 97, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Noto Serif JP', -apple-system, sans-serif;
  background: var(--sumi);
  color: var(--text-light);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  font-weight: 300;
}

/* ===== 背景レイヤー ===== */

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 0%, var(--indigo-soft) 0%, var(--indigo) 25%, var(--indigo-deep) 60%, var(--sumi) 100%);
}

.bg-gradient::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 80% 90%, rgba(160, 32, 40, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 70%, rgba(201, 169, 97, 0.05) 0%, transparent 50%);
}

/* 星空 */
.stars-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.stars {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
}

.stars-far {
  background-image:
    radial-gradient(0.5px 0.5px at 5% 10%,  rgba(255,255,255,0.7) 50%, transparent 50%),
    radial-gradient(0.5px 0.5px at 25% 30%, rgba(255,255,255,0.5) 50%, transparent 50%),
    radial-gradient(0.5px 0.5px at 45% 60%, rgba(255,255,255,0.7) 50%, transparent 50%),
    radial-gradient(0.5px 0.5px at 75% 15%, rgba(255,255,255,0.6) 50%, transparent 50%),
    radial-gradient(0.5px 0.5px at 85% 80%, rgba(255,255,255,0.5) 50%, transparent 50%);
  background-size: 300px 300px;
  animation: starFar 200s linear infinite;
}

.stars-mid {
  background-image:
    radial-gradient(1px 1px at 15% 40%, rgba(255,247,224,0.9) 50%, transparent 50%),
    radial-gradient(1px 1px at 60% 20%, rgba(229,201,125,0.8) 50%, transparent 50%),
    radial-gradient(1px 1px at 35% 75%, rgba(255,255,255,0.85) 50%, transparent 50%),
    radial-gradient(1px 1px at 90% 50%, rgba(229,201,125,0.7) 50%, transparent 50%);
  background-size: 500px 500px;
  animation: starTwinkle 4s ease-in-out infinite;
}

.stars-near {
  background-image:
    radial-gradient(1.5px 1.5px at 22% 18%, var(--gold-bright) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 70% 65%, rgba(255,247,224,1) 50%, transparent 50%),
    radial-gradient(2px 2px at 50% 45%, var(--gold) 50%, transparent 50%);
  background-size: 800px 800px;
  animation: starTwinkleSlow 6s ease-in-out infinite;
}

@keyframes starFar {
  from { transform: translateY(0); }
  to { transform: translateY(-300px); }
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.45; }
}

@keyframes starTwinkleSlow {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.55; }
}

/* 月の周りの淡い光 */
.moon-glow {
  position: fixed;
  top: 80px;
  right: -100px;
  width: 500px;
  height: 500px;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle, rgba(245,230,179,0.15) 0%, transparent 60%);
  filter: blur(40px);
}

/* ===== コンテナ ===== */

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  position: relative;
  z-index: 10;
}

.screen {
  display: none;
  animation: fadeIn 0.8s ease;
}

.screen.active {
  display: block;
}

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

/* ===== 入力画面 ===== */

/* ヒーローアート（鳥居 + 月） */
.hero-art {
  position: relative;
  height: 280px;
  margin: 0 auto 2.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.moon {
  position: absolute;
  top: -20px;
  right: 8%;
  width: 110px;
  height: 110px;
  filter: drop-shadow(0 0 30px rgba(245, 230, 179, 0.4));
  animation: moonFloat 8s ease-in-out infinite;
}

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

.torii {
  width: 100%;
  max-width: 380px;
  height: auto;
  filter: drop-shadow(0 4px 20px rgba(160, 32, 40, 0.4));
  animation: toriiAppear 1.2s ease;
}

@keyframes toriiAppear {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ヒーローテキスト */
.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 400;
  color: var(--text-light);
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.title-em {
  color: var(--gold-bright);
  font-style: italic;
  font-weight: 500;
}

.subtitle {
  font-family: 'Noto Serif JP', serif;
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.3em;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.subtitle-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-style: italic;
}

/* ロア */
.lore {
  position: relative;
  background: rgba(20, 37, 68, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-gold);
  padding: 3rem 2rem 2.5rem;
  margin-bottom: 3rem;
  border-radius: 2px;
  text-align: center;
}

.lore::before,
.lore::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1px solid var(--gold);
}

.lore::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.lore::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.lore-mark {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sumi);
  padding: 0 1rem;
  font-family: 'Noto Serif JP', serif;
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.3em;
}

.lore p {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

.lore p:last-child {
  margin-bottom: 0;
}

.lore em {
  color: var(--gold-bright);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.lore strong {
  color: var(--gold);
  font-weight: 600;
}

.kanji-aside {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.85em;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-left: 0.25em;
  opacity: 0.85;
}

.lore-divider {
  display: flex;
  justify-content: center;
  margin: 1.25rem 0;
}

.lore-divider span {
  width: 40px;
  height: 1px;
  background: var(--gold-soft);
  position: relative;
}

.lore-divider span::before,
.lore-divider span::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  transform: translateY(-50%);
}

.lore-divider span::before { left: -8px; }
.lore-divider span::after  { right: -8px; }

/* フォームカード */
.form-card {
  background: linear-gradient(180deg, rgba(245, 241, 232, 0.97) 0%, rgba(239, 232, 214, 0.95) 100%);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 2.25rem 1.75rem;
  margin-bottom: 2rem;
  position: relative;
  box-shadow:
    0 0 0 1px var(--line-gold),
    0 20px 40px rgba(0, 0, 0, 0.3);
}

.form-card::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 1px solid var(--line-gold);
  border-radius: 4px;
  pointer-events: none;
}

.form {
  position: relative;
  z-index: 1;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.form-label-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--indigo-deep);
  letter-spacing: 0.02em;
}

.form-label-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.85rem;
  color: var(--indigo-mid);
  letter-spacing: 0.15em;
  opacity: 0.7;
}

input[type="date"] {
  width: 100%;
  padding: 1rem 1.25rem;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  border: 1.5px solid var(--line-gold);
  background: rgba(255, 255, 255, 0.7);
  color: var(--indigo-deep);
  transition: all 0.25s;
  margin-bottom: 1.5rem;
  border-radius: 2px;
}

input[type="date"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.2);
  background: white;
}

/* ボタン */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1.15rem 2rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  background: var(--indigo-deep);
  color: var(--gold-bright);
  border: 1px solid var(--gold);
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 97, 0.15), transparent);
  transition: left 0.6s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: var(--indigo);
  border-color: var(--gold-bright);
  box-shadow: 0 0 25px rgba(201, 169, 97, 0.3);
}

.btn-arrow {
  transition: transform 0.3s;
  font-size: 1.1em;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-secondary {
  display: block;
  margin: 2rem auto 0;
  padding: 0.6rem 1.25rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  background: none;
  border: 1px solid var(--line-faint);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.05em;
  border-radius: 2px;
}

.btn-secondary:hover {
  color: var(--gold);
  border-color: var(--gold-soft);
}

.disclaimer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2rem;
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.05em;
  line-height: 1.5;
}

/* ===== 結果画面 ===== */

.result-hero {
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  background: rgba(20, 37, 68, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-gold);
  border-radius: 2px;
}

.result-hero::before,
.result-hero::after {
  content: '';
  position: absolute;
  width: 32px;
  height: 32px;
  border: 1px solid var(--gold);
}

.result-hero::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.result-hero::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.result-mark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.beast-icon-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
  width: 280px;
  height: 280px;
}

.beast-glow {
  position: absolute;
  inset: -30px;
  background: radial-gradient(circle, rgba(201,169,97,0.35) 0%, rgba(201,169,97,0.1) 40%, transparent 70%);
  filter: blur(30px);
  animation: beastGlow 4s ease-in-out infinite;
  z-index: 0;
}

@keyframes beastGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.beast-image {
  position: relative;
  z-index: 1;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow:
    0 0 0 1px rgba(201, 169, 97, 0.3),
    0 0 0 6px rgba(20, 37, 68, 0.6),
    0 0 0 7px rgba(201, 169, 97, 0.2),
    0 12px 40px rgba(0, 0, 0, 0.5);
  animation: beastFloat 6s ease-in-out infinite;
  background: var(--indigo-deep);
}

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

.beast-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  letter-spacing: 0.3em;
  color: var(--gold-bright);
  text-transform: uppercase;
  margin-bottom: 2rem;
  font-weight: 500;
}

.mansion-display {
  margin-top: 1.5rem;
}

.mansion-frame {
  display: inline-block;
  position: relative;
  padding: 1rem 2.5rem;
  margin-bottom: 1rem;
}

.mansion-frame::before,
.mansion-frame::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 1.5rem;
  height: 1px;
  background: var(--gold);
  transform: translateY(-50%);
}

.mansion-frame::before { left: 0; }
.mansion-frame::after  { right: 0; }

.mansion-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 4rem;
  font-weight: 500;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
  text-shadow: 0 0 40px rgba(229, 201, 125, 0.4);
  line-height: 1;
}

.mansion-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-style: italic;
}

.mansion-romaji {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 0.25em;
  text-transform: lowercase;
}

/* 詳細情報 */
.result-body {
  background: rgba(20, 37, 68, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-gold);
  padding: 0.5rem 1.75rem;
  margin-bottom: 2rem;
  border-radius: 2px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-faint);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.info-value {
  font-family: 'Noto Serif JP', serif;
  font-weight: 500;
  color: var(--gold-bright);
  font-size: 0.95rem;
}

/* CTA */
.cta-block {
  background: linear-gradient(180deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  border: 1px solid var(--gold);
  padding: 2.5rem 1.75rem;
  border-radius: 2px;
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.cta-block::before,
.cta-block::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1px solid var(--gold);
}

.cta-block::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.cta-block::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.cta-mark {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.cta-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.3em;
  margin-bottom: 0.75rem;
  opacity: 0.85;
}

.cta-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--gold-bright);
  font-style: italic;
}

.cta-text {
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  color: var(--text-light);
  opacity: 0.85;
}

.btn-cta {
  background: var(--gold);
  color: var(--indigo-deep);
  border-color: var(--gold-bright);
  font-weight: 600;
}

.btn-cta:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: var(--sumi);
  box-shadow: 0 0 30px rgba(229, 201, 125, 0.4);
}

/* シェア */
.share-block {
  text-align: center;
  margin-bottom: 1rem;
}

.share-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.3em;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  font-style: italic;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 0.875rem;
}

.share-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(20, 37, 68, 0.4);
  border: 1px solid var(--line-gold);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.25s;
  font-family: inherit;
}

.share-btn:hover {
  border-color: var(--gold-bright);
  background: rgba(20, 37, 68, 0.7);
  color: var(--gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(201, 169, 97, 0.2);
}

.share-hint {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.875rem;
  letter-spacing: 0.05em;
  font-style: italic;
}

/* Substack 埋め込み */
.substack-embed-wrap {
  margin: 2.5rem 0 1rem;
  text-align: center;
}

.embed-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.3em;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  font-style: italic;
}

.substack-embed {
  width: 100%;
  max-width: 480px;
  height: 320px;
  border: 1px solid var(--line-gold);
  border-radius: 4px;
  background: rgba(245, 241, 232, 0.97);
  display: block;
  margin: 0 auto;
}

/* フッター */
.footer {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  position: relative;
  z-index: 10;
}

.footer-mark {
  font-family: 'Noto Serif JP', serif;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
  letter-spacing: 0.5em;
}

.footer-text {
  font-family: 'Cormorant Garamond', serif;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.footer-jp {
  font-family: 'Noto Serif JP', serif;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.4em;
  margin-bottom: 0.4rem;
}

.footer-en-italic {
  font-family: 'Cormorant Garamond', serif;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-style: italic;
  letter-spacing: 0.15em;
}

/* ===== レスポンシブ ===== */
@media (max-width: 480px) {
  .container {
    padding: 1.5rem 1rem 1rem;
  }

  .hero-art {
    height: 220px;
    margin-bottom: 2rem;
  }

  .moon {
    width: 80px;
    height: 80px;
    top: 0;
  }

  .mansion-jp {
    font-size: 3rem;
  }

  .mansion-en {
    font-size: 1.2rem;
  }

  .lore {
    padding: 2.5rem 1.25rem 2rem;
  }

  .form-card {
    padding: 1.75rem 1.25rem;
  }

  .moon-glow {
    width: 300px;
    height: 300px;
  }

  .beast-icon-wrap,
  .beast-image {
    width: 220px;
    height: 220px;
  }
}

/* ハイコントラスト/モーション縮小設定への配慮 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
