/*
 * Hayya theme — visual layer based on the "new UI UX" design proposal.
 * Loaded last so it overrides earlier stylesheets. Re-skins existing
 * markup (no structural rewrite) by retargeting class names already in
 * use in templates: .screens-nav, .nav-tab, .btn, .feature-card, etc.
 */

:root {
  --gold: #c9a961;
  --gold-bright: #ffd700;
  --gold-deep: #8a6d2e;
  --red: #8b2635;
  --red-bright: #dc283c;
  --blue: #1b4965;
  --emerald: #1f4d3a;
  --felt-dark: #123226;
  --ivory: #fff8e7;
  --sand: #e8dcc4;
  --midnight: #10111f;
  --midnight-deep: #070812;
  --panel: rgba(9, 12, 20, .78);
  --line: rgba(201, 169, 97, .32);
  --line-soft: rgba(201, 169, 97, .16);
  --shadow: 0 24px 70px rgba(0, 0, 0, .55);
}

html { scroll-behavior: smooth; }

body {
  background: var(--midnight-deep) !important;
  color: var(--ivory);
  font-family: Cairo, system-ui, sans-serif;
  overflow-x: hidden;
  position: relative;
  /* iPhone notch / dynamic island: with `viewport-fit=cover` in the
     meta tag the viewport extends edge-to-edge under the notch, so
     content placed at the visual right edge (where RTL text
     anchors) ends up partially under the bezel — surfaces to the
     user as "UI shifted to the left." Padding-inline keeps the
     content inside the safe area on iOS; the env() values resolve
     to 0 on every non-iOS browser so nothing changes there. */
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Site background — orbs + grid (no markup needed) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 20%, rgba(139, 38, 53, .42), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(201, 169, 97, .18), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(31, 77, 58, .3), transparent 34%),
    linear-gradient(135deg, #06070e, #10111f 42%, #05060b);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 215, 0, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 215, 0, .035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 45%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, black, transparent 80%);
  opacity: .25;
}

/* Floating orbs (decorative, injected on home only) */
.hayya-orbs { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.hayya-orbs .orb {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(45px);
  opacity: .4;
  animation: hayyaFloatOrb 12s ease-in-out infinite;
}
.hayya-orbs .orb-red { background: rgba(220, 40, 60, .4); top: 10%; left: 8%; }
.hayya-orbs .orb-gold { background: rgba(255, 215, 0, .22); top: 40%; right: 4%; animation-delay: -5s; }
.hayya-orbs .orb-green { background: rgba(31, 77, 58, .55); bottom: -6%; left: 30%; animation-delay: -9s; }
@keyframes hayyaFloatOrb {
  50% { transform: translate3d(18px, -24px, 0) scale(1.08); }
}

/* ================ TOPBAR / NAV ================ */
.screens-nav {
  position: sticky;
  top: 14px;
  z-index: 20;
  width: min(1240px, calc(100% - 28px));
  margin: 14px auto 0 !important;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 16px !important;
  border: 1px solid var(--line) !important;
  border-radius: 22px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018)),
    rgba(6, 8, 14, .82) !important;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow) !important;
}

.screens-nav .nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  min-height: 44px;
}

.screens-nav .brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--red-bright);
  border: 1px solid rgba(255, 215, 0, .35);
  background: radial-gradient(circle, rgba(255, 215, 0, .22), transparent 62%), rgba(0,0,0,.24);
  box-shadow: inset 0 0 20px rgba(255, 215, 0, .12), 0 0 16px rgba(220, 40, 60, .16);
}

.screens-nav .brand-name {
  font-family: "Reem Kufi", Cairo, sans-serif;
  font-size: 1.35rem;
  color: var(--gold-bright);
  line-height: 1;
}

.screens-nav .brand-sub {
  color: rgba(255, 248, 231, .55);
  font-size: .72rem;
}

.screens-nav .nav-tabs {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.screens-nav .nav-tab {
  position: relative;
  padding: 10px 14px !important;
  color: rgba(255, 248, 231, .72) !important;
  border-radius: 999px !important;
  font-size: .92rem;
  background: transparent !important;
  border: 0 !important;
  transition: .2s ease;
}

.screens-nav .nav-tab:hover,
.screens-nav .nav-tab.active {
  color: var(--gold-bright) !important;
  background: rgba(255, 215, 0, .07) !important;
}

.screens-nav .nav-tab.active::after {
  content: "";
  position: absolute;
  right: 16px;
  left: 16px;
  bottom: 3px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}

.screens-nav .nav-tab.nav-user {
  color: var(--gold) !important;
  font-weight: 700;
}

.screens-nav .nav-toggle {
  border: 1px solid rgba(201, 169, 97, .3);
  color: var(--sand);
  background: rgba(0,0,0,.2);
  border-radius: 999px;
  padding: 0;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: none;
}
.screens-nav .nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--gold);
}

/* Standalone notification bell. Lives on the top bar at every width
   (never inside the collapsible .nav-tabs drawer) so notifications
   stay one tap away on mobile. 44px circular tap target; the unread
   badge floats at the corner with a ring so it reads off the dark
   nav background. */
.screens-nav .nav-bell {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(201, 169, 97, .3);
  background: rgba(0, 0, 0, .2);
  color: var(--gold-bright);
  font-size: 1.15rem;
  line-height: 1;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .12s ease;
}
.screens-nav .nav-bell:hover,
.screens-nav .nav-bell:focus-visible {
  background: rgba(255, 215, 0, .12);
  border-color: rgba(255, 215, 0, .5);
  outline: none;
}
.screens-nav .nav-bell[aria-expanded="true"] {
  background: rgba(255, 215, 0, .14);
  border-color: rgba(255, 215, 0, .55);
}
.screens-nav .nav-bell:active { transform: scale(.94); }
.screens-nav .nav-bell .nav-bell-ico { pointer-events: none; }

/* Circular profile crest — replaces the old name+avatar tile. 44px
   tap target, gold-rimmed, brand hexagon centred. Clicking opens the
   user's own profile. Mirrors the bell's shape so the nav reads as a
   consistent set of round controls. */
.screens-nav .nav-profile-circle {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(201, 169, 97, .35);
  background: rgba(0, 0, 0, .22);
  overflow: hidden;
  padding: 0;
  text-decoration: none;
  transition: border-color .2s ease, transform .12s ease, box-shadow .2s ease;
}
.screens-nav .nav-profile-circle:hover,
.screens-nav .nav-profile-circle:focus-visible {
  border-color: rgba(255, 215, 0, .6);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, .25);
  outline: none;
}
.screens-nav .nav-profile-circle:active { transform: scale(.94); }
/* The user's own profile picture fills the circle. object-fit:cover
   keeps any aspect ratio from distorting. */
.screens-nav .nav-profile-circle-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
  pointer-events: none;
}
.screens-nav .nav-bell .nav-bell-badge {
  position: absolute;
  top: -3px;
  inset-inline-end: -3px;
  margin: 0;
  box-shadow: 0 0 0 2px rgba(6, 8, 14, .92);
}

