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

body.tarot {
  color: #e6dccb;
  background:
    radial-gradient(ellipse at top, rgba(90, 16, 28, 0.45), transparent 55%),
    #000 url("/images/smoke3.png") center top / cover no-repeat fixed;
}

body.tarot h1 {
  font-family: Arvo, Georgia, serif;
  font-weight: 700;
  letter-spacing: 0;
  color: #f0e2b6;
}

body.tarot h2 {
  font-family: Arvo, Georgia, serif;
  font-weight: 700;
  letter-spacing: 0;
  color: #f0e2b6;
}

body.tarot main {
  width: min(1120px, calc(100% - 32px));
}

.eyebrow {
  margin: 0 0 8px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: #ee1f30;
}

.deck-intro { text-align: center; }

.lede {
  max-width: 640px;
  margin: 0 auto 12px;
  font-size: 18px;
  line-height: 1.55;
  color: #d7d0c4;
}

.load-error {
  margin: 18px auto;
  padding: 12px 14px;
  border: 1px solid #ee1f30;
  color: #f4d03f;
  text-align: center;
}

.spread-menu h2 {
  text-align: center;
  font-size: 32px;
  margin: 36px 0 16px;
}

.spread-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.spread-choices button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 168px;
  padding: 22px 20px 20px;
  text-align: left;
  cursor: pointer;
  color: #f3eadc;
  background:
    linear-gradient(180deg, rgba(36, 10, 14, 0.2), rgba(0, 0, 0, 0.35)),
    rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(212, 179, 106, 0.55);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.spread-choices button:hover,
.spread-choices button:focus-visible {
  border-color: #f0e2b6;
  background: rgba(40, 8, 12, 0.88);
  color: #fff;
}

.spread-name {
  font-family: Arvo, Georgia, serif;
  font-size: 32px;
  line-height: 1.15;
  color: #f0e2b6;
}

.spread-blurb {
  font-size: 16px;
  line-height: 1.45;
  color: #c9c0b2;
}

.reading-bar {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
}

.reading-copy h2 {
  margin: 0 0 4px;
  font-size: 32px;
}

.reading-copy p {
  margin: 0;
  color: #c9c0b2;
}

.table {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) minmax(260px, 340px);
  gap: 22px;
  align-items: start;
}

.deck-col {
  position: sticky;
  top: 12px;
}

.deck-pile {
  position: relative;
  width: 168px;
  height: calc(168px * 16 / 9);
  margin: 0 auto 10px;
}

.deck-card {
  position: absolute;
  inset: auto 0 0 auto;
  width: 148px;
  height: calc(148px * 16 / 9);
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(212, 179, 106, 0.65);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  --x: 0px;
  --y: 0px;
  --sx: 0px;
  transform: translate(var(--x), var(--y));
}

.deck-card:nth-child(1) { --x: -16px; --y: 12px; --sx: -46px; }
.deck-card:nth-child(2) { --x: -10px; --y: 8px; --sx: -22px; }
.deck-card:nth-child(3) { --x: -4px; --y: 4px; --sx: 22px; }
.deck-card:nth-child(4) { --x: 2px; --y: 2px; --sx: 42px; }
.deck-card:nth-child(5) { --x: 8px; --y: 0px; --sx: 8px; z-index: 1; }

.deck-pile.is-shuffling .deck-card {
  animation: riffle 0.9s ease;
}

@keyframes riffle {
  0% { transform: translate(var(--x), var(--y)); }
  45% { transform: translate(calc(var(--x) + var(--sx)), -14px); }
  100% { transform: translate(var(--x), var(--y)); }
}

.deck-count,
.back-note {
  margin: 0 0 8px;
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  color: #b7b1a6;
}

