/* The shop and closing time: comic panels. Loads last. */

.sh-screen, .dy-screen { background: var(--cm-page); background-image: radial-gradient(circle at 3px 3px, rgba(27, 27, 31, .16) 2.2px, transparent 2.6px); background-size: 12px 12px; }

.sh-btn, .dy-new {
  min-width: 72px; min-height: 72px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 5px solid var(--cm-ink); border-radius: 18px; background: var(--cm-sun); color: var(--cm-ink);
  font: 26px/1 var(--cm-big); letter-spacing: 1px; box-shadow: 0 6px 0 var(--cm-ink);
}
.sh-btn:active:not([disabled]), .dy-new:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--cm-ink); }
.sh-btn[disabled] { background: #E4E0D4; color: #77736A; border-color: #77736A; box-shadow: 0 6px 0 #77736A; letter-spacing: 0; font-size: 22px; }
.sh-buy:not([disabled]) { background: #5ED6B0; }

/* ---------- Shop ---------- */
.sh-panel {
  position: absolute; inset: 14px; padding: 12px 18px 14px;
  display: flex; flex-direction: column; gap: 6px; overflow: hidden;
}
.sh-top { display: flex; justify-content: space-between; align-items: center; padding-right: 96px; min-height: 52px; }
.sh-top .hud-coins { transform-origin: 100% 50%; }
.sh-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.sh-head { font: 32px/1 var(--cm-big); letter-spacing: 2px; margin-top: 2px; }
.sh-grid { display: grid; gap: 8px; }
.sh-recipes { grid-template-columns: repeat(8, 1fr); }
.sh-upgrades { grid-template-columns: repeat(3, 1fr); }
/* Nine recipes in one row: a little narrower, so the words are a little smaller. */
.sh-recipes.is-many { gap: 6px; }
.sh-recipes.is-many .sh-card h3 { font-size: 17px; }
.sh-recipes.is-many .sh-btn[disabled] { font-size: 19px; }
.sh-page { font: 22px/1 var(--cm-hand); letter-spacing: 0; margin-left: 8px; }
.sh-card {
  background: #fff; border: 5px solid var(--cm-ink); border-radius: 14px; box-shadow: 0 5px 0 var(--cm-ink);
  display: flex; align-items: center; min-width: 0;
}
.sh-recipe { flex-direction: column; gap: 2px; padding: 6px 4px 8px; }
.sh-recipe .sh-pic { width: 62px; height: 62px; }
.sh-card h3 { font: 19px/1 var(--cm-hand); text-align: center; min-height: 2em; display: flex; align-items: center; margin: 0; }
.sh-price { font: 24px/1 var(--cm-big); letter-spacing: 1px; }
.sh-recipe .sh-buy { width: 100%; min-width: 0; padding: 0 2px; }
.sh-upgrade { gap: 8px; padding: 6px 8px; min-height: 100px; }
.sh-upgrade .sh-pic { width: 62px; height: 62px; }
.sh-upgrade .sh-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sh-upgrade h3 { justify-content: flex-start; text-align: left; min-height: 0; font-size: 19px; }
.sh-namerow { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.sh-upgrade .sh-price { font-size: 22px; }
.sh-upgrade p { margin: 0; font: 18px/1.1 var(--cm-hand); }
.sh-upgrade .sh-buy { width: 88px; flex: none; }
.sh-empty { flex: 1; display: flex; align-items: center; justify-content: center; }
.sh-empty .cm-bubble { font-size: 34px; max-width: 640px; text-align: center; }
.sh-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 80px; }
.sh-have { flex: 1; display: flex; align-items: center; gap: 10px; }
.sh-have-label { font: 26px/1 var(--cm-big); letter-spacing: 1px; }
.sh-own { width: 56px; height: 56px; background: #fff; border: 4px solid var(--cm-ink); border-radius: 50%; padding: 4px; }
.sh-gift { position: relative; }
.sh-gift b { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%) rotate(-4deg); padding: 1px 7px; border: 3px solid var(--cm-ink); border-radius: 9px; background: #FF8FB1; font: 15px/1.1 var(--cm-big); letter-spacing: 1px; }
.sh-own { flex: none; }
.sh-back { min-width: 170px; background: #fff; }
.sh-more { min-width: 130px; background: #8FD3FF; }
.sh-word {
  position: absolute; left: 50%; top: 42%; margin-left: -170px; width: 340px; text-align: center;
  pointer-events: none; z-index: 5; animation: sh-pop .5s cubic-bezier(.3, 1.5, .5, 1) both;
}
.sh-word[hidden] { display: none; }
@keyframes sh-pop { 0% { transform: scale(.4) rotate(-12deg); opacity: 0; } 100% { transform: scale(1) rotate(-6deg); opacity: 1; } }

/* ---------- Closing time ---------- */
.dy-panel {
  position: absolute; inset: 14px; padding: 14px 24px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; overflow: hidden;
}
.dy-top { align-self: flex-start; }
.dy-title { font-size: 54px; }
.dy-sums { width: 560px; display: flex; flex-direction: column; gap: 6px; }
.dy-line { display: flex; align-items: center; gap: 14px; font: 28px/1 var(--cm-hand); padding: 2px 10px; border-bottom: 3px dashed rgba(27, 27, 31, .3); }
.dy-line .pic { width: 44px; height: 44px; }
.dy-line span:nth-child(2) { flex: 1; }
.dy-line b { font: 34px/1 var(--cm-big); letter-spacing: 1px; }
.dy-kept { background: var(--cm-caption); border: 5px solid var(--cm-ink); border-radius: 14px; font-size: 34px; }
.dy-kept .pic { width: 56px; height: 48px; }
.dy-kept b { font-size: 48px; }
.dy-plates { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; min-height: 56px; }
.dy-plates-text { font: 30px/1 var(--cm-big); letter-spacing: 1px; }
.dy-plate-row { display: flex; align-items: center; gap: 4px; }
.dy-plate { width: 46px; height: 46px; }
.dy-more { font: 28px/1 var(--cm-big); }
.dy-party { flex: 1; min-height: 0; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.dy-friend { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.dy-dancer { width: 104px; height: 132px; transform-origin: 50% 100%; animation: dy-bounce .8s ease-in-out infinite; }
.dy-name { max-width: 120px; padding: 0 8px; border: 3px solid var(--cm-ink); border-radius: 10px; background: #fff; font: 20px/1.2 var(--cm-hand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dy-new {
  min-width: 340px; min-height: 90px; font-size: 48px; background: #5ED6B0;
  animation: dy-glow 1.4s ease-in-out infinite;
}
@keyframes dy-bounce { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
@keyframes dy-glow { 0%, 100% { box-shadow: 0 6px 0 var(--cm-ink), 0 0 0 0 rgba(255, 201, 60, .9); } 50% { box-shadow: 0 6px 0 var(--cm-ink), 0 0 0 14px rgba(255, 201, 60, 0); } }

@media (prefers-reduced-motion: reduce) {
  .dy-dancer, .dy-new, .sh-word { animation: none; }
}
