:root {
  --bg: #eaf4fb; --card: #ffffff; --ink: #17212b; --muted: #5b6876; --line: #dbe4ec;
  --green: #1f9d55; --green2: #17803f; --red: #e0362c; --red2: #b8231b; --blue: #1d5fb8; --blue2: #154a8f; --gold: #f4b400;
  --shadow: 0 8px 28px rgba(20, 40, 60, .18);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: "Hind Siliguri", system-ui, Arial, sans-serif; overflow: hidden; }
button { font-family: inherit; cursor: pointer; }
.screen { position: fixed; inset: 0; display: none; }
.screen.on { display: block; }

/* HOME */
#home { overflow-y: auto; padding: 12px 16px 28px; max-width: 560px; margin: 0 auto; }
.h-top { display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 22px; font-weight: 700; }
.brand b { background: var(--green); color: #fff; padding: 0 8px; border-radius: 8px; margin-right: 4px; }
.ibtn { border: 1px solid var(--line); background: #fff; border-radius: 12px; width: 42px; height: 42px; font-size: 18px; }
.ibtn.sm { width: 32px; height: 32px; font-size: 14px; border-radius: 10px; }
.pitch { font-size: 15px; color: var(--muted); line-height: 1.45; margin: 8px 0; }
.strip { display: flex; justify-content: space-between; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; font-size: 13px; color: var(--muted); }
.mods { display: grid; gap: 10px; margin-top: 12px; }
.mod { display: flex; gap: 12px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px 12px; text-align: left; width: 100%; color: var(--ink); }
.mod .no { flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--green); color: #fff; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; font-size: 22px; }
.mod .no small { font-size: 10px; font-weight: 600; }
.mod .tx { flex: 1; min-width: 0; }
.mod .tx b { display: block; font-size: 16px; line-height: 1.25; }
.mod .tx span { font-size: 13px; color: var(--muted); }
.mod .st { color: var(--gold); letter-spacing: 1px; font-size: 18px; }
.mod.open { border-color: var(--green); box-shadow: 0 6px 18px rgba(31,157,85,.18); }
.mod.open .play { background: var(--green); color: #fff; border-radius: 12px; padding: 8px 12px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.mod.lock { opacity: .62; }
.mod.lock .no { background: #9aa6b1; }
.mod .soon { font-size: 12px; background: #eef2f6; border-radius: 8px; padding: 2px 8px; color: var(--muted); white-space: nowrap; }
.hero { position: relative; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, #cfe6fa, #f4f9fd); padding: 14px; margin: 6px 0 0; }
.hero h1 { margin: 0; font-size: 21px; }
.hero p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

/* GAME */
#view { position: absolute; inset: 0; }
#view canvas { display: block; touch-action: none; }
.hud-top { position: absolute; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top) + 8px) 8px 0; pointer-events: none; z-index: 2; }
.hud-top .row { display: flex; align-items: center; gap: 5px; }
.hud-top button { pointer-events: auto; }
.pill { background: rgba(255,255,255,.94); border-radius: 10px; padding: 2px 8px; font-size: 13px; box-shadow: 0 2px 6px rgba(0,0,0,.12); white-space: nowrap; }
.pill small { color: var(--muted); font-size: 10px; }
.pill.bump { animation: bump .5s; }
.hearts { color: var(--red); font-size: 16px; background: rgba(255,255,255,.94); border-radius: 10px; padding: 0 6px; margin-left: auto; letter-spacing: 1px; }
.prog { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; font-weight: 600; color: #22313f; }
.prog .bar { flex: 1; height: 7px; background: rgba(255,255,255,.75); border-radius: 6px; overflow: hidden; }
.prog .bar i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 6px; transition: width .3s; }
.prog span { background: rgba(255,255,255,.85); border-radius: 8px; padding: 0 6px; }
.tips { position: absolute; left: 8px; right: 8px; top: calc(env(safe-area-inset-top) + 72px); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; z-index: 2; }
.tip { background: #fff; border-left: 6px solid var(--red); border-radius: 12px; padding: 5px 12px; font-size: 16px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.2); max-width: 92%; animation: tipin .45s cubic-bezier(.2,1.4,.4,1); transform-origin: left center; }
.tip.g { border-color: var(--green); } .tip.b { border-color: var(--blue); } .tip.y { border-color: var(--gold); }
.tip.out { animation: tipout .35s forwards; }
.ask { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 74px); transform: translateX(-50%); width: min(92%, 480px); background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow); display: none; z-index: 3; text-align: center; border-top: 6px solid var(--blue); }
.ask.on { display: block; animation: pop .3s; }
.ask h3 { margin: 0; font-size: 20px; }
.ask p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.ask.shake { animation: shake .4s; }
.wait { position: absolute; left: 50%; top: 56%; transform: translate(-50%,-50%); background: #fff7d6; border: 2px solid var(--gold); border-radius: 14px; padding: 8px 14px; font-weight: 700; display: none; text-align: center; max-width: 86%; z-index: 2; }
.wait.on { display: block; animation: pop .3s; }
.labels { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.lab { position: absolute; transform: translate(-50%, -100%); background: #fff; border-radius: 12px; padding: 4px 10px; box-shadow: 0 4px 14px rgba(0,0,0,.25); font-size: 14px; text-align: center; white-space: nowrap; animation: labin .45s cubic-bezier(.2,1.5,.4,1); }
.lab b { font-family: Arial, sans-serif; font-size: 17px; display: block; }
.lab.ok { border: 3px solid var(--green); } .lab.no { border: 3px solid var(--red); }
.lab::after { content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 8px solid transparent; border-bottom: 0; border-top-color: #fff; }
.ring { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 4px solid var(--gold); animation: ring 1s infinite; }
.coinfly { position: absolute; font-size: 22px; font-weight: 700; color: #b98900; animation: coinfly 1.1s forwards; pointer-events: none; z-index: 6; }
.hud-bot { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 10px calc(env(safe-area-inset-bottom) + 12px); display: flex; align-items: flex-end; gap: 8px; pointer-events: none; z-index: 2; }
.wheel { width: 66px; height: 66px; background: rgba(255,255,255,.85); border-radius: 50%; transition: transform .15s; }
.speedo { display: flex; align-items: center; gap: 6px; flex: 1; justify-content: center; }
.roundel { width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 6px solid var(--red); display: flex; align-items: center; justify-content: center; font: 700 16px Arial; color: #111; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.kmh { background: #fff; border-radius: 12px; padding: 2px 12px; min-width: 84px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.kmh b { display: block; font: 700 30px Arial; line-height: 1.1; }
.kmh small { font-size: 11px; color: var(--muted); }
.auto { background: rgba(255,255,255,.85); border-radius: 10px; padding: 3px 8px; font-size: 12px; color: var(--muted); align-self: center; }
.flash { position: absolute; inset: 0; pointer-events: none; display: none; z-index: 1; }
.flash.on { display: block; animation: police .45s infinite; }
.caption { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); background: rgba(255,255,255,.96); border-radius: 12px; padding: 8px 14px; font-size: 17px; font-weight: 700; display: none; text-align: center; max-width: 90%; box-shadow: var(--shadow); z-index: 3; }
.caption.on { display: block; animation: pop .3s; }
.loading { position: fixed; inset: 0; background: rgba(234,244,251,.92); display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 20; font-weight: 700; }
.loading.on { display: flex; }
.spin { width: 46px; height: 46px; border: 5px solid #cfe0ee; border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; }

/* cards */
.ov { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 10px; background: rgba(220,234,245,.32); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 5; }
.ov.on { display: flex; }
.ov.low { align-items: flex-end; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; padding-bottom: 96px; }
.ov.peek { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.ov.peek .card { opacity: 0; }
.card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); width: 100%; max-width: 520px; max-height: 100%; overflow-y: auto; padding: 14px; animation: cardin .35s cubic-bezier(.2,1.3,.4,1); }
.badge { display: inline-block; background: var(--green); color: #fff; border-radius: 8px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
.badge.b { background: var(--blue); } .badge.y { background: var(--gold); color: #3a2a00; } .badge.r { background: var(--red); }
.qhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.timer { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 22px Arial; color: #fff; background: conic-gradient(var(--blue) var(--p, 100%), #cfd8e1 0); position: relative; flex: none; }
.timer::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--blue); }
.timer span { position: relative; }
.timer.low::before { background: var(--red); }
.qimg { position: relative; margin: 10px 0 8px; }
.qimg img { width: 100%; border-radius: 12px; display: block; aspect-ratio: 16/9; object-fit: cover; background: #dde5ec; }
.peekbtn { position: absolute; right: 8px; bottom: 8px; border: 0; border-radius: 10px; background: rgba(255,255,255,.94); padding: 4px 10px; font-size: 13px; font-weight: 700; touch-action: none; }
.qen { font-size: 18px; font-weight: 700; line-height: 1.3; margin: 4px 0; font-family: Arial, sans-serif; }
.qen mark { background: #fff1a8; border-radius: 4px; padding: 0 2px; }
.qen mark.trap { background: #ffd6d2; }
.qbn { font-size: 15px; color: var(--muted); margin: 0 0 10px; }
.ans { display: grid; gap: 8px; }
.ans.yn { grid-template-columns: 1fr 1fr; }
.abtn { border: 0; border-radius: 14px; padding: 13px 10px; font-size: 17px; font-weight: 700; color: #fff; background: var(--blue); box-shadow: 0 4px 0 var(--blue2); text-align: left; font-family: Arial, "Hind Siliguri", sans-serif; }
.ans.yn .abtn { text-align: center; font-size: 22px; }
.ans.yn .abtn.yes { background: var(--green); box-shadow: 0 4px 0 var(--green2); }
.ans.yn .abtn.no { background: var(--red); box-shadow: 0 4px 0 var(--red2); }
.abtn small { display: block; font-size: 13px; font-weight: 600; opacity: .92; font-family: "Hind Siliguri", sans-serif; }
.abtn.dim { opacity: .35; }
.abtn.right { outline: 4px solid #ffd54a; }
.fb { border-radius: 14px; padding: 10px 12px; margin-top: 10px; font-size: 16px; line-height: 1.45; }
.fb.good { background: #e6f6ec; border: 2px solid var(--green); }
.fb.bad { background: #fff3f2; border: 2px solid var(--red); }
.fb h3 { margin: 0 0 4px; font-size: 20px; }
.okbtn { width: 100%; margin-top: 12px; border: 0; border-radius: 14px; background: var(--blue); color: #fff; font-size: 20px; font-weight: 700; padding: 12px; box-shadow: 0 4px 0 var(--blue2); }
.card h3 { margin: 6px 0; font-size: 21px; }
.card .sub { color: var(--muted); margin: 0 0 8px; font-size: 15px; }
.bigsign { display: block; width: 120px; height: 120px; margin: 6px auto; animation: wob 1.6s ease-in-out infinite; }
.opts { display: grid; gap: 8px; }
.opt { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 12px; font-size: 18px; font-weight: 700; text-align: center; color: var(--ink); }
.opt.ok { border-color: var(--green); background: #e6f6ec; animation: bump .4s; }
.opt.no { border-color: var(--red); background: #fff3f2; animation: shake .4s; }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.picks button { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 8px; }
.picks img { width: 100%; aspect-ratio: 1; display: block; }
.picks button.ok { border-color: var(--green); background: #e6f6ec; } .picks button.no { border-color: var(--red); background: #fff3f2; animation: shake .4s; }
.words { display: flex; flex-wrap: wrap; gap: 6px; font: 700 18px Arial, sans-serif; line-height: 1.2; margin: 8px 0; }
.words button { border: 0; background: #eef3f8; border-radius: 8px; padding: 6px 7px; font: inherit; color: var(--ink); }
.words button.hit { background: #fff1a8; outline: 3px solid var(--gold); animation: bump .4s; }
.words button.trap { background: #ffd6d2; outline: 3px solid var(--red); }
.words button.no { animation: shake .4s; }
.keybox { display: none; text-align: center; background: #fffbe6; border: 2px dashed var(--gold); border-radius: 14px; padding: 8px; margin-top: 8px; }
.keybox.on { display: block; animation: pop .35s; }
.keybox b { font-size: 26px; display: block; }
.keybox small { font-size: 14px; color: var(--muted); }
.ladder { display: grid; gap: 8px; }
.ladder button { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 10px; font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.ladder button .n { width: 32px; height: 32px; border-radius: 50%; background: #eef2f6; display: inline-flex; align-items: center; justify-content: center; }
.ladder button.ok { border-color: var(--green); background: #e6f6ec; } .ladder button.ok .n { background: var(--green); color: #fff; }
.ladder button.no { animation: shake .4s; border-color: var(--red); }
.ticket { border-top: 10px solid var(--blue); }
.ticket .ph { display: flex; align-items: center; gap: 10px; }
.ticket .ph .ic { font-size: 40px; }
.ticket h2 { margin: 0; font-size: 26px; color: var(--red2); }
.ticket .why { background: #fff3f2; border-radius: 12px; padding: 10px; margin: 10px 0; font-size: 16px; line-height: 1.45; }
.ticket .nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: center; }
.ticket .nums div { background: #f2f5f8; border-radius: 12px; padding: 6px; }
.ticket .nums b { display: block; font-size: 24px; color: var(--red2); }
.end { text-align: center; }
.end h2 { margin: 4px 0; font-size: 24px; }
.end .stars { font-size: 50px; color: var(--gold); letter-spacing: 4px; }
.end .stars i { font-style: normal; display: inline-block; animation: starin .5s both; }
.end .stars i.off { color: #d5dde4; }
.end .grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 10px 0; }
.end .grid div { background: #f2f5f8; border-radius: 12px; padding: 8px; font-size: 13px; }
.end .grid b { display: block; font-size: 20px; }
.end .btns { display: grid; gap: 8px; }
.end .btns a, .end .btns button { border: 0; border-radius: 14px; padding: 12px; font-size: 18px; font-weight: 700; color: #fff; background: var(--blue); text-decoration: none; display: block; }
.end .btns .g { background: var(--green); }
.end .btns .w { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.cabin svg { width: 100%; height: auto; display: block; background: #eef4f8; border-radius: 14px; touch-action: none; }
.cabin .tgt { cursor: pointer; }
.cabin .hint { animation: pulse 1s infinite; transform-box: fill-box; transform-origin: center; }
.steps { display: flex; gap: 6px; margin: 6px 0 8px; }
.steps span { flex: 1; text-align: center; font-size: 13px; padding: 4px; border-radius: 8px; background: #eef2f6; color: var(--muted); font-weight: 600; }
.steps span.cur { background: #e9f2ff; color: var(--blue); }
.steps span.ok { background: #e6f6ec; color: var(--green2); }
.lsw { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.lsw button { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 6px; font-size: 16px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lsw button .i { font-size: 26px; }
.lsw button.bad { border-color: var(--red); background: #fff3f2; }
.lsw button.good { border-color: var(--green); background: #e6f6ec; }

@keyframes pop { from { transform: translateX(-50%) scale(.9); opacity: 0; } }
.ov .card, .caption { --x: 0; }
@keyframes cardin { from { transform: translateY(30px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tipin { from { transform: translateX(-40px) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tipout { to { transform: translateX(-30px); opacity: 0; } }
@keyframes labin { from { transform: translate(-50%, -60%) scale(.4); opacity: 0; } to { transform: translate(-50%, -100%); opacity: 1; } }
@keyframes bump { 40% { transform: scale(1.12); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes ring { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@keyframes coinfly { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 20% { transform: translate(0, -20px) scale(1.2); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(.6); opacity: 0; } }
@keyframes wob { 50% { transform: rotate(-4deg) scale(1.04); } }
@keyframes starin { from { transform: scale(0) rotate(-90deg); } }
@keyframes pulse { 50% { transform: scale(1.08); opacity: .75; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes police { 0% { box-shadow: inset 0 0 0 10px rgba(30,90,255,.75); } 50% { box-shadow: inset 0 0 0 10px rgba(255,40,40,.75); } 100% { box-shadow: inset 0 0 0 10px rgba(30,90,255,.75); } }
.caption.on, .ask.on { animation: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .card { max-height: 96%; padding: 10px; }
  .qimg img { max-height: 34vh; }
}

/* email gate */
.gl { display: block; font-size: 15px; font-weight: 600; margin-top: 8px; }
.gl small { color: var(--muted); font-weight: 400; }
.gl input { display: block; width: 100%; margin-top: 2px; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; font: 400 17px Arial, "Hind Siliguri", sans-serif; background: #fff; color: var(--ink); }
.gl input:focus, .gcode:focus { outline: none; border-color: var(--blue); }
.gc { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.35; padding: 8px 0 2px; }
.gc input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--green); }
.gp { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.gerr { color: var(--red2); font-weight: 700; font-size: 15px; margin: 6px 0 0; min-height: 22px; }
.gcode { width: 100%; text-align: center; border: 2px solid var(--line); border-radius: 14px; padding: 10px; font: 700 32px Arial; letter-spacing: 10px; color: var(--ink); background: #fff; }
.gmail { word-break: break-all; }
.ghint, .glinks button { border: 0; background: none; color: var(--blue); font-size: 15px; font-weight: 600; padding: 8px 0; text-decoration: underline; }
.ghint { display: block; } .ghint[hidden] { display: none; }
.glinks { text-align: center; }
.ghp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.okbtn:disabled { opacity: .55; }