@media (max-width: 760px) {
  .screens-nav { flex-wrap: wrap; top: 8px; }
  .screens-nav .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-right: auto;
  }
  .screens-nav .nav-tabs {
    display: none;
    order: 5;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-top: 8px;
    padding: 10px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
      rgba(6, 8, 14, .96);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(0,0,0,.5);
    backdrop-filter: blur(14px);
  }
  .screens-nav.open .nav-tabs { display: flex; }
  .screens-nav .nav-tabs .nav-tab {
    width: 100%;
    text-align: right;
    padding: 12px 16px !important;
    border-radius: 14px !important;
    color: var(--ivory) !important;
    background: rgba(0,0,0,.3) !important;
    border: 1px solid var(--line-soft) !important;
    font-size: 1rem !important;
    font-weight: 700;
  }
  .screens-nav .nav-tabs .nav-tab:hover,
  .screens-nav .nav-tabs .nav-tab.active {
    color: var(--gold-bright) !important;
    background: linear-gradient(180deg, rgba(255, 215, 0, .14), rgba(201, 169, 97, .06)) !important;
    border-color: rgba(255, 215, 0, .5) !important;
  }
  .screens-nav .nav-tabs .nav-tab.active::after { display: none; }
  .screens-nav .nav-tabs .nav-user {
    background: rgba(255, 215, 0, .08) !important;
    color: var(--gold) !important;
  }
}

/* ================ BUTTONS ================ */
.btn {
  border: 0;
  cursor: pointer;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 800;
  transition: .2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.btn-primary,
.btn.btn-primary,
.btn.primary {
  color: #15101c !important;
  background: linear-gradient(135deg, #ffe89a, var(--gold-bright) 30%, var(--gold) 68%, #8a6d2e) !important;
  border: 1px solid rgba(255, 248, 231, .45) !important;
  box-shadow: 0 16px 36px rgba(255, 215, 0, .18) !important;
}

.btn-ghost,
.btn.btn-ghost,
.btn.ghost {
  color: var(--ivory) !important;
  background: rgba(0,0,0,.22) !important;
  border: 1px solid rgba(201, 169, 97, .28) !important;
}

.btn-primary:hover,
.btn-ghost:hover,
.btn.btn-primary:hover,
.btn.btn-ghost:hover { transform: translateY(-2px); }

.btn-block, .btn.btn-block, .btn.block { width: 100%; }
.btn-lg { min-height: 56px; padding: 14px 28px; font-size: 1.05rem; }

/* ================ HOME (new hayya hero) ================ */
.hayya-home { width: min(1240px, calc(100% - 28px)); margin: 22px auto 70px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-weight: 700;
  margin: 0 0 12px;
}
.eyebrow > .dot,
.eyebrow > span:first-child:not(:only-child) {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--red-bright);
  box-shadow: 0 0 16px rgba(220, 40, 60, .8);
  display: inline-block;
}

.home-layout {
  min-height: 650px;
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  gap: 38px;
  align-items: center;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)),
    radial-gradient(circle at 32% 55%, rgba(139, 38, 53, .25), transparent 38%),
    rgba(5, 7, 13, .72);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.home-layout::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 215, 0, .13);
  border-radius: inherit;
  pointer-events: none;
}

.hero-art { position: relative; min-height: 560px; display: grid; place-items: center; }
.coffee-table {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 42%, rgba(166, 24, 38, .35), transparent 32%),
    radial-gradient(circle, rgba(255, 215, 0, .08), transparent 55%);
}
.coffee-table::before, .coffee-table::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(201, 169, 97, .18);
  border-radius: 50%;
  inset: 6%;
}
.coffee-table::after { inset: 16%; opacity: .55; }

