/* Pig: a push-your-luck dice game drawn on the notebook page. */
.pig {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pig-scores {
  display: flex;
  justify-content: center;
  gap: 18px;
  width: min(100%, 320px);
}
.pig-side {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 2px 8px;
  border-bottom: 2px solid transparent;
  color: var(--ink);
}
.pig-side.p1 { color: var(--red); }
.pig-side.active { border-bottom-color: currentColor; }
.pig-who {
  font-size: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pig-num {
  font-family: var(--font-title);
  font-size: 34px;
  line-height: 1;
}

.pig-die {
  width: min(52vw, 200px);
  aspect-ratio: 1;
}
.pig-die svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pig-outline {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pig-pips { fill: color-mix(in srgb, var(--game) 76%, var(--ink)); }
.pig-pip { fill: color-mix(in srgb, var(--game) 76%, var(--ink)); stroke: none; }
.pig-mark {
  fill: var(--pencil);
  font-family: var(--font-title);
  font-size: 58px;
  font-weight: 700;
}

.pig-die.rolling { animation: pig-roll 620ms var(--ease-pen) both; }

.pig-pot {
  font-size: 22px;
  color: var(--pencil);
}
.pig-pot b {
  font-family: var(--font-title);
  font-size: 34px;
  color: var(--ink);
}

.pig-actions { display: flex; gap: 12px; }
.pig-actions .btn { min-width: 96px; }
.pig-actions .btn.primary { color: var(--ink); }
.pig-hint { min-height: 20px; }

@keyframes pig-roll {
  0% { transform: rotate(0deg) translateY(0) scale(1); }
  30% { transform: rotate(200deg) translateY(-18px) scale(1.08); }
  70% { transform: rotate(520deg) translateY(-6px) scale(.96); }
  100% { transform: rotate(720deg) translateY(0) scale(1); }
}
