:root {
  --night: #070610;
  --night-soft: #0d0a17;
  --panel: #141020;
  --panel-soft: #1b1529;
  --gold: #dfb83d;
  --gold-bright: #ffe79a;
  --gold-dim: #95782d;
  --text: #d2cadc;
  --muted: #898096;
  --edge: rgba(223, 184, 61, .23);
  --wine: #743044;
  --shadow: rgba(0, 0, 0, .66);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-width: 320px;
  min-height: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  background: var(--night);
  font-family: "Noto Serif SC", "PingFang SC", serif;
  transition: color .45s ease, background .45s ease;
}

body.is-busy {
  cursor: progress;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
.history-item:focus-visible,
.share-menu-item:focus-visible,
.account-chip:focus-within,
.tarot-carousel:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

#star-field,
.atmosphere,
.vignette,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#star-field {
  z-index: 0;
}

.atmosphere {
  z-index: 1;
  inset: 0;
  opacity: .46;
  filter: blur(90px);
  background:
    radial-gradient(42% 38% at 52% 40%, #2a1d4b 0, transparent 65%),
    radial-gradient(31% 28% at 17% 79%, #19112d 0, transparent 64%),
    radial-gradient(29% 25% at 83% 18%, #251637 0, transparent 64%);
  background-size: 180% 180%;
  animation: driftingFog 70s ease-in-out infinite;
}

.vignette {
  z-index: 1;
  background: radial-gradient(120% 100% at 50% 38%, transparent 40%, rgba(0, 0, 0, .56) 88%, rgba(0, 0, 0, .88));
}

.grain {
  z-index: 2;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.84' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");
}

@keyframes driftingFog {
  0%, 100% { background-position: 0 0; }
  50% { background-position: 100% 100%; }
}

.page-shell {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  overflow-x: clip;
  padding: 28px 16px 38px;
}

.masthead {
  text-align: center;
}

.ornament {
  color: var(--gold-dim);
  font-size: 11px;
  letter-spacing: .48em;
  opacity: .72;
}

.masthead h1 {
  margin: 7px 0 0;
  color: var(--gold-bright);
  font: 600 clamp(1.55rem, .7rem + 3.4vw, 3rem)/1 "Cinzel", serif;
  letter-spacing: .18em;
  white-space: nowrap;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 58%, var(--gold-dim));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 11px rgba(223, 184, 61, .24));
}

.cn-title {
  margin: 7px 0 0;
  color: var(--muted);
  font: italic 15px/1.3 "Cormorant Garamond", serif;
  letter-spacing: .29em;
}

.masthead-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .12em;
  opacity: .9;
}

.intention {
  width: min(720px, 94vw);
  margin-top: 18px;
  text-align: center;
}

.intention label {
  display: block;
  color: var(--gold-dim);
  font-size: 10px;
  letter-spacing: .12em;
}

.question-line {
  position: relative;
  margin-top: 7px;
}

.question-line input {
  width: 100%;
  padding: 11px 58px 10px 16px;
  border: 0;
  border-bottom: 1px solid var(--edge);
  color: var(--text);
  background: rgba(255, 255, 255, .025);
  text-align: center;
  outline: none;
  transition: border-color .2s, background .2s;
}

.question-line input:focus {
  border-color: var(--gold);
  background: rgba(223, 184, 61, .05);
}

.question-line span {
  position: absolute;
  right: 12px;
  top: 50%;
  color: var(--muted);
  font-size: 9px;
  transform: translateY(-50%);
}

.intention > p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  opacity: .75;
}

.tarot-stage {
  position: relative;
  width: min(100%, 900px);
  height: min(54vh, 430px);
  min-height: 330px;
  margin: 4px auto 0;
}

.carousel-scene {
  position: absolute;
  inset: 0;
  perspective: 1320px;
  perspective-origin: 50% 45%;
  transition: opacity .55s ease, filter .55s ease;
}

.carousel-scene.is-dimmed {
  opacity: .1;
  filter: blur(3px);
}

.tarot-carousel {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 0;
  height: 0;
  outline: none;
  transform-style: preserve-3d;
  touch-action: none;
}

.tarot-card-back {
  position: absolute;
  left: -68px;
  top: -109px;
  width: 136px;
  height: 218px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: #081630 url("./card-back.svg") center / cover no-repeat;
  box-shadow: 0 15px 36px var(--shadow), inset 0 0 0 1px rgba(246, 221, 146, .34);
  cursor: pointer;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: opacity .18s, filter .18s, box-shadow .18s;
}

.tarot-card-back::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, .12), transparent 24%, transparent 72%, rgba(0, 0, 0, .22));
  pointer-events: none;
}

.tarot-card-back.is-front {
  border-color: var(--gold);
  box-shadow: 0 16px 42px var(--shadow), inset 0 0 0 4px rgba(0, 0, 0, .4), inset 0 0 0 5px var(--gold), 0 0 30px rgba(223, 184, 61, .46);
}

