:root {
  --fate-accent: #8adfff;
  --fate-accent-soft: rgba(138, 223, 255, 0.16);
  --fate-gold: #f6e4bf;
  --fate-danger: #ff8a8a;
  --fate-low: #aab6d7;
  --fate-neutral: #d7e1f0;
  --fate-glimmer: #9ef2cf;
  --fate-good: #ffe28f;
  --fate-rare: #c8a6ff;
}

.fate-page .service-hero__title {
  max-width: 8ch;
}

.fate-page .service-hero__subtitle {
  max-width: 28rem;
}

.fate-page .service-hero__lede {
  max-width: 38rem;
}

.fate-main {
  gap: 38px;
}

.fate-grid {
  align-items: start;
}

.fate-console .identity-form {
  gap: 16px;
}

.fate-console .identity-form__hint {
  min-height: 1.4em;
}

.step-track {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-track__item {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 14px 16px 14px 52px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(9, 15, 24, 0.68);
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.step-track__item::before {
  content: attr(data-step);
  position: absolute;
  top: 15px;
  left: 15px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--strong);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.step-track__label {
  color: var(--ink);
  font-family: var(--title-font);
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.step-track__meta {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.step-track__item.is-active {
  border-color: rgba(138, 223, 255, 0.42);
  box-shadow: 0 0 0 1px rgba(138, 223, 255, 0.14) inset;
  transform: translateY(-2px);
}

.step-track__item.is-complete::before {
  content: "OK";
  color: #0f1822;
  border-color: rgba(138, 223, 255, 0.58);
  background: rgba(138, 223, 255, 0.88);
}

.step-track__item.is-dim {
  opacity: 0.62;
}

.fate-stage {
  overflow: hidden;
}

.fate-ritual,
.fate-result {
  gap: 24px;
}

.fate-ritual__name {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  letter-spacing: 0.04em;
}

.fate-ritual__name strong {
  color: var(--ink);
  font-family: "Orbitron", "Chakra Petch", sans-serif;
}

.fate-die-wrap {
  display: grid;
  place-items: center;
  min-height: 330px;
}

.fate-die {
  --die-glow: rgba(138, 223, 255, 0.22);
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 360px);
  aspect-ratio: 1;
  padding: 28px;
  isolation: isolate;
}

.fate-die::before,
.fate-die::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  clip-path: polygon(24% 0, 76% 0, 100% 24%, 100% 76%, 76% 100%, 24% 100%, 0 76%, 0 24%);
}

.fate-die::after {
  inset: 18px;
  border-color: rgba(138, 223, 255, 0.22);
}

.fate-die__halo {
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--die-glow) 0, rgba(138, 223, 255, 0.06) 42%, transparent 72%);
  filter: blur(10px);
}

.fate-die__face {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(8, 17, 28, 0.94), rgba(9, 14, 23, 0.88)),
    radial-gradient(circle at top, rgba(138, 223, 255, 0.18), transparent 52%);
  color: var(--fate-gold);
  font-family: "Orbitron", "Chakra Petch", sans-serif;
  font-size: clamp(3.4rem, 8vw, 5rem);
  font-weight: 700;
  text-shadow: 0 0 24px rgba(246, 228, 191, 0.28);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 18px 38px rgba(0, 0, 0, 0.32);
}

.fate-die__tier {
  position: absolute;
  bottom: 34px;
  left: 50%;
  z-index: 1;
  margin: 0;
  transform: translateX(-50%);
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.fate-die.is-rolling {
  animation: die-float 1.3s linear infinite;
}

.fate-die.is-rolling .fate-die__face {
  animation: die-spin 900ms linear infinite;
}

.fate-ritual__status {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.7;
}

.fate-ritual__status[data-tone="error"] {
  color: #ffd1d1;
}

.fate-ritual__status[data-tone="resolved"] {
  color: var(--fate-gold);
}

.fate-log {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    rgba(7, 12, 19, 0.74);
}

.fate-log p {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.72;
}

.fate-slip {
  position: relative;
  display: grid;
  gap: 24px;
  padding: 24px;
  max-width: 820px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    linear-gradient(180deg, rgba(9, 15, 24, 0.96), rgba(8, 12, 20, 0.94));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 20px 48px rgba(0, 0, 0, 0.32);
}

.fate-slip::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(138, 223, 255, 0.1);
  pointer-events: none;
}

