/* =====================================================================
   Games page (games.html): inline game players.
   Each game is its own page under /games and is embedded in an <iframe>
   only after the visitor presses Play, so the page itself stays light.
   ===================================================================== */

.gm-section { padding-top: clamp(2.5rem, 6vw, 4.5rem); }

.gm-game { max-width: 1080px; margin: 0 auto clamp(3rem, 7vw, 5rem); scroll-margin-top: 96px; }
.gm-info { max-width: 720px; margin-bottom: 1.25rem; }
.gm-info h2 { font-size: clamp(1.9rem, 4.4vw, 2.8rem); margin: 0.25rem 0 0.5rem; }
.gm-info p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.6; margin-bottom: 0.9rem; }

.gm-player { border-radius: 22px; overflow: hidden; background: #12141b; border: 1px solid rgba(124, 77, 255, 0.28); box-shadow: 0 24px 60px rgba(27, 31, 42, 0.22); }

.gm-frame { position: relative; aspect-ratio: 16 / 9; max-height: 82vh; width: 100%; background: #12141b; }
.gm-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

.gm-poster { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; background: #12141b; display: block; overflow: hidden; }
.gm-poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease, filter 0.3s ease; }
.gm-poster::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(18, 20, 27, 0.15), rgba(18, 20, 27, 0.6)); pointer-events: none; }
.gm-poster:hover img { transform: scale(1.03); }
.gm-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; display: inline-flex; align-items: center; gap: 0.6rem; font-family: 'Clash Display', 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(1.1rem, 2.6vw, 1.5rem); color: #fff; background: #7c4dff; padding: 0.85em 1.5em 0.85em 1.25em; border-radius: 999px; box-shadow: 0 14px 40px rgba(124, 77, 255, 0.55); transition: transform 0.15s ease, background 0.15s ease; }
.gm-play-ico { font-size: 0.8em; }
.gm-poster:hover .gm-play { transform: translate(-50%, -50%) scale(1.06); background: #8d63ff; }
.gm-poster:focus-visible { outline: 3px solid #b8a2ff; outline-offset: -3px; }

.gm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.7rem 1rem; background: #1b1f2a; color: #c9c5de; font-size: 0.86rem; }
.gm-hint b { color: #fff; font-weight: 700; }
.gm-bar-actions { display: inline-flex; gap: 0.5rem; margin-left: auto; }
.gm-link { appearance: none; font: inherit; font-weight: 700; font-size: 0.86rem; color: #fff; background: transparent; border: 1px solid rgba(184, 162, 255, 0.45); border-radius: 999px; padding: 0.42em 1em; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s; }
.gm-link:hover { background: rgba(124, 77, 255, 0.3); border-color: #b8a2ff; }
.gm-link:focus-visible { outline: 3px solid #b8a2ff; outline-offset: 2px; }
.gm-link[hidden] { display: none; }

.gm-foot { max-width: 720px; margin: 0 auto; text-align: center; color: var(--text-muted); font-size: 0.98rem; line-height: 1.6; }
.gm-foot a { color: var(--primary); font-weight: 700; }

/* ----- Promo card on demos.html that links to the Games page ----- */
.gm-promo { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; align-items: stretch; margin: 0 0 2rem; border-radius: 22px; overflow: hidden; text-decoration: none; background: #1b1f2a; color: #f5f3ff; border: 1px solid rgba(124, 77, 255, 0.35); box-shadow: 0 14px 40px rgba(27, 31, 42, 0.18); transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; }
.gm-promo:hover { transform: translateY(-3px); border-color: #7c4dff; box-shadow: 0 18px 50px rgba(124, 77, 255, 0.28); }
.gm-promo:focus-visible { outline: 3px solid #7c4dff; outline-offset: 3px; }
.gm-promo-thumb { display: block; position: relative; min-height: 170px; overflow: hidden; }
.gm-promo-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s; }
.gm-promo:hover .gm-promo-thumb img { transform: scale(1.04); }
.gm-promo-body { display: grid; align-content: center; gap: 0.4rem; padding: 1.4rem 1.6rem; }
.gm-promo-body .dm-kicker { color: #b8a2ff; }
.gm-promo-body strong { font-family: 'Clash Display', 'Space Grotesk', sans-serif; font-weight: 600; font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.2; color: #fff; }
.gm-promo-text { color: #c9c5de; font-size: 0.98rem; line-height: 1.5; max-width: 52ch; }
.gm-promo-cta { justify-self: start; margin-top: 0.5rem; font-weight: 700; font-size: 0.95rem; color: #fff; background: #7c4dff; padding: 0.6em 1.2em; border-radius: 999px; }
@media (max-width: 640px) {
  .gm-promo { grid-template-columns: 1fr; }
  .gm-promo-thumb { aspect-ratio: 16 / 9; min-height: 0; }
  .gm-promo-body { padding: 1.15rem 1.2rem 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .gm-promo, .gm-promo-thumb img { transition: none; }
}

/* Phones: a taller frame suits both games, and the hint drops under the buttons */
@media (max-width: 720px) {
  .gm-frame { aspect-ratio: 2 / 3; max-height: 78vh; }
  .gm-poster img { object-position: 64% 50%; }
  .gm-player { border-radius: 16px; }
  .gm-hint { order: 2; width: 100%; font-size: 0.8rem; }
  .gm-bar-actions { margin-left: 0; width: 100%; }
  .gm-bar-actions .gm-link { flex: 1; text-align: center; }
}
@media (max-width: 720px) and (orientation: landscape) {
  .gm-frame { aspect-ratio: 16 / 9; max-height: 86vh; }
}

@media (prefers-reduced-motion: reduce) {
  .gm-poster img, .gm-play { transition: none; }
}
