/* Yazeed Games: noon in Najd. A saffron sky, sand below, coffee ink; each game is a sticker on its own colour. */
:root {
  --sun: #ffc93c;
  --coffee: #2b1607;
  --coffee-soft: #5b3714;
  --sand: #f6dfae;
  --cream: #fff4cf;
  --green: #006c35;
  --on-green: #ffffff;
  --beta: #ffd27a;
  --beta-ink: #3a2300;
  --ground: #2b1607;
  --ground-2: #3d2412;
  --ink: #efe4cc;
  --ink-soft: #c9bc9f;
  --gold: #d9a441;
  --gold-ink: #1b1306;
  --gutter: 16px;
  --max: 1320px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --display: 'Lalezar', 'Rubik', system-ui, 'Segoe UI', Tahoma, sans-serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--sand);
  color: var(--coffee);
  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(--coffee); outline-offset: 3px; }

/* The beta pill, the house shape: small, rounded, amber with dark ink. */
.beta {
  display: inline-block;
  padding: 2px 12px;
  border: 2px solid var(--beta-ink);
  border-radius: 999px;
  background: var(--beta);
  color: var(--beta-ink);
  font-family: 'Rubik', system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  white-space: nowrap;
}

/* Header: the sky */
.sky {
  background: var(--sun);
}

.bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}
.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(--coffee);
  color: var(--cream);
  cursor: pointer;
  transition: transform 160ms var(--ease);
}
.lang:hover { transform: rotate(-3deg); }
.lang:active { transform: scale(0.96); }

.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 7vw, 88px) var(--gutter) 8px;
}

.headline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 16px;
  padding-inline-end: clamp(88px, 16vw, 200px);
}

.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(54px, 13.5vw, 156px);
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
[dir='ltr'] .title { font-size: clamp(50px, 12vw, 150px); line-height: 1; }

.beta-title { font-size: 17px; padding: 4px 16px; margin-bottom: 0.9em; transform: rotate(-4deg); }

/* The stamp: a green round seal that says it is free. */
.stamp {
  position: absolute;
  top: clamp(24px, 6vw, 80px);
  inset-inline-end: var(--gutter);
  display: grid;
  place-items: center;
  width: clamp(84px, 14vw, 168px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--green);
  color: var(--on-green);
  font-family: var(--display);
  font-size: clamp(22px, 3.6vw, 44px);
  line-height: 1;
  text-align: center;
  box-shadow: 0 0 0 4px var(--sun), 0 0 0 7px var(--green);
  transform: rotate(-12deg);
}

.lede {
  margin: 20px 0 0;
  max-width: 34ch;
  text-wrap: balance;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.45;
  font-weight: 500;
}

.nos {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.nos li {
  padding: 6px 16px;
  border: 2px solid var(--coffee);
  border-radius: 12px;
  background: var(--cream);
  font-weight: 700;
  font-size: 16px;
  transform: rotate(-1.5deg);
}
.nos li:nth-child(even) { transform: rotate(1.5deg); }

.count {
  margin: 20px 0 0;
  color: var(--coffee-soft);
  font-size: 17px;
  font-weight: 500;
}

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

/* A phone on its side: a shorter sky so the games show sooner. */
@media (max-height: 500px) and (orientation: landscape) {
  .bar { padding-top: 10px; }
  .hero { padding-top: 6px; }
  .title, [dir='ltr'] .title { font-size: clamp(40px, 6.4vw, 60px); line-height: 1.05; }
  .beta-title { margin-bottom: 0.6em; }
  .stamp { width: 72px; top: 22px; font-size: 19px; box-shadow: 0 0 0 3px var(--sun), 0 0 0 5px var(--green); }
  .headline { padding-inline-end: 96px; }
  .lede { margin-top: 8px; font-size: 18px; max-width: 60ch; }
  .nos { margin-top: 10px; gap: 8px; }
  .nos li { padding: 3px 12px; font-size: 14px; }
  .count { margin-top: 8px; font-size: 15px; }
  .dunes { height: 28px; }
  .field { padding-top: 8px; }
}

/* The games */
.field {
  background: var(--sand);
  padding: 16px 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: 28px 20px;
}

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--field);
  color: var(--ink);
  border: 3px solid var(--coffee);
  border-radius: 20px;
  box-shadow: 6px 6px 0 var(--coffee);
  overflow: hidden;
  cursor: pointer;
  transition: transform 260ms var(--pop), box-shadow 260ms var(--ease);
}
.card:hover { transform: translateY(-6px) rotate(-1.2deg); box-shadow: 10px 12px 0 var(--coffee); }
.card:nth-child(even):hover { transform: translateY(-6px) rotate(1.2deg); }
.card:active { transform: translateY(-1px) scale(0.99); }
.card:focus-within { outline: 3px solid var(--coffee); outline-offset: 5px; }
.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.05); }

