/* =========================================================
   MANKALA — bord met kuiltjes, kassen en munten
   ========================================================= */

.mk-board{
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) repeat(6, minmax(0, 1fr)) minmax(0, 1.15fr);
  gap: clamp(5px, 1.4vw, 12px);
  padding: clamp(14px, 2.6vw, 24px) clamp(10px, 2.2vw, 20px);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.12), transparent 60%),
    var(--primary);
  border: 4px solid #17251f;
  border-radius: clamp(26px, 6vw, 56px);
  box-shadow: 0 6px 0 #17251f, var(--shadow-md);
}

.mk-pit,
.mk-store{
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  background: radial-gradient(circle at 50% 30%, #1d4a3a, #143528 72%);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.mk-pit{
  aspect-ratio: 1;
  border-radius: 50%;
}
.mk-store{
  border-radius: 999px;
  /* ring in de kleur van de eigenaar */
  box-shadow: inset 0 0 0 3px var(--owner), inset 0 6px 12px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mk-coins{
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.mk-coin{
  position: absolute;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #fff6d4 0 9%, #f5cf6a 20%, #e3a857 58%, #b27a2c 100%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(120, 76, 18, 0.55);
}
.mk-coin.is-new{ animation: mk-drop .3s var(--ease-spring); }
@keyframes mk-drop{
  from{ transform: translate(-50%, -85%) scale(0.3); opacity: 0; }
  to{ transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.mk-count{
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  z-index: 2;
  min-width: 1.9em;
  padding: 0 0.45em;
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 1.7vw, 0.8rem);
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid #17251f;
  border-radius: 999px;
}
/* bovenste rij: getal aan de bovenkant, zodat de rijen elkaar niet raken */
.mk-pit.is-theirs .mk-count{ top: -7px; bottom: auto; }
.mk-store .mk-count{
  bottom: 7%;
  font-size: clamp(0.72rem, 2vw, 0.95rem);
}
.mk-store-label{
  position: absolute;
  top: 7%;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  font-family: var(--font-mono);
  font-size: clamp(0.55rem, 1.5vw, 0.7rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

/* ---------- spelen ---------- */
.mk-pit:disabled{ cursor: default; }
.mk-pit.is-playable{
  cursor: pointer;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5), 0 0 0 3px var(--accent);
}
.mk-pit.is-playable:hover,
.mk-pit.is-playable:focus-visible{
  transform: translateY(-3px);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5), 0 0 0 4px #fff3c4;
  outline: none;
}

/* waar de laatste munt terechtkomt, en wat er dan geslagen wordt */
.mk-pit.is-target,
.mk-store.is-target{ outline: 3px dashed #fff3c4; outline-offset: 3px; }
.mk-pit.is-capture{ outline: 3px dashed #ffb3a8; outline-offset: 3px; }

/* tijdens het zaaien */
.mk-pit.is-hot,
.mk-store.is-hot{
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 0 4px #fff;
}

/* het kuiltje van de laatste zet, met de kleur van wie hem deed */
.mk-pit.is-last::after{
  content: '';
  position: absolute;
  top: 4%;
  right: 4%;
  z-index: 2;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--last);
  border: 2px solid #fff;
}
.mk-pit.is-theirs.is-last::after{ top: auto; bottom: 4%; }

@media (max-width: 520px){
  /* op een smal scherm zijn hogere kuiltjes makkelijker aan te tikken */
  .mk-pit{ aspect-ratio: 0.8; border-radius: 45% / 38%; }
  .mk-coin{ width: 32%; }
}

@media (prefers-reduced-motion: reduce){
  .mk-coin.is-new{ animation: none; }
}
