/* ========================================================================
   Le3betna — لعبتنا  portal landing styles  (v1.1 refinement)
   Brand: deep forest green + Lebanese red on warm cream.
   Vanilla CSS, no build step. Logical properties for automatic RTL.
   ======================================================================== */

:root {
  --green: #1f7a46;
  --green-deep: #0f3d26;
  --green-soft: #2e9d5c;
  --red: #d1202a;
  --red-deep: #a8151e;
  --gold: #e0a92e;
  --cream: #f7f4ec;
  --cream-2: #efe9db;
  --ink: #15271d;
  --muted: #5b6b61;
  --card: #fffdf8;
  --accent: var(--green);              /* per-card override */
  --shadow: 0 8px 24px rgba(15, 61, 38, 0.10);
  --shadow-lg: 0 22px 48px rgba(15, 61, 38, 0.20);
  --radius: 20px;
  --radius-sm: 12px;
  --maxw: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus: 0 0 0 3px rgba(31, 122, 70, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 520px at 50% -8%, rgba(46, 157, 92, 0.12), transparent 62%),
    radial-gradient(900px 400px at 100% 100%, rgba(209, 32, 42, 0.05), transparent 60%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Arabic typography tuning */
html[lang="ar"] body {
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Amiri", system-ui, sans-serif;
  line-height: 1.85;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* visible focus everywhere (accessibility) */
:where(a, button, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 10px;
}

/* skip link */
.skip-link {
  position: absolute;
  inset-block-start: -60px;
  inset-inline-start: 12px;
  z-index: 100;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  transition: inset-block-start 0.2s var(--ease);
}
.skip-link:focus { inset-block-start: 12px; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.2) blur(10px);
  background: rgba(247, 244, 236, 0.85);
  border-bottom: 1px solid rgba(15, 61, 38, 0.08);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
}
.brand-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.brand-mini .mark { width: 34px; height: 34px; }
.brand-mini .word { font-size: 1.2rem; }
.brand-mini .word b { color: var(--green); }
.brand-mini .word .three { color: var(--red); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid var(--green);
  color: var(--green);
  background: transparent;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.1s ease;
}
.lang-toggle .globe { flex: none; }
.lang-toggle:hover { background: var(--green); color: #fff; }
.lang-toggle:active { transform: scale(0.97); }

/* ------------------------------------------------------------------ hero */
.hero {
  text-align: center;
  padding: clamp(28px, 5vw, 56px) 0 clamp(20px, 3vw, 32px);
}
.hero .logo-wrap {
  width: min(480px, 76vw);
  height: auto;
  margin-inline: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 14px 30px rgba(15, 61, 38, 0.18));
  animation: rise 0.8s var(--ease) both;
}
.hero .logo-wrap img { width: 100%; height: auto; }
.hero h1 {
  font-size: clamp(2rem, 4.8vw, 3.2rem);
  margin: 0.1em 0 0.2em;
  color: var(--green-deep);
  line-height: 1.12;
  letter-spacing: -0.5px;
  font-weight: 800;
}
.hero .sub {
  max-width: 660px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
}

/* --------------------------------------------------------------- games */
.games { padding: clamp(14px, 2.5vw, 24px) 0 clamp(48px, 7vw, 88px); }
.section-title {
  text-align: center;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--green-deep);
  margin: 0 0 6px;
  font-weight: 800;
}
.section-title .accent {
  display: block;
  width: 72px;
  height: 4px;
  border-radius: 4px;
  background: var(--red);
  margin: 12px auto 0;
}
.games-grid {
  margin-top: clamp(28px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(18px, 2vw, 28px);
  align-items: stretch;
}

/* game card */
.game-card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(15, 61, 38, 0.08);
  border-radius: var(--radius);
  padding: 30px 24px 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
  overflow: hidden;
  min-height: 420px;
}
.game-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff));
}
.game-card.soon::before { background: linear-gradient(90deg, #b9c4bd, #d7ddd6); }

.game-card.live:hover,
.game-card.live:focus-within {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.game-card.soon { opacity: 0.94; }
.game-card.soon:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15, 61, 38, 0.13); }

/* per-game artwork */
.art {
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  margin-top: 6px;
  filter: drop-shadow(0 8px 16px rgba(15, 61, 38, 0.14));
  transition: transform 0.3s var(--ease);
}
.art-svg { width: 118px; height: 118px; }
.game-card.live:hover .art { transform: translateY(-2px) rotate(-2deg) scale(1.04); }
.game-card.soon .art { filter: drop-shadow(0 6px 12px rgba(15, 61, 38, 0.10)) saturate(0.8); opacity: 0.92; }

.game-card h3 {
  margin: 2px 0 0;
  font-size: 1.45rem;
  color: var(--green-deep);
  font-weight: 800;
}
.game-card .desc {
  color: var(--muted);
  font-size: 0.97rem;
  margin: 0;
  max-width: 24ch;
}

/* status pill (top corner) */
.pill {
  position: absolute;
  inset-block-start: 14px;
  inset-inline-end: 14px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 11px;
  border-radius: 999px;
}
.pill.live {
  color: #fff;
  background: var(--green);
  box-shadow: 0 2px 8px rgba(31, 122, 70, 0.35);
}
.pill.live::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-inline-end: 5px;
  border-radius: 50%;
  background: #8ff0b4;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(143, 240, 180, 0.7);
  animation: pulse 2s infinite;
}
.pill.soon {
  color: var(--muted);
  background: var(--cream-2);
  border: 1px solid rgba(15, 61, 38, 0.12);
}

