/* ========================================
   Celestia - Felissimo-inspired Design
   Deep navy + warm gold, elegant serif
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navy: #1a1a3e;
  --navy-deep: #0e0e2a;
  --navy-light: #2a2a5e;
  --cream: #faf8f5;
  --cream-dark: #f0ece5;
  --gold: #c9a96e;
  --gold-light: #dcc28e;
  --gold-dark: #a8884a;
  --text-dark: #2c2c2c;
  --text-light: #e8e4dc;
  --text-muted-dark: #7a7a7a;
  --text-muted-light: #b0a89a;
  --border-light: #ddd5c8;
  --border-dark: rgba(201, 169, 110, 0.25);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "游明朝", "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  background-color: var(--cream);
  color: var(--text-dark);
  line-height: 2;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.6;
}

a {
  color: var(--gold-dark);
  text-decoration: none;
  transition: opacity 0.3s;
}

a:hover {
  opacity: 0.7;
}

/* Layout */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Navigation ===== */
.nav {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--navy-deep);
  border-bottom: 1px solid var(--border-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  font-size: 0.75rem;
  font-family: "游明朝", "Yu Mincho", serif;
  color: var(--text-muted-light);
  letter-spacing: 0.15em;
  transition: all 0.3s;
  border-bottom: 2px solid transparent;
}

.nav__link:hover,
.nav__link--active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
  opacity: 1;
}

.nav__icon {
  font-size: 1rem;
}

/* ===== Hero / Key Visual ===== */
.hero-visual {
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

.hero-visual__inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 60px 20px 50px;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Decorative stars */
.hero-visual::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 50% 10%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 90% 70%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 20% 80%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 80% 90%, rgba(255,255,255,0.2), transparent);
  animation: twinkle 6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes twinkle {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.hero-visual__catchcopy {
  font-size: 0.75rem;
  color: var(--gold-light);
  letter-spacing: 0.3em;
  margin-bottom: 20px;
}

.hero-visual__title {
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
  font-weight: 400;
}

.hero-visual__title strong {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  margin: 8px 0;
}

.hero-visual__subtitle {
  font-size: 2.2rem;
  color: var(--gold-light);
  letter-spacing: 0.4em;
  font-weight: 400;
  margin-bottom: 24px;
}

.hero-visual__desc {
  font-size: 0.8rem;
  color: var(--text-muted-light);
  line-height: 2.2;
  max-width: 440px;
  margin: 0 auto;
}

/* ===== Section - Dark (navy) ===== */
.section-dark {
  background: var(--navy);
  color: var(--text-light);
  padding: 50px 0;
  position: relative;
}

.section-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(1px 1px at 15% 25%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 45% 75%, rgba(255,255,255,0.15), transparent),
    radial-gradient(1px 1px at 75% 35%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 85% 85%, rgba(255,255,255,0.15), transparent);
  pointer-events: none;
}

.section-dark .container {
  position: relative;
  z-index: 1;
}

/* ===== Section - Light (cream) ===== */
.section-light {
  background: var(--cream);
  color: var(--text-dark);
  padding: 50px 0;
}

/* ===== Section Titles ===== */
.section-title {
  text-align: center;
  margin-bottom: 12px;
  font-size: 1.5rem;
  letter-spacing: 0.15em;
  font-weight: 400;
}

.section-title--light {
  color: #fff;
}

.section-title--dark {
  color: var(--text-dark);
}

.section-lead {
  text-align: center;
  font-size: 0.8rem;
  margin-bottom: 36px;
}

.section-lead--light {
  color: var(--text-muted-light);
}

.section-lead--dark {
  color: var(--text-muted-dark);
}

/* ===== Menu Cards (Top page) ===== */
.menu {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 440px;
  margin: 0 auto;
}

.menu-card {
  display: block;
  padding: 32px 24px;
  background: #fff;
  border: 1px solid var(--border-light);
  text-align: center;
  transition: all 0.3s;
  position: relative;
}

.menu-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.menu-card__icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.menu-card__title {
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}

.menu-card__desc {
  font-size: 0.75rem;
  color: var(--text-muted-dark);
  line-height: 2;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 40px;
  border: none;
  font-size: 0.85rem;
  font-family: "游明朝", "Yu Mincho", serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 0.15em;
}

.btn--dark {
  background: var(--navy);
  color: #fff;
}

