/* الجيش الصغير — green army camp look around a vertical battlefield canvas */
:root { --ink: #fff; --muted: #d9f2c9; --card: rgba(22, 48, 28, .9); --line: rgba(255, 255, 255, .16); --gold: #ffd23f; --green: #46c35a; --red: #ff4d4d; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #16301c; }
body { min-height: 100vh; color: var(--ink); font-family: "Baloo Bhaijaan 2", system-ui, sans-serif; overflow-x: hidden;
  background: radial-gradient(circle at 15% 0, #6fd36b44, transparent 45%), radial-gradient(circle at 90% 100%, #ff4d4d33, transparent 45%), linear-gradient(#16301c, #1f4226 60%, #2d5a2f); }
.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; }
.home, .map { 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, .35); }
.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, .45); }
.home h1 { margin: 8px 0 0; font-size: 40px; color: var(--gold); text-shadow: 0 3px 0 #2c5a12; }
.home p { margin: 2px 0 6px; color: var(--muted); font-weight: 600; }
.best b { color: var(--gold); }
.how { text-align: right; margin: 10px 0 0; padding: 10px 14px; list-style: none; border-radius: 16px; background: rgba(0, 0, 0, .25); line-height: 1.9; font-weight: 600; font-size: 15px; }
.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(#7be26f, #2f9e3f); color: #0d2a10; box-shadow: 0 5px 0 #1a5c22; }
.btn-main:active { transform: translateY(3px); box-shadow: 0 2px 0 #1a5c22; }
.btn-ghost { background: rgba(255, 255, 255, .12); border: 1px solid var(--line); }
.map-head { display: flex; align-items: center; gap: 10px; }
.map-head h2 { flex: 1; margin: 0; color: var(--gold); font-size: 26px; }
.total-stars { font-weight: 800; background: rgba(0, 0, 0, .3); padding: 4px 12px; border-radius: 999px; }
.land { margin-top: 12px; padding: 12px; border-radius: 22px; border: 1px solid var(--line); background: #234 center / cover; position: relative; overflow: hidden; }
.land::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .2)); }
.land.l0 { background-image: url(/assets/army/bg_meadow.webp?v=1); }
.land.l1 { background-image: url(/assets/army/bg_desert.webp?v=1); }
.land.l2 { background-image: url(/assets/army/bg_snow.webp?v=1); }
.land > * { position: relative; }
.land h3 { margin: 0 0 8px; font-size: 20px; text-shadow: 0 2px 4px #000; }
.lv-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lv { border: 0; border-radius: 16px; padding: 8px 2px 6px; background: linear-gradient(#7be26f, #2f9e3f); color: #0d2a10; box-shadow: 0 4px 0 #1a5c22; display: flex; flex-direction: column; align-items: center; }
.lv b { font-size: 24px; line-height: 1.1; }
.lv small { font-size: 10px; min-height: 15px; letter-spacing: -1px; }
.lv.lock { background: rgba(255, 255, 255, .22); color: #fff; box-shadow: none; }
body.playing .page { display: none; }
.play { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; background: #1d3a22; padding: env(safe-area-inset-top) 0 0; }
.hud { direction: ltr; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(14, 30, 18, .96); font-weight: 800; }
.hud-mid { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.15; min-width: 0; direction: rtl; }
.hud-mid #lvName { color: var(--gold); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.army { font-size: 14px; color: var(--muted); }
.hud-base { font-size: 16px; white-space: nowrap; }
#pauseBtn { width: 36px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .12); }
.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; }
.banner { position: absolute; left: 50%; top: auto; bottom: 24%; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; text-align: center; padding: 10px 22px; border-radius: 20px; background: rgba(14, 30, 18, .85); border: 2px solid var(--gold); transition: .3s; min-width: 62%; }
.banner.on { opacity: 1; transform: translate(-50%, 0); }
.banner b { display: block; font-size: 24px; color: var(--gold); }
.banner small { font-size: 14px; color: var(--muted); font-weight: 700; }
.boss-btn { position: absolute; left: 10px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 92px; height: 56px; border-radius: 18px; border: 2px solid rgba(255, 255, 255, .5); background: rgba(14, 30, 18, .75); overflow: hidden; font-weight: 800; font-size: 15px; padding: 0; }
.boss-btn i { position: absolute; left: 0; bottom: 0; width: 100%; height: 0; background: linear-gradient(#ffe066, #ff9f1c); transition: height .2s; }
.boss-btn span { position: relative; }
.boss-btn:not(:disabled) { border-color: #fff; color: #3a1a00; animation: bossPulse .8s ease-in-out infinite; }
.boss-btn:disabled { color: #fff; }
@keyframes bossPulse { 50% { transform: scale(1.08); } }
.hint { position: absolute; left: 0; right: 0; bottom: 18%; margin: 0; text-align: center; font-weight: 800; font-size: 18px; text-shadow: 0 2px 6px #000; pointer-events: none; animation: hintB 1.2s ease-in-out infinite; }
@keyframes hintB { 50% { transform: translateY(-6px); opacity: .7; } }
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(5, 14, 8, .8); }
.modal { width: min(400px, 100%); padding: 18px 16px; border-radius: 24px; background: #24452a; border: 1px solid var(--line); text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.modal h2 { margin: 0 0 6px; color: var(--gold); }
.modal p { margin: 4px 0; font-weight: 700; }
.res-stars { font-size: 42px; letter-spacing: 4px; }
.sinan-credit { text-align: center; margin-top: 18px; color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.sinan-credit b { color: var(--gold); }
/* v2: upgrades shop + 10 battles per land */
.lv-row { grid-template-columns: repeat(5, 1fr); }
.shop { margin: 12px 0 4px; padding: 10px; border-radius: 18px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); display: grid; gap: 7px; }
.shop-head { text-align: center; font-weight: 800; font-size: 18px; color: var(--gold); }
.upg { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n p" "s p"; align-items: center; gap: 0 8px; text-align: right; padding: 8px 12px; border-radius: 14px; border: 0; background: linear-gradient(#ffe27a, #f2a91e); color: #3a2000; box-shadow: 0 4px 0 #9a5f00; }
.upg .un { grid-area: n; font-weight: 800; font-size: 15px; }
.upg small { grid-area: s; font-size: 12px; font-weight: 700; opacity: .85; }
.upg b { grid-area: p; font-size: 15px; background: rgba(255, 255, 255, .45); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.upg:disabled { background: rgba(255, 255, 255, .14); color: #e6f3df; box-shadow: none; }
.upg:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #9a5f00; }
.modal .shop { margin-top: 8px; }
.play { background: #7fd3ff; }