/* play button */
.btn-play {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 1.02rem;
  padding: 12px 28px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(31, 122, 70, 0.32);
  transition: background 0.2s var(--ease), transform 0.12s ease, box-shadow 0.2s var(--ease);
}
.btn-play:hover { background: var(--green-deep); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(31, 122, 70, 0.42); }
.btn-play:active { transform: translateY(0); }
.btn-play .arrow { transition: transform 0.2s var(--ease); }
.btn-play:hover .arrow { transform: translateX(3px); }
html[dir="rtl"] .btn-play .arrow { transform: scaleX(-1); }
html[dir="rtl"] .btn-play:hover .arrow { transform: scaleX(-1) translateX(3px); }

.btn-soon {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.97rem;
  padding: 12px 28px;
  border-radius: 999px;
  border: 1.5px dashed rgba(15, 61, 38, 0.22);
  cursor: default;
}

/* --------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid rgba(15, 61, 38, 0.1);
  background: rgba(239, 233, 219, 0.5);
  padding: 30px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 800;
  font-size: 1rem;
  margin: 0 0 4px;
}
.foot-cedar { color: var(--green); }
.site-footer .copyright { opacity: 0.8; font-size: 0.85rem; margin-top: 6px; }

/* --------------------------------------------------------------- motion */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(143, 240, 180, 0.7); }
  70%  { box-shadow: 0 0 0 6px rgba(143, 240, 180, 0); }
  100% { box-shadow: 0 0 0 0 rgba(143, 240, 180, 0); }
}
.game-card { animation: rise 0.6s var(--ease) both; }
.games-grid .game-card:nth-child(2) { animation-delay: 0.07s; }
.games-grid .game-card:nth-child(3) { animation-delay: 0.14s; }
.games-grid .game-card:nth-child(4) { animation-delay: 0.21s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
}

/* =============================================================== responsive
   4 cols -> 2 cols (tablet) -> 1 col (phone).  No horizontal scroll. */
@media (max-width: 1040px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .games-grid { grid-template-columns: 1fr; gap: 16px; }
  .game-card { min-height: 0; padding: 26px 20px 24px; }
  .art, .art-svg { width: 104px; height: 104px; }
  .brand-mini .word { font-size: 1.05rem; }
  .hero { padding-top: 22px; }
  .hero .logo-wrap { width: min(420px, 82vw); }
  .game-card .desc { max-width: 30ch; }
}

/* safe-area for notched phones */
@supports (padding: max(0px)) {
  .container {
    padding-inline: max(clamp(20px, 4vw, 48px), env(safe-area-inset-left), env(safe-area-inset-right));
  }
}
