:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #111827;
  --panel-soft: #172033;
  --text: #e8ecf1;
  --muted: #94a3b8;
  --mint: #00ffc8;
  --pink: #ff3366;
  --gold: #ffd166;
  --line: rgba(255, 255, 255, 0.12);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(0, 255, 200, 0.12), transparent 28rem),
    radial-gradient(circle at 85% 20%, rgba(255, 51, 102, 0.11), transparent 26rem),
    var(--bg);
  color: var(--text);
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.home-view,
.question-view,
.loading-view,
.result-view {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.result-view {
  padding-bottom: 104px;
}

.home-view {
  width: min(390px, 100%);
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: 0;
  position: relative;
  overflow-x: hidden;
  padding: clamp(34px, 9svh, 72px) 22px;
}

.hero-copy {
  max-width: 760px;
  width: 100%;
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: clamp(8px, 1.8svh, 14px);
}

.eyebrow {
  color: var(--mint);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0;
  margin: 0 0 8px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.home-title {
  display: grid;
  gap: 2px;
  line-height: 0.9;
  width: 100%;
  margin-bottom: clamp(16px, 3.5svh, 28px);
}

.home-title span {
  display: block;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
}

.title-small {
  color: #e8ecf1;
  font-size: clamp(40px, 11.2vw, 54px);
}

.title-main {
  color: transparent;
  background:
    linear-gradient(92deg, #fff4f4 0%, #ffb3a7 28%, #ff4d6d 62%, #b91c1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: clamp(58px, 17.4vw, 78px);
  filter: drop-shadow(0 0 18px rgba(255, 51, 102, 0.22));
}

.subtitle {
  color: var(--text);
  font-size: clamp(18px, 4.8vw, 22px);
  line-height: 1.22;
  margin-bottom: clamp(8px, 2svh, 16px);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-name {
  color: var(--gold);
  font-size: clamp(18px, 4.8vw, 23px);
  margin-bottom: clamp(30px, 6.8svh, 62px);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ease-note {
  max-width: 680px;
  color: #c9d4e5;
  font-size: 14px;
  line-height: 1.3;
  margin: clamp(20px, 4.6svh, 40px) auto 0;
  justify-self: center;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.home-cta {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  width: min(100%, 340px);
  min-height: 64px;
  border-radius: 16px;
  padding: 0 28px;
  margin-top: clamp(8px, 2svh, 18px);
  color: #07110f;
  font-size: clamp(22px, 6vw, 28px);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  background:
    linear-gradient(135deg, #00ffc8 0%, #22f0c0 46%, #ffd166 100%);
  box-shadow:
    0 18px 48px rgba(0, 255, 200, 0.24),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    inset 0 -8px 20px rgba(0, 0, 0, 0.12);
}

.home-cta::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  border: 1px solid rgba(0, 255, 200, 0.26);
  pointer-events: none;
}

.home-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 0 34%, rgba(255, 255, 255, 0.32) 48%, transparent 62% 100%);
  transform: translateX(-120%);
  animation: cta-sheen 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes cta-sheen {
  0%, 62% { transform: translateX(-120%); }
  82%, 100% { transform: translateX(120%); }
}

.fate-vault {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  width: 100%;
  max-width: 580px;
  margin: 10px 0 12px;
  min-width: 0;
}

.fate-vault > div {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(0, 255, 200, 0.22);
  background:
    linear-gradient(90deg, rgba(0, 255, 200, 0.15), rgba(255, 255, 255, 0.035) 46%, rgba(255, 51, 102, 0.14)),
    rgba(11, 17, 29, 0.86);
  border-radius: 9px;
  padding: 7px 10px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 26px rgba(0, 255, 200, 0.05),
    0 18px 48px rgba(0, 0, 0, 0.22);
  word-break: break-word;
}

.fate-vault > div::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: translateX(-130%);
  animation: vault-scan 4.8s infinite;
}

.fate-vault > div::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  pointer-events: none;
}

.fate-vault span,
.fate-vault em {
  display: inline;
  font-style: normal;
  line-height: 1.22;
  position: relative;
  z-index: 1;
}

.fate-vault span {
  color: #ffffff;
  font-size: 15px;
  font-weight: 850;
  text-shadow:
    0 0 14px rgba(0, 255, 200, 0.24),
    0 1px 0 rgba(0, 0, 0, 0.8);
}

.fate-vault em {
  color: var(--muted);
  font-size: 11px;
}

.fate-vault em::before {
  content: " / ";
  color: rgba(255, 255, 255, 0.34);
}

@keyframes vault-scan {
  0%, 56% { transform: translateX(-130%); }
  76%, 100% { transform: translateX(130%); }
}

.meta-row span,
.badge-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--text);
}

.primary-action,
.ghost-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
}

