/* النقّيفة — mud-brick wall look: warm clay tones, a wooden slingshot at the bottom, everything else drawn on canvas */
:root { --ink: #fff; --muted: #f0dcc0; --card: rgba(38, 23, 12, .88); --line: rgba(255, 255, 255, .14); --gold: #ffb703; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #1a1008; }
body { min-height: 100vh; color: var(--ink); font-family: "Baloo Bhaijaan 2", system-ui, sans-serif; overflow-x: hidden;
  background: radial-gradient(circle at 20% 8%, #ffb70333, transparent 42%), radial-gradient(circle at 85% 90%, #e5383b2e, transparent 45%), linear-gradient(165deg, #3a2412, #1f1409 58%, #140d06); }
.page { max-width: 560px; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 14px calc(20px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.icon { width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); font-size: 20px; }
.card { margin-top: 12px; padding: 16px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
.home { text-align: center; }
.home-art { width: min(240px, 66%); aspect-ratio: 1; border-radius: 26px; object-fit: cover; box-shadow: 0 10px 26px rgba(0, 0, 0, .55); }
.home h1 { margin: 8px 0 0; font-size: 42px; color: var(--gold); text-shadow: 0 3px 0 #4a2c05, 0 0 22px #ffb70355; }
.home p { margin: 2px 0 10px; color: var(--muted); font-weight: 600; }
.how { text-align: right; margin: 12px 0 0; padding: 10px 14px; list-style: none; border-radius: 16px; background: rgba(0, 0, 0, .28); line-height: 1.9; font-weight: 600; font-size: 14.5px; }
.btn { display: block; width: 100%; margin-top: 10px; border: 0; border-radius: 18px; padding: 13px; font-weight: 800; font-size: 19px; }
.btn-main { background: linear-gradient(135deg, #ffb703, #fb8500); color: #3a1f00; box-shadow: 0 5px 0 #8a4b00; }
.btn-main:active { transform: translateY(3px); box-shadow: 0 2px 0 #8a4b00; }
.btn-ghost { background: rgba(255, 255, 255, .1); border: 1px solid var(--line); }
.btn-ghost b { color: var(--gold); }
.map-head { display: flex; align-items: center; gap: 10px; }
.map-head h2 { flex: 1; margin: 0; font-size: 26px; color: var(--gold); }
.total { font-weight: 800; background: rgba(0, 0, 0, .3); padding: 4px 12px; border-radius: 999px; }
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.lv { aspect-ratio: 1; border: 0; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: linear-gradient(150deg, #c1762c, #8c4a16); box-shadow: inset 0 -4px 0 #0004, inset 0 3px 0 #ffffff33, 0 3px 0 #0005; font-weight: 800; }
.lv b { font-size: 21px; line-height: 1; text-shadow: 0 2px 2px #0005; }
.lv small { font-size: 10px; letter-spacing: -1px; min-height: 13px; }
.lv.lock { background: rgba(255, 255, 255, .1); box-shadow: none; color: #fff9; }
body.playing .page { display: none; }
.play { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background: linear-gradient(175deg, #2a1a0c, #16100a 70%); }
.hud { display: flex; align-items: center; gap: 10px; padding: 8px 12px 4px; }
.hbtn { flex: none; width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); font-size: 22px; font-weight: 800; }
.hmid { flex: 1; text-align: center; line-height: 1.25; min-width: 0; }
.hmid > b { display: block; font-size: 18px; color: var(--gold); }
.hmid small { font-size: 13px; color: var(--muted); font-weight: 700; }
.hmid small b { color: #fff; }
.stage { position: relative; flex: 1; min-height: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; direction: ltr; }
.pop { position: absolute; left: 50%; top: 12%; transform: translateX(-50%) scale(.6); margin: 0; padding: 6px 18px; border-radius: 16px;
  font-size: 26px; font-weight: 800; color: #fff; text-shadow: 0 2px 4px #000a; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 183, 3, .5);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.pop.on { opacity: 1; transform: translateX(-50%) scale(1); }
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(12, 7, 3, .8); }
.modal { width: min(380px, 100%); padding: 18px 16px; border-radius: 24px; background: #30200f; border: 1px solid var(--line); text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.modal h2 { margin: 0 0 6px; color: var(--gold); }
.modal p { margin: 4px 0; font-weight: 700; }
.res-stars { font-size: 44px; letter-spacing: 6px; min-height: 10px; }
.res-stars i { font-style: normal; display: inline-block; animation: starIn .5s cubic-bezier(.3, 1.8, .5, 1) backwards; }
.res-stars i:nth-child(2) { animation-delay: .25s; } .res-stars i:nth-child(3) { animation-delay: .5s; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } }
.sinan-credit { text-align: center; margin-top: 18px; color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.sinan-credit b { color: var(--gold); }
