/* ===== ספארי בצפון טנזניה – עיצוב ===== */

/* ---------- צבעים (כמו בקטלוגים) ---------- */
:root {
  --accent: #A4521F;   /* חום־כתום */
  --accent-d: #7A3B14;
  --green: #3F6B1F;
  --text: #2E2A24;
  --muted: #6B5D45;
  --soft: #F6F1E7;     /* רקע */
  --sand: #FBF3DC;     /* תיבות */
  --line: #D8CFBF;
  --bad: #B3261E;
  --r: 14px;           /* עיגול פינות */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  background: var(--soft);
  color: var(--text);
}
a { color: var(--accent); }
img { max-width: 100%; }

/* ---------- הפס העליון ---------- */
#bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 4px;
  background: var(--accent); color: #fff;
  padding: 8px 8px;
  padding-top: calc(8px + env(safe-area-inset-top));
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
#b-title {
  flex: 1; margin: 0 6px; font-size: 1.1rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ic {
  position: relative;
  width: 42px; height: 42px; flex: none;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff;
  font-size: 1.35rem; line-height: 1; cursor: pointer;
}
.ic:active { background: rgba(255,255,255,.3); }
#b-dot { position: absolute; top: 6px; left: 6px; width: 10px; height: 10px; border-radius: 50%; background: #F2C14E; }

main {
  max-width: 720px; margin: 0 auto;
  padding: 14px 14px calc(30px + env(safe-area-inset-bottom));
}
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- כרטיסים וכפתורים ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 10px; font-size: 1.2rem; color: var(--accent); }
.center { text-align: center; }
.btn, .bigbtn {
  display: block; width: 100%;
  border: 0; border-radius: 12px;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: bold; font-size: 1.05rem;
  padding: 14px; margin: 12px 0 6px; cursor: pointer;
}
.btn:disabled { background: var(--green); opacity: .85; }
.bigbtn { background: var(--green); text-align: right; display: flex; justify-content: space-between; align-items: center; }
.bigbtn small { font-weight: normal; opacity: .9; }
.prog { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 10px 0 4px; }
.prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.note { font-size: .9rem; color: var(--muted); }
.banner {
  display: block; background: var(--sand); border: 1px solid #E8D9A8; border-right: 5px solid var(--accent);
  border-radius: 10px; padding: 12px 14px; margin: 10px 0 4px; color: var(--text); text-decoration: none;
}
table.info { width: 100%; border-collapse: collapse; }
table.info td { padding: 6px 0; border-bottom: 1px solid var(--soft); }
table.info td:first-child { color: var(--muted); width: 45%; }
#toast {
  position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: #2E2A24; color: #fff; padding: 10px 18px; border-radius: 20px; font-size: .95rem;
  z-index: 20; max-width: 90%; text-align: center;
}

/* ---------- מסך הבית ---------- */
.hero h2 { margin: 4px 0 6px; font-size: 1.35rem; color: var(--accent); line-height: 1.35; }
.hero .txt { color: var(--text); }
h3.sec { margin: 22px 0 10px; font-size: 1.15rem; color: var(--accent-d); border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  position: relative; display: block; border-radius: var(--r); overflow: hidden;
  background: var(--line); text-decoration: none; aspect-ratio: 4 / 3;
}
.tile-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-t {
  position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  color: #fff; font-weight: bold; font-size: 1rem; line-height: 1.25;
}
.tile-t small { display: block; font-weight: normal; font-size: .8rem; opacity: .9; }
figure.map { margin: 0 0 10px; }
figure.map img { border-radius: var(--r); display: block; width: 100%; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 26px; }

