/* JM Mobile Yangi yil aksiyasi: telefon sahifasi */
@font-face { font-family: 'Baloo 2'; font-weight: 600; font-display: swap; src: url('/fonts/baloo-2-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Baloo 2'; font-weight: 800; font-display: swap; src: url('/fonts/baloo-2-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 400; font-display: swap; src: url('/fonts/open-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 600; font-display: swap; src: url('/fonts/open-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 700; font-display: swap; src: url('/fonts/open-sans-latin-700-normal.woff2') format('woff2'); }

:root {
  --green: #58734e; --green-dark: #3f5538; --green-tint: #eef3eb; --line: #d5dfd0; --line-soft: #e6ece2;
  --navy: #16224f; --red: #d91a22; --red-dark: #a5121a; --red-tint: #fdf1f1;
  --text: #1b1b1f; --muted: #4a4f57; --label: #5a5f66;
  --display: 'Baloo 2', 'Open Sans', system-ui, sans-serif;
  --body: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; color: var(--text); font-family: var(--body); -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { min-height: 100vh; min-height: 100dvh; }
img { max-width: 100%; display: block; }
button, input { font-family: inherit; }
[hidden] { display: none !important; }

#snow, #confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#snow { z-index: 30; }
#confetti { z-index: 60; }
#mock-badge { position: fixed; left: 8px; bottom: 8px; z-index: 90; background: #111; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; }

.app { position: relative; width: 100%; max-width: 460px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; overflow-x: clip; }
.screen { display: none; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.screen.is-active { display: flex; }
.pad { padding-inline: 24px; }

/* Ekranga kirish: bolalar birin-ketin ko'tariladi */
.rise { opacity: 0; transform: translateY(18px); }
.is-active .rise { animation: rise .55s var(--spring) forwards; animation-delay: calc(var(--i, 0) * 90ms + 80ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Bosh sahifa ---------- */
.hero { position: relative; aspect-ratio: 390 / 273; flex-shrink: 0; }
.garland { position: absolute; top: 0; width: 27.8%; }
.garland-l { left: 0; transform-origin: 20% 0; animation: sway 5.5s ease-in-out infinite alternate; }
.garland-r { right: 0; transform-origin: 80% 0; animation: sway 6.2s ease-in-out infinite alternate-reverse; }
@keyframes sway { from { transform: rotate(-1.4deg); } to { transform: rotate(1.4deg); } }
.hero-logo { position: absolute; left: 50%; top: 10%; width: 28.8%; margin-left: -14.4%; opacity: 0; }
.is-active .hero-logo { animation: dropIn .9s var(--spring) .1s forwards, floaty 3.6s ease-in-out 1.1s infinite alternate; }
.hero-year { position: absolute; left: 50%; top: 53%; width: 43%; margin-left: -21.5%; opacity: 0; }
.is-active .hero-year { animation: popIn .7s var(--spring) .55s forwards, shine 2.8s ease-in-out 1.4s infinite; }
@keyframes dropIn { 0% { opacity: 0; transform: translateY(-120%) rotate(-8deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.2); } 100% { opacity: 1; transform: scale(1); } }
@keyframes floaty { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes shine { 0%, 100% { filter: brightness(1) saturate(1); } 50% { filter: brightness(1.13) saturate(1.15); } }

.lead { margin: 4px 0 0; font-size: 14px; line-height: 1.5; text-align: center; }
#imei-form { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
#imei-form label { font-size: 13px; font-weight: 700; color: var(--green-dark); }
#imei { height: 56px; width: 100%; border: 2px solid var(--green); border-radius: 14px; background: var(--green-tint); padding: 0 16px; font-size: 18px; letter-spacing: .04em; color: var(--text); text-align: center; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
#imei::placeholder { color: #5d6b58; font-size: 15px; letter-spacing: 0; }
#imei:focus { box-shadow: 0 0 0 4px rgba(88, 115, 78, .22); background: #fff; }
#imei.is-error { border-color: #b3141b; background: var(--red-tint); }
#imei-form.shake #imei { animation: shakeX .45s; }
@keyframes shakeX { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }

.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--red-tint); border: 1.5px solid #f1c4c6; animation: rise .4s var(--spring) both; }
.alert svg { flex-shrink: 0; margin-top: 1px; color: var(--red-dark); }
.alert strong { display: block; font-size: 15px; color: var(--red-dark); }
.alert span { display: block; margin-top: 3px; font-size: 14px; line-height: 1.45; }

.btn-row { display: flex; gap: 10px; margin-top: 6px; }
.btn { flex: 1; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: 14px; border: 2px solid var(--green); font-size: 16px; font-weight: 700; line-height: 1.2; cursor: pointer; text-decoration: none; transition: transform .12s ease, box-shadow .2s, background .2s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.96); }
.btn:focus-visible, .link:focus-visible, .box:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(88, 115, 78, .28); }
.btn-ghost { background: #fff; color: var(--green-dark); font-size: 15px; }
.btn svg { flex-shrink: 0; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn-primary .arrow { transition: transform .25s; }
.btn-primary:hover .arrow { transform: translateX(4px); }
.btn-block { flex: none; width: 100%; }
.link { min-height: 44px; display: flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--green-dark); font-size: 15px; font-weight: 700; text-decoration: underline; cursor: pointer; }

.promo { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; text-align: center; font-size: 15px; line-height: 1.55; }
.promo p { margin: 0; }
.promo h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.2; color: var(--navy); }
.promo .fine { font-size: 13px; line-height: 1.5; color: var(--muted); }
.strip { width: 100%; margin-top: auto; padding-top: 24px; }
.is-active .strip { animation: slideUp .9s var(--spring) .5s both; }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }

.mywin { margin: 12px 24px 0; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 0; background: #fff0f0; color: var(--red-dark); font-size: 14px; font-weight: 700; cursor: pointer; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 26, 34, .25); } 50% { box-shadow: 0 0 0 9px rgba(217, 26, 34, 0); } }

/* ---------- Yuklanish ---------- */
#loading { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(255, 255, 255, .92); animation: fadeIn .25s both; }
#loading img { width: 150px; animation: rattle .5s ease-in-out infinite; }
#loading p { margin: 0; font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--navy); }
#loading p::after { content: ''; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
@keyframes rattle { 0%, 100% { transform: rotate(-7deg) translateY(0); } 25% { transform: rotate(6deg) translateY(-6px); } 50% { transform: rotate(-5deg) translateY(0); } 75% { transform: rotate(7deg) translateY(-4px); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Kichik sarlavha (burchak bezaklari + logo) ---------- */
.mini-head { position: relative; height: 150px; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: center; }
.corner { position: absolute; top: 0; width: 136px; mix-blend-mode: multiply; }
.corner-l { left: 0; transform-origin: 0 0; animation: sway2 5s ease-in-out infinite alternate; }
.corner-r { right: 0; transform-origin: 100% 0; animation: sway2 5.8s ease-in-out infinite alternate-reverse; }
@keyframes sway2 { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
.mini-head .logo { position: relative; width: 112px; opacity: 0; }
.is-active .mini-head .logo { animation: dropIn .8s var(--spring) .05s forwards, floaty 3.6s ease-in-out 1s infinite alternate; }
.corner.small { width: 104px; }

/* ---------- Mijoz ma'lumotlari ---------- */
.body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 16px 24px 24px; }
.pill { align-self: center; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--green-tint); color: var(--green-dark); font-size: 14px; font-weight: 700; }
h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.15; color: var(--navy); text-align: center; }
.card { margin: 0; border: 1.5px solid var(--line); border-radius: 18px; padding: 4px 18px; display: flex; flex-direction: column; background: #fff; }
.card > div { padding: 11px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 2px; }
.card > div:last-child { border-bottom: 0; }
.card dt { font-size: 12px; font-weight: 600; color: var(--label); }
.card dd { margin: 0; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.card.compact { border-radius: 16px; padding: 2px 16px; }
.card.compact > div { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; padding: 6px 0; }
.card.compact dt { font-size: 13px; }
.card.compact dd { font-size: 15px; text-align: right; }
.note { margin: 0; font-size: 14px; line-height: 1.5; text-align: center; color: var(--muted); }
.push { margin-top: auto; }

/* ---------- Quti tanlash ---------- */
#s-boxes h1 { font-size: 32px; }
.boxes { position: relative; margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; justify-items: center; }
.box { position: relative; width: 164px; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 12px 10px; border: 2px solid #e2e8de; border-radius: 22px; background: #fff; color: var(--navy); font-family: var(--display); font-weight: 800; font-size: 18px; cursor: pointer; -webkit-tap-highlight-color: transparent; opacity: 0; transition: border-color .2s, box-shadow .2s, background .3s; }
.box:nth-child(1) { grid-column: 1 / -1; }
.box img { width: 136px; pointer-events: none; }
.is-active .box { animation: boxDrop .8s var(--spring) forwards; animation-delay: calc(var(--i) * 160ms + 150ms); }
.is-active .box img { animation: wobble 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * 420ms + 1s); }
@keyframes boxDrop { 0% { opacity: 0; transform: translateY(-90px) scale(.6) rotate(-12deg); } 100% { opacity: 1; transform: none; } }
@keyframes wobble { 0%, 100% { transform: rotate(0) translateY(0); } 20% { transform: rotate(-5deg) translateY(-3px); } 40% { transform: rotate(4deg) translateY(0); } 60% { transform: rotate(-2deg); } 80% { transform: rotate(1deg); } }
.box:hover { border-color: var(--green); box-shadow: 0 10px 24px rgba(22, 34, 79, .12); }
.box:active img { transform: scale(.94); }
.boxes.is-picking .box { pointer-events: none; }
.box.is-gone { animation: flyOff .6s cubic-bezier(.5, 0, .9, .4) forwards !important; }
.box.is-gone:nth-child(2) { --fx: -160%; --fr: -30deg; }
.box.is-gone:nth-child(3) { --fx: 160%; --fr: 30deg; }
.box.is-gone:nth-child(1) { --fx: 0%; --fy: -260%; --fr: 20deg; }
@keyframes flyOff { from { opacity: 1; transform: none; } to { opacity: 0; transform: translate(var(--fx, 0), var(--fy, 40%)) rotate(var(--fr, 0)) scale(.6); } }
.box.is-chosen { z-index: 5; opacity: 1; animation: none !important; border-color: var(--red); background: #fff4f4; box-shadow: 0 18px 36px rgba(217, 26, 34, .22); transform: translate(var(--dx, 0), var(--dy, 0)) scale(1.35); transition: transform .65s var(--spring), border-color .2s, background .3s, box-shadow .3s; }
.box.is-chosen::before { content: ''; position: absolute; inset: -30%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 196, 60, .55), rgba(255, 196, 60, 0)); animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { from { transform: scale(.8); opacity: .5; } to { transform: scale(1.15); opacity: 1; } }
.box.is-chosen img { animation: none !important; }
.box.is-shaking img { animation: suspense 1.6s ease-in forwards !important; }
@keyframes suspense {
  0% { transform: rotate(0); } 10% { transform: rotate(-4deg); } 20% { transform: rotate(4deg); } 30% { transform: rotate(-6deg); } 40% { transform: rotate(6deg); }
  50% { transform: rotate(-9deg) scale(1.03); } 60% { transform: rotate(9deg) scale(1.03); } 70% { transform: rotate(-12deg) scale(1.06); } 80% { transform: rotate(12deg) scale(1.06); }
  90% { transform: rotate(-14deg) scale(1.1); } 100% { transform: rotate(0) scale(1.18); }
}
.who { margin-top: auto; align-self: center; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--green-tint); color: var(--green-dark); font-size: 13px; font-weight: 700; text-align: center; }

#flash { position: fixed; inset: 0; z-index: 55; pointer-events: none; background: radial-gradient(circle at 50% 45%, #fff 0, #fff 30%, rgba(255, 255, 255, 0) 75%); opacity: 0; }
#flash.go { animation: flash .7s ease-out; }
@keyframes flash { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; transform: scale(1.6); } 100% { opacity: 0; transform: scale(2.2); } }

/* ---------- Natija ---------- */
.result { position: relative; padding: 50px 24px 16px; gap: 10px; align-items: stretch; }
.result .corner { z-index: 0; }
.win-title { font-size: 40px; line-height: 1.1; color: var(--red); display: flex; justify-content: center; }
.win-title span { display: inline-block; opacity: 0; }
.is-active .win-title span { animation: letter .6s var(--spring) forwards; animation-delay: calc(var(--n) * 55ms + 250ms); }
@keyframes letter { 0% { opacity: 0; transform: translateY(26px) scale(.4) rotate(-14deg); } 100% { opacity: 1; transform: none; } }
.art { align-self: center; width: min(68vw, 270px); display: flex; flex-direction: column; align-items: center; opacity: 0; }
.is-active .art { animation: prizePop .9s var(--spring) .15s forwards, floaty 3s ease-in-out 1.2s infinite alternate; }
@keyframes prizePop { 0% { opacity: 0; transform: scale(.25) rotate(-10deg); } 100% { opacity: 1; transform: none; } }
.art img { width: 100%; mix-blend-mode: multiply; }
.art-title { margin-top: -4px; font-family: var(--display); font-weight: 800; font-size: 38px; line-height: 1.2; letter-spacing: .02em; color: #ff2d3a; -webkit-text-stroke: 5px #2b3a8c; paint-order: stroke fill; text-align: center; }
.prize-pill { align-self: center; padding: 8px 18px; border-radius: 999px; background: #fff0f0; color: var(--red-dark); font-size: 15px; font-weight: 700; }
.claim { align-self: center; display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.claim b { font-family: var(--display); font-size: 24px; letter-spacing: .12em; color: var(--navy); }

.empty-title { font-size: 32px; padding: 0 14px; }
.empty-art { position: relative; align-self: center; width: 280px; display: flex; flex-direction: column; align-items: center; }
.empty-art .lid { width: 168px; opacity: 0; }
.is-active .empty-art .lid { animation: lidUp 1s var(--spring) .2s forwards, lidBob 3s ease-in-out 1.3s infinite alternate; }
@keyframes lidUp { 0% { opacity: 0; transform: translateY(120px) rotate(0); } 100% { opacity: 1; transform: translateY(0) rotate(-8deg); } }
@keyframes lidBob { from { transform: translateY(0) rotate(-8deg); } to { transform: translateY(-9px) rotate(-5deg); } }
.empty-art svg { width: 280px; height: auto; margin-top: 6px; }
.puff { position: absolute; left: 50%; top: 58%; width: 46px; height: 46px; margin-left: -23px; border-radius: 50%; background: #e3e7ec; filter: blur(6px); opacity: 0; }
.is-active .puff { animation: puff 1.8s ease-out forwards; animation-delay: calc(var(--i) * 140ms + 350ms); }
@keyframes puff { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 25% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--px, 0), -150px) scale(2.4); } }

@media (max-width: 359px) {
  .pad, .body { padding-inline: 16px; }
  .box { width: 140px; } .box img { width: 112px; }
  .win-title { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
