:root {
  color-scheme: light;
  --ink: #1e1720;
  --muted: #5e5662;
  --paper: #fff3dc;
  --panel: #ffffff;
  --line: #8a6042;
  --rose: #9f2144;
  --rose-dark: #5c1730;
  --blue: #243b67;
  --mint: #e7f6ed;
  --gold: #f0c84b;
  --stone: #574b55;
  --wood: #6a3f28;
  --shadow: 8px 8px 0 rgba(30, 23, 32, 0.82);
  --ui-title-bg: url("./assets/ui/game-title-bg-v2.webp");
  --ui-quiz-bg: url("./assets/ui/game-quiz-bg-v2.webp");
  --ui-result-bg: url("./assets/ui/game-result-bg.webp");
  --ui-kit: url("./assets/ui/game-ui-kit.webp");
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow: hidden;
}

html,
body {
  width: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family:
    "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui,
    sans-serif;
  background:
    radial-gradient(circle at 50% 0%, rgba(159, 33, 68, 0.38), transparent 34%),
    radial-gradient(circle at 10% 72%, rgba(240, 200, 75, 0.16), transparent 28%),
    linear-gradient(180deg, #170e22, #2b142a 48%, #120a18);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 6%, rgba(240, 200, 75, 0.12) 6% 6.6%, transparent 6.6% 93.4%, rgba(240, 200, 75, 0.12) 93.4% 94%, transparent 94%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.34), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.34));
}

button,
a {
  font: inherit;
}

.app-shell {
  position: relative;
  width: min(100%, 440px);
  height: 100dvh;
  margin: 0 auto;
  display: block;
  overflow: hidden;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background: #120a18;
  box-shadow: 0 0 0 1px rgba(240, 200, 75, 0.28), 0 0 80px rgba(0, 0, 0, 0.7);
}

.hero,
.quiz,
.analyzing,
.result {
  width: 100%;
}

.app-screen {
  position: absolute;
  inset: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  min-height: 100%;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  pointer-events: none;
  transition: opacity 360ms ease, transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app-screen.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hero {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: stretch;
  padding: clamp(14px, 4vw, 24px);
  background: #08040c;
  border: 0;
  box-shadow: 0 0 0 2px rgba(240, 200, 75, 0.32) inset;
}

.hero-ensemble {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  transform: translateX(-50%);
  filter: saturate(1.08) contrast(1.04);
  pointer-events: none;
  user-select: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 4, 12, 0.08) 0, transparent 28%, transparent 72%, rgba(8, 4, 12, 0.28) 100%);
}

.ambient-canvas,
.magic-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-copy,
.quiz,
.result-card {
  position: relative;
}

.hero-copy::before,
.quiz::before,
.result-card::before {
  content: none;
}

.hero-copy {
  z-index: 1;
  align-self: end;
  padding: clamp(14px, 4vw, 22px) clamp(16px, 5vw, 28px) clamp(58px, 10dvh, 78px);
  text-align: center;
  color: #fff3dc;
  background:
    linear-gradient(180deg, rgba(18, 8, 26, 0.04), rgba(18, 8, 26, 0.42) 46%, rgba(18, 8, 26, 0.64));
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  animation: panelRise 780ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-character-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.hero-character-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  color: #fff3dc;
  text-decoration: none;
  background: rgba(30, 23, 32, 0.68);
  border: 1px solid rgba(240, 200, 75, 0.58);
  border-radius: 999px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.34);
  font-size: 0.78rem;
  font-weight: 900;
}

.hero-title-lockup {
  position: relative;
  z-index: 2;
  align-self: start;
  width: min(94%, 410px);
  margin: 0 auto;
  padding: clamp(12px, 3dvh, 24px) 12px 14px;
  text-align: center;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(22, 9, 28, 0.82), rgba(68, 22, 48, 0.74)),
    linear-gradient(90deg, transparent, rgba(240, 200, 75, 0.18), transparent);
  border: 2px solid rgba(240, 200, 75, 0.72);
  box-shadow:
    0 8px 0 rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 247, 220, 0.18) inset,
    0 0 24px rgba(0, 0, 0, 0.58);
  clip-path: polygon(4% 0, 96% 0, 100% 14%, 100% 86%, 96% 100%, 4% 100%, 0 86%, 0 14%);
  animation: panelRise 760ms 80ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-kicker {
  position: relative;
  width: fit-content;
  margin: 0 auto 6px;
  padding: 5px 14px 6px;
  color: #2a1123;
  background: linear-gradient(90deg, rgba(255, 247, 215, 0.94), rgba(240, 200, 75, 0.96), rgba(255, 247, 215, 0.94));
  border: 2px solid rgba(92, 23, 48, 0.72);
  box-shadow: 0 4px 0 rgba(42, 13, 28, 0.74), 0 0 18px rgba(240, 200, 75, 0.5);
  font-size: clamp(0.72rem, 2.8vw, 0.92rem);
  font-weight: 900;
  letter-spacing: 0.1em;
}

