.cp-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 14px 24px;
  color: var(--cg-ink);
  font-family: Inter, Arial, sans-serif;
}

.cp-topbar,
.cp-statline,
.cp-actions,
.cp-hud,
.cp-create {
  display: flex;
  align-items: center;
}

.cp-topbar {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cp-statline,
.cp-actions {
  gap: 8px;
}

.cp-stat,
.cp-hud > div {
  min-width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
  text-align: center;
}

.cp-stat span,
.cp-hud span {
  display: block;
  color: var(--cg-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cp-stat strong,
.cp-hud strong {
  display: block;
  margin-top: 2px;
  font-size: 19px;
  line-height: 1;
}

.cp-btn,
.cp-close {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: #fff;
  color: var(--cg-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.cp-btn:focus-visible,
.cp-close:focus-visible,
.cp-hole:focus-visible {
  outline: 3px solid rgba(49, 95, 157, 0.38);
  outline-offset: 3px;
}

.cp-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cp-icon {
  padding: 0;
  font-size: 20px;
}

.cp-primary {
  border-color: transparent;
  background: var(--cg-teal);
  color: #fff;
}

.cp-stage {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--cg-line);
  border-radius: 18px;
  background: radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.92), transparent 42%), linear-gradient(180deg, #d8f2df 0 37%, #8fc981 37% 50%, #7b5539 50% 100%);
  box-shadow: var(--cg-shadow);
  touch-action: none;
  user-select: none;
}

.cp-stage::before {
  content: "";
  position: absolute;
  inset: 37% 0 auto;
  height: 16%;
  background: repeating-linear-gradient(112deg, rgba(255,255,255,0.15) 0 8px, transparent 8px 28px);
}

.cp-hud {
  position: relative;
  z-index: 4;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px 0;
}

.cp-board {
  position: absolute;
  inset: 100px 14px 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

.cp-hole {
  position: relative;
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.cp-key {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 7px;
  background: rgba(42, 33, 24, 0.36);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.cp-burrow {
  position: absolute;
  inset: auto 8% 8%;
  height: 34%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #211b17 0 42%, #533824 45% 62%, rgba(68,45,28,0) 64%);
}

.cp-critter {
  position: absolute;
  left: 50%;
  bottom: -34%;
  width: min(74%, 120px);
  aspect-ratio: 0.88;
  border-radius: 48% 48% 42% 42%;
  background: linear-gradient(145deg, #40c9b1, #168676);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,0.12), 0 10px 20px rgba(28,23,18,0.24);
  transform: translate(-50%, 110%);
  transition: transform 120ms cubic-bezier(.2,.8,.2,1), filter 100ms ease;
}

.cp-up .cp-critter {
  transform: translate(-50%, -18%);
}

.cp-gold .cp-critter {
  background: linear-gradient(145deg, #ffd86a, #d89518);
}

.cp-bad .cp-critter {
  border-radius: 38% 52% 36% 54%;
  background: repeating-linear-gradient(135deg, #8752b1 0 12px, #593078 12px 24px);
}

.cp-hit .cp-critter {
  filter: brightness(1.35);
  transform: translate(-50%, 22%) scale(0.86);
}

.cp-ear {
  position: absolute;
  top: -8%;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 70% 30% 55% 45%;
  background: inherit;
}

.cp-ear-left { left: 5%; transform: rotate(-18deg); }
.cp-ear-right { right: 5%; transform: scaleX(-1) rotate(-18deg); }

.cp-face {
  position: absolute;
  inset: 27% 18% auto;
  display: flex;
  justify-content: space-between;
}

.cp-face i {
  width: 14px;
  height: 18px;
  border-radius: 50%;
  background: #14211e;
  box-shadow: inset 4px 3px 0 rgba(255,255,255,0.75);
}

.cp-face b {
  position: absolute;
  top: 28px;
  left: 50%;
  width: 18px;
  height: 8px;
  border: 4px solid #14211e;
  border-top: 0;
  border-radius: 0 0 18px 18px;
  transform: translateX(-50%);
}

.cp-bad .cp-face b {
  border-top: 4px solid #f4dfff;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
}

.cp-overlay {
  position: absolute;
  z-index: 12;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 10px;
  width: min(82%, 340px);
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 16px;
  background: rgba(255,255,255,0.93);
  box-shadow: 0 28px 70px rgba(30,37,40,0.25);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(12px);
}

.cp-overlay strong { font-size: 25px; }
.cp-overlay span,
.cp-overlay p { margin: 0; color: var(--cg-muted); line-height: 1.45; }

.cp-flash {
  position: absolute;
  z-index: 10;
  top: 22%;
  left: 50%;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  font-size: 22px;
  font-weight: 950;
  transform: translateX(-50%);
  animation: cp-flash 420ms ease forwards;
  pointer-events: none;
}

.cp-flash-good { color: #087f6d; }
.cp-flash-gold { color: #a86500; }
.cp-flash-bad { color: #7e22a7; }

.cp-create {
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
}

.cp-create div { display: grid; gap: 3px; }
.cp-create span { color: var(--cg-muted); font-size: 12px; }
.cp-create a { flex: 0 0 auto; color: var(--cg-teal); font-size: 13px; font-weight: 850; }

.cp-modal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(30,37,40,0.4);
}

.cp-modal-card {
  position: relative;
  width: min(100%, 440px);
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(30,37,40,0.28);
}

.cp-modal-card h2 { margin: 0 48px 12px 0; }
.cp-modal-card p { color: var(--cg-muted); line-height: 1.5; }
.cp-close { position: absolute; top: 12px; right: 12px; padding: 0; font-size: 24px; }
.cp-hidden { display: none !important; }

@keyframes cp-flash {
  0% { opacity: 0; transform: translate(-50%, 16px) scale(.8); }
  35% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -28px) scale(1); }
}

@media (max-width: 620px) {
  .cp-shell { padding: 0 8px 18px; }
  .cp-topbar { align-items: stretch; flex-direction: column; }
  .cp-statline,
  .cp-actions { justify-content: center; }
  .cp-stat { flex: 1 1 70px; }
  .cp-stage { min-height: 500px; border-radius: 13px; }
  .cp-board { inset: 96px 4px 12px; gap: 5px; }
  .cp-hud { gap: 4px; padding-inline: 5px; }
  .cp-hud > div { min-width: 0; flex: 1 1 25%; padding: 8px 4px; }
  .cp-create { align-items: stretch; flex-direction: column; }
  .cp-create a { min-height: 36px; display: grid; place-items: center; border: 1px solid var(--cg-line); border-radius: 8px; }
  .cp-key { top: 8px; right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .cp-critter { transition-duration: 1ms; }
  .cp-flash { animation-duration: 1ms; }
}
