:root {
  --bg: #0e2416;
  --panel: rgba(14, 30, 20, .86);
  --panel2: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .14);
  --text: #f1f5ee;
  --muted: #a9bba9;
  --accent: #8bc34a;
  --accent2: #ffca28;
  --danger: #ef5350;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
html, body { margin: 0; height: 100%; color: var(--text);
  font-family: system-ui, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Hebrew", "Noto Sans Arabic", "Noto Sans SC", Arial, sans-serif; font-size: 16px; overscroll-behavior: none; }
body { overflow-x: hidden; }
#bg { position: fixed; inset: 0; background: url("/assets/menu-bg.jpg") center/cover no-repeat; filter: brightness(.55) saturate(1.1); z-index: -1; }
.hidden { display: none !important; }
main { max-width: 640px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 32px; min-height: 100%; }
.loading { text-align: center; padding-top: 40vh; color: var(--muted); }

h1 { font-size: 2rem; margin: 12px 0 4px; text-align: center; letter-spacing: .5px; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
h1 span { color: var(--accent); }
h2 { font-size: 1.15rem; margin: 18px 0 8px; }
.sub { text-align: center; color: var(--muted); margin: 0 0 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; backdrop-filter: blur(6px); box-shadow: 0 6px 24px rgba(0,0,0,.35); }
label { display: block; font-size: .9rem; color: var(--muted); margin: 10px 0 4px; }
input, select { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.35); color: var(--text); font-size: 1rem; }
input:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
input[dir="ltr"] { text-align: left; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 11px 16px; background: var(--accent); color: #102010; font-weight: 700; }
button:disabled { opacity: .5; cursor: default; }
button.sec { background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
button.danger { background: var(--danger); color: #fff; }
button.small { padding: 7px 11px; font-size: .88rem; }
button.full { width: 100%; margin-top: 14px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.tabs { display: flex; gap: 6px; background: var(--panel); padding: 6px; border-radius: var(--radius); border: 1px solid var(--line); position: sticky; top: 8px; z-index: 5; }
.tabs button { flex: 1; min-width: 0; background: transparent; color: var(--muted); padding: 7px 2px; font-size: .74rem; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; overflow: hidden; }
.tabs button .ico { font-size: 1.15rem; line-height: 1.2; }
.tabs button .badge { position: absolute; top: 2px; inset-inline-end: 6px; }
.tabs button.on { background: var(--accent); color: #102010; }
.badge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: .75rem; margin-inline-start: 4px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.list .meta { color: var(--muted); font-size: .85rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #666; flex: none; }
.dot.on { background: #4caf50; box-shadow: 0 0 6px #4caf50; }
.empty { color: var(--muted); font-size: .92rem; padding: 6px 0; }
.err { color: #ffab91; min-height: 1.2em; font-size: .92rem; margin-top: 8px; }
.rules { list-style: none; padding: 0; margin: 8px 0 0; font-size: .85rem; color: var(--muted); columns: 2; }
.rules li::before { content: "✗ "; color: var(--danger); }
.rules li.ok { color: #c5e1a5; }
.rules li.ok::before { content: "✓ "; color: var(--accent); }
.link { background: none; color: var(--accent2); padding: 4px; font-weight: 600; text-decoration: underline; }
.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.header .me { font-weight: 700; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: .78rem; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.pill.live { background: #2e7d32; color: #fff; border-color: transparent; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats div { background: var(--panel2); border-radius: 10px; padding: 10px 4px; }
.stats b { display: block; font-size: 1.4rem; color: var(--accent2); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
td, th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: start; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-inline-end: 6px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222c; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 100; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; }

/* ---------- game ---------- */
#game { position: fixed; inset: 0; background: #000; z-index: 50; touch-action: none; user-select: none; -webkit-user-select: none; }
#cv { width: 100%; height: 100%; display: block; }
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud-top { position: absolute; top: max(8px, env(safe-area-inset-top)); right: 8px; left: 64px; display: flex; flex-direction: column; gap: 4px; }
#hud-round { font-weight: 700; text-shadow: 0 1px 4px #000; }
#hud-timer { font-weight: 700; text-shadow: 0 1px 4px #000; font-variant-numeric: tabular-nums; direction: ltr; white-space: nowrap; }
#hud-center .panel.intro { margin-bottom: 12px; max-width: 320px; }
#hud-scores { display: flex; flex-wrap: wrap; gap: 6px; }
#hud-scores span { background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 8px; font-size: .85rem; }
#hud-scores span.dead { opacity: .45; text-decoration: line-through; }
.hud-btn { pointer-events: auto; position: absolute; top: max(8px, env(safe-area-inset-top)); width: 44px; height: 44px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 1.1rem; }
#btn-exit { left: 8px; }
#btn-cam { left: 8px; top: calc(max(8px, env(safe-area-inset-top)) + 52px); }
#hud-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; text-shadow: 0 2px 10px #000; }
#hud-center .big { font-size: 5rem; font-weight: 800; color: var(--accent2); }
#hud-center .panel { pointer-events: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; min-width: 260px; max-width: 92vw; max-height: 80vh; overflow: auto; }
#ctrl { position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 14px; direction: ltr; }
#ctrl button { pointer-events: auto; width: 92px; height: 92px; border-radius: 50%; font-size: 2rem; background: rgba(255,255,255,.18); color: #fff; border: 2px solid rgba(255,255,255,.35); }
#ctrl button:active { background: rgba(139,195,74,.6); }
#hud-ping { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: .72rem; color: #fffa; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.langbar { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.langbar select { width: auto; min-width: 150px; padding: 8px 10px; }
select option { background: #14261a; color: var(--text); }

/* ---------- welcome / download page ---------- */
body.landing main { max-width: 720px; }
.hero { text-align: center; padding: 8px 0 4px; }
.hero-icon { border-radius: 50%; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.hero h1 { font-size: 2.4rem; margin-top: 10px; }
a.dl { display: block; max-width: 360px; margin: 18px auto 8px; padding: 16px 20px; border-radius: 14px; background: var(--accent); color: #102010; font-weight: 800; font-size: 1.15rem; text-align: center; text-decoration: none; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
a.dl:active { transform: translateY(1px); }
.dl-meta { text-align: center; color: var(--muted); font-size: .88rem; margin: 0 0 8px; }
.card p { line-height: 1.6; margin: 6px 0; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.shots img { width: 100%; height: 300px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; }
.feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feats li { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; line-height: 1.45; font-size: .95rem; }
.steps { margin: 0; padding-inline-start: 22px; line-height: 1.8; }
.credits { color: var(--muted); font-size: .78rem; text-align: center; line-height: 1.6; margin-top: 18px; }
@media (max-width: 480px) { .feats { grid-template-columns: 1fr; } .shots img { height: 240px; } }