/* ---------- קטלוג ---------- */
details.about { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
details.about summary { font-weight: bold; color: var(--accent); cursor: pointer; }
.filters { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 5; background: var(--soft); padding: 4px 0 8px; }
.filters input, .filters select {
  font: inherit; font-size: 16px; /* 16 – כדי שהאייפון לא יגדיל את המסך */
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text);
  padding: 9px 10px;
}
.sel { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 6px; }
.sel select { padding: 8px 4px; font-size: 14px; }
.count { color: var(--muted); font-size: .9rem; margin: 4px 0; }
h2.grp { font-size: 1.2rem; color: #fff; background: var(--accent); border-radius: 10px; padding: 4px 12px; margin: 18px 0 8px; }
details.fam { margin: 12px 0 6px; }
details.fam summary { font-weight: bold; color: var(--accent-d); cursor: pointer; list-style: none; }
details.fam summary::-webkit-details-marker { display: none; }
details.fam .i { color: var(--muted); font-weight: normal; }
details.fam .txt { font-size: .95rem; background: var(--sand); border-radius: 10px; padding: 6px 12px; margin-top: 6px; }
.rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
.row {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); padding-left: 10px;
}
.row img, .row .noimg { width: 92px; height: 69px; min-height: 0; object-fit: cover; flex: none; display: block; background: var(--line); }
.row-t { flex: 1; line-height: 1.3; min-width: 0; }
.row-t b { display: block; font-size: 1rem; }
.row-t small { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-s { color: var(--accent); font-size: .85rem; letter-spacing: 1px; flex: none; }
details.more summary { color: var(--accent); cursor: pointer; font-weight: bold; }
.st-off { color: var(--line); }

/* ---------- כרטיס ---------- */
.hero-img { margin: -14px -14px 10px; }
.hero-img img, .hero-img .noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--line); }
.hero-img figcaption { font-size: .75rem; color: var(--muted); padding: 3px 14px; }
.hero-img figcaption a { color: var(--muted); }
.nm { margin: 0; font-size: 1.7rem; color: var(--accent); line-height: 1.3; }
.names { margin: 2px 0; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tags > span { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 2px 10px; font-size: .88rem; }
.tags .st { color: var(--accent); }
.tags .cs.ok { border-color: #A9C48F; color: var(--green); }
.tags .cs.mid { border-color: #E3C27A; color: #8A5A00; }
.tags .cs.bad { border-color: #E2A29D; color: var(--bad); }
.regs { margin: 6px 0 10px; }
.facts { background: var(--sand); border-radius: 12px; padding: 10px 30px 10px 14px; margin: 10px 0; }
.item h3, .page h3 { color: var(--accent); margin: 18px 0 4px; font-size: 1.15rem; }
.page h4 { color: var(--accent-d); margin: 14px 0 2px; }
.txt p { margin: 0 0 8px; }
.txt ul { padding-right: 22px; margin: 4px 0 8px; }
.txt li { margin-bottom: 4px; }
.txt table { width: 100%; border-collapse: collapse; background: #fff; margin: 6px 0; font-size: .95rem; }
.txt td, .txt th { border: 1px solid var(--line); padding: 5px 8px; text-align: right; vertical-align: top; }
.txt th { background: var(--sand); }
.txt img { border-radius: 10px; display: block; margin: 6px 0; }
.dyk { background: #EEF4E6; border-right: 5px solid var(--green); border-radius: 12px; padding: 4px 14px 6px; margin: 18px 0; }
.dyk h3 { color: var(--green) !important; }
.pn { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; font-weight: bold; }
.pn a { text-decoration: none; }
a.ext::after { content: " ↗"; font-size: .8em; }

/* ---------- דף מידע ---------- */
.page h2.pt { font-size: 1.5rem; color: var(--accent); margin: 2px 0 10px; line-height: 1.3; }
.page figure { margin: 10px 0 14px; }
.page figure img, .page figure .noimg { width: 100%; border-radius: var(--r); display: block; background: var(--line); }
.page figure .noimg { aspect-ratio: 4 / 3; }
.page figcaption { font-size: .85rem; color: var(--muted); padding: 3px 4px; }
a.figlink { text-decoration: none; color: inherit; }
a.figlink figcaption { color: var(--accent); font-weight: bold; }
.noimg { min-height: 60px; }

/* שדה החיפוש עם כפתור X לניקוי */
.search { position: relative; }
.search input { padding-left: 44px; }
#f-x {
  position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--line); color: var(--text); font-size: 1rem; line-height: 1; cursor: pointer;
}
#f-x:active { background: var(--muted); color: #fff; }

/* מסך ההתקנה */
.banner.inst { background: #FFF; border-right-color: var(--green); }
.why, .steps { padding-right: 22px; margin: 6px 0; }
.why li, .steps li { margin-bottom: 10px; }
.steps small { color: var(--muted); }
.ios-ic { width: 26px; height: 26px; vertical-align: middle; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.ios-more { display: inline-block; min-width: 26px; text-align: center; font-weight: bold; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.copy { font: inherit; font-size: .9rem; border: 1px solid var(--accent); color: var(--accent); background: #fff; border-radius: 8px; padding: 2px 10px; cursor: pointer; }
.qr { width: 220px; height: 220px; display: block; margin: 8px auto; image-rendering: pixelated; }
button.link { font: inherit; font-size: .9rem; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* משחקים */
.gtiles { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.gtile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 4px;
  text-decoration: none; color: var(--accent-d); font-weight: bold; text-align: center;
}
.gtile span { font-size: 1.9rem; line-height: 1.2; }
.lead { color: var(--muted); }
.gcard {
  display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; margin-bottom: 10px; text-decoration: none; color: var(--text);
}
.gcard .ge { font-size: 2.4rem; flex: none; }
.gcard .gt b { display: block; color: var(--accent); font-size: 1.15rem; }
.gcard .gt small { display: block; color: var(--green); font-weight: bold; margin-top: 2px; }

/* חלון ״מידע נוסף״ מעל משחק */
#sheet {
  position: fixed; inset: 0; z-index: 30; background: var(--soft);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
#sheet .sh-bar {
  position: sticky; top: 0; z-index: 2; background: var(--green);
  padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top));
}
.sh-close { font: inherit; font-weight: bold; color: #fff; background: rgba(255,255,255,.18); border: 0; border-radius: 20px; padding: 8px 16px; cursor: pointer; }
#sheet .sh-body { max-width: 720px; margin: 0 auto; padding: 14px 14px calc(30px + env(safe-area-inset-bottom)); }
#sheet .hero-img { margin-top: -14px; }
body.sheet-open { overflow: hidden; }

/* חשבון וטבלאות מובילים */
.glinks { display: flex; justify-content: space-between; gap: 10px; margin: 10px 2px 0; font-weight: bold; }
.glinks a { text-decoration: none; }
.gplayer { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; font-size: .95rem; }
.gplayer small { display: block; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip { font: inherit; font-size: .95rem; background: #fff; border: 1px solid var(--line); color: var(--text); border-radius: 20px; padding: 6px 14px; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: bold; }
.card input { font: inherit; font-size: 16px; width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 4px 0; background: #fff; color: var(--text); }
.row2 { display: flex; gap: 8px; align-items: center; }
.row2 input { flex: 1; font-size: 1.4rem; letter-spacing: .15em; text-align: center; }
.row2 .btn { width: auto; margin: 4px 0; padding: 12px 22px; }
.btn.ghost { background: #fff; color: var(--accent); border: 2px solid var(--accent); }
.amsg { color: var(--bad); min-height: 1.2em; margin: 4px 0 0; }
table.lb { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.lb th { text-align: right; color: var(--muted); font-weight: normal; border-bottom: 2px solid var(--line); padding: 4px; }
table.lb td { padding: 6px 4px; border-bottom: 1px solid var(--soft); }
table.lb tr.me td { background: var(--sand); font-weight: bold; }
table.lb tr.gap td { text-align: center; color: var(--muted); border: 0; }