.snake-card {
  position: relative;
  width: min(340px, 72vw);
  aspect-ratio: 5 / 7;
  border-radius: 28px;
  color: var(--red-bright);
  background:
    radial-gradient(circle at 45% 5%, rgba(255,255,255,.9), transparent 18%),
    linear-gradient(180deg, #fff8e7, #f3e7cd);
  box-shadow:
    0 30px 70px rgba(0,0,0,.65),
    0 0 0 1px rgba(255, 215, 0, .7),
    0 0 36px rgba(255, 215, 0, .26);
  transform: rotate(-7deg);
  overflow: hidden;
  animation: hayyaCardFloat 4.5s ease-in-out infinite;
}
@keyframes hayyaCardFloat {
  50% { transform: rotate(-5deg) translateY(-14px); }
}
.snake-card::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 20px;
  border: 1px solid rgba(138, 109, 46, .45);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 215, 0, .06), transparent 25%),
    repeating-linear-gradient(0deg, rgba(138,109,46,.06), rgba(138,109,46,.06) 1px, transparent 1px, transparent 6px);
}
.snake-card .corner {
  position: absolute;
  z-index: 3;
  font-weight: 800;
  color: #c5162c;
  font-size: 42px;
  line-height: .9;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: Georgia, serif;
}
.snake-card .corner span { font-size: 24px; }
.snake-card .corner.top { top: 24px; left: 24px; }
.snake-card .corner.bottom { bottom: 24px; right: 24px; transform: rotate(180deg); }
.snake-card .pip {
  position: absolute;
  z-index: 1;
  color: #d2162a;
  font-size: 56px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(115, 0, 10, .2);
}
.snake-card .pip.p1 { top: 12%; right: 24%; }
.snake-card .pip.p2 { top: 12%; left: 24%; }
.snake-card .pip.p3 { top: 30%; left: 50%; transform: translateX(-50%); }
.snake-card .pip.p4 { top: 48%; right: 24%; }
.snake-card .pip.p5 { top: 48%; left: 24%; }
.snake-card .pip.p6 { bottom: 14%; right: 24%; }
.snake-card .pip.p7 { bottom: 14%; left: 24%; }
.snake-card .snake {
  position: absolute;
  z-index: 2;
  inset: 8% 5%;
  width: 90%;
  height: 84%;
  filter: url(#hayyaSoftShadow);
}
.snake-body { fill: none; stroke: url(#hayyaSnakeGold); stroke-width: 44; stroke-linecap: round; }
.snake-belly { fill: none; stroke: rgba(255,255,255,.36); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 4 14; }
.snake-head { fill: url(#hayyaSnakeGold); stroke: #5b0610; stroke-width: 4; }
.snake-eye { fill: #3b0006; stroke: #ffd700; stroke-width: 2; }
.snake-tongue { fill: none; stroke: #b70e20; stroke-width: 4; stroke-linecap: round; }

.hero-copy { position: relative; z-index: 2; padding: 20px; }
.hero-copy h1 {
  font-family: "Reem Kufi", Cairo, sans-serif;
  color: #f3d996;
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 7rem);
  line-height: .94;
  text-shadow: 0 12px 40px rgba(255, 215, 0, .12);
}
.hero-copy h1 em { color: var(--gold-bright); font-style: normal; font-size: .62em; }
.hero-copy .lead {
  max-width: 560px;
  color: rgba(255, 248, 231, .72);
  font-size: 1.12rem;
  line-height: 1.9;
  margin: 22px 0 28px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 470px;
  margin-top: 28px;
}
.stats-strip > div {
  padding: 14px;
  text-align: center;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: rgba(0,0,0,.2);
}
.stats-strip b { display: block; font-size: 1.6rem; color: var(--gold-bright); }
.stats-strip span { color: rgba(255,248,231,.55); }

/* ================ ORIGINAL HOME (.home-grid + hayya.png) harmonized with new theme ================ */
.screen.home {
  width: min(1240px, calc(100% - 28px));
  margin: 22px auto 70px !important;
  position: relative;
}

.home-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  gap: 38px;
  align-items: center;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)),
    radial-gradient(circle at 32% 55%, rgba(139, 38, 53, .25), transparent 38%),
    rgba(5, 7, 13, .72);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.home-grid::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 215, 0, .13);
  border-radius: inherit;
  pointer-events: none;
}

.hero-title {
  font-family: "Reem Kufi", Cairo, sans-serif;
  color: #f3d996 !important;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: .96;
  margin: 14px 0 18px;
  text-shadow: 0 12px 40px rgba(255, 215, 0, .12);
}
.hero-title .line-1 { display: block; color: #f3d996; }
.hero-title .line-2 {
  display: block;
  color: var(--gold-bright);
  font-size: .65em;
  margin-top: 6px;
}

.hero-sub {
  max-width: 560px;
  color: rgba(255, 248, 231, .72) !important;
  font-size: 1.1rem;
  line-height: 1.9;
  margin: 0 0 28px;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }

.hero-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 470px;
}
.hero-stats .stat {
  flex: 1;
  padding: 14px;
  text-align: center;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: rgba(0,0,0,.2);
}
.hero-stats .stat-num {
  font-size: 1.6rem;
  color: var(--gold-bright);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.hero-stats .stat-lbl { color: rgba(255,248,231,.55); font-size: .85rem; }
.hero-stats .stat-sep {
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, transparent, rgba(201,169,97,.35), transparent);
}

.home-right { display: grid; place-items: center; min-height: 480px; position: relative; }
.hero-card-stage {
  position: relative;
  width: min(360px, 80vw);
  aspect-ratio: 5/7;
  display: grid;
  place-items: center;
}
.hero-card-stage .ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 97, .22);
  pointer-events: none;
}
.hero-card-stage .ring-1 { inset: 4%; }
.hero-card-stage .ring-2 { inset: 14%; opacity: .7; }
.hero-card-stage .ring-3 { inset: 24%; opacity: .45; }
.hero-card-stage::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 42%, rgba(166, 24, 38, .35), transparent 32%),
    radial-gradient(circle, rgba(255, 215, 0, .08), transparent 55%);
  filter: blur(.5px);
}
.hero-card.hayya-hero {
  position: relative;
  z-index: 2;
  width: min(260px, 64vw);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 30px 70px rgba(0,0,0,.65),
    0 0 0 1px rgba(255, 215, 0, .55),
    0 0 36px rgba(255, 215, 0, .26);
  transform: rotate(-6deg);
  animation: hayyaCardFloat 4.5s ease-in-out infinite;
}
.hero-card-img { display: block; width: 100%; height: auto; }
.card-shadow {
  position: absolute;
  inset: auto -10% -8% -10%;
  height: 22px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.55), transparent 70%);
  filter: blur(6px);
  z-index: 1;
}
.card-label {
  position: absolute !important;
  bottom: -42px !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  transform: translateX(-50%) rotate(6deg) !important;
  z-index: 3;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(0,0,0,.62);
  color: var(--gold-bright) !important;
  font-family: "Reem Kufi", Cairo, sans-serif;
  font-weight: 800;
  font-size: .9rem;
  letter-spacing: .05em;
  border: 1px solid rgba(255,215,0,.42);
  text-decoration: none !important;
  text-shadow: 0 2px 10px rgba(255,215,0,.35);
  white-space: nowrap;
  line-height: 1;
}

.floating-cards {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.floating-cards .float-card {
  position: absolute;
  width: 86px;
  height: 124px;
  border-radius: 12px;
  opacity: .18;
  filter: blur(.4px) saturate(.85);
  animation: floatCardDrift 18s ease-in-out infinite;
}
.floating-cards .float-card .card-back {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,215,0,.18), transparent 55%),
    linear-gradient(135deg, #7a1726, #19060b);
  border: 1px solid rgba(255,215,0,.35);
}
.floating-cards .fc1 { top: 8%; right: 6%; transform: rotate(12deg); animation-delay: 0s; }
.floating-cards .fc2 { top: 30%; left: 4%; transform: rotate(-18deg); animation-delay: -3s; opacity: .14; }
.floating-cards .fc3 { bottom: 18%; right: 10%; transform: rotate(-8deg); animation-delay: -6s; opacity: .16; }
.floating-cards .fc4 { bottom: 8%; left: 14%; transform: rotate(20deg); animation-delay: -9s; opacity: .12; }
.floating-cards .fc5 { top: 52%; right: 24%; transform: rotate(4deg); animation-delay: -12s; opacity: .1; }
@keyframes floatCardDrift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-22px); }
}

.ambient-orbs { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambient-orbs .orb {
  position: absolute;
  width: 360px; height: 360px;
  border-radius: 999px;
  filter: blur(45px);
  opacity: .4;
  animation: hayyaFloatOrb 12s ease-in-out infinite;
}
.ambient-orbs .orb-1 { background: rgba(220, 40, 60, .4); top: 10%; left: 8%; }
.ambient-orbs .orb-2 { background: rgba(255, 215, 0, .22); top: 40%; right: 4%; animation-delay: -5s; }
.ambient-orbs .orb-3 { background: rgba(31, 77, 58, .55); bottom: -6%; left: 30%; animation-delay: -9s; }

.home-feedback {
  position: relative;
  z-index: 2;
  margin-top: 22px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)),
    rgba(7, 10, 17, .76);
  box-shadow: 0 18px 45px rgba(0,0,0,.32);
  overflow: hidden;
}
.home-feedback::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 215, 0, .13);
  border-radius: inherit;
  pointer-events: none;
}
.feedback-glow {
  position: absolute;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,.18), transparent 60%);
  filter: blur(40px);
  top: -120px; right: -80px;
  pointer-events: none;
}
.feedback-header { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; position: relative; z-index: 1; }
.feedback-icon-wrap {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: rgba(255, 215, 0, .08);
  border: 1px solid var(--line-soft);
  color: var(--gold-bright);
}
.feedback-title {
  font-family: "Reem Kufi", Cairo, sans-serif;
  color: #f3d996 !important;
  margin: 0;
  font-size: 1.4rem;
}
.feedback-sub { color: rgba(255,248,231,.62) !important; margin: 4px 0 0; }
.feedback-form { position: relative; z-index: 1; }
.feedback-field { margin-bottom: 16px; }
.feedback-label {
  display: flex; align-items: center; gap: 8px;
  color: var(--gold) !important;
  font-weight: 700;
  margin-bottom: 8px;
}
.feedback-input-wrap input,
.feedback-input-wrap textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.25);
  color: var(--ivory);
  font-family: inherit;
}
.feedback-input-wrap textarea { resize: vertical; min-height: 110px; }
.feedback-textarea-wrap { position: relative; }
.feedback-char-count {
  position: absolute;
  bottom: 8px; left: 12px;
  color: rgba(255,248,231,.45);
  font-size: .75rem;
  /* Stop the count from blocking textarea clicks (it sits inside the
     padded textbox region). `tnum` locks digit widths so "199 / 1000"
     doesn't jitter as the user types. */
  pointer-events: none;
  font-feature-settings: "tnum";
}
.feedback-success { text-align: center; padding: 20px; }
.feedback-success-icon { font-size: 3rem; }
.feedback-success-text { color: var(--gold-bright); font-size: 1.1rem; }

@media (max-width: 1040px) {
  .home-grid { grid-template-columns: 1fr; padding: 22px; }
  .home-right { min-height: 380px; }
}
@media (max-width: 760px) {
  /* `max-width: 100vw` was shifting the WHOLE UI to the LEFT on
     iPhones (reported in production). iOS Safari's `100vw` doesn't
     always equal the document width — with a notched device + RTL,
     the viewport unit excludes the safe-area inset and the body
     ends up narrower than the document, so RTL content (which
     anchors to the right) renders with a visible leftward gap on
     the viewport's right edge. `100%` respects the parent / actual
     document width and behaves the same on every browser. Pin
     `width: 100%` explicitly too so html/body don't fall back to
     `auto` and let any rogue child push the layout off-axis. */
  html, body { overflow-x: hidden; width: 100%; max-width: 100%; }
  .screen.home, .hayya-home { width: calc(100% - 16px); margin: 12px auto 40px !important; padding: 0; }
  .home-grid { padding: 18px 14px; gap: 22px; border-radius: 22px; }
  .home-grid::before { inset: 6px; border-radius: inherit; }
  .hero-title { font-size: clamp(2.4rem, 11vw, 3.6rem); margin: 8px 0 12px; }
  .hero-sub { font-size: 1rem; line-height: 1.75; margin-bottom: 20px; }
  .hero-cta { gap: 8px; }
  .hero-cta .btn { flex: 1; min-width: 0; padding: 12px 14px; font-size: .95rem; }
  .hero-stats { gap: 8px; }
  .hero-stats .stat { padding: 10px 6px; }
  .hero-stats .stat-num { font-size: 1.2rem; }
  .hero-stats .stat-lbl { font-size: .72rem; }
  .hero-stats .stat-sep { display: none; }
  .home-right { min-height: 360px; }
  .hero-card-stage { width: min(260px, 70vw); }
  .hero-card.hayya-hero { width: min(200px, 60vw); }
  .card-label { bottom: -34px !important; font-size: .78rem; padding: 5px 12px; }
  /* Decorative card-back drifts cost real paint cycles and add nothing
     readable on phones where the hero is the focus. Hide the whole
     `.floating-cards` layer under 760 px. */
  .floating-cards { display: none !important; }
  /* Keep the ambient color glow on phones, but stop perpetually compositing a
     moving blurred layer — `animation: none` makes each orb a static glow
     (rasterized once) instead of an always-animating filtered layer. */
  .ambient-orbs .orb { width: 220px; height: 220px; animation: none; }
  .home-features { grid-template-columns: 1fr !important; gap: 12px; margin-top: 22px; }
  .feature-card { padding: 18px !important; min-height: auto !important; }
  .home-feedback { padding: 20px 16px; margin-top: 18px; }
  .home-feedback::before { inset: 6px; }
  .feedback-header { gap: 10px; margin-bottom: 14px; }
  .feedback-icon-wrap { width: 44px; height: 44px; flex: 0 0 44px; }
  .feedback-title { font-size: 1.1rem; }
  .home-proverb { padding: 22px 16px; }
  .home-proverb .proverb-text { font-size: 1.3rem; }
  .screens-nav { padding: 10px 12px !important; gap: 10px; }
  .screens-nav .brand-name { font-size: 1.1rem; }
}
@media (max-width: 380px) {
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
}

/* ================ FEATURE GRID (re-skin existing .feature-card / .home-features) ================ */
.home-features, .feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 22px 0;
}
.home-features.cols-4, .feature-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.feature-card, .ornate-card {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  padding: 28px;
  border: 1px solid var(--line) !important;
  border-radius: 24px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)),
    rgba(7, 10, 17, .76) !important;
  box-shadow: 0 18px 45px rgba(0,0,0,.32);
  color: var(--ivory);
  display: block;
}
.feature-card::before, .ornate-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 215, 0, .13);
  border-radius: inherit;
  pointer-events: none;
}
.feature-card:hover, .ornate-card:hover { transform: translateY(-3px); transition: .25s ease; }
.feature-card .feature-icon, .ornate-card .icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: rgba(255, 215, 0, .08);
  border: 1px solid var(--line-soft);
  color: var(--gold-bright);
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.feature-card .feature-title, .ornate-card h3 {
  font-family: "Reem Kufi", Cairo, sans-serif;
  color: #f3d996 !important;
  font-size: 1.35rem;
  margin: 16px 0 8px;
}
.feature-card .feature-sub, .ornate-card p {
  color: rgba(255,248,231,.62) !important;
  margin: 0;
  line-height: 1.8;
}
.feature-card .feature-arrow { display: none; }

/* ================ QUOTE / PROVERB ================ */
.home-proverb, .quote-card {
  position: relative;
  margin-top: 22px;
  padding: 28px;
  text-align: center;
  border: 1px solid var(--line) !important;
  border-radius: 24px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)),
    rgba(7, 10, 17, .76) !important;
  overflow: hidden;
}
.home-proverb::before, .quote-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 215, 0, .13);
  border-radius: inherit;
  pointer-events: none;
}
.home-proverb .quote-mark, .quote-card span {
  font-size: 4rem;
  color: rgba(255, 215, 0, .3);
  line-height: .2;
  display: block;
}
.home-proverb .proverb-text, .quote-card p {
  font-family: Amiri, serif;
  color: #f3d996 !important;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  margin: 0;
}
.home-proverb .proverb-attr, .quote-card small { color: rgba(255,248,231,.5) !important; }

/* ================ Re-skin existing screen panels (setup/lobby/rules/stats) ================ */
.screen { width: min(1240px, calc(100% - 28px)); margin: 22px auto 70px !important; }

.setup-section,
.summary-card,
.tip-card,
.rules-page-grid > *,
.stats-grid > *,
.lobby-card,
.lobby-section,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line) !important;
  border-radius: 24px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)),
    rgba(7, 10, 17, .76) !important;
  box-shadow: 0 18px 45px rgba(0,0,0,.32);
}

.setup-section,
.summary-card,
.tip-card,
.lobby-card,
.lobby-section,
.panel { padding: 24px; }

.setup-section::before,
.summary-card::before,
.tip-card::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 215, 0, .13);
  border-radius: inherit;
  pointer-events: none;
}

.section-h, .summary-h {
  font-family: "Reem Kufi", Cairo, sans-serif;
  color: #f3d996 !important;
  font-size: 1.35rem;
  margin: 0 0 16px;
}

.screen-title { font-family: "Reem Kufi", Cairo, sans-serif; color: #f3d996 !important; }
.screen-eyebrow { color: var(--gold) !important; }

/* admin dashboard polish — tighter padding, sticky header, mobile
 * column hiding, and a horizontal scroll wrapper so wide tables don't
 * blow out the layout. */
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
}
.admin-table {
  font-size: 13px;
  min-width: 1100px;
}
.admin-table th,
.admin-table td {
  padding: 10px 12px !important;
  white-space: nowrap;
}
.admin-table th {
  position: sticky;
  top: 0;
  background: rgba(7, 10, 17, .92);
  backdrop-filter: blur(8px);
  z-index: 2;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: .02em;
}
.admin-table th[data-sort] {
  cursor: pointer;
  user-select: none;
  padding-inline-end: 22px !important;
  position: sticky;
  transition: color .15s ease, background .15s ease;
}
.admin-table th[data-sort]:hover {
  color: var(--gold-bright);
  background: rgba(255, 215, 0, .06);
}
.admin-table th[data-sort]::after {
  content: "↕";
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: .35;
  transition: opacity .15s ease, color .15s ease;
}
.admin-table th[data-sort]:hover::after { opacity: .7; }
.admin-table th.sort-asc::after,
.admin-table th.sort-desc::after {
  opacity: 1;
  color: var(--gold-bright);
  font-size: 12px;
}
.admin-table th.sort-asc::after { content: "▲"; }
.admin-table th.sort-desc::after { content: "▼"; }
.admin-table tbody tr {
  transition: background .12s ease;
}
.admin-table tbody tr:hover td {
  background: rgba(255, 215, 0, .045) !important;
}
.admin-table tr:nth-child(even) td { background: rgba(255,255,255,.012); }

/* Hide low-priority columns on mobile so the operator can read the
 * essentials (status / kind / id / location / last-activity / device)
 * without scrolling 13 columns horizontally. With the new "آخر نشاط"
 * column at index 5, indices for the hidden columns shifted by one. */
@media (max-width: 768px) {
  .admin-table { min-width: 760px; }
  .admin-table th:nth-child(8),  /* اللغة */
  .admin-table td:nth-child(8),
  .admin-table th:nth-child(9),  /* الإحالة */
  .admin-table td:nth-child(9),
  .admin-table th:nth-child(12), /* أول زيارة */
  .admin-table td:nth-child(12),
  .admin-table th:nth-child(13), /* آخر زيارة (مكرر مع آخر نشاط) */
  .admin-table td:nth-child(13) { display: none; }
}

.admin-tiles {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.admin-tile {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(7, 10, 17, .68);
}
.admin-tile .tile-num {
  font-family: "Reem Kufi", Cairo, sans-serif;
  font-size: 1.6rem;
  color: var(--gold-bright);
  font-weight: 800;
}
.admin-tile .tile-lbl {
  font-size: .82rem;
  color: rgba(255,248,231,.72);
  margin-top: 4px;
}
.admin-tile-online {
  border-color: rgba(74, 222, 128, .45);
  background:
    linear-gradient(180deg, rgba(74, 222, 128, .08), transparent),
    rgba(7, 10, 17, .68);
}
.admin-tile-online .tile-num { color: #4ade80; }
.admin-tile-warn {
  border-color: rgba(245, 158, 11, .45);
  background:
    linear-gradient(180deg, rgba(245, 158, 11, .08), transparent),
    rgba(7, 10, 17, .68);
}
.admin-tile-warn .tile-num { color: #f59e0b; }
.online-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  margin-inline-end: 6px;
  box-shadow: 0 0 8px #4ade80;
  animation: adminPulse 1.6s ease-in-out infinite;
}
@keyframes adminPulse { 50% { opacity: .55; } }

/* Admin section nav — sticky pill row below .admin-head. Mobile-first:
 * horizontally scrolls if 3 chips ever overflow (safety net; with the
 * current label widths they fit comfortably at 320px).
 */
.admin-section-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  gap: 8px;
  padding: 10px 0;
  margin: 0 0 18px;
  background: linear-gradient(180deg, rgba(7,10,17,.92), rgba(7,10,17,.78));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-section-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7,10,17,.55);
  color: var(--gold);
  font-family: "Reem Kufi", Cairo, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
  cursor: pointer;
}
.admin-section-chip:hover {
  border-color: rgba(255,215,0,.45);
  color: var(--gold-bright);
  transform: translateY(-1px);
}
.admin-section-chip.is-active {
  background: linear-gradient(135deg, #ffe89a, var(--gold-bright));
  color: #15101c;
  border-color: rgba(255,248,231,.45);
  box-shadow: 0 4px 12px rgba(255,215,0,.18);
}

/* Sections + per-section titles. scroll-margin-top accounts for the
 * sticky nav so an anchor-jump doesn't tuck the heading under it.
 */
.admin-section {
  scroll-margin-top: 80px;
  margin-top: 28px;
}
.admin-section:first-of-type { margin-top: 0; }
.admin-section-title {
  font-family: "Reem Kufi", Cairo, sans-serif;
  color: var(--gold-bright);
  font-size: 1.5rem;
  margin: 0 0 16px;
  position: relative;
  padding-inline-start: 14px;
}
.admin-section-title::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, var(--gold-bright), rgba(255,215,0,.3));
  border-radius: 2px;
}
@media (max-width: 500px) {
  .admin-section-title { font-size: 1.25rem; }
  .admin-section { scroll-margin-top: 72px; }
}

/* Responsive tile grid — at 375px the default minmax(140px, 1fr) cramps
 * to 2 columns with too-tight padding. Tighten the min so 2-per-row is
 * the comfortable default on the smallest viewport.
 */
@media (max-width: 500px) {
  .admin-tiles {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
    gap: 8px;
  }
  .admin-tile { padding: 12px; }
  .admin-tile .tile-num { font-size: 1.4rem; }
}

/* Load-test toggle in the visitors filter bar + the lt-guest pill on
 * each lt-guest row when the toggle is on.
 */
.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(7,10,17,.55);
  color: rgba(255,248,231,.78);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}
.admin-toggle:hover { border-color: rgba(245,158,11,.45); }
.admin-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #f59e0b;
  cursor: pointer;
}

.kind-pill.kind-load-test {
  background: rgba(245,158,11,.18);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,.42);
}

/* admin: location pill + spectate button */
.loc-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-inline-end: 6px;
}
.loc-pill.loc-game {
  background: rgba(220, 40, 60, .18);
  color: #ff8c97;
  border: 1px solid rgba(220, 40, 60, .42);
}
.loc-pill.loc-table {
  background: rgba(255, 215, 0, .14);
  color: var(--gold-bright);
  border: 1px solid rgba(255, 215, 0, .42);
}
.spectate-btn {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffe89a, var(--gold-bright));
  color: #15101c !important;
  text-decoration: none;
  border: 1px solid rgba(255, 248, 231, .45);
}
.spectate-btn:hover { transform: translateY(-1px); }

/* lobby table-card host flag */
.table-icon .table-flag-emoji {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 2rem;
  line-height: 1;
}

/* lobby host-theme picker (inside create-table modal) */
.lobby-theme-row { display: grid; gap: 8px; margin-top: 10px; }
.lobby-theme-h {
  font-size: .82rem;
  color: var(--gold);
  font-weight: 700;
  margin-top: 4px;
}

/* contact page email footer */
.contact-email {
  text-align: center;
  margin-top: 22px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  background: rgba(0,0,0,.22);
  color: rgba(255,248,231,.65);
  font-size: .95rem;
}
.contact-email span { display: block; margin-bottom: 6px; font-size: .85rem; }
.contact-email a {
  color: var(--gold-bright);
  font-family: monospace;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: .03em;
  direction: ltr;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 999px;
}
.contact-email a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════
 *  PLAY CHOOSER — /play screen, two big cards (vs AI / vs friends)
 * ════════════════════════════════════════════════════════════════ */
.play-chooser {
  width: min(960px, calc(100% - 24px));
  margin: 22px auto 70px !important;
}
.play-head { text-align: center; padding: 24px 12px; }
.play-head h1 {
  font-family: "Reem Kufi", Cairo, sans-serif;
  color: #f3d996;
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin: 8px 0 12px;
  text-shadow: 0 12px 40px rgba(255, 215, 0, .12);
}
.play-sub { color: rgba(255,248,231,.7); max-width: 560px; margin: 0 auto; line-height: 1.8; }

.play-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.play-card {
  position: relative;
  display: block;
  padding: 32px 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)),
    rgba(7, 10, 17, .76);
  box-shadow: 0 18px 45px rgba(0,0,0,.32);
  color: var(--ivory);
  transition: .25s ease;
  overflow: hidden;
}
.play-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 215, 0, .13);
  border-radius: inherit;
  pointer-events: none;
}
.play-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,215,0,.45);
  box-shadow: 0 28px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(255,215,0,.18);
}

.play-card .play-icon {
  width: 72px; height: 72px;
  display: grid; place-items: center;
  border-radius: 22px;
  background: rgba(255,215,0,.12);
  border: 1px solid rgba(255,215,0,.32);
  font-size: 2.2rem;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.play-card h2 {
  font-family: "Reem Kufi", Cairo, sans-serif;
  color: #f3d996;
  font-size: 1.6rem;
  margin: 0 0 10px;
  position: relative;
  z-index: 1;
}
.play-card p {
  color: rgba(255,248,231,.72);
  margin: 0 0 18px;
  line-height: 1.8;
  position: relative;
  z-index: 1;
}
.play-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.play-meta span {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.32);
  border: 1px solid var(--line-soft);
  color: rgba(255,248,231,.78);
  font-size: .8rem;
  font-weight: 700;
}
.play-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe89a, var(--gold-bright) 30%, var(--gold) 68%);
  color: #15101c;
  font-weight: 800;
  position: relative;
  z-index: 1;
  box-shadow: 0 12px 28px rgba(255,215,0,.18);
}
.play-go span {
  font-size: 1.1rem;
  transition: transform .2s ease;
}
.play-card:hover .play-go span { transform: translateX(-4px); }

.play-card.play-vs-friends .play-icon {
  background: rgba(31,77,58,.25);
  border-color: rgba(31,77,58,.55);
}
.play-card.play-online .play-icon {
  background: rgba(46,120,160,.22);
  border-color: rgba(110,190,230,.5);
}

@media (max-width: 760px) {
  .play-grid { grid-template-columns: 1fr; gap: 14px; }
  .play-card { padding: 22px 18px; }
  .play-card::before { inset: 6px; }
  .play-card .play-icon { width: 60px; height: 60px; font-size: 1.8rem; }
  .play-card h2 { font-size: 1.3rem; }
}

/* ════════════════════════════════════════════════════════════════
 *  RULES PAGE — clean rebuild ('hayya-rules' wraps the screen)
 * ════════════════════════════════════════════════════════════════ */
.hayya-rules { width: min(1100px, calc(100% - 24px)); margin: 22px auto 70px !important; }

.rules-hero { text-align: center; padding: 24px 12px 14px; }
.rules-hero h1 {
  font-family: "Reem Kufi", Cairo, sans-serif;
  color: #f3d996;
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin: 8px 0 12px;
  text-shadow: 0 12px 40px rgba(255, 215, 0, .12);
}
.rules-hero-sub { color: rgba(255,248,231,.7); max-width: 620px; margin: 0 auto; line-height: 1.8; }

.rules-toc-new {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 22px 0 28px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 10, 17, .6);
}
.toc-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 999px;
  background: rgba(0,0,0,.32);
  border: 1px solid var(--line-soft);
  color: rgba(255, 248, 231, .8);
  font-size: .9rem;
  font-weight: 700;
  transition: .2s ease;
}
.toc-chip:hover { color: var(--gold-bright); border-color: rgba(255,215,0,.5); transform: translateY(-1px); }
.toc-chip > span {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(255,215,0,.12);
  color: var(--gold-bright);
  font-size: .8rem;
  font-weight: 800;
}

.rules-sec {
  position: relative;
  margin: 22px 0;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)),
    rgba(7, 10, 17, .76);
  box-shadow: 0 18px 45px rgba(0,0,0,.32);
  scroll-margin-top: 90px;
}
.rules-sec::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 215, 0, .13);
  border-radius: inherit;
  pointer-events: none;
}
.sec-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.sec-head h2 {
  font-family: "Reem Kufi", Cairo, sans-serif;
  color: #f3d996;
  margin: 0;
  font-size: clamp(1.4rem, 3.2vw, 1.9rem);
}
.sec-num {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffe89a, var(--gold-bright) 35%, var(--gold) 75%);
  color: #15101c;
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: 0 8px 20px rgba(255,215,0,.25);
}
.sub-h {
  font-family: "Reem Kufi", Cairo, sans-serif;
  color: var(--gold);
  font-size: 1.1rem;
  margin: 22px 0 12px;
  position: relative;
  z-index: 1;
}
.sec-intro { color: rgba(255,248,231,.72); margin: 0 0 18px; line-height: 1.8; position: relative; z-index: 1; }

/* — quick stats grid — */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  position: relative;
  z-index: 1;
}
.qs-card {
  padding: 16px 12px;
  text-align: center;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(0,0,0,.28);
}
.qs-num {
  font-family: "Reem Kufi", Cairo, sans-serif;
  color: var(--gold-bright);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}
.qs-num span { color: rgba(255,248,231,.5); font-size: 1rem; padding: 0 4px; }
.qs-lbl { color: var(--ivory); font-weight: 700; margin-top: 6px; }
.qs-sub { color: rgba(255,248,231,.55); font-size: .78rem; margin-top: 4px; }