.hero-kicker::before,
.hero-kicker::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f0c84b);
}

.hero-kicker::before {
  right: 100%;
}

.hero-kicker::after {
  left: 100%;
  transform: scaleX(-1);
}

.legal-menu {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 7px 12px;
  color: rgba(255, 243, 220, 0.84);
  background: rgba(13, 6, 19, 0.58);
  border: 1px solid rgba(240, 200, 75, 0.38);
  transform: translateX(-50%);
  backdrop-filter: blur(6px);
}

.legal-link {
  min-height: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-link:focus-visible,
.legal-close:focus-visible,
.home-button:focus-visible {
  outline: 2px solid #fff7dc;
  outline-offset: 3px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f0c84b;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.52);
}

.quiz .eyebrow {
  color: #8d1436;
  text-align: center;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  position: relative;
  display: grid;
  gap: 0;
  width: fit-content;
  margin: 0 auto;
  color: #fff0a8;
  font-family:
    "Yu Mincho", "Hiragino Mincho ProN", "Yu Gothic UI", serif;
  font-size: clamp(2.34rem, 10.8vw, 4.15rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: 0.04em;
  text-shadow:
    0 1px 0 #fff9dc,
    0 3px 0 #7d1128,
    0 5px 0 #250914,
    2px 2px 0 #250914,
    -2px 2px 0 #250914;
  transform: skewX(-5deg);
}

h1::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -12px;
  right: -12px;
  top: 11%;
  bottom: 8%;
  background:
    linear-gradient(90deg, transparent, rgba(37, 9, 20, 0.94) 8%, rgba(37, 9, 20, 0.88) 92%, transparent);
  clip-path: polygon(6% 0, 94% 0, 100% 50%, 94% 100%, 6% 100%, 0 50%);
}

