/* ===========================================================
   Pig — push-your-luck dice vs CPU.
   Only game-specific rules live here; shared.css does the rest.
   =========================================================== */

/* a touch tighter than the default 20px so it all fits on a phone */
body { gap: 16px; }

/* ---------- wins / losses tally ---------- */
#stats {
  display: flex;
  gap: 12px;
}

/* ---------- the two player score boxes ---------- */
#scores {
  display: flex;
  gap: 16px;
}
.score-box.player {
  min-width: 120px;
  padding: 12px 24px;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}
.score-box.player .val { font-size: 2rem; }

/* highlight whoever is currently up */
.score-box.player.active {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- the "table" with die + turn total ---------- */
#table {
  display: flex;
  align-items: center;
  gap: 22px;
  background: var(--surface-2);
  padding: 18px 26px;
  border-radius: 16px;
  box-shadow: inset 0 2px 8px var(--shadow);
}

/* the big rendered die face */
.die {
  font-size: 4.5rem;
  line-height: 1;
  width: 5rem;
  text-align: center;
  color: var(--text);
  user-select: none;
}
/* little wobble each time a new face lands */
.die.rolling { animation: tumble 0.35s ease; }
@keyframes tumble {
  0%   { transform: rotate(0deg)   scale(1);   }
  50%  { transform: rotate(180deg) scale(1.15);}
  100% { transform: rotate(360deg) scale(1);   }
}

#turnBox .val {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
}

/* ---------- roll / hold controls ---------- */
#controls {
  display: flex;
  gap: 14px;
}
#controls button {
  min-width: 130px;
  font-size: 1.15rem;
  padding: 16px 24px;
}
/* dim + block interaction while it's the CPU's turn or game over */
#controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#rollBtn { background: var(--green); color: #fff; }
#holdBtn { background: var(--red);   color: #fff; }

#newGame { padding: 10px 22px; }

/* ---------- responsive squeeze for narrow phones ---------- */
@media (max-width: 420px) {
  .score-box.player { min-width: 100px; padding: 10px 16px; }
  .die { font-size: 3.6rem; width: 4rem; }
  #controls button { min-width: 0; flex: 1; padding: 16px 12px; }
  #controls { width: 100%; }
}