.primary-action {
  background: var(--mint);
  color: #03110e;
  font-weight: 800;
  box-shadow: 0 14px 32px rgba(0, 255, 200, 0.22);
}

.secondary-action {
  background: var(--gold);
  color: #171006;
  box-shadow: 0 14px 32px rgba(255, 209, 102, 0.18);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--line);
}

.ghost-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.social-note {
  border-left: 3px solid var(--pink);
  color: var(--muted);
  padding-left: 12px;
  max-width: 720px;
  font-size: 13px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.social-note p {
  margin-bottom: 4px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  margin-bottom: 28px;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--pink));
}

.question-card,
.result-card {
  background: rgba(17, 24, 39, 0.86);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.question-card {
  padding: clamp(22px, 5vw, 46px);
}

.question-card h2 {
  font-size: clamp(24px, 5vw, 42px);
  line-height: 1.22;
}

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

.option-button {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
}

.option-button:hover {
  border-color: var(--mint);
  transform: translateY(-1px);
}

.option-button:disabled {
  cursor: default;
  opacity: 0.68;
  transform: none;
}

.option-button.is-chosen {
  border-color: var(--mint);
  background: rgba(0, 255, 200, 0.13);
}

.option-button b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 255, 200, 0.13);
  color: var(--mint);
}

.red-letter {
  color: var(--pink);
  font-weight: 800;
}

.rich-question {
  font-size: 0.68em;
  line-height: 1.7;
}

.rich-question .red-letter {
  display: inline-block;
  font-size: 1.68em;
  line-height: 1;
  margin: 0 1.5px;
  font-weight: 950;
  text-shadow:
    0 0 16px rgba(255, 51, 102, 0.78),
    0 0 28px rgba(255, 51, 102, 0.42),
    0 1px 0 rgba(0, 0, 0, 0.85);
}

.loading-view {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
}

.scanner {
  width: 92px;
  height: 92px;
  border: 2px solid var(--mint);
  border-radius: 50%;
  margin: 0 auto 24px;
  box-shadow: 0 0 28px rgba(0, 255, 200, 0.45);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(0.94); opacity: 0.6; }
  to { transform: scale(1.04); opacity: 1; }
}

.result-card {
  position: relative;
  padding: clamp(18px, 4vw, 34px);
}

.result-visual {
  position: relative;
  min-height: clamp(230px, 58vw, 460px);
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent), transparent 70%), rgba(255, 255, 255, 0.05));
  margin-bottom: 12px;
  border: 1px solid color-mix(in srgb, var(--accent), white 15%);
}

.result-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.66) saturate(0.9) contrast(1.05);
}

.result-visual img.is-missing {
  display: none;
}

.fallback-orb {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-size: clamp(42px, 12vw, 130px);
  font-weight: 900;
  color: var(--accent);
}

.result-visual img.is-missing + .fallback-orb {
  display: grid;
}

.visual-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.24) 70%, rgba(0, 0, 0, 0.66));
}

.result-title-plate {
  position: relative;
  max-width: 720px;
  border: 1px solid color-mix(in srgb, var(--accent), white 22%);
  border-radius: 14px;
  background: rgba(5, 10, 18, 0.82);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.38), inset 0 0 34px rgba(255, 255, 255, 0.04);
  padding: clamp(16px, 4vw, 28px);
  margin-bottom: 18px;
  overflow: hidden;
}