h1::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -4px;
  width: 38px;
  height: 38px;
  background:
    radial-gradient(circle, #fff7dc 0 12%, transparent 13%),
    conic-gradient(from 45deg, transparent 0 12%, #f0c84b 12% 18%, transparent 18% 37%, #f0c84b 37% 43%, transparent 43% 62%, #f0c84b 62% 68%, transparent 68% 87%, #f0c84b 87% 93%, transparent 93%);
  filter: drop-shadow(0 2px 0 #250914);
}

h1 span:first-child {
  display: block;
  padding-right: 0.28em;
}

h1 span:last-child {
  display: block;
  padding-left: 0.62em;
  margin-top: -0.07em;
  color: #fff7dc;
  font-size: 0.82em;
}

.lead {
  max-width: 36rem;
  margin: 0 auto 16px;
  color: #f8dfb5;
  font-size: clamp(0.88rem, 3.6vw, 1rem);
  line-height: 1.65;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.56);
}

.pixel-stage {
  display: none;
  justify-items: center;
  gap: 14px;
  color: var(--rose-dark);
  font-weight: 800;
}

.pixel-frame {
  width: min(280px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--mint);
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 var(--gold), 14px 14px 0 var(--ink);
  image-rendering: pixelated;
}

canvas {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.game-result-canvas,
.share-canvas {
  image-rendering: auto;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-weight: 800;
  border-radius: 0;
}

.primary-button {
  position: relative;
  min-width: min(100%, 310px);
  min-height: 62px;
  padding: 12px 38px 13px;
  color: #341024;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.48), transparent 35%),
    linear-gradient(180deg, #fff6cc, #f0c84b 54%, #b9852e);
  border: 0;
  clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%);
  box-shadow: none;
  font-size: clamp(1rem, 4vw, 1.18rem);
  letter-spacing: 0.08em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.76);
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.primary-button::before {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: -2;
  background: linear-gradient(90deg, #7a4b2a, #f0c84b, #fff2a8, #f0c84b, #7a4b2a);
  clip-path: inherit;
}

.primary-button::after {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: -1;
  border: 1px solid rgba(92, 23, 48, 0.42);
  clip-path: inherit;
  box-shadow: 0 0 18px rgba(240, 200, 75, 0.34) inset;
}

.primary-button span {
  position: relative;
}

.primary-button span::before,
.primary-button span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 2px;
  background: #5c1730;
}

.primary-button span::before {
  right: calc(100% + 12px);
}

.primary-button span::after {
  left: calc(100% + 12px);
}

.secondary-button {
  color: var(--ink);
  background: linear-gradient(180deg, #fff7e6, #efd4a4);
  border: 2px solid #5c1730;
}

.ghost-button {
  color: #fff3dc;
  background: rgba(36, 20, 48, 0.72);
  border: 2px solid rgba(240, 200, 75, 0.76);
}

.result-card .ghost-button {
  color: var(--rose-dark);
  background: transparent;
  border-color: var(--line);
}

.primary-button:active,
.secondary-button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.quiz {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(128px, 0.64fr) minmax(318px, 1.18fr);
  gap: clamp(8px, 1.6dvh, 14px);
  padding: clamp(14px, 3.8vw, 24px) clamp(14px, 4vw, 24px) clamp(16px, 4vw, 26px);
  background:
    radial-gradient(circle at 50% 28%, rgba(240, 200, 75, 0.13), transparent 28%),
    linear-gradient(180deg, rgba(10, 5, 16, 0.12), rgba(10, 5, 16, 0.56)),
    var(--ui-quiz-bg) center / cover no-repeat;
  border: 4px solid #05030a;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.58), 0 0 0 2px rgba(240, 200, 75, 0.45) inset;
}

.quiz.is-leaving h2,
.quiz.is-leaving .choice-button {
  animation: questionExit 220ms ease both;
}

.quiz.is-entering h2,
.quiz.is-entering .choice-button {
  animation: questionEnter 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.quiz-header {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: clamp(8px, 2.8vw, 16px);
  min-height: 0;
  margin-bottom: 0;
  padding-top: 2px;
}

.progress-wrap {
  height: 12px;
  overflow: hidden;
  background: rgba(42, 24, 61, 0.72);
  border: 2px solid #f0c84b;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--blue));
  transition: width 180ms ease;
}

.question-count {
  color: #fff3dc;
  font-weight: 800;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

.quiz > .eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 0;
  padding: 6px 10px;
  color: #fff3dc;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(25, 12, 33, 0.72);
  border: 2px solid rgba(240, 200, 75, 0.5);
}

.quiz h2 {
  position: relative;
  display: grid;
  place-items: center;
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: clamp(20px, 5vw, 30px) clamp(24px, 7vw, 38px);
  color: #3a1730;
  font-size: clamp(1.02rem, 4.3vw, 1.42rem);
  line-height: 1.48;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 247, 220, 0.82);
  overflow: hidden;
  overflow-wrap: anywhere;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse at 50% 0, rgba(255, 255, 255, 0.48), transparent 45%),
    linear-gradient(180deg, rgba(255, 249, 231, 0.96), rgba(224, 184, 119, 0.96)),
    var(--ui-kit) center / cover no-repeat;
  border: 0;
  clip-path: polygon(8% 0, 92% 0, 100% 15%, 97% 50%, 100% 85%, 92% 100%, 8% 100%, 0 85%, 3% 50%, 0 15%);
  box-shadow:
    0 8px 0 rgba(58, 24, 48, 0.66),
    0 0 0 3px rgba(240, 200, 75, 0.82) inset,
    0 0 0 1px rgba(70, 32, 28, 0.38) inset,
    0 18px 34px rgba(0, 0, 0, 0.34);
}

.quiz h2::before,
.quiz h2::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.quiz h2::before {
  inset: 0;
  background: linear-gradient(90deg, #5c1730, #f0c84b, #fff0a5, #f0c84b, #5c1730);
  clip-path: inherit;
  opacity: 0.28;
}

.quiz h2::after {
  z-index: 0;
  left: 50%;
  top: 8px;
  width: 42px;
  height: 24px;
  background:
    radial-gradient(circle, #7a1537 0 28%, transparent 29%),
    conic-gradient(from 45deg, transparent 0 11%, #c8943e 11% 22%, transparent 22% 39%, #c8943e 39% 50%, transparent 50%);
  transform: translateX(-50%);
  opacity: 0.5;
}

.choices {
  position: relative;
  display: grid;
  align-content: center;
  gap: clamp(9px, 1.7dvh, 13px);
  min-height: 0;
  margin: 0;
  padding: clamp(10px, 2dvh, 16px);
  overflow: visible;
  background:
    radial-gradient(ellipse at 50% 22%, rgba(240, 200, 75, 0.15), transparent 48%),
    linear-gradient(180deg, rgba(14, 6, 21, 0.22), rgba(14, 6, 21, 0.56));
  border: 0;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.28) inset,
    0 1px 0 rgba(240, 200, 75, 0.26) inset;
  touch-action: manipulation;
}

.choices::-webkit-scrollbar {
  display: none;
}

.choices.is-dragging {
  cursor: default;
}

.choice-roll {
  position: relative;
  min-height: 0;
  display: grid;
  align-items: stretch;
  grid-template-rows: 1fr;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 231, 145, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(12, 5, 17, 0.36), rgba(52, 19, 48, 0.24), rgba(12, 5, 17, 0.56));
  border-block: 1px solid rgba(240, 200, 75, 0.32);
}

.choice-roll::before,
.choice-roll::after {
  content: none;
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 28px;
  width: 68px;
  pointer-events: none;
}

.choice-roll::before {
  left: 0;
  background: linear-gradient(90deg, rgba(12, 6, 18, 0.92), transparent);
}

.choice-roll::after {
  right: 0;
  background: linear-gradient(270deg, rgba(12, 6, 18, 0.92), transparent);
}

.roll-nav {
  display: none;
}

.roll-nav-prev {
  left: 0;
}

.roll-nav-next {
  right: 0;
}

.choice-button {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(10px, 3vw, 14px);
  padding: clamp(13px, 3.2vw, 17px) clamp(14px, 4vw, 20px);
  color: #fff7df;
  text-align: left;
  background:
    linear-gradient(90deg, rgba(255, 240, 165, 0.18), transparent 18%, transparent 82%, rgba(255, 240, 165, 0.12)),
    radial-gradient(circle at 8% 50%, rgba(240, 200, 75, 0.28), transparent 22%),
    linear-gradient(180deg, rgba(74, 26, 62, 0.96), rgba(28, 12, 39, 0.98));
  border: 0;
  border-radius: 0;
  clip-path: polygon(5% 0, 95% 0, 100% 50%, 95% 100%, 5% 100%, 0 50%);
  cursor: pointer;
  box-shadow:
    0 5px 0 rgba(8, 4, 12, 0.72),
    0 0 0 2px rgba(240, 200, 75, 0.66) inset,
    0 0 0 1px rgba(255, 247, 220, 0.18) inset,
    0 12px 24px rgba(0, 0, 0, 0.24);
  font-weight: 900;
  line-height: 1.42;
  font-size: clamp(0.92rem, 3.8vw, 1.04rem);
  overflow: hidden;
  overflow-wrap: anywhere;
  opacity: 1;
  transform: translateY(0);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease, background 160ms ease;
  animation: choiceRise 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.choice-button:nth-child(1) {
  animation-delay: 20ms;
}

.choice-button:nth-child(2) {
  animation-delay: 80ms;
}

.choice-button:nth-child(3) {
  animation-delay: 140ms;
}

.choice-button:nth-child(4) {
  animation-delay: 200ms;
}

.choice-button::before,
.choice-button::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.choice-button::before {
  inset: 5px 8px;
  border: 1px solid rgba(255, 240, 165, 0.3);
  clip-path: inherit;
  box-shadow: 0 0 16px rgba(240, 200, 75, 0.14) inset;
}

.choice-button::after {
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 34%, rgba(255, 255, 255, 0.13) 42%, transparent 50%),
    radial-gradient(circle at 96% 50%, rgba(240, 200, 75, 0.18), transparent 18%);
  opacity: 0;
  transform: translateX(-36%);
  transition: opacity 180ms ease, transform 280ms ease;
}

.choice-button.is-active {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    0 6px 0 rgba(8, 4, 12, 0.76),
    0 0 0 2px rgba(255, 232, 129, 0.9) inset,
    0 0 24px rgba(240, 200, 75, 0.28),
    0 14px 26px rgba(0, 0, 0, 0.28);
}

.choice-button:hover,
.choice-button:focus-visible {
  border-color: #fff0a5;
  outline: 3px solid rgba(240, 200, 75, 0.32);
  filter: brightness(1.04);
}

.choice-button.is-picked {
  color: #35142b;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.42), transparent 35%),
    linear-gradient(180deg, #fff0a5, #d69e42);
  transform: translateY(1px) scale(0.99);
  filter: brightness(1.13);
  box-shadow:
    0 2px 0 rgba(92, 23, 48, 0.64),
    0 0 0 2px #fff7dc inset,
    0 0 30px rgba(240, 200, 75, 0.72);
}

.choice-button.is-picked::after,
.choice-button:hover::after,
.choice-button:focus-visible::after {
  opacity: 1;
  transform: translateX(24%);
}

.choice-card-label {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #35142b;
  background: linear-gradient(180deg, #fff3b8, #c9953e);
  border: 2px solid rgba(92, 23, 48, 0.72);
  box-shadow: 0 0 12px rgba(240, 200, 75, 0.34);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  transform: rotate(45deg);
}

.choice-card-label span {
  transform: rotate(-45deg);
}

.choice-card-text {
  position: relative;
  z-index: 1;
  color: inherit;
}

.choice-card-arrow {
  position: relative;
  z-index: 1;
  color: #f0c84b;
  font-size: 1.5rem;
  line-height: 1;
  text-shadow: 0 0 12px rgba(240, 200, 75, 0.62);
}

.choice-dots {
  display: none;
}

.choice-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  background: rgba(255, 243, 220, 0.42);
  border: 1px solid rgba(240, 200, 75, 0.68);
  cursor: pointer;
  transform: rotate(45deg);
}

.choice-dot.is-active {
  background: #f0c84b;
  box-shadow: 0 0 14px rgba(240, 200, 75, 0.72);
}

.choice-confirm {
  display: none;
}

.analyzing {
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  color: #fff3dc;
  background:
    radial-gradient(circle at 50% 42%, rgba(240, 200, 75, 0.18), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(159, 33, 68, 0.34), transparent 46%),
    var(--ui-title-bg) center / cover no-repeat;
}

.analyzing::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(13, 7, 20, 0.78);
}

.analyzing-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  padding: 28px 22px 30px;
  text-align: center;
  background: linear-gradient(180deg, rgba(37, 20, 53, 0.92), rgba(18, 8, 26, 0.95));
  border: 3px solid rgba(240, 200, 75, 0.9);
  box-shadow: 0 14px 0 rgba(0, 0, 0, 0.48), 0 0 42px rgba(240, 200, 75, 0.24);
}

.analyzing-panel h2 {
  margin: 0 0 18px;
  color: #fff3dc;
  font-size: clamp(2rem, 9vw, 3.1rem);
  line-height: 1;
  text-shadow: 0 3px 0 #5c1730;
}

.analyzing-panel p:last-child {
  margin: 18px 0 0;
  color: #f8dfb5;
  line-height: 1.8;
}

.magic-orb {
  position: relative;
  width: 168px;
  aspect-ratio: 1;
  margin: 0 auto;
  border: 3px solid #f0c84b;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 243, 220, 0.92) 0 6%, transparent 7%),
    radial-gradient(circle, rgba(181, 31, 79, 0.5), rgba(36, 20, 48, 0.2) 54%, transparent 58%);
  box-shadow: 0 0 36px rgba(240, 200, 75, 0.42), inset 0 0 30px rgba(255, 255, 255, 0.18);
  animation: orbPulse 1300ms ease-in-out infinite;
}

.magic-orb span {
  position: absolute;
  inset: 16px;
  border: 2px solid rgba(240, 200, 75, 0.72);
  border-radius: 50%;
  animation: spin 2600ms linear infinite;
}

.magic-orb span:nth-child(2) {
  inset: 32px;
  animation-direction: reverse;
  animation-duration: 1900ms;
}

.magic-orb span:nth-child(3) {
  inset: 52px;
  border-style: dashed;
  animation-duration: 1600ms;
}

.result {
  display: block;
  max-width: none;
  height: 100%;
  min-height: 0;
  max-height: none;
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  padding: 14px 10px calc(104px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 8%, rgba(240, 200, 75, 0.16), transparent 28%),
    radial-gradient(circle at 8% 34%, rgba(159, 33, 68, 0.18), transparent 30%),
    radial-gradient(circle at 92% 62%, rgba(36, 59, 103, 0.2), transparent 32%),
    linear-gradient(180deg, #13091d 0%, #24112e 48%, #0c0711 100%);
  scrollbar-width: none;
}

.result::-webkit-scrollbar {
  width: 0;
}

.result-summary-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  overflow: hidden;
  color: #fff3dc;
  background:
    radial-gradient(circle at 16% 0%, rgba(240, 200, 75, 0.28), transparent 36%),
    linear-gradient(135deg, rgba(30, 23, 32, 0.95), rgba(92, 23, 48, 0.94) 56%, rgba(36, 59, 103, 0.9));
  border: 3px solid rgba(240, 200, 75, 0.82);
  border-radius: 18px 18px 10px 10px;
  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.42),
    0 0 0 2px rgba(0, 0, 0, 0.72) inset,
    0 0 0 5px rgba(240, 200, 75, 0.18) inset;
}

.result-summary-card::before,
.result-summary-card::after {
  content: "";
  position: absolute;
  width: 78px;
  height: 78px;
  opacity: 0.18;
  pointer-events: none;
  background:
    linear-gradient(var(--gold), var(--gold)) 34px 0 / 10px 78px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 34px / 78px 10px no-repeat,
    radial-gradient(circle, transparent 38%, var(--gold) 40% 45%, transparent 47%);
}

.result-summary-card::before {
  top: -24px;
  right: -24px;
}

.result-summary-card::after {
  left: -26px;
  bottom: -28px;
  transform: rotate(22deg);
}

.result-summary-portraits {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-summary-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    #171020;
  background-size: 10px 10px;
  border: 3px solid #05030a;
  border-radius: 14px;
  box-shadow: 0 0 0 2px rgba(240, 200, 75, 0.78), 0 7px 0 rgba(0, 0, 0, 0.42);
}

.result-summary-avatar-prelife {
  background-color: #eef4f8;
}

.result-summary-avatar canvas {
  width: 100%;
  height: 100%;
}

.result-summary-avatar span {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  padding: 1px 6px;
  color: #fff3dc;
  background: rgba(5, 3, 10, 0.72);
  border: 1px solid rgba(240, 200, 75, 0.7);
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.result-summary-arrow {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 1.25rem;
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.54);
}

.result-summary-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.result-summary-copy .eyebrow {
  margin-bottom: 4px;
  color: #f9d872;
}

.result-summary-copy h2 {
  margin: 0;
  color: #fff8e8;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.28rem, 6vw, 1.9rem);
  line-height: 1.15;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.58);
  overflow-wrap: anywhere;
}

