:root {
  color-scheme: dark;
  --ground: #161126;
  --panel: #231939;
  --ink: #f7ecdc;
  --muted: #c2b5d1;
  --gold: #f5d68f;
  --lilac: #d2b3ff;
  --line: #57436e;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 78% 40%, #2e1c49, transparent 54%), var(--ground);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.shell { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.masthead, footer { display: flex; justify-content: space-between; align-items: center; }
.masthead { min-height: 78px; border-bottom: 1px solid var(--line); }
.brand { font: 1.55rem var(--serif); }
.brand span { color: var(--gold); margin-right: .42rem; }
.edition, footer, .eyebrow, .card-index, .face-label, .card-bottom {
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .71rem;
  font-weight: 700;
}
.edition, footer { color: var(--muted); }
.favorites-link { text-underline-offset: .3em; }
.favorites-link:hover { color: var(--gold); }
.table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  align-items: start;
  column-gap: clamp(34px, 8vw, 118px);
  padding-block: clamp(45px, 8vh, 94px) 54px;
}
.question { padding-top: 24px; }
.eyebrow, .face-label { color: var(--lilac); }
.eyebrow { margin: 0 0 1.15rem; display: flex; align-items: center; gap: .8rem; }
.eyebrow span { width: 29px; height: 1px; background: currentColor; }
h1 { font: normal clamp(3.35rem, 6.9vw, 6.2rem)/.98 var(--serif); letter-spacing: -.075em; margin: 0; }
h1 em { color: var(--gold); font-weight: 400; }
.intro { color: var(--muted); max-width: 41ch; margin: 1.5rem 0 2.3rem; }
.field-label { display: block; margin: 0 0 .55rem; font-size: .9rem; font-weight: 650; }
input:not([type="radio"]), select {
  display: block;
  width: 100%;
  min-height: 53px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #21182f;
  color: var(--ink);
  padding: .65rem .9rem;
}
input::placeholder { color: #b5a6c5; }
.examples, .tones { display: flex; flex-wrap: wrap; gap: .45rem; }
.examples { margin-top: .7rem; }
.examples button, .tones span {
  display: block;
  border: 1px solid var(--line);
  border-radius: 40px;
  background: transparent;
  color: var(--muted);
  font-size: .77rem;
  padding: .39rem .7rem;
}
.examples button:hover, .tones label:hover span { border-color: var(--lilac); color: var(--ink); }
fieldset { border: 0; margin: 1.55rem 0 1.4rem; padding: 0; min-width: 0; }
legend { padding: 0; }
.tones label { position: relative; cursor: pointer; }
.tones input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tones input:checked + span { background: #3b2857; border-color: #a884d1; color: #eee1ff; }
.tones input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }
.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 53px;
  padding: .65rem 1.1rem;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #2a1d22;
  font-weight: 750;
}
.primary:hover { background: #ffe3a5; }
.primary:disabled { opacity: .68; }
.status { color: var(--muted); font-size: .83rem; margin: .7rem 0 0; }
.status:empty { display: none; }
.status[data-error] { color: #ffc4c7; }
details { margin-top: 1.2rem; color: var(--muted); font-size: .84rem; }
summary { cursor: pointer; width: fit-content; }
.personal-fields { margin-top: .6rem; }
.personal-fields select, .personal-fields input { min-height: 42px; margin: .3rem 0 .55rem; }
.reading { min-width: 0; }
.card-stage { perspective: 1500px; }
.card-stage.has-reading[aria-busy="false"] { cursor: pointer; }
.card-inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform .58s cubic-bezier(.36,.72,.35,1);
}
.card-stage.flipped .card-inner { transform: rotateY(180deg); }
.card-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  min-height: 502px;
  padding: 26px 32px 23px;
  border: 1px solid #a884d180;
  border-radius: 19px;
  background: radial-gradient(ellipse at 50% 40%, #382254 0%, #251939 68%);
  box-shadow: 0 18px 48px #0b081b80;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.card-face::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid #b590ed52;
  border-radius: 12px;
  pointer-events: none;
}
.card-face.back {
  background: radial-gradient(ellipse at 50% 35%, #312741, #211a2d 72%);
  border-color: #e2bd6b91;
  transform: rotateY(180deg);
}
.card-face.back::before { border-color: #e2bd6b5c; }
.card-index { display: flex; align-items: center; justify-content: space-between; color: var(--gold); }
.card-index span:nth-child(2) { font-size: 1rem; }
.cover { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; padding-bottom: 12px; }
.cover img { width: min(100%, 260px); height: auto; }
.cover h2, .card-story h2 { font: normal clamp(1.8rem, 3.6vw, 2.45rem)/1.08 var(--serif); margin: 0; overflow-wrap: anywhere; }
.cover p, .topic { color: var(--muted); font-size: .86rem; margin: .6rem 0 0; overflow-wrap: anywhere; }
.card-story { margin-block: auto; padding-block: 1.7rem; }
.face-label { margin: 0 0 .7rem; }
.back .face-label { color: var(--gold); }
.story-text { margin: 1.1rem 0; white-space: pre-line; overflow-wrap: anywhere; }
.note { color: var(--muted); font-size: .8rem; margin: 0; }
.sources { padding-left: 1.2rem; margin: .55rem 0 0; font-size: .8rem; overflow-wrap: anywhere; }
.sources:empty { display: none; }
.sources a { color: var(--gold); text-underline-offset: .2em; }
.card-bottom { color: var(--gold); text-align: center; }
.card-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; margin-top: 15px; }
.turn {
  padding: .45rem .9rem;
  min-height: 42px;
  border: 1px solid #a884d180;
  border-radius: 40px;
  background: #21172e;
  color: var(--ink);
  font-size: .85rem;
}
.turn [aria-hidden] { color: var(--gold); margin-right: .3rem; }
.turn:disabled { color: var(--muted); opacity: .7; }
.turn:not(:disabled):hover { border-color: var(--gold); }
.favorite-status { text-align: center; }
.favorites { grid-column: 1 / -1; min-width: 0; margin-top: 42px; border-top: 1px solid var(--line); padding-top: 24px; }
.favorites h2 { font: normal 1.8rem var(--serif); margin: 0; }
.favorites p { color: var(--muted); font-size: .85rem; margin: .4rem 0 0; }
#favorites-list { margin: 1rem 0 0; padding: 0; list-style: none; }
#favorites-list:empty { display: none; }
.favorite-item { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.favorite-open { min-width: 0; border: 0; background: none; color: var(--ink); text-align: left; padding: .3rem .25rem; overflow-wrap: anywhere; }
.favorite-open:hover { color: var(--gold); }
.favorite-open span { display: block; font-size: .79rem; color: var(--muted); }
.favorite-item .turn { flex-shrink: 0; }
footer { min-height: 63px; border-top: 1px solid var(--line); gap: 1rem; }
footer span:nth-child(2) { color: var(--gold); }
footer span:last-child { text-align: right; }
@media (max-width: 820px) {
  .shell { width: min(540px, calc(100% - 36px)); }
  .table { grid-template-columns: 1fr; gap: 34px; padding-block: 34px; }
  .question { padding-top: 0; }
  .masthead { min-height: 61px; }
  .card-face { min-height: 420px; padding-inline: 26px; }
  .favorites { margin-top: 0; }
}
@media (max-width: 360px) {
  .edition, footer { letter-spacing: .09em; }
}
@media (prefers-reduced-motion: reduce) {
  .card-inner { transition: none; }
}