.tarot-card-back.is-picked {
  opacity: .09 !important;
  pointer-events: none;
}

.tarot-card-back.is-shuffling {
  animation: deckPulse .72s ease both;
  animation-delay: var(--shuffle-delay);
}

@keyframes deckPulse {
  35% { filter: brightness(1.55); }
  55% { transform: var(--ring-transform) translateY(-38px) scale(.84); }
}

.stage-glow {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 45%;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(223, 184, 61, .16), rgba(116, 48, 68, .09) 46%, transparent 70%);
  transform: translate(-50%, -50%);
  animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
  50% { opacity: .66; transform: translate(-50%, -50%) scale(1.13); }
}

.front-marker {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 3%;
  color: var(--gold);
  font-size: 19px;
  opacity: .66;
  filter: drop-shadow(0 0 8px var(--gold));
  transform: translateX(-50%);
  animation: markerBob 2s ease-in-out infinite;
}

@keyframes markerBob {
  50% { transform: translate(-50%, 6px); }
}

.rune-ring {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 45%;
  width: min(77vw, 580px);
  aspect-ratio: 1;
  border: 1px solid rgba(223, 184, 61, .1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: runeSpin 150s linear infinite;
  pointer-events: none;
}

.rune-ring::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px dashed rgba(223, 184, 61, .08);
  border-radius: 50%;
}

.rune-ring span {
  position: absolute;
  left: 50%;
  top: 50%;
  color: rgba(223, 184, 61, .3);
  font: 500 14px/1 "Cinzel", serif;
}

@keyframes runeSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.stage-hint {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: max-content;
  max-width: 94vw;
  margin: 0;
  color: var(--muted);
  font: italic 15px/1.3 "Cormorant Garamond", serif;
  letter-spacing: .06em;
  text-align: center;
  transform: translateX(-50%);
}

.card-reveal {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.6vw, 26px);
  perspective: 1400px;
  pointer-events: none;
}

.reveal-card {
  width: clamp(120px, 27vw, 176px);
  aspect-ratio: 130 / 210;
  opacity: 0;
  transform: translateY(20px) scale(.72);
  transform-style: preserve-3d;
  transition: opacity .45s ease, transform .58s cubic-bezier(.2, .8, .2, 1);
}

.reveal-card.is-in {
  opacity: 1;
  transform: none;
}

.reveal-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.2, .8, .2, 1);
}

.reveal-card.is-flipped .reveal-card-inner {
  transform: rotateY(180deg);
}

.reveal-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--edge);
  border-radius: 13px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.reveal-back {
  background: #081630 url("./card-back.svg") center / cover no-repeat;
  box-shadow: 0 16px 40px var(--shadow), inset 0 0 0 1px rgba(246, 221, 146, .34);
}

.reveal-front {
  position: relative;
  padding: 10px;
  color: var(--text);
  background: linear-gradient(160deg, var(--panel-soft), var(--panel));
  box-shadow: 0 16px 40px var(--shadow), inset 0 0 30px rgba(223, 184, 61, .06);
  transform: rotateY(180deg);
}

.reveal-front .position {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 16px);
  padding: 3px 7px;
  border-radius: 12px;
  color: #fff7d9;
  background: rgba(10, 8, 13, .72);
  font-size: 9px;
  letter-spacing: .13em;
  transform: translateX(-50%);
}

.reveal-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .55s ease;
}

.reveal-card-image.is-reversed {
  transform: rotate(180deg);
}

.reveal-card-caption {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 24px 8px 9px;
  background: linear-gradient(transparent, rgba(7, 6, 10, .88));
  text-align: center;
}

.reveal-front strong {
  display: block;
  margin-top: 10px;
  color: #fff7dd;
  font: 600 clamp(14px, 3.3vw, 18px)/1.2 "Cinzel", serif;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
}

.reveal-front small {
  display: block;
  margin-top: 4px;
  color: #e4d9c5;
  font-size: 10px;
  letter-spacing: .12em;
  text-align: center;
}

.spread-slots {
  position: relative;
  width: min(94vw, 860px);
  height: clamp(300px, 52vw, 440px);
  min-height: 0;
  margin: 0 auto;
  transition: height .3s, margin .3s;
}

.spread-slots.has-slots {
  margin-top: 30px;
}

.spread-slots[data-layout="single"],
.spread-slots[data-layout="line-three"] {
  height: clamp(210px, 30vw, 270px);
}

.spread-slots[data-layout="timeline-seven"] {
  height: clamp(190px, 25vw, 240px);
}

