/* NAV (assets/js/nav.js): the phones' bottom bar, the Home icon, and the bars kept still between pages.
   The site's own look (DESIGN.md): navy surface, gold for what matters, the 1px gold hairline.
   Loaded by nav.js. What the first frame needs is in each page's own stylesheet (the Home icon in page.css and
   account.css; the account icon's place and the bar's room in main.css), so nothing flashes or jumps; this file
   repeats the Home icon for any other page. */

:root {
  --nav-css: 1;
}

/* ---------- «ارجع للموقع» as a Home icon, every width ---------- */
.pbar__home,
.cbar__home {
  position: relative;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0 !important;
  border: 1px solid var(--gold-line-strong, rgba(var(--gold-hi-rgb), .36));
  border-radius: 50%;
  overflow: hidden;
  color: transparent !important;
  font-size: 0 !important;
  white-space: nowrap;
  text-decoration: none;
}

.pbar__home::before,
.cbar__home::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  background: var(--gold-hi, rgb(var(--gold-hi-rgb)));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10.6 12 4l8 6.6V19a1.5 1.5 0 0 1-1.5 1.5H15v-5.5h-6v5.5H5.5A1.5 1.5 0 0 1 4 19z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10.6 12 4l8 6.6V19a1.5 1.5 0 0 1-1.5 1.5H15v-5.5h-6v5.5H5.5A1.5 1.5 0 0 1 4 19z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.pbar__home:hover,
.cbar__home:hover {
  background: var(--navy-800, #0b2a4c);
}

.pbar__home:active,
.cbar__home:active {
  transform: scale(.94);
}

/* ---------- the phones' bottom bar ---------- */
.tabbar {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(calc(100% - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)), 520px);
  display: flex;
  align-items: stretch;
  padding: 5px;
  border: 1px solid rgba(var(--gold-hi-rgb), .24);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(18, 56, 95, .52), rgba(4, 17, 36, .66));
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  backdrop-filter: blur(22px) saturate(1.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -1px 0 rgba(0, 0, 0, .3),
    0 0 0 .5px rgba(0, 0, 0, .45),
    0 20px 44px -18px rgba(0, 0, 0, .85),
    0 6px 16px -10px rgba(var(--gold-rgb), .18);
  transform: translateX(-50%);
  transition: padding .45s cubic-bezier(.32, .72, 0, 1), border-radius .45s cubic-bezier(.32, .72, 0, 1), width .45s cubic-bezier(.32, .72, 0, 1);
}

/* the glass's edge catches the light */
.tabbar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .14), transparent 30%, transparent 70%, rgba(var(--gold-hi-rgb), .1));
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  padding: 1px;
}

/* going down the page: it draws in to icons only; going up it opens again */
.tabbar.is-compact {
  padding: 3px;
  border-radius: 24px;
}

.tabbar__tab {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 2px;
  border: 0;
  border-radius: 22px;
  background: none;
  cursor: pointer;
  color: var(--text-3, #8d9db3);
  font: 700 11px/1.3 "Cairo", system-ui, sans-serif;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color .2s, background-color .3s, box-shadow .3s, min-height .45s cubic-bezier(.32, .72, 0, 1), transform .35s cubic-bezier(.32, .72, 0, 1);
}

.tabbar__tab:active {
  transform: scale(.92);
}

.tabbar.is-compact .tabbar__tab {
  min-height: 44px;
}

.tabbar.is-compact .tabbar__word {
  opacity: 0;
  max-height: 0;
}

.tabbar__word {
  transition: opacity .25s, max-height .45s cubic-bezier(.32, .72, 0, 1);
  max-height: 16px;
}

.tabbar__tab .icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar__tab .icon .duo {
  fill: currentColor;
  fill-opacity: .12;
  stroke: none;
}

.tabbar__tab[aria-current="page"],
.tabbar__tab[aria-current="location"] {
  color: var(--gold-hi, rgb(var(--gold-hi-rgb)));
}

.tabbar__tab {
  z-index: 1;
}

/* the lit place's glass pill: one lens that glides (a soft spring), it never jumps */
.tabbar__lens {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 0;
  height: 0;
  border-radius: 22px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--gold-hi-rgb), .22), rgba(var(--gold-hi-rgb), .07));
  box-shadow: inset 0 0 0 1px rgba(var(--gold-hi-rgb), .36), inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 18px -8px rgba(var(--gold-rgb), .5);
  transition: transform .6s cubic-bezier(.32, .72, 0, 1), width .6s cubic-bezier(.32, .72, 0, 1), height .35s cubic-bezier(.32, .72, 0, 1), opacity .3s;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .tabbar__lens {
    transition: opacity .2s;
  }
}

