:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #6d7b82;
  --paper: #fbfbf6;
  --foam: #f2fbf8;
  --line: #c7d9da;
  --deep: #15374a;
  --reef: #237783;
  --kelp: #4f8f5f;
  --coral: #e85f59;
  --sun: #f0c94b;
  --lilac: #9e91cf;
  --shadow: 0 24px 60px rgba(28, 72, 84, 0.13);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 9%, rgba(240, 201, 75, 0.18), transparent 26%),
    radial-gradient(circle at 86% 18%, rgba(232, 95, 89, 0.13), transparent 27%),
    linear-gradient(180deg, #f7fcfb 0%, #ffffff 46%, #fdfdf9 100%);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(21, 55, 74, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(21, 55, 74, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 76%);
}

button {
  font: inherit;
}

.lang-toggle {
  position: fixed;
  z-index: 10;
  top: 14px;
  right: 14px;
  min-width: 54px;
  min-height: 34px;
  border: 1px solid rgba(23, 33, 38, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #4e5c62;
  box-shadow: 0 8px 24px rgba(28, 72, 84, 0.08);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  backdrop-filter: blur(14px);
}

body.is-result-view .lang-toggle {
  display: none;
}

.app {
  width: min(100%, 820px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 18px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

body.is-result-view .app {
  width: min(100%, 438px);
  padding: 14px 26px;
  display: block;
}

.view {
  display: none;
  width: 100%;
}

.view.is-active {
  display: block;
}

.view-home {
  text-align: center;
}

.brand-lockup {
  margin: 0 auto 12px;
}

.mini-label {
  margin: 0 0 8px;
  color: var(--reef);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  color: #17374a;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 88px;
  font-weight: 760;
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 0 3px 0 rgba(240, 201, 75, 0.72), 0 18px 34px rgba(21, 55, 74, 0.14);
}

.reef-wall {
  width: min(100%, 446px);
  margin: 16px auto 24px;
  display: grid;
  gap: 9px;
  overflow: hidden;
  padding: 4px 0;
  contain: paint;
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.reef-row {
  width: 100%;
  overflow: hidden;
  contain: paint;
}

.reef-track {
  width: max-content;
  display: flex;
  gap: 9px;
  animation: reef-slide var(--duration, 22s) linear infinite;
}

.reef-row.is-reverse .reef-track {
  animation-name: reef-slide-reverse;
}

@keyframes reef-slide {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes reef-slide-reverse {
  from {
    transform: translateX(-50%);
  }

  to {
    transform: translateX(0);
  }
}

.home-copy {
  width: min(100%, 510px);
  margin: 0 auto;
}

.home-copy h2,
.question-title,
.result-name {
  margin: 0;
  font-size: 32px;
  line-height: 1.18;
  font-weight: 880;
}

.home-copy p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 720;
}

.primary-action,
.nav-action,
.secondary-action {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  padding: 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 850;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, opacity 160ms ease;
}

.primary-action {
  width: min(100%, 360px);
  margin-top: 22px;
  background: #16384b;
  color: #ffffff;
  box-shadow: 0 10px 0 rgba(22, 56, 75, 0.18), 0 18px 36px rgba(22, 56, 75, 0.14);
}

.quiz-nav {
  width: 100%;
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.nav-action {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid transparent;
  font-size: 14px;
  box-shadow: none;
  overflow: hidden;
}

.nav-action.is-primary {
  background: linear-gradient(135deg, #194b5d, #123043);
  color: #ffffff;
  box-shadow: 0 7px 0 rgba(22, 56, 75, 0.14), 0 14px 28px rgba(22, 56, 75, 0.12);
}

.nav-action.is-secondary {
  border-color: rgba(109, 123, 130, 0.24);
  background: rgba(255, 255, 255, 0.78);
  color: #4e5c62;
  box-shadow: inset 0 -2px 0 rgba(109, 123, 130, 0.09), 0 10px 22px rgba(28, 72, 84, 0.05);
}

.nav-action.is-secondary::before,
.nav-action.is-primary::after {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: 0 0 26px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.nav-action.is-secondary::before {
  content: "<";
  background: rgba(35, 119, 131, 0.11);
  color: #206a74;
}

.nav-action.is-primary::after {
  content: ">";
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.primary-action:hover,
.secondary-action:hover,
.nav-action:hover,
.option-button:hover,
.lang-toggle:hover {
  transform: translateY(-2px);
}

.primary-action:active,
.secondary-action:active,
.nav-action:active,
.option-button:active,
.lang-toggle:active {
  transform: translateY(1px);
}

.nav-action:disabled {
  cursor: not-allowed;
  background: #d9e2e0;
  color: rgba(49, 45, 42, 0.52);
  box-shadow: none;
  opacity: 0.75;
}

.nav-action:disabled::before,
.nav-action:disabled::after {
  background: rgba(255, 255, 255, 0.28);
  color: rgba(49, 45, 42, 0.42);
}

.play-mark {
  width: 28px;
  height: 28px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.play-mark::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 7px;
  border-left: 9px solid currentColor;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.save-mark {
  width: 18px;
  height: 20px;
  border: 2px solid currentColor;
  border-top-width: 6px;
  border-radius: 4px;
  position: relative;
}

.save-mark::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 4px;
  background: currentColor;
}

.fine-print {
  margin: 36px 0 0;
  color: #819098;
  font-size: 13px;
  font-weight: 820;
}

.quiz-shell {
  width: min(100%, 448px);
  margin: 0 auto;
}

.quiz-topbar {
  margin-bottom: 32px;
}

.progress-wrap {
  display: grid;
  gap: 12px;
  text-align: center;
}

.progress-text {
  color: var(--muted);
  font-size: 14px;
  font-weight: 820;
}

.progress-track {
  height: 4px;
  border-radius: 99px;
  background: rgba(109, 123, 130, 0.18);
  overflow: hidden;
}

.progress-fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--reef), var(--sun), var(--coral), var(--lilac));
  transition: width 240ms ease;
}

.question-meta {
  min-height: 60px;
  margin-bottom: 24px;
  padding: 8px 14px 8px 8px;
  border: 1px solid rgba(109, 123, 130, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(12px);
}

.question-kicker {
  color: #b44d4c;
  font-size: 14px;
  font-weight: 840;
}

.question-title {
  margin-bottom: 10px;
}

.question-body {
  margin: 0 0 28px;
  color: #5d6b72;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 690;
}

.option-list {
  display: grid;
  gap: 12px;
}

.option-button {
  min-height: 62px;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid rgba(109, 123, 130, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-align: left;
  box-shadow: 0 10px 26px rgba(28, 72, 84, 0.06);
  backdrop-filter: blur(12px);
}

.option-letter {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(240, 201, 75, 0.22);
  font-size: 18px;
  line-height: 1;
}

.option-text {
  display: block;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.option-button.is-selected {
  border-color: rgba(35, 119, 131, 0.78);
  background: rgba(242, 251, 248, 0.96);
  box-shadow: 0 9px 0 rgba(35, 119, 131, 0.15);
}

.fish-avatar {
  width: 82px;
  aspect-ratio: 1;
  border: 1px solid rgba(109, 123, 130, 0.18);
  border-radius: 8px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(232, 247, 246, 0.72));
  box-shadow: 0 12px 26px rgba(28, 72, 84, 0.08);
}

.fish-avatar::before,
.fish-avatar::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(35, 119, 131, 0.15);
}

.fish-avatar::before {
  width: 9px;
  height: 9px;
  right: 18%;
  top: 18%;
}

.fish-avatar::after {
  width: 5px;
  height: 5px;
  right: 30%;
  top: 30%;
}

.meta-fish {
  width: 44px;
  flex: 0 0 44px;
}

.result-avatar {
  width: 168px;
  margin: 0 auto 28px;
  box-shadow: 0 18px 44px rgba(28, 72, 84, 0.13);
}

.reef-fish {
  width: 78px;
  flex: 0 0 78px;
}

.fish-symbol {
  width: 78%;
  height: 62%;
  position: relative;
  z-index: 1;
  transform: rotate(var(--tilt, 0deg));
}

.fish-body {
  position: absolute;
  left: 24%;
  top: 23%;
  width: 54%;
  height: 52%;
  border-radius: var(--body-radius, 50% 58% 52% 48%);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), transparent 46%),
    var(--body);
  box-shadow: inset -8px -3px 0 rgba(0, 0, 0, 0.08), 0 6px 12px rgba(21, 55, 74, 0.12);
}

.fish-tail {
  position: absolute;
  left: 8%;
  top: 27%;
  width: 26%;
  height: 46%;
  clip-path: polygon(0 0, 100% 50%, 0 100%, 24% 50%);
  background: var(--tail);
  box-shadow: inset -3px 0 0 rgba(255, 255, 255, 0.16);
}

.fish-fin {
  position: absolute;
  background: var(--fin);
}

.fish-fin.top {
  left: 42%;
  top: 10%;
  width: 25%;
  height: 25%;
  clip-path: polygon(0 100%, 58% 0, 100% 100%);
}

.fish-fin.bottom {
  left: 45%;
  top: 67%;
  width: 22%;
  height: 20%;
  clip-path: polygon(0 0, 100% 0, 42% 100%);
}

.fish-eye {
  position: absolute;
  right: 16%;
  top: 39%;
  width: 8%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #111111;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.78);
}

.fish-mouth {
  position: absolute;
  right: 7%;
  top: 50%;
  width: 10%;
  height: 8%;
  border-top: 2px solid rgba(23, 33, 38, 0.55);
  border-radius: 50%;
}

.fish-pattern {
  position: absolute;
  inset: 29% 27% 31% 38%;
  background: var(--stripe);
  opacity: var(--pattern-opacity, 0.9);
  clip-path: var(--pattern-shape, polygon(0 0, 30% 0, 18% 100%, 0 100%));
}

.shape-long .fish-body {
  width: 60%;
  height: 38%;
  top: 31%;
  border-radius: 999px;
}

.shape-long .fish-tail {
  top: 30%;
  height: 40%;
}

.shape-round .fish-body {
  width: 52%;
  height: 58%;
  top: 20%;
  border-radius: 58% 44% 48% 56%;
}

.shape-puffer .fish-body {
  width: 54%;
  height: 58%;
  top: 20%;
  border-radius: 50%;
}

.shape-puffer .fish-pattern {
  inset: 36% 30% 35% 36%;
  clip-path: polygon(0 0, 16% 0, 16% 100%, 0 100%, 42% 0, 58% 0, 58% 100%, 42% 100%, 84% 0, 100% 0, 100% 100%, 84% 100%);
}

.shape-ray .fish-body {
  left: 27%;
  top: 25%;
  width: 50%;
  height: 44%;
  border-radius: 54% 54% 48% 48%;
  clip-path: polygon(50% 0, 100% 44%, 66% 100%, 50% 72%, 34% 100%, 0 44%);
}

.shape-ray .fish-tail {
  left: 14%;
  top: 44%;
  width: 20%;
  height: 12%;
  clip-path: polygon(0 36%, 100% 0, 100% 100%);
}

.shape-ray .fish-fin {
  display: none;
}

.shape-moon .fish-body {
  width: 50%;
  height: 62%;
  top: 18%;
  border-radius: 50%;
}

.shape-moon .fish-tail {
  left: 11%;
  top: 22%;
  height: 56%;
}

.shape-knife .fish-body {
  width: 62%;
  height: 30%;
  top: 36%;
  border-radius: 999px 58% 58% 999px;
}

.shape-knife .fish-fin.top {
  top: 64%;
  left: 29%;
  width: 42%;
  height: 16%;
  clip-path: polygon(0 0, 100% 0, 74% 100%, 18% 100%);
}

.view-result {
  display: none;
  width: 100%;
  max-width: 354px;
  margin: 0 auto;
}

.view-result.is-active {
  display: block;
}

.result-card {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.result-topline {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #9aa6ab;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 650;
}

.result-kicker {
  margin: 0 0 8px;
  color: #9aa6ab;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 850;
  text-align: center;
}

.result-name {
  max-width: 100%;
  margin: 0 auto;
  color: #111111;
  font-size: 31px;
  line-height: 1.1;
  font-weight: 920;
  overflow-wrap: anywhere;
}

.result-subtitle {
  margin: 8px 0 0;
  color: #9aa6ab;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 850;
}

.result-punchline {
  margin: 30px 0 0;
  padding: 15px 18px;
  border-radius: 8px;
  background: #f3f7f6;
  color: #1d2d33;
  font-size: 18px;
  line-height: 1.48;
  font-weight: 540;
  text-align: left;
  position: relative;
}

.result-punchline::before {
  content: '"';
  position: absolute;
  left: 16px;
  top: -8px;
  color: rgba(0, 0, 0, 0.07);
  font-size: 58px;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
}

.result-tags {
  position: relative;
}

.tag-heading {
  margin: 24px 0 12px;
  color: #9aa6ab;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 850;
  text-align: left;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  padding-right: 96px;
}

.tag-row span {
  padding: 8px 13px;
  border-radius: 8px;
  background: #f3f7f6;
  color: #171717;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 850;
}

.tag-row span:nth-child(2n) {
  background: #eaf5ef;
}

.tag-row span:nth-child(3n) {
  background: #fff2cd;
}

.result-mbti {
  min-height: 35px;
  margin: 0;
  padding: 0 12px;
  border: 2px solid rgba(232, 95, 89, 0.56);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(190, 68, 63, 0.86);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 10px;
  bottom: 4px;
  transform: rotate(-12deg);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(232, 95, 89, 0.18);
  opacity: 0.92;
  pointer-events: none;
}

.result-desc {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid #e8eeed;
  color: #435258;
  font-size: 17px;
  line-height: 1.58;
  font-weight: 430;
  text-align: left;
  overflow-wrap: anywhere;
}

.result-actions {
  width: 100%;
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.result-actions .primary-action,
.result-actions .secondary-action {
  min-height: 56px;
  padding-inline: 22px;
}

.primary-action.compact {
  width: 100%;
  margin: 0;
  background: #111111;
  color: #ffffff;
  box-shadow: none;
  font-size: 18px;
}

.secondary-action {
  border: 1px solid rgba(109, 123, 130, 0.22);
  background: #ffffff;
  color: #4e5c62;
}

@media (max-width: 620px) {
  .app {
    padding: 26px 16px;
  }

  body.is-result-view .app {
    padding: 12px 22px;
  }

  h1 {
    font-size: 54px;
  }

  .home-copy h2,
  .question-title {
    font-size: 26px;
  }

  .reef-wall {
    width: min(100%, 352px);
    margin-top: 12px;
    gap: 8px;
  }

  .reef-track {
    gap: 8px;
  }

  .reef-fish {
    width: 70px;
    flex-basis: 70px;
  }

  .quiz-shell {
    width: 100%;
  }

  .result-avatar {
    width: 150px;
    margin-bottom: 24px;
  }

  .result-name {
    font-size: 27px;
  }
}

@media (min-width: 760px) and (max-height: 780px) {
  .app {
    padding-block: 18px;
  }

  h1 {
    font-size: 76px;
  }

  .reef-wall {
    width: min(100%, 390px);
    margin: 10px auto 16px;
  }

  .reef-fish {
    width: 72px;
    flex-basis: 72px;
  }

  .home-copy h2 {
    font-size: 28px;
  }

  .home-copy p {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.5;
  }

  .primary-action {
    min-height: 54px;
    margin-top: 18px;
  }

  .quiz-nav {
    margin-top: 18px;
  }

  .fine-print {
    margin-top: 26px;
  }
}

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