/* Red Dog. The page is built once; states only change content inside fixed regions. */

.game-root { min-height: 48rem; }

.rd-table {
  --card-w: clamp(2.7rem, 17cqw, 4.5rem);
  --card-h: calc(var(--card-w) * 1.452);
  --radius: calc(var(--card-w) * 0.07);
  width: min(100%, 40rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.rd-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  height: 2.4rem;
  color: #d8e0d8;
  font-size: 0.85rem;
}

.rd-deck-icon.playing-card {
  --card-w: 1.5rem;
  --card-h: 2.18rem;
  --radius: 0.2rem;
  flex: none;
  cursor: default;
  pointer-events: none;
}

.rd-head-note {
  margin: 0;
  line-height: 1.25;
}

.rd-cards {
  display: grid;
  grid-template-columns: repeat(3, var(--card-w));
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  height: var(--card-h);
}

.rd-slot {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--radius);
}

.rd-slot:not(.is-filled) {
  outline: 1px dashed rgba(255, 253, 247, 0.32);
  outline-offset: -1px;
}

.rd-slot--third:not(.is-filled) {
  outline-color: rgba(240, 207, 106, 0.55);
}

.rd-slot .playing-card {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  cursor: default;
  pointer-events: none;
}

.rd-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  min-height: 3.1rem;
}

.rd-info-cell {
  display: grid;
  align-content: center;
  gap: 0.1rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid rgba(255, 253, 247, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  text-align: center;
}

.rd-info-label {
  color: #d8e0d8;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rd-info-value {
  color: #fffdf7;
  font: 700 0.98rem/1.2 var(--font-serif);
  font-variant-numeric: tabular-nums;
}

.rd-history {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1.7rem));
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  height: 1.7rem;
  margin: 0.15rem 0;
  padding: 0;
  list-style: none;
}

.rd-hist {
  display: grid;
  place-items: center;
  width: 100%;
  height: 1.7rem;
  border-radius: 50%;
  border: 2px solid transparent;
  color: #fffdf7;
  font: 700 0.68rem/1 var(--font-serif);
  letter-spacing: 0.02em;
}

.rd-hist.is-empty { border-color: rgba(255, 253, 247, 0.32); }
.rd-hist--W { background: #1e5c3d; }
.rd-hist--L { background: #8c3b32; }
.rd-hist--P { background: #1e4578; }
.rd-hist.is-latest { box-shadow: inset 0 0 0 1px rgba(255, 253, 247, 0.85); }

.rd-bet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 0.7rem;
  align-items: stretch;
  width: 100%;
  min-height: 11.5rem;
}

.rd-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 11.5rem;
  margin: 0;
  padding: 0.7rem 0.35rem 0.5rem;
  border: 1px solid rgba(255, 253, 247, 0.38);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  color: #fffdf7;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.rd-spot.is-locked {
  pointer-events: none;
}

.rd-spot-name {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.2em;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 4.4cqw, 1.35rem);
  line-height: 1.15;
  text-align: center;
}

.rd-spot-pay {
  height: 1.2em;
  color: #f0cf6a;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-align: center;
}

.rd-spot-well {
  position: relative;
  width: 100%;
  height: 2.8rem;
  margin-top: auto;
}

.rd-spot.is-win {
  border-color: #f0cf6a;
  box-shadow: inset 0 0 0 1px #f0cf6a;
}

.rd-spot.is-lose { border-color: rgba(255, 253, 247, 0.16); }

.rd-spot.is-push { border-color: rgba(255, 253, 247, 0.72); }

.rd-spot:focus-visible {
  outline: 3px solid #e0b948;
  outline-offset: 2px;
}

@media (hover: hover) {
  .rd-spot:not(.is-locked):hover { background: rgba(255, 253, 247, 0.08); }
}

.rd-spot:active { background: rgba(255, 253, 247, 0.12); }

.rd-paytable {
  width: 100%;
  min-height: 11.5rem;
  margin: 0;
  border-collapse: collapse;
  color: #fffdf7;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 253, 247, 0.22);
  border-radius: 12px;
  overflow: hidden;
}

.rd-paytable caption {
  padding: 0.45rem 0.5rem 0.25rem;
  color: #f0cf6a;
  font: 600 0.78rem/1.2 var(--font-sans);
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  caption-side: top;
}

.rd-paytable th,
.rd-paytable td {
  padding: 0.28rem 0.55rem;
  border-top: 1px solid rgba(255, 253, 247, 0.12);
  text-align: left;
  vertical-align: middle;
}

.rd-paytable thead th {
  color: #d8e0d8;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-top: none;
}

.rd-paytable tbody th {
  font-weight: 500;
  color: #fffdf7;
}

.rd-paytable td {
  font-variant-numeric: tabular-nums;
  color: #f0cf6a;
  white-space: nowrap;
}

.rd-actions {
  display: grid;
  width: min(100%, 34rem);
  margin-inline: auto;
  min-height: var(--tap-min);
}

.rd-actions > .casino-controls {
  grid-area: 1 / 1;
  width: 100%;
  margin-inline: 0;
}

.rd-actions > .casino-controls[hidden],
.casino-controls .btn[hidden] { display: none !important; }

@media (max-width: 28rem) {
  .rd-bet-row {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .rd-spot {
    min-height: 8.5rem;
  }

  .rd-paytable {
    min-height: 0;
    font-size: 0.74rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rd-slot .playing-card {
    transition: none;
  }
}
