/* ============================================================
   Gimme Giveaways — Instant Win scratch-and-reveal overlay
   ============================================================ */
.iw-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.iw-modal[hidden] { display: none; }              /* beat the .iw-modal display:flex */

.iw-backdrop {
  position: absolute; inset: 0;
  background: rgba(11, 11, 15, .62); backdrop-filter: blur(6px);
}

.iw-box {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  background: var(--bg, #fff);
  border: 1px solid var(--hairline, rgba(11,11,15,.1));
  border-top: 4px solid var(--gold, #F8BF3D);
  border-radius: 20px;
  padding: 26px 24px 22px;
  box-shadow: 0 40px 90px rgba(11, 11, 15, .35);
  animation: iw-in .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes iw-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

.iw-x {
  position: absolute; top: 10px; right: 12px;
  width: 34px; height: 34px; border: 0; background: transparent;
  color: var(--ink-dim, #6B655A); font-size: 26px; line-height: 1; cursor: pointer; border-radius: 8px;
}
.iw-x:hover { background: var(--surface, #EFEBE0); color: var(--ink, #0B0B0F); }

.iw-head { text-align: center; margin-bottom: 16px; }
.iw-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-ink, #A0710E); }
.iw-game { font-family: var(--f-serif, serif); font-weight: 700; font-size: 24px; line-height: 1.1; margin: 6px 0 4px; color: var(--ink, #0B0B0F); }
.iw-sub { font-size: 13.5px; color: var(--ink-dim, #6B655A); margin: 0; }

/* Stage — the scratch area + result */
.iw-stage { position: relative; }
.iw-scratch {
  position: relative; border-radius: 16px; overflow: hidden;
  background: var(--surface, #EFEBE0);
  border: 1px solid var(--hairline, rgba(11,11,15,.1));
}
.iw-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px; }
.iw-cell {
  aspect-ratio: 1; display: grid; place-items: center;
  font-size: clamp(32px, 12vw, 46px); line-height: 1;
  background: #fff; border-radius: 12px;
  border: 1px solid var(--hairline, rgba(11,11,15,.1));
}
.iw-foil {
  position: absolute; inset: 0; width: 100%; height: 100%;
  cursor: grab; touch-action: none; display: none;
}
.iw-foil:active { cursor: grabbing; }

/* Winning cells pop + go gold */
.iw-stage.win .iw-cell {
  border-color: var(--gold, #F8BF3D);
  box-shadow: 0 0 0 2px var(--gold-line, rgba(248,191,61,.55)) inset, 0 6px 16px rgba(126, 88, 8, .18);
  animation: iw-pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.iw-stage.win .iw-cell:nth-child(2) { animation-delay: .08s; }
.iw-stage.win .iw-cell:nth-child(3) { animation-delay: .16s; }
@keyframes iw-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* Result block, revealed after the scratch */
.iw-result {
  text-align: center; margin-top: 14px; min-height: 30px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s;
}
.iw-stage.revealed .iw-result { opacity: 1; transform: none; }
.iw-tag {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-dim, #6B655A);
}
.iw-tag.win {
  color: #2a1e00; background: linear-gradient(180deg, #FFE39B, var(--gold, #F8BF3D));
  padding: 4px 12px; border-radius: 999px;
}
.iw-big { font-family: var(--f-serif, serif); font-weight: 800; font-size: 40px; line-height: 1; color: var(--gold-ink, #A0710E); }
.iw-lbl { font-size: 13px; color: var(--ink-dim, #6B655A); }
.iw-miss { font-size: 14.5px; color: var(--ink-2, #2A2922); }

/* Loading */
.iw-loading {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface, #EFEBE0); border-radius: 16px;
  font-size: 14px; font-weight: 600; color: var(--ink-2, #2A2922);
}
.iw-loading[hidden] { display: none; }
.iw-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--gold-soft, #FDEBB5); border-top-color: var(--gold-deep, #7E5808);
  animation: iw-spin .7s linear infinite;
}
@keyframes iw-spin { to { transform: rotate(360deg); } }

/* Actions + footnote */
.iw-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.iw-btn[hidden] { display: none; }
.iw-btn { min-width: 130px; justify-content: center; }
.iw-foot { text-align: center; font-size: 12px; color: var(--ink-dim, #6B655A); margin: 12px 0 0; }

/* Confetti */
.iw-confetti { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.iw-piece {
  position: absolute; top: -24px; width: 9px; height: 15px; border-radius: 2px;
  opacity: .95; will-change: transform;
  animation-name: iw-fall; animation-timing-function: cubic-bezier(.3, .1, .5, 1); animation-fill-mode: forwards;
}
@keyframes iw-fall {
  0% { transform: translateY(-10vh) rotate(0); opacity: 1; }
  100% { transform: translateY(112vh) rotate(680deg); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .iw-box, .iw-stage.win .iw-cell, .iw-result { animation: none !important; transition: none !important; }
  .iw-result { opacity: 1; transform: none; }
}
