.fortune-page {
  --fortune-navy: #102b55;
  --fortune-blue: #1d4ed8;
  --fortune-ivory: #fffaf0;
  --fortune-gold: #d8a83e;
  --fortune-line: rgba(23, 58, 118, 0.16);
  background:
    radial-gradient(circle at 8% 12%, rgba(216, 168, 62, 0.08), transparent 25rem),
    var(--bg);
}

.fortune-page .site-header {
  background: rgba(247, 249, 252, 0.94);
}

.fortune-shell {
  width: min(1160px, calc(100% - 40px));
}

.fortune-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 32px;
  align-items: center;
  min-height: 390px;
  padding: clamp(30px, 5vw, 58px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 240, 0.96) 52%, rgba(225, 234, 250, 0.95)),
    var(--surface);
  border: 1px solid var(--fortune-line);
  border-radius: 24px;
  box-shadow: 0 22px 60px rgba(16, 43, 85, 0.1);
}

.fortune-hero::before,
.fortune-hero::after {
  position: absolute;
  border: 1px solid rgba(216, 168, 62, 0.2);
  border-radius: 999px;
  content: "";
  pointer-events: none;
}

.fortune-hero::before {
  right: -150px;
  bottom: -260px;
  width: 560px;
  height: 560px;
}

.fortune-hero::after {
  right: -42px;
  bottom: -150px;
  width: 360px;
  height: 360px;
}

.fortune-hero-copy {
  position: relative;
  z-index: 1;
}

.fortune-hero-copy h1 {
  color: var(--fortune-navy);
  font-size: clamp(42px, 6.5vw, 72px);
  letter-spacing: -0.045em;
}

.fortune-hero-copy > p:not(.eyebrow) {
  max-width: 660px;
  margin: 20px 0 0;
  color: #475569;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.75;
  word-break: keep-all;
}

.fortune-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.fortune-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(23, 58, 118, 0.12);
  border-radius: 999px;
  color: var(--fortune-navy);
  font-size: 12px;
  font-weight: 800;
}

