:root {
  color-scheme: light;

  --cream-50: #fffdf8;
  --cream-100: #f8f3e9;
  --cream-200: #ede4d6;

  --ink-900: #34333d;
  --ink-700: #5d5b68;
  --ink-500: #7d7987;

  --periwinkle: #aeb8df;
  --periwinkle-deep: #7f8fc5;
  --peach: #efc4b4;
  --mint: #b8d9cc;
  --lavender: #cbbde2;
  --soft-gold: #d8bd7e;

  --glass-white: rgba(255, 255, 255, 0.56);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-shadow: rgba(95, 88, 116, 0.14);

  --radius-small: 14px;
  --radius-medium: 24px;
  --radius-large: 36px;

  --shadow-soft:
    0 24px 70px rgba(86, 79, 104, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);

  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream-100);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink-900);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang TC",
    "Noto Sans TC",
    "Microsoft JhengHei",
    sans-serif;
  line-height: 1.7;
  background:
    radial-gradient(
      circle at 12% 12%,
      rgba(174, 184, 223, 0.24),
      transparent 34%
    ),
    radial-gradient(
      circle at 88% 18%,
      rgba(239, 196, 180, 0.22),
      transparent 32%
    ),
    radial-gradient(
      circle at 82% 82%,
      rgba(184, 217, 204, 0.24),
      transparent 35%
    ),
    radial-gradient(
      circle at 18% 80%,
      rgba(203, 189, 226, 0.22),
      transparent 31%
    ),
    linear-gradient(
      rgba(248, 243, 233, 0.18),
      rgba(248, 243, 233, 0.46)
    ),
    url("assets_background/emotion-ball-background.webp")
      center top / cover no-repeat fixed;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(127, 143, 197, 0.5);
  outline-offset: 3px;
}

.ambient-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.atrium-panel {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 44px;
  opacity: 0.65;
  filter: blur(0.2px);
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.46),
      rgba(255, 255, 255, 0.12)
    );
  box-shadow:
    inset 0 0 32px rgba(255, 255, 255, 0.26),
    0 30px 80px rgba(116, 105, 145, 0.08);
  backdrop-filter: blur(22px);
}

.panel-one {
  width: 420px;
  height: 190px;
  top: 8%;
  left: -150px;
  transform: rotate(-12deg);
}

.panel-two {
  width: 500px;
  height: 230px;
  right: -210px;
  top: 34%;
  transform: rotate(11deg);
}

.panel-three {
  width: 380px;
  height: 170px;
  left: 12%;
  bottom: -80px;
  transform: rotate(5deg);
}

.pearl {
  position: absolute;
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 32% 28%,
      #ffffff 0%,
      #f2eff5 42%,
      #c7c2d7 100%
    );
  box-shadow:
    0 8px 22px rgba(84, 78, 105, 0.15),
    inset -3px -5px 9px rgba(159, 150, 180, 0.18);
  animation: float 8s ease-in-out infinite;
}

.pearl-one {
  top: 19%;
  left: 8%;
}

.pearl-two {
  top: 72%;
  right: 9%;
  width: 16px;
  height: 16px;
  animation-delay: -2s;
}

.pearl-three {
  top: 9%;
  right: 21%;
  width: 11px;
  height: 11px;
  animation-delay: -4s;
}

.crystal {
  position: absolute;
  display: block;
  width: 54px;
  height: 64px;
  clip-path: polygon(50% 0%, 92% 23%, 78% 82%, 50% 100%, 17% 80%, 7% 22%);
  opacity: 0.55;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.88),
      rgba(174, 184, 223, 0.35) 32%,
      rgba(239, 196, 180, 0.32) 61%,
      rgba(184, 217, 204, 0.48)
    );
  box-shadow: 0 20px 44px rgba(102, 92, 128, 0.14);
  animation: float 10s ease-in-out infinite;
}

.crystal-one {
  left: 4%;
  bottom: 15%;
  transform: rotate(-14deg);
}

.crystal-two {
  right: 4%;
  top: 13%;
  width: 39px;
  height: 48px;
  animation-delay: -4s;
}

