:root {
  --bg: #090527;
  --deep: #170936;
  --panel: rgba(44, 19, 76, 0.72);
  --line: rgba(255, 168, 228, 0.5);
  --text: #fff7ff;
  --muted: #dcbcff;
  --pink: #ff67b9;
  --gold: #ffdca8;
  --violet: #9f73ff;
  color-scheme: dark;
  font-family: "Noto Serif TC", "Songti TC", "PingFang TC", "Microsoft JhengHei", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 48% 18%, rgba(161, 91, 255, 0.4), transparent 22rem),
    radial-gradient(circle at 18% 74%, rgba(255, 91, 184, 0.18), transparent 18rem),
    linear-gradient(180deg, #06062a, var(--deep) 48%, #070321);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.shell::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 132, 211, 0.8) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(176, 126, 255, 0.72) 0 1px, transparent 1.8px);
  background-position: 0 0, 50px 74px, 110px 28px;
  background-size: 120px 120px, 156px 156px, 214px 214px;
  animation: twinkle 4.5s ease-in-out infinite alternate;
}

.brand {
  min-height: 78px;
  padding: 12px 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 189, 242, 0.35);
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(45, 22, 78, 0.82), rgba(24, 13, 60, 0.76));
  box-shadow: 0 0 24px rgba(139, 83, 205, 0.28), inset 0 0 22px rgba(255, 255, 255, 0.04);
}

.brand strong {
  font-size: clamp(31px, 9vw, 42px);
  text-shadow: 0 0 14px rgba(255, 205, 248, 0.7);
}

.moon {
  position: relative;
  display: inline-block;
  border-radius: 50%;
  background: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 132, 201, 0.85));
}

.moon.tiny {
  width: 54px;
  height: 54px;
  box-shadow: -17px 4px 0 5px #ffb3d6;
}

.moon.tiny i {
  position: absolute;
  right: 4px;
  top: 22px;
  color: #ffd7ed;
  font-style: normal;
  font-size: 17px;
}

.hero {
  position: relative;
  min-height: 322px;
  display: grid;
  place-items: center;
}

.moon.big {
  position: absolute;
  left: 70px;
  top: 22px;
  width: 120px;
  height: 150px;
  box-shadow: -50px 10px 0 12px #ffadd1;
  transform: rotate(12deg);
}

.heart-line {
  position: absolute;
  top: 84px;
  right: 36px;
  width: 132px;
  height: 112px;
  transform: rotate(-45deg);
}

.heart-line::before,
.heart-line::after {
  position: absolute;
  width: 74px;
  height: 116px;
  border: 2px solid #ff9ad8;
  border-left: 0;
  border-bottom: 0;
  border-radius: 74px 74px 0 0;
  content: "";
  filter: drop-shadow(0 0 8px rgba(255, 104, 200, 0.9));
}

.heart-line::after {
  left: 43px;
  transform: rotate(90deg);
  transform-origin: 0 100%;
}

.cards {
  position: relative;
  width: 190px;
  height: 170px;
  margin-top: 108px;
  animation: float 3.8s ease-in-out infinite;
}

.cards span {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 82px;
  height: 128px;
  border: 2px solid rgba(255, 180, 224, 0.78);
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 54%, rgba(255, 134, 208, 0.25), transparent 34%),
    linear-gradient(145deg, #19114a, #32165d);
  box-shadow: 0 0 18px rgba(255, 103, 193, 0.32);
}

.cards span::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffd3ee;
  font-size: 34px;
  content: "♥";
}

.cards span:nth-child(1) {
  transform: translateX(-96%) rotate(-12deg);
}

.cards span:nth-child(2) {
  z-index: 2;
  width: 92px;
  height: 144px;
  transform: translateX(-50%);
}

.cards span:nth-child(3) {
  transform: translateX(-4%) rotate(12deg);
}

.ring {
  position: absolute;
  bottom: 18px;
  width: 82%;
  height: 62px;
  border: 1px solid rgba(255, 170, 234, 0.72);
  border-radius: 50%;
  transform: perspective(120px) rotateX(56deg);
  box-shadow: 0 0 24px rgba(255, 99, 198, 0.5);
}

.copy {
  text-align: center;
}

.copy h1,
.loading h1 {
  margin: 0;
  font-size: clamp(39px, 10.8vw, 55px);
  line-height: 1.14;
  text-shadow: 0 0 17px rgba(255, 121, 213, 0.78);
}

