/* ══════════════════════════════════════════════════════════════════════════
   THE BLACK FRIDAY SCRATCH CARD (js/scratch.js) — the wheel window's frame
   (css/wheel.css) in black and gold, with a ticket instead of a wheel. Its own
   file for the same reason the wheel has one: the look's stylesheet may not
   name the cart's form or its payment buttons. Everything is under
   .wheel-dialog--scratch, or under the Black Friday look, so nothing here
   reaches the Halloween wheel.
   ══════════════════════════════════════════════════════════════════════════ */
.wheel-dialog--scratch .wheel-dialog__backdrop { background: rgba(4, 4, 6, 0.78); }
.wheel-dialog--scratch .wheel-dialog__card {
  color: #fff8e7;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(245, 197, 66, 0.2), transparent 60%),
    linear-gradient(170deg, #26262c 0%, #17171b 52%, #0b0b0d 100%);
  box-shadow: 0 0 0 1px rgba(245, 197, 66, 0.6), 0 30px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.wheel-dialog--scratch .wheel-dialog__card::before { content: none; }
.wheel-dialog--scratch .wheel-dialog__kicker { color: #f5c542; }
.wheel-dialog--scratch .wheel-dialog__title { text-shadow: 0 2px 18px rgba(245, 197, 66, 0.4); }
.wheel-dialog--scratch .wheel-dialog__sub,
.wheel-dialog--scratch .wheel-dialog__result { color: rgba(255, 248, 231, 0.84); }
.wheel-dialog--scratch .wheel-dialog__close { color: #fff8e7; }
.wheel-dialog--scratch .wheel-dialog__won { color: #f5c542; text-shadow: 0 2px 16px rgba(245, 197, 66, 0.5); }
.wheel-dialog--scratch .wheel-dialog__going { color: rgba(255, 248, 231, 0.75); }
.wheel-dialog--scratch .wheel-dialog__going::before { border-color: rgba(245, 197, 66, 0.35); border-top-color: #f5c542; }
.wheel-dialog--scratch .wheel-dialog__link { color: rgba(255, 248, 231, 0.72); }
.wheel-dialog--scratch .wheel-dialog__btn {
  color: #0b0b0d;
  background: linear-gradient(135deg, #ffe9a8, #f5c542 55%, #c8962a);
  box-shadow: 0 8px 22px rgba(245, 197, 66, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.wheel-dialog--scratch .wheel-dialog__btn:hover:not(:disabled) { box-shadow: 0 12px 28px rgba(245, 197, 66, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.wheel-dialog--scratch .wheel-dialog__close:focus-visible,
.wheel-dialog--scratch .wheel-dialog__btn:focus-visible,
.wheel-dialog--scratch .wheel-dialog__link:focus-visible { outline-color: #fff3c4; }

/* The ticket: a cream card in a gold frame, notched on both sides like a real one. */
.scratch {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 16 / 9;
  margin: 22px auto 8px;
  border-radius: 14px;
  background: #fff8e7;
  box-shadow: 0 0 0 3px #f5c542, 0 14px 34px rgba(0, 0, 0, 0.55);
}
.scratch::before,
.scratch::after {
  content: '';
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #17171b;
  box-shadow: 0 0 0 3px #f5c542;
  translate: 0 -50%;
  pointer-events: none;
}
.scratch::before { left: -9px; clip-path: inset(-4px -4px -4px 50%); }
.scratch::after { right: -9px; clip-path: inset(-4px 50% -4px -4px); }

.scratch__prize {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 26px;
  border-radius: inherit;
  color: #17171b;
  text-align: center;
}
.scratch__icon { font-size: clamp(2rem, 11vw, 2.8rem); line-height: 1.05; }
.scratch__big {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(2rem, 11vw, 3rem);
  line-height: 1;
  color: #8a6410;
}
.scratch__small { font-size: 0.95rem; font-weight: 800; line-height: 1.2; letter-spacing: 0.04em; }
.scratch.is-top .scratch__big { color: #c81e1e; }

/* Rubbed before the server has answered: three dots where the prize is about to be. */
.scratch:not(.is-armed) .scratch__prize::before {
  content: '\2022\2002\2022\2002\2022';
  font-size: 1.6rem;
  color: #c8962a;
}
@media (prefers-reduced-motion: no-preference) {
  .scratch:not(.is-armed) .scratch__prize::before { animation: scratch-wait 0.7s ease-in-out infinite alternate; }
  .scratch.is-armed .scratch__prize > * { animation: scratch-appear 0.22s ease-out both; }
}
@keyframes scratch-wait { to { opacity: 0.35; } }
@keyframes scratch-appear { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }

/* The hint: a finger rubbing to and fro over the foil until the first touch, then gone. It never
   takes the pointer, so the card can be scratched straight through it. */
.scratch__hint {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 46px;
  aspect-ratio: 50 / 68;
  margin-left: -23px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-3 -3 56 74'%3E%3Cg fill='%233a2600' stroke='%233a2600' stroke-width='5' stroke-linejoin='round'%3E%3Crect x='17' y='3' width='11' height='40' rx='5.5'/%3E%3Crect x='28' y='24' width='9.5' height='22' rx='4.75'/%3E%3Crect x='37.5' y='27' width='8.5' height='20' rx='4.25'/%3E%3Cpath d='M17 38L8 30a4.5 4.5 0 0 0-6.5 6L12 52z'/%3E%3Cpath d='M12 40h34v12a12 12 0 0 1-12 12H24a12 12 0 0 1-12-12z'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Crect x='17' y='3' width='11' height='40' rx='5.5'/%3E%3Crect x='28' y='24' width='9.5' height='22' rx='4.75'/%3E%3Crect x='37.5' y='27' width='8.5' height='20' rx='4.25'/%3E%3Cpath d='M17 38L8 30a4.5 4.5 0 0 0-6.5 6L12 52z'/%3E%3Cpath d='M12 40h34v12a12 12 0 0 1-12 12H24a12 12 0 0 1-12-12z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.45));
  transition: opacity 0.15s;
}
.scratch.is-started .scratch__hint { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .scratch__hint { animation: scratch-rub 2.2s ease-in-out infinite; }
}
@keyframes scratch-rub {
  0%, 100% { transform: translate(-74px, 4px) rotate(-14deg); }
  18%      { transform: translate(74px, -6px) rotate(12deg); }
  36%      { transform: translate(-74px, 4px) rotate(-14deg); }
  54%      { transform: translate(74px, -6px) rotate(12deg); }
  72%      { transform: translate(-74px, 4px) rotate(-14deg); }
}

/* The foil. The canvas takes the pointer, so the page must not scroll under the finger. A coin
   for a cursor on a computer. */
.scratch__foil {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  touch-action: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='13' fill='%23e9bf55' stroke='%238a6410' stroke-width='2'/%3E%3Ccircle cx='16' cy='16' r='8.5' fill='none' stroke='%238a6410' stroke-width='1.5'/%3E%3C/svg%3E") 16 16, pointer;
}
.scratch.is-open .scratch__foil { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .scratch.is-open .scratch__foil { transition: opacity 0.35s ease-out; }
  /* While the server deals the card: a glint runs over the foil. */
  .wheel-dialog__card[data-state="spinning"] .scratch:not(.is-armed) { animation: scratch-deal 0.7s ease-in-out infinite alternate; }
  .scratch.is-open.is-top { animation: scratch-glow 2.2s ease-in-out infinite alternate; }
  .wheel-dialog--scratch .wheel__bit { animation-duration: 2.4s; }
}
@keyframes scratch-deal { to { box-shadow: 0 0 0 3px #fff3c4, 0 0 26px 4px rgba(245, 197, 66, 0.55); } }
@keyframes scratch-glow { to { box-shadow: 0 0 0 3px #fff3c4, 0 0 40px 12px rgba(245, 197, 66, 0.75); } }

/* The sparks when it opens: the wheel's burst, in gold. */
.wheel-dialog--scratch .wheel__burst { z-index: 3; }
.wheel-dialog--scratch .wheel__bit--0 { background: #f5c542; }
.wheel-dialog--scratch .wheel__bit--1 { background: #fff3c4; }
.wheel-dialog--scratch .wheel__bit--2 { left: -6px; width: 12px; height: 12px; background: #c8962a; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }

/* ── The sushi box or the sake: about three cards in a hundred ──
   Gold rays turning behind the card, a flash, a stamp slammed across the ticket, the prize
   jumping out of it and gold coming down over the whole screen (js/scratch.js jackpot()). */
.jackpot-rays {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 233, 168, 0.5), transparent 58%);
}
.jackpot-rays::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 170vmax;
  height: 170vmax;
  margin: -85vmax 0 0 -85vmax;
  background: repeating-conic-gradient(rgba(245, 197, 66, 0.3) 0 10deg, transparent 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 60%);
  mask: radial-gradient(circle, #000 0, transparent 60%);
}
.wheel-dialog--jackpot .wheel-dialog__card {
  box-shadow: 0 0 0 2px #f5c542, 0 0 80px 18px rgba(245, 197, 66, 0.55), 0 30px 80px rgba(0, 0, 0, 0.7);
}
.wheel-dialog--jackpot .wheel-dialog__won { font-size: 1.9rem; }
/* "Scratch the card" has nothing left to say, and the stamp needs its place. */
.wheel-dialog--jackpot .wheel-dialog__sub { visibility: hidden; }
.jackpot-stamp {
  position: absolute;
  left: 50%;
  top: -34px;
  z-index: 4;
  padding: 0.22em 0.85em;
  border-radius: 8px;
  background: linear-gradient(135deg, #e5383b, #b5121b);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: 0 0 0 2px #f5c542, 0 8px 18px rgba(0, 0, 0, 0.5);
  translate: -50% 0;
  rotate: -5deg;
}
.jackpot-rain { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.jackpot__bit {
  position: absolute;
  top: -30px;
  width: 11px;
  height: 17px;
  border-radius: 2px;
}
.jackpot__bit--0 { background: #f5c542; }
.jackpot__bit--1 { background: #fff3c4; width: 8px; height: 13px; }
.jackpot__bit--2 { background: #e5383b; }
.jackpot__bit--3 {
  width: 18px;
  height: 18px;
  background: #ffe9a8;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
@media (prefers-reduced-motion: no-preference) {
  .jackpot-rays { animation: jackpot-flash 1.4s ease-out both; }
  .jackpot-rays::before { animation: jackpot-turn 60s linear infinite; }
  .jackpot-stamp { animation: jackpot-slam 0.95s cubic-bezier(0.2, 1.3, 0.4, 1) 0.25s both; }
  .jackpot__bit { animation: jackpot-fall var(--fall) linear var(--wait) infinite; }
  .wheel-dialog--jackpot .scratch.is-open.is-top { animation: jackpot-shake 1.1s ease-in-out both, scratch-glow 2.2s ease-in-out 1.1s infinite alternate; }
  /* As deep as the ordinary fade-in of the prize (.scratch.is-armed .scratch__prize > *), or it wins. */
  .wheel-dialog--jackpot .scratch.is-armed .scratch__prize .scratch__icon { animation: jackpot-icon 1.4s cubic-bezier(0.3, 1.5, 0.5, 1) both, jackpot-bob 1.8s ease-in-out 1.4s infinite alternate; }
}
@keyframes jackpot-flash {
  0%   { background-color: rgba(255, 248, 220, 0.95); }
  100% { background-color: transparent; }
}
@keyframes jackpot-turn { to { rotate: 360deg; } }
@keyframes jackpot-slam {
  from { opacity: 0; scale: 3.2; }
  to   { opacity: 1; scale: 1; }
}
@keyframes jackpot-fall {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(110vh) rotate(var(--turn)); }
}
@keyframes jackpot-shake {
  0%, 100% { transform: none; }
  20%      { transform: translateX(-7px) rotate(-1.6deg); }
  40%      { transform: translateX(7px) rotate(1.6deg); }
  60%      { transform: translateX(-5px) rotate(-1deg); }
  80%      { transform: translateX(4px) rotate(0.8deg); }
}
@keyframes jackpot-icon {
  from { opacity: 0; transform: scale(0.2) rotate(-24deg); }
  to   { opacity: 1; transform: scale(1.35); }
}
@keyframes jackpot-bob {
  from { transform: scale(1.35) translateY(0); }
  to   { transform: scale(1.35) translateY(-5px); }
}

@media (max-height: 640px) {
  .scratch { width: min(270px, 100%); margin-top: 14px; }
}

/* The cart's note and the prize in the totals: gold, with a ticket instead of the pumpkin. */
html[data-holiday="blackfriday"] .cart-wheel-note,
html[data-holiday="blackfriday"] .cart-summary__discount.cart-summary__discount--wheel { color: #8a6410; }
html[data-holiday="blackfriday"][data-theme="dark"] .cart-wheel-note,
html[data-holiday="blackfriday"][data-theme="dark"] .cart-summary__discount.cart-summary__discount--wheel { color: #f5c542; }
html[data-holiday="blackfriday"] .cart-wheel-note::before,
html[data-holiday="blackfriday"] .cart-summary__discount--wheel span::before,
html[data-holiday="blackfriday"][data-theme="dark"] .cart-wheel-note::before,
html[data-holiday="blackfriday"][data-theme="dark"] .cart-summary__discount--wheel span::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M3 11h34v6a3 3 0 0 0 0 6v6H3v-6a3 3 0 0 0 0-6z' fill='%23f5c542' stroke='%238a6410' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M15 13v14' stroke='%238a6410' stroke-width='2' stroke-dasharray='3 3'/%3E%3C/svg%3E");
}
html[data-holiday="blackfriday"] .order-confirmed__wheel { color: #8a6410; }
html[data-holiday="blackfriday"][data-theme="dark"] .order-confirmed__wheel { color: #f5c542; }
