:root {
  --bg: #FFF6E9; --grass: #C9E4B4; --road: #EBD9BC; --ink: #3D3A4A; --muted: #6E6A7C;
  --accent: #FF8A5B; --card: #FFFDF8; --line: #E9DCC8; --error: #B3261E;
  --head: "Baloo 2", system-ui, sans-serif; --body: "Nunito", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); }
h1, h2 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5rem; }
a { color: inherit; }
.muted { color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--accent); color: var(--ink);
  font: 700 16px var(--body); text-decoration: none; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn-ghost { background: var(--card); }
.btn:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* --- Sadə səhifələr (forma, kod, qaydalar) --- */
body.page main { max-width: 480px; margin: 0 auto; padding: 32px 16px 48px; }
form { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 700; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
input[type=text], select, input[type=file] { min-height: 44px; padding: 8px 12px; border: 2px solid var(--line);
  border-radius: 14px; background: var(--card); font: 16px var(--body); color: var(--ink); }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); margin-top: 2px; }
.error { background: #FDE8E4; border: 2px solid var(--error); color: var(--error); padding: 10px 14px; border-radius: 14px; }
.code { font: 700 clamp(28px, 9vw, 40px) var(--head); letter-spacing: .06em; background: var(--card);
  border: 3px dashed var(--accent); border-radius: 18px; padding: 12px; text-align: center; user-select: all; }
.steps { padding-left: 1.2rem; }
.back { display: inline-block; margin-top: 24px; }

/* --- Şəhər --- */
body.town { overflow: hidden; height: 100dvh; touch-action: none; }
#map { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; cursor: grab; background: var(--grass); }
#map.dragging { cursor: grabbing; }
.loading { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; font: 700 20px var(--head); pointer-events: none; }
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; gap: 10px; align-items: flex-start;
  padding: max(12px, env(safe-area-inset-top)) 16px 0; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.counter { flex: none; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 8px 14px;
  font-weight: 700; white-space: nowrap; box-shadow: 0 3px 0 var(--ink); }
.counter b { font-family: var(--head); font-size: 18px; }
.search { flex: 1; min-width: 0; position: relative; }
.search input { width: 100%; min-height: 44px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--card); font: 16px var(--body); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.results { position: absolute; top: 52px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--card);
  border: 2px solid var(--ink); border-radius: 18px; max-height: 50vh; overflow: auto; }
.results button { width: 100%; min-height: 44px; display: flex; gap: 10px; align-items: center; padding: 6px 10px;
  border: 0; border-radius: 12px; background: none; font: 16px var(--body); color: var(--ink); text-align: left; cursor: pointer; }
.results button:hover, .results button:focus-visible { background: var(--bg); }
.results img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.results .empty { padding: 10px; color: var(--muted); }
.fab-join { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: max(20px, env(safe-area-inset-bottom)); }
.fab-join:active { transform: translateX(-50%) translateY(2px); }
.fab-home { position: fixed; z-index: 5; right: 16px; bottom: max(20px, env(safe-area-inset-bottom)); width: 48px; height: 48px;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--card); font-size: 22px; color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--ink); }

.sheet { position: fixed; inset: 0; z-index: 10; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(61, 58, 74, .25); }
.sheet-card { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 480px; background: var(--card);
  border: 2px solid var(--ink); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 12px 20px max(20px, env(safe-area-inset-bottom));
  text-align: center; animation: up .25s ease-out; }
.grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.c-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 0 0 4px var(--ring, var(--accent)); background: var(--bg); }
.c-head { display: flex; justify-content: center; align-items: baseline; gap: 10px; margin-top: 10px; }
.c-head h2 { margin: 0; font-size: 26px; }
.c-no { color: var(--muted); font-size: 14px; }
.sheet-card p { margin: 4px 0; }
.c-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .sheet-card { animation: none; } }
