/* Dominomancia — pick 3 of 7 face-down domino backs.
   Dominoes are CSS-only: ivory tile with two halves (3x3 pip grid each). */

.dom-page { color: #f5ecd2; }
.dom-header { text-align: center; margin-bottom: 1.4rem; }
.dom-header h1 {
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: #e6c890;
  text-shadow: 0 0 16px rgba(230,200,144,0.55);
  margin: 0 0 .6rem;
}
.dom-intro {
  max-width: 60ch;
  margin: 0 auto;
  color: rgba(245,236,210,0.85);
  line-height: 1.55;
}

.dom-app {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.dom-instruction {
  text-align: center;
  margin: 0;
  color: rgba(245,236,210,0.85);
  font-size: 1.05rem;
  min-height: 1.4em;
}

/* ---------- Slots (where revealed pieces land) ---------- */
.dom-slots {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 520px;
}
.dom-slot {
  aspect-ratio: 2 / 1;
  border: 2px dashed rgba(230,200,144,0.3);
  border-radius: 10px;
  background: rgba(20,12,40,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}
.dom-slot.is-filled {
  border-style: solid;
  border-color: rgba(230,200,144,0.55);
  background: rgba(40,28,80,0.4);
  box-shadow: 0 6px 14px rgba(0,0,0,0.45);
  animation: dom-slot-pop .45s ease-out;
}
@keyframes dom-slot-pop {
  0%   { transform: scale(.6); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- Deck (face-down backs) ---------- */
.dom-deck {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  flex-wrap: wrap;
  padding-top: 14px;
}
.dom-back {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  width: 70px;
  height: 130px;
  position: relative;
  transition: transform .25s ease, opacity .25s ease;
  transform: rotate(calc(-9deg + 3deg * var(--i, 0)));
}
.dom-back:hover:not([disabled]) { transform: rotate(calc(-9deg + 3deg * var(--i, 0))) translateY(-8px); }
.dom-back[disabled] { cursor: not-allowed; opacity: 0.35; pointer-events: none; }
.dom-back-face {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,235,180,0.25), transparent 55%),
    repeating-linear-gradient(45deg, rgba(255,235,180,0.06) 0 4px, transparent 4px 8px),
    linear-gradient(160deg, #4a1a1a 0%, #7a2820 50%, #2a0a0a 100%);
  border: 2px solid rgba(230,200,144,0.55);
  box-shadow:
    inset 0 0 0 3px rgba(60,20,20,0.55),
    0 12px 22px rgba(0,0,0,0.55);
}
.dom-back-face::after {
  content: "?";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: rgba(230,200,144,0.85);
  text-shadow: 0 0 10px rgba(230,200,144,0.65);
}
.dom-back.is-picked {
  animation: dom-back-fly .35s ease-in forwards;
  pointer-events: none;
}
@keyframes dom-back-fly {
  to { transform: translateY(-30px) scale(.85); opacity: 0; }
}

/* ---------- Domino piece (ivory tile with two halves) ---------- */
.dom-piece {
  display: flex;
  width: 100%;
  aspect-ratio: 2 / 1;
  background: linear-gradient(180deg, #fff8e8 0%, #f0e4c8 100%);
  border-radius: 6px;
  border: 1px solid #8a7048;
  box-shadow:
    inset 0 -3px 0 rgba(120,90,40,0.18),
    inset 0 2px 0 rgba(255,255,255,0.7),
    0 4px 10px rgba(0,0,0,0.35);
  color: #2a1a0a;
  overflow: hidden;
}
.dom-half {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 14%;
  box-sizing: border-box;
  position: relative;
}
.dom-divider {
  width: 2px;
  background: rgba(60,40,12,0.55);
  margin: 6% 0;
}
.dom-pip {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dom-pip::before {
  content: "";
  display: block;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #555 0%, #1a0e04 70%, #000 100%);
  box-shadow: inset -1px -1px 2px rgba(255,255,255,0.25);
}

/* When slot/spotlight contains piece, scale it correctly */
.dom-slot .dom-piece {
  height: 100%;
}
.dom-spotlight-piece {
  width: 140px;
  margin: 0 auto 1rem;
}

/* ---------- Result ---------- */
.dom-result {
  width: 100%;
  text-align: center;
  background: linear-gradient(160deg, rgba(50,30,80,0.6), rgba(20,12,40,0.4));
  border: 1px solid rgba(230,200,144,0.4);
  border-radius: 16px;
  padding: 1.4rem 1.2rem 1rem;
  box-shadow: 0 14px 28px rgba(0,0,0,0.45);
  animation: dom-reveal .55s ease-out;
  max-width: 560px;
}
@keyframes dom-reveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dom-verdict {
  display: inline-block;
  padding: .6rem 1.6rem;
  border-radius: 999px;
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 1rem;
}
.dom-result[data-verdict-side="si"] .dom-verdict {
  background: linear-gradient(160deg, #1c5a2a, #0a2a12);
  color: #c0ffce;
  border: 1px solid rgba(160,255,180,0.5);
  box-shadow: 0 0 18px rgba(60,180,80,0.45);
}
.dom-result[data-verdict-side="no"] .dom-verdict {
  background: linear-gradient(160deg, #6a1818, #2a0606);
  color: #ffcaca;
  border: 1px solid rgba(255,160,160,0.5);
  box-shadow: 0 0 18px rgba(200,60,60,0.45);
}
.dom-result[data-verdict-strength="probable"] .dom-verdict {
  opacity: 0.88;
  font-size: 1.2rem;
}

.dom-spotlight-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: #e6c890;
  margin: 0 0 .8rem;
  letter-spacing: .06em;
}
.dom-spotlight-text {
  color: #f5ecd2;
  line-height: 1.6;
  margin: 0 0 1.2rem;
  text-align: left;
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
  white-space: pre-line; /* preserve \n\n paragraph breaks */
}

.dom-error { color: #ff9999; text-align: center; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .dom-slot.is-filled,
  .dom-back.is-picked,
  .dom-result { animation: none; }
  .dom-back.is-picked { opacity: 0; transform: none; }
}

@media (max-width: 520px) {
  .dom-back { width: 56px; height: 104px; }
  .dom-spotlight-piece { width: 110px; }
}