.result-title-plate .eyebrow {
  margin-bottom: 8px;
}

.result-title-plate h1 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: clamp(42px, 12vw, 92px);
  line-height: 0.92;
  white-space: nowrap;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.9),
    0 0 24px color-mix(in srgb, var(--accent), transparent 44%);
}

.result-title-plate p:last-child {
  margin: 0;
  color: var(--gold);
  font-size: clamp(18px, 4.8vw, 32px);
  font-weight: 850;
  white-space: nowrap;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.identity {
  color: var(--gold);
  font-size: 18px;
}

.quote {
  font-size: 22px;
  line-height: 1.35;
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  text-wrap: pretty;
}

.keep-punct {
  white-space: nowrap;
}

.relation-grid,
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.relation-grid div,
.two-col > div,
.script-box,
.result-section {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 14px;
}

.relation-grid div {
  display: grid;
  grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
  align-items: start;
  column-gap: 12px;
}

.relation-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.relation-grid strong {
  display: block;
  margin-top: 0;
  font-size: clamp(18px, 4.8vw, 23px);
  text-align: right;
  min-width: 0;
  width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.14;
  justify-self: stretch;
}

.relation-name {
  display: block;
  width: 100%;
  font-size: clamp(16px, 5.2vw, 21px);
  font-weight: 850;
  line-height: 1.16;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.relation-pair strong {
  display: grid;
  width: 100%;
  justify-items: stretch;
  gap: 4px;
  line-height: 1.06;
}

.relation-pair b {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: clamp(16px, 5.2vw, 21px);
  font-weight: 850;
  line-height: 1.16;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.relation-pair i {
  color: #ff8faf;
  font-style: normal;
  font-size: 0.82em;
  line-height: 1;
  justify-self: center;
}

.earned-badges {
  border: 1px solid color-mix(in srgb, var(--accent), white 18%);
  border-radius: 12px;
  padding: 14px;
  margin: 18px 0;
  background:
    radial-gradient(circle at 10% 20%, color-mix(in srgb, var(--accent), transparent 76%), transparent 12rem),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 32px rgba(255, 255, 255, 0.03);
}

.badge-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.badge-section-title span {
  color: var(--mint);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}

.badge-section-title strong {
  color: #ffffff;
  font-size: 20px;
}

.earned-badge-list,
.badge-showcase {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.earned-badge {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  border: 1px solid color-mix(in srgb, var(--accent), white 18%);
  border-radius: 12px;
  padding: 10px;
  background: rgba(5, 10, 18, 0.52);
}

.earned-badge img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border: 2px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent), transparent 64%);
}

.earned-badge span {
  color: #ffffff;
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 850;
  line-height: 1.18;
}

.badge-medal {
  position: relative;
  display: grid;
  grid-template-columns: 108px 1fr;
  align-items: center;
  gap: 16px;
  min-height: 132px;
  border: 1px solid color-mix(in srgb, var(--accent), white 18%);
  border-radius: 12px;
  padding: 14px;
  background:
    radial-gradient(circle at 18% 28%, color-mix(in srgb, var(--accent), transparent 52%), transparent 7.5rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(13, 20, 35, 0.92);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.28), inset 0 0 26px rgba(255, 255, 255, 0.04);
}

.badge-medal::before {
  content: "ACHIEVEMENT";
  position: absolute;
  top: 10px;
  right: 12px;
  color: rgba(255, 255, 255, 0.18);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}

.badge-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 1px solid color-mix(in srgb, var(--accent), white 28%);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    color-mix(in srgb, var(--accent), transparent 88%);
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent), transparent 62%);
}

.badge-frame img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
}

.badge-medal small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
}

.badge-medal span {
  display: block;
  color: var(--text);
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 850;
  line-height: 1.15;
}

.corner {
  position: absolute;
  width: 13px;
  height: 13px;
  border-color: var(--gold);
}

