:root {
  color-scheme: dark;
  --ink: #08110f;
  --panel: rgba(8, 17, 15, 0.62);
  --panel-strong: rgba(11, 25, 21, 0.86);
  --jade: #57f0bd;
  --jade-soft: rgba(87, 240, 189, 0.24);
  --gold: #f7c96b;
  --gold-soft: rgba(247, 201, 107, 0.26);
  --red: #e95445;
  --text: #f6f1df;
  --muted: rgba(246, 241, 223, 0.68);
  --line: rgba(246, 241, 223, 0.18);
  --mx: 50vw;
  --my: 50vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(8, 17, 15, 0.82), rgba(8, 17, 15, 0.34) 48%, rgba(8, 17, 15, 0.9)),
    url("./assets/oracle-bg.png") center / cover fixed;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.cursor-orb {
  position: fixed;
  left: var(--mx);
  top: var(--my);
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(87, 240, 189, 0.22), rgba(247, 201, 107, 0.12) 38%, transparent 68%);
  filter: blur(10px);
  opacity: 0.85;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  transition: left 0.18s ease, top 0.18s ease, opacity 0.3s ease;
}

.scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 239, 193, 0.95) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(87, 240, 189, 0.7) 0 1px, transparent 1.5px);
  background-size: 94px 94px, 151px 151px;
  opacity: 0.28;
  animation: drift 22s linear infinite;
}

.mist {
  position: absolute;
  width: 72vw;
  height: 42vh;
  border-radius: 999px;
  filter: blur(54px);
  opacity: 0.22;
  mix-blend-mode: screen;
}

.mist-a {
  left: -24vw;
  top: 14vh;
  background: rgba(87, 240, 189, 0.42);
  animation: float-a 13s ease-in-out infinite alternate;
}

.mist-b {
  right: -28vw;
  bottom: 2vh;
  background: rgba(247, 201, 107, 0.34);
  animation: float-b 16s ease-in-out infinite alternate;
}

.light-grid {
  position: absolute;
  inset: auto -8vw -26vh -8vw;
  height: 58vh;
  background:
    linear-gradient(rgba(87, 240, 189, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 201, 107, 0.18) 1px, transparent 1px);
  background-size: 72px 72px;
  transform: perspective(640px) rotateX(62deg);
  transform-origin: center bottom;
  opacity: 0.2;
  mask-image: linear-gradient(transparent, black 30%, transparent);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px clamp(18px, 4vw, 56px) 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--gold-soft);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 28px rgba(247, 201, 107, 0.25);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.lang,
.chips button,
.share,
.sound-toggle {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(8, 17, 15, 0.45);
  backdrop-filter: blur(18px);
}

.lang {
  min-width: 44px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
}

.lang.is-active {
  color: var(--ink);
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), var(--jade));
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
}

.sound-toggle.is-on {
  color: var(--jade);
  border-color: rgba(87, 240, 189, 0.5);
  box-shadow: 0 0 22px rgba(87, 240, 189, 0.16);
}

.sound-bars {
  display: inline-grid;
  grid-template-columns: repeat(3, 3px);
  align-items: end;
  gap: 3px;
  height: 14px;
}

.sound-bars i {
  display: block;
  width: 3px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.82;
}

.sound-bars i:nth-child(2) {
  height: 12px;
}

.sound-bars i:nth-child(3) {
  height: 9px;
}

.sound-toggle.is-on .sound-bars i {
  animation: sound-rise 1s ease-in-out infinite alternate;
}

.sound-toggle.is-on .sound-bars i:nth-child(2) {
  animation-delay: 0.18s;
}

.sound-toggle.is-on .sound-bars i:nth-child(3) {
  animation-delay: 0.34s;
}

.oracle {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.05fr) minmax(310px, 0.75fr);
  align-items: center;
  gap: clamp(22px, 4vw, 52px);
  min-height: calc(100vh - 84px);
  padding-top: 18px;
}

.intro {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(44px, 6vw, 88px);
  line-height: 0.96;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 0 48px rgba(87, 240, 189, 0.18);
}

.subtitle {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.55vw, 19px);
  line-height: 1.75;
}

.ask-card {
  width: min(620px, 100%);
  margin-top: 34px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(8, 17, 15, 0.74), rgba(20, 49, 40, 0.46));
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
}

