:root {
  --maghreb-green: #2f7d32;
  --maghreb-deep-green: #102616;
  --maghreb-gold: #f4bd32;
  --maghreb-sand: #f1d39b;
}

body {
  background: var(--maghreb-deep-green);
}

::selection {
  color: #102616;
  background: var(--maghreb-gold);
}

#jouer > .absolute.inset-0.z-0 {
  background: linear-gradient(
    180deg,
    rgb(7 27 13 / 42%) 0%,
    rgb(16 65 28 / 72%) 54%,
    rgb(8 35 17 / 92%) 100%
  ) !important;
}

#jeux {
  background-color: #195b2a !important;
}

#jeux > .absolute.inset-0.z-1 {
  background: linear-gradient(180deg, rgb(4 32 16 / 0%) 0%, #071d10 100%) !important;
}

.navbar-glass,
.server-dropdown {
  border-color: rgb(244 189 50 / 46%) !important;
}

a[href^="https://maghrebsmp.invalid"] {
  cursor: not-allowed;
  pointer-events: none !important;
}

.maghreb-trailer-showcase {
  position: relative;
  z-index: 2;
  width: 100%;
  box-sizing: border-box;
  padding: 64px 20px 72px;
}

.maghreb-trailer-frame {
  width: min(100%, 1040px);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 2px solid rgb(244 189 50 / 45%);
  border-radius: 18px;
  background: #000;
  box-shadow: 0 24px 70px rgb(0 0 0 / 50%);
}

.maghreb-trailer-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: auto;
  touch-action: manipulation;
}

/* Lenis disables iframe interaction globally while smooth scrolling is active. */
.lenis.lenis-smooth .maghreb-trailer-frame iframe {
  pointer-events: auto;
}

/* Preserve Arabic shaping while revealing treasure-map text progressively. */
.arabic-ink-line {
  display: block;
  direction: rtl;
  unicode-bidi: plaintext;
  opacity: 0;
  clip-path: inset(0 0 0 100%);
}

.arabic-ink-line-visible {
  animation-name: arabic-ink-reveal;
  animation-duration: var(--arabic-duration, 420ms);
  animation-delay: var(--arabic-delay, 0ms);
  animation-timing-function: steps(var(--arabic-steps, 8), end);
  animation-fill-mode: both;
}

@keyframes arabic-ink-reveal {
  from {
    opacity: 1;
    clip-path: inset(0 0 0 100%);
  }
  to {
    opacity: 1;
    clip-path: inset(0);
  }
}

@media (min-width: 1024px) {
  .maghreb-trailer-showcase {
    padding: 0 20px;
  }
}

/* Stats dropdown and coming-soon modal */
.server-dropdown .server-dropdown-item {
  direction: ltr;
  text-align: left;
}

.server-dropdown .server-dropdown-icon img {
  image-rendering: auto;
}

.stats-mobile-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: white;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease;
}

.stats-mobile-item:hover,
.stats-mobile-item:focus-visible {
  background: rgb(255 255 255 / 8%);
}

.stats-mobile-item:active {
  transform: scale(0.985);
}

.stats-mobile-item:focus-visible {
  outline: 2px solid rgb(244 189 50 / 75%);
  outline-offset: 2px;
}

.stats-mobile-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
  overflow: hidden;
  border: 1px solid rgb(244 189 50 / 20%);
  border-radius: 0.55rem;
  background: rgb(255 255 255 / 7%);
}

.stats-mobile-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.stats-mobile-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.stats-mobile-name {
  color: rgb(255 255 255 / 92%);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stats-mobile-description {
  margin-top: 0.2rem;
  color: rgb(255 255 255 / 40%);
  font-size: 0.7rem;
}

.stats-coming-overlay {
  animation: stats-overlay-in 180ms ease-out both;
}

.stats-coming-dialog {
  max-width: 40rem;
  min-height: 17.5rem;
  outline: none;
  animation: stats-dialog-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.stats-coming-content {
  width: 100%;
  min-height: 17.5rem;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4.75rem 2rem 3.75rem;
  text-align: center;
}

.stats-coming-title {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.625rem);
}

.stats-coming-bee {
  display: block;
}

@keyframes stats-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes stats-dialog-in {
  from { opacity: 0; transform: translateY(1rem) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .stats-coming-dialog {
    min-height: 14rem;
    border-radius: 1.5rem;
  }

  .stats-coming-content {
    min-height: 14rem;
    padding: 4.75rem 1rem 3rem;
  }

  .stats-coming-title {
    font-size: clamp(1.85rem, 9vw, 2.5rem);
  }

  .stats-coming-bee {
    top: 1.15rem;
    right: 4rem;
    width: 2.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stats-coming-overlay,
  .stats-coming-dialog {
    animation: none;
  }
}


/* Moroccan Darija locale */
html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] [class*="font-markup"] {
  font-family: Arial, "Noto Sans Arabic", sans-serif !important;
  letter-spacing: 0 !important;
}

html[dir="rtl"] .text-left {
  text-align: right !important;
}

html[dir="rtl"] .text-right {
  text-align: left !important;
}

html[dir="rtl"] code,
html[dir="rtl"] input,
html[dir="rtl"] .font-mono {
  direction: ltr;
  unicode-bidi: embed;
}

.ma-language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

body.burger-menu-open .social-orbit-root,
body.burger-menu-open .social-planet-btn,
body.burger-menu-open .social-orbit-item {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (min-width: 768px) {
  html[dir="rtl"] #jouer .server-panel-desktop-layout {
    flex-direction: row-reverse;
  }

  html[dir="rtl"] #jouer .server-platform-callout {
    flex-direction: row-reverse;
    left: -70px;
  }
}

@media (min-width: 1024px) {
  html[dir="rtl"] #discord span[aria-label] {
    transform: translateX(-130px);
  }
}