/* — suits row — */
.suits-row-new {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  position: relative;
  z-index: 1;
}
.suit-chip {
  padding: 14px 8px;
  text-align: center;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(0,0,0,.28);
  border-top: 3px solid var(--c, #c9a961);
}
.suit-chip .g { display: block; font-size: 2rem; color: var(--c); line-height: 1; }
.suit-chip b { display: block; font-family: "Reem Kufi"; color: var(--gold-bright); margin-top: 4px; }
.suit-chip small { display: block; color: rgba(255,248,231,.55); font-size: .72rem; margin-top: 2px; }

/* — cards glossary — */
.cards-glossary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  position: relative;
  z-index: 1;
}
.gloss-card {
  padding: 10px 6px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(0,0,0,.32);
}
.gloss-num { color: var(--gold-bright); font-weight: 800; font-size: 1.1rem; }
.gloss-name { color: var(--ivory); font-size: .82rem; margin-top: 2px; }
.gloss-eng { color: rgba(255,248,231,.4); font-size: .68rem; font-family: monospace; margin-top: 2px; }

/* — flow steps — */
.flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.flow-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(0,0,0,.28);
}
.fs-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: rgba(255,215,0,.08);
  border: 1px solid rgba(255,215,0,.2);
  font-size: 1.7rem;
}
.fs-body h4 { font-family: "Reem Kufi"; color: var(--gold-bright); font-size: 1.1rem; margin: 0 0 4px; }
.fs-body p { color: rgba(255,248,231,.72); margin: 0; line-height: 1.7; font-size: .95rem; }

/* — capture demo cards — */
.cap-card {
  position: relative;
  z-index: 1;
  margin: 16px 0;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: rgba(0,0,0,.28);
}
.cap-card.shakkba {
  border-color: rgba(255,215,0,.35);
  background:
    linear-gradient(180deg, rgba(255,215,0,.06), rgba(0,0,0,.3)),
    rgba(0,0,0,.28);
}
.cap-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cap-card-h h3 {
  font-family: "Reem Kufi";
  color: var(--gold-bright);
  font-size: 1.2rem;
  margin: 0;
}
.cap-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line-soft);
  color: rgba(255,248,231,.7);
  font-size: .72rem;
  font-weight: 700;
}
.cap-badge.gold {
  background: rgba(255,215,0,.14);
  color: var(--gold-bright);
  border-color: rgba(255,215,0,.45);
}
.cap-card p { color: rgba(255,248,231,.72); line-height: 1.8; margin: 0 0 16px; }

.cap-demo {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at center, rgba(31,77,58,.55), rgba(8,18,14,.85)),
    #0a1410;
  border: 1px solid rgba(201,169,97,.25);
}
.cap-stage { text-align: center; }
.cap-label {
  color: rgba(255,248,231,.55);
  font-size: .78rem;
  margin-bottom: 8px;
  font-weight: 700;
}
.cap-cards {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 86px;
  align-items: center;
}
.cap-cards.empty {
  border: 2px dashed rgba(255,215,0,.4);
  border-radius: 12px;
  padding: 14px 8px;
  background: rgba(255,215,0,.04);
}
.empty-mark { color: var(--gold-bright); font-weight: 800; font-size: .85rem; }

.rule-card {
  width: 50px;
  height: 70px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff8e7, #f3e7cd);
  color: #c5162c;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-weight: 800;
  font-size: 1.4rem;
  border: 1px solid rgba(138,109,46,.4);
  box-shadow: 0 6px 14px rgba(0,0,0,.4);
}
.rule-card.hi {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 2px rgba(255,215,0,.5), 0 6px 14px rgba(0,0,0,.4);
  transform: translateY(-2px);
}
.rule-card.hand {
  background: linear-gradient(135deg, #ffe89a, var(--gold-bright));
  color: #15101c;
  border-color: rgba(255,255,255,.5);
}

.cap-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-weight: 800;
  font-size: .8rem;
}
.cap-arrow .rule-card { width: 40px; height: 56px; font-size: 1.1rem; }
.cap-arrow span:last-child { font-size: 1.5rem; color: var(--gold-bright); }

.shakkba-points {
  list-style: none;
  margin: 16px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,215,0,.06);
  border: 1px solid rgba(255,215,0,.2);
  display: grid;
  gap: 8px;
}
.shakkba-points li { color: rgba(255,248,231,.85); font-size: .92rem; }
.shakkba-points b { color: var(--gold-bright); }