.ask-card label {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.question-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(246, 241, 223, 0.2);
  border-radius: 8px;
  padding: 0 16px;
  outline: none;
  color: var(--text);
  background: rgba(4, 10, 9, 0.72);
}

input:focus {
  border-color: rgba(87, 240, 189, 0.72);
  box-shadow: 0 0 0 4px rgba(87, 240, 189, 0.12);
}

.spin-button {
  min-width: 106px;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  color: #09110f;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--jade));
  box-shadow: 0 0 30px rgba(87, 240, 189, 0.3);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.chips button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
}

.compass-wrap {
  position: relative;
  display: grid;
  min-height: 620px;
  place-items: center;
  transition: transform 0.3s ease;
}

.aura {
  position: absolute;
  width: min(54vw, 680px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(87, 240, 189, 0.26), transparent 55%),
    conic-gradient(from 0deg, transparent, rgba(247, 201, 107, 0.34), transparent, rgba(87, 240, 189, 0.32), transparent);
  filter: blur(18px);
  opacity: 0.9;
  animation: pulse 5s ease-in-out infinite;
}

.compass {
  position: relative;
  width: min(88vw, 540px);
  aspect-ratio: 1;
  border: 1px solid rgba(247, 201, 107, 0.45);
  border-radius: 50%;
  color: var(--gold);
  background:
    radial-gradient(circle at center, rgba(247, 201, 107, 0.3) 0 2px, transparent 3px 100%),
    repeating-conic-gradient(from 0deg, rgba(247, 201, 107, 0.34) 0deg 1deg, transparent 1deg 15deg),
    radial-gradient(circle, rgba(4, 10, 9, 0.92), rgba(4, 10, 9, 0.52) 55%, rgba(87, 240, 189, 0.12));
  box-shadow:
    0 0 0 1px rgba(246, 241, 223, 0.08) inset,
    0 0 70px rgba(87, 240, 189, 0.28),
    0 40px 120px rgba(0, 0, 0, 0.6);
  transition: transform 2.65s cubic-bezier(0.12, 0.72, 0.18, 1), box-shadow 0.4s ease;
}

.compass:hover {
  box-shadow:
    0 0 0 1px rgba(246, 241, 223, 0.12) inset,
    0 0 92px rgba(87, 240, 189, 0.36),
    0 46px 140px rgba(0, 0, 0, 0.7);
}

.compass.is-spinning {
  animation: shockwave 2.15s ease;
}

.ring {
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(247, 201, 107, 0.34);
  border-radius: 50%;
}

.ring-outer {
  inset: 7%;
  background: repeating-conic-gradient(from 8deg, transparent 0 17deg, rgba(87, 240, 189, 0.14) 17deg 18deg);
}

.ring-mid {
  inset: 22%;
  border-color: rgba(87, 240, 189, 0.42);
}

.ring-inner {
  inset: 36%;
  border-color: rgba(247, 201, 107, 0.42);
  background: radial-gradient(circle, rgba(247, 201, 107, 0.13), transparent 68%);
}

.trigrams {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 54px;
  height: 70px;
  color: rgba(246, 241, 223, 0.88);
  text-shadow: 0 0 18px rgba(247, 201, 107, 0.42);
}

.trigrams b {
  display: block;
  color: var(--gold);
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.trigrams em {
  display: block;
  margin-top: 5px;
  color: rgba(246, 241, 223, 0.82);
  font-size: 30px;
  line-height: 1;
  font-style: normal;
}

.trigram-n { left: calc(50% - 27px); top: 8%; }
.trigram-ne { right: 16%; top: 16%; }
.trigram-e { right: 8%; top: calc(50% - 27px); }
.trigram-se { right: 16%; bottom: 16%; }
.trigram-s { left: calc(50% - 27px); bottom: 8%; }
.trigram-sw { left: 16%; bottom: 16%; }
.trigram-w { left: 8%; top: calc(50% - 27px); }
.trigram-nw { left: 16%; top: 16%; }

.yin-yang {
  position: absolute;
  inset: 41%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 25%, #08110f 0 7%, transparent 7.5%),
    radial-gradient(circle at 50% 75%, var(--text) 0 7%, transparent 7.5%),
    linear-gradient(90deg, var(--text) 0 50%, #08110f 50%);
  box-shadow: 0 0 36px rgba(247, 201, 107, 0.35);
  animation: slow-spin 18s linear infinite;
}

.yin-yang span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 25%, var(--text) 0 25%, transparent 25.5%),
    radial-gradient(circle at 50% 75%, #08110f 0 25%, transparent 25.5%);
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(247, 201, 107, 0.28);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(9, 20, 17, 0.88), rgba(8, 17, 15, 0.62));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(24px);
}