.spread-paths {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.spread-paths line {
  stroke: rgba(223, 184, 61, .38);
  stroke-width: .45;
  stroke-dasharray: 1.5 1.2;
  vector-effect: non-scaling-stroke;
}

.spread-paths marker path {
  fill: rgba(223, 184, 61, .58);
}

.spread-slot {
  position: absolute;
  z-index: 1;
  left: var(--slot-x);
  top: var(--slot-y);
  width: clamp(46px, 11vw, 78px);
  aspect-ratio: 130 / 210;
  color: var(--muted);
  transform: translate(-50%, -50%);
  transition: color .3s ease;
}

.spread-slots[data-layout="timeline-seven"] .spread-slot {
  width: clamp(38px, 8.5vw, 66px);
}

.slot-label {
  position: absolute;
  z-index: 5;
  top: -24px;
  left: 50%;
  width: max-content;
  max-width: 126px;
  padding: 3px 7px;
  border: 1px solid rgba(223, 184, 61, .16);
  border-radius: 999px;
  background: rgba(9, 7, 17, .82);
  font-size: 9px;
  letter-spacing: .08em;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
}

.spread-slots[data-layout="timeline-seven"] .slot-label {
  top: auto;
  bottom: -22px;
  max-width: 54px;
  padding-inline: 3px;
  font-size: 7px;
  letter-spacing: 0;
}

.slot-card {
  width: 100%;
  height: 100%;
  perspective: 900px;
}

.slot-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .82s cubic-bezier(.2, .8, .2, 1);
}

.spread-slots.is-revealed .slot-card-inner {
  transform: rotateY(180deg);
}

.slot-card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(223, 184, 61, .3);
  border-radius: 9px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.slot-card-back {
  background: rgba(255, 255, 255, .018);
  box-shadow: inset 0 0 0 1px rgba(246, 221, 146, .04);
  transition: border-color .3s, box-shadow .3s, background .3s;
}

.slot-card-front {
  border-style: solid;
  border-color: var(--edge);
  background: var(--panel);
  box-shadow: 0 12px 30px var(--shadow);
  transform: rotateY(180deg);
}

.spread-slot.is-current .slot-card-back {
  border-style: solid;
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(223, 184, 61, .3);
}

.spread-slot.is-current {
  color: var(--gold);
}

.spread-slot.is-filled .slot-card-back {
  border-style: solid;
  border-color: var(--edge);
  background: #081630 url("./card-back.svg") center / cover no-repeat;
  box-shadow: 0 12px 28px var(--shadow), inset 0 0 0 1px rgba(246, 221, 146, .28);
}

.spread-slot.is-derived .slot-card-back {
  border-style: dashed;
  border-color: rgba(223, 184, 61, .62);
  background: rgba(42, 31, 65, .48);
}

.spread-slot.is-derived.is-filled .slot-card-back {
  background: #081630 url("./card-back.svg") center / cover no-repeat;
}

.slot-seal {
  color: var(--gold);
  font: 600 15px/1 "Cinzel", serif;
  opacity: .48;
  text-shadow: 0 1px 5px #000;
  transition: opacity .3s, transform .3s;
}

.spread-slot.is-filled .slot-seal {
  opacity: .86;
}

.spread-slot.is-dealt .slot-card {
  animation: slotDeal .52s cubic-bezier(.2, .82, .22, 1) both;
}

@keyframes slotDeal {
  from { opacity: 0; transform: translateY(-46px) scale(.78) rotate(-4deg); }
  70% { opacity: 1; transform: translateY(4px) scale(1.025) rotate(.6deg); }
  to { opacity: 1; transform: none; }
}

.slot-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.slot-card-image.is-reversed {
  transform: rotate(180deg);
}

.slot-orientation {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #fff7d9;
  background: rgba(7, 6, 10, .78);
  font-size: 7px;
}

.slot-orientation.is-reversed {
  color: #ffd3df;
}

.primary-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.ritual-button {
  min-width: 190px;
  padding: 12px 28px;
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(44, 35, 20, .66), rgba(20, 16, 12, .65));
  box-shadow: 0 0 18px rgba(223, 184, 61, .11), inset 0 0 16px rgba(223, 184, 61, .06);
  cursor: pointer;
  font: 500 12px/1.3 "Cinzel", serif;
  letter-spacing: .12em;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}

.ritual-button:hover:not(:disabled) {
  border-color: var(--gold);
  box-shadow: 0 0 28px rgba(223, 184, 61, .25);
  transform: translateY(-2px);
}

.ritual-button.ghost {
  min-width: 112px;
  border-color: rgba(255, 255, 255, .13);
  color: var(--muted);
  background: rgba(255, 255, 255, .02);
  box-shadow: none;
}

.ritual-button:disabled {
  cursor: wait;
  opacity: .42;
}

.diagnostic {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .04em;
  text-align: center;
}

.utility-actions {
  position: fixed;
  z-index: 22;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle,
.history-toggle,
.account-chip {
  padding: 8px 15px;
  border: 1px solid var(--gold-dim);
  border-radius: 22px;
  color: var(--gold-bright);
  background: rgba(12, 10, 22, .58);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .42);
  backdrop-filter: blur(9px);
  cursor: pointer;
  font: 500 10px/1.3 "Cinzel", serif;
  letter-spacing: .07em;
  transition: transform .2s, border-color .2s;
}