.site-shell {
  width: min(100% - 28px, 790px);
  margin: 0 auto;
  padding:
    max(24px, env(safe-area-inset-top))
    0
    max(36px, env(safe-area-inset-bottom));
}

.brand-header {
  padding: 10px 4px 22px;
  text-align: center;
}

.brand-name,
.brand-location {
  margin: 0;
}

.brand-name {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.brand-location {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.glass-panel {
  border: 1px solid var(--glass-border);
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.7),
      rgba(255, 255, 255, 0.36)
    );
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(118%);
  -webkit-backdrop-filter: blur(28px) saturate(118%);
}

.app-panel {
  min-height: 520px;
  padding: clamp(24px, 5vw, 52px);
  border-radius: var(--radius-large);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--periwinkle-deep);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.3;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.35rem);
  letter-spacing: -0.045em;
}

h2 {
  margin: 0;
  font-size: clamp(1.65rem, 5vw, 2.5rem);
  letter-spacing: -0.025em;
}

h3 {
  margin: 28px 0 8px;
  font-size: 1.08rem;
}

.lead {
  max-width: 630px;
  margin: 22px 0 0;
  color: var(--ink-700);
  font-size: clamp(1rem, 2.7vw, 1.1rem);
}

.quote-line {
  margin: 28px 0;
  padding: 17px 20px;
  border-left: 4px solid rgba(127, 143, 197, 0.55);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  color: #4d4b5a;
  background: rgba(255, 255, 255, 0.39);
  font-weight: 650;
}

.disclaimer {
  margin: 22px 0 0;
  color: var(--ink-500);
  font-size: 0.84rem;
}

.progress-wrap {
  margin-bottom: 32px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  color: var(--ink-500);
  font-size: 0.82rem;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 4px rgba(90, 83, 111, 0.08);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      var(--periwinkle-deep),
      var(--lavender),
      var(--peach)
    );
  transition: width 260ms ease;
}

.question-title {
  margin-bottom: 24px;
}

.answer-list {
  display: grid;
  gap: 13px;
}

.answer-button {
  width: 100%;
  padding: 17px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 19px;
  color: var(--ink-900);
  text-align: left;
  cursor: pointer;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.72),
      rgba(255, 255, 255, 0.36)
    );
  box-shadow:
    0 10px 24px rgba(92, 84, 111, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.answer-button:hover {
  transform: translateY(-2px);
  border-color: rgba(127, 143, 197, 0.42);
  box-shadow:
    0 14px 29px rgba(92, 84, 111, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.answer-button.is-selected {
  border-color: rgba(127, 143, 197, 0.72);
  background:
    linear-gradient(
      135deg,
      rgba(222, 226, 247, 0.9),
      rgba(255, 255, 255, 0.64)
    );
  box-shadow:
    0 13px 29px rgba(92, 84, 111, 0.12),
    inset 0 0 0 2px rgba(127, 143, 197, 0.12);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform var(--transition),
    opacity var(--transition),
    box-shadow var(--transition);
}

.primary-button {
  border: 1px solid rgba(113, 128, 184, 0.22);
  color: #fff;
  background:
    linear-gradient(
      135deg,
      #7989bd,
      #9687bd 55%,
      #c398aa
    );
  box-shadow: 0 12px 25px rgba(105, 111, 163, 0.25);
}

.secondary-button {
  border: 1px solid rgba(127, 143, 197, 0.25);
  color: var(--ink-900);
  background: rgba(255, 255, 255, 0.56);
}

.text-button {
  border: 0;
  color: var(--ink-700);
  background: transparent;
}

.primary-button:hover,
.secondary-button:hover,
.text-button:hover {
  transform: translateY(-2px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

.orb-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 390px);
  min-height: 300px;
  margin: 4px auto 28px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 42px;
  background:
    radial-gradient(
      circle at 50% 38%,
      rgba(255, 255, 255, 0.82),
      rgba(255, 255, 255, 0.16) 65%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 22px 55px rgba(83, 78, 103, 0.09);
  overflow: hidden;
}

.orb-stage::before,
.orb-stage::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 12px 27px rgba(91, 84, 110, 0.1);
}

.orb-stage::before {
  width: 18px;
  height: 18px;
  left: 18%;
  top: 24%;
}

.orb-stage::after {
  width: 10px;
  height: 10px;
  right: 21%;
  bottom: 26%;
}

.orb {
  --orb-a: #aeb8df;
  --orb-b: #efc4b4;
  --orb-c: #b8d9cc;

  position: relative;
  width: 178px;
  aspect-ratio: 1;
  border-radius: 44% 56% 51% 49% / 48% 43% 57% 52%;
  background:
    radial-gradient(
      circle at 34% 28%,
      rgba(255, 255, 255, 0.98),
      rgba(255, 255, 255, 0.48) 18%,
      transparent 29%
    ),
    linear-gradient(
      145deg,
      var(--orb-a),
      var(--orb-b) 54%,
      var(--orb-c)
    );
  box-shadow:
    0 33px 54px rgba(78, 73, 97, 0.2),
    inset 17px 15px 28px rgba(255, 255, 255, 0.42),
    inset -20px -24px 34px rgba(75, 67, 100, 0.15);
  animation: orb-breathe 5s ease-in-out infinite;
}

.result-orb-image {
  position: absolute;
  z-index: 2;
  width: min(82%, 300px);
  height: min(82%, 300px);
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 24px 26px rgba(78, 73, 97, 0.18));
  transition: opacity 240ms ease;
}

.orb-stage.has-image .result-orb-image {
  opacity: 1;
}

.orb-stage.has-image .orb {
  opacity: 0;
}

.orb::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.42);
  filter: blur(0.3px);
}