.fortune-orbit {
  position: relative;
  z-index: 1;
  width: min(310px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border: 1px solid rgba(216, 168, 62, 0.42);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 34px rgba(255, 255, 255, 0.24),
    0 20px 50px rgba(16, 43, 85, 0.12);
}

.fortune-orbit::before,
.fortune-orbit::after {
  position: absolute;
  inset: 17%;
  border: 1px dashed rgba(23, 58, 118, 0.2);
  border-radius: 50%;
  content: "";
}

.fortune-orbit::after {
  inset: 31%;
  border-style: solid;
  border-color: rgba(216, 168, 62, 0.34);
}

.fortune-orbit-core {
  position: absolute;
  inset: 38%;
  display: grid;
  place-items: center;
  background: var(--fortune-navy);
  border: 5px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(16, 43, 85, 0.22);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.fortune-element-dot {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 7px 18px rgba(15, 23, 42, 0.14);
  color: #ffffff;
  font-size: 19px;
  font-weight: 900;
}

.fortune-element-dot.wood { top: 4%; left: 18%; background: #2f7d56; }
.fortune-element-dot.fire { top: 4%; right: 18%; background: #b84a3c; }
.fortune-element-dot.earth { top: 46%; right: -7%; background: #b58116; }
.fortune-element-dot.metal { right: 16%; bottom: 2%; background: #64748b; }
.fortune-element-dot.water { bottom: 2%; left: 17%; background: #24364b; }

.fortune-calculator {
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 24px;
  margin-top: 26px;
}

.fortune-form-card,
.fortune-result-card {
  border-color: var(--fortune-line);
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(16, 43, 85, 0.08);
}

.fortune-form-card {
  position: sticky;
  top: 88px;
  padding: clamp(24px, 4vw, 34px);
  background:
    linear-gradient(160deg, rgba(255, 250, 240, 0.9), rgba(255, 255, 255, 0.98) 44%),
    var(--surface);
}

.fortune-form-card fieldset {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.fortune-form-card legend {
  margin-bottom: 8px;
  color: var(--fortune-navy);
  font-size: 24px;
}

.fortune-form-intro,
.fortune-privacy {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.65;
}

.fortune-form-card .single-field,
.fortune-input-grid {
  grid-template-columns: 1fr;
}

.optional-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 4px;
  padding: 0 8px;
  background: #eef4ff;
  border-radius: 999px;
  color: var(--fortune-blue);
  font-size: 11px;
  font-weight: 850;
  vertical-align: middle;
}

.fortune-form-card input[type="date"],
.fortune-form-card input[type="time"] {
  width: 100%;
  min-height: 56px;
  padding: 0 14px;
  background: #f8fafc;
  border: 1px solid #d8e0eb;
  border-radius: 10px;
  color: var(--fortune-navy);
  font-size: 17px;
  font-weight: 800;
}

.fortune-form-card input[type="date"]:focus,
.fortune-form-card input[type="time"]:focus {
  border-color: var(--fortune-blue);
  outline: 3px solid rgba(37, 99, 235, 0.14);
  outline-offset: 1px;
}

.fortune-submit {
  min-height: 56px;
  border-radius: 10px;
  background: var(--fortune-navy);
  font-size: 16px;
}

.fortune-submit:hover {
  background: #173f7c;
}

.fortune-error {
  min-height: 20px;
  margin: -4px 0 -6px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 750;
}

.fortune-result-card {
  position: relative;
  top: auto;
  gap: 20px;
  padding: clamp(24px, 4vw, 38px);
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(216, 168, 62, 0.16), transparent 18rem),
    linear-gradient(145deg, #eef4ff, #ffffff 45%, #fffaf0);
}

.fortune-result-card::before {
  position: absolute;
  top: -90px;
  right: -90px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(216, 168, 62, 0.25);
  border-radius: 50%;
  content: "";
}

.fortune-result-card > * {
  position: relative;
  z-index: 1;
}

.fortune-result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fortune-result-topline time {
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
}

.fortune-headline {
  color: var(--fortune-navy);
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -0.035em;
}

.fortune-headline:focus {
  outline: 0;
}

.fortune-summary {
  max-width: 720px;
  font-size: 15px;
  line-height: 1.75;
}

.fortune-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: center;
}

.fortune-pillar {
  display: grid;
  gap: 6px;
  min-height: 120px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(23, 58, 118, 0.12);
  border-radius: 14px;
  text-align: center;
}

.fortune-pillar span,
.fortune-pillar small {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.fortune-pillar strong {
  color: var(--fortune-navy);
  font-size: 25px;
}

.fortune-time-pillar {
  background: linear-gradient(145deg, rgba(255, 250, 240, 0.92), rgba(238, 244, 255, 0.92));
  border-color: rgba(216, 168, 62, 0.34);
}

.fortune-flow-mark {
  color: var(--fortune-gold);
  font-size: 22px;
  font-weight: 900;
}

.fortune-relations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.fortune-relations div {
  padding: 14px;
  background: rgba(16, 43, 85, 0.05);
  border-radius: 10px;
}

.fortune-relations dt {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.fortune-relations dd {
  margin: 5px 0 0;
  color: var(--fortune-navy);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}

.fortune-areas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fortune-areas article {
  padding: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(23, 58, 118, 0.1);
  border-radius: 12px;
}

.fortune-areas span,
.fortune-action-box span {
  color: var(--fortune-blue);
  font-size: 12px;
  font-weight: 850;
}

.fortune-areas p {
  margin: 7px 0 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.62;
}

.fortune-action-box {
  display: grid;
  gap: 6px;
  padding: 17px 18px;
  background: var(--fortune-navy);
  border-radius: 12px;
}

.fortune-action-box span {
  color: #bfdbfe;
}

.fortune-action-box strong {
  color: #ffffff;
  font-size: 16px;
  line-height: 1.5;
}

.fortune-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(23, 58, 118, 0.12);
}

.fortune-share-button {
  min-height: 46px;
  background: #ffffff;
  border-color: rgba(29, 78, 216, 0.28);
  color: var(--fortune-blue);
  font-weight: 850;
}

.fortune-share-button:disabled {
  background: #eef2f7;
  border-color: #d8e0eb;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 1;
}

.fortune-share-status {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.fortune-result-disclaimer {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(23, 58, 118, 0.12);
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
}

.fortune-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.fortune-method-grid article {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--fortune-line);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(16, 43, 85, 0.06);
}

.fortune-step {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: #eef4ff;
  border-radius: 50%;
  color: var(--fortune-blue);
  font-size: 12px;
  font-weight: 900;
}

.fortune-method-grid h3,
.fortune-boundary h3 {
  margin: 16px 0 8px;
  color: var(--fortune-navy);
  font-size: 19px;
}

.fortune-method-grid p,
.fortune-boundary p {
  margin: 0;
  color: #64748b;
  line-height: 1.7;
}

.fortune-boundary {
  margin-top: 14px;
  border-left: 4px solid var(--fortune-gold);
  box-shadow: none;
}

.fortune-boundary h3 {
  margin-top: 0;
}

@media (max-width: 900px) {
  .fortune-hero {
    grid-template-columns: 1fr;
  }

  .fortune-orbit {
    width: min(280px, 78vw);
  }

  .fortune-calculator {
    grid-template-columns: 1fr;
  }

  .fortune-form-card {
    position: relative;
    top: auto;
  }
}

@media (max-width: 720px) {
  .fortune-shell {
    width: min(100% - 28px, 1160px);
    padding-top: 28px;
  }

  .fortune-hero {
    min-height: auto;
    padding: 28px 22px 34px;
    border-radius: 18px;
  }

  .fortune-hero-copy h1 {
    font-size: clamp(40px, 13vw, 56px);
  }

  .fortune-orbit {
    width: min(250px, 76vw);
  }

  .fortune-element-dot {
    width: 42px;
    height: 42px;
    font-size: 17px;
  }

  .fortune-form-card,
  .fortune-result-card {
    border-radius: 14px;
  }

  .fortune-pillars,
  .fortune-relations,
  .fortune-areas,
  .fortune-method-grid {
    grid-template-columns: 1fr;
  }

  .fortune-flow-mark {
    transform: rotate(90deg);
    justify-self: center;
  }

  .fortune-result-topline {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fortune-page *,
  .fortune-page *::before,
  .fortune-page *::after {
    scroll-behavior: auto !important;
  }
}