.theme-toggle:hover,
.history-toggle:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(460px, calc(100vw - 28px));
  padding-block: 5px;
  padding-right: 6px;
  cursor: default;
  letter-spacing: 0;
}

.account-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--edge);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(223, 184, 61, .08);
}

.account-identity {
  display: grid;
  min-width: 0;
  text-align: left;
}

.account-identity strong,
.account-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-email-status {
  color: #ca8ca2 !important;
}

.account-email-status.is-verified {
  color: var(--gold-dim) !important;
}

.account-provider-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid rgba(223, 184, 61, .24);
  border-radius: 12px;
  color: var(--gold-dim);
  background: rgba(223, 184, 61, .06);
  font-size: 8px;
  white-space: nowrap;
}

.account-google-link {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.account-google-link label {
  color: var(--muted);
  font-size: 8px;
}

.google-link-password {
  width: 82px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, .025);
  font-family: system-ui, sans-serif;
  font-size: 9px;
  outline: none;
}

.google-link-password:focus {
  border-color: var(--gold-dim);
}

.account-google-link.is-busy {
  opacity: .5;
  pointer-events: none;
}

.google-link-button-slot {
  display: grid;
  min-width: 34px;
  min-height: 34px;
  place-items: center;
}

.google-link-button-slot.is-disabled {
  opacity: .38;
  pointer-events: none;
}

.account-google-unconfigured {
  flex: 0 0 auto;
  max-width: 82px;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.35;
  text-align: center;
}

.account-identity strong {
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 600;
}

.account-identity small {
  margin-top: 2px;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 8px;
}

.logout-button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, .025);
  cursor: pointer;
  font-size: 9px;
}

.logout-button:hover:not(:disabled) {
  border-color: var(--gold-dim);
  color: var(--gold-bright);
}

.logout-button:disabled {
  cursor: wait;
  opacity: .5;
}

.history-toggle b {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  margin-left: 3px;
  padding-inline: 5px;
  border-radius: 10px;
  color: var(--night);
  background: var(--gold);
  font: 700 9px/1 "Cinzel", serif;
}

.history-toggle:disabled {
  cursor: wait;
  opacity: .48;
}

.history-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(390px, calc(100vw - 18px));
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--edge);
  color: var(--text);
  background:
    radial-gradient(circle at 0 0, rgba(223, 184, 61, .12), transparent 38%),
    rgba(12, 10, 22, .98);
  box-shadow: 22px 0 70px rgba(0, 0, 0, .72);
  animation: historyDrawerIn .28s ease both;
}

.history-drawer::backdrop {
  background: rgba(2, 2, 7, .68);
  backdrop-filter: blur(4px);
}

@keyframes historyDrawerIn {
  from { opacity: 0; transform: translateX(-28px); }
}

.history-drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 25px 20px 18px;
}

.history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--edge);
}

.history-heading span {
  color: var(--gold);
  font: 500 9px/1 "Cinzel", serif;
  letter-spacing: .14em;
}

.history-heading h2 {
  margin: 7px 0 0;
  color: var(--gold-bright);
  font: 600 30px/1.05 "Cormorant Garamond", serif;
}

.history-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--edge);
  border-radius: 50%;
  color: var(--gold-bright);
  background: rgba(255, 255, 255, .025);
  cursor: pointer;
  font: 300 24px/1 "Cormorant Garamond", serif;
}

.history-intro {
  margin: 16px 0 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.history-status {
  min-height: 18px;
  margin: 5px 0 12px;
  color: var(--gold-dim);
  font-size: 9px;
  letter-spacing: .04em;
}

.history-list {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 0;
  padding: 2px 3px 16px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--gold-dim) transparent;
}

.history-item {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 88px;
  padding: 14px 15px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, .025);
  text-decoration: none;
  transition: border-color .2s, background .2s, transform .2s;
}

.history-item:hover {
  border-color: var(--gold-dim);
  background: rgba(223, 184, 61, .07);
  transform: translateX(2px);
}

.history-item.is-current {
  border-color: var(--gold);
  background: rgba(223, 184, 61, .1);
}

.history-item.is-current::after {
  position: absolute;
  top: 9px;
  right: 10px;
  content: "正在查看";
  color: var(--gold);
  font-size: 8px;
  letter-spacing: .06em;
}