.corner-a {
  top: 6px;
  left: 6px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.corner-b {
  top: 6px;
  right: 6px;
  border-top: 2px solid;
  border-right: 2px solid;
}

.corner-c {
  right: 6px;
  bottom: 6px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.corner-d {
  bottom: 6px;
  left: 6px;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.script-box p {
  margin: 0 0 4px;
  color: var(--gold);
}

.radar-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 18px 0;
}

.radar-panel {
  border: 1px solid color-mix(in srgb, var(--accent), white 16%);
  border-radius: 12px;
  padding: 14px;
  margin: 0;
  background:
    radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--accent), transparent 82%), transparent 11rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    rgba(5, 10, 18, 0.58);
  box-shadow: inset 0 0 34px rgba(255, 255, 255, 0.03);
}

.radar-heading {
  display: grid;
  gap: 12px;
  margin-bottom: 8px;
}

.radar-heading span {
  color: var(--mint);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}

.radar-heading strong {
  color: #ffffff;
  font-size: 18px;
}

.radar-chart {
  display: block;
  width: min(100%, 436px);
  margin: 0 auto;
  overflow: visible;
}

.radar-grid-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.radar-axis {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1;
}

.radar-shape {
  fill: color-mix(in srgb, var(--accent), transparent 68%);
  stroke: var(--accent);
  stroke-width: 3;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent), transparent 28%));
}

.radar-dot {
  fill: var(--gold);
  stroke: #05070d;
  stroke-width: 1.5;
}

.radar-label {
  fill: #dbe7f5;
  font-size: 11.5px;
  font-weight: 750;
  text-anchor: middle;
  dominant-baseline: middle;
}

.radar-label tspan:last-child {
  fill: var(--gold);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 850;
}

.social-relations {
  border: 1px solid rgba(255, 51, 102, 0.34);
  border-radius: 12px;
  padding: 14px;
  margin: 18px 0;
  background:
    radial-gradient(circle at 8% 20%, rgba(255, 51, 102, 0.16), transparent 11rem),
    rgba(255, 255, 255, 0.04);
}

.social-relations-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.social-relations-heading span {
  color: #ff8faf;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}

.social-relations-heading strong {
  color: #ffffff;
  font-size: 20px;
}

.result-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, transparent, rgba(8, 11, 18, 0.78) 24%, rgba(8, 11, 18, 0.96));
  pointer-events: none;
}

