﻿/* Q Party — موقع ألعاب التجمعات من سلسلة Q Live */

:root {
  --night: #1E0B3A;
  --night-2: #2B1452;
  --night-3: #3A1D6B;
  --grape: #7C3AED;
  --grape-soft: #A98BFF;
  --coral: #FF6B4A;
  --butter: #FFD84D;
  --milk: #FFF5EC;
  --ink: #1E0B3A;
  --ink-soft: #5B4A75;
  --on-night-soft: rgba(255, 245, 236, 0.74);
  --line-dark: rgba(255, 245, 236, 0.14);
  --line-light: rgba(30, 11, 58, 0.12);
  --green: #22B573;

  --display: "Lalezar", "Readex Pro", system-ui, sans-serif;
  --body: "Readex Pro", system-ui, sans-serif;

  /* مقياس مسافات واحد لكل الصفحة */
  --s1: 8px;
  --s2: 12px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s6: 48px;
  --s7: 72px;
  --section: clamp(64px, 8vw, 104px);
  --header-h: 76px;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

/* التمرير الناعم يتم من js عند الضغط فقط، حتى لا تبدأ الصفحة من أعلى ثم تنزل عند فتح رابط فيه # */
[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

body {
  margin: 0;
  background: var(--milk);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--butter);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--butter);
  color: var(--ink);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--night);
  color: var(--milk);
  border-bottom: 1px solid var(--line-dark);
}
.site-header .wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s5);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  text-decoration: none;
}
.brand-logo {
  width: clamp(120px, 12vw, 150px);
  height: auto;
  aspect-ratio: 5 / 2;
  object-fit: contain;
}
.site-header .brand-logo {
  width: 120px;
  height: 48px;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 1.5vw, 20px);
}
.site-nav a {
  position: relative;
  padding-block: var(--s1);
  text-decoration: none;
  font-size: 0.97rem;
  white-space: nowrap;
  color: var(--on-night-soft);
  transition: color 0.2s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -2px;
  height: 3px;
  border-radius: 3px;
  background: var(--coral);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.site-nav a:hover { color: var(--milk); }
.site-nav a[aria-current] { color: var(--milk); font-weight: 600; }
.site-nav a[aria-current]::after { transform: scaleX(1); }
.site-nav svg { display: none; }
/* أزرار أسفل قائمة الجوال فقط */
.nav-actions { display: none; }

.header-end {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}
.menu-toggle svg { width: 22px; height: 22px; margin: auto; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  border: 0;
  border-radius: 16px;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-coral {
  background: var(--coral);
  color: var(--night);
  box-shadow: 0 4px 0 #C2412A;
}
.btn-coral:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #C2412A; }
.btn-coral:active { transform: translateY(3px); box-shadow: 0 1px 0 #C2412A; }
.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1.5px solid currentColor;
}
.btn-sm { min-height: 42px; padding: 0 18px; font-size: 0.95rem; border-radius: var(--radius-sm); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(520px 420px at 22% 48%, rgba(124, 58, 237, 0.42), transparent 70%),
    var(--night);
  color: var(--milk);
  padding-block: clamp(40px, 6vw, 80px) clamp(88px, 9vw, 128px);
}
.hero::after {
  /* حافة متموجة تنقل الصفحة من الليل إلى الحليبي */
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 32px;
  background: var(--milk);
  -webkit-mask: radial-gradient(16px 16px at 16px 0, transparent 98%, #000) repeat-x 0 0 / 32px 32px;
          mask: radial-gradient(16px 16px at 16px 0, transparent 98%, #000) repeat-x 0 0 / 32px 32px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  margin: 0 0 var(--s4);
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: rgba(255, 245, 236, 0.08);
  font-size: 0.92rem;
  color: var(--on-night-soft);
}
.hero-kicker svg { width: 22px; height: 22px; }

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.2rem, 7.4vw, 6.4rem);
  line-height: 1.1;
  margin: 0 0 var(--s4);
}
.hero h1 span { display: block; }
.hero-lede {
  max-width: 30em;
  margin: 0 0 var(--s5);
  font-size: 1.15rem;
  color: var(--on-night-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--s3);
}

/* دخول غرفة بكود */
.join { flex: 0 1 340px; }
.join-row {
  display: flex;
  align-items: center;
  gap: var(--s1);
  height: 58px;
  padding: 5px;
  border-radius: 16px;
  background: var(--night-2);
  border: 1.5px dashed rgba(255, 245, 236, 0.3);
}
.join-row:focus-within { border-style: solid; border-color: var(--butter); }
.join-prefix {
  padding-inline: 10px 2px;
  font-size: 0.9rem;
  white-space: nowrap;
  color: var(--on-night-soft);
}
.join input {
  flex: 1;
  width: 0;
  min-width: 0;
  height: 100%;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--milk);
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  text-align: center;
  direction: ltr;
}
.join input::placeholder { color: rgba(255, 245, 236, 0.25); }
.join input:focus-visible { outline: none; }
.join input[aria-invalid="true"] { color: var(--coral); }
.join button {
  height: 100%;
  padding: 0 var(--s3);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--butter);
  color: var(--night);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.join-status {
  margin: var(--s1) 0 0;
  font-size: 0.92rem;
  color: var(--butter);
}
.join-status:empty { display: none; }

/* مشهد التجمع: غرفة صوتية + شاشة الغرفة + جوال لاعب */
.scene {
  position: relative;
  width: 100%;
  max-width: 500px;
  justify-self: center;
  padding-bottom: 40px;
}

.voice {
  width: 88%;
  margin-inline-start: auto;
  padding: var(--s3) var(--s3) 56px;
  border-radius: var(--radius-lg);
  background: var(--night-3);
  border: 1px solid var(--line-dark);
}
.voice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  margin-bottom: var(--s3);
  font-size: 0.85rem;
  color: var(--on-night-soft);
}
.voice-head b { font-weight: 600; color: var(--milk); }
.voice-on {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.voice-on::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.seats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--s1);
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}
.seat {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 6px;
  border-radius: 50%;
  font-weight: 700;
  color: var(--night);
}
.seat svg {
  position: absolute;
  bottom: -4px;
  inset-inline-end: -4px;
  width: 20px;
  height: 20px;
  padding: 3px;
  border-radius: 50%;
  background: var(--night);
}
.seats small { display: block; font-size: 0.75rem; color: var(--on-night-soft); }
.seats .is-talking .seat { box-shadow: 0 0 0 3px var(--night-3), 0 0 0 5px var(--green); }