.history-question {
  display: -webkit-box;
  padding-right: 54px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-meta,
.history-item time {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.history-item time {
  color: var(--gold-dim);
}

.history-footer {
  display: grid;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid var(--edge);
}

.history-secondary-action {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  color: var(--gold-bright);
  background: rgba(223, 184, 61, .06);
  cursor: pointer;
  font-size: 10px;
}

.history-secondary-action:disabled {
  cursor: wait;
  opacity: .5;
}

.spread-picker {
  position: fixed;
  z-index: 21;
  top: 14px;
  right: 14px;
  width: 54px;
  max-height: calc(100vh - 28px);
  padding: 8px 10px;
  overflow: hidden auto;
  border: 1px solid rgba(223, 184, 61, .11);
  border-radius: 10px;
  background: rgba(12, 10, 22, .3);
  opacity: .35;
  backdrop-filter: blur(8px);
  transition: width .36s, opacity .3s, background .3s, border-color .3s;
}

.spread-picker:hover,
.spread-picker.is-open {
  width: 242px;
  border-color: var(--edge);
  background: rgba(12, 10, 22, .95);
  opacity: 1;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .7);
}

.spread-picker-title {
  width: 100%;
  padding: 2px 0;
  border: 0;
  color: var(--gold);
  background: transparent;
  cursor: pointer;
  font: 500 10px/1.3 "Cinzel", serif;
  letter-spacing: .14em;
  text-align: left;
  white-space: nowrap;
}

.spread-list {
  display: grid;
  gap: 7px;
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  transition: max-height .36s, margin .3s, opacity .25s;
}

.spread-picker:hover .spread-list,
.spread-picker.is-open .spread-list {
  max-height: 640px;
  margin-top: 9px;
  opacity: 1;
}

.spread-option {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: border-color .2s, background .2s;
}

.spread-option:hover,
.spread-option.is-active {
  border-color: var(--gold-dim);
}

.spread-option.is-active {
  background: rgba(223, 184, 61, .09);
}

.spread-number {
  color: var(--gold);
  font: 500 16px/1.2 "Cinzel", serif;
  text-align: center;
}

.spread-copy strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
}

.spread-copy em {
  margin-left: 4px;
  color: var(--gold);
  font-size: 9px;
  font-style: normal;
}

.spread-copy small {
  display: block;
  max-height: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
  opacity: 0;
  transition: max-height .3s, margin .3s, opacity .25s;
}

.spread-option.is-active .spread-copy small,
.spread-option.is-open .spread-copy small {
  max-height: 100px;
  margin-top: 6px;
  opacity: 1;
}

.camera-widget {
  position: fixed;
  z-index: 23;
  right: 16px;
  bottom: 16px;
  width: 208px;
  padding: 10px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: rgba(12, 10, 22, .92);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .7);
  backdrop-filter: blur(14px);
  transition: transform .35s;
}

.camera-widget.is-collapsed {
  transform: translateY(calc(100% - 42px));
}

.camera-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  color: var(--gold);
  background: transparent;
  cursor: pointer;
  font: 500 10px/1.4 "Cinzel", serif;
  letter-spacing: .08em;
}

.camera-widget-head span:first-child {
  display: inline-flex;
  align-items: center;
}

#camera-dot {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #555;
}

#camera-dot.is-on {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.camera-box {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.camera-box video,
.camera-box canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-box video {
  transform: scaleX(-1);
}

.camera-box canvas {
  z-index: 2;
  transform: scaleX(-1);
}

.gesture-name {
  position: absolute;
  z-index: 3;
  right: 6px;
  bottom: 6px;
  padding: 3px 8px;
  border-radius: 7px;
  color: var(--gold);
  background: rgba(0, 0, 0, .58);
  font-size: 10px;
}

.gesture-charge {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 6px;
  width: 70%;
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(255, 255, 255, .14);
  opacity: 0;
  transform: translateX(-50%);
}

.gesture-charge.is-visible {
  opacity: 1;
}

.gesture-charge i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
}

.camera-widget > p {
  min-height: 28px;
  margin: 7px 1px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
}

.camera-start {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  color: var(--gold-bright);
  background: rgba(40, 32, 20, .5);
  cursor: pointer;
  font: 500 10px/1.2 "Cinzel", serif;
  letter-spacing: .08em;
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  top: 22px;
  max-width: calc(100vw - 30px);
  padding: 10px 23px;
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  color: var(--gold-bright);
  background: rgba(12, 10, 22, .96);
  font: 500 12px/1.4 "Cinzel", serif;
  letter-spacing: .09em;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
  transition: opacity .3s, transform .3s;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reading-panel {
  width: min(94vw, 760px);
  margin: 38px auto 4px;
  animation: readingIn .65s ease both;
}

@keyframes readingIn {
  from { opacity: 0; transform: translateY(18px); }
}

.reading-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--edge);
}

.reading-heading span,
.synthesis > span {
  color: var(--gold);
  font: 500 9px/1 "Cinzel", serif;
  letter-spacing: .16em;
}

.reading-heading h2 {
  margin: 6px 0 0;
  color: var(--gold-bright);
  font: 600 30px/1.1 "Cormorant Garamond", serif;
}

.quiet-link {
  padding: 5px 0;
  border: 0;
  border-bottom: 1px solid var(--edge);
  color: var(--gold);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
}

.share-menu {
  position: relative;
  flex: 0 0 auto;
}

.share-menu-toggle[aria-expanded="true"] {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.share-menu-popover {
  position: absolute;
  z-index: 12;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  width: max-content;
  min-width: 188px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border: 1px solid var(--gold-dim);
  border-radius: 9px;
  background: rgba(12, 10, 22, .98);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .48);
  backdrop-filter: blur(14px);
}

