/* ── Scratch prank · mobile-first (these get opened on phones) ───────── */

:root {
  --orange:  #FBA318;
  --orange-d:#F08A05;
  --navy:    #1B2A6B;
  --ink:     #14161a;
  --paper:   #fff7ea;
  --green:   #1f7a3d;
  --radius:  18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Devanagari", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Mobile-only layout. No page padding — the banners bleed to the screen edges,
   and the sections between them pad themselves. */
.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── banner slots ─────────────────────────────────────────────────── */

/* Both banners are full-bleed: the top one flush to top/left/right, the footer
   one flush to bottom/left/right. No margin, no padding, no radius, no shadow —
   anything of the sort would read as an inset from the screen edge. */
.banner {
  width: 100%;
  margin: 0;
  padding: 0;
  display: block;
  position: relative;         /* anchors the countdown timer overlay */
  line-height: 0;             /* kills the inline-image gap under the banner */
}

.banner img,
.banner__link,
.banner__empty {
  width: 100%;
  max-width: none;
  height: auto;
  display: block;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.banner__link { cursor: pointer; }

/* An uploaded banner keeps its own proportions — height follows the image, so
   nothing is ever cut off. These ratios apply only to the empty placeholders. */
.banner--top .banner__empty    { aspect-ratio: 436 / 709; }
.banner--footer .banner__empty { aspect-ratio: 333 / 709; }

.banner__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed #d8c3a0;
  background: #fffdf7;
  color: #a08d6d;
  text-align: center;
  padding: 16px;
  line-height: 1.6;
}
.banner__empty span  { font-size: 17px; font-weight: 700; }
.banner__empty small { font-size: 13px; opacity: .8; }
.banner__empty em    { font-size: 12px; font-style: normal; opacity: .65; max-width: 180px; }

/* ── countdown timer · overlaid on the top banner ─────────────────── */

/* Positioned as % of the banner via inline styles from the admin timer_*
   settings, so it lands inside the box drawn in the banner art. */
.timer {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  overflow: hidden;
}

.timer span {
  font-weight: 900;
  color: #000;
  /* Fills the box: scales with the box width, capped so it never overflows the
     height. Tabular figures keep the digits from jittering as they change. */
  font-size: clamp(14px, 6.2vw, 46px);
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
  white-space: nowrap;
}

/* ── the card ─────────────────────────────────────────────────────── */

.stage {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 20px 12px;
}

/* No forced aspect-ratio: the card takes the artwork's own proportions, so the
   whole image is visible and nothing is cropped, whatever shape it is. */
.card {
  position: relative;
  width: 100%;
  max-width: 420px;
  filter: drop-shadow(0 10px 26px rgba(0,0,0,.20));
}

.card__art {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* Prize text, placed over the blank panel in the artwork via the panel_*
   admin settings. Transparent — the artwork behind it is what shows. */
.prize {
  position: absolute;
  left:   var(--prize-x, 17%);
  top:    var(--prize-y, 63%);
  width:  var(--prize-w, 66%);
  height: var(--prize-h, 28%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  padding: 6px;
}

/* Keeps the text readable even if it lands on busy artwork. */
.prize__amount,
.prize__sub {
  text-shadow: 0 1px 2px rgba(255,255,255,.85), 0 0 10px rgba(255,255,255,.6);
}

/* Only room for the icon when the prize box is tall enough — see app.js. */
.prize__icon {
  display: none;
  font-size: clamp(28px, 10vw, 54px);
  line-height: 1;
  margin-bottom: 2px;
}
.prize.is-tall .prize__icon { display: block; }

.prize__amount {
  font-size: clamp(30px, 11vw, 54px);
  font-weight: 900;
  color: var(--green);
  line-height: 1.05;
  letter-spacing: -.5px;
}
.prize__sub {
  font-size: clamp(13px, 4.2vw, 19px);
  font-weight: 700;
  color: var(--navy);
}

/* The foil sits over the entire card, not just the prize panel. */
.card__scratch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  cursor: grab;
  touch-action: none;          /* let us handle the drag, not the browser */
  transition: opacity .45s ease;
}
.card__scratch:active { cursor: grabbing; }
.card__scratch.gone   { opacity: 0; pointer-events: none; }

/* ── misc ─────────────────────────────────────────────────────────── */

.disclaimer {
  margin: 0;
  padding: 0 16px 16px;
  font-size: 12.5px;
  color: #9b8b73;
  text-align: center;
  line-height: 1.6;
}

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
