@import "@fontsource/creepster/400.css";

/* Portrait card designed at 300px wide. Positions and sizes use container
   units (1cqw = 3px at 300px wide), so the card scales to whatever width its
   slot gives it. */
.cpbw-hw {
  container-type: inline-size;
  width: 100%;
  font-family: var(--ino-default-font-family, Arial, Helvetica, sans-serif);
}

.cpbw-hw *,
.cpbw-hw *::before,
.cpbw-hw *::after {
  box-sizing: border-box;
}

.cpbw-hw-banner {
  position: relative;
  aspect-ratio: 300 / 404;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 15% 58%, #bd3e8380, transparent 40%),
    radial-gradient(ellipse at 80% 100%, #8e32c080, transparent 55%),
    linear-gradient(110deg, #42116c, #210765 58%, #411179);
  box-shadow: inset 0 0 0 1px #ffffff14, 0 10px 28px -12px #2a0a4f99;
  color: #fff;
  isolation: isolate;
}

.cpbw-hw-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.cpbw-hw-stars circle {
  animation: cpbw-hw-twinkle 3.2s ease-in-out infinite;
}

.cpbw-hw-stars circle:nth-child(2n) {
  animation-delay: 1.1s;
}

.cpbw-hw-stars circle:nth-child(3n) {
  animation-delay: 2.2s;
}

.cpbw-hw-spider {
  transform-origin: 272px 24px;
  animation: cpbw-hw-spider-swing 6s ease-in-out infinite;
}

/* Pumpkin */
.cpbw-hw-pumpkin {
  position: absolute;
  left: 19.67%;
  top: 1.67cqw;
  width: 60.67%;
  height: 70.33cqw;
  transform-origin: 50% 0;
  animation: cpbw-hw-swing 6s ease-in-out infinite;
}

.cpbw-hw-pumpkin svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: cpbw-hw-glow 4s ease-in-out infinite;
}

/* Ghosts beside the pumpkin */
.cpbw-hw-side-ghost {
  position: absolute;
  top: 58cqw;
  width: 9%;
  height: 10cqw;
  filter: drop-shadow(0 0 7px #eed0ff88);
  pointer-events: none;
}

.cpbw-hw-left-ghost {
  left: 11.33%;
  animation: cpbw-hw-left-float 5s ease-in-out infinite;
}

.cpbw-hw-right-ghost {
  right: 11.33%;
  animation: cpbw-hw-right-float 5.6s ease-in-out infinite;
}

/* Copy */
.cpbw-hw-copy {
  position: absolute;
  left: 4%;
  top: 72cqw;
  width: 92%;
  text-align: center;
  animation: cpbw-hw-fade 0.9s 0.15s both;
}

.cpbw-hw-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2cqw;
  margin-bottom: 1cqw;
  font-size: 5cqw;
  font-weight: 700;
  color: #fff;
}

.cpbw-hw-brand svg {
  width: 6cqw;
  height: 7.67cqw;
}

.cpbw-hw .cpbw-hw-season {
  margin: 0 0 4cqw;
  padding: 0;
  font-family: "Creepster", fantasy;
  font-size: 8cqw;
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1;
  color: #ffd476;
  text-shadow: 0 0 14px #ff9d2a59, 0 2px 6px #19072b;
}

/* Coupons */
.cpbw-hw-coupons {
  display: flex;
  justify-content: center;
  gap: 4cqw;
}

.cpbw-hw-coupon-group {
  display: flex;
  flex-direction: column;
  gap: 1.33cqw;
}

.cpbw-hw-coupon-group label {
  font-size: 2.67cqw;
  font-weight: 800;
  letter-spacing: 1.7px;
  line-height: 1;
  color: #ffd07a;
  cursor: default;
}

.cpbw-hw .cpbw-hw-coupon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4.67cqw;
  min-width: 31.67cqw;
  margin: 0;
  padding: 2cqw 3cqw;
  border: 1px dashed #e9922bcc;
  border-radius: 7px;
  background: #20093588;
  box-shadow: 0 0 10px #ff9a0026;
  transition: border-color 0.2s, transform 0.2s;
  color: #fff6dc;
  font-family: inherit;
  font-size: 4cqw;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 5cqw;
  cursor: pointer;
}

.cpbw-hw .cpbw-hw-coupon:hover,
.cpbw-hw .cpbw-hw-coupon:focus-visible {
  border-color: #ffb54a;
  background: #562158;
  color: #fff6dc;
  transform: translateY(-1px);
}

.cpbw-hw .cpbw-hw-coupon.is-copied {
  border-style: solid;
  border-color: #7ddc8f;
  background: #1f4a3a;
  color: #e6ffe9;
}