.share-menu-popover::before {
  position: absolute;
  top: -5px;
  right: 18px;
  width: 8px;
  height: 8px;
  border-top: 1px solid var(--gold-dim);
  border-left: 1px solid var(--gold-dim);
  background: rgba(12, 10, 22, .98);
  content: "";
  transform: rotate(45deg);
}

.share-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.share-menu-item span[aria-hidden="true"] {
  width: 14px;
  color: var(--gold);
  font-family: "Cinzel", serif;
  text-align: center;
}

.share-menu-item:hover,
.share-menu-item:focus-visible {
  color: var(--gold-bright);
  background: rgba(223, 184, 61, .11);
}

.reading-question {
  margin: 18px 0;
  color: var(--text);
  font: italic 20px/1.5 "Cormorant Garamond", serif;
  text-align: center;
}

.reading-cards {
  display: grid;
  gap: 12px;
}

.reading-row {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 15px;
  padding: 17px 18px;
  border: 1px solid var(--edge);
  border-radius: 13px;
  background: linear-gradient(155deg, rgba(27, 21, 41, .78), rgba(20, 16, 32, .76));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  backdrop-filter: blur(10px);
  opacity: 0;
  animation: rowIn .5s ease forwards;
  animation-delay: var(--row-delay);
}

@keyframes rowIn {
  to { opacity: 1; transform: none; }
  from { opacity: 0; transform: translateY(12px); }
}

.reading-card-mini {
  display: grid;
  place-items: center;
  width: 58px;
  aspect-ratio: 130 / 210;
  border: 1px solid var(--edge);
  border-radius: 7px;
  color: var(--gold-bright);
  background: linear-gradient(160deg, var(--panel-soft), var(--panel));
  font-size: 28px;
  overflow: hidden;
}

.reading-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.reading-card-image.is-reversed {
  transform: rotate(180deg);
}

.reading-position {
  color: var(--gold);
  font: 500 9px/1.2 "Cinzel", serif;
  letter-spacing: .13em;
}

.reading-card-title {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 17px;
}

.reading-card-title small {
  margin-left: 7px;
  color: var(--muted);
  font: 500 9px/1 "Cinzel", serif;
}

.orientation-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 20px;
  color: var(--gold);
  font-size: 8px;
  font-weight: 400;
  vertical-align: 2px;
}

.orientation-tag.is-reversed {
  color: #ca8ca2;
}

.reading-keywords {
  margin: 7px 0 0;
  color: var(--gold-dim);
  font-size: 9px;
  letter-spacing: .08em;
}

.reading-meaning {
  margin: 7px 0 0;
  color: #bdb5c9;
  font-size: 12px;
  line-height: 1.85;
  white-space: pre-line;
}

.synthesis {
  margin-top: 18px;
  padding: 26px;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, .025);
}

.summary {
  margin: 18px 0;
  color: var(--text);
  font: 500 19px/1.75 "Cormorant Garamond", serif;
  white-space: pre-line;
}

.next-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.next-step strong {
  color: var(--gold);
  font-size: 10px;
}

.next-step p {
  margin: 0;
  color: #c7bfce;
  font-size: 11px;
  line-height: 1.8;
  white-space: pre-line;
}

.synthesis > small {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.7;
}

.feedback {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--edge);
}

.feedback > div:first-child strong,
.feedback > div:first-child small {
  display: block;
}

.feedback > div:first-child strong {
  font-size: 11px;
}

.feedback > div:first-child small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.rating {
  display: flex;
  gap: 6px;
}

.rating button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .16);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.rating button:hover,
.rating button.is-selected {
  border-color: var(--gold-bright);
  color: var(--night);
  background: var(--gold-bright);
}

#feedback-status {
  color: var(--gold);
  font-size: 9px;
}

.site-footer {
  position: relative;
  z-index: 3;
  padding: 26px 16px 32px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
  text-align: center;
  opacity: .76;
}

.site-footer p {
  margin: 2px 0;
}

.site-footer small {
  color: var(--gold-dim);
}

/* Sakura theme keeps the same information architecture while switching the full visual skin. */
body[data-theme="sakura"] {
  --night: #ffe9f3;
  --night-soft: #ffddeb;
  --panel: #fff5fa;
  --panel-soft: #ffe5f1;
  --gold: #e75a97;
  --gold-bright: #ff86bb;
  --gold-dim: #bc668e;
  --text: #5d3751;
  --muted: #9e7892;
  --edge: rgba(231, 90, 151, .28);
  --wine: #9474d2;
  --shadow: rgba(175, 83, 129, .28);
}