/* — Libyan rules grid — */
.libyan-grid-new {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  position: relative;
  z-index: 1;
}
.lib-card-new {
  padding: 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.2)),
    rgba(0,0,0,.32);
  position: relative;
  overflow: hidden;
  transition: .25s ease;
}
.lib-card-new:hover { transform: translateY(-3px); border-color: rgba(255,215,0,.4); }
.lib-card-new.accent-gold { border-top: 3px solid var(--gold-bright); }
.lib-card-new.accent-red { border-top: 3px solid #dc283c; }
.lib-card-new.accent-crown {
  border-top: 3px solid var(--gold-bright);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,215,0,.18), transparent 50%),
    rgba(0,0,0,.32);
}
.lib-icon-new {
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(255,215,0,.1);
  border: 1px solid rgba(255,215,0,.25);
  font-size: 1.6rem;
  margin-bottom: 12px;
}
.lib-card-new h4 {
  font-family: "Reem Kufi";
  color: var(--gold-bright);
  font-size: 1.2rem;
  margin: 0 0 4px;
}
.lib-tag {
  display: inline-block;
  font-size: .72rem;
  color: rgba(255,248,231,.55);
  margin-bottom: 8px;
}
.lib-card-new p { color: rgba(255,248,231,.7); font-size: .88rem; line-height: 1.7; margin: 0 0 12px; }
.lib-points {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,215,0,.14);
  color: var(--gold-bright);
  font-weight: 800;
  font-size: .8rem;
  border: 1px solid rgba(255,215,0,.32);
}
.lib-points.red { background: rgba(220,40,60,.18); color: #ff8c97; border-color: rgba(220,40,60,.4); }
.lib-points.crown { background: linear-gradient(135deg, #ffe89a, var(--gold-bright)); color: #15101c; border-color: transparent; }

/* (The .kartet-flow / .k-step rules were removed 2026-05-31 with the
   retired كرطت/مسكتك button explainer on the rules page — the only
   surviving kartet surface is the cosmetic announcement banner.) */

/* — score cards — */
.score-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  position: relative;
  z-index: 1;
}
.sc {
  padding: 16px 14px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(0,0,0,.28);
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
}
.sc.gold { border-color: rgba(255,215,0,.35); background: rgba(255,215,0,.06); }
.sc.total {
  border-color: var(--gold-bright);
  background: linear-gradient(135deg, rgba(255,215,0,.18), rgba(201,169,97,.06));
}
.sc-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(255,215,0,.1);
  border: 1px solid rgba(255,215,0,.2);
  font-size: 1.3rem;
}
.sc-h { font-family: "Reem Kufi"; color: var(--gold-bright); font-weight: 800; }
.sc-cond { color: rgba(255,248,231,.55); font-size: .78rem; grid-column: 2; }
.sc-pt {
  font-family: "Reem Kufi";
  color: var(--gold-bright);
  font-weight: 900;
  font-size: 1.4rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,215,0,.1);
  border: 1px solid rgba(255,215,0,.32);
}
.sc.total .sc-pt { background: var(--gold-bright); color: #15101c; }

/* — CTA — */
.rules-cta { text-align: center; margin-top: 28px; }

/* — responsive — */
@media (max-width: 760px) {
  .quick-stats { grid-template-columns: repeat(2, 1fr); }
  .suits-row-new { grid-template-columns: repeat(2, 1fr); }
  .cards-glossary { grid-template-columns: repeat(3, 1fr); }
  .libyan-grid-new { grid-template-columns: 1fr; }
  .score-cards { grid-template-columns: 1fr; }
  .cap-demo { grid-template-columns: 1fr; gap: 10px; }
  .cap-arrow { flex-direction: row; }
  .cap-arrow span:last-child { transform: rotate(-90deg); }
  .rules-sec { padding: 18px 14px; }
  .rules-sec::before { inset: 6px; }
  .sec-num { width: 36px; height: 36px; font-size: 1rem; }
  .flow-step { grid-template-columns: 52px 1fr; gap: 10px; padding: 12px; }
  .fs-icon { width: 48px; height: 48px; font-size: 1.4rem; }
  .rule-card { width: 42px; height: 60px; font-size: 1.15rem; }
  .toc-chip { font-size: .82rem; padding: 6px 10px; }
}

/* image-preview swatches — show the actual table/background asset */
.swatch.swatch-img {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--line) !important;
  background: #1a1a1a !important;
}
.swatch.swatch-img[data-table-img] { background: var(--_img, #1a1a1a) center/cover no-repeat !important; }
.swatch.swatch-img[data-bg-img]    { background: var(--_img, #1a1a1a) center/cover no-repeat !important; }
.swatch.swatch-img::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--_img) center/cover no-repeat;
  z-index: 0;
}
.swatch.swatch-img > * { position: relative; z-index: 1; }
.swatch.swatch-img > span {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: rgba(0,0,0,.62);
  color: var(--ivory);
  padding: 2px 6px;
  border-radius: 999px;
  font-size: .65rem;
  text-align: center;
  max-width: calc(100% - 8px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
}
@media (max-width: 760px) {
  .swatch { width: 64px !important; height: 52px !important; }
  .swatch.swatch-img > span { font-size: .6rem; padding: 1px 4px; }
}
.swatch.swatch-img.selected {
  border-color: var(--gold-bright) !important;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, .14) !important;
}

/* shibani portrait pickers — used in /setup difficulty section */
.shibani-row {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.shibani-pill {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  padding: 0 !important;
  overflow: hidden;
  border: 2px solid var(--line) !important;
  border-radius: 18px !important;
  background: rgba(0,0,0,.32);
  cursor: pointer;
  transition: .25s ease;
}
/* sr-only — keep the radio in the tab order so the setup picker is
   keyboard-reachable. Was `display: none` which broke focus. */
.shibani-pill input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.shibani-portrait {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--line-soft);
  filter: saturate(.92) brightness(.95);
}
.shibani-meta {
  padding: 12px 10px 14px;
  text-align: center;
}
.shibani-pill .diff-name {
  color: #f3d996;
  font-family: "Reem Kufi", Cairo, sans-serif;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 4px;
}
.shibani-pill .diff-sub { color: rgba(255,248,231,.55); font-size: .78rem; }

.shibani-pill.selected {
  border-color: rgba(255, 215, 0, .8) !important;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, .14), 0 18px 36px rgba(0,0,0,.4) !important;
  transform: translateY(-2px);
}
.shibani-pill.selected .shibani-portrait { filter: saturate(1.05) brightness(1.05); }
.shibani-pill.selected .diff-name { color: var(--gold-bright); }
.shibani-pill.selected::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--gold-bright);
  color: #15101c;
  font-weight: 900;
  z-index: 2;
  box-shadow: 0 6px 14px rgba(255,215,0,.4);
}

@media (max-width: 760px) {
  .shibani-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .shibani-meta { padding: 8px 4px 10px; }
  .shibani-pill .diff-name { font-size: .8rem; }
  .shibani-pill .diff-sub { font-size: .68rem; }
  .shibani-pill.selected::after { width: 22px; height: 22px; font-size: .8rem; }
}

.bot-avatar.has-shibani {
  background-color: #1a1a1a !important;
  border: 2px solid var(--gold-bright) !important;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, .18), 0 12px 28px rgba(0,0,0,.5) !important;
  font-size: 0;
}

/* Game backgrounds + table image (applies on /game). The scene + felt
 * elements have inline `data-bg` / `data-table` attribute selectors in
 * `_new-design.css` that win on specificity, so we layer the asset on
 * `.has-bg-image` with `!important` to make the new images stick. */
.scene.has-bg-image {
  background:
    linear-gradient(180deg, rgba(5,7,13,.55), rgba(5,7,13,.78)),
    var(--scene-bg-img) center/cover no-repeat !important;
}
.scene.has-bg-image::before,
.scene.has-bg-image::after { display: none !important; }
/* Full-bleed table image: the picture fills the entire .felt (replacing
 * the wood frame entirely), and we drop a thin gold hairline as the only
 * frame. The inner cloth + decorative SVG go transparent so the picture
 * shows through edge-to-edge. */
.felt.has-bg-image,
.felt-table.has-bg-image {
  padding: 4px !important;
  background:
    var(--felt-bg-img) center/100% 100% no-repeat !important;
  border: 1px solid rgba(201, 169, 97, .35) !important;
  box-shadow:
    0 30px 60px rgba(0,0,0,.6),
    0 0 0 1px rgba(0,0,0,.4),
    inset 0 0 0 1px rgba(255, 215, 0, .12) !important;
}
.felt.has-bg-image .felt-inner {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 22px !important;
}
.felt.has-bg-image .felt-inner::before,
.felt.has-bg-image .felt-inner::after { display: none !important; }

/* selection states across setup pickers */
.mode-card.selected,
.diff-pill.selected,
.score-card.selected,
.swatch.selected,
.cardback-swatch.selected {
  color: var(--gold-bright) !important;
  border-color: rgba(255, 215, 0, .62) !important;
  background: linear-gradient(180deg, rgba(255, 215, 0, .13), rgba(201, 169, 97, .05)) !important;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, .06) !important;
}

/* ================ Footer ================ */
footer { color: rgba(255,248,231,.5); }

/* Responsive */
@media (max-width: 1040px) {
  .home-layout { grid-template-columns: 1fr; }
  .home-features, .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .home-layout { padding: 16px; min-height: auto; }
  .hero-art { min-height: 430px; }
  .snake-card { width: min(270px, 78vw); }
  .home-features, .feature-grid, .stats-strip { grid-template-columns: 1fr; }
}