.copy p,
.loading p {
  margin: 12px 0 0;
  color: #ffe8f8;
  font-size: clamp(21px, 6vw, 28px);
  line-height: 1.45;
}

.copy small {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 16px;
}

.compact h1 {
  font-size: clamp(34px, 9vw, 46px);
}

.compact p {
  font-size: 17px;
  color: var(--muted);
}

.btn {
  width: 100%;
  min-height: 62px;
  border: 1px solid rgba(255, 203, 237, 0.86);
  border-radius: 999px;
  color: #fff;
  font-size: clamp(22px, 6vw, 31px);
  font-weight: 800;
  background: rgba(35, 15, 68, 0.66);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn.primary,
.btn.secondary {
  background: linear-gradient(180deg, #ff83c9, #fb3f9f);
  box-shadow: 0 0 24px rgba(255, 83, 177, 0.62), inset 0 2px 0 rgba(255, 255, 255, 0.26);
  animation: pulse 2.7s ease-in-out infinite;
}

.btn.secondary {
  background: linear-gradient(180deg, #c68cff, #8d62ff);
}

.btn.ghost {
  min-height: 54px;
  color: #f7d8ff;
}

.btn:hover,
.options button:hover,
.pills button:hover,
.insights button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(255, 103, 198, 0.42);
}

.time {
  margin: 0;
  text-align: center;
  color: #f1c9ff;
  font-size: 21px;
}

.progress {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.progress span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: rgba(216, 183, 255, 0.72);
  font-size: 17px;
  font-weight: 800;
}

.progress span::before {
  position: absolute;
  top: 20px;
  left: -50%;
  z-index: -1;
  width: 100%;
  height: 3px;
  background: rgba(202, 118, 255, 0.42);
  content: "";
}

.progress span:first-child::before {
  display: none;
}

.progress b {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(208, 145, 255, 0.62);
  border-radius: 50%;
  background: rgba(84, 42, 131, 0.86);
  font-family: "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 24px;
}

.progress .on {
  color: #ffd7f0;
}

.progress .on b {
  border-color: #ffc6ea;
  background: linear-gradient(180deg, #ff85cb, #e246a9);
  box-shadow: 0 0 17px rgba(255, 91, 186, 0.84);
}

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: linear-gradient(180deg, rgba(69, 29, 104, 0.78), rgba(22, 10, 54, 0.74));
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.035), 0 0 24px rgba(116, 65, 210, 0.25);
  backdrop-filter: blur(14px);
}

.form {
  display: grid;
  gap: 17px;
}

label {
  display: grid;
  gap: 8px;
  color: #ffe2f6;
  font-size: 18px;
  font-weight: 800;
}

input {
  height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(255, 173, 235, 0.42);
  border-radius: 14px;
  outline: 0;
  color: #fff;
  background: rgba(9, 6, 40, 0.58);
}

input:focus {
  border-color: rgba(255, 138, 211, 0.92);
  box-shadow: 0 0 0 3px rgba(255, 92, 184, 0.16);
}

.pills,
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.pills button,
.options button {
  min-height: 41px;
  padding: 8px 13px;
  border: 1px solid rgba(214, 151, 255, 0.42);
  border-radius: 999px;
  color: #f4dcff;
  background: rgba(28, 14, 61, 0.72);
}

.options {
  display: grid;
}

.options button {
  min-height: 58px;
  border-radius: 16px;
  color: #fff3fb;
  font-size: 20px;
  text-align: left;
}

.pills .picked,
.options .picked {
  color: #fff;
  border-color: rgba(255, 202, 237, 0.9);
  background: linear-gradient(135deg, rgba(255, 111, 193, 0.86), rgba(126, 84, 242, 0.78));
  box-shadow: 0 0 16px rgba(255, 92, 188, 0.36);
}

.notice {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 212, 151, 0.45);
  border-radius: 13px;
  color: #ffe4b8;
  background: rgba(88, 49, 30, 0.34);
  text-align: center;
}

.split,
.stack {
  display: grid;
  gap: 12px;
}

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

.meta {
  display: flex;
  justify-content: space-between;
  color: var(--gold);
}

.bar {
  height: 8px;
  margin: 12px 0 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 179, 234, 0.28);
  border-radius: 999px;
  background: rgba(20, 10, 56, 0.74);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--violet));
  box-shadow: 0 0 12px rgba(255, 96, 189, 0.72);
}