body[data-theme="sakura"] .atmosphere {
  opacity: .56;
  background:
    radial-gradient(42% 38% at 52% 38%, #ffc2db 0, transparent 65%),
    radial-gradient(31% 28% at 16% 80%, #ffd6e9 0, transparent 64%),
    radial-gradient(29% 25% at 84% 18%, #e5d2ff 0, transparent 64%);
}

body[data-theme="sakura"] .vignette {
  background: radial-gradient(120% 100% at 50% 36%, transparent 50%, rgba(255, 164, 201, .27) 90%, rgba(245, 142, 189, .42));
}

body[data-theme="sakura"] .grain {
  opacity: .025;
}

body[data-theme="sakura"] .tarot-card-back.is-front {
  box-shadow: 0 14px 34px rgba(210, 80, 140, .32), inset 0 0 0 2px #f4dc8e, 0 0 30px rgba(231, 90, 151, .45);
}

body[data-theme="sakura"] .theme-toggle,
body[data-theme="sakura"] .history-toggle,
body[data-theme="sakura"] .account-chip,
body[data-theme="sakura"] .history-drawer,
body[data-theme="sakura"] .spread-picker,
body[data-theme="sakura"] .camera-widget,
body[data-theme="sakura"] .toast,
body[data-theme="sakura"] .share-menu-popover,
body[data-theme="sakura"] .share-menu-popover::before {
  background: rgba(255, 244, 250, .9);
}

/* Authentication is intentionally isolated from the reading UI while sharing its visual language. */
.auth-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  overflow-x: hidden;
}

.auth-shell {
  position: relative;
  z-index: 3;
  display: grid;
  width: 100%;
  min-height: 100dvh;
  padding: 28px 16px;
  place-items: center;
}

.auth-card {
  width: min(100%, 460px);
  padding: clamp(25px, 6vw, 42px);
  border: 1px solid var(--edge);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0, rgba(223, 184, 61, .09), transparent 38%),
    rgba(12, 10, 22, .88);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .62);
  backdrop-filter: blur(18px);
}

.auth-brand {
  text-align: center;
}

.auth-sigil {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 15px;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  color: var(--gold-bright);
  background: rgba(223, 184, 61, .055);
  box-shadow: 0 0 35px rgba(223, 184, 61, .15), inset 0 0 20px rgba(223, 184, 61, .08);
  font: 500 27px/1 "Cormorant Garamond", serif;
  place-items: center;
}

.auth-brand p {
  margin: 0;
  color: var(--gold-dim);
  font: 500 9px/1 "Cinzel", serif;
  letter-spacing: .2em;
}

.auth-brand h1 {
  margin: 10px 0 7px;
  color: var(--gold-bright);
  font: 600 clamp(1.65rem, 8vw, 2.25rem)/1.2 "Cormorant Garamond", "Noto Serif SC", serif;
  letter-spacing: .13em;
}

.auth-brand > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 28px 0 22px;
  border-bottom: 1px solid var(--edge);
}

.auth-provider {
  display: grid;
  min-height: 44px;
  place-items: center;
}

.google-button-slot {
  display: grid;
  width: 100%;
  min-height: 44px;
  place-items: center;
  transition: opacity .2s;
}

.google-button-slot.is-busy {
  opacity: .5;
  pointer-events: none;
}

.auth-provider-note {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .04em;
  text-align: center;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 18px 0 20px;
  color: var(--muted);
  font-size: 8px;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: rgba(255, 255, 255, .08);
  content: "";
}

.auth-tab {
  padding: 11px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: .14em;
}

.auth-tab.is-active {
  border-bottom-color: var(--gold);
  color: var(--gold-bright);
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field label {
  color: var(--gold-dim);
  font-size: 10px;
  letter-spacing: .08em;
}

.auth-field input {
  width: 100%;
  min-height: 45px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, .035);
  outline: none;
  font-family: system-ui, "Noto Serif SC", sans-serif;
  transition: border-color .2s, background .2s;
}

.auth-field input:focus {
  border-color: var(--gold-dim);
  background: rgba(223, 184, 61, .05);
}

.auth-field input[readonly] {
  color: var(--muted);
  background: rgba(255, 255, 255, .018);
  cursor: default;
}

.auth-field small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
}

.auth-submit {
  min-height: 47px;
  margin-top: 5px;
  border: 1px solid var(--gold-dim);
  border-radius: 5px;
  color: var(--night);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  box-shadow: 0 8px 28px rgba(223, 184, 61, .16);
  cursor: pointer;
  font: 600 11px/1.3 "Cinzel", "Noto Serif SC", serif;
  letter-spacing: .13em;
}

.auth-submit:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: .66;
}

.registration-verification {
  display: grid;
  gap: 15px;
  padding: 17px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(223, 184, 61, .035);
}

.verification-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.verification-heading strong {
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 500;
}