.result-summary-copy dl {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
}

.result-summary-copy div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.result-summary-copy dt {
  color: #f9d872;
  font-size: 0.75rem;
}

.result-summary-copy dd {
  color: #fff3dc;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.result-reasons {
  margin-top: 12px;
}

.result-reasons > span {
  display: block;
  margin-bottom: 7px;
  color: #f9d872;
  font-size: 0.75rem;
  font-weight: 900;
}

.result-reasons ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-reasons li {
  max-width: 100%;
  padding: 5px 9px;
  color: #2a0d1c;
  background: linear-gradient(180deg, #fff3b8, #d6a44c);
  border: 1px solid rgba(255, 247, 220, 0.68);
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.35;
}

.result-summary-actions {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.result-summary-actions .primary-button,
.result-summary-actions .secondary-button {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
}

.result-summary-actions p {
  grid-column: 1 / -1;
  min-height: 1.2em;
  margin: 0;
  color: #fff3dc;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.result-stage {
  position: relative;
  display: grid;
  gap: 0;
  margin: 6px 0 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(11, 5, 18, 0.08), rgba(11, 5, 18, 0.42)),
    var(--stage-bg, linear-gradient(180deg, #1b1028, #38203b)) center / cover no-repeat;
  border: 4px solid #05030a;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.58), 0 0 0 2px rgba(240, 200, 75, 0.45) inset;
  scroll-margin-top: 18px;
}

.result-stage-label {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  width: fit-content;
  margin: 0;
  padding: 6px 12px;
  color: #fff3dc;
  background: var(--ink);
  border: 2px solid var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
}

.game-result-canvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
  border: 0;
  box-shadow: none;
  transform-origin: 50% 12%;
  touch-action: pan-y;
  filter: drop-shadow(0 24px 32px rgba(0, 0, 0, 0.34));
}

.result.is-active .result-stage-prelife .game-result-canvas {
  animation: cardReveal 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.result.is-active .result-stage-villainess .game-result-canvas {
  animation: cardReveal 620ms 180ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  box-shadow: none !important;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: clamp(28px, 6vw, 54px) clamp(22px, 5vw, 44px);
  overflow: visible;
  color: #21142d;
  background:
    radial-gradient(circle at 100% 0, rgba(240, 200, 75, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(255, 249, 237, 0.96), rgba(255, 243, 220, 0.98));
  border: 4px solid #05030a;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.58), 0 0 0 2px rgba(240, 200, 75, 0.45) inset;
  margin-bottom: 22px;
}

.result-card-prelife {
  background:
    radial-gradient(circle at 100% 0, rgba(36, 59, 103, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(246, 251, 255, 0.97), rgba(255, 243, 220, 0.98));
}

.result-card-prelife .eyebrow {
  color: #243b67;
}

.result-card-prelife h2 {
  color: #1d2740;
}

.result-card-prelife .deep-details section {
  background: linear-gradient(180deg, rgba(246, 251, 255, 0.97), rgba(232, 241, 252, 0.94));
  border-color: #8fa4c4;
}

.result-card-prelife .deep-details h3 {
  color: #243b67;
}

.result-card::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 22px;
  width: 112px;
  height: 74px;
  opacity: 0.14;
  background:
    linear-gradient(var(--stone), var(--stone)) 16px 0 / 16px 16px no-repeat,
    linear-gradient(var(--stone), var(--stone)) 48px 0 / 16px 16px no-repeat,
    linear-gradient(var(--stone), var(--stone)) 80px 0 / 16px 16px no-repeat,
    linear-gradient(var(--stone), var(--stone)) 0 16px / 112px 58px no-repeat;
}

.result-portraits {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.result-portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: 104px;
  aspect-ratio: 1;
  background:
    linear-gradient(90deg, rgba(30, 23, 32, 0.13) 1px, transparent 1px),
    linear-gradient(rgba(30, 23, 32, 0.1) 1px, transparent 1px),
    #eef4f8;
  background-size: 12px 12px;
  border: 4px solid #21142d;
  box-shadow: 6px 6px 0 #f0c84b, 0 0 18px rgba(240, 200, 75, 0.22);
}

.result-portrait span {
  position: absolute;
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%);
  padding: 2px 8px;
  color: #fff3dc;
  background: var(--ink);
  border: 2px solid var(--gold);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.result-portrait-modern {
  background:
    linear-gradient(90deg, rgba(30, 23, 32, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(30, 23, 32, 0.08) 1px, transparent 1px),
    #f5f2e9;
}

.result-portrait canvas {
  image-rendering: auto;
}

.result-arrow {
  color: var(--rose-dark);
  font-size: 1.4rem;
  font-weight: 900;
}

.result-intro {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
}

.result-axis-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 22px 0 18px;
}

.result-axis-strip-solo {
  margin: 16px 0 18px;
}

.result-axis-strip section {
  min-width: 0;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255, 250, 238, 0.96), rgba(239, 211, 164, 0.9));
  border: 3px solid #b78a4b;
  box-shadow: 0 4px 0 rgba(92, 23, 48, 0.28);
}

.result-axis-strip span {
  display: block;
  margin-bottom: 5px;
  color: var(--rose);
  font-size: 0.76rem;
  font-weight: 900;
}

.result-axis-strip strong {
  display: block;
  font-size: 0.96rem;
  line-height: 1.35;
}

.result-copy h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4.8vw, 2.8rem);
  line-height: 1.14;
  color: #21142d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.result-summary {
  margin: 18px 0 22px;
  color: #3c303e;
  font-size: 1.03rem;
  line-height: 1.8;
}