.orb-label {
  position: absolute;
  bottom: 22px;
  color: var(--ink-500);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.orb.seed-0 {
  --orb-a: #e9e3fb;
  --orb-b: #aeb8df;
  --orb-c: #fff2d4;
}

.orb.seed-1 {
  --orb-a: #b3c5d8;
  --orb-b: #8fa3bf;
  --orb-c: #d6bfdc;
}

.orb.seed-2 {
  --orb-a: #e6b7ca;
  --orb-b: #aeb8df;
  --orb-c: #f1cfaa;
}

.orb.seed-3 {
  --orb-a: #c8b6db;
  --orb-b: #9faed3;
  --orb-c: #dabdb5;
}

.orb.seed-4 {
  --orb-a: #dbeaf0;
  --orb-b: #cfd9ec;
  --orb-c: #f4e8df;
}

.orb.seed-5 {
  --orb-a: #f2c1d1;
  --orb-b: #f4d6c8;
  --orb-c: #c7dcd6;
}

.orb.seed-6 {
  --orb-a: #c3d6ea;
  --orb-b: #d8c7e8;
  --orb-c: #fff1be;
  clip-path: polygon(50% 0%, 100% 73%, 70% 100%, 30% 100%, 0 73%);
  border-radius: 0;
}

.orb.seed-7 {
  --orb-a: #bdd2dc;
  --orb-b: #d0c2e3;
  --orb-c: #f3d1bf;
  border-radius: 28%;
}

.orb.seed-8 {
  --orb-a: #f4d995;
  --orb-b: #dcae77;
  --orb-c: #f0c8ae;
}

.orb.seed-9 {
  --orb-a: #e8aebc;
  --orb-b: #e8c376;
  --orb-c: #aebde7;
}

.result-section {
  margin-top: 28px;
}

.result-section p {
  margin: 8px 0 0;
  color: var(--ink-700);
}

.strength-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.strength-list li {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: var(--ink-700);
  background: rgba(255, 255, 255, 0.45);
  font-size: 0.88rem;
}

.balance-card,
.oya-note,
.nearby-result {
  margin-top: 20px;
  padding: 19px 20px;
  border-radius: var(--radius-medium);
}

.balance-card {
  border: 1px solid rgba(184, 217, 204, 0.55);
  background: rgba(221, 239, 232, 0.42);
}

.oya-note {
  border: 1px solid rgba(203, 189, 226, 0.5);
  background: rgba(232, 224, 242, 0.42);
}

.nearby-result {
  color: var(--ink-700);
  background: rgba(255, 255, 255, 0.38);
}

.cta-grid {
  display: grid;
  gap: 13px;
  margin-top: 28px;
}

.cta-card {
  padding: 19px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-medium);
  background: rgba(255, 255, 255, 0.4);
}

