/* Tessera (dry-streak punch card), components/PunchCard.tsx.
   accent = --brand-primary, accent-deep = --brand-700 of the active fruit theme. */
.dc-punch {
  --punch-accent: var(--brand-primary, #facd15);
  --punch-deep: rgb(var(--brand-700, 161 98 7));
  --punch-ink: #0b0b0c;
  --punch-paper: color-mix(in srgb, var(--punch-accent) 14%, #f7f1e4);
  position: relative;
  width: min(342px, 100%);
  margin: 0 auto;
  transform: rotate(-1.5deg); /* static: printed card lying on the table */
  font-family: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  color: var(--punch-ink);
  isolation: isolate;
}
.dc-punch__enter { position: relative; z-index: 1; }
.dc-punch--straight { transform: none; } /* Profilo: card lies straight */
.dc-punch__card {
  position: relative;
  padding: 20px;
  border-radius: 22px;
  background: var(--punch-paper);
  outline: 1.5px solid var(--punch-deep);
  outline-offset: -8px;
  box-shadow: 0 10px 28px rgb(11 11 12 / 0.08), 0 2px 0 rgb(11 11 12 / 0.06);
}
.dc-punch__overline {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(11 11 12 / 0.6);
}
.dc-punch__title {
  margin: 2px 0 4px;
  font-family: 'Yellowtail', cursive;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  color: var(--punch-deep);
}
.dc-punch__rule {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--punch-ink);
}
.dc-punch__holes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 60px);
  gap: 14px;
  justify-content: center;
}
.dc-hole {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgb(11 11 12 / 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dc-hole__fill {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--punch-accent);
  box-shadow: inset 0 2px 4px rgb(11 11 12 / 0.22);
  transform: scale(0);
  opacity: 0;
}
.dc-hole__num {
  position: relative;
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: rgb(11 11 12 / 0.4);
  line-height: 1;
}
.dc-hole.is-punched { border-color: transparent; }
.dc-hole.is-punched .dc-hole__fill { transform: scale(1); opacity: 1; }
/* Ink on every fruit accent: all six primaries are light enough for #0B0B0C (>= 7:1), so no cream swap is needed. */
.dc-hole.is-punched .dc-hole__num { color: var(--punch-ink); }
/* PREMIO slot */
.dc-hole.is-prize { border: 2px dashed var(--punch-deep); }
.dc-hole.is-prize .dc-hole__num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--punch-deep);
}
.dc-hole.is-prize.is-punched { border-color: transparent; }
.dc-hole.is-prize .dc-hole__fill { background: var(--punch-ink); box-shadow: none; }
.dc-hole.is-prize.is-punched .dc-hole__num { color: var(--punch-accent); display: flex; }
/* The day about to be claimed (dry-day sheet). */
.dc-hole.is-next:not(.is-prize) { border-style: dashed; border-color: var(--punch-deep); }
.dc-punch__name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 16px;
}
.dc-punch__line {
  flex: 1;
  min-width: 0;
  padding: 0 2px 2px;
  border-bottom: 1px solid rgb(11 11 12 / 0.25);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mini (Home, right after the dry day was claimed): one row of 8 small holes. */
.dc-punch--mini .dc-punch__card { padding: 16px 18px 18px; }
.dc-punch--mini .dc-punch__title { font-size: 26px; margin-bottom: 2px; }
.dc-punch--mini .dc-punch__rule { margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.dc-punch--mini .dc-punch__holes { grid-template-columns: repeat(8, 30px); gap: 7px; }
.dc-punch--mini .dc-hole { width: 30px; height: 30px; border-width: 1.5px; }
.dc-punch--mini .dc-hole.is-prize { border-width: 1.5px; }
.dc-punch--mini .dc-hole__num { font-size: 12px; }

/* ---- Motion (transform / opacity only) ---- */
.dc-punch.is-entering .dc-punch__enter {
  will-change: transform, opacity;
  animation: dc-punch-enter 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.dc-punch.is-entering .dc-hole {
  will-change: transform, opacity;
  animation: dc-punch-hole-in 200ms ease-out both;
  animation-delay: calc(120ms + var(--i) * 30ms);
}
@keyframes dc-punch-enter {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes dc-punch-hole-in {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: none; }
}
/* Punch: fill pops in, number fades, a paper disc and 3 fragments fly off and fall. */
.dc-hole.is-punching .dc-hole__fill {
  will-change: transform, opacity;
  animation: dc-punch-fill 260ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: var(--punch-at, 0ms);
}
.dc-hole.is-punching .dc-hole__num {
  animation: dc-punch-num 150ms ease-out both;
  animation-delay: calc(var(--punch-at, 0ms) + 90ms);
}
@keyframes dc-punch-fill {
  0% { transform: scale(0); opacity: 1; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes dc-punch-num {
  from { opacity: 0; }
  to { opacity: 1; }
}
.dc-hole__chad,
.dc-hole__frag {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background: var(--punch-paper);
  box-shadow: 0 1px 2px rgb(11 11 12 / 0.18);
  pointer-events: none;
  will-change: transform, opacity;
  opacity: 0;
}
.dc-hole__chad {
  width: 100%;
  height: 100%;
  margin: -50% 0 0 -50%;
  border: 1px solid rgb(11 11 12 / 0.08);
  z-index: 3;
  --dir: 1;
  animation: dc-punch-chad 380ms cubic-bezier(0.2, 0.8, 0.4, 1) both;
  animation-delay: var(--punch-at, 0ms);
}
.dc-hole:nth-child(even) .dc-hole__chad { --dir: -1; }
@keyframes dc-punch-chad {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  40% { opacity: 1; transform: translate(calc(var(--dir) * 16px), -36px) rotate(calc(var(--dir) * 96deg)); }
  100% { opacity: 0; transform: translate(calc(var(--dir) * 22px), 20px) rotate(calc(var(--dir) * 240deg)); }
}
.dc-hole__frag {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  z-index: 3;
  background: var(--punch-accent);
  animation: dc-punch-frag 300ms cubic-bezier(0.2, 0.8, 0.4, 1) both;
  animation-delay: calc(var(--punch-at, 0ms) + var(--f) * 20ms);
}
@keyframes dc-punch-frag {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  45% { opacity: 1; transform: translate(calc((var(--f) - 1) * 18px), calc(-22px - var(--f) * 6px)) scale(1); }
  100% { opacity: 0; transform: translate(calc((var(--f) - 1) * 26px), 18px) scale(0.6); }
}
/* Card full: squash-and-stretch bounce, PREMIO pulses. */
.dc-punch.is-celebrating .dc-punch__card {
  will-change: transform;
  transform-origin: 50% 100%;
  animation: dc-punch-bounce 400ms ease-out both;
  animation-delay: var(--celebrate-at, 0ms);
}
@keyframes dc-punch-bounce {
  0% { transform: none; }
  30% { transform: translateY(-10px) scale(1.08, 0.94); }
  55% { transform: scale(0.97, 1.03); }
  75% { transform: scale(1.02, 0.99); }
  100% { transform: none; }
}
.dc-punch.is-celebrating .dc-hole.is-prize {
  will-change: transform;
  animation: dc-punch-pulse 300ms ease-in-out both;
  animation-delay: calc(var(--celebrate-at, 0ms) + 400ms);
}
@keyframes dc-punch-pulse {
  0%, 100% { transform: none; }
  50% { transform: scale(1.12); }
}
/* Home toast holding the mini card. */
.dc-punch-toast {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(5.75rem, calc(5.5rem + env(safe-area-inset-bottom, 0px)));
  z-index: 150;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  pointer-events: none;
}
.dc-punch-toast > button {
  pointer-events: auto;
  width: min(342px, 100%);
  padding: 0;
  border: 0;
  background: none;
  -webkit-tap-highlight-color: transparent;
}
.dc-punch-toast.is-leaving { animation: dc-punch-out 220ms ease-in both; }
@keyframes dc-punch-out { to { opacity: 0; transform: translateY(12px); } }
/* Profile: completed cards count under the card. */
.dc-punch-collection {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  font-family: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgb(11 11 12 / 0.6);
}
.dc-punch-collection b {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary, #facd15) 22%, #fff);
  color: rgb(var(--brand-800, 133 77 14));
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
html.dark .dc-punch-collection { color: rgb(255 255 255 / 0.65); }

@media (prefers-reduced-motion: reduce) {
  .dc-punch.is-entering .dc-punch__enter,
  .dc-hole.is-punching .dc-hole__fill { animation: dc-punch-num 200ms linear both; }
  .dc-punch.is-entering .dc-hole,
  .dc-punch.is-celebrating .dc-punch__card,
  .dc-punch.is-celebrating .dc-hole.is-prize { animation: none; }
  .dc-hole.is-punching .dc-hole__fill { transform: none; }
  .dc-hole__chad,
  .dc-hole__frag { display: none; }
  .dc-punch-toast.is-leaving { animation: dc-punch-num 150ms linear reverse both; }
}
