/* arcade-kit — هيكل الصفحة المشترك لألعاب الأركيد. كل لعبة تغيّر الألوان بمتغيراتها (--bg1 … --accent). */
:root { --bg1: #140f22; --bg2: #241a3c; --accent: #ffd166; --accent2: #ff7b54; --ink: #fff6ec; --muted: #c9bfe0; --line: rgba(255, 255, 255, .16); --card: rgba(20, 14, 34, .9); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg1); }
body { min-height: 100vh; color: var(--ink); font-family: "Baloo Bhaijaan 2", system-ui, sans-serif; overflow-x: hidden;
  background: radial-gradient(900px 600px at 50% -10%, var(--bg2) 0, transparent 60%), var(--bg1); }
.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 { text-align: center; 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, .4); }
.home-art { width: min(230px, 64%); height: auto; aspect-ratio: 1; border-radius: 28px; object-fit: cover; box-shadow: 0 12px 28px rgba(0, 0, 0, .5); }
.home h1 { margin: 8px 0 0; font-size: 40px; color: var(--accent); text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.home p { margin: 2px 0 8px; color: var(--muted); font-weight: 600; }
.best b { color: var(--accent); }
.how { text-align: right; margin: 10px 0; padding: 10px 14px; list-style: none; border-radius: 18px; background: rgba(0, 0, 0, .28); line-height: 1.95; 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(var(--accent), var(--accent2)); color: #2a1300; box-shadow: 0 5px 0 rgba(0, 0, 0, .35); }
.btn-main:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.btn-ghost { background: rgba(255, 255, 255, .12); border: 1px solid var(--line); font-size: 17px; }

body.playing .page { display: none; }
.play { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; background: var(--bg1); padding: env(safe-area-inset-top) 0 0; }
.hud { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: rgba(0, 0, 0, .35); font-weight: 800; }
.chip { flex: 1; text-align: center; padding: 5px 2px; border-radius: 12px; background: rgba(255, 255, 255, .08); font-size: 14px; white-space: nowrap; }
.chip b { color: var(--accent); }
#pauseBtn { width: 36px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .12); flex: none; }
.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; touch-action: none; }
.hint { margin: 0; padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); text-align: center; background: rgba(0, 0, 0, .35); color: var(--muted); font-size: 13px; font-weight: 700; }

.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(6, 4, 12, .82); }
.modal { width: min(400px, 100%); padding: 18px 16px; border-radius: 26px; background: var(--bg2); border: 1px solid var(--line); text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .55); }
.modal h2 { margin: 0 0 6px; color: var(--accent); }
.modal p { margin: 4px 0; font-weight: 700; }
.modal p b { color: var(--accent); }
.new-best { color: #7dff8a !important; }
.sinan-credit { text-align: center; margin-top: 18px; color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.sinan-credit b { color: var(--accent); }
