/* "🎰 הפריט היומי" — the vintage slot machine on the home page (public/js/slot.js).
   Enamel berry body, chrome and gold trim, a cream marquee sign with bulbs that
   chase, three glass reel windows, a lever with a red knob. The machine keeps
   its own colours in light and dark; the prize card follows the site's. */

.slot-lock { overflow: hidden; }

.slot-back {
  position: fixed; inset: 0; z-index: 2000; overscroll-behavior-x: none;
  display: grid; place-items: center; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 30%, rgba(90, 20, 55, .78), rgba(14, 6, 12, .9));
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  opacity: 0; transition: opacity .25s ease;
}
.slot-back.in { opacity: 1; }

.slot-dlg {
  --cell: min(calc((100vw - 150px) / 3), 128px);
  --gold: linear-gradient(180deg, #fff1b8 0%, #f2c14e 30%, #b98222 62%, #ffe08a 100%);
  --chrome: linear-gradient(90deg, #8e949c 0%, #f4f6f8 22%, #b9bec5 45%, #ffffff 58%, #8c929a 100%);
  position: relative; width: min(470px, 100%); margin: auto;
  padding-right: 34px;   /* room for the lever (always on the right, like a real machine) */
  transform: translateY(18px) scale(.94); transition: transform .45s cubic-bezier(.2, 1.4, .4, 1);
}
.slot-back.in .slot-dlg { transform: none; }
/* light rays behind the machine */
.slot-dlg::before {
  content: ''; position: absolute; inset: -18% -30%; z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 120, .16) 0 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle at 50% 35%, #000 0 30%, transparent 62%); mask: radial-gradient(circle at 50% 35%, #000 0 30%, transparent 62%);
  animation: slotRays 28s linear infinite;
}
@keyframes slotRays { to { transform: rotate(360deg); } }

.slot-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.slot-x, .slot-sound {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255, 241, 184, .7);
  background: rgba(30, 10, 22, .55); color: #fff6dc; font-size: 20px; line-height: 1; cursor: pointer;
}
.slot-x:hover, .slot-sound:hover { background: rgba(30, 10, 22, .85); }

