/* Yazeed Games: a night in Najd. One ground, sand ink, one gold accent; each card takes its game's own colour. */
:root {
  --ground: #0b0e1a;
  --ground-2: #1a2036;
  --ink: #efe4cc;
  --ink-soft: #c9bc9f;
  --gold: #d9a441;
  --gold-ink: #1b1306;
  --gutter: 16px;
  --max: 1320px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Rubik', system-ui, 'Segoe UI', Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

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

/* Header */
.top {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px var(--gutter) 40px;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(40px, 8vw, 96px);
}

.mark { display: block; border-radius: 10px; }
.mark img { width: 40px; height: 40px; }

.lang {
  font: inherit;
  font-weight: 500;
  font-size: 16px;
  min-height: 44px;
  padding: 8px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--ground-2);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}
.lang:hover { background: #262e4c; }
.lang:active { transform: scale(0.96); }

.title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(64px, 15vw, 168px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
[dir='rtl'] .title { letter-spacing: 0; line-height: 1.1; }
/* The Latin title is wider than the Arabic one: sized down and allowed to wrap, so it never pushes the page sideways. */
[dir='ltr'] .title { font-size: clamp(40px, 10.5vw, 168px); white-space: normal; overflow-wrap: anywhere; }

.lede {
  margin: 24px 0 0;
  max-width: 40ch;
  text-wrap: balance;
  font-size: clamp(19px, 2.2vw, 26px);
  line-height: 1.45;
  font-weight: 500;
}

.count {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.dunes { display: block; width: 100%; height: clamp(48px, 8vw, 120px); }

/* The games */
.field {
  background: #232a44;
  padding: 8px 0 clamp(64px, 10vw, 140px);
}

.games {
  list-style: none;
  margin: 0 auto;
  padding: 0 var(--gutter);
  max-width: var(--max);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

@media (min-width: 768px) {
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (min-width: 1200px) {
  .games { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--field);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 220ms var(--ease), background-color 220ms var(--ease);
}
.card:hover { transform: translateY(-4px); }
.card:active { transform: translateY(-1px) scale(0.99); }
.card:focus-within { outline: 3px solid var(--gold); outline-offset: 4px; }
.card:focus-within .play:focus-visible { outline-color: var(--ink); }

.shot {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
  transition: transform 420ms var(--ease);
}
.shot.wide img { object-position: 50% 50%; }
.card:hover .shot img { transform: scale(1.04); }

/* The newest game takes the rest of its row and lies on its side. */
@media (min-width: 768px) {
  .card.feature { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .card.feature .shot { aspect-ratio: auto; min-height: 360px; }
  .card.feature .shot img { position: absolute; inset: 0; object-position: 50% 22%; }
  .card.feature .body { padding: 32px 32px 32px; justify-content: center; }
  .card.feature .name-main { font-size: clamp(48px, 5vw, 72px); }
  .card.feature .line { font-size: 19px; max-width: 36ch; }
}

.ribbon {
  position: absolute;
  top: 16px;
  inset-inline-start: 0;
  padding: 6px 16px;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 700;
  font-size: 16px;
  border-start-end-radius: 999px;
  border-end-end-radius: 999px;
}

.body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  padding: 20px 20px 22px;
}

.name {
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-weight: 800;
  line-height: 1.1;
}
.name-main { font-size: clamp(36px, 4.2vw, 48px); }
.name-other { font-size: 17px; font-weight: 500; color: var(--ink-soft); }

.line { margin: 0; font-size: 17px; line-height: 1.55; text-wrap: pretty; }

.foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.ver { font-size: 15px; color: var(--ink-soft); }

.input {
  font-size: 15px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
}

.play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 112px;
  padding: 10px 28px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 700;
  font-size: 19px;
  text-decoration: none;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.play:hover, .card:hover .play { background: #e8b75a; }
.play:active { transform: scale(0.96); }

.plain { margin: 0 auto; max-width: var(--max); padding: 0 var(--gutter); font-size: 22px; }
.plain a { color: var(--gold); }

/* Footer */
.end {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 112px) var(--gutter) 40px;
}
.more {
  margin: 0;
  font-weight: 800;
  font-size: clamp(44px, 9vw, 112px);
  line-height: 1.05;
  color: var(--gold);
}
.year { margin: 16px 0 0; color: var(--ink-soft); font-size: 16px; }
.year .v { unicode-bidi: isolate; }

/* Motion: cards rise in turn once; nothing moves for those who ask for less. */
@media (prefers-reduced-motion: no-preference) {
  .card { animation: rise 520ms var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
  .title, .lede, .count { animation: rise 600ms var(--ease) both; }
  .lede { animation-delay: 80ms; }
  .count { animation-delay: 140ms; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  .card:hover, .card:hover .shot img { transform: none; }
}