.room {
  position: relative;
  z-index: 1;
  width: 72%;
  margin: -40px 0 0;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--milk);
  color: var(--ink);
  transform: rotate(-3deg);
  box-shadow: 12px 14px 0 var(--grape);
}
.room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  margin-bottom: var(--s2);
  font-size: 0.92rem;
}
.room-title { font-weight: 600; }
.room-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(34, 181, 115, 0.12);
  font-size: 0.8rem;
  color: #147A4C;
}
.room-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.room-qr {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: var(--s3);
  border-radius: var(--radius-md);
  background: #fff;
}
.room-qr svg { display: block; width: 100%; height: auto; }
.room-code {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: var(--s2);
  direction: ltr;
}
.room-code span {
  display: grid;
  place-items: center;
  height: 52px;
  padding-top: 6px;
  border-radius: 10px;
  background: var(--night);
  color: var(--butter);
  font-family: var(--display);
  font-size: 1.9rem;
  line-height: 1;
}

.phone {
  position: absolute;
  z-index: 2;
  bottom: 0;
  inset-inline-end: 0;
  width: 150px;
  padding: 10px;
  border-radius: 26px;
  background: var(--night);
  border: 2px solid var(--night-3);
  transform: rotate(7deg);
  box-shadow: 0 18px 40px rgba(10, 3, 24, 0.5);
}
.phone-screen {
  padding: var(--s2) 10px;
  border-radius: 18px;
  background: var(--milk);
  color: var(--ink);
  text-align: center;
}
.phone-screen p { margin: 0 0 var(--s1); font-size: 0.78rem; font-weight: 600; line-height: 1.4; }
.phone-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.phone-answers span {
  display: grid;
  place-items: center;
  height: 38px;
  border-radius: 10px;
  font-weight: 700;
  color: var(--night);
}
.phone-answers span:nth-child(1) { background: var(--coral); }
.phone-answers span:nth-child(2) { background: var(--butter); }
.phone-answers span:nth-child(3) { background: var(--grape-soft); }
.phone-answers span:nth-child(4) { background: #7FDDB4; }

/* الحركة الوحيدة عند فتح الصفحة: الأصدقاء يدخلون الغرفة الصوتية واحدا بعد الآخر */
@media (prefers-reduced-motion: no-preference) {
  .seats li {
    animation: join-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
    animation-delay: calc(0.5s + var(--i) * 0.35s);
  }
  .seats .is-talking .seat { animation: talk 1.4s ease-in-out 3s infinite; }
}
@keyframes join-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.6); }
  to { opacity: 1; transform: none; }
}
@keyframes talk {
  50% { box-shadow: 0 0 0 3px var(--night-3), 0 0 0 8px rgba(34, 181, 115, 0.35); }
}

