/* Chuck-a-Luck. The page is built once; states only change content inside fixed regions. */

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

.cal-table {
  width: min(100%, 36rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.cal-dice {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  height: 6.2rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.35);
}

.cal-die-slot {
  width: 4.6rem;
  height: 4.6rem;
  display: grid;
  place-items: center;
}

.cal-dice .die-wrap { gap: 0; }
.cal-dice .die-tag { display: none; }

.cal-dice .die {
  width: 4.5rem;
  cursor: default;
}

.cal-dice .die:disabled { opacity: 1; }

.cal-readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 3.5rem;
  margin: 0;
  text-align: center;
}

.cal-readout b {
  font: 700 1.7rem/1 var(--font-serif);
  color: #fffdf7;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.cal-readout span {
  margin-top: 0.15rem;
  height: 1.2em;
  color: #d5ddd6;
  font-size: 0.82rem;
  line-height: 1.2;
}

.cal-readout--triple b { color: #f0cf6a; }

.cal-history {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.35rem;
  width: 100%;
  max-width: 24rem;
  margin: 0.2rem 0 0.35rem;
  padding: 0;
  list-style: none;
}

.cal-hist {
  display: grid;
  place-items: center;
  height: 1.85rem;
  border-radius: 999px;
  border: 2px solid transparent;
  color: #fffdf7;
  font: 700 0.68rem/1 var(--font-serif);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cal-hist.is-empty { border-color: rgba(255, 253, 247, 0.32); }
.cal-hist--roll { background: #2a3a48; }
.cal-hist--pair { background: #3d4f3a; }
.cal-hist--triple { background: #c4a24a; color: #1d2433; }
.cal-hist.is-latest { box-shadow: inset 0 0 0 1px rgba(255, 253, 247, 0.85); }

.cal-spots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  width: 100%;
}

.cal-spots.is-locked { pointer-events: none; }

.cal-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 7.5rem;
  margin: 0;
  padding: 0.55rem 0.3rem 0.45rem;
  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;
  overflow: hidden;
}

.cal-spot--triple {
  grid-column: 1 / -1;
  background: rgba(224, 185, 72, 0.14);
  border-color: rgba(224, 185, 72, 0.55);
}

.cal-spot-name {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 100%;
  height: 2.5rem;
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 6cqw, 2rem);
  line-height: 1;
  text-align: center;
}

.cal-spot--triple .cal-spot-name {
  font-size: clamp(1.05rem, 4.4cqw, 1.45rem);
}

.cal-spot-pay {
  flex: none;
  height: 1.2rem;
  color: #f0cf6a;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  line-height: 1.2rem;
  white-space: nowrap;
}

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

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

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

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

@media (hover: hover) {
  .cal-spot:hover { background: rgba(255, 253, 247, 0.08); }
  .cal-spot--triple:hover { background: rgba(224, 185, 72, 0.22); }
}

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

@container (max-width: 22rem) {
  .cal-dice { height: 5.4rem; gap: 0.45rem; }
  .cal-die-slot { width: 3.8rem; height: 3.8rem; }
  .cal-dice .die { width: 3.7rem; }
  .cal-spot-pay { font-size: 0.68rem; letter-spacing: 0; }
}
