:root {
  --ink: #1c1c1e;
  --red: #e40000;
  --pixel-red: #d53610;
  --green: #1a8a3c;
  --muted: #74777d;
  --pixel: 'Press Start 2P', monospace;
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #f6f7f9; overflow: hidden; }
body { font-family: var(--ui); color: var(--ink); -webkit-font-smoothing: antialiased; }
button { font: inherit; border: 0; background: none; padding: 0; color: inherit; cursor: pointer; }
img { -webkit-user-drag: none; user-select: none; }

/* ---------- shell: full-screen on phones, framed on desktop ---------- */
#stage { height: 100%; }
#app { position: fixed; inset: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: none; background: #fff; }
#page { width: 375px; position: relative; background: #fff; }
#panel, #phone::before { display: none; }

body.framed { background: #ececef; }
body.framed #stage { display: flex; align-items: center; justify-content: center; gap: 56px; padding: 24px; }
body.framed #phone { position: relative; width: 399px; height: 836px; border-radius: 62px; background: #111214; padding: 12px; box-shadow: 0 30px 80px rgba(20, 20, 40, .22), inset 0 0 0 2px #2b2c30; flex: none; }
body.framed #phone::before { display: block; content: ''; position: absolute; z-index: 20; top: 23px; left: 50%; width: 120px; height: 34px; margin-left: -60px; border-radius: 20px; background: #000; }
body.framed #app { position: absolute; inset: 12px; border-radius: 50px; scrollbar-width: none; }
body.framed #app::-webkit-scrollbar { display: none; }
body.framed #panel { display: block; width: 300px; flex: none; }
body:not(.framed) .statusbar { display: none; }
body:not(.framed) #page { margin-top: -26px; }  /* no fake status bar on a real phone */

#panel .eyebrow { font: 600 12px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin: 0 0 10px; }
#panel h1 { font: 700 30px/1.1 var(--ui); margin: 0 0 12px; letter-spacing: -.02em; }
#panel .lede { font: 400 15px/1.5 var(--ui); color: #4a4d55; margin: 0 0 22px; }
.qr-card { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05); margin-bottom: 22px; }
.qr-card p { margin: 0; font: 400 13px/1.45 var(--ui); color: #4a4d55; }
.qr-card b { color: var(--ink); font-weight: 600; }
#qr { flex: none; width: 104px; height: 104px; }
#qr img, #qr svg { width: 104px; height: 104px; image-rendering: pixelated; display: block; }

.controls { display: grid; gap: 10px; }
.controls h3 { font: 600 12px/1 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 2px; }
.ctl-profile { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1.5px solid #e3e5ea; font: 500 13px/1.3 var(--ui); }
.ctl-profile.on { border-color: var(--red); box-shadow: 0 0 0 3px rgba(228, 0, 0, .08); }
.ctl-profile .logos { display: flex; flex: none; }
.ctl-profile .logos img { width: 24px; height: 24px; margin-right: -6px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.ctl-profile span { margin-left: 8px; }
.ctl-row { display: flex; gap: 10px; }
.ctl-btn { flex: 1; padding: 11px 12px; border-radius: 12px; background: var(--ink); color: #fff; font: 600 13px/1 var(--ui); }
.ctl-btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid #e3e5ea; }

#presenter { position: fixed; inset: 0; z-index: 50; background: rgba(10, 10, 20, .35); display: flex; align-items: flex-end; }
#presenter[hidden] { display: none; }
.pr-sheet { width: 100%; background: #f6f7f9; border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
.pr-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 15px; }
.pr-close { width: 32px; height: 32px; border-radius: 16px; background: #e8e9ee; font-size: 14px; }

/* ---------- game section ---------- */
#game {
  position: relative; height: 540px; overflow: hidden; cursor: pointer;
  background: linear-gradient(180deg, #cfe3ff 0%, #ffdfdf 55%, #ffcaca 100%);
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.layer { position: absolute; left: 0; top: 0; width: 375px; height: 100%; pointer-events: none; }
#clouds .cloud { position: absolute; background: url(../assets/img/cloud.png) center / 100% 100% no-repeat; animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { from { translate: -6px 0; } to { translate: 8px 0; } }

#title .airtel { position: absolute; left: 147px; top: 98px; width: 81px; height: 36px; }
#title .rewards-title { position: absolute; left: 73px; top: 150px; width: 229px; height: 32px; }
#title .rewards-title img { width: 100%; height: 100%; display: block; }
#title .shine {
  position: absolute; inset: 0;
  -webkit-mask: url(../assets/img/rewards_title.png) center / 100% 100% no-repeat; mask: url(../assets/img/rewards_title.png) center / 100% 100% no-repeat;
  background: linear-gradient(104deg, transparent 42%, rgba(255, 250, 224, .25) 46%, rgba(255, 255, 255, .8) 50%, rgba(255, 250, 224, .25) 54%, transparent 58%) 0 0 / 320% 100% no-repeat;
  animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 0%, 35% { background-position: 110% 0; } 75%, 100% { background-position: -10% 0; } }
#title .ready { position: absolute; left: 0; top: 194px; width: 375px; margin: 0; text-align: center; font: 10px/12px var(--pixel); letter-spacing: 2.5px; text-transform: uppercase; color: var(--pixel-red); padding-left: 2.5px; }

#ground { position: absolute; left: 0; right: 0; bottom: 0; height: 76px; background: url(../assets/img/ground_tile.png) 0 0 / 477px 63px repeat-x, linear-gradient(#933e25, #933e25) 0 62px / 100% 14px no-repeat; }
#world { position: absolute; left: 0; bottom: 65px; width: 0; height: 0; }
#world > * { position: absolute; }
#world img { display: block; width: 100%; height: 100%; }
.deco { z-index: 1; }
.orb { z-index: 2; }
.block, .pipe, .mush, .plat { z-index: 3; }
.pole, .flag, .finial, .pole-base { z-index: 2; }
.coin { z-index: 4; }
.hero { left: 0; bottom: -4px; width: 92px; height: 90px; z-index: 5; }
.hero-svg { display: block; overflow: visible; }
.pill { z-index: 6; }

.block img { transform-origin: 50% 100%; }
.block .glint { position: absolute; inset: 3px; border-radius: 4px; overflow: hidden; pointer-events: none; }
.block .glint::after { content: ''; position: absolute; top: -20%; bottom: -20%; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent); animation: glint 2.6s ease-in-out infinite; }
@keyframes glint { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
.block.used img { filter: saturate(.25) brightness(.78) sepia(.35); }
.block.used .glint { display: none; }
.mush img, .pipe img { transform-origin: 50% 100%; }

.coin { animation: coinspin 1.1s ease-in-out infinite; }
.coin:nth-child(2n) { animation-delay: -.35s; }
.coin:nth-child(3n) { animation-delay: -.7s; }
@keyframes coinspin { 0%, 100% { scale: 1 1; } 50% { scale: .25 1; } }

/* mystery orb: the "?" bubble used for rewards in the world and in the tray */
.bubble { position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff 0 14%, rgba(255, 255, 255, .92) 28%, rgba(255, 244, 236, .78) 62%, rgba(255, 196, 196, .7) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .95), inset 0 -4px 8px rgba(255, 120, 120, .28), 0 5px 12px rgba(213, 54, 16, .22);
  display: grid; place-items: center; overflow: hidden; }
.bubble .q { font: 16px/1 var(--pixel); color: var(--pixel-red); text-shadow: 0 2px 0 #ffd24a; translate: 1px 1px; }
.bubble::after { content: ''; position: absolute; top: -30%; bottom: -30%; width: 35%; left: -70%; transform: rotate(20deg); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent); animation: glint 3s ease-in-out infinite; }
.orb .bob { position: absolute; inset: 0; animation: bob 1.6s ease-in-out infinite; }
.orb .halo { position: absolute; inset: -14px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 236, 160, .7), rgba(255, 236, 160, 0) 70%); animation: halo 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes halo { 0%, 100% { opacity: .55; scale: .9; } 50% { opacity: 1; scale: 1.08; } }

#tray .slot { position: absolute; left: 0; top: 0; width: 48px; height: 48px; margin: -24px 0 0 -24px; pointer-events: none; }
#tray .slot .in { position: absolute; inset: 0; animation: bob 2.2s ease-in-out infinite; }
#tray .slot:nth-child(2) .in { animation-delay: -.7s; }
#tray .slot:nth-child(3) .in { animation-delay: -1.4s; }
#tray .slot .logo { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; opacity: 0; box-shadow: 0 6px 14px rgba(40, 10, 10, .18); }
#tray .slot.filled .logo { opacity: 1; }
#tray .slot.filled .bubble { opacity: 0; }
#game.playing #tray .slot .in { animation-duration: 3s; }
#game.finale #tray .slot .in { animation: none; }

.pill { width: 122px; height: 23px; display: grid; place-items: center; transform-origin: 50% 100%; }
.pill .pill-bg { position: absolute; left: 3px; top: 1px; right: 3px; bottom: 1px; background: #fff; border-radius: 13px; }
.pill img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pill span { position: relative; font: 8.85px/1 var(--pixel); letter-spacing: -.58px; color: var(--ink); text-transform: uppercase; white-space: nowrap; padding-top: 1px; }
.pill .pulse { position: absolute; inset: 0; display: grid; place-items: center; animation: pillpulse 1.2s ease-in-out infinite; }
@keyframes pillpulse { 0%, 100% { scale: 1; } 50% { scale: 1.07; } }
.pill.button { pointer-events: auto; cursor: pointer; }

.pole { background: linear-gradient(90deg, #c9ccd3, #ffffff 45%, #b9bcc4); border-radius: 3px; }
.pole-base { background: #6a4630; border-radius: 3px 3px 0 0; box-shadow: inset 0 3px 0 #8a5d3f; }
.flag .cloth { transform-origin: 0 50%; animation: wave 1.1s ease-in-out infinite; }
.flag .cloth { position: absolute; inset: 0; background: var(--red); clip-path: polygon(0 0, 100% 8%, 88% 50%, 100% 92%, 0 100%); display: grid; place-items: center; padding-right: 8px; }
.flag .cloth img { width: 38px; height: auto; filter: brightness(0) invert(1); }
@keyframes wave { 0%, 100% { transform: skewY(0deg) scaleX(1); } 50% { transform: skewY(-4deg) scaleX(.94); } }

/* HUD */
.statusbar { position: absolute; left: 0; top: 0; width: 375px; height: 44px; }
.statusbar span { position: absolute; left: 27px; top: 13px; font: 600 15px/20px var(--ui); }
.statusbar img { position: absolute; left: 284px; top: 17px; width: 68px; height: 12px; }
#hud button, #hud .coins { pointer-events: auto; }
.back { position: absolute; left: 15px; top: 57px; width: 24px; height: 24px; }
.back img { width: 24px; height: 24px; display: block; }
.sound { position: absolute; left: 46px; top: 56px; width: 26px; height: 26px; display: grid; place-items: center; opacity: .8; }
.sound .x { display: none; }
.sound.off .w1, .sound.off .w2 { display: none; }
.sound.off .x { display: inline; }
.coins { position: absolute; left: 286px; top: 50px; width: 78px; height: 40px; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: #fff; border: 1px solid #e6e9ef; border-radius: 100px; cursor: default; -webkit-touch-callout: none; }
.coins img { width: 25px; height: 25px; }
.coins span { font: 600 14px/16px var(--ui); color: #292c31; font-feature-settings: 'liga' 0; font-variant-numeric: tabular-nums; }

/* FX */
#fx > *, #finale > .fx-sq, #finale > .confetti { position: absolute; left: 0; top: 0; }
.fx-sq { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; }
.fx-ring { width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; border: 3px solid #fff; }
.fx-star { width: 16px; height: 15px; margin: -8px 0 0 -8px; background: url(../assets/img/star.png) center / contain no-repeat; }
.fx-dust { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 2px; background: #fff4e6; }
.fx-plus { font: 9px/1 var(--pixel); color: #fff; text-shadow: 0 2px 0 rgba(150, 60, 20, .55); margin: -5px 0 0 -10px; }
.fx-coin { width: 22px; height: 22px; margin: -11px 0 0 -11px; background: url(../assets/img/coin.png) center / contain no-repeat; }

.reveal { width: 48px; height: 48px; margin: -24px 0 0 -24px; z-index: 3; }
.reveal .rays { position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 238, 150, .85) 0 10deg, rgba(255, 238, 150, 0) 10deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); mask: radial-gradient(circle, #000 18%, transparent 68%); animation: spin 5s linear infinite; }
.reveal .glow { position: absolute; inset: -18px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 240, 200, 0) 70%); }
.reveal img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 6px 16px rgba(60, 10, 10, .25); }
.reveal .label { position: absolute; left: 50%; top: 56px; translate: -50% 0; white-space: nowrap; background: var(--ink); color: #fff; font: 7px/1 var(--pixel); letter-spacing: .5px; padding: 5px 7px 4px; border-radius: 4px; box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
@keyframes spin { to { rotate: 360deg; } }

#flash { background: #fff; opacity: 0; z-index: 9; }

/* finale */
#finale { z-index: 8; }
#finale .veil { position: absolute; inset: 0; z-index: 0; background: rgba(40, 12, 24, .42); opacity: 0; }
.finale-card { position: absolute; z-index: 2; left: 37.5px; width: 300px; height: 268px; pointer-events: auto; cursor: default; }
.finale-card .card-bg { position: absolute; inset: 0; background: #fff; border-radius: 18px; box-shadow: 0 0 0 3px var(--ink), 0 7px 0 3px var(--ink), 0 24px 50px rgba(30, 0, 10, .35); }
.finale-card .ttl { position: absolute; left: 0; right: 0; top: 22px; display: flex; justify-content: center; align-items: center; gap: 8px; font: 12px/1 var(--pixel); color: var(--pixel-red); letter-spacing: -.3px; }
.finale-card .ttl i { width: 15px; height: 14px; background: url(../assets/img/star.png) center / contain no-repeat; }
.finale-card .sub { position: absolute; left: 0; right: 0; top: 44px; text-align: center; font: 500 13px/1.3 var(--ui); color: #5d6068; }
.finale-card .names { position: absolute; left: 0; top: 146px; width: 300px; }
.finale-card .nm { position: absolute; width: 96px; margin-left: -48px; text-align: center; }
.finale-card .nm b { display: block; font: 600 12.5px/1.25 var(--ui); color: var(--ink); }
.finale-card .nm small { display: block; font: 500 11.5px/1.3 var(--ui); color: var(--muted); margin-top: 2px; }
.finale-card .cta { position: absolute; left: 20px; right: 20px; top: 202px; height: 46px; border-radius: 23px; background: var(--red); color: #fff; font: 600 15px/1 var(--ui); box-shadow: 0 4px 0 #a80000; display: grid; place-items: center; }
.finale-card .cta:active { translate: 0 2px; box-shadow: 0 2px 0 #a80000; }
.confetti { width: 6px; height: 10px; margin: -5px 0 0 -3px; border-radius: 1px; }

/* ---------- page below the game ---------- */
#sheet { position: relative; z-index: 2; margin-top: -28px; padding-top: 28px; background: #fff; border-radius: 28px 28px 0 0; box-shadow: 0 -6px 12px rgba(0, 0, 0, .07); }
#sheet .grabber { position: absolute; left: 169.5px; top: 12px; width: 36px; height: 5px; border-radius: 3px; background: #d1d1d6; }
.page-img { display: block; width: 375px; height: auto; }
#rewardsList { padding: 0 20px 22px; }
.rw { position: relative; display: flex; align-items: center; height: 73px; gap: 12px; overflow: hidden; }
.rw + .rw::before { content: ''; position: absolute; left: 52px; right: 0; top: 0; height: 1px; background: #ececef; }
.rw .ic { flex: none; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; position: relative; }
.rw .ic img { width: 100%; height: 100%; display: block; }
.rw .ic.round { border-radius: 50%; }
.rw .tx { flex: 1; min-width: 0; }
.rw .tx b { display: block; font: 500 16px/20px var(--ui); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw .tx small { display: block; font: 500 14px/18px var(--ui); color: var(--muted); margin-top: 2px; }
.rw .st { flex: none; text-align: right; }
.rw .st b { display: block; font: 600 16px/20px var(--ui); color: var(--green); }
.rw .st b.dark { color: var(--ink); }
.rw .st small { display: block; font: 500 13px/18px var(--ui); color: var(--muted); margin-top: 2px; }
.rw .new { display: inline-block; vertical-align: 2px; margin-left: 6px; font: 7px/1 var(--pixel); color: #fff; background: var(--red); padding: 4px 4px 3px; border-radius: 3px; }
.rw .hl { position: absolute; inset: 0 -20px; background: linear-gradient(90deg, rgba(255, 215, 120, 0), rgba(255, 215, 120, .35), rgba(255, 215, 120, 0)); opacity: 0; pointer-events: none; }
.rw.teaser { cursor: pointer; }
.rw.teaser .ic { background: #fff3d8; display: grid; place-items: center; }
.rw.teaser .ic img { width: 30px; height: 26px; }
.rw.teaser .st b { color: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .coin, .orb .bob, #tray .slot .in, .pill .pulse, .flag .cloth, #clouds .cloud { animation: none; }
}
