/* ===========================================================
   Farkle — push-your-luck dice vs CPU.
   Only game-specific layout/sizing; shared.css does colour + chrome.
   =========================================================== */

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

/* ---------- 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; }
.score-box.player.active {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- this-turn tallies ---------- */
#turnInfo { display: flex; gap: 16px; }
.turn-stat {
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 18px;
  text-align: center;
  min-width: 96px;
  box-shadow: 0 2px 8px var(--shadow);
}
.turn-stat .label {
  font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 1px; opacity: 0.7;
}
.turn-stat .val { font-size: 1.5rem; font-weight: 800; color: var(--accent); }

/* ---------- the dice in play ---------- */
#dice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  background: var(--surface-2);
  padding: 18px 22px;
  border-radius: 16px;
  box-shadow: inset 0 2px 8px var(--shadow);
  min-height: 92px;
  min-width: min(420px, 92vw);
}

/* a single rollable die (button) */
.die {
  font-size: 3.4rem;
  line-height: 1;
  width: 3.6rem;
  height: 3.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 6px var(--shadow);
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.die:hover:not(:disabled):not(.kept) { transform: translateY(-3px); }
.die.selected {
  border-color: var(--accent);
  background: var(--surface-3);
  transform: translateY(-4px);
}
.die.idle { cursor: default; opacity: 0.85; }
.die:disabled { cursor: default; }

/* freshly rolled wobble */
.die.rolling { animation: tumble 0.35s ease; }
@keyframes tumble {
  0%   { transform: rotate(0deg)   scale(1);   }
  50%  { transform: rotate(180deg) scale(1.12);}
  100% { transform: rotate(360deg) scale(1);   }
}

/* ---------- set-aside row ---------- */
#keptWrap { text-align: center; }
#keptWrap .label {
  font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 1px; opacity: 0.7; margin-bottom: 6px;
}
#kept {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 2.6rem;
}
.die.kept {
  font-size: 2.4rem;
  width: 2.7rem;
  height: 2.7rem;
  cursor: default;
  border-color: var(--accent);
  color: var(--green);
}

/* ---------- roll / bank controls ---------- */
#controls { display: flex; gap: 14px; }
#controls button {
  min-width: 130px;
  font-size: 1.15rem;
  padding: 16px 24px;
}
#controls button:disabled { opacity: 0.4; cursor: not-allowed; }
#rollBtn { background: var(--green); color: #fff; }
#bankBtn { background: var(--blue-board); color: #fff; }

#newGame { padding: 10px 22px; }

/* ---------- responsive squeeze for narrow phones ---------- */
@media (max-width: 420px) {
  .score-box.player { min-width: 100px; padding: 10px 16px; }
  .turn-stat { min-width: 80px; padding: 6px 12px; }
  #dice { gap: 8px; padding: 14px; }
  .die { font-size: 2.7rem; width: 3rem; height: 3rem; }
  .die.kept { font-size: 2rem; width: 2.3rem; height: 2.3rem; }
  #controls button { min-width: 0; flex: 1; padding: 16px 12px; }
  #controls { width: 100%; }
}
