:root {
  --sand: #F6E3B4;
  --sand-dark: #EAD9B0;
  --palm: #2B6B2E;
  --palm-dark: #1E4F21;
  --date: #8B4A1F;
  --ink: #3A2414;
  --muted: #8a7458;
  --danger: #b3261e;
  --card: #FFF8E7;
  --sunset: #F28C28;
  --radius: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Tajawal, -apple-system, "SF Arabic", "Segoe UI", Tahoma, sans-serif;
  background: var(--sand);
  color: var(--ink);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

main { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }

h1 { font-family: 'Baloo Bhaijaan 2', sans-serif; font-size: 2rem; margin: 8px 0 4px; color: var(--palm); line-height: 1.2; }
h2 { font-family: 'Baloo Bhaijaan 2', sans-serif; font-size: 1.4rem; margin: 0 0 12px; color: var(--date); }
p.sub { color: var(--muted); margin: 0 0 20px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 0 var(--sand-dark);
}

label { display: block; font-weight: 600; margin: 10px 0 4px; }

input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%;
  font-size: 16px; /* أقل من 16 يخلي الآيفون يكبّر الصفحة */
  padding: 12px 14px;
  border: 2px solid var(--sand-dark);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
input:focus { outline: none; border-color: var(--palm); }
input.ltr { direction: ltr; text-align: left; }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 6px; width: 20px; height: 20px; flex: none; }

button, .btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 18px;
  border: 0;
  border-radius: 16px;
  background: var(--palm);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--palm-dark);
  font-family: 'Baloo Bhaijaan 2', Tajawal, sans-serif;
  transition: transform .08s, box-shadow .08s;
  text-decoration: none;
  text-align: center;
}
button:active, .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--palm-dark); }
button:disabled { opacity: .6; }
button.full, .btn.full { width: 100%; margin-top: 14px; }
button.light { background: var(--sand-dark); color: var(--ink); box-shadow: 0 4px 0 #D9BE80; }
button.danger { background: var(--danger); box-shadow: 0 4px 0 #7f1a14; }
button.small { padding: 6px 12px; font-size: .9rem; }
button.link { background: none; color: var(--palm-dark); padding: 6px 0; text-decoration: underline; font-weight: 600; box-shadow: none; font-family: Tajawal, sans-serif; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.msg { padding: 10px 14px; border-radius: 12px; margin: 12px 0 0; }
.msg.ok { background: #e4f2df; color: var(--palm-dark); }
.msg.err { background: #fbe3e0; color: var(--danger); }
.hidden { display: none !important; }

.list-item {
  border: 2px solid var(--sand-dark);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.list-item .title { font-weight: 700; }
.list-item .meta { color: var(--muted); font-size: .9rem; direction: ltr; text-align: right; }

.code {
  direction: ltr;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 1.6rem;
  letter-spacing: 4px;
  background: #fff;
  border: 2px dashed var(--palm);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  margin: 8px 0;
}

/* خريطة الحي */
.hood-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  background: #e9d29f;
  padding: 10px;
  border-radius: var(--radius);
}
.plot {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  text-align: center;
  padding: 4px;
  overflow: hidden;
}
.plot .icon { font-size: 1.5rem; line-height: 1; }
.plot.empty { background: rgba(255,255,255,.25); color: var(--muted); }
.plot.taken { background: #f3e2bd; border: 3px solid var(--date); }
.plot.me { background: #cfe8c4; border: 3px solid var(--palm); font-weight: 700; }
.plot .name { font-size: .8rem; font-weight: 600; line-height: 1.3; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.big-choice { display: grid; gap: 14px; margin-top: 24px; }
.big-choice .btn { font-size: 1.2rem; padding: 22px; border-radius: 20px; }
.hero { font-size: 4rem; text-align: center; margin-top: 20px; }
.center { text-align: center; }

.logo { display: block; width: 120px; height: 120px; margin: 24px auto 4px; border-radius: 27px; filter: drop-shadow(0 6px 0 rgba(58,36,20,.15)); }
.hero { display: block; width: 100%; max-width: 520px; height: auto; margin: 12px auto 4px; }
.brand { font-family: 'Baloo Bhaijaan 2', sans-serif; font-size: 3rem; font-weight: 800; color: var(--palm); text-align: center; margin: 0; line-height: 1.1; }
body { background: linear-gradient(#DDF0F8, #F6E3B4 320px); min-height: 100vh; }

/* بوابة ولي الأمر في التطبيق */
.gate { position: fixed; inset: 0; z-index: 100; background: #FFF8E7; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gate .card { width: 100%; max-width: 420px; }
.gate-q { font-size: 34px; font-weight: 800; text-align: center; direction: ltr; margin: 10px 0; }

/* داخل التطبيق: لا تطلع قائمة النسخ ولا معاينة الروابط عند الضغط المطوّل */
button, a, img, svg, canvas { -webkit-touch-callout: none; }
button, .hud-btn, canvas { -webkit-user-select: none; user-select: none; }

/* الآيفون: لا يدخل العنوان تحت الساعة والبطارية، وروابط «رجوع» بشكل اللعبة */
main { padding-top: calc(20px + env(safe-area-inset-top)); }
.gate { padding-top: calc(20px + env(safe-area-inset-top)); box-sizing: border-box; }
.gate .card { box-sizing: border-box; }
.gate input { text-align: center; font-size: 24px; margin-top: 6px; }
a { color: var(--palm-dark); font-weight: 700; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* الدخول بأبل وقوقل */
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: #9a8468; font-size: .9rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--sand-dark); }
.social-btns { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
button.social { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-family: -apple-system, 'Tajawal', sans-serif; }
button.social.apple { background: #000; color: #fff; box-shadow: 0 4px 0 #333; }
button.social.google { background: #fff; color: #3c4043; border: 1px solid #dadce0; box-shadow: 0 4px 0 #dadce0; }
.gbtn { display: flex; justify-content: center; min-height: 44px; }
.muted { color: #7a6650; }