.result-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.result-details div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  padding: 11px 12px 9px;
  border-top: 2px solid rgba(138, 96, 66, 0.58);
  background: rgba(255, 249, 237, 0.58);
}

dt {
  color: var(--rose);
  font-weight: 900;
}

dd {
  margin: 0;
  color: var(--ink);
}

.deep-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 22px;
}

.deep-details section {
  min-width: 0;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255, 249, 237, 0.96), rgba(245, 224, 188, 0.96));
  border: 3px solid #b78a4b;
  box-shadow: 0 5px 0 rgba(92, 23, 48, 0.24);
}

.deep-details h3 {
  margin: 0 0 8px;
  color: var(--rose-dark);
  font-size: 0.92rem;
}

.deep-details p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.82;
}

.quote-panel {
  grid-column: 1 / -1;
  background: #2a2230 !important;
  border-color: var(--ink) !important;
}

.quote-panel h3,
.quote-panel p {
  color: #fff3dc;
}

.quote-panel p {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
}

.ad-slot {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 112px;
  margin: 8px 0 18px;
  padding: 18px;
  color: rgba(255, 243, 220, 0.72);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 243, 220, 0.08), rgba(240, 200, 75, 0.05)),
    rgba(8, 4, 12, 0.46);
  border: 2px dashed rgba(240, 200, 75, 0.42);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24) inset;
}

