.tarot-body .tarot-game-panel {
  display: grid;
  gap: 1rem;
  overflow: hidden;
}

.bet-stepper {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) 3.2rem;
  gap: 0.45rem;
}

.bet-stepper input {
  min-width: 0;
}

.step-button {
  min-height: 2.7rem;
  border: 1px solid #335368;
  border-radius: 0.45rem;
  background: #102b38;
  color: #dcecf4;
  font-weight: 950;
  cursor: pointer;
}

.step-button:hover,
.step-button:focus-visible {
  border-color: #73cfff;
  background: #173849;
}

.tarot-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 17rem);
  gap: 1rem;
  align-items: stretch;
}

.tarot-stage-surface {
  position: relative;
  display: grid;
  grid-template-rows: minmax(18rem, 1fr) auto auto;
  gap: 0.85rem;
  min-height: 35rem;
  padding: 1.2rem;
  overflow: hidden;
  border-radius: 0.45rem;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 204, 54, 0.18), transparent 12rem),
    radial-gradient(circle at 18% 72%, rgba(92, 189, 255, 0.11), transparent 13rem),
    radial-gradient(circle at 86% 78%, rgba(255, 87, 136, 0.12), transparent 12rem),
    linear-gradient(180deg, #091c27, #06151f);
}

.tarot-stage-surface::before {
  content: "";
  position: absolute;
  inset: 0.8rem;
  border-radius: 0.45rem;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 3.8rem 3.8rem;
  pointer-events: none;
}

.tarot-table-line {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(28rem, 82%);
  height: 0.35rem;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #34576a;
  box-shadow:
    0 -4.8rem 0 -0.12rem rgba(52, 87, 106, 0.7),
    0 4.8rem 0 -0.12rem rgba(52, 87, 106, 0.7);
}

.tarot-card-row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(6.6rem, 8rem) minmax(7.6rem, 9rem) minmax(6.6rem, 8rem);
  gap: clamp(0.75rem, 3vw, 1.3rem);
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 21rem;
}

.tarot-card {
  --edge: #9db6c6;
  --glow: rgba(157, 182, 198, 0.3);
  position: relative;
  height: 12.2rem;
  perspective: 900px;
}

.tarot-card.centre {
  height: 15rem;
}

.tarot-card.minor {
  --edge: #a9c4d2;
  --glow: rgba(169, 196, 210, 0.3);
}

.tarot-card.major {
  --edge: #ffc928;
  --glow: rgba(255, 201, 40, 0.5);
}

.tarot-card.zero {
  --edge: #f05a86;
  --glow: rgba(240, 90, 134, 0.42);
}

.tarot-card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.46s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.tarot-card.revealed .tarot-card-inner {
  transform: rotateY(180deg);
}

.tarot-card-back,
.tarot-card-face {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: space-between;
  min-width: 0;
  border: 0.22rem solid var(--edge);
  border-radius: 0.65rem;
  backface-visibility: hidden;
  overflow: hidden;
  box-shadow:
    0 0 0.8rem var(--glow),
    0 1rem 1.4rem rgba(0, 0, 0, 0.35);
}

.tarot-card-back {
  padding: 0.65rem;
  background:
    radial-gradient(circle at 50% 43%, rgba(255, 255, 255, 0.23), transparent 1.8rem),
    linear-gradient(135deg, transparent 18%, rgba(255, 255, 255, 0.09) 18% 20%, transparent 20% 38%, rgba(255, 255, 255, 0.08) 38% 40%, transparent 40%),
    linear-gradient(180deg, #405c70, #1a3444);
}

.tarot-card-back::before,
.tarot-card-back::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.tarot-card-back::before {
  width: 4rem;
  height: 4rem;
  border: 0.35rem solid rgba(255, 255, 255, 0.35);
}

.tarot-card-back::after {
  width: 1.15rem;
  height: 1.15rem;
  background: #98d7f4;
  box-shadow: 0 0 1rem rgba(152, 215, 244, 0.7);
}

.tarot-card-face {
  transform: rotateY(180deg);
  padding: 0.55rem;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.36), transparent 3.9rem),
    linear-gradient(180deg, #f4fbff, #dce6ed);
  color: #17303f;
}

.tarot-card.major .tarot-card-face {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.62), transparent 4.5rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 28%),
    linear-gradient(180deg, #ffcf27, #ff9f18);
  color: #542d05;
}

.tarot-card.zero .tarot-card-face {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.42), transparent 4rem),
    linear-gradient(180deg, #743147, #341925);
  color: #f8eaf0;
}

.tarot-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: center;
  min-width: 0;
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.tarot-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 1.4rem;
  padding-inline: 0.35rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
}

.tarot-art {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  width: 4.6rem;
  height: 4.6rem;
  margin-block: 0.4rem;
}

.tarot-card.centre .tarot-art {
  width: 5.8rem;
  height: 5.8rem;
}

.tarot-art::before,
.tarot-art::after {
  content: "";
  position: absolute;
}

.tarot-art.sun::before {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: #fff2a8;
  box-shadow: 0 0 0 0.5rem rgba(255, 113, 39, 0.52), 0 0 1.5rem rgba(255, 255, 255, 0.65);
}

.tarot-art.moon::before {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 999px;
  background: #7bd8ff;
  box-shadow: inset -0.95rem 0 0 #24465c, 0 0 1.3rem rgba(123, 216, 255, 0.56);
}

.tarot-art.cup::before {
  width: 2.8rem;
  height: 2.3rem;
  border: 0.42rem solid currentColor;
  border-top: 0;
  border-radius: 0 0 1.3rem 1.3rem;
}