.badges {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* 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: 380px; }
  .card.feature .shot img { position: absolute; inset: 0; object-position: 50% 22%; }
  .card.feature .body { padding: 32px; justify-content: center; }
  .card.feature .name-main { font-size: clamp(56px, 6vw, 84px); }
  .card.feature .joke { font-size: 24px; max-width: 30ch; }
  .card.feature .line { max-width: 40ch; }
}

.ribbon {
  display: inline-block;
  padding: 2px 14px;
  border: 2px solid var(--gold-ink);
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
}

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

.name {
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  line-height: 1.15;
}
.name-main { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 4.4vw, 52px); }
.name-other { font-size: 17px; font-weight: 500; color: var(--ink-soft); }

.joke { margin: 0; font-size: 20px; line-height: 1.45; font-weight: 700; text-wrap: pretty; }
.line { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink-soft); 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: 8px 28px;
  border: 3px solid var(--gold-ink);
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--gold-ink);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), background-color 160ms var(--ease);
}
.play:hover, .card:hover .play { background: #e8b75a; }
.play:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-ink); }

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

/* Footer: the night after the games */
.end {
  background: var(--ground);
  color: var(--ink);
  padding: clamp(56px, 8vw, 112px) var(--gutter) 40px;
}
.end > * { max-width: var(--max); margin-inline: auto; }
.more {
  margin-top: 0;
  margin-bottom: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(48px, 10vw, 120px);
  line-height: 1.1;
  color: var(--sun);
}
.foot-joke { margin-top: 12px; margin-bottom: 0; font-size: clamp(18px, 2vw, 22px); font-weight: 500; }
.year { margin-top: 24px; margin-bottom: 0; color: var(--ink-soft); font-size: 16px; }
.year .v { unicode-bidi: isolate; }

/* The one-second paper burst (app.js adds it once per visit, never for reduced motion). */
.confetti { position: fixed; inset: 0; z-index: 50; overflow: hidden; pointer-events: none; }
.confetti i {
  position: absolute;
  top: -16px;
  left: var(--x);
  width: 9px;
  height: 14px;
  border-radius: 2px;
  background: var(--c);
  animation: fall 820ms cubic-bezier(0.3, 0.6, 0.5, 1) var(--d) both;
}
@keyframes fall {
  from { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  80% { opacity: 1; }
  to { transform: translate(var(--dx), 72vh) rotate(var(--r)); opacity: 0; }
}

/* Motion: the sky pops in once and the cards rise in turn; nothing moves for those who ask for less. */
@media (prefers-reduced-motion: no-preference) {
  .card { animation: rise 520ms var(--ease) backwards; animation-delay: calc(120ms + var(--i, 0) * 70ms); }
  .title, .lede, .nos, .count { animation: rise 600ms var(--ease) backwards; }
  .lede { animation-delay: 80ms; }
  .nos { animation-delay: 140ms; }
  .count { animation-delay: 200ms; }
  .stamp { animation: slap 520ms var(--pop) 260ms backwards; }
  .beta-title { animation: slap-small 420ms var(--pop) 340ms backwards; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes slap {
  from { opacity: 0; transform: scale(2.2) rotate(8deg); }
  to { opacity: 1; transform: rotate(-12deg); }
}
@keyframes slap-small {
  from { opacity: 0; transform: scale(1.8) rotate(4deg); }
  to { opacity: 1; transform: rotate(-4deg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  .card:hover, .card:nth-child(even):hover, .card:hover .shot img { transform: none; }
}