.ad-slot span {
  position: absolute;
  top: 8px;
  left: 10px;
  padding: 2px 7px;
  color: rgba(255, 243, 220, 0.72);
  background: rgba(8, 4, 12, 0.62);
  border: 1px solid rgba(240, 200, 75, 0.34);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ad-slot p {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 800;
}

.ad-slot-result {
  min-height: 128px;
  margin-bottom: 0;
}

.legal-dialog {
  width: min(92vw, 420px);
  max-height: min(82dvh, 720px);
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.legal-dialog::backdrop {
  background: rgba(8, 4, 12, 0.74);
  backdrop-filter: blur(4px);
}

.legal-dialog-panel {
  position: relative;
  max-height: min(82dvh, 720px);
  overflow: auto;
  padding: 26px 22px 24px;
  background:
    linear-gradient(180deg, rgba(255, 249, 237, 0.97), rgba(238, 209, 160, 0.97)),
    var(--ui-kit) center / cover no-repeat;
  border: 4px solid #3a1830;
  box-shadow:
    0 16px 50px rgba(0, 0, 0, 0.62),
    0 0 0 2px rgba(240, 200, 75, 0.62) inset;
}

.legal-close {
  position: sticky;
  top: 0;
  z-index: 2;
  float: right;
  width: 38px;
  height: 38px;
  margin: -8px -6px 4px 12px;
  color: #fff3dc;
  background: #5c1730;
  border: 2px solid #f0c84b;
  cursor: pointer;
  font-size: 1.34rem;
  font-weight: 900;
  line-height: 1;
}

.legal-document h2 {
  margin: 6px 0 16px;
  color: var(--rose-dark);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  line-height: 1.12;
}

.legal-document h3 {
  margin: 18px 0 8px;
  color: #7a2d24;
  font-size: 1rem;
}

.legal-document p {
  margin: 0 0 12px;
  color: #3a2a2a;
  font-size: 0.94rem;
  line-height: 1.78;
}

.is-qa-mode {
  overflow: auto;
}

.is-qa-mode .app-shell {
  width: 100%;
  height: auto;
  min-height: 100dvh;
  overflow: visible;
  padding: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(240, 200, 75, 0.16), transparent 36%),
    linear-gradient(180deg, #170e22, #2b142a);
}

.share-qa-screen {
  position: relative;
  z-index: 5;
  min-height: 100dvh;
  padding: clamp(18px, 4vw, 42px);
  color: #fff3dc;
}

.share-qa-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  max-width: 1320px;
  margin: 0 auto 24px;
}

.share-qa-header h1 {
  margin: 4px 0 8px;
  font-size: clamp(2rem, 6vw, 4.2rem);
}

.share-qa-header p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 243, 220, 0.82);
  line-height: 1.7;
}

