/* guardian.css — LP2 design */

/* ===========================
   Overlay
=========================== */
#guardian-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background:
    radial-gradient(
      ellipse 120% 80% at 50% 10%,
      rgba(107, 63, 160, 0.18) 0%,
      rgba(26, 26, 46, 0.97) 45%,
      rgba(15, 12, 38, 0.99) 100%
    );
  color: #e8e8e8;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

#guardian-overlay.is-active { display: block; }

#guardian-overlay #guardian-gate {
  background: linear-gradient(to bottom, rgba(8,10,14,0.72), rgba(8,10,14,0.6));
  padding: 0.5rem 0;
}

#guardian-overlay #guardian-gate p {
  margin: 0 0 0.6rem;
  font-size: 1.08rem;
  line-height: 2.1;
  letter-spacing: 0.06em;
  color: #f2f3f7;
  word-break: normal;
  overflow-wrap: break-word;
}

@media (min-width: 768px) {
  #guardian-overlay #guardian-gate p { font-size: 1.18rem; line-height: 2.2; }
}

/* ===========================
   Gate text animation
=========================== */
[data-gate-text] { opacity: 0; }
[data-gate-text].is-visible { opacity: 1; transition: opacity 0.25s ease-out; }

#guardian-gate {
  margin-bottom: 2.5rem;
  font-family: "Noto Serif JP", "Noto Sans JP", serif;
  line-height: 1.9;
}

#guardian-gate p {
  margin: 0 0 0.6rem;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
  color: #cfcfd4;
  text-align: left;
  text-indent: 0.15em;
}

@media (min-width: 768px) {
  #guardian-gate p { font-feature-settings: "palt"; font-size: 0.95rem; letter-spacing: 0.07em; }
}

@media (min-width: 1024px) {
  #guardian-gate { max-width: 560px; margin-left: auto; margin-right: auto; }
}

/* ===========================
   Card Select
=========================== */
.guardian-card-select {
  position: fixed;
  inset: 0;
  z-index: 2800;
  display: none;
}

.guardian-card-select.is-open { display: block; }

.guardian-card-select__overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 18, 0.92);
}

.guardian-card-select__content {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  text-align: center;
}

.guardian-card-select__lead {
  font-size: 1.1rem;
  line-height: 1.9;
  letter-spacing: 0.08em;
  font-family: "Noto Serif JP", serif;
  color: rgba(242, 243, 247, 0.85);
  margin-bottom: 2rem;
}


/* Cards container — 円形スプレッド用、中央を原点に（overflow visible でカードがはみ出してもOK） */
.guardian-card-select__cards {
  position: relative;
  width: clamp(260px, 70vw, 340px);
  height: clamp(260px, 70vw, 340px);
  margin: 0 auto;
  display: block;
  overflow: visible;
}

/* ===========================
   Individual Card — 円形スプレッド
   top:50% left:50% + JS translate で円上に配置
=========================== */
.guardian-card {
  aspect-ratio: 2 / 3;
  background-color: #0f172a;
  background-image: url("/assets/img/guardian/guardian-card-back.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 116% 116%;
  border: 2px solid rgba(197, 165, 90, 0.45);
  border-radius: 10px;
  cursor: pointer;
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(72px, 16vw, 92px);
  transform-origin: center center;
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(197, 165, 90, 0.1);
  will-change: transform, opacity;
}

/* 光の粒子オーバーレイ */
.guardian-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(197, 165, 90, 0.1), transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(197, 165, 90, 0.06), transparent 45%);
  border-radius: inherit;
  pointer-events: none;
}

/* ホバー時の金縁グロー（JS の mouseenter でも追加） */
.guardian-card.is-hovered {
  border-color: rgba(197, 165, 90, 0.8);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(197, 165, 90, 0.3);
}

@media (max-width: 480px) {
  .guardian-card-select__cards { width: clamp(220px, 84vw, 280px); height: clamp(220px, 84vw, 280px); }
  .guardian-card { width: clamp(58px, 16vw, 76px); }
  .guardian-card-select__lead { font-size: 0.95rem; }
  .guardian-card-select__content { padding: 2rem 1.25rem; }
}

/* ===========================
   Modal — LP2 ホワイトデザイン
=========================== */
.guardian-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
}

.guardian-modal.is-open { display: block; }

.guardian-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 18, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* LP2 スタイル: 白背景 + 金縁 */
.guardian-modal__content {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(197, 165, 90, 0.35);
  box-shadow:
    0 30px 80px rgba(26, 26, 46, 0.45),
    0 0 0 4px rgba(197, 165, 90, 0.08);
  text-align: center;
  color: #1A1A2E;
}

/* 上部ゴールドアクセントライン */
.guardian-modal__content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, #C5A55A, #E2C97E, #C5A55A);
  border-radius: 0 0 3px 3px;
}

.guardian-word { margin-bottom: 2.5rem; }

.guardian-word__title {
  font-family: "Cormorant Garamond", "Noto Serif JP", serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: #C5A55A;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.guardian-word__text {
  font-family: "Noto Serif JP", serif;
  font-size: 1.25rem;
  line-height: 2.1;
  white-space: pre-line;
  color: #1A1A2E;
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* ===========================
   Action Buttons — LP2 style
=========================== */
.guardian-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.guardian-action--consult {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 28px;
  background: #6B3FA0;
  color: #ffffff;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  width: 100%;
  max-width: 280px;
}

.guardian-action--consult:hover {
  background: #5a3487;
  transform: translateY(-1px);
}

.guardian-action--retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  background: transparent;
  color: rgba(26, 26, 46, 0.55);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  border-radius: 9999px;
  border: 1px solid rgba(26, 26, 46, 0.15);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  width: 100%;
  max-width: 280px;
}

.guardian-action--retry:hover {
  border-color: rgba(107, 63, 160, 0.4);
  color: #6B3FA0;
}

@media (max-width: 768px) {
  .guardian-modal__content { padding: 2rem 1.5rem; margin: 0 1rem; top: 50%; }
  .guardian-word__text { font-size: 1.1rem; }
}