/* ---------- Sections ---------- */

.section { padding-block: var(--section); }
.section-head {
  max-width: 36em;
  margin-bottom: var(--s6);
}
.section-head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 3.8vw, 2.9rem);
  line-height: 1.25;
  margin: 0 0 var(--s1);
}
.section-head p { margin: 0; font-size: 1.1rem; color: var(--ink-soft); }

/* الخطوات: تسلسل حقيقي فالأرقام لها معنى */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: var(--s1);
  padding: var(--s5) var(--s4);
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1.5px solid var(--line-light);
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--s2);
  padding-top: 4px;
  border-radius: 18px;
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1;
}
.steps li:nth-child(1)::before { background: var(--grape); color: var(--milk); }
.steps li:nth-child(2)::before { background: var(--coral); color: var(--night); }
.steps li:nth-child(3)::before { background: var(--butter); color: var(--night); }
.steps h3 { margin: 0; font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
.steps p { margin: 0; color: var(--ink-soft); }

/* فئات الألعاب */
.kinds-section { padding-top: 0; }
.kinds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
}
.kind {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--s1);
  min-height: 270px;
  padding: var(--s5) var(--s4) var(--s4);
  border-radius: var(--radius-lg);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.18s ease;
}
.kind:hover { transform: translateY(-4px); }
.kind svg {
  position: absolute;
  top: var(--s4);
  inset-inline-end: var(--s4);
  width: 84px;
  height: 84px;
}
.kind-name {
  font-family: var(--display);
  font-size: 2.6rem;
  line-height: 1.1;
}
.kind p { margin: 0; max-width: 26ch; }
.kind-go {
  margin-top: var(--s2);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.kind--speed { background: var(--coral); color: var(--night); }
.kind--luck { background: var(--butter); color: var(--night); }
.kind--smarts { background: var(--grape); color: var(--milk); }

/* أماكن اللعب */
.places {
  background: var(--grape);
  color: var(--milk);
}
.places .section-head p { color: rgba(255, 245, 236, 0.85); }
.place-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.place {
  display: grid;
  align-content: start;
  gap: var(--s1);
  padding: var(--s4);
  border-radius: var(--radius-md);
  background: rgba(30, 11, 58, 0.28);
}
.place svg { width: 36px; height: 36px; margin-bottom: var(--s1); }
.place h3 { margin: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.4; }
.place p { margin: 0; font-size: 0.95rem; color: rgba(255, 245, 236, 0.82); }

.live-note {
  display: grid;
  justify-items: center;
  gap: var(--s1);
  margin-top: var(--s4);
  padding: var(--s5) var(--s4);
  border-radius: var(--radius-lg);
  background: var(--milk);
  color: var(--ink);
  text-align: center;
}
.live-note svg { width: 56px; height: 56px; margin-bottom: var(--s1); }
.live-note h3 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.live-note p { margin: 0; color: var(--ink-soft); max-width: 52ch; }

/* الأسئلة */
.faq .wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: var(--s6);
  align-items: start;
}
.faq .section-head { margin-bottom: 0; }
.faq-list { display: grid; gap: var(--s2); }
.faq details {
  border-radius: var(--radius-md);
  background: #fff;
  border: 1.5px solid var(--line-light);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    linear-gradient(var(--night), var(--night)) center / 12px 2px no-repeat,
    linear-gradient(var(--night), var(--night)) center / 2px 12px no-repeat,
    var(--butter);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 var(--s4) var(--s4); color: var(--ink-soft); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--night);
  color: var(--on-night-soft);
  font-size: 0.95rem;
}
.footer-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding-block: var(--s6);
}
.footer-brand { display: grid; justify-items: start; gap: var(--s1); }
.footer-brand p { margin: 0; }
.footer-mail {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 10px 20px 10px 14px;
  border-radius: var(--radius-md);
  background: var(--night-2);
  border: 1px solid var(--line-dark);
  color: var(--milk);
  text-decoration: none;
}
.footer-mail svg {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 12px;
  background: var(--coral);
  color: var(--night);
}
.footer-mail span { display: grid; line-height: 1.4; }
.footer-mail small { font-size: 0.8rem; color: var(--on-night-soft); }
.footer-mail bdi { font-weight: 600; }
.footer-mail:hover { border-color: rgba(255, 245, 236, 0.35); }

