@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/assets/fonts/naskh-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

:root {
  --ink: #f5f5f5;
  --muted: #a3a3a3;
  --bg: #000000;
  --card: #141414;
  --line: #262626;
  --accent: #f4f4f5;
  --accent-ink: #0a0a0a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --max: 1180px;
  --font: "Outfit", "Noto Naskh Arabic", "Segoe UI", sans-serif;
  --display: "Outfit", "Noto Naskh Arabic", "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 1.02rem;
  font-weight: 450;
  line-height: 1.6;
  letter-spacing: -0.011em;
}

html[dir="rtl"] body {
  font-family: "Noto Naskh Arabic", "Outfit", "Segoe UI", sans-serif;
  letter-spacing: 0;
  line-height: 1.85;
}

img { max-width: 100%; height: auto; }

a { color: var(--ink); }

h1, h2, h3, .logo-word, .hero-title {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin: 0;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .hero-title {
  font-family: "Noto Naskh Arabic", "Outfit", sans-serif;
  letter-spacing: 0;
  line-height: 1.4;
  font-weight: 700;
}

html[dir="rtl"] .logo-word {
  font-family: "Outfit", "Segoe UI", sans-serif;
  letter-spacing: -0.03em;
}

p { margin: 0; }

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -48px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 60;
}

.skip:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 16px;
  align-items: center;
  padding: 16px 0 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.logo-word { font-size: 1.2rem; font-weight: 600; }

.search {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #111111;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  min-height: 44px;
}

.search svg { flex: none; color: var(--muted); }

.search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  min-height: 42px;
  outline: none;
}

.search input::placeholder { color: #737373; font-weight: 500; }

.langs {
  display: flex;
  gap: 4px;
  justify-self: end;
  overflow-x: auto;
  max-width: 100%;
}

.langs a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 560;
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 7px 9px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.langs a[aria-current="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 16px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chips a {
  text-decoration: none;
  color: #d4d4d4;
  background: #111111;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 550;
  white-space: nowrap;
}

.chips a:hover,
.chips a[aria-current="page"] {
  border-color: #3a3a3a;
  background: #1a1a1a;
  color: var(--ink);
}

main { padding: 28px 0 80px; }

.hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 320px;
  background: #0a0a0a;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 36px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  text-decoration: none;
  color: white;
  opacity: 0;
  visibility: hidden;
}

.hero-slide.is-active { opacity: 1; visibility: visible; position: relative; min-height: 320px; }

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 20%, rgba(0, 0, 0, 0.82) 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 28px;
  display: grid;
  gap: 12px;
  max-width: 36rem;
}

.hero-title { font-size: clamp(2.2rem, 6vw, 4rem); }

.hero-copy p { color: #e5e5e5; max-width: 42ch; }

.hero-dots {
  position: absolute;
  z-index: 2;
  inset-inline-end: 16px;
  bottom: 16px;
  display: flex;
  gap: 6px;
}

.hero-dots button {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.45);
  padding: 0;
  cursor: pointer;
}

.hero-dots button[aria-current="true"] { background: var(--accent); width: 22px; }

.shelf { margin: 12px 0 40px; }

.shelf-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  align-items: end;
  margin-bottom: 12px;
}

.shelf-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

.shelf-head p { color: var(--muted); max-width: 46ch; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px;
}

.card {
  display: grid;
  align-content: start;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #3a3a3a;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0a0a0a;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.card:hover .thumb img { transform: scale(1.035); }

.hero-copy .tag {
  position: static;
  justify-self: start;
}

.hero-copy .btn { justify-self: start; min-width: 9rem; }

.intro-line { margin-bottom: 14px; color: var(--muted); }
.rail-note { margin-bottom: 12px; color: var(--muted); }

.tag {
  position: absolute;
  inset-inline-start: 10px;
  top: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 560;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 4px 8px;
}

.card-body { padding: 12px 12px 14px; display: grid; gap: 4px; }

.card-body h3 { font-size: 1.15rem; }

.meta { color: var(--muted); font-weight: 700; font-size: 0.88rem; }

.soon-card {
  border: 1px dashed #333333;
  background: #111111;
  border-radius: var(--radius);
  padding: 18px;
  max-width: 520px;
  color: var(--muted);
}

.badge, .pill {
  display: inline-flex;
  align-items: center;
  background: #1a1a1a;
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 560;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 560;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  color: inherit;
}

.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #ffffff; color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: #333333; color: var(--ink); }
.btn.ghost:hover { border-color: #737373; color: var(--ink); }
.btn.small { padding: 9px 14px; font-size: 0.92rem; }

.search-empty {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
}

.play-layout { display: grid; gap: 22px; }

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-weight: 560;
  margin-bottom: 12px;
}

.crumb a { text-decoration: none; }

.kicker {
  color: #a3a3a3;
  font-weight: 560;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[dir="rtl"] .kicker { letter-spacing: 0; text-transform: none; font-size: 0.95rem; }

.stage-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.stage-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.frame-shell {
  width: min(1080px, 100%);
  margin-inline: auto;
  height: min(78dvh, 760px);
  min-height: 480px;
  background: #000000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
}

.frame-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000000;
}

.frame-shell:fullscreen,
.frame-shell:-webkit-full-screen {
  border: 0;
  border-radius: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.game-panel { display: grid; gap: 16px; margin-top: 22px; }

.game-panel h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stats div {
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  border: 1px solid var(--line);
}

.stats b { display: block; font-family: var(--display); font-size: 1.45rem; }

.stats span { color: var(--muted); font-weight: 700; font-size: 0.9rem; }

.prose { display: grid; gap: 12px; max-width: 70ch; }
.prose h2 { font-size: 1.45rem; margin-top: 8px; }
.prose ol, .prose ul { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: 8px; }
.prose li, .lead { color: #d4d4d4; }

.shots { display: grid; gap: 12px; }
.shots figure {
  margin: 0;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
}
.shots figcaption { padding: 10px 12px 12px; color: var(--muted); font-weight: 700; }
.shots img { display: block; width: 100%; }

.rail h2 { margin-bottom: 12px; }

.page-intro { display: grid; gap: 10px; margin-bottom: 18px; max-width: 70ch; }
.page-intro h1 { font-size: clamp(2rem, 5vw, 3.2rem); }

.email {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #000000;
  padding: 28px 0 36px;
}

.foot { display: grid; gap: 16px; }
.foot p { color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.foot-links a { font-weight: 550; text-decoration: none; }
.kofi {
  justify-self: start;
  background: var(--accent);
  color: var(--accent-ink) !important;
  text-decoration: none;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 16px;
}
.fine { color: #737373; font-size: 0.92rem; }

.lang-pick { display: grid; gap: 10px; margin-top: 16px; }
.lang-pick a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  text-decoration: none;
  font-weight: 560;
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (min-width: 860px) {
  .bar {
    grid-template-columns: auto minmax(220px, 1fr) auto;
  }
  .search { grid-column: auto; }
  .hero { min-height: 460px; }
  .hero-slide.is-active { min-height: 460px; }
  .hero-copy { padding: 36px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .play-layout { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
  .rail { position: sticky; top: 92px; }
  .shots { grid-template-columns: 1.4fr 0.8fr; }
  .foot { grid-template-columns: 1.4fr 1fr auto; align-items: center; }
}

@media (max-width: 700px) {
  .frame-shell { min-height: 0; height: 72dvh; border-radius: 16px; }
  .stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .thumb img, .hero-slide { transition: none; }
  .card:hover { transform: none; }
  .card:hover .thumb img { transform: none; }
}

/* Homepage catalog and game introductions */
.game-catalog { margin-block: 20px 32px; }
.game-catalog h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3.4rem); line-height: 1.1; }
.game-catalog .shelf-head p { max-width: 66ch; margin-top: 8px; }
.game-catalog .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game-intro { padding: 16px 16px 8px; }
.game-intro h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 4vw, 2.65rem); line-height: 1.1; }
.game-intro .lead { margin: 0; }
@media (max-width: 650px) {
  .game-catalog .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stage-actions { flex-grow: 1; }
  .stage-actions #fullscreen-play { width: 100%; }
}
@media (max-width: 355px) {
  .game-catalog .card-grid { grid-template-columns: minmax(0, 1fr); }
}
