/* NilPlay — Nile twilight palette */
:root {
  --nile-indigo: #0B1A2B;
  --nile-indigo-mid: #122640;
  --nile-indigo-light: #1A3352;
  --papyrus-gold: #D4A017;
  --papyrus-gold-soft: #E8C547;
  --papyrus-gold-dim: rgba(212, 160, 23, 0.35);
  --nile-teal: #1A7A6D;
  --nile-teal-bright: #23A090;
  --nile-teal-dim: rgba(26, 122, 109, 0.25);
  --text-primary: #F0EDE4;
  --text-muted: #A8B8C8;
  --text-dim: #6B8094;
  --card-bg: rgba(18, 38, 64, 0.72);
  --header-h: 72px;
  --radius-pill: 999px;
  --radius-card: 16px;
  --font-display: "Noto Naskh Arabic", "Traditional Arabic", serif;
  --font-ui: "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  --gold-frame: linear-gradient(135deg, #D4A017 0%, #E8C547 25%, #B8860B 50%, #E8C547 75%, #D4A017 100%);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-ui);
  background: var(--nile-indigo);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 85% 8%, rgba(212, 160, 23, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 10% 90%, rgba(26, 122, 109, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #0B1A2B 0%, #0E2035 40%, #0B1A2B 100%);
  pointer-events: none;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 8%, rgba(232,197,71,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 35%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 28% 42%, rgba(255,255,255,0.15) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--papyrus-gold-soft); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--text-primary); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
  width: min(1140px, 92vw);
  margin-inline: auto;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(11, 26, 43, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(26, 122, 109, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1140px, 92vw);
  margin-inline: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--papyrus-gold);
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.geo-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1.1rem;
  background: var(--nile-teal-dim);
  border: 1px solid rgba(26, 122, 109, 0.45);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  color: var(--nile-teal-bright);
  white-space: nowrap;
}

.geo-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nile-teal-bright);
  box-shadow: 0 0 8px var(--nile-teal-bright);
}

/* ── Nile wave divider ── */
.nile-wave {
  display: block;
  width: 100%;
  height: 48px;
  overflow: hidden;
  color: var(--nile-teal);
  opacity: 0.55;
}

.nile-wave--gold { color: var(--papyrus-gold); opacity: 0.4; }

/* ── Hero ── */
.hero {
  padding: 3.5rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr 1.1fr;
    gap: 3rem;
  }
}

.hero-featured {
  order: -1;
}

@media (min-width: 900px) {
  .hero-featured { order: 0; }
}

.hero-copy {
  text-align: center;
}

@media (min-width: 900px) {
  .hero-copy { text-align: right; }
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--nile-teal-bright);
  margin-bottom: 0.75rem;
  padding: 0.3rem 0.9rem;
  border-right: 3px solid var(--papyrus-gold);
  background: rgba(26, 122, 109, 0.12);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.hero-title em {
  font-style: normal;
  color: var(--papyrus-gold);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 36ch;
  margin-inline: auto;
  margin-bottom: 1.75rem;
}

@media (min-width: 900px) {
  .hero-desc { margin-inline: 0 0 auto; }
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  background: linear-gradient(135deg, var(--nile-teal) 0%, #156B60 100%);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid rgba(35, 160, 144, 0.5);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(26, 122, 109, 0.35);
  color: var(--text-primary);
}

.featured-card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--card-bg);
}

.featured-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 3px;
  border-radius: inherit;
  background: var(--gold-frame);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.featured-card__img-wrap {
  aspect-ratio: 4/3;
  overflow: hidden;
}

.featured-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-card:hover .featured-card__img-wrap img {
  transform: scale(1.04);
}

.featured-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.featured-badge {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--papyrus-gold);
  margin-bottom: 0.4rem;
}

.featured-card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.featured-card__genre {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.featured-card__play {
  width: 100%;
  padding: 0.75rem;
  background: rgba(212, 160, 23, 0.15);
  border: 1px solid var(--papyrus-gold-dim);
  border-radius: 10px;
  color: var(--papyrus-gold-soft);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, border-color 0.2s;
}

.featured-card__play:hover {
  background: rgba(212, 160, 23, 0.28);
  border-color: var(--papyrus-gold);
}

/* ── Sections ── */
.section {
  padding: 3rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 2.25rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Game grid 2×4 ── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .games-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 960px) {
  .games-grid { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
}

.game-card {
  position: relative;
  border-radius: 14px;
  background: var(--card-bg);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: var(--gold-frame);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
  opacity: 0.7;
  transition: opacity 0.25s;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.game-card:hover::before { opacity: 1; }

.game-card__thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  cursor: pointer;
}

.game-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.game-card:hover .game-card__thumb img { transform: scale(1.06); }

.game-card__info {
  padding: 0.85rem 1rem 1rem;
}

.game-card__cat {
  font-size: 0.68rem;
  color: var(--nile-teal-bright);
  margin-bottom: 0.2rem;
}

.game-card__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 0.65rem;
  min-height: 2.8em;
}

.game-card__btn {
  width: 100%;
  padding: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--papyrus-gold);
  background: transparent;
  border: 1px solid var(--papyrus-gold-dim);
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.game-card__btn:hover {
  background: var(--papyrus-gold);
  color: var(--nile-indigo);
}

/* ── Nile picks (3 cards) ── */
.picks-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .picks-row { grid-template-columns: repeat(3, 1fr); }
}

.pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  background: linear-gradient(160deg, var(--nile-indigo-mid) 0%, var(--nile-indigo-light) 100%);
  overflow: hidden;
  border: 1px solid rgba(212, 160, 23, 0.2);
  transition: border-color 0.25s, transform 0.25s;
}

.pick-card:hover {
  border-color: var(--papyrus-gold);
  transform: translateY(-3px);
}

.pick-card__rank {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--papyrus-gold);
  color: var(--nile-indigo);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 50%;
  z-index: 3;
}

.pick-card__img {
  aspect-ratio: 16/10;
  overflow: hidden;
  cursor: pointer;
}

.pick-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pick-card__body {
  padding: 1rem 1.15rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pick-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.pick-card__desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 0.85rem;
}

.pick-card__btn {
  align-self: flex-start;
  padding: 0.5rem 1.2rem;
  background: var(--nile-teal);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.pick-card__btn:hover { background: var(--nile-teal-bright); }

/* ── How to play ── */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
}

.step-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: rgba(18, 38, 64, 0.5);
  border-radius: var(--radius-card);
  border: 1px solid rgba(26, 122, 109, 0.2);
  position: relative;
}

.step-card__num {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--nile-indigo);
  background: var(--papyrus-gold);
  border-radius: 50%;
}

.step-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--papyrus-gold-soft);
}

.step-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── Footer ── */
.site-footer {
  padding: 2.5rem 0 1.5rem;
  border-top: 1px solid rgba(26, 122, 109, 0.2);
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  max-width: 32ch;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--papyrus-gold);
  margin-bottom: 0.85rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li { margin-bottom: 0.45rem; }

.footer-col a {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-col a:hover { color: var(--papyrus-gold-soft); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(26, 122, 109, 0.15);
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ── Cookie banner ── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 1.25rem;
  background: rgba(11, 26, 43, 0.96);
  border-top: 1px solid rgba(212, 160, 23, 0.3);
  backdrop-filter: blur(12px);
  transform: translateY(100%);
  transition: transform 0.35s ease;
}

.cookie-banner.is-visible { transform: translateY(0); }

.cookie-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1140px, 92vw);
  margin-inline: auto;
}

.cookie-text {
  flex: 1;
  min-width: 240px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.cookie-text a { color: var(--papyrus-gold); }

.cookie-actions {
  display: flex;
  gap: 0.65rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.cookie-btn--accept {
  background: var(--nile-teal);
  color: var(--text-primary);
}

.cookie-btn--accept:hover { background: var(--nile-teal-bright); }

.cookie-btn--decline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(168, 184, 200, 0.3);
}

.cookie-btn--decline:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* ── Game modal ── */
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(5, 12, 20, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.game-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.game-modal__dialog {
  position: relative;
  width: min(960px, 96vw);
  background: var(--nile-indigo-mid);
  border-radius: 14px;
  border: 2px solid var(--papyrus-gold-dim);
  overflow: hidden;
  transform: scale(0.92);
  transition: transform 0.3s ease;
}

.game-modal.is-open .game-modal__dialog { transform: scale(1); }

.game-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(11, 26, 43, 0.6);
  border-bottom: 1px solid rgba(26, 122, 109, 0.25);
}

.game-modal__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--papyrus-gold-soft);
}

.game-modal__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--text-muted);
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.game-modal__close:hover {
  background: rgba(212, 160, 23, 0.15);
  color: var(--papyrus-gold);
}

.game-modal__frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: #000;
}

.game-modal__frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Legal pages ── */
.legal-page {
  padding: 2.5rem 0 4rem;
}

.legal-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--papyrus-gold);
  margin-bottom: 0.5rem;
}

.legal-page .legal-updated {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin: 1.75rem 0 0.65rem;
}

.legal-page p,
.legal-page li {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.legal-page ul {
  padding-right: 1.5rem;
  margin-bottom: 1rem;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--nile-teal-bright);
}

.legal-back:hover { color: var(--papyrus-gold-soft); }