.btn--dark:hover {
  background: var(--navy-light);
}

.btn--dark::after {
  content: '→';
  margin-left: 4px;
  font-size: 0.9rem;
}

.btn--gold {
  background: var(--gold);
  color: #fff;
}

.btn--gold:hover {
  background: var(--gold-dark);
}

.btn--outline {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
}

.btn--outline:hover {
  background: var(--navy);
  color: #fff;
}

.btn--outline-light {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid var(--gold-light);
}

.btn--outline-light:hover {
  background: rgba(201, 169, 110, 0.15);
}

.btn--block {
  width: 100%;
}

.btn--primary {
  background: var(--navy);
  color: #fff;
}

.btn--primary:hover {
  background: var(--navy-light);
}

/* ===== Tarot Styles ===== */
.tarot-stage {
  text-align: center;
  padding: 40px 0;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tarot-stage__message {
  font-size: 1rem;
  margin-bottom: 20px;
  letter-spacing: 0.1em;
  animation: fadeIn 0.5s ease;
}

.tarot-stage__message--sub {
  font-size: 0.75rem;
  color: var(--text-muted-light);
  margin-top: 16px;
}

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

/* Fan-shaped card layout */
.card-fan {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: 320px;
  margin: 0 auto 32px;
}

.tarot-card {
  position: absolute;
  width: 56px;
  height: 84px;
  cursor: pointer;
  transition: all 0.4s ease;
  transform-style: preserve-3d;
  left: 50%;
  bottom: 20px;
  transform-origin: 50% 200%;
}

.tarot-card__inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  border-radius: 4px;
}

.tarot-card--flipped .tarot-card__inner {
  transform: rotateY(180deg);
}

.tarot-card__front,
.tarot-card__back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tarot-card__back {
  background: linear-gradient(180deg, #2a3a7e, #1a1a4e);
  border: 1.5px solid var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.tarot-card__back::before {
  content: '';
  width: 60%;
  height: 60%;
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: 50%;
}

.tarot-card__back::after {
  content: '';
  position: absolute;
  width: 40%;
  height: 40%;
  border: 1px solid rgba(201, 169, 110, 0.2);
  transform: rotate(45deg);
}

.tarot-card__front {
  background: linear-gradient(180deg, #f5f0e8, #e8e0d0);
  border: 1.5px solid var(--gold);
  transform: rotateY(180deg);
  flex-direction: column;
  padding: 6px;
  color: var(--navy);
  text-align: center;
}

.tarot-card__front-icon {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.tarot-card__front-name {
  font-size: 0.5rem;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.tarot-card:hover {
  z-index: 10 !important;
  filter: brightness(1.2);
  margin-bottom: 12px;
}

.tarot-card--disabled {
  pointer-events: none;
  opacity: 0.3;
  filter: grayscale(0.5);
}

/* Shuffle Animation */
.shuffle-area {
  position: relative;
  width: 240px;
  height: 160px;
  margin: 24px auto;
}

.shuffle-card {
  position: absolute;
  width: 70px;
  height: 105px;
  background: linear-gradient(180deg, #2a3a7e, #1a1a4e);
  border: 1.5px solid var(--gold);
  border-radius: 4px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: shuffle 1.5s ease-in-out infinite;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.shuffle-card:nth-child(1) { animation-delay: 0s; }
.shuffle-card:nth-child(2) { animation-delay: 0.2s; }
.shuffle-card:nth-child(3) { animation-delay: 0.4s; }

@keyframes shuffle {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  25% { transform: translate(-90%, -50%) rotate(-20deg); }
  50% { transform: translate(-50%, -50%) rotate(0deg); }
  75% { transform: translate(-10%, -50%) rotate(20deg); }
  100% { transform: translate(-50%, -50%) rotate(0deg); }
}

/* ===== Result Display ===== */
.result {
  padding: 40px 20px;
  animation: fadeIn 0.8s ease;
}

.result__card-display {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-dark);
}

.result__card-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.result__card-name {
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: 0.1em;
  font-weight: 400;
}

.result__card-name-en {
  font-size: 0.75rem;
  color: var(--gold-light);
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}

.result__card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted-light);
}

.result__box {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-dark);
}

.result__box:last-of-type {
  border-bottom: none;
}

.result__box-title {
  font-size: 0.8rem;
  color: var(--gold);
  margin-bottom: 12px;
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result__box-text {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 2.2;
}

.result__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px 0;
  text-align: center;
  align-items: center;
}

/* ===== Astrology Form ===== */
.form-section {
  max-width: 400px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group__label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dark);
  margin-bottom: 10px;
  letter-spacing: 0.1em;
}

.form-group__label--light {
  color: var(--text-light);
}

.form-group__input,
.form-group__select {
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border-light);
  color: var(--text-dark);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.3s;
  -webkit-appearance: none;
}

.form-group__input:focus,
.form-group__select:focus {
  outline: none;
  border-color: var(--gold);
}

.form-group__row {
  display: flex;
  gap: 8px;
}

.form-group__row .form-group__select,
.form-group__row .form-group__input {
  flex: 1;
}

/* Dark form variant */
.form-section--dark .form-group__input,
.form-section--dark .form-group__select {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-dark);
  color: var(--text-light);
}