.verification-heading p {
  margin: 6px 0 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.verification-heading b {
  color: var(--text);
  font-family: system-ui, sans-serif;
  font-weight: 500;
}

.verification-heading small {
  color: var(--gold-dim);
  font-size: 8px;
}

.verification-code-field input {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .36em;
  text-align: center;
}

.auth-text-button {
  flex: 0 0 auto;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid var(--edge);
  color: var(--gold);
  background: transparent;
  cursor: pointer;
  font-size: 8px;
}

.auth-secondary-button {
  min-height: 39px;
  padding: 8px 12px;
  border: 1px solid var(--edge);
  border-radius: 5px;
  color: var(--gold-dim);
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
  font-size: 9px;
}

.auth-text-button:disabled,
.auth-secondary-button:disabled {
  cursor: wait;
  opacity: .5;
}

.auth-message {
  min-height: 18px;
  margin: -10px 0 14px;
  color: var(--gold-dim);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.auth-message.is-error {
  padding: 9px 11px;
  border: 1px solid rgba(202, 140, 162, .34);
  border-radius: 6px;
  color: #e5aabd;
  background: rgba(116, 48, 68, .14);
}

.auth-switch-copy {
  margin: 19px 0 0;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.auth-switch-copy button {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid var(--edge);
  color: var(--gold);
  background: transparent;
  cursor: pointer;
}

.auth-privacy {
  margin: 25px 0 0;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: var(--muted);
  font-size: 8px;
  line-height: 1.7;
  text-align: center;
}

body[data-theme="sakura"] .share-menu-item:hover,
body[data-theme="sakura"] .share-menu-item:focus-visible {
  background: rgba(231, 90, 151, .1);
}

body[data-theme="sakura"] .history-item {
  border-color: rgba(193, 84, 139, .16);
  background: rgba(255, 255, 255, .42);
}

body[data-theme="sakura"] .history-item:hover,
body[data-theme="sakura"] .history-item.is-current {
  border-color: rgba(193, 84, 139, .44);
  background: rgba(255, 222, 238, .7);
}

body[data-theme="sakura"] .reading-row,
body[data-theme="sakura"] .reading-card-mini,
body[data-theme="sakura"] .slot-card-front,
body[data-theme="sakura"] .reveal-front {
  background: linear-gradient(155deg, rgba(255, 245, 250, .92), rgba(255, 226, 240, .9));
}

body[data-theme="sakura"] .reading-meaning,
body[data-theme="sakura"] .next-step p {
  color: #755068;
}

body[data-theme="sakura"] .ritual-button {
  background: linear-gradient(180deg, rgba(255, 230, 241, .85), rgba(255, 211, 232, .82));
}

@media (max-width: 760px) {
  .page-shell {
    padding-top: 104px;
  }

  .tarot-stage {
    height: min(50vh, 380px);
    min-height: 315px;
  }

  .utility-actions {
    top: 10px;
    left: 10px;
    right: 74px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .theme-toggle,
  .history-toggle {
    padding: 7px 11px;
    font-size: 9px;
  }

  .account-chip {
    order: 3;
    max-width: 100%;
  }

  .spread-picker {
    top: 10px;
    right: 10px;
  }

  .camera-widget {
    right: 10px;
    bottom: 10px;
    width: 170px;
  }

  .tarot-card-back {
    left: -56px;
    top: -90px;
    width: 112px;
    height: 180px;
  }

  .reading-row {
    grid-template-columns: 56px 1fr;
    padding: 14px;
  }

  .reading-card-mini {
    width: 50px;
    font-size: 24px;
  }
}

@media (max-width: 520px) {
  .auth-shell {
    padding: 12px;
  }

  .auth-card {
    padding: 25px 19px;
    border-radius: 14px;
  }

  .auth-brand h1 {
    font-size: 1.7rem;
  }

  .history-drawer {
    width: 100vw;
  }

  .history-drawer-inner {
    padding: 20px 15px 15px;
  }

  .history-toggle b {
    display: none;
  }

  .page-shell {
    padding-inline: 10px;
  }

  .masthead h1 {
    font-size: 1.45rem;
    letter-spacing: .12em;
  }

  .cn-title {
    font-size: 13px;
    letter-spacing: .18em;
  }

  .masthead-hint {
    font-size: 9px;
  }

  .intention {
    margin-top: 13px;
  }

  .question-line input {
    font-size: 12px;
  }

  .tarot-stage {
    width: 100vw;
    height: 340px;
    min-height: 340px;
    margin-inline: calc(50% - 50vw);
  }

  .rune-ring {
    width: 88vw;
  }

  .stage-hint {
    font-size: 13px;
  }

  .primary-actions {
    gap: 8px;
  }

  .ritual-button {
    min-width: 174px;
    padding: 11px 18px;
  }

  .ritual-button.ghost {
    min-width: 104px;
  }

  .reading-panel {
    width: calc(100vw - 20px);
  }

  .reading-heading {
    align-items: flex-start;
    gap: 10px;
  }

  .reading-heading h2 {
    font-size: 26px;
  }

  .share-menu-popover {
    min-width: 174px;
  }

  .reading-row {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .reading-copy {
    width: 100%;
  }

  .reading-meaning {
    text-align: left;
  }

  .synthesis {
    padding: 20px 17px;
  }

  .next-step {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .feedback {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .camera-widget {
    width: 150px;
  }
}

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