/* Whack-a-crab: nine rock pools on the sand. */
.wc-main {
  --water: #3f9fb2; --water-deep: #1f6b7d; --rock: #a39887; --rock-dark: #7d7366; --sun: #f2b544; --pop: #3f7a5a;
  gap: 12px;
}
.wc-top { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; width: 100%; }
.wc-hud { display: flex; align-items: center; gap: 18px; }
.wc-score { min-width: 5em; font-size: 2rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--sea-deep); line-height: 1; text-align: right; }
.wc-score small { font-family: var(--sans); font-size: 1rem; font-weight: 300; color: var(--sea); }
.wc-timer { width: clamp(160px, 24vw, 420px); height: 18px; border-radius: 9px; background: var(--sand-deep); overflow: hidden; }
.wc-timer-fill { height: 100%; width: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--sun), #e9824f); transform-origin: left; }
.wc-timer-fill.is-low { background: linear-gradient(90deg, #e9824f, var(--bad)); }
.wc-time { min-width: 3em; font-size: 1.25rem; font-variant-numeric: tabular-nums; color: var(--sea-deep); }
.wc-main .game-message { min-height: 1.4em; }

.wc-stage { position: relative; flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; }
.wc-board {
  height: 100%; max-width: 100%; aspect-ratio: 4 / 3;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 1.4%;
  padding: 1.6%; border-radius: var(--radius);
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.35) 0 2px, transparent 3px) 0 0 / 46px 46px,
    radial-gradient(circle at 70% 60%, rgba(163,140,110,0.25) 0 2px, transparent 3px) 0 0 / 38px 38px,
    linear-gradient(180deg, #f1e3c8, #e8d3ad);
  box-shadow: inset 0 -6px 0 rgba(125,115,102,0.18);
}

/* one pool */
.wc-hole {
  position: relative; min-width: var(--tap); min-height: var(--tap); padding: 0; border: 0; border-radius: 18px;
  background: none; cursor: pointer; touch-action: none; overflow: hidden;
}
.wc-water {
  position: absolute; left: 10%; right: 10%; bottom: 12%; height: 38%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, #7cc7d3, var(--water) 45%, var(--water-deep));
  box-shadow: 0 0 0 clamp(5px, 0.8vw, 12px) var(--rock), 0 clamp(4px, 0.6vw, 9px) 0 clamp(5px, 0.8vw, 12px) var(--rock-dark),
    inset 0 6px 10px rgba(0,0,0,0.25);
}
.wc-water::after { /* a glint */
  content: ""; position: absolute; left: 22%; top: 22%; width: 22%; height: 14%; border-radius: 50%; background: rgba(255,255,255,0.35);
}
.wc-window { position: absolute; left: 0; right: 0; top: 0; bottom: 31%; overflow: hidden; pointer-events: none; }
.wc-critter {
  position: absolute; left: -20%; right: -20%; bottom: -14%; height: 118%; display: flex; justify-content: center;
  transform: translateY(105%); transition: transform 0.12s ease-out;
}
.wc-critter svg { height: 100%; width: auto; overflow: visible; }
.wc-hole.is-up .wc-critter { transform: none; }
.wc-hole.is-bonked .wc-critter { transform: translateY(18%) scale(1.12, 0.78); transition-duration: 0.08s; }
.wc-hole.is-bonked .wc-critter::after { /* stars round its head */
  content: "\2605  \2605"; position: absolute; top: 12%; left: 0; right: 0; text-align: center;
  color: var(--sun); font-size: clamp(16px, 2.6vh, 34px); letter-spacing: 0.4em; text-shadow: 0 1px 0 #b77a12;
}
.wc-hole.is-oops .wc-water { box-shadow: 0 0 0 clamp(5px, 0.8vw, 12px) var(--bad), 0 clamp(4px, 0.6vw, 9px) 0 clamp(5px, 0.8vw, 12px) #7d3329, inset 0 6px 10px rgba(0,0,0,0.25); }
.wc-hole.is-pressed .wc-water { filter: brightness(1.15); }
.wc-key {
  position: absolute; left: 0; right: 0; bottom: 15%; text-align: center; pointer-events: none;
  font-size: clamp(12px, 1.7vh, 20px); font-weight: 500; letter-spacing: 0.06em; color: rgba(255,255,255,0.6);
}
.wc-pop {
  position: absolute; left: 0; right: 0; top: 12%; text-align: center; pointer-events: none; opacity: 0;
  font-family: var(--serif); font-weight: 700; font-size: clamp(26px, 4.6vh, 56px); color: var(--pop);
  text-shadow: 0 2px 0 #fff, 0 0 8px rgba(255,255,255,0.8);
}
.wc-pop.is-bad { color: var(--bad); }
.wc-pop.is-on { animation: wc-pop 0.7s ease-out; }
@keyframes wc-pop { 0% { opacity: 0; transform: translateY(20%) scale(0.7); } 15% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-60%); } }

/* start button and 3-2-1 over the board */
.wc-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.wc-overlay[hidden] { display: none; }
.wc-start { pointer-events: auto; min-height: 96px; padding: 0 2.4em; font-size: 1.8rem; border-radius: 24px; box-shadow: 0 10px 30px rgba(22,44,51,0.3); }
.wc-start[hidden] { display: none; }
.wc-count {
  font-family: var(--serif); font-weight: 700; font-size: clamp(90px, 22vh, 240px); line-height: 1; color: var(--cream);
  text-shadow: 0 6px 0 var(--sea-deep), 0 10px 30px rgba(0,0,0,0.35);
}
.wc-count.is-on { animation: wc-count 0.9s ease-out; }
@keyframes wc-count { from { transform: scale(1.5); opacity: 0; } 25% { transform: none; opacity: 1; } to { opacity: 0.2; } }

@media (prefers-reduced-motion: reduce) {
  .wc-critter, .wc-hole.is-bonked .wc-critter { transition: none; }
  .wc-pop.is-on { animation: wc-pop-still 0.7s linear; }
  .wc-count.is-on { animation: none; }
}
@keyframes wc-pop-still { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