.form-section--dark .form-group__input:focus,
.form-section--dark .form-group__select:focus {
  border-color: var(--gold);
}

/* Gender buttons in dark mode */
.gender-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border-light);
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 0.1em;
}

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

.gender-btn--active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* ===== Astrology Result ===== */
.astro-result {
  padding: 40px 20px;
  animation: fadeIn 0.8s ease;
}

.astro-result__header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-dark);
}

.astro-result__symbol {
  font-size: 3rem;
  margin-bottom: 12px;
}

.astro-result__title {
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: 0.1em;
  font-weight: 400;
}

.astro-result__subtitle {
  font-size: 0.75rem;
  color: var(--gold-light);
  letter-spacing: 0.15em;
}

.astro-result__chart {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-dark);
  margin-bottom: 32px;
}

.astro-result__chart-item {
  background: var(--navy);
  padding: 16px;
  text-align: center;
}

.astro-result__chart-label {
  font-size: 0.65rem;
  color: var(--text-muted-light);
  margin-bottom: 4px;
  letter-spacing: 0.1em;
}

.astro-result__chart-value {
  font-size: 0.95rem;
  color: var(--gold-light);
  font-weight: 600;
}

/* ===== Share ===== */
.share-section {
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid var(--border-dark);
}

.share-section__label {
  font-size: 0.7rem;
  color: var(--text-muted-light);
  letter-spacing: 0.2em;
  margin-bottom: 12px;
}

.share {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.share__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: 1px solid var(--border-dark);
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s;
}

.share__btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 32px 20px;
  background: var(--cream-dark);
  border-top: 1px solid var(--border-light);
}

.footer__logo {
  font-size: 0.8rem;
  color: var(--gold-dark);
  letter-spacing: 0.3em;
  margin-bottom: 8px;
}

.footer__text {
  font-size: 0.7rem;
  color: var(--text-muted-dark);
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
}

.footer__links a {
  font-size: 0.7rem;
  color: var(--text-muted-dark);
  letter-spacing: 0.05em;
}

/* ===== About Box ===== */
.about-box {
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
}

.about-box p {
  font-size: 0.8rem;
  color: var(--text-muted-dark);
  line-height: 2.2;
}

/* ===== Decorative Divider ===== */
.deco-divider {
  text-align: center;
  padding: 8px 0;
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.5em;
}

/* ===== Loading ===== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 60px 0;
}

.loading__spinner {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border-dark);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading__text {
  font-size: 0.8rem;
  color: var(--text-muted-light);
  letter-spacing: 0.1em;
}

/* ===== Hero for subpages ===== */
.page-hero {
  text-align: center;
  padding: 48px 20px 32px;
}

.page-hero__icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.page-hero__title {
  font-size: 1.4rem;
  color: #fff;
  letter-spacing: 0.15em;
  font-weight: 400;
  margin-bottom: 8px;
}

.page-hero__desc {
  font-size: 0.78rem;
  color: var(--text-muted-light);
  line-height: 2.2;
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .container {
    max-width: 680px;
  }

  .hero-visual__title strong {
    font-size: 2.4rem;
  }

  .hero-visual__subtitle {
    font-size: 2.8rem;
  }

  .card-fan {
    max-width: 440px;
    height: 360px;
  }

  .tarot-card {
    width: 65px;
    height: 97px;
  }
}