.cta-card h3 {
  margin-top: 0;
}

.cta-card p {
  margin: 5px 0 16px;
  color: var(--ink-700);
  font-size: 0.94rem;
}

.site-footer {
  padding: 25px 12px 4px;
  color: var(--ink-500);
  text-align: center;
  font-size: 0.77rem;
}

.site-footer p {
  margin: 3px 0;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  width: min(calc(100% - 32px), 430px);
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  color: var(--ink-900);
  text-align: center;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 40px rgba(74, 69, 91, 0.18);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.noscript-message {
  margin: 40px auto;
  max-width: 600px;
  padding: 24px;
  text-align: center;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-12px) rotate(4deg);
  }
}

@keyframes orb-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-6px) scale(1.018);
  }
}

@media (min-width: 700px) {
  .cta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .site-shell {
    width: min(100% - 18px, 790px);
  }

  .app-panel {
    min-height: 480px;
    padding: 23px 19px;
    border-radius: 28px;
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .text-button {
    width: 100%;
  }

  .orb-stage {
    min-height: 260px;
  }

  .orb {
    width: 150px;
  }

  body[data-page="quiz"] .site-shell {
    display: grid;
    place-items: center;
    width: min(100% - 12px, 790px);
    min-height: 100dvh;
    padding:
      max(6px, env(safe-area-inset-top))
      0
      max(6px, env(safe-area-inset-bottom));
  }

  body[data-page="quiz"] .brand-header {
    display: none;
  }

  body[data-page="quiz"] .brand-name {
    font-size: 0.78rem;
  }

  body[data-page="quiz"] .brand-location,
  body[data-page="quiz"] .site-footer,
  body[data-page="quiz"] .eyebrow {
    display: none;
  }

  body[data-page="quiz"] .app-panel {
    width: 100%;
    min-height: 0;
    padding: 14px;
    border-radius: 22px;
  }

  body[data-page="quiz"] .progress-wrap {
    margin-bottom: 10px;
  }

  body[data-page="quiz"] .progress-meta {
    margin-bottom: 5px;
    font-size: 0.72rem;
  }

  body[data-page="quiz"] .progress-track {
    height: 6px;
  }

  body[data-page="quiz"] .question-title {
    margin-bottom: 12px;
    font-size: clamp(1.32rem, 5.9vw, 1.62rem);
    line-height: 1.3;
  }

  body[data-page="quiz"] .answer-list {
    gap: 8px;
  }

  body[data-page="quiz"] .answer-button {
    min-height: 53px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 1.06rem;
    line-height: 1.45;
  }

  body[data-page="quiz"] .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
  }

  body[data-page="quiz"] .primary-button,
  body[data-page="quiz"] .secondary-button {
    min-height: 48px;
    padding: 10px;
  }
}

@media (max-width: 520px) and (max-height: 720px) {
  body[data-page="quiz"] .brand-header {
    display: none;
  }

  body[data-page="quiz"] .app-panel {
    padding: 12px 14px;
    border-radius: 19px;
  }

  body[data-page="quiz"] .progress-wrap {
    margin-bottom: 8px;
  }

  body[data-page="quiz"] .question-title {
    margin-bottom: 9px;
    font-size: 1.28rem;
    line-height: 1.3;
  }

  body[data-page="quiz"] .answer-list {
    gap: 7px;
  }

  body[data-page="quiz"] .answer-button {
    min-height: 51px;
    padding: 10px 12px;
    font-size: 1.02rem;
    line-height: 1.42;
  }

  body[data-page="quiz"] .action-row {
    margin-top: 10px;
  }

  body[data-page="quiz"] .primary-button,
  body[data-page="quiz"] .secondary-button {
    min-height: 46px;
    padding: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