.tarot-art.cup::after {
  width: 3.1rem;
  height: 0.35rem;
  bottom: 0.55rem;
  border-radius: 999px;
  background: currentColor;
}

.tarot-art.wand::before {
  width: 0.55rem;
  height: 4.6rem;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(34deg);
}

.tarot-art.wand::after {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 0.25rem;
  border: 0.35rem solid currentColor;
  transform: rotate(45deg) translateY(-1.55rem);
}

.tarot-art.void::before {
  width: 3.4rem;
  height: 3.4rem;
  border: 0.45rem solid currentColor;
  border-radius: 999px;
  opacity: 0.78;
}

.tarot-art.void::after {
  width: 4rem;
  height: 0.45rem;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-35deg);
}

.tarot-art.star::before {
  width: 4.1rem;
  height: 4.1rem;
  background: currentColor;
  clip-path: polygon(50% 0, 61% 34%, 98% 35%, 68% 56%, 79% 92%, 50% 70%, 21% 92%, 32% 56%, 2% 35%, 39% 34%);
}

.tarot-art.coin::before {
  width: 3.45rem;
  height: 3.45rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: inset 0 0 0 0.55rem rgba(255, 255, 255, 0.35);
}

.tarot-card-title {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  text-align: center;
}

.tarot-card-title strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.tarot-card-title span {
  color: currentColor;
  font-size: 0.68rem;
  font-weight: 850;
  opacity: 0.78;
}

.tarot-total {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 2.3rem minmax(7rem, 12rem) 2.3rem;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-height: 3.3rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  background: #102c3a;
  box-shadow:
    inset 0 0 0 0.2rem #274b60,
    0 0.8rem 1rem rgba(0, 0, 0, 0.24);
}

.tarot-total strong {
  display: grid;
  place-items: center;
  min-height: 2.25rem;
  border-radius: 999px;
  background: #263f50;
  color: #f7fdff;
  font-size: clamp(1.05rem, 3vw, 1.45rem);
  font-weight: 950;
}

.tarot-orb {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 0.22rem solid #73b9ff;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.9), transparent 0.45rem),
    linear-gradient(145deg, #2e8dff, #1b4f9b);
  box-shadow: 0 0 1rem rgba(70, 166, 255, 0.45);
}

.tarot-status {
  position: relative;
  z-index: 3;
  min-height: 1.4rem;
  margin: 0;
  color: #bdd7e4;
  text-align: center;
  font-weight: 850;
}

.tarot-stage-surface.running .tarot-total {
  animation: tarot-pulse 0.7s ease-in-out infinite;
}

.tarot-stage-surface.win .tarot-total strong {
  color: #1fe276;
}

.tarot-stage-surface.loss .tarot-total strong {
  color: #ff6b91;
}

.tarot-paytable-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.7rem;
  min-height: 35rem;
  padding: 0.85rem;
  border-radius: 0.45rem;
  background: #183441;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.tarot-paytable-header {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: baseline;
}

.tarot-paytable-header span {
  color: #a8c8d8;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.tarot-paytable-columns,
.tarot-paytable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
}

.tarot-paytable-columns {
  color: #a8c8d8;
  font-size: 0.72rem;
  font-weight: 950;
}

.tarot-paytable-list {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  max-height: 31rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.tarot-paytable-row {
  min-height: 2.1rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.35rem;
  background: #102a36;
}

.tarot-paytable-row .swatch {
  display: inline-block;
  width: 0.78rem;
  height: 1.1rem;
  margin-right: 0.4rem;
  border-radius: 0.18rem;
  vertical-align: -0.18rem;
  background: var(--swatch, #ffc928);
}

.tarot-paytable-row strong,
.tarot-paytable-row span:last-child {
  overflow-wrap: anywhere;
}

.tarot-result-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.mapping-panel {
  margin-block: 0.9rem;
}

.mapping-panel summary {
  color: #dff5ff;
  font-weight: 950;
  cursor: pointer;
}

.mapping-wrap {
  max-height: 24rem;
  margin-top: 0.6rem;
}

.mapping-wrap table {
  min-width: 48rem;
}

@keyframes tarot-pulse {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-0.18rem);
  }
}

@media (max-width: 1050px) {
  .tarot-stage-grid {
    grid-template-columns: 1fr;
  }

  .tarot-paytable-card {
    min-height: 18rem;
  }
}

@media (max-width: 760px) {
  .tarot-stage-surface {
    min-height: 42rem;
    padding: 0.85rem;
  }

  .tarot-card-row {
    grid-template-columns: minmax(0, 8.6rem);
    min-height: 32rem;
  }

  .tarot-card,
  .tarot-card.centre {
    height: 9.8rem;
  }

  .tarot-art,
  .tarot-card.centre .tarot-art {
    width: 3.8rem;
    height: 3.8rem;
    margin-block: 0.2rem;
  }

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

  .tarot-table-line {
    top: 44%;
    width: 0.35rem;
    height: min(28rem, 76%);
    box-shadow:
      -4.8rem 0 0 -0.12rem rgba(52, 87, 106, 0.65),
      4.8rem 0 0 -0.12rem rgba(52, 87, 106, 0.65);
  }
}

@media (max-width: 430px) {
  .tarot-card-row {
    min-height: 30rem;
  }

  .tarot-card,
  .tarot-card.centre {
    height: 9.2rem;
  }

  .tarot-total {
    grid-template-columns: 2rem minmax(6rem, 10rem) 2rem;
  }

  .tarot-orb {
    width: 2rem;
    height: 2rem;
  }
}
