.scratch-game[hidden], .scratch-game [hidden] { display: none !important; }
.scratch-game { position: fixed; inset: 0; z-index: 16000; display: grid; place-items: center; padding: 20px; background: rgba(26,30,35,.46); backdrop-filter: blur(6px); }
.scratch-game__panel { position: relative; width: min(410px,100%); box-sizing: border-box; max-height: calc(100dvh - 40px); overflow-y: auto; padding: 44px 28px 28px; border: 1px solid #e9e5dc; border-radius: 24px; background: #fff; color: #202124; text-align: center; box-shadow: 0 24px 80px #0003; font-family: Arial,sans-serif; }
.scratch-game__close { position: absolute; top: 9px; right: 11px; width: 32px; height: 32px; border-radius: 50%; padding: 0; border: 0; background: #f5f5f3; color: #545454; font-size: 27px; font-weight: 300; line-height: 1; cursor: pointer; }
.scratch-game h2 { margin: 0 0 12px; color: #202124; font-size: 28px; font-weight: 800; letter-spacing: -.7px; line-height: 1.15; }
.scratch-game__subtitle { margin: 0; color: #686868; font-size: 18px; line-height: 1.4; }
.scratch-game__subtitle strong { color: #a87918; font-weight: 800; }
.scratch-game__card { position: relative; display: grid; place-items: center; min-height: 160px; margin: 24px 0 22px; overflow: hidden; border: 1px solid #e9e2d2; border-radius: 18px; background: #fff; }
#scratchGameReward { padding: 18px; color: #a87918; font-size: 30px; font-weight: 900; line-height: 1.1; text-align: center; letter-spacing: -1px; }
.scratch-game--percent #scratchGameReward { font-size: 58px; letter-spacing: -3px; }
.scratch-game:not(.scratch-game--revealed) .scratch-game__card { cursor: grab; }
.scratch-game:not(.scratch-game--revealed) .scratch-game__card:active { cursor: grabbing; }
.scratch-game canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.scratch-game canvas:active { cursor: grabbing; }
.scratch-game__result { margin: 0 0 22px; color: #626262; font-size: 16px; line-height: 1.6; font-weight: 400; overflow-wrap: anywhere; }
.scratch-game__continue, #scratchAddToOrder { display: block; width: 100%; padding: 16px 12px; border: 0; border-radius: 8px; background: linear-gradient(110deg,#ff6100,#ff9800); box-shadow: 0 5px 15px #ff6a001f; color: #fff; font-size: 14px; line-height: 1.2; font-weight: 800; cursor: pointer; }
.scratch-game button:focus-visible { outline: 2px solid #ffca51; outline-offset: 4px; }
.scratch-game button:disabled { opacity: .65; cursor: wait; }
.scratch-game--product-result .scratch-game__panel { width: min(430px,100%); }
.scratch-game--product-result .scratch-game__card { min-height: 0; margin: 18px 0; background: transparent; clip-path: none; transform: none; overflow: visible; }
.scratch-reveal-product { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 10px; color: #202124; }
.scratch-reveal-win { display: none; }
.scratch-reveal-pack { color: #686868; font-size: 13px; }
.scratch-reveal-media { display: flex; justify-content: center; width: 100%; }
.scratch-reveal-media img { width: 100%; max-width: 250px; height: 150px; object-fit: contain; border-radius: 12px; background: #fff; }
#scratchRevealDiscount { display: block; width: 100%; box-sizing: border-box; padding: 16px 10px; color: #a87918; background: #fff; font-size: 58px; letter-spacing: -3px; font-weight: 900; line-height: 1.1; }
.scratch-reveal-prices { display: flex; align-items: baseline; justify-content: center; gap: 12px; }
#scratchRevealRegularPrice { color: #858585; font-size: 17px; }
#scratchRevealPrice { color: #202124; font-size: 28px; }
#scratchRevealName { display: none; }
#scratchProductChoice p { margin: 0 0 15px; font-size: 14px; line-height: 1.5; color: #626262; }
#scratchSkipProduct { margin-top: 12px; padding: 8px 14px; border: 0; background: transparent; color: #686868; font-size: 13px; cursor: pointer; }
@media (max-width: 390px) { .scratch-game { padding: 15px; } .scratch-game__panel { padding: 40px 22px 24px; max-height: calc(100dvh - 30px); } .scratch-game h2 { font-size: 25px; } .scratch-game__subtitle { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .scratch-game { backdrop-filter: none; } }

.scratch-game--immediate .scratch-game__panel { width: min(500px,100%); padding: 48px 32px 32px; }
.scratch-game--immediate h2 { font-size: 34px; }
.scratch-game--immediate .scratch-game__subtitle { font-size: 21px; }
.scratch-game--immediate .scratch-game__card { min-height: 210px; }
.scratch-game--immediate.scratch-game--product-result .scratch-game__card { min-height: 0; }
.scratch-game--immediate #scratchGameReward { font-size: 36px; }
.scratch-game--immediate.scratch-game--percent #scratchGameReward { font-size: 72px; }
/* Show the foil immediately while the server persists the reward. */
.scratch-game--loading .scratch-game__card > * { visibility: hidden; }
.scratch-game--loading .scratch-game__card::after { content: 'GREBI OVDJE'; position: absolute; inset: 0; display: grid; place-items: center; color: #8f7439; font-size: 22px; font-weight: 900; background: linear-gradient(135deg,#fff,#f7f4ed 50%,#fff); }
.scratch-game--immediate:not(.scratch-game--revealed) .scratch-game__card { min-height: 260px; }
@media (max-width: 390px) {
  .scratch-game--immediate .scratch-game__panel { padding: 44px 22px 26px; }
  .scratch-game--immediate h2 { font-size: 30px; }
  .scratch-game--immediate .scratch-game__subtitle { font-size: 19px; }
  .scratch-game--immediate .scratch-game__card { min-height: 190px; }
  .scratch-game--immediate:not(.scratch-game--revealed) .scratch-game__card { min-height: 230px; }
  .scratch-game--immediate.scratch-game--product-result .scratch-game__card { min-height: 0; }
}

/* Metallic gold stays on the discount figures, with a readable fallback. */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .scratch-game--percent #scratchGameReward, #scratchRevealDiscount {
    background-image: linear-gradient(115deg,#8d6413 5%,#bf902c 30%,#e0b850 48%,#ab791a 70%,#8d6413 95%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
  }
}
.scratch-game--product-result .scratch-game__card { border: 0; }