/* الارتباط بـ Q Live: صغير وفي المنتصف */
.footer-family {
  display: grid;
  justify-items: center;
  gap: var(--s2);
  padding-block: var(--s4) var(--s5);
  border-top: 1px solid var(--line-dark);
  text-align: center;
}
.family-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 6px 16px 6px 6px;
  border-radius: 999px;
  background: rgba(255, 245, 236, 0.06);
  border: 1px solid var(--line-dark);
  font-size: 0.88rem;
  text-decoration: none;
}
.family-link img {
  width: 96px;
  height: auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
}
.family-link:hover { color: var(--milk); border-color: rgba(255, 245, 236, 0.35); }
.footer-family small { font-size: 0.8rem; opacity: 0.7; }

/* ---------- Games page ---------- */

.page-head {
  background: var(--night);
  color: var(--milk);
  padding-block: clamp(40px, 6vw, 64px) var(--s5);
}
.page-head h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  line-height: 1.15;
  margin: 0 0 var(--s1);
}
.page-head p { margin: 0 0 var(--s5); max-width: 36em; color: var(--on-night-soft); }

.search {
  position: relative;
  display: block;
  max-width: 420px;
}
.search svg {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  opacity: 0.55;
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 46px;
  padding-inline: 42px 14px;
  border: 1.5px solid var(--line-dark);
  border-radius: 14px;
  background: var(--night-2);
  color: var(--milk);
}
.search input::placeholder { color: rgba(255, 245, 236, 0.5); }

/* شريط الفلاتر: يلتصق تحت الناف بار */
.filter-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  background: var(--milk);
  border-bottom: 1.5px solid var(--line-light);
}
.filter-bar .wrap {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding-block: var(--s2);
}
.chips {
  display: flex;
  gap: var(--s1);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 var(--s3);
  border: 1.5px solid var(--line-light);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.95rem;
  white-space: nowrap;
  cursor: pointer;
}
.chip:hover { border-color: rgba(30, 11, 58, 0.3); }
.chip[aria-pressed="true"] {
  background: var(--night);
  border-color: var(--night);
  color: var(--milk);
  font-weight: 600;
}
.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s1) var(--s3);
  padding-top: var(--s4);
}
.result-count { font-size: 0.92rem; color: var(--ink-soft); }
/* رسالة قصيرة أسفل الشاشة بعد الضغط على ابدأ */
.games-status {
  position: fixed;
  z-index: 30;
  bottom: var(--s4);
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: var(--s2) var(--s4);
  border-radius: 999px;
  background: var(--night);
  color: var(--milk);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 10px 30px rgba(30, 11, 58, 0.3);
}
.games-status:empty { display: none; }