/* ---- the body ---- */
.slot-machine {
  position: relative; border-radius: 26px 26px 18px 18px; padding: 0 14px 16px;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, .22), transparent 55%),
    linear-gradient(160deg, #c23d78 0%, #8e2257 45%, #5e1238 100%);
  box-shadow: 0 0 0 4px #e8b84a, 0 0 0 7px #7a4a0c, 0 0 0 9px #f3d27a, 0 28px 60px rgba(0, 0, 0, .55), inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -10px 24px rgba(0, 0, 0, .35);
}
.slot-crown {
  position: relative; margin: 0 -14px 14px; padding: 12px 14px 10px; border-radius: 26px 26px 50% 50% / 26px 26px 22px 22px;
  background: linear-gradient(180deg, #fffaf0, #ffe9c4);
  box-shadow: inset 0 -5px 0 #e8b84a, inset 0 -8px 0 #9a6214, 0 6px 14px rgba(0, 0, 0, .3);
  text-align: center;
}
.slot-sign { display: flex; align-items: center; justify-content: center; gap: 10px; }
.slot-sign h2 {
  margin: 0; font-family: 'Secular One', Rubik, sans-serif; font-size: clamp(30px, 8vw, 42px); line-height: 1.1; color: #9b1544;
  text-shadow: 0 2px 0 #fff, 0 3px 0 #e8b84a, 0 0 18px rgba(232, 60, 120, .45);
}
.slot-star { color: #d9a02a; font-size: 22px; animation: slotTwinkle 1.6s ease-in-out infinite; }
.slot-star:last-child { animation-delay: -.8s; }
@keyframes slotTwinkle { 50% { transform: scale(1.35) rotate(20deg); opacity: .7; } }
.slot-date { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: #6b3a1a; }

/* bulbs */
.slot-bulbs { display: flex; justify-content: space-between; pointer-events: none; }
.slot-bulbs.top { margin: 0 6px 8px; }
.slot-bulbs i {
  width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffbe6, #ffcf4a 45%, #c47a12);
  box-shadow: 0 0 8px 2px rgba(255, 200, 70, .85);
  animation: slotBulb 1.1s steps(1) infinite; animation-delay: calc(var(--k) * -.12s);
}
.slot-bulbs i:nth-child(odd) { animation-delay: calc(var(--k) * -.12s - .55s); }
@keyframes slotBulb { 50% { background: radial-gradient(circle at 35% 30%, #fff, #f7a8c8 45%, #b8336a); box-shadow: 0 0 5px 1px rgba(255, 130, 180, .5); } }
.slot-bulbs.side { position: absolute; top: 8px; bottom: 54px; flex-direction: column; }
.slot-bulbs.s1 { inset-inline-start: 3px; }
.slot-bulbs.s2 { inset-inline-end: 3px; }
.slot-bulbs.side i { width: 8px; height: 8px; }
.win .slot-bulbs i { animation-duration: .22s; }

/* ---- the reel window ---- */
.slot-face { position: relative; padding: 0 10px; }
.slot-window {
  position: relative; display: grid; grid-template-columns: repeat(3, var(--cell)); justify-content: center; gap: 7px; width: fit-content; margin-inline: auto;
  padding: 10px; border-radius: 14px;
  background: linear-gradient(180deg, #2a0a1a, #4a1430);
  box-shadow: inset 0 0 0 3px #f3d27a, inset 0 0 0 6px #7a4a0c, inset 0 8px 18px rgba(0, 0, 0, .7), 0 2px 0 rgba(255, 255, 255, .25);
}
.slot-reel {
  position: relative; height: var(--cell); overflow: hidden; border-radius: 8px;
  background: #fffaf0; box-shadow: inset 0 0 0 2px #c9a24a;
}
.slot-strip {
  height: calc(var(--cell) * var(--n));
  transform: translateY(0); will-change: transform;
  transition-property: transform; transition-timing-function: cubic-bezier(.12, .62, .22, 1.04);
}
.slot-strip.run, .slot-reel.now .slot-strip { transform: translateY(calc(-100% * (var(--n) - 1) / var(--n))); }
.slot-reel.now .slot-strip { transition: none; }
.slot-cell { height: var(--cell); padding: 5px; }
.slot-cell img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; background: #f1e3d0; }
.slot-reel.go .slot-cell img { filter: blur(1.6px) saturate(1.2); }
/* curved glass: dark at top and bottom, a shine across */
.slot-glass {
  position: absolute; inset: 0; pointer-events: none; border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, transparent 22%, transparent 78%, rgba(0, 0, 0, .55) 100%),
    linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .45) 38%, transparent 46%);
}
.slot-reel.stopped { animation: slotHit .38s ease-out; }
@keyframes slotHit { 30% { transform: translateY(5px); } 60% { transform: translateY(-2px); } }
.slot-payline {
  position: absolute; inset-inline: 4px; top: 50%; height: 3px; transform: translateY(-50%); pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 70, 110, .85) 8%, rgba(255, 70, 110, .85) 92%, transparent);
  box-shadow: 0 0 10px rgba(255, 70, 110, .8); opacity: .55;
}
.slot-payline::before, .slot-payline::after {
  content: ''; position: absolute; top: 50%; transform: translateY(-50%); border: 8px solid transparent;
}
.slot-payline::before { right: -6px; border-right-color: #ffd166; }
.slot-payline::after { left: -6px; border-left-color: #ffd166; }
.win .slot-payline { opacity: 1; animation: slotLine .3s steps(1) 6; }
@keyframes slotLine { 50% { opacity: .2; } }
.win .slot-reel { box-shadow: inset 0 0 0 2px #ffd166, 0 0 16px 4px rgba(255, 209, 102, .9); }

.slot-jack {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-family: 'Secular One', Rubik, sans-serif; font-size: clamp(38px, 11vw, 60px); color: #fff3c4;
  -webkit-text-stroke: 2px #9b1544; text-shadow: 0 4px 0 #7a4a0c, 0 0 26px rgba(255, 200, 80, .95);
  opacity: 0; transform: scale(.3) rotate(-8deg);
}
.win .slot-jack { animation: slotJack 1.7s cubic-bezier(.2, 1.5, .4, 1) forwards; }
@keyframes slotJack { 0% { opacity: 0; transform: scale(.3) rotate(-8deg); } 25% { opacity: 1; transform: scale(1.12) rotate(-4deg); } 70% { opacity: 1; transform: scale(1) rotate(-4deg); } 100% { opacity: 0; transform: scale(1.3) rotate(-4deg); } }

.slot-hint { margin: 10px 4px 0; text-align: center; color: #ffeec9; font-size: 14px; line-height: 1.45; }
.win .slot-hint { visibility: hidden; }

/* ---- the button tray ---- */
.slot-tray { margin: 12px 10px 0; padding: 10px; border-radius: 12px; background: linear-gradient(180deg, #3f0d27, #5e1238); box-shadow: inset 0 4px 10px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .2); }
.slot-spin {
  display: block; width: 100%; min-height: 56px; border: 0; border-radius: 12px; cursor: pointer;
  font-family: 'Secular One', Rubik, sans-serif; font-size: 24px; color: #3a1d00; letter-spacing: .5px;
  background: var(--gold); box-shadow: 0 5px 0 #7a4a0c, 0 8px 18px rgba(0, 0, 0, .45), inset 0 2px 0 #fff8d8;
  animation: slotPulse 1.8s ease-in-out infinite;
}
.slot-spin:hover:not(:disabled) { filter: brightness(1.07); }
.slot-spin:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #7a4a0c, 0 3px 8px rgba(0, 0, 0, .4), inset 0 2px 0 #fff8d8; }
.slot-spin:disabled { animation: none; cursor: default; opacity: .92; }
@keyframes slotPulse { 50% { box-shadow: 0 5px 0 #7a4a0c, 0 0 26px 6px rgba(255, 209, 102, .65), inset 0 2px 0 #fff8d8; } }
.slot-feet { display: flex; justify-content: space-between; margin: 10px 18px -26px; }
.slot-feet i { width: 54px; height: 12px; border-radius: 0 0 10px 10px; background: var(--chrome); box-shadow: 0 4px 6px rgba(0, 0, 0, .4); }

/* ---- the lever ---- */
.slot-lever {
  position: absolute; top: 26%; right: -32px; width: 40px; height: 44%;
  padding: 0; border: 0; background: none; cursor: pointer; touch-action: none;
}
.slot-hub {
  position: absolute; bottom: 0; left: 4px; width: 30px; height: 46px; border-radius: 8px 12px 12px 8px;
  background: var(--chrome); box-shadow: 0 4px 8px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(0, 0, 0, .15);
}
.slot-rod {
  position: absolute; bottom: 22px; left: 50%; width: 9px; margin-left: -4.5px; border-radius: 5px;
  height: calc(100% - 22px - var(--p, 0) * 62%);
  background: var(--chrome); box-shadow: 1px 0 3px rgba(0, 0, 0, .4);
}
.slot-knob {
  position: absolute; top: -20px; left: 50%; width: 38px; height: 38px; margin-left: -19px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0 8%, #ff6b8b 22%, #c8102e 58%, #6e0016 100%);
  box-shadow: 0 5px 10px rgba(0, 0, 0, .5), 0 0 0 2px rgba(110, 0, 22, .4); cursor: grab;
}
.slot-lever:not(:disabled) .slot-knob { animation: slotKnob 2.2s ease-in-out infinite; }
@keyframes slotKnob { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(6px); } 90% { transform: translateY(-2px); } }
.slot-lever.pull .slot-rod { animation: slotPull .7s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes slotPull { 35% { height: calc(100% - 22px - 62%); } }
.slot-lever:disabled { cursor: default; }
.slot-lever:focus-visible { outline: 3px solid #ffd166; outline-offset: 4px; border-radius: 8px; }

/* ---- the prize ---- */
.slot-prize {
  position: relative; margin-top: 34px; padding: 18px 16px 16px; border-radius: 18px; text-align: center;
  background: var(--card); color: var(--ink);
  box-shadow: 0 0 0 3px #e8b84a, 0 20px 50px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(24px) scale(.96); transition: opacity .45s ease, transform .55s cubic-bezier(.2, 1.4, .4, 1);
}
.slot-prize.in { opacity: 1; transform: none; }
.slot-prize:focus { outline: none; }
.slot-prize:focus-visible { outline: 3px solid var(--focus, #b8336a); outline-offset: 3px; }
.slot-win {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%); margin: 0; white-space: nowrap;
  padding: 6px 16px; border-radius: 999px; font-weight: 700; color: #3a1d00; background: var(--gold); box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}
.slot-pic { display: block; margin: 6px auto 10px; max-width: 260px; }
.slot-pic img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; box-shadow: 0 8px 22px rgba(0, 0, 0, .2); }
.slot-title { margin: 0; font-size: 22px; }
.slot-title a { color: inherit; text-decoration: none; }
.slot-title a:hover { text-decoration: underline; }
.slot-desc { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.slot-price { margin: 8px 0 0; font-size: 28px; font-weight: 800; color: var(--primary); }
.slot-shop { margin: 6px 0 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.slot-coupon {
  display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 10px 12px; text-align: start;
  border: 2px dashed #c98a1c; border-radius: 12px; background: rgba(255, 209, 102, .16);
}
.slot-coupon .cg { font-size: 28px; }
.slot-coupon div { flex: 1; display: flex; flex-direction: column; }
.slot-coupon small { color: var(--muted); }
.slot-code { font-family: ui-monospace, monospace; font-size: 17px; letter-spacing: 1px; }
.slot-go { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.slot-go .btn { flex: 1; max-width: 200px; }
.slot-prize .share { justify-content: center; margin-top: 10px; }
.slot-tomorrow { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

.slot-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }

/* ---- the corner button ---- */
.slot-fab {
  position: fixed; z-index: 60; inset-inline-start: 12px; bottom: calc(16px + var(--bottom-nav, 0px) + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 6px 14px 6px 10px; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 15px Rubik, sans-serif; color: #3a1d00; background: linear-gradient(180deg, #fff1b8, #f2c14e 50%, #d99a2b);
  box-shadow: 0 0 0 2px #9b1544, 0 6px 16px rgba(0, 0, 0, .3);
}
.slot-fab .fi { font-size: 24px; line-height: 1; }
.slot-fab.fresh { animation: slotFab 1.6s ease-in-out infinite; }
.slot-fab.fresh::after { content: ''; position: absolute; top: 2px; inset-inline-end: 4px; width: 11px; height: 11px; border-radius: 50%; background: #e0123f; box-shadow: 0 0 0 2px #fff; }
@keyframes slotFab { 50% { box-shadow: 0 0 0 2px #9b1544, 0 0 22px 6px rgba(255, 200, 70, .8); transform: translateY(-2px); } }
/* in the header, level with the logo, 12px from the right edge (slot.js sets `top`) */
.slot-fab.inhead { position: absolute; z-index: 6; bottom: auto; inset-inline-start: auto; right: 12px; }
@media (max-width: 600px) {
  .slot-fab { padding: 6px; width: 52px; height: 52px; justify-content: center; }
  .slot-fab .fl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 380px) {
  .slot-dlg { padding-right: 28px; }
  .slot-machine { padding: 0 8px 14px; }
  .slot-window { gap: 5px; padding: 7px; }
  .slot-lever { right: -27px; }
  .slot-sign h2 { font-size: 28px; }
}

/* still: nothing moves (the phone's setting or "עצירת אנימציות") */
.a11y-still .slot-dlg::before, .a11y-still .slot-star, .a11y-still .slot-bulbs i, .a11y-still .slot-spin, .a11y-still .slot-knob, .a11y-still .slot-fab.fresh,
.a11y-still .slot-reel.stopped, .a11y-still .win .slot-payline { animation: none !important; }
.a11y-still .slot-jack { display: none; }
.a11y-still .slot-dlg, .a11y-still .slot-prize, .a11y-still .slot-back { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .slot-dlg::before, .slot-star, .slot-bulbs i, .slot-spin, .slot-knob, .slot-fab.fresh, .slot-reel.stopped, .win .slot-payline { animation: none !important; }
  .slot-jack { display: none; }
  .slot-dlg, .slot-prize, .slot-back { transition: none; }
}

/* "📖 הסיפור של הפריט" inside the prize card */
.slot-story:empty { display: none; }
.slot-prize .story.inslot { margin: 14px 0 4px; }

/* "🔔 ההתראה היומית" under the prize */
.slot-push:empty { display: none; }
.slot-push {
  margin: 12px 0 2px; padding: 12px 12px 10px; border-radius: 10px; text-align: center;
  background: color-mix(in srgb, var(--accent, #f7c6d9) 35%, var(--card, #fff)); border: 1px dashed var(--primary, #b8336a);
}
.slot-push .sp-q { margin: 0 0 8px; font-weight: 600; }
.slot-push .sp-on { margin: 0; font-size: 14px; }
.slot-push .sp-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.slot-push .sp-row .btn { min-height: 44px; }
.slot-push .linkish { background: none; border: 0; padding: 6px 2px; min-height: 36px; font: inherit; color: var(--link, #9c2f6b); text-decoration: underline; cursor: pointer; }

/* ---- "פרקים לחגים": the machine dressed for a holiday (server/holidays.js) ---- */
.slot-machine.holiday .slot-sign { box-shadow: 0 0 0 4px var(--hol, #b8336a), 0 0 26px color-mix(in srgb, var(--hol, #b8336a) 60%, transparent); }
.slot-hol {
  margin: 6px auto 0; width: fit-content; padding: 4px 14px; border-radius: 999px; font: 800 15px Rubik, sans-serif; color: #fff;
  background: var(--hol, #b8336a); box-shadow: 0 0 0 2px #f2c14e, 0 4px 10px rgba(0, 0, 0, .3);
}
.slot-garland { position: absolute; top: -26px; left: 4%; right: 4%; z-index: 3; display: flex; justify-content: space-between; pointer-events: none; }
.slot-garland i { font-style: normal; font-size: 26px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); animation: slotSwing 2.6s ease-in-out infinite; animation-delay: calc(var(--k) * -.3s); transform-origin: 50% 0; }
.slot-garland i:nth-child(even) { margin-top: 10px; }
@keyframes slotSwing { 50% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .slot-garland i { animation: none; } }
html.a11y-still .slot-garland i { animation: none; }
/* the owner's slot-machine picture (2026-11-03): same box as the old emoji */
.slot-fab img.fi { width: 30px; height: 30px; object-fit: contain; display: block; }
.slot-spin-ic { width: 1.3em; height: 1.3em; object-fit: contain; vertical-align: middle; margin-inline-end: 4px; }