.fate-slip__masthead {
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fate-slip__masthead > div {
  display: grid;
  gap: 8px;
}

.fate-slip__code,
.fate-slip__label,
.fate-metric span {
  margin: 0;
  color: var(--strong);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fate-slip__masthead h3 {
  margin: 0;
  color: var(--ink);
  font-family: "SJsuqian", "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.08;
}

.fate-slip__tier {
  justify-self: start;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(138, 223, 255, 0.18);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fate-slip__topline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fate-metric,
.fate-slip__cell {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    rgba(255, 255, 255, 0.02);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.fate-metric strong {
  color: var(--ink);
  font-family: "Orbitron", "Chakra Petch", sans-serif;
  font-size: 1.1rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.fate-slip__section {
  display: grid;
  gap: 12px;
  padding: 18px 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(90deg, rgba(138, 223, 255, 0.08), rgba(138, 223, 255, 0) 18%),
    rgba(255, 255, 255, 0.02);
}

.fate-slip__fortune {
  margin: 0;
  color: var(--ink);
  font-family: "SJsuqian", "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: clamp(1.36rem, 3vw, 1.72rem);
  line-height: 1.72;
  letter-spacing: 0.01em;
}

.fate-slip__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fate-slip__cell p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.fate-slip__cell--wide {
  grid-column: 1 / -1;
}

.fate-result .result-summary,
.fate-result .result-status {
  max-width: 64ch;
  margin-left: auto;
  margin-right: auto;
}

.fate-result .result-summary {
  text-align: center;
}

.fate-result[data-tier="danger"] .fate-slip__tier,
.fate-die[data-tier="danger"] .fate-die__face {
  border-color: rgba(255, 138, 138, 0.4);
  color: var(--fate-danger);
}

.fate-result[data-tier="low"] .fate-slip__tier,
.fate-die[data-tier="low"] .fate-die__face {
  border-color: rgba(170, 182, 215, 0.32);
  color: var(--fate-low);
}

.fate-result[data-tier="neutral"] .fate-slip__tier,
.fate-die[data-tier="neutral"] .fate-die__face {
  border-color: rgba(215, 225, 240, 0.26);
  color: var(--fate-neutral);
}

.fate-result[data-tier="glimmer"] .fate-slip__tier,
.fate-die[data-tier="glimmer"] .fate-die__face {
  border-color: rgba(158, 242, 207, 0.34);
  color: var(--fate-glimmer);
}

.fate-result[data-tier="good"] .fate-slip__tier,
.fate-die[data-tier="good"] .fate-die__face {
  border-color: rgba(255, 226, 143, 0.36);
  color: var(--fate-good);
}

.fate-result[data-tier="rare"] .fate-slip__tier,
.fate-die[data-tier="rare"] .fate-die__face {
  border-color: rgba(200, 166, 255, 0.42);
  color: var(--fate-rare);
}

@keyframes die-spin {
  0% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(180deg) scale(0.92);
  }

  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes die-float {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }

  100% {
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .fate-slip__topline,
  .fate-slip__grid {
    grid-template-columns: 1fr;
  }

  .fate-die-wrap {
    min-height: 290px;
  }
}

@media (max-width: 640px) {
  .fate-page .service-hero__title {
    max-width: none;
  }

  .fate-die {
    width: min(100%, 300px);
  }

  .fate-die__face {
    width: 116px;
    height: 116px;
  }

  .fate-slip {
    padding: 18px;
  }

  .step-track__item {
    padding-left: 48px;
  }
}

@media (max-width: 399px) {
  .fate-main {
    gap: 22px;
  }

  .step-track__item {
    padding: 12px 12px 12px 42px;
  }

  .step-track__item::before {
    top: 12px;
    left: 12px;
    width: 20px;
    height: 20px;
    font-size: 0.64rem;
  }

  .step-track__label {
    font-size: 0.9rem;
  }

  .step-track__meta,
  .fate-log p,
  .fate-ritual__status {
    font-size: 0.82rem;
    line-height: 1.58;
  }

  .fate-die-wrap {
    min-height: 236px;
  }

  .fate-die {
    width: min(100%, 250px);
    padding: 18px;
  }

  .fate-die__face {
    width: 92px;
    height: 92px;
    font-size: 2.8rem;
  }

  .fate-die__tier {
    bottom: 24px;
    font-size: 0.72rem;
  }

  .fate-log,
  .fate-slip,
  .fate-metric,
  .fate-slip__cell,
  .fate-slip__section {
    padding: 14px;
  }

  .fate-slip {
    gap: 18px;
  }

  .fate-slip::before {
    inset: 10px;
  }

  .fate-slip__masthead h3 {
    font-size: clamp(1.56rem, 8.8vw, 1.94rem);
  }

  .fate-slip__fortune {
    font-size: 1.16rem;
    line-height: 1.58;
  }

  .fate-slip__cell p:last-child {
    font-size: 0.86rem;
    line-height: 1.64;
  }
}

@media (prefers-reduced-motion: reduce) {
  .step-track__item,
  .fate-die,
  .fate-die__face {
    transition: none;
    animation: none;
  }
}