.games-area { padding-block: var(--s3) var(--section); }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--s4);
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: #fff;
  border: 1.5px solid var(--line-light);
  overflow: hidden;
}
.game-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(circle at 50% 55%, rgba(255, 245, 236, 0.28) 0 34%, transparent 35%),
    var(--tone);
}
.game-card[data-kind="speed"] { --tone: var(--coral); }
.game-card[data-kind="luck"] { --tone: var(--butter); }
.game-card[data-kind="smarts"] { --tone: var(--grape); }
.game-icon { width: 48%; height: auto; }
.game-cover .badge {
  position: absolute;
  top: var(--s2);
  inset-inline-start: var(--s2);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--milk);
  color: var(--night);
  font-size: 0.8rem;
  font-weight: 600;
}
.game-body { display: flex; flex-direction: column; gap: 6px; padding: 18px; flex: 1; }
.game-body h3 { margin: 0; font-size: 1.2rem; font-weight: 600; line-height: 1.4; }
.game-body p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }
.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: var(--s2);
  border-top: 1.5px dashed var(--line-light);
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.game-players { display: inline-flex; align-items: center; gap: 6px; }
.game-players svg { width: 18px; height: 18px; }
.game-meta .btn { min-height: 40px; padding: 0 26px; font-size: 0.95rem; border-radius: 999px; }

.no-results {
  grid-column: 1 / -1;
  padding: var(--s5);
  border-radius: var(--radius-lg);
  background: var(--butter);
  text-align: center;
}
.no-results h2 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 600; }
.no-results p { margin: 0; }
.no-results button {
  margin-top: var(--s3);
  min-height: 42px;
  padding: 0 18px;
  border: 1.5px solid var(--night);
  border-radius: var(--radius-sm);
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .site-nav { gap: var(--s3); }
  .site-nav a { font-size: 0.92rem; }
}

@media (max-width: 1020px) {
  :root { --header-h: 68px; }
  .site-header .wrap { grid-template-columns: 1fr auto; }
  .site-header .brand-logo { width: 110px; height: 44px; }
  .menu-toggle { display: grid; }
  .site-header .wrap { gap: var(--s3); }
  /* قائمة الجوال: لوحة تحت الشريط، صفوف كبيرة سهلة اللمس، وأزرار الدخول في الأسفل */
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    padding: var(--s2) var(--gutter) var(--s4);
    background: var(--night);
    border-bottom: 1px solid var(--line-dark);
    box-shadow: 0 24px 40px rgba(10, 3, 24, 0.45);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) {
    display: flex;
    align-items: center;
    gap: var(--s2);
    min-height: 52px;
    padding: 0 var(--s2);
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
  }
  .site-nav a:not(.btn):hover { background: var(--night-2); }
  .site-nav svg { display: block; flex: 0 0 22px; width: 22px; height: 22px; opacity: 0.8; }
  .site-nav a::after { display: none; }
  .site-nav a[aria-current] { background: var(--night-2); color: var(--coral); }
  .site-nav a[aria-current] svg { opacity: 1; }
  .nav-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s2);
    margin-top: var(--s2);
    padding-top: var(--s3);
    border-top: 1px solid var(--line-dark);
  }
  .nav-actions .btn { min-height: 50px; padding: 0 var(--s2); font-size: 1rem; }
  .site-nav .nav-actions .btn-coral { color: var(--night); }
  .site-nav .nav-actions .btn-ghost { color: var(--milk); border-color: var(--line-dark); }
  .menu-toggle[aria-expanded="true"] { background: var(--night-2); }

  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .scene { max-width: 460px; }
  .place-grid { grid-template-columns: repeat(2, 1fr); }
  .faq .wrap { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
}

@media (max-width: 760px) {
  .header-end .btn { min-height: 40px; padding: 0 14px; font-size: 0.9rem; }
  .steps, .kinds { grid-template-columns: 1fr; }
  .steps { gap: var(--s2); }
  .steps li {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: var(--s3);
    row-gap: 2px;
    padding: var(--s3) var(--s4);
  }
  .steps li::before { grid-row: span 2; align-self: center; width: 48px; height: 48px; margin: 0; font-size: 1.7rem; }
  .kind { min-height: 190px; }
  .kind svg { width: 64px; height: 64px; }
  .live-note { padding: var(--s4); }
}