.back-note { color: #d4b36a; }

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-gold {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #d4b36a;
  background: transparent;
  color: #f0e2b6;
  font-family: Arvo, Georgia, serif;
  font-size: 18px;
  cursor: pointer;
}

.btn-gold.is-primary {
  background: #4f0404;
  color: #fff;
  border-color: #000;
}

.btn-gold.is-primary:hover,
.btn-gold.is-primary:focus-visible {
  background: #6d0808;
  color: #fff;
}

.btn-gold:hover,
.btn-gold:focus-visible {
  color: #fff;
}

.btn-gold:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.spread {
  display: grid;
  gap: 14px 12px;
  align-items: start;
}

.spread[data-spread="single"] {
  grid-template-columns: minmax(150px, 230px);
  justify-content: center;
}

.spread[data-spread="three"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.spread[data-spread="birth"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.slot-name {
  margin: 0;
  font-family: Arvo, Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: #f0e2b6;
}

.slot-topic {
  margin: 2px 0 8px;
  min-height: 2.5em;
  font-size: 13px;
  line-height: 1.35;
  color: #a6a8a8;
}

.card-well {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  border: 1px dashed rgba(212, 179, 106, 0.55);
  background:
    radial-gradient(ellipse at center, rgba(92, 18, 28, 0.28), rgba(0, 0, 0, 0.15) 72%);
  overflow: hidden;
}

.well-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: rgba(212, 179, 106, 0.75);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.flipper,
.face,
.face img {
  width: 100%;
  height: 100%;
}

.flipper { position: relative; }

.face {
  position: absolute;
  inset: 0;
}

.face img {
  display: block;
  object-fit: cover;
  border-radius: 11px;
}

.back-face { z-index: 1; }

.front-face {
  z-index: 2;
  opacity: 0;
  transform: rotateY(70deg);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.flipper.is-up .back-face { opacity: 0; }

.flipper.is-up .front-face {
  opacity: 1;
  transform: none;
}

.front-face img.is-reversed { transform: rotate(180deg); }

.slot[data-orientation="reversed"] .slot-name { color: #f0c4c8; }

.meanings {
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 4px 14px 16px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(212, 179, 106, 0.4);
  border-radius: 14px;
}

.meanings-title {
  margin: 0;
  padding: 14px 0 8px;
  font-size: 22px;
}

.meanings-empty {
  margin: 8px 0 16px;
  color: #a6a8a8;
}

.meaning {
  padding: 14px 0 16px;
  border-top: 1px solid rgba(212, 179, 106, 0.28);
}

.meaning-kicker,
.field-label,
.orientation {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
}

.meaning-kicker { color: #ee1f30; }

.meaning h3 {
  margin: 0 0 4px;
  font-family: Arvo, Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: #f0e2b6;
}

.orientation.upright { color: #d4b36a; }
.orientation.reversed { color: #ee1f30; }

.meaning-topic,
.meaning-text,
.keywords,
.field-body {
  margin: 0 0 8px;
  line-height: 1.5;
}

.meaning-text { color: #f4efe6; }

.keywords {
  color: #d4b36a;
  font-size: 14px;
}

.imagery { margin: 0 0 8px; }
.imagery summary {
  cursor: pointer;
  color: #d4b36a;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
}

.field-label { color: #a6a8a8; }

.field-body {
  color: #d7d0c4;
  font-size: 15px;
}

body.tarot.is-browsing main {
  width: min(1240px, calc(100% - 32px));
  padding-top: 20px;
}

.browse-layout {
  display: grid;
  grid-template-columns: min(520px, calc(72vh * 9 / 16)) minmax(320px, 520px);
  gap: 28px;
  align-items: start;
  justify-content: center;
  width: 100%;
}

.browse-stage {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.browse-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  width: 100%;
}

.browse-name {
  margin: 0;
  min-width: 0;
  font-family: Arvo, Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: #f0e2b6;
}

.browse-count {
  margin: 0;
  flex: 0 0 auto;
  color: #d4b36a;
  letter-spacing: 0.08em;
  font-size: 16px;
}

.browse-art-wrap {
  width: 100%;
  max-width: 100%;
  touch-action: pan-y;
}

.browse-art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(212, 179, 106, 0.75);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
  background: #000;
}

.browse-art.is-reversed { transform: rotate(180deg); }

.browse-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  width: 100%;
}

.browse-nav .btn-gold {
  width: 100%;
  font-size: 16px;
  padding: 8px 10px;
}

.browse-meanings {
  width: 100%;
  max-height: min(74vh, 920px);
}

.browse-card-meaning {
  padding: 4px 0 16px;
}

.browse-reading {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-left: 3px solid transparent;
}

.browse-reading.is-current {
  border-left-color: #d4b36a;
  background: rgba(79, 4, 4, 0.45);
}

.browse-reading[data-orientation="reversed"].is-current {
  border-left-color: #ee1f30;
}

.noscript {
  width: min(1120px, calc(100% - 32px));
  margin: 12px auto 32px;
  color: #f4d03f;
}

@media (prefers-reduced-motion: reduce) {
  .deck-pile.is-shuffling .deck-card,
  .front-face {
    animation: none;
    transition: none;
  }
}

@media (max-width: 980px) {
  .table { grid-template-columns: 1fr; }
  .deck-col { position: static; }
  .meanings { max-height: none; }
  .spread[data-spread="birth"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spread-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .browse-layout { grid-template-columns: 1fr; width: min(100%, 520px); }
  .browse-stage { width: 100%; }
  .browse-meanings { max-height: none; }
}

@media (max-width: 700px) {
  .lede { font-size: 16px; }
  .spread-menu h2 { margin-top: 22px; font-size: 26px; }
  .spread-choices { grid-template-columns: 1fr; }
  .browse-name { font-size: 22px; }
  .browse-layout { width: 100%; }
  .browse-nav {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "prev next"
      "flip flip";
  }
  #browse-prev { grid-area: prev; }
  #browse-next { grid-area: next; }
  #browse-orientation { grid-area: flip; }
  .browse-art-wrap,
  .browse-art { width: 100%; max-width: none; }
  .spread-choices button { min-height: 0; padding: 16px; }
  .spread-name { font-size: 26px; }
  .reading-bar { flex-direction: column; align-items: stretch; }
  .deck-col {
    display: grid;
    grid-template-columns: 96px 1fr;
    column-gap: 12px;
    align-items: center;
  }
  .deck-pile {
    width: 96px;
    height: calc(86px * 16 / 9);
    margin: 0;
    grid-row: span 3;
  }
  .deck-card {
    width: 78px;
    height: calc(78px * 16 / 9);
  }
  .deck-count,
  .back-note { text-align: left; }
  .actions { grid-column: 2; }
  .spread[data-spread="three"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slot-name { font-size: 13px; }
  .slot-topic { font-size: 11px; min-height: 2.8em; }
  .meanings { padding: 2px 12px 12px; }
}