.tabbar__tab[aria-current] .icon {
  filter: drop-shadow(0 0 6px rgba(var(--gold-hi-rgb), .45));
}

.tabbar__word {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* «حسابي» is the account icon: its door face, smaller, over the word */
.tabbar .acct-badge {
  width: auto;
  height: auto;
  margin: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.tabbar .acct-badge .acct-badge__face {
  width: 22px;
  height: 25px;
  font-size: 13px;
}

.tabbar__tab:focus-visible {
  outline: 2px solid var(--gold-hi, rgb(var(--gold-hi-rgb)));
  outline-offset: -2px;
}

/* the bar is the home page's (owner, 2026-11-04: the other pages keep their own top bar, the Home icon and the
   account icon, no bottom bar). On a phone's home page: the top keeps the bell and the sound; nothing hides under
   the bar. Decided by the width and the page in CSS, not by the bar's arrival, so nothing moves when it comes in */
@media (max-width: 767px) {
  .topbar .acct-badge {
    display: none;
  }

  body:has(> main.hub) {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  body:has(> main.hub) .toast {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tabbar__tab {
    transition: none;
  }
}

/* a jump to a home section stops below the top bar */
.hub [data-area] {
  scroll-margin-top: 76px;
}

/* ---------- «المزيد»: a sheet from the bottom, the site's sheets in spirit ---------- */
dialog.nav-more {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  max-width: 640px;
  max-height: min(82dvh, 720px);
  margin: 0 auto;
  padding: 10px max(18px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--gold-line, rgba(var(--gold-hi-rgb), .16));
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  color: var(--text, #f5f7fb);
  background: linear-gradient(180deg, var(--navy-800, #0b2a4c), var(--navy-900, #061a31) 40%);
  box-shadow: 0 -30px 60px -20px rgba(0, 0, 0, .8);
  animation: nav-more-in .42s cubic-bezier(.22, 1, .36, 1) both;
}

dialog.nav-more::backdrop {
  background: rgba(1, 5, 12, .62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: nav-fade .25s ease both;
}

dialog.nav-more.is-closing {
  animation: nav-more-out .2s ease both;
}

@keyframes nav-more-in { from { transform: translateY(100%); } }
@keyframes nav-more-out { to { transform: translateY(100%); } }
@keyframes nav-fade { from { opacity: 0; } }

.nav-more__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 6px;
}

.nav-more__head::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 44px;
  height: 5px;
  margin-left: -22px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .2);
}

.nav-more__head h2 {
  flex: 1;
  margin: 10px 0 0;
  font: 700 1.6rem/1.5 "Aref Ruqaa", "Cairo", serif;
  color: var(--gold-hi, rgb(var(--gold-hi-rgb)));
}

.nav-more__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gold-line, rgba(var(--gold-hi-rgb), .16));
  border-radius: 50%;
  background: none;
  color: var(--text-2, #b9c5d5);
  cursor: pointer;
}

.nav-more__close .icon,
.nav-more__icon .icon {
  width: 22px;
  height: 22px;
}

.nav-more__group h3 {
  margin: 14px 0 10px;
  font: 800 .82rem/1.4 "Cairo", system-ui, sans-serif;
  color: var(--text-3, #8d9db3);
}

.nav-more__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 8px;
}

.nav-more__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 2px;
  border-radius: 16px;
  color: var(--text-2, #b9c5d5);
  font: 700 .74rem/1.4 "Cairo", system-ui, sans-serif;
  text-align: center;
  text-decoration: none;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1), color .2s;
}

.nav-more__tile:active {
  transform: scale(.94);
}

.nav-more__tile:hover,
.nav-more__tile:focus-visible {
  color: var(--text, #f5f7fb);
}

.nav-more__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  color: var(--gold-hi, rgb(var(--gold-hi-rgb)));
  background: linear-gradient(180deg, var(--navy-700, #12385f), var(--navy-800, #0b2a4c));
  box-shadow: inset 0 0 0 1px var(--gold-line, rgba(var(--gold-hi-rgb), .16));
}

.nav-more__word {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.nav-more__empty {
  margin: 20px 0;
  color: var(--text-3, #8d9db3);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  dialog.nav-more,
  dialog.nav-more::backdrop,
  dialog.nav-more.is-closing {
    animation: none;
  }
}

/* the three slots (the places near you on the home page) and the two that never move */
.tabbar__slots {
  position: relative;
  flex: 3;
  min-width: 0;
  display: flex;
  overflow: hidden;
  border-radius: 22px;
  margin-inline-end: 5px;
}

/* the line between the places and «حسابي» */
.tabbar__slots::after {
  content: "";
  position: absolute;
  inset-inline-end: 0;
  top: 22%;
  bottom: 22%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(var(--gold-hi-rgb), .35), transparent);
}

.tabbar__slots > .tabbar__tab {
  flex: 1 0 33.333%;
}

.tabbar__slots > .is-leaving {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.tabbar > .tabbar__tab {
  flex: 1;
}


.tabbar .icon {
  width: 24px;
  height: 24px;
}

/* no glass where the browser cannot blur: a solid navy capsule */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar {
    background: linear-gradient(180deg, #0d2d52, #061a31);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tabbar,
  .tabbar__word {
    transition: none;
  }
}

/* nothing the page needs hides under the bar: its own sticky actions stop above it, and anything brought
   into view (focus, a jump) stays clear of it */
@media (max-width: 767px) {
  html:has(body > main.hub) {
    scroll-padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

/* the bar arrives with the page, without a jump: it rises once, softly */
.tabbar {
  animation: tabbar-in .45s cubic-bezier(.32, .72, 0, 1) backwards;
}

@keyframes tabbar-in {
  from { opacity: 0; translate: 0 12px; }
}

html:active-view-transition-type(site-page) .tabbar {
  animation: none;
}

/* a task in progress has the screen to itself (as an app hides its tab bar): while a booking is being filled
   in, or while typing (the keyboard is up), the bar slides away; it comes back when the task is done */
.tabbar {
  transition: padding .45s cubic-bezier(.32, .72, 0, 1), border-radius .45s cubic-bezier(.32, .72, 0, 1), width .45s cubic-bezier(.32, .72, 0, 1), translate .45s cubic-bezier(.32, .72, 0, 1), opacity .3s;
}

html.has-tabbar body:has(.bk-flow:not(.bk-done)) .tabbar,
html.has-tabbar body:has(input:focus:not([type="checkbox"]):not([type="radio"]), textarea:focus, select:focus) .tabbar {
  translate: 0 calc(100% + 24px + env(safe-area-inset-bottom));
  opacity: 0;
  pointer-events: none;
}

/* ---------- GAME INTRO (assets/js/game-intro.js): a lively welcome, part of the page ---------- */
.gintro-host {
  position: relative;
}

.gintro-covered > *:not(.gintro) {
  opacity: 0;
}

.gintro-arrive > *:not(.gintro) {
  animation: gintro-arrive .6s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes gintro-arrive {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
}

.gintro {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 300px;
  overflow: hidden;
  border-radius: inherit;
  background:
    radial-gradient(55% 45% at 50% 42%, rgba(var(--gold-rgb), .2), transparent 70%),
    radial-gradient(80% 70% at 50% 100%, rgba(76, 195, 203, .1), transparent 70%),
    linear-gradient(180deg, var(--navy-900, #061a31), var(--ink, #020914));
  pointer-events: none;
  animation: gintro-in .25s ease-out both;
}

.gintro--page {
  position: fixed;
  inset: 0;
  z-index: 9;
  border-radius: 0;
}

.gintro--violet {
  background:
    radial-gradient(55% 45% at 50% 42%, rgba(163, 92, 255, .24), transparent 70%),
    linear-gradient(180deg, #120a2e, var(--ink, #020914));
}

.gintro.is-open {
  animation: gintro-open .5s cubic-bezier(.65, 0, .35, 1) both;
}

.gintro__rays {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 260vmax;
  height: 260vmax;
  margin: -130vmax 0 0 -130vmax;
  background: repeating-conic-gradient(from 0deg, rgba(var(--gold-hi-rgb), .1) 0deg 5deg, transparent 5deg 16deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 22%);
  mask: radial-gradient(circle, #000 0, transparent 22%);
  animation: gintro-rays 3s linear both, gintro-fade .4s ease-out both;
}

.gintro__glow {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 240px;
  height: 240px;
  margin: -120px 0 0 -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--gold-light-rgb), .55), rgba(var(--gold-rgb), .14) 45%, transparent 70%);
  animation: gintro-pulse .9s cubic-bezier(.22, 1, .36, 1) .1s both;
}

.gintro__marks {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.gintro__seal {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(var(--gold-hi-rgb), .5), 0 0 30px -6px rgba(var(--gold-hi-rgb), .7);
  animation: gintro-drop .55s cubic-bezier(.34, 1.56, .64, 1) .05s both;
}

.gintro__x {
  font: 800 26px/1 "Cairo", system-ui, sans-serif;
  color: var(--gold-hi, rgb(var(--gold-hi-rgb)));
  text-shadow: 0 0 14px rgba(var(--gold-hi-rgb), .8);
  animation: gintro-pop .4s cubic-bezier(.34, 1.56, .64, 1) .3s both;
}

.gintro__partner {
  height: 46px;
  width: auto;
  max-width: 120px;
  padding: 6px 10px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6);
  animation: gintro-drop .55s cubic-bezier(.34, 1.56, .64, 1) .18s both;
}

.gintro__games {
  position: relative;
  width: min(240px, 62%);
  height: auto;
  margin-top: 4px;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .5));
  animation: gintro-spring .7s cubic-bezier(.34, 1.56, .64, 1) .32s both;
}

.gintro__word {
  position: relative;
  margin: 2px 0 0;
  font: 800 1.15rem/1.6 "Cairo", system-ui, sans-serif;
  color: var(--gold-hi, rgb(var(--gold-hi-rgb)));
  letter-spacing: 0;
  animation: gintro-rise .45s cubic-bezier(.22, 1, .36, 1) .7s both;
}

.gintro__spark {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 6px;
  height: 6px;
  margin: -3px;
  border-radius: 50%;
  background: var(--gold-hi, rgb(var(--gold-hi-rgb)));
  box-shadow: 0 0 10px 2px rgba(var(--gold-hi-rgb), .7);
  opacity: 0;
  animation: gintro-spark .8s cubic-bezier(.22, 1, .36, 1) .45s both;
}

.gintro__spark--1 { --sx: -120px; --sy: -70px; }
.gintro__spark--2 { --sx: 120px; --sy: -60px; animation-delay: .5s; }
.gintro__spark--3 { --sx: -140px; --sy: 30px; animation-delay: .55s; }
.gintro__spark--4 { --sx: 140px; --sy: 40px; animation-delay: .48s; }
.gintro__spark--5 { --sx: -60px; --sy: -120px; animation-delay: .6s; background: #4cc3cb; }
.gintro__spark--6 { --sx: 70px; --sy: -115px; animation-delay: .52s; background: #c8433a; }
.gintro__spark--7 { --sx: -90px; --sy: 100px; animation-delay: .58s; }
.gintro__spark--8 { --sx: 95px; --sy: 95px; animation-delay: .62s; background: #4cc3cb; }

.gintro--lite .gintro__rays { animation: gintro-fade .4s ease-out both; }
.gintro--lite .gintro__games { filter: none; }

@keyframes gintro-in { from { opacity: 0; } }
@keyframes gintro-fade { from { opacity: 0; } }
@keyframes gintro-rays { to { transform: rotate(40deg); } }
@keyframes gintro-pulse { 0% { opacity: 0; transform: scale(.3); } 60% { opacity: 1; transform: scale(1.1); } 100% { opacity: .8; transform: scale(1); } }
@keyframes gintro-drop { from { opacity: 0; transform: translateY(-40px) scale(.6); } }
@keyframes gintro-pop { from { opacity: 0; transform: scale(0) rotate(-90deg); } }
@keyframes gintro-spring { from { opacity: 0; transform: scale(.4) rotate(-8deg); } }
@keyframes gintro-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes gintro-spark { 0% { opacity: 0; transform: none; } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(.4); } }
@keyframes gintro-open { to { opacity: 0; transform: scale(1.06); filter: blur(6px); } }

@media (prefers-reduced-motion: reduce) {
  .gintro { display: none; }
  .gintro-covered > *:not(.gintro) { opacity: 1; }
  .gintro-arrive > *:not(.gintro) { animation: none; }
}

/* a light arrival (nav.js: «نقاطي», once per visit): what is drawn in the first moment rises into place */
html[data-arrive] main > * {
  animation: nav-arrive .6s cubic-bezier(.22, 1, .36, 1) backwards;
}

html[data-arrive] main > *:nth-child(2) { animation-delay: .06s; }
html[data-arrive] main > *:nth-child(3) { animation-delay: .12s; }
html[data-arrive] main > *:nth-child(n+4) { animation-delay: .18s; }

@keyframes nav-arrive {
  from { opacity: 0; transform: translateY(16px); }
}

@media (prefers-reduced-motion: reduce) {
  html[data-arrive] main > * { animation: none; }
}