/* صفحة الألعاب على الجوال: كل لعبة صف مدمج (أيقونة، اسم، زر ابدأ) مثل قوائم التطبيقات */
@media (max-width: 640px) {
  .page-head { padding-block: var(--s4); }
  .page-head h1 { font-size: 2.3rem; margin-bottom: 4px; }
  .page-head p { margin-bottom: var(--s3); font-size: 0.95rem; }
  .search { max-width: none; }
  .filter-bar .wrap { gap: var(--s1); padding-block: 10px; }
  .chip { min-height: 36px; padding: 0 14px; font-size: 0.9rem; }
  .list-head { padding-top: var(--s3); }

  /* فئة واحدة: شبكة من عمودين */
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

  /* الكل: رف لكل فئة يتسحب بالعرض، فطول الصفحة ثابت مهما زادت الألعاب */
  .games-grid.is-shelves { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .shelf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s2);
    margin-bottom: var(--s2);
  }
  .shelf-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1.2; }
  .shelf-head button {
    min-height: 36px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--grape);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
  }
  .shelf-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 44%;
    gap: 10px;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    padding-bottom: 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .shelf-row::-webkit-scrollbar { display: none; }
  .shelf-row .game-card { scroll-snap-align: start; }

  /* البطاقة المدمجة */
  .game-card { border-radius: 18px; }
  .game-cover { aspect-ratio: 16 / 11; }
  .game-cover .badge { display: none; }
  .game-icon { width: 50%; }
  .game-body { gap: 2px; padding: 10px; }
  .game-body h3 { font-size: 0.98rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .game-body p { display: none; }
  .game-meta { flex-direction: column; align-items: stretch; gap: var(--s1); padding-top: 0; border-top: 0; font-size: 0.8rem; }
  .game-players svg { width: 14px; height: 14px; }
  .game-meta .btn { min-height: 36px; padding: 0; font-size: 0.92rem; }
}

@media (max-width: 350px) {
  .header-end .btn { display: none; }
}

/* الهيرو على الجوال: كل شيء بعرض الشاشة والمشهد مصغر بدون الجوال الطائر */
@media (max-width: 560px) {
  .hero { padding-block: var(--s5) 88px; }
  .hero-grid > :first-child { text-align: center; }
  .hero-lede { margin-inline: auto; }
  .join-prefix { padding-inline: 12px 0; }
  .hero-kicker { margin-bottom: var(--s3); font-size: 0.85rem; }
  .hero h1 { font-size: clamp(2.9rem, 14vw, 3.8rem); margin-bottom: var(--s3); }
  .hero-lede { font-size: 1.02rem; margin-bottom: var(--s4); }
  .hero-actions { flex-direction: column; align-items: stretch; gap: var(--s2); }
  .hero-actions .btn { width: 100%; }
  .join { flex-basis: auto; }
  .scene { padding-bottom: 0; margin-top: var(--s2); }
  .voice { width: 100%; padding-bottom: 52px; }
  .seat { width: 40px; height: 40px; }
  /* شاشة المضيف تتحول لشريط صغير: QR مصغر بجانب الكود بدل بطاقة كبيرة */
  .room {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: var(--s3);
    row-gap: var(--s1);
    align-items: center;
    width: 92%;
    margin-inline: auto;
    padding: var(--s2);
    transform: rotate(-1.5deg);
    box-shadow: 6px 8px 0 var(--grape);
    border-radius: var(--radius-md);
  }
  .room-head { grid-column: 2; margin: 0; font-size: 0.85rem; white-space: nowrap; }
  /* على الشاشة الضيقة تبقى النقطة الخضراء وحدها */
  .room-live { gap: 0; padding: 4px; font-size: 0; }
  .room-live::before { width: 8px; height: 8px; }
  .room-qr { grid-column: 1; grid-row: 1 / 3; padding: 6px; border-radius: 12px; }
  .room-code { grid-column: 2; margin: 0; gap: 5px; }
  .room-code span { height: 38px; padding-top: 4px; border-radius: 8px; font-size: 1.35rem; }
  .phone { display: none; }
  .place-grid { grid-template-columns: 1fr; }
  .place { grid-template-columns: auto 1fr; column-gap: var(--s3); }
  .place svg { grid-row: span 2; margin-bottom: 0; }
  .footer-main { flex-direction: column; text-align: center; padding-block: var(--s5); }
  .footer-brand { justify-items: center; }
  .family-link { flex-direction: column; padding: var(--s2) var(--s3); border-radius: var(--radius-md); }
}