.share-qa-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.share-qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  max-width: 1320px;
  margin: 0 auto;
}

.share-qa-screen-single .share-qa-grid {
  max-width: 980px;
  grid-template-columns: 1fr;
}

.share-qa-item {
  min-width: 0;
  padding: 12px;
  background: rgba(10, 5, 15, 0.56);
  border: 2px solid rgba(240, 200, 75, 0.42);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
}

.share-qa-item canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #150817;
}

.share-qa-item h2 {
  margin: 12px 0 4px;
  color: #fff3dc;
  font-size: 0.98rem;
  line-height: 1.45;
}

.share-qa-item p {
  margin: 0;
  color: rgba(255, 243, 220, 0.74);
  font-size: 0.84rem;
  line-height: 1.55;
}

.share-qa-screen-single .share-qa-item h2 {
  font-size: clamp(1.05rem, 3vw, 1.35rem);
}

@media (max-width: 760px) {
  .share-qa-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .share-qa-actions {
    justify-content: flex-start;
  }

  .share-qa-grid {
    grid-template-columns: 1fr;
  }
}

.hidden {
  display: none !important;
}

.ui-sparkle {
  position: absolute;
  z-index: 20;
  width: 9px;
  height: 9px;
  pointer-events: none;
  background: #f0c84b;
  box-shadow: 0 0 14px rgba(240, 200, 75, 0.8);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: sparkleBurst 920ms ease-out forwards;
}