.quiz h2 {
  margin: 0 0 18px;
  font-size: clamp(28px, 7.2vw, 37px);
  line-height: 1.28;
  text-align: center;
}

.loading {
  flex: 1;
  display: grid;
  align-content: center;
  gap: 20px;
  text-align: center;
}

.orbit {
  position: relative;
  width: 238px;
  height: 238px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid transparent;
  border-top-color: rgba(255, 141, 214, 0.86);
  border-right-color: rgba(185, 126, 255, 0.62);
  border-radius: 50%;
  animation: spin 2.4s linear infinite;
}

.orbit span {
  width: 88px;
  height: 132px;
  border: 2px solid rgba(255, 188, 232, 0.86);
  border-radius: 10px;
  background: linear-gradient(160deg, #2c1558, #140d41);
  box-shadow: 0 0 24px rgba(255, 105, 198, 0.52);
}

.orbit span::after {
  display: grid;
  height: 100%;
  place-items: center;
  color: #ffd0ed;
  font-size: 40px;
  content: "☾";
}

.bar.thick {
  height: 16px;
  margin: 0;
}

.result h2 {
  margin: 0 0 14px;
  padding: 13px;
  border: 1px solid rgba(255, 169, 232, 0.44);
  border-radius: 999px;
  background: rgba(33, 14, 64, 0.72);
  text-align: center;
  font-size: clamp(25px, 7vw, 34px);
  overflow-wrap: anywhere;
}

.door {
  position: relative;
  height: 222px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 54% 48%, rgba(255, 154, 216, 0.38), transparent 7rem),
    linear-gradient(180deg, rgba(42, 20, 83, 0.6), rgba(12, 8, 38, 0.78));
}

.door::before {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 128px;
  height: 200px;
  border: 5px solid rgba(255, 177, 221, 0.52);
  border-bottom: 0;
  border-radius: 70px 70px 0 0;
  transform: translateX(-50%);
  content: "";
}

.door span {
  position: absolute;
  left: calc(50% - 39px);
  bottom: 0;
  width: 72px;
  height: 172px;
  border: 2px solid rgba(255, 184, 224, 0.64);
  border-radius: 42px 10px 0 0;
  background: linear-gradient(145deg, #241050, #120b36);
  transform: perspective(420px) rotateY(-28deg);
  transform-origin: left center;
}

.door i {
  position: absolute;
  right: 110px;
  bottom: 86px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #ffd0e8;
  box-shadow: 0 0 24px rgba(255, 117, 205, 0.74);
}

.door i::after {
  position: absolute;
  inset: -2px 12px 4px 25px;
  border-radius: 50%;
  background: #251050;
  content: "";
}

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

.gauge {
  --score: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.gauge::before {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #170a3d 0 55%, transparent 56%),
    conic-gradient(var(--color) calc(var(--score) * 1%), rgba(158, 90, 255, 0.2) 0);
  box-shadow: 0 0 16px rgba(255, 117, 203, 0.26);
  content: "";
}

.gauge b {
  margin-top: -64px;
  font-family: "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 25px;
}

.gauge span {
  color: #ffe4f7;
  font-size: 15px;
}

.oracle {
  margin: 16px 0;
  color: #ffe0b8;
  text-align: center;
  font-size: 21px;
  line-height: 1.45;
}

.insights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.insights button {
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(255, 151, 222, 0.44);
  border-radius: 15px;
  color: #fff;
  background: rgba(44, 18, 80, 0.68);
  font-size: 18px;
  font-weight: 800;
}

.detail {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 194, 235, 0.3);
  border-radius: 14px;
  background: rgba(9, 6, 40, 0.38);
}

.detail h3 {
  margin: 0 0 8px;
  color: var(--gold);
}

.detail p {
  margin: 8px 0;
  line-height: 1.55;
}

@media (max-width: 374px) {
  .brand strong {
    font-size: 29px;
  }

  .gauge::before {
    width: 82px;
    height: 82px;
  }

  .gauge b {
    margin-top: -58px;
    font-size: 22px;
  }
}

@keyframes twinkle {
  to {
    opacity: 0.72;
    transform: translateY(-7px);
  }
}

@keyframes float {
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 34px rgba(255, 83, 177, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.26);
  }
}

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