:root {
  color-scheme: dark;
  --bg: #080c13;
  --text: #f2e8d5;
  --muted: #aaa6b4;
  --gold: #cfad70;
  --line: #32333c;
  --panel: #111620;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 0, #1c2238 0, transparent 570px), var(--bg);
  color: var(--text);
  font:
    15px/1.65 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
textarea,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #f0d395;
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
.shell {
  max-width: 850px;
  margin: auto;
  padding: 24px 28px 20px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.brand {
  text-decoration: none;
  font:
    25px Georgia,
    serif;
  letter-spacing: 0.035em;
}
.brand span {
  color: var(--gold);
  font-size: 35px;
  vertical-align: -3px;
  margin-right: 7px;
}
.quiet,
.secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  border-radius: 30px;
  padding: 10px 17px;
}
.quiet {
  font-size: 12px;
  padding: 7px 13px;
  color: var(--muted);
}
.primary {
  background: var(--gold);
  color: #14120e;
  border: 1px solid var(--gold);
  border-radius: 30px;
  font-weight: 650;
  padding: 13px 24px;
}
.primary:hover {
  background: #e3c58e;
}
.secondary:hover,
.quiet:hover {
  border-color: var(--gold);
}
h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.16;
}
h1 {
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: -0.04em;
  margin: 15px 0 18px;
}
h2 {
  font-size: 32px;
  margin: 14px 0 22px;
}
h3 {
  font-size: 23px;
}
.hero {
  text-align: center;
  max-width: 590px;
  margin: auto;
}
.hero h1 {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.muted,
.subtitle {
  color: var(--muted);
}
.subtitle {
  max-width: 450px;
  margin: 0 auto 26px;
  line-height: 1.65;
}
.art-fan {
  height: 215px;
  position: relative;
  max-width: 400px;
  margin: 8px auto 30px;
}
.art-fan img {
  width: 126px;
  position: absolute;
  top: 13px;
  left: calc(50% - 63px);
  border-radius: 7px;
  box-shadow: 0 16px 35px #0009;
}
.art-fan img:first-child {
  transform: translateX(-88px) rotate(-13deg);
  top: 24px;
}
.art-fan img:last-child {
  transform: translateX(88px) rotate(13deg);
  top: 24px;
}
.art-fan img:nth-child(2) {
  z-index: 1;
}
.question-form {
  max-width: 590px;
  margin: 26px auto 0;
  text-align: left;
}
.field-label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  color: var(--text);
}
textarea {
  font-size: 16px;
  width: 100%;
  background: #10151fe6;
  border: 1px solid #45414b;
  border-radius: 13px;
  color: var(--text);
  padding: 16px;
  resize: vertical;
  min-height: 115px;
  line-height: 1.6;
}
textarea::placeholder {
  color: #888493;
}
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 17px 0;
}
.hint {
  font-size: 12px;
  color: var(--muted);
}
.ai-notice, .ai-label, .ai-disclosure, .agreement-panel {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.ai-notice { text-align: center; margin: 0 0 12px; }
.ai-label { max-width: 650px; margin: 8px auto 16px; }
.ai-disclosure { margin: 10px 0; }
.agreement-panel { max-width: 650px; margin: 10px auto; }
.agreement-panel label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.agreement-panel input { flex: 0 0 20px; width: 20px; height: 20px; margin: 0; accent-color: var(--gold); }
.agreement-panel button { margin-top: 10px; }
.price {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.price strong {
  color: var(--gold);
  font-weight: 500;
}
.center {
  text-align: center;
}
.notice {
  font-size: 13px;
  padding: 11px 15px;
  background: #292334;
  border: 1px solid #61516d;
  border-radius: 8px;
  margin-bottom: 22px;
}
.challenge-panel {
  max-width: 520px;
  margin: 24px auto;
  text-align: center;
}
.challenge-panel h1 {
  font-size: clamp(28px, 7vw, 40px);
}
.challenge-widget {
  min-height: 65px;
  margin: 22px auto;
  display: flex;
  justify-content: center;
}
.intro {
  font:
    21px/1.65 Georgia,
    serif;
  white-space: pre-wrap;
}
.original {
  color: var(--muted);
  font-size: 14px;
  border-left: 2px solid var(--gold);
  padding-left: 17px;
  margin: 28px 0;
  overflow-wrap: anywhere;
}
.original strong {
  display: block;
  color: var(--text);
  font-weight: 400;
}
.questions {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}
.questions li {
  display: flex;
  align-items: stretch;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 4px 0;
}
.questions .number {
  color: var(--gold);
  font-size: 17px;
  min-width: 18px;
  padding-top: 17px;
}
.questions .question-choice {
  flex: 1;
  min-height: 58px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: 22px/1.45 Georgia, serif;
  text-align: left;
  padding: 11px 12px;
}
.questions .question-choice:hover,
.questions .question-choice:focus-visible {
  background: #1a2230;
  color: #f5daa6;
}
.included {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.reading-head {
  text-align: center;
  margin: 30px auto;
  max-width: 620px;
}
.step {
  color: var(--gold);
  font-size: 13px;
}
.reading-head h1 {
  font-size: clamp(30px, 5vw, 43px);
}
.progress {
  display: flex;
  gap: 5px;
  width: 130px;
  margin: 22px auto;
}
.progress i {
  height: 3px;
  background: #353540;
  flex: 1;
}
.progress i.active {
  background: var(--gold);
}
.deck-panel {
  margin: 28px 0;
  padding: 18px 0;
  border-block: 1px solid var(--line);
}
.deck-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5px;
}
.deck {
  display: flex;
  gap: 9px;
  padding: 26px 10px 22px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}
.deck-card {
  width: 70px;
  min-width: 70px;
  height: 105px;
  background: url("/card-back.svg") center/cover;
  border: 0;
  border-radius: 5px;
  transition: transform 0.18s;
}
.deck-card:hover,
.deck-card:focus-visible {
  transform: translateY(-8px);
}
.reveal {
  text-align: center;
}
.card-image {
  display: block;
  width: 220px;
  max-width: 70vw;
  height: auto;
  margin: auto;
  border-radius: 9px;
  box-shadow: 0 20px 60px #0008;
}
.reversed {
  transform: rotate(180deg);
}
.card-caption {
  margin: 20px 0;
}
.card-caption h2 {
  font-size: 27px;
  margin: 0 0 4px;
}
.card-caption p {
  font-size: 12px;
  color: var(--gold);
  margin: 0;
}
.prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    19px/1.8 Georgia,
    serif;
  text-align: left;
  max-width: 650px;
  margin: 28px auto;
}
.reading-actions {
  justify-content: center;
  margin: 25px 0;
}
.conversation {
  max-width: 650px;
  margin: 34px auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.conversation h3 {
  font-size: 22px;
  margin: 0;
}
.message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 13px 16px;
  margin: 12px 0;
  border-radius: 12px;
  background: var(--panel);
}
.message.user {
  margin-left: 30px;
  background: #28251f;
}
.message.assistant {
  margin-right: 20px;
  border-left: 2px solid #635334;
}
.chat-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-row textarea {
  min-height: 56px;
  height: 56px;
}
.chat-row button {
  padding: 13px 17px;
}
.history {
  margin: 36px 0 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.history h3 {
  font:
    13px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--muted);
  margin-bottom: 18px;
}
.history-grid {
  display: flex;
  gap: 17px;
  overflow-x: auto;
  padding-bottom: 14px;
}
.history-item {
  width: 94px;
  min-width: 94px;
  margin: 0;
}
.history-item img {
  width: 94px;
  height: 141px;
  object-fit: contain;
  border-radius: 4px;
}
.history-item figcaption {
  font-size: 11px;
  line-height: 1.45;
  margin-top: 10px;
}
.history-item span {
  display: block;
  color: var(--muted);
}
.final-spread {
  display: flex;
  justify-content: center;
  gap: 17px;
  margin: 32px 0;
}
.final-spread img {
  width: 27%;
  max-width: 170px;
  border-radius: 6px;
}
.share-box {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 28px;
}
.share-box label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.share-box input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}
.recovery-entry {
  margin: 8px auto 0;
  text-align: center;
}
.recovery-panel {
  max-width: 650px;
  margin: 30px auto;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.recovery-panel h3 {
  margin: 0 0 8px;
}
.recovery-panel .hint {
  margin: 0 0 15px;
}
.recovery-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: end;
}
.recovery-form label {
  grid-column: 1 / -1;
}
.recovery-form input {
  min-width: 0;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #45414b;
  border-radius: 10px;
  background: #10151f;
  color: var(--text);
  font-size: 16px;
}
.recovery-form button {
  min-height: 48px;
}
.recovery-success {
  color: var(--gold);
  margin: 0;
}
.recovery-error {
  color: #f0bec1;
  margin: 12px 0 0;
}
.loading,
#status {
  text-align: center;
  color: var(--gold);
  font-size: 14px;
}
.loading {
  padding: 55px 0;
}
#status:not(:empty) {
  padding: 18px 0;
}
.error {
  padding: 17px;
  border: 1px solid #78575c;
  border-radius: 10px;
  color: #f0bec1;
  margin-top: 18px;
}
.error p {
  margin: 0 0 12px;
}
.error button {
  margin: 0 10px 0 0;
}
footer {
  text-align: center;
  margin: 45px 0 10px;
  font-size: 11px;
  color: #97929f;
}
footer nav {
  display: flex;
  justify-content: center;
  gap: 20px;
}
footer p {
  margin-bottom: 9px;
}
.review {
  max-width: 650px;
  margin: 35px auto;
}
.review h1 {
  font-size: 43px;
}
.screen-heading {
  text-align: center;
}
.screen-heading p {
  color: var(--muted);
}
@media (min-width: 700px) {
  .hero {
    padding-top: 5px;
  }
  .art-fan {
    height: 237px;
  }
  .art-fan img {
    width: 143px;
    left: calc(50% - 71px);
  }
  .art-fan img:first-child {
    transform: translateX(-106px) rotate(-13deg);
  }
  .art-fan img:last-child {
    transform: translateX(106px) rotate(13deg);
  }
}
@media (max-width: 480px) {
  .shell {
    padding: 12px 20px max(20px, env(safe-area-inset-bottom));
  }
  .topbar {
    margin-bottom: 8px;
  }
  .art-fan {
    height: 80px;
    margin: 0 auto 8px;
  }
  .art-fan img {
    width: 50px;
    left: calc(50% - 25px);
    top: 0;
  }
  .art-fan img:first-child {
    transform: translateX(-51px) rotate(-13deg);
    top: 4px;
  }
  .art-fan img:last-child {
    transform: translateX(51px) rotate(13deg);
    top: 4px;
  }
  .hero h1 {
    font-size: 32px;
    margin-top: 12px;
    margin-bottom: 9px;
  }
  .subtitle {
    font-size: 14px;
    margin-bottom: 12px;
  }
  .question-form {
    margin-top: 14px;
  }
  .question-form textarea {
    min-height: 90px;
    padding: 12px 14px;
  }
  .question-form .field-label {
    margin-bottom: 6px;
  }
  .question-form .actions {
    flex-direction: column-reverse;
    align-items: stretch;
    margin-top: 12px;
  }
  .question-form .primary {
    width: 100%;
  }
  .question-form .price {
    text-align: center;
  }
  .review h1 {
    font-size: 34px;
  }
  .review > .actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .review > .actions .primary {
    width: 100%;
  }
  button,
  .brand,
  footer a {
    min-height: 44px;
    min-width: 44px;
  }
  .brand,
  footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .brand span {
    margin-right: 9px;
  }
  .notice {
    margin-bottom: 12px;
    padding: 8px 12px;
    line-height: 1.45;
  }
  .questions .question-choice {
    font-size: 21px;
  }
  .card-image {
    width: 204px;
  }
  .prose {
    font-size: 18px;
  }
  .reading-actions button {
    flex-grow: 1;
  }
  .final-spread {
    gap: 11px;
  }
  .chat-row {
    gap: 8px;
  }
  .chat-row button {
    padding: 13px;
  }
  .share-box .actions {
    align-items: stretch;
  }
  .share-box button {
    flex-grow: 1;
  }
  .recovery-panel {
    padding: 17px;
  }
  .recovery-form {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }
  .recovery-form button {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
.deck.shuffling .deck-card {
  animation: shuffle-cards 0.65s ease-in-out both;
  opacity: 1;
}
.deck.shuffling .deck-card:nth-child(2n) {
  animation-direction: reverse;
}
.deck.shuffling .deck-card:nth-child(3n) {
  animation-delay: 0.025s;
}
@keyframes shuffle-cards {
  0%,
  100% {
    transform: translateX(0) rotate(0);
  }
  30% {
    transform: translateX(18px) translateY(-9px) rotate(13deg);
  }
  65% {
    transform: translateX(-14px) translateY(5px) rotate(-11deg);
  }
}
.card-turn-stage {
  width: 220px;
  max-width: 70vw;
  aspect-ratio: 2/3;
  margin: auto;
  perspective: 1100px;
}
.card-turn {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: reveal-card 0.7s cubic-bezier(0.2, 0.65, 0.25, 1) both;
}
.card-turn-back,
.card-turn-front {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 9px;
}
.card-turn-back {
  object-fit: fill;
  transform: rotateY(180deg);
}
.card-turn-front .card-image {
  width: 100%;
  max-width: none;
}
@keyframes reveal-card {
  from {
    transform: rotateY(180deg) translateY(12px);
  }
  to {
    transform: rotateY(0) translateY(0);
  }
}
@media (max-width: 480px) {
  .card-turn-stage {
    width: 204px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card-turn {
    animation: none;
  }
  .deck.shuffling .deck-card {
    animation: none;
  }
}
.art-fan img,
.final-spread img {
  height: auto;
}
.safety-panel { max-width: 620px; margin: 24px auto; }
.safety-panel h1 { font-size: clamp(1.65rem, 6vw, 2.3rem); }
.safety-panel .prose { line-height: 1.65; }
.safety-resources { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.safety-resources a { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px; text-align: center; text-decoration: none; border: 1px solid currentColor; border-radius: 10px; }
.safety-panel > button { margin: 12px 0; width: 100%; min-height: 48px; }