.card-glow {
  position: absolute;
  inset: -40% -10% auto;
  height: 170px;
  background: radial-gradient(circle, rgba(87, 240, 189, 0.28), transparent 60%);
  pointer-events: none;
}

.result-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.result-head p,
.advice span,
.omens span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-head p {
  margin: 0;
}

.result-head strong {
  color: var(--gold);
  font-size: clamp(34px, 4vw, 52px);
  line-height: 0.95;
  white-space: nowrap;
}

.reading {
  position: relative;
  min-height: 120px;
  margin: 26px 0;
  color: rgba(246, 241, 223, 0.92);
  font-size: 20px;
  line-height: 1.68;
}

.omens {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.omens div {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.omens strong {
  display: block;
  margin-top: 12px;
  color: var(--jade);
  font-size: 22px;
}

.advice {
  margin-top: 18px;
  padding: 16px;
  border-left: 3px solid var(--gold);
  background: rgba(247, 201, 107, 0.08);
}

.advice p {
  margin: 9px 0 0;
  color: rgba(246, 241, 223, 0.9);
  line-height: 1.65;
}

.share {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  border-radius: 8px;
  font-weight: 800;
}

.notice {
  margin: 14px 0 0;
  color: rgba(246, 241, 223, 0.46);
  font-size: 12px;
  line-height: 1.5;
}

.result-card.flash {
  animation: card-flash 0.8s ease;
}

.reveal-text {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(8px);
  transition: opacity 0.75s ease, filter 0.75s ease, transform 0.75s ease;
}

.reveal-text.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

@keyframes drift {
  to { transform: translate3d(48px, 22px, 0); }
}

@keyframes float-a {
  to { transform: translate3d(10vw, 4vh, 0) scale(1.08); }
}

@keyframes float-b {
  to { transform: translate3d(-8vw, -5vh, 0) scale(1.05); }
}

@keyframes pulse {
  0%, 100% { transform: scale(0.98); opacity: 0.68; }
  50% { transform: scale(1.04); opacity: 1; }
}

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

@keyframes shockwave {
  0% { box-shadow: 0 0 0 0 rgba(87, 240, 189, 0.48), 0 40px 120px rgba(0, 0, 0, 0.6); }
  100% { box-shadow: 0 0 0 58px rgba(87, 240, 189, 0), 0 40px 120px rgba(0, 0, 0, 0.6); }
}

@keyframes card-flash {
  0% { transform: translateY(8px); border-color: rgba(87, 240, 189, 0.76); }
  100% { transform: translateY(0); border-color: rgba(247, 201, 107, 0.28); }
}

@keyframes sound-rise {
  0% { transform: scaleY(0.55); opacity: 0.55; }
  100% { transform: scaleY(1.08); opacity: 1; }
}

@media (max-width: 1180px) {
  .oracle {
    grid-template-columns: 1fr 1fr;
  }

  .result-card {
    grid-column: 1 / -1;
    width: min(760px, 100%);
    margin: -18px auto 0;
  }
}

@media (max-width: 780px) {
  body {
    background-attachment: scroll;
  }

  .shell {
    padding: 18px 14px 28px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .nav {
    justify-content: flex-start;
  }

  .oracle {
    display: block;
    min-height: 0;
    padding-top: 34px;
  }

  .question-row {
    grid-template-columns: 1fr;
  }

  .spin-button {
    width: 100%;
  }

  .compass-wrap {
    min-height: 420px;
    margin: 20px 0;
  }

  .trigrams {
    width: 38px;
    height: 52px;
  }

  .trigrams b {
    font-size: 17px;
  }

  .trigrams em {
    margin-top: 3px;
    font-size: 23px;
  }

  .trigram-n { left: calc(50% - 19px); }
  .trigram-e { top: calc(50% - 19px); }
  .trigram-s { left: calc(50% - 19px); }
  .trigram-w { top: calc(50% - 19px); }

  .result-card {
    margin-top: 0;
  }

  .omens {
    grid-template-columns: 1fr;
  }

  .reading {
    min-height: 0;
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