.cpbw-hw .cpbw-hw-coupon:focus-visible,
.cpbw-hw .cpbw-hw-cta:focus-visible {
  outline: 2px solid #ffe082;
  outline-offset: 2px;
}

.cpbw-hw-coupon svg {
  width: 4cqw;
  height: 4.33cqw;
  opacity: 0.85;
  stroke: #ffc35d;
  fill: none;
  stroke-width: 1.5;
}

/* CTA */
.cpbw-hw-actions {
  position: absolute;
  top: 111cqw;
  right: 13.33%;
  width: 73.33%;
  text-align: center;
  animation: cpbw-hw-fade 1s 0.45s both;
}

.cpbw-hw-button-group {
  position: relative;
}

.cpbw-hw .cpbw-hw-cta {
  display: block;
  position: relative;
  z-index: 2;
  padding: 3cqw 2.67cqw;
  border: 1px solid #ffe082;
  border-radius: 999px;
  background: linear-gradient(#ffdb4a, #ffa318);
  box-shadow: 0 0 12px #ffc344cc, 0 0 30px #ff8a0099, 0 0 52px #ff5e0044,
    inset 0 2px 0 #ffffff70;
  color: #23104b;
  font-size: 5.33cqw;
  font-weight: 800;
  line-height: 6.67cqw;
  text-decoration: none;
  transition: filter 0.2s;
  animation: cpbw-hw-nudge 5s 2s ease-in-out infinite,
    cpbw-hw-button-glow 4s ease-in-out infinite;
}

.cpbw-hw .cpbw-hw-cta:hover,
.cpbw-hw .cpbw-hw-cta:focus {
  color: #23104b;
  filter: brightness(1.12);
  box-shadow: 0 0 18px #ffd876ee, 0 0 42px #ff9b00bb, 0 0 64px #ff6b0066,
    inset 0 2px 0 #ffffff80;
}

.cpbw-hw-cta-arrow {
  display: inline-block;
  transition: transform 0.2s;
}

.cpbw-hw .cpbw-hw-cta:hover .cpbw-hw-cta-arrow {
  transform: translateX(3px);
}

.cpbw-hw-ghost {
  position: absolute;
  left: -8cqw;
  top: 1.33cqw;
  width: 9.67cqw;
  height: 11cqw;
  z-index: 1;
  filter: drop-shadow(0 0 7px #eecaff88);
  animation: cpbw-hw-follow 5s 2s ease-in-out infinite;
}

.cpbw-hw .cpbw-hw-date {
  margin: 3cqw 0 0;
  font-size: 3.33cqw;
  line-height: 4cqw;
  letter-spacing: 0.4px;
  color: #e9d6fb;
}

.cpbw-hw-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* Animations */
@keyframes cpbw-hw-swing {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes cpbw-hw-glow {
  0%, 100% { filter: drop-shadow(0 0 8px #ff780088); }
  50% { filter: drop-shadow(0 0 22px #ff9700dd); }
}

@keyframes cpbw-hw-fade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes cpbw-hw-nudge {
  0%, 74%, 100% { transform: translateX(0); }
  80%, 90% { transform: translateX(3px); }
  85%, 95% { transform: translateX(0); }
}

@keyframes cpbw-hw-follow {
  0%, 74%, 100% { transform: translate(0, 0) rotate(-5deg); }
  40% { transform: translate(0, -3px) rotate(4deg); }
  80%, 90% { transform: translate(6px, -1px) rotate(7deg); }
  85%, 95% { transform: translate(2px, 0); }
}

@keyframes cpbw-hw-left-float {
  0%, 100% { transform: translateY(0) rotate(-12deg); }
  50% { transform: translateY(-6px) rotate(-5deg); }
}

@keyframes cpbw-hw-right-float {
  0%, 100% { transform: translateY(-3px) rotate(12deg); }
  50% { transform: translateY(3px) rotate(5deg); }
}

@keyframes cpbw-hw-twinkle {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@keyframes cpbw-hw-spider-swing {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

@keyframes cpbw-hw-button-glow {
  0%, 100% {
    box-shadow: 0 0 12px #ffc344aa, 0 0 28px #ff8a0077, 0 0 45px #ff5e0033,
      inset 0 2px 0 #ffffff70;
  }
  50% {
    box-shadow: 0 0 18px #ffd363dd, 0 0 38px #ff9500aa, 0 0 58px #ff6e0055,
      inset 0 2px 0 #ffffff70;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cpbw-hw *,
  .cpbw-hw *::before {
    animation: none !important;
  }
}
