/* بلياردو — dark club look: lamp-lit hall behind, real wood + felt table on the canvas */
:root { --ink: #fff; --muted: #cfe3d4; --card: rgba(10, 22, 15, .86); --line: rgba(255, 255, 255, .14); --gold: #f2c14e; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #0b140e; }
body { min-height: 100vh; color: var(--ink); font-family: "Baloo Bhaijaan 2", system-ui, sans-serif; overflow-x: hidden; }
.hall { position: fixed; inset: 0; z-index: 0; background: linear-gradient(rgba(5, 10, 7, .55), rgba(5, 10, 7, .8)), url(/assets/pool/hall.webp?v=1) center / cover; }
.page { position: relative; z-index: 1; 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, .35); 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, .45); }
.home-art { width: min(240px, 66%); aspect-ratio: 1; border-radius: 26px; object-fit: cover; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.home h1 { margin: 8px 0 0; font-size: 42px; color: var(--gold); text-shadow: 0 3px 0 #3b2a05; }
.home p { margin: 2px 0 8px; color: var(--muted); font-weight: 600; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode { border: 1px solid rgba(242, 193, 78, .45); border-radius: 16px; padding: 10px 4px; background: linear-gradient(#1f3b29, #12241a); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mode b { font-size: 14px; }
.mode small { color: var(--gold); font-weight: 800; font-size: 15px; }
.mode.two { grid-column: 1 / -1; background: linear-gradient(#3a2b0d, #241a07); }
.mode:active { transform: scale(.97); }
.names { display: grid; gap: 8px; margin-top: 10px; }
.names input { height: 46px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: 16px; padding: 0 14px; text-align: center; }
.how { text-align: right; margin: 12px 0 0; padding: 10px 14px; list-style: none; border-radius: 16px; background: rgba(0, 0, 0, .3); 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(#f6d27a, #d99a1e); color: #2b1a00; box-shadow: 0 5px 0 #7a5208; }
.btn-main:active { transform: translateY(3px); box-shadow: 0 2px 0 #7a5208; }
.btn-ghost { background: rgba(255, 255, 255, .1); border: 1px solid var(--line); }
body.playing .page { display: none; }
.play { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 35%, #1d2f22, #070d09 75%); padding: env(safe-area-inset-top) 0 0; }
.hud { direction: ltr; display: flex; align-items: center; gap: 8px; padding: 4px 8px; }
#pauseBtn { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .1); }
.pl { flex: 1; min-width: 0; direction: rtl; padding: 5px 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); transition: .25s; }
.pl.on { border-color: var(--gold); background: rgba(242, 193, 78, .16); box-shadow: 0 0 0 1px var(--gold) inset; }
.pn { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb { display: flex; gap: 2px; min-height: 14px; flex-wrap: wrap; }
.pb i { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset -2px -2px 3px rgba(0, 0, 0, .35); }
.pb i.st { background-image: linear-gradient(#fff 26%, transparent 26%, transparent 74%, #fff 74%) !important; }
.pb i.gone { opacity: .18; }
.pb em { font-style: normal; font-size: 11px; color: var(--muted); }
.msg { position: absolute; left: 50%; top: 9%; transform: translateX(-50%); margin: 0; max-width: 86%; text-align: center; font-weight: 800; font-size: 15px; color: #fff; background: rgba(5, 12, 8, .78); border: 1px solid rgba(242, 193, 78, .6); border-radius: 14px; padding: 6px 14px; pointer-events: none; }
.msg:empty { display: 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; }
.ctls { direction: ltr; display: flex; align-items: center; gap: 10px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
.fine { flex: none; width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .1); font-size: 24px; user-select: none; -webkit-user-select: none; }
.fine:active { background: rgba(255, 255, 255, .25); }
.power { position: relative; flex: 1; height: 52px; border-radius: 16px; overflow: hidden; border: 1px solid rgba(242, 193, 78, .5); background: linear-gradient(90deg, #142b1c, #0b170f); touch-action: none; }
.power i { position: absolute; right: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #ff3b30, #ffcc00 55%, #4cd964); }
.power span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 16px; text-shadow: 0 1px 3px #000; pointer-events: none; }
.play.busy .power, .play.busy .fine { opacity: .35; }
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(3, 8, 5, .8); }
.modal { width: min(400px, 100%); padding: 18px 16px; border-radius: 24px; background: #15281c; 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-ball { font-size: 54px; }
.sinan-credit { text-align: center; margin-top: 18px; color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.sinan-credit b { color: var(--gold); }