.floating-share-button {
  width: min(420px, 100%);
  min-height: 54px;
  border-radius: 14px;
  font-size: 17px;
  pointer-events: auto;
  box-shadow:
    0 18px 44px rgba(255, 209, 102, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.share-countdown {
  width: min(420px, 100%);
  border: 1px solid rgba(255, 209, 102, 0.48);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(16, 24, 39, 0.94);
  box-shadow:
    0 18px 44px rgba(255, 209, 102, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  pointer-events: auto;
}

.share-countdown span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

.share-countdown div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.share-countdown i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--gold), #ff5c7c);
  transform-origin: left center;
  animation: share-countdown-fill 7s linear forwards;
}

@keyframes share-countdown-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.camera-flash {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: white;
  animation: flash-pop 0.5s ease-out forwards;
}

@keyframes flash-pop {
  0% { opacity: 0; }
  18% { opacity: 0.92; }
  100% { opacity: 0; }
}

.share-preview {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(2, 6, 12, 0.82);
  backdrop-filter: blur(14px);
}

.share-preview-panel {
  position: relative;
  width: min(420px, 100%);
  max-height: 94vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #101827;
  padding: 16px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  text-align: center;
}

.share-preview-panel h2 {
  margin-bottom: 8px;
  font-size: clamp(28px, 8vw, 44px);
}

.share-preview-panel p {
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

.share-preview-panel img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 12px;
  margin: 10px 0 0;
  background: #05070d;
}

.share-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.debug-layout-overlay {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 9999;
  display: grid;
  gap: 3px;
  max-width: min(320px, calc(100vw - 20px));
  padding: 10px 12px;
  border: 1px solid rgba(255, 51, 102, 0.55);
  border-radius: 10px;
  background: rgba(5, 7, 13, 0.9);
  color: #ffffff;
  font: 12px/1.3 "JetBrains Mono", ui-monospace, monospace;
}

.debug-layout-overlay strong {
  color: #ff8faf;
}

.debug-layout-overlay code {
  color: #ffd166;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .home-view {
    align-content: center;
    padding-top: clamp(42px, 10.5svh, 74px);
    padding-bottom: clamp(38px, 10svh, 70px);
  }

  .eyebrow {
    margin-bottom: 6px;
  }

  .home-title {
    margin-bottom: clamp(16px, 3.2svh, 24px);
  }

  .title-small {
    font-size: clamp(34px, 10.6vw, 46px);
  }

  .title-main {
    font-size: clamp(48px, 15vw, 66px);
  }

  .fate-vault > div {
    min-height: 40px;
  }

  .fate-vault span {
    font-size: 15px;
  }

  .earned-badge-list,
  .two-col {
    grid-template-columns: 1fr;
  }

  .social-relations-heading {
    display: grid;
    justify-content: start;
    gap: 4px;
  }

  .relation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .relation-grid div {
    min-height: 112px;
    padding: 12px;
    grid-template-columns: 1fr;
    row-gap: 8px;
    column-gap: 0;
    align-content: start;
  }

  .relation-grid strong {
    font-size: clamp(15px, 4.2vw, 18px);
    text-align: left;
  }

  .relation-pair strong {
    justify-items: start;
    gap: 2px;
  }

  .relation-pair b {
    text-align: left;
    font-size: clamp(15px, 4.2vw, 18px);
  }

  .relation-pair i {
    justify-self: start;
    font-size: 14px;
  }

  .relation-name {
    font-size: clamp(15px, 4.2vw, 18px);
  }

  .radar-panel {
    padding: 12px;
  }

  .radar-heading {
    gap: 4px;
  }

  .radar-heading span {
    font-size: 10px;
  }

  .radar-heading strong {
    font-size: 18px;
  }

  .radar-chart {
    width: min(100%, 390px);
  }

  .radar-label {
    font-size: 12px;
  }

  .radar-label tspan:last-child {
    font-size: 11.2px;
  }

  .ease-note {
    font-size: 13px;
  }

  .result-card {
    padding: 12px;
  }

  .result-visual {
    min-height: 0;
    margin-bottom: 10px;
  }

  .result-title-plate {
    padding: 14px;
    margin-bottom: 14px;
  }

  .result-title-plate h1 {
    font-size: clamp(42px, 14vw, 64px);
  }

  .result-title-plate p:last-child {
    font-size: clamp(17px, 5vw, 24px);
  }

  .meta-row {
    margin: 12px 0;
  }

  .identity {
    font-size: 16px;
  }

  .quote {
    font-size: 20px;
  }

  .floating-share-button {
    width: 100%;
  }
}

@media (max-height: 740px) {
  .home-view {
    align-content: center;
    padding-top: clamp(24px, 6.5svh, 42px);
    padding-bottom: clamp(22px, 6svh, 38px);
  }

  .social-note {
    display: none;
  }

  .subtitle {
    font-size: 16px;
  }

  .report-name {
    font-size: 17px;
    margin-bottom: 24px;
  }

  .ease-note {
    margin-top: 14px;
  }
}

@media (max-height: 640px) {
  .title-small {
    font-size: clamp(32px, 10.2vw, 40px);
  }

  .title-main {
    font-size: clamp(44px, 14.2vw, 58px);
  }

  .report-name {
    margin-bottom: 18px;
  }

  .home-cta {
    width: min(100%, 320px);
    min-height: 58px;
    font-size: clamp(20px, 5.6vw, 24px);
  }

  .ease-note {
    margin-top: 14px;
  }
}

@media (max-width: 420px) {
  .title-small {
    font-size: clamp(32px, 10vw, 42px);
  }

  .title-main {
    font-size: clamp(44px, 14vw, 60px);
  }

  .subtitle {
    font-size: clamp(16px, 4.6vw, 19px);
  }

  .report-name {
    font-size: clamp(16px, 4.8vw, 20px);
  }
}
