/* Хөзрийн мэрэг: the felt table, card backs and faces. Everything else reuses style.css. */
.cards-hint { text-align: center; font-family: var(--serif); font-style: italic; color: var(--bone); min-height: 3.2em; margin: 0 0 8px; }
.cards-table {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 10px; align-items: start;
  padding: 20px 16px 10px; border-radius: var(--radius);
  background: radial-gradient(120% 90% at 50% 10%, #5c201b, #3d1412 60%, #2a0e0c);
  border: 1px solid #7d3a2c;
  box-shadow: inset 0 0 0 6px #32100e, inset 0 0 0 7px #b8863b55, inset 0 30px 60px #0005;
}
.cards-table.done { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 22px 12px 14px; animation: rise .45s var(--ease); }

.cards-slot {
  display: block; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform .25s var(--ease);
}
.cards-slot:disabled { cursor: default; }
/* Laid out by hand, not by a ruler */
.cards-slot:nth-child(3n+1) { rotate: -1.6deg; }
.cards-slot:nth-child(4n+2) { rotate: 1.2deg; }
.cards-slot:nth-child(5n) { rotate: 2deg; }
.cards-table.done .cards-slot { rotate: none; }
.cards-table.done .cards-slot:first-child { rotate: -2deg; }
.cards-table.done .cards-slot:last-child { rotate: 2deg; }
.cards-slot.picked { transform: translateY(-8px); }
.cards-table:not(.done) .cards-slot:not(.picked):active { transform: scale(.95); }

.cards-flip { display: block; position: relative; aspect-ratio: 5 / 7; border-radius: 9px; filter: drop-shadow(0 5px 5px #0008); transition: box-shadow .25s; }
.cards-slot.picked .cards-flip { box-shadow: 0 0 0 2px var(--gold), 0 0 18px #e0ad4d77; }
.cards-table.done .cards-flip { border-radius: 11px; }
.cards-back, .cards-face {
  position: absolute; inset: 0; border-radius: inherit;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .5s var(--ease);
}
.cards-back { transform: perspective(600px) rotateY(0deg); }
.cards-face { transform: perspective(600px) rotateY(-180deg); }
.flipped .cards-back { transform: perspective(600px) rotateY(180deg); }
.flipped .cards-face { transform: perspective(600px) rotateY(0deg); }

/* Back: an ivory edge around red felt with a gold lattice and a medallion */
.cards-back {
  border: 3px solid var(--bone);
  background:
    repeating-linear-gradient(45deg, #e0ad4d3d 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, #e0ad4d3d 0 1px, transparent 1px 7px),
    linear-gradient(160deg, #a23a2c, #7a2a22 55%, #5a1e1a);
  box-shadow: inset 0 0 0 1px #b8863b;
}
.cards-back::before {
  content: ''; position: absolute; inset: 0; margin: auto; width: 38%; aspect-ratio: 1; rotate: 45deg;
  background: #6a231d; border: 1px solid var(--gold); box-shadow: inset 0 0 0 3px #6a231d, inset 0 0 0 4px #e0ad4d99;
}
.cards-back::after { content: ''; position: absolute; inset: 0; margin: auto; width: 9%; aspect-ratio: 1; rotate: 45deg; background: var(--gold); }

/* Face: dark lacquer with a gold rim; ♥ ♦ ember, ♣ ♠ ivory */
.cards-face {
  display: grid; place-items: center; color: var(--bone);
  background: linear-gradient(155deg, #33281f, #1b1510 70%);
  border: 1px solid var(--gold); box-shadow: inset 0 0 0 3px #1b1510, inset 0 0 0 4px #e0ad4d44;
  font-family: var(--serif); line-height: 1;
}
.cards-face.red { color: #e2523a; }
.cards-pip { font-size: clamp(1.6rem, 9vw, 2.4rem); }
.cards-table.done .cards-pip { font-size: clamp(2.2rem, 13vw, 3.4rem); }
.cards-corner { position: absolute; top: 7%; left: 9%; display: grid; justify-items: center; gap: 1px; font-weight: 700; font-size: .8rem; }
.cards-corner i { font-style: normal; font-size: .7rem; }
.cards-corner:last-child { inset: auto 9% 7% auto; rotate: 180deg; }
.cards-table.done .cards-corner { font-size: 1.05rem; }
.cards-table.done .cards-corner i { font-size: .85rem; }

/* Under each card: its place in the reading, then its name once it has turned */
.cards-cap { display: block; min-height: 1.5em; margin-top: 6px; text-align: center; font-family: var(--serif); font-size: .78rem; letter-spacing: -.01em; line-height: 1.25; color: var(--bone); overflow-wrap: anywhere; }
.cards-cap small { display: block; font: 600 .68rem/1.5 system-ui, sans-serif; letter-spacing: .04em; color: var(--gold); }
.cards-table:not(.done) .cards-cap { height: 1.1rem; min-height: 0; overflow: hidden; font-size: 0; }
