:root {
  --bg: #fff5f9;
  --card: #ffffff;
  --ink: #222222;
  --muted: #666666;
  --soft: #999999;
  --pink: #ff66b2;
  --blue: #66ccff;
  --purple: #cc88ff;
  --pale-pink: #ffd8e6;
  --pale-blue: #c3e8ff;
  --pale-purple: #f2daff;
  --danger-bg: #ffdad6;
  --danger: #ba1a1a;
  --gradient: linear-gradient(100deg, #ff66b2 0%, #cc88ff 55%, #66ccff 100%);
  --shadow: 6px 7px 0 #222222;
  --shadow-sm: 4px 5px 0 #222222;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: "Quicksand", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(rgba(255, 176, 208, .35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 176, 208, .35) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.screen {
  width: 100%;
  min-height: 100dvh;
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
  position: relative;
}

.screen.center {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.decor {
  position: absolute;
  z-index: 0;
  color: var(--pink);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 900;
  pointer-events: none;
  opacity: .9;
  filter: drop-shadow(3px 4px 0 var(--ink));
}

.decor.heart::before {
  content: "♡";
}

.decor.star::before {
  content: "★";
}

.decor.spark::before {
  content: "✦";
}

.float-a {
  animation: floatA 4.6s ease-in-out infinite;
}

.float-b {
  animation: floatA 5.2s ease-in-out .8s infinite reverse;
}

@keyframes floatA {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-12px) rotate(calc(var(--r, 0deg) + 7deg)); }
}

.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.hero-top {
  padding-top: 10px;
  text-align: center;
  position: relative;
  z-index: 1;
}

h1,
h2,
h3 {
  font-family: "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-title {
  font-size: clamp(38px, 11.6vw, 52px);
  font-weight: 900;
  text-shadow: 4px 5px 0 rgba(255, 176, 208, .8), 7px 7px 0 rgba(34, 34, 34, .18);
}

.subtitle {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 12px;
  border: 2px solid rgba(34, 34, 34, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  color: #5b4650;
  font-weight: 800;
  font-size: 16px;
}

.chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 4px;
}

.chip {
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  padding: 9px 15px;
  font-size: 16px;
  font-weight: 900;
}

.chip:nth-child(1) { background: var(--pale-pink); transform: rotate(-2deg); }
.chip:nth-child(2) { background: var(--pale-blue); transform: rotate(1deg); }
.chip:nth-child(3) { background: var(--pale-purple); transform: rotate(-1deg); }

.card {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.privacy-card {
  padding: 18px 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-areas:
    "icon title"
    "icon copy";
  column-gap: 12px;
  align-items: center;
}

.privacy-card::before,
.privacy-card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  opacity: .36;
}

.privacy-card::before {
  right: -36px;
  top: -34px;
  background: var(--pale-pink);
}

.privacy-card::after {
  left: -42px;
  bottom: -40px;
  background: var(--pale-blue);
}

.shield {
  grid-area: icon;
  width: 42px;
  height: 48px;
  margin: 0;
  color: #ae2270;
}

.shield svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.privacy-card h2 {
  grid-area: title;
  text-align: left;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 5px;
}

.privacy-card p {
  grid-area: copy;
  position: relative;
  z-index: 1;
  margin: 0;
  color: #564149;
  font-size: 15px;
  line-height: 1.48;
  font-weight: 900;
}

