/* Feedback animates artwork and a pointer-transparent light layer, never hit areas. */
.merge-feedback {
  position: fixed;
  z-index: 30;
  width: 0;
  height: 0;
  pointer-events: none;
}
.merge-halo,
.merge-flash {
  position: absolute;
  width: var(--burst-size);
  height: var(--burst-size);
  left: calc(var(--burst-size) / -2);
  top: calc(var(--burst-size) / -2);
  border-radius: 50%;
}
.merge-halo {
  border: 3px solid #fff9ce;
  box-shadow:
    0 0 13px #fff4a9,
    inset 0 0 12px #ffc461;
  animation: merge-halo 0.7s cubic-bezier(0.15, 0.65, 0.3, 1) both;
}
.merge-halo.echo {
  border-width: 2px;
  border-color: #a5fff4;
  animation-delay: 0.12s;
  box-shadow: 0 0 12px #73f5eb;
}
.merge-flash {
  background: radial-gradient(circle, #fffde7 0, #ffe6a6bb 15%, #ffcd5255 36%, transparent 68%);
  animation: merge-flash 0.6s ease-out both;
}
.merge-feedback i {
  position: absolute;
  width: var(--spark-size);
  height: var(--spark-size);
  border-radius: 50%;
  background: #fff8cb;
  box-shadow: 0 0 6px 2px #ffd777;
  animation: merge-spark 0.72s cubic-bezier(0.12, 0.65, 0.28, 1) var(--delay) both;
}
.merge-feedback i:nth-of-type(3n) {
  border-radius: 1px;
  background: #d5fff8;
  box-shadow: 0 0 6px #75ffe4;
}
.discovery-impact .merge-flash {
  filter: brightness(1.2);
}
.purchase-impact .merge-halo {
  height: calc(var(--burst-size) * 0.36);
  top: calc(var(--burst-size) * -0.18);
  border-width: 2px;
}
.purchase-impact .merge-flash {
  opacity: 0.65;
}
@keyframes merge-halo {
  0% {
    transform: scale(0.25);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: scale(1.65);
    opacity: 0;
  }
}
@keyframes merge-flash {
  0% {
    transform: scale(0.15);
    opacity: 0;
  }
  18% {
    transform: scale(0.7);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}
@keyframes merge-spark {
  0%,
  12% {
    transform: translate(-3px, -3px) scale(0.25);
    opacity: 0;
  }
  22% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0.1);
    opacity: 0;
  }
}
.tile > .penguin-art.merge-reveal {
  animation: merge-reveal 0.55s ease-out;
  transform-origin: 50% 85%;
}
@keyframes merge-reveal {
  0% {
    transform: translateX(-50%) scale(0.8);
    filter: brightness(1.6);
  }
  38% {
    transform: translateX(-50%) scale(1.14);
    filter: brightness(1.15);
  }
  70% {
    transform: translateX(-50%) scale(0.97);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}
.tile:has(> .purchase-arrival) {
  z-index: 5;
}
.tile > .penguin-art.purchase-arrival {
  animation: purchase-arrival 0.68s linear both;
  transform-origin: 50% 90%;
  pointer-events: none;
}
@keyframes purchase-arrival {
  0% {
    transform: translateX(-50%) translate(var(--arrival-x), var(--arrival-y)) scale(0.12)
      rotate(-14deg);
    opacity: 0.15;
  }
  28% {
    transform: translateX(-50%)
      translate(calc(var(--arrival-x) * 0.6), calc(var(--arrival-y) * 0.85)) scale(0.42)
      rotate(-8deg);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%)
      translate(calc(var(--arrival-x) * 0.18), calc(var(--arrival-y) * 0.4)) scale(0.85, 0.98)
      rotate(4deg);
  }
  62% {
    transform: translateX(-50%) translateY(0) scale(1.15, 0.8) rotate(0deg);
  }
  79% {
    transform: translateX(-50%) translateY(-15px) scale(0.96, 1.05);
  }
  92% {
    transform: translateX(-50%) translateY(0) scale(1.04, 0.96);
  }
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}
.merge-feedback.still .merge-halo {
  animation: none;
  opacity: 0.5;
  transform: scale(0.9);
}
.merge-feedback.still .echo,
.merge-feedback.still .merge-flash {
  display: none;
}
.penguin-silhouette {
  width: 100%;
  height: 100%;
  color: #344c5b;
  filter: drop-shadow(0 8px 10px #304b5322);
}
.penguin-silhouette image {
  display: none;
}
.collection-item.is-locked {
  background: linear-gradient(155deg, #e9eeeb, #dce4e2);
  border-color: #ffffff88;
  box-shadow:
    inset 0 1px 0 #fff9,
    0 4px 15px #1d4d5e08;
}
.collection-item.is-locked h3,
.collection-item.is-locked small {
  color: #5f747b;
}
.collection-item.is-locked .collection-art {
  opacity: 0.8;
}
.collection-item.is-locked .level-badge {
  color: #5d7177;
  background: #f4f7f3;
}
.unlock-card {
  text-align: center;
}
.unlock-art {
  height: min(28dvh, 220px);
  min-height: 115px;
  background: radial-gradient(ellipse at 50% 60%, #ffdf85a0, transparent 65%);
}
.unlock-art .penguin-art {
  height: 100%;
  width: 100%;
}
.unlock-badge {
  display: inline-block;
  border: 1px solid #dbc27e;
  background: #fff1bd;
  color: #826025;
  padding: 4px 15px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}
.unlock-card h2 {
  font-size: 24px;
  margin: 12px 0 8px;
}
.unlock-card p {
  font-size: 13px;
  color: #657e7c;
  margin: 8px 0 16px;
}
#choose-level {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  min-height: 44px;
  cursor: pointer;
  flex-shrink: 0;
}
#choose-level small {
  display: block;
  color: #527c81;
  font-size: 11px;
  margin-top: 3px;
}
#choose-level:focus-visible {
  outline: 2px solid #268c8c;
  border-radius: 8px;
  outline-offset: 3px;
}
#adopt {
  white-space: nowrap;
}
.shop-rule {
  font-size: 12px;
  line-height: 1.6;
  color: #637c7d;
  margin: 0 0 12px;
}
.shop-list {
  display: grid;
  gap: 8px;
  max-height: 55dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 2px;
}
.shop-row {
  width: 100%;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 78px;
  border: 1px solid #d5dfd8;
  border-radius: 16px;
  background: #f4f5eb;
  color: var(--ink);
  padding: 6px 12px 6px 5px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.shop-row.chosen {
  border: 2px solid #42958f;
  background: #e7f2e7;
  padding: 5px 11px 5px 4px;
}
.shop-row:disabled {
  opacity: 1;
  background: #e9ede8;
  color: #708381;
  cursor: default;
}
.shop-art {
  height: 62px;
  display: block;
}
.shop-art svg {
  width: 100%;
  height: 100%;
}
.shop-copy strong {
  display: block;
  font-size: 14px;
}
.shop-copy small {
  display: block;
  font-size: 11px;
  margin-top: 6px;
  line-height: 1.4;
}
.shop-choice {
  font-size: 12px;
  color: #377f79;
  white-space: nowrap;
}
.shop-row:disabled .shop-choice {
  color: #798b88;
}
@media (max-width: 360px) {
  #adopt {
    padding: 0 10px;
    font-size: 12px;
    margin-left: 6px;
  }
  #adopt .button-divider {
    margin: 0 6px;
  }
  .shop-row {
    gap: 6px;
    grid-template-columns: 46px minmax(0, 1fr) auto;
  }
  .shop-copy strong {
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .merge-feedback * {
    animation: none !important;
  }
}
