/* ============================================================
   Global Voices — Games page (/games)

   The Dino Land post, its trailer, and the playable game in a
   frame. Uses the site's own tokens from styles.css: navy
   surfaces, the orange-to-gold accent, pill buttons, 1.5rem
   panels. Nothing here introduces a new colour.
   ============================================================ */

/* ---------- 1. Page head ---------- */
.games-head {
  max-width: 46rem;
  margin: 0 auto;
  padding-block: clamp(2.25rem, 5vw, 3.5rem) clamp(1.5rem, 3vw, 2.25rem);
  text-align: center;
}
.games-head__kicker {
  margin: 0 0 0.9rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.games-head__title {
  margin: 0 0 0.9rem;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.games-head__lede {
  margin: 0 auto;
  max-width: 38rem;
  font-size: clamp(1.02rem, 2.2vw, 1.18rem);
  line-height: 1.7;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ---------- 2. The post (opens WhatsApp) ---------- */
.dino-post {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-card);
  text-decoration: none;
  transition: box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.dino-post__img {
  width: 100%;
  height: auto;
  aspect-ratio: 2000 / 1131;
  object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.dino-post:hover,
.dino-post:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px rgba(255, 138, 30, 0.55), var(--shadow-card-hover);
}
.dino-post:hover .dino-post__img { transform: scale(1.015); }
.dino-post:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.dino-post__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: clamp(0.9rem, 2vw, 1.15rem) clamp(1rem, 2.5vw, 1.6rem);
  background: var(--panel-grad);
  border-top: 1px solid var(--line);
}
.dino-post__label { color: var(--ink); font-weight: 800; font-size: clamp(1rem, 2vw, 1.12rem); }
.dino-post__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--grad-btn);
  color: #fff;
  font-weight: 800;
  font-size: 0.98rem;
  box-shadow: var(--glow-orange);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.dino-post:hover .dino-post__hint { transform: translateY(-3px) scale(1.03); }

.dino-wa { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- 3. Trailer + copy ---------- */
.dino-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3.25rem);
  align-items: start;
  margin-top: clamp(2rem, 4.5vw, 3.25rem);
}

.dino-video {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #03040a;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-card);
  aspect-ratio: 16 / 9;
}
.dino-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #03040a;
}
/* After the last frame ("Click to register via WhatsApp") a video
   cannot be clicked, so the button it asks for appears over it. */
.dino-video__end {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 14%;
  margin-inline: auto;
  width: max-content;
  max-width: calc(100% - 2rem);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  background: var(--grad-btn);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--glow-orange);
  animation: dinoRise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.dino-video__end[hidden] { display: none; }

/* The copy column is the taller one, so the trailer stays in view
   beside it while the visitor reads. */
@media (min-width: 901px) {
  .dino-video { position: sticky; top: 6.5rem; }
}

.dino-copy { min-width: 0; }
.dino-copy__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  text-wrap: balance;
}
.dino-copy__lede {
  margin: 0 0 1.4rem;
  max-width: 34rem;
  line-height: 1.7;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.dino-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.5rem;
  margin: 0 0 1.4rem;
  padding-block: 1.25rem;
  border-block: 1px solid var(--line);
}
.dino-facts dt {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gold);
}
.dino-facts dd { margin: 0; line-height: 1.5; color: var(--ink); }

.dino-copy__workshop { margin: 0 0 1.25rem; line-height: 1.7; color: var(--ink-soft); max-width: 34rem; }

.dino-copy__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.dino-btn { padding-inline: 1.7rem; }
.dino-copy__phone { margin: 0; color: var(--ink-faint); font-size: 0.95rem; }
.dino-copy__phone a { color: var(--gold); font-weight: 800; text-decoration: none; }
.dino-copy__phone a:hover { text-decoration: underline; }

/* ---------- 4. The game ---------- */
.dino-play { margin-top: clamp(3.25rem, 7vw, 5rem); }

.dino-play__head {
  max-width: 44rem;
  margin: 0 auto clamp(1.5rem, 3vw, 2rem);
  text-align: center;
}
.dino-play__title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  text-wrap: balance;
}
.dino-play__head p { margin: 0 auto; max-width: 38rem; line-height: 1.7; color: var(--ink-soft); text-wrap: pretty; }

.dino-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: calc(100svh - 7rem);
  margin-inline: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line), 0 30px 70px -30px rgba(42, 108, 255, 0.45), var(--shadow-card);
}
.dino-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #8fd3ff;
}
.dino-stage:fullscreen { aspect-ratio: auto; max-height: none; width: 100%; height: 100%; border-radius: 0; }
.dino-stage:-webkit-full-screen { aspect-ratio: auto; max-height: none; width: 100%; height: 100%; border-radius: 0; }

.dino-stage__cover { position: absolute; inset: 0; display: grid; place-items: center; }
.dino-stage__cover[hidden] { display: none; }
.dino-stage__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) saturate(1.05);
  transform: scale(1.04);
}
.dino-stage__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(5, 7, 15, 0) 30%, rgba(5, 7, 15, 0.7) 100%);
  pointer-events: none;
}
.dino-stage__cta { position: relative; z-index: 1; display: grid; justify-items: center; gap: 0.9rem; padding: 1rem; text-align: center; }

.dino-stage__start {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  font-weight: 900;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.dino-stage__play {
  position: relative;
  width: clamp(76px, 10vw, 104px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--grad-btn);
  box-shadow: 0 0 0 8px rgba(255, 138, 30, 0.18), var(--glow-orange);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.dino-stage__play::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.95rem 0 0.95rem 1.55rem;
  border-color: transparent transparent transparent #fff;
  transform: translateX(12%);
}
.dino-stage__start:hover .dino-stage__play,
.dino-stage__start:focus-visible .dino-stage__play {
  transform: scale(1.07);
  box-shadow: 0 0 0 14px rgba(255, 138, 30, 0.2), 0 18px 40px -10px rgba(255, 138, 30, 0.75);
}
.dino-stage__start:active .dino-stage__play { transform: scale(0.97); }
.dino-stage__start:focus-visible { outline: 3px solid var(--gold); outline-offset: 8px; border-radius: 1rem; }
.dino-stage__note { margin: 0; font-size: 0.9rem; color: #dde6f7; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); }

.dino-stage__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-weight: 700;
  pointer-events: none;
}

.dino-stage__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.1rem;
}
.dino-bar__btn { padding: 0.7rem 1.4rem; font-size: 0.95rem; text-decoration: none; }

@keyframes dinoRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 5. Smaller screens ---------- */
@media (max-width: 900px) {
  .dino-intro { grid-template-columns: 1fr; }
  .dino-copy__lede, .dino-copy__workshop { max-width: none; }
}
@media (max-width: 640px) {
  .dino-post__bar { justify-content: center; text-align: center; }
  .dino-post__hint { width: 100%; justify-content: center; }
  .dino-facts { grid-template-columns: 1fr; gap: 0.9rem; }
  .dino-copy__actions .btn { width: 100%; }
  /* The game is built to work in portrait, so the frame gets taller. */
  .dino-stage { aspect-ratio: 3 / 4; max-height: 78svh; }
  .dino-bar__btn { width: 100%; }
}

/* ---------- 6. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .dino-post, .dino-post__img, .dino-post__hint, .dino-stage__play { transition: none; }
  .dino-post:hover, .dino-post:hover .dino-post__img, .dino-post:hover .dino-post__hint { transform: none; }
  .dino-video__end { animation: none; }
}
