/* ===== مكتبة الألعاب — showroom page (inherits the site identity from style.css) ===== */

.lib-page {
  min-height: 100svh;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(115deg, rgba(0,0,0,.18), rgba(0,0,0,.54)),
    radial-gradient(circle at 78% 8%, rgba(124, 92, 246, .12), transparent 30%),
    #060312;
}
.lib-page .grid-layer,
.lib-page .glow,
.lib-page .vignette { position: fixed; }
.lib-page .vignette { z-index: -1; }

.back-pill {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid rgba(185, 165, 255, .35);
  color: #c5bce6;
  font-weight: 800;
  font-size: 14px;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}
.back-pill:hover {
  color: #0c0722;
  background: linear-gradient(180deg, var(--accent-soft), #7a5cf0);
  border-color: transparent;
  transform: translateY(-2px);
}
.back-pill:focus-visible { outline: 3px solid #ded5ff; outline-offset: 3px; }

.lib-wrap {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding-bottom: 30px;
}

/* --- header: gallery-style, the hero's type treatment --- */
.lib-head { text-align: center; margin: clamp(4px, 2vh, 26px) 0 clamp(28px, 4vh, 44px); }
.lib-eyebrow {
  margin: 0;
  color: #c5bce6;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .5px;
  word-spacing: 4px;
}
.lib-title {
  margin: 2px 0 0;
  font-family: 'Baloo Bhaijaan 2', 'Cairo', sans-serif;
  font-weight: 800;
  font-size: clamp(58px, 9vw, 118px);
  line-height: 1.05;
  color: var(--accent);
  text-shadow:
    0 6px 0 rgba(70, 45, 170, .35),
    0 16px 40px rgba(0,0,0,.48),
    0 0 28px rgba(var(--accent-rgb), .18);
}
.lib-sub {
  margin: 10px 0 0;
  color: #d6d0e8;
  font-weight: 800;
  font-size: clamp(13px, 1.6vw, 17px);
}
.lib-sub span { color: var(--accent); }

/* --- featured flagship card --- */
.featured { margin-bottom: 22px; }
.f-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  min-height: 280px;
  padding: clamp(24px, 3.4vw, 44px);
  border-radius: 30px;
  overflow: hidden;
  background: linear-gradient(180deg, #120d26, #0b0719);
  border: 1px solid rgba(185, 165, 255, .16);
  box-shadow: 0 30px 70px rgba(0,0,0,.45);
}
.f-card::before {
  content: "";
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), .55);
}
.f-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px at 22% 80%, rgba(var(--accent-rgb), .08), transparent 65%);
  pointer-events: none;
}
.f-info { position: relative; z-index: 1; text-align: right; }
.f-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), .09);
  border: 1px solid rgba(var(--accent-rgb), .3);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 900;
}
.f-title {
  margin: 14px 0 0;
  font-family: 'Baloo Bhaijaan 2', 'Cairo', sans-serif;
  font-weight: 800;
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 6px 24px rgba(0,0,0,.5);
}
.f-desc {
  margin: 10px 0 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: clamp(13px, 1.5vw, 15.5px);
  font-weight: 700;
  line-height: 1.9;
}
.f-play {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 13px 30px;
  border-radius: 999px;
  color: #0c0722;
  font-family: 'Baloo Bhaijaan 2', 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 19px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--accent) 48%, #6a4de6 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .6),
    inset 0 -5px 0 rgba(38, 20, 105, .28),
    0 14px 34px rgba(0, 0, 0, .4),
    0 0 28px rgba(var(--accent-rgb), .35);
  transition: transform .22s cubic-bezier(.2, .9, .3, 1.25), box-shadow .22s ease;
}
.f-play:hover { transform: translateY(-3px); box-shadow: inset 0 2px 0 rgba(255,255,255,.7), inset 0 -5px 0 rgba(38,20,105,.3), 0 18px 42px rgba(0,0,0,.5), 0 0 40px rgba(var(--accent-rgb), .55); }
.f-play:focus-visible { outline: 3px solid #ded5ff; outline-offset: 4px; }
.f-emblem {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.f-emblem svg {
  width: clamp(150px, 17vw, 220px);
  height: clamp(150px, 17vw, 220px);
  color: var(--accent);
  filter: drop-shadow(0 0 26px rgba(var(--accent-rgb), .35));
  animation: emblemTurn 26s linear infinite;
}
@keyframes emblemTurn { to { transform: rotate(360deg); } }

/* --- the grid --- */
.g-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 18px;
}
.g-card {
  --mx: 50%;
  --my: 30%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 208px;
  padding: 24px 22px 20px;
  border-radius: 22px;
  overflow: hidden;
  text-align: right;
  background: linear-gradient(180deg, #100b22, #0a0718);
  border: 1px solid var(--line);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.g-card::before {
  content: "";
  position: absolute;
  top: 0; left: 18%; right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), .55), transparent);
  opacity: 0;
  transition: opacity .25s ease;
}
/* the signature: pointer spotlight */
.g-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(240px at var(--mx) var(--my), rgba(var(--accent-rgb), .11), transparent 62%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.g-card:hover, .g-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(185, 165, 255, .4);
  box-shadow: 0 22px 48px rgba(0,0,0,.5), 0 0 30px rgba(var(--accent-rgb), .12);
}
.g-card:hover::before, .g-card:hover::after,
.g-card:focus-visible::before, .g-card:focus-visible::after { opacity: 1; }
.g-card:focus-visible { outline: 3px solid #ded5ff; outline-offset: 3px; }
.g-card { --card: var(--accent); }   /* لون البطاقة من الباليت — أحادي عندنا · متعدّد في Tailwind */
.g-card:nth-child(6n+1) { --card: var(--pal-1); }
.g-card:nth-child(6n+2) { --card: var(--pal-2); }
.g-card:nth-child(6n+3) { --card: var(--pal-3); }
.g-card:nth-child(6n+4) { --card: var(--pal-4); }
.g-card:nth-child(6n+5) { --card: var(--pal-5); }
.g-card:nth-child(6n+6) { --card: var(--pal-6); }
.g-ic {
  display: inline-flex;
  width: 52px; height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: color-mix(in srgb, var(--card) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--card) 24%, transparent);
  color: var(--card);
  transition: transform .25s ease;
}
.g-ic svg { width: 30px; height: 30px; }
.g-card:hover .g-ic { transform: scale(1.08); }
.g-t {
  margin: 2px 0 0;
  font-family: 'Baloo Bhaijaan 2', 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 21px;
  color: #fff;
}
.g-d {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.8;
  flex: 1;
}
.g-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.g-cat {
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: #c5bce6;
  font-size: 11.5px;
  font-weight: 800;
}
.g-go {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}
.g-card:hover .g-go, .g-card:focus-visible .g-go { opacity: 1; transform: none; }

/* coming-soon card */
.g-card--soon { border-style: dashed; border-color: rgba(255,255,255,.14); }
.g-card--soon .g-ic { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); color: var(--muted); }
.g-card--soon .g-t { color: var(--muted); }
.g-card--soon:hover { transform: none; box-shadow: none; border-color: rgba(255,255,255,.2); }

/* footer flows after content on this page (it's absolute inside the hero) */
.lib-page .footer { position: relative; margin-top: 56px; }

@media (hover: none) {
  .g-go { opacity: 1; transform: none; }
}

@media (max-width: 820px) {
  .lib-wrap { width: calc(100% - 36px); }
  .f-card { grid-template-columns: 1fr; text-align: center; min-height: 0; gap: 18px; }
  .f-info { text-align: center; }
  .f-desc { margin-inline: auto; }
  .f-emblem svg { width: 130px; height: 130px; }
  .g-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
}