.legal {
  margin: 9px 4px 0;
  color: var(--soft);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.btn {
  border: 3px solid var(--ink);
  border-radius: 24px;
  min-height: 58px;
  padding: 14px 20px;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-weight: 900;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.btn:active {
  transform: translate(4px, 5px);
  box-shadow: 0 0 0 var(--ink);
}

.btn.primary {
  width: 100%;
  min-height: 64px;
  background: var(--gradient);
  font-family: "Plus Jakarta Sans", "PingFang SC", sans-serif;
  font-size: 27px;
}

.btn.secondary {
  color: #006689;
}

.btn.small {
  min-height: 48px;
  border-radius: 999px;
  padding: 10px 18px;
}

.btn:disabled {
  cursor: not-allowed;
  color: var(--soft);
  background: #eeeeee;
  filter: grayscale(.2);
  box-shadow: 3px 4px 0 #999999;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -28px -20px 24px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
}

.round-icon {
  width: 44px;
  height: 44px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: #ae2270;
  font-size: 24px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.brand-pill {
  justify-self: center;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  background: #fff;
  padding: 4px 18px 7px;
  color: #ae2270;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.progress-label {
  display: inline-block;
  margin-bottom: 12px;
  padding: 8px 14px;
  border: 3px solid var(--ink);
  border-radius: 9px;
  background: #fff;
  color: #ae2270;
  box-shadow: var(--shadow-sm);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 17px;
  font-weight: 900;
  transform: rotate(-2deg);
}

.progress {
  height: 20px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.progress span {
  border-right: 2px solid var(--ink);
  background: transparent;
}

.progress span:last-child {
  border-right: 0;
}

.progress span.done {
  background: linear-gradient(90deg, #ae2270, #cc88ff);
}

.question-title {
  margin: 34px 0 28px;
  padding: 28px 28px;
  transform: rotate(.8deg);
}

.question-title h1 {
  color: #ae2270;
  font-size: 34px;
  font-weight: 900;
}

.question-title p {
  margin: 12px 0 0;
  color: #564149;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 800;
}

.question-block {
  margin-bottom: 24px;
}

.question-block h2 {
  margin: 0 0 13px;
  font-size: 20px;
  font-weight: 900;
}

.range-card {
  padding: 22px;
}

.range-value {
  text-align: center;
  color: #ae2270;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 12px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--pink);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-top: 8px;
}

.options {
  display: grid;
  gap: 14px;
}

.option {
  width: 100%;
  min-height: 76px;
  text-align: left;
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 18px 18px;
  display: grid;
  grid-template-columns: 1fr 36px;
  gap: 14px;
  align-items: center;
  color: var(--ink);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .18s ease;
}

.option:nth-child(odd) {
  transform: rotate(-.5deg);
}

.option:nth-child(even) {
  transform: rotate(.45deg);
}

.option strong {
  display: block;
  font-size: 18px;
  line-height: 1.35;
}

.option small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 800;
}

.option .mark {
  width: 34px;
  height: 34px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #f0eded;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.option.selected {
  background: linear-gradient(100deg, #ff66b2, #cc88ff);
  box-shadow: 8px 8px 0 var(--ink);
}

.option.selected strong,
.option.selected small {
  color: #fff;
}

.option.selected .mark {
  background: #ae2270;
  color: #fff;
}

.option:active {
  transform: translate(4px, 5px);
  box-shadow: none;
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
}

.actions .btn {
  flex: 1;
}

.loading-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  text-align: center;
}

.crystal {
  width: 142px;
  height: 142px;
  margin: 0 auto 104px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(135deg, #ff66b2, #cc88ff);
  box-shadow: 9px 10px 0 var(--ink);
  position: relative;
  animation: glow 1.8s ease-in-out infinite;
}

.crystal::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 24px;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,.35);
  transform: rotate(-30deg);
}

.crystal::after {
  content: "✦";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 58px;
  font-weight: 900;
}

.crystal-base {
  width: 92px;
  height: 22px;
  margin: -120px auto 84px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 5px 6px 0 var(--ink);
}

@keyframes glow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.loading-screen h1 {
  font-size: 36px;
  font-weight: 900;
  text-shadow: 3px 4px 0 rgba(34,34,34,.14);
}

.loading-screen p {
  margin: 14px 0 40px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 900;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.dot {
  width: 24px;
  height: 24px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  animation: bounce 1s infinite;
}

.dot:nth-child(1) { background: var(--pink); }
.dot:nth-child(2) { background: var(--purple); animation-delay: .15s; }
.dot:nth-child(3) { background: var(--blue); animation-delay: .3s; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-16px); }
}

.result-screen {
  padding-top: 22px;
  padding-bottom: 36px;
}

.result-card {
  padding: 26px 22px;
  text-align: center;
  overflow: hidden;
}

.persona {
  font-size: 31px;
  font-weight: 900;
}

.rarity {
  display: inline-block;
  margin: 10px 0 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 900;
}

.score {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 72px;
  line-height: 1;
  font-weight: 900;
  background: linear-gradient(90deg, #ff66b2, #cc88ff);
  -webkit-background-clip: text;
  color: transparent;
}

.score span {
  font-size: 28px;
}

.summary {
  margin: 18px 0 0;
  color: #564149;
  line-height: 1.7;
  font-weight: 800;
}

.section-card {
  margin-top: 24px;
  padding: 22px 18px;
}

.section-title {
  display: inline-block;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.dim {
  margin-bottom: 18px;
}

.dim-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 900;
}

.dim-name {
  font-size: 16px;
}

.dim-percent {
  color: #ae2270;
  font-size: 13px;
}

.bar {
  height: 13px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  background: #f0eded;
}

.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff66b2, #cc88ff, #66ccff);
}

.dim p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}

.portrait {
  margin-top: 16px;
  padding: 19px 18px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: #fff;
  box-shadow: 4px 5px 0 rgba(34,34,34,.18);
}

.portrait.danger {
  background: var(--danger-bg);
}

.portrait h3 {
  color: #ae2270;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 10px;
}

.portrait:nth-child(2) h3 { color: #008ac0; }
.portrait.danger h3 { color: var(--danger); }

.portrait ul {
  margin: 0;
  padding-left: 20px;
}

.portrait li {
  margin: 8px 0;
  color: #42343a;
  line-height: 1.5;
  font-weight: 800;
}

.tips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.tip {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: start;
}

.tip-badge {
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 13px;
}

.tip:nth-child(1) .tip-badge { background: var(--pink); }
.tip:nth-child(2) .tip-badge { background: var(--blue); }
.tip:nth-child(3) .tip-badge { background: var(--purple); }

.tip strong {
  display: block;
  margin-bottom: 4px;
}

.tip p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
  font-weight: 800;
}

.ending {
  margin-top: 24px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
  font-weight: 800;
}

.result-actions {
  display: grid;
  gap: 13px;
  margin-top: 22px;
}

.share-hint {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 900;
}

.share-screen {
  display: grid;
  place-items: center;
}

.share-card {
  width: min(100%, 360px);
  aspect-ratio: 3 / 4;
  padding: 42px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: rgba(255, 245, 249, .95);
}

.share-persona {
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 12px 22px;
  font-size: 29px;
  font-weight: 900;
  transform: rotate(-2deg);
}

.share-score {
  margin: 50px 0 40px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 112px;
  font-weight: 900;
  line-height: .8;
  color: var(--pink);
  text-shadow: 5px 6px 0 var(--ink);
  -webkit-text-stroke: 2px var(--ink);
}

.share-score span {
  font-size: 38px;
  -webkit-text-stroke: 1px var(--ink);
}

.share-slogan {
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 14px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
  font-weight: 900;
}

.share-label {
  position: absolute;
  bottom: 34px;
  left: 0;
  right: 0;
  color: var(--soft);
  font-size: 15px;
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  transform: translate(-50%, 120px);
  width: min(calc(100% - 40px), 360px);
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 13px 16px;
  text-align: center;
  font-weight: 900;
  transition: transform .22s ease;
}

.toast.show {
  transform: translate(-50%, 0);
}

.fade-in {
  animation: rise .32s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 700px) {
  .app-shell {
    border-left: 1px solid rgba(34,34,34,.08);
    border-right: 1px solid rgba(34,34,34,.08);
  }
}

@media (max-width: 374px) {
  .screen {
    padding-left: 16px;
    padding-right: 16px;
  }
  .hero-title {
    font-size: 40px;
  }
  .privacy-card p {
    font-size: 18px;
  }
  .brand-pill {
    font-size: 24px;
    padding-left: 14px;
    padding-right: 14px;
  }
}