@keyframes panelRise {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes questionEnter {
  from {
    opacity: 0;
    transform: translateX(22px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes questionExit {
  to {
    opacity: 0;
    transform: translateX(-18px) scale(0.98);
  }
}

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

@keyframes orbPulse {
  0%,
  100% {
    transform: scale(0.98);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.05);
    filter: brightness(1.22);
  }
}

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

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(40px) rotateX(18deg) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
  }
}

@keyframes sparkleBurst {
  from {
    opacity: 0;
    transform: translate(0, 0) scale(0.4) rotate(0deg);
  }
  18% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(180deg);
  }
}

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

@media (max-width: 760px) {
  .app-shell {
    width: 100%;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  }

  .hero,
  .result-card {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 100%;
    padding: 10px 14px 14px;
  }

  .hero-copy,
  .result-card {
    padding: 20px;
  }

  .hero-ensemble {
    top: 0;
    width: 100%;
    height: 100%;
    object-position: center top;
  }

  .hero-title-lockup {
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .hero-kicker {
    margin-bottom: 5px;
  }

  h1 {
    font-size: clamp(2.35rem, 11vw, 4rem);
  }

  .hero-copy {
    padding: 14px 12px clamp(56px, 9dvh, 72px);
  }

  .quiz {
    grid-template-rows: auto auto minmax(118px, 0.58fr) minmax(318px, 1.18fr);
    gap: 8px;
    padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  }

  .pixel-stage {
    display: none;
  }

  .pixel-frame {
    width: 190px;
    box-shadow: 8px 8px 0 var(--gold);
  }

  .quiz-header {
    grid-template-columns: auto auto 1fr;
    gap: 8px;
  }

  .question-count {
    grid-column: 3;
    justify-self: end;
    font-size: 0.78rem;
  }

  .quiz .ghost-button {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .quiz h2 {
    padding: 18px 22px;
    font-size: clamp(0.98rem, 4.25vw, 1.2rem);
    line-height: 1.42;
  }

  .choices {
    gap: 9px;
    padding: 10px 8px;
  }

  .choice-button {
    padding: 12px 14px;
    font-size: clamp(0.86rem, 3.7vw, 0.98rem);
    line-height: 1.36;
  }

  .choice-card-label {
    width: 30px;
    height: 30px;
    font-size: 0.7rem;
  }

  .result-portrait {
    width: 92px;
    box-shadow: 5px 5px 0 var(--gold);
  }

  .result-portraits {
    gap: 8px;
  }

  .result-arrow {
    font-size: 1.1rem;
  }

  .result-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .result-summary-card {
    grid-template-columns: 1fr;
    padding: 14px;
    border-radius: 16px 16px 10px 10px;
  }

  .result-summary-portraits {
    justify-content: center;
  }

  .result-summary-copy {
    text-align: center;
  }

  .result-summary-copy div {
    grid-template-columns: 58px minmax(0, 1fr);
    text-align: left;
  }

  .result-summary-actions {
    grid-template-columns: 1fr;
  }

  .result-axis-strip {
    grid-template-columns: 1fr;
  }

  .deep-details {
    grid-template-columns: 1fr;
  }

  .result-details div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .actions > * {
    width: 100%;
  }

  .legal-menu {
    bottom: max(8px, env(safe-area-inset-bottom));
    padding: 6px 10px;
  }

  .legal-dialog-panel {
    padding: 22px 18px;
  }
}
