/* ============================================================
 * GAMES — games.html / games-de.html (tools/build-games.js)
 * The card game is the feature (wide card, art left), the games you can
 * play right now stand below on one wooden shelf — the same wood as the
 * demo's table, the same paper cards and black outlines as the site.
 * ============================================================ */

.games-body { background: transparent; color: var(--paper); font-size: 19px; }
.games-header { padding-inline: var(--gutter); }

.games-main {
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding: clamp(28px, 5vw, 64px) var(--gutter) var(--s-8);
}

/* ---------- page head ---------- */
.gm-head { max-width: 760px; margin-bottom: clamp(28px, 3.5vw, 48px); }
.gm-h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 88px);
  line-height: .95;
  text-transform: uppercase;
  -webkit-text-stroke: .1em var(--card-black);
  paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--card-black);
  text-wrap: balance;
}
.gm-lead { margin: var(--s-5) 0 0; max-width: 52ch; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.45; color: var(--paper-dim); text-wrap: pretty; }

/* ---------- one game card (shared) ---------- */
.gm-game {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink-text);
  border: 4px solid var(--card-black);
  border-radius: 16px;
  box-shadow: 0 8px 0 var(--card-black), 0 30px 50px -28px rgba(0, 0, 0, .8);
  overflow: hidden;
}
.gm-art { position: relative; background: var(--card-sky); border-bottom: 4px solid var(--card-black); }
.gm-art img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 0; }
.gm-badge {
  position: absolute;
  left: 14px;
  bottom: 12px;
  padding: 7px 12px 4px;
  border: 3px solid var(--card-black);
  border-radius: 8px;
  box-shadow: 0 4px 0 var(--card-black);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.gm-badge--live { background: #6fe39a; color: #062b18; }
.gm-badge--free { background: var(--gold); color: #1d1300; }

.gm-body { display: flex; flex-direction: column; flex: 1; padding: clamp(20px, 2.2vw, 28px); }
.gm-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink-text);
  text-wrap: balance;
}
.gm-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; }
.gm-facts li { padding: 4px 11px 3px; border: 2px solid var(--card-black); border-radius: 999px; font-size: 16px; line-height: 1.2; background: #fff; }
.gm-text { margin: 14px 0 0; max-width: 46ch; font-size: 18px; line-height: 1.5; color: var(--ink-secondary); text-wrap: pretty; }
.gm-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 22px; }

/* ---------- the feature: the card game, art left ---------- */
.gm-feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.gm-feature .gm-art { border-bottom: 0; border-right: 4px solid var(--card-black); }
.gm-feature .gm-art img { height: 100%; aspect-ratio: auto; object-position: 50% 30%; }
.gm-feature .gm-body { justify-content: center; padding: clamp(24px, 3vw, 44px); }
.gm-feature .gm-title { font-size: clamp(30px, 3.2vw, 46px); }
.gm-feature .gm-actions { margin-top: 0; padding-top: 26px; }

/* ---------- play now: two games on a wooden shelf ---------- */
.gm-play { margin-top: clamp(56px, 7vw, 96px); }
.gm-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1;
  text-transform: uppercase;
  -webkit-text-stroke: .09em var(--card-black);
  paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--card-black);
}
.gm-sub { margin: 10px 0 0; font-size: 19px; color: var(--paper-dim); }

.gm-shelf {
  position: relative;
  z-index: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(20px, 3vw, 40px);
  margin-top: clamp(22px, 3vw, 32px);
  padding: 0 clamp(14px, 2.4vw, 32px) clamp(34px, 4vw, 46px);
}
.gm-shelf::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(30px, 3.6vw, 42px);
  border: 4px solid var(--card-black);
  border-radius: 10px;
  background:
    repeating-linear-gradient(92deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 46px),
    linear-gradient(180deg, #7a4a22, #5a3519 55%, #3a210c);
  box-shadow: 0 12px 0 rgba(0, 0, 0, .45), 0 30px 50px -20px #000;
}
.gm-shelf .gm-game { margin-bottom: -4px; } /* standing on the plank */

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) and (min-width: 721px) {
  .gm-shelf:has(> .gm-game:nth-child(3)) { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gm-shelf:has(> .gm-game:nth-child(3)) .gm-game:first-child { grid-column: 1 / -1; }
  .gm-shelf:has(> .gm-game:nth-child(3)) .gm-game:first-child .gm-art img { aspect-ratio: 21 / 9; }
}
@media (max-width: 960px) {
  .gm-feature { grid-template-columns: minmax(0, 1fr); }
  .gm-feature .gm-art { border-right: 0; border-bottom: 4px solid var(--card-black); }
  .gm-feature .gm-art img { height: auto; aspect-ratio: 16 / 9; }
}
@media (max-width: 720px) {
  .gm-shelf { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 0; }
  .gm-shelf::after { display: none; }
  .gm-shelf .gm-game { margin-bottom: 0; }
}
@media (max-width: 480px) {
  .gm-actions .btn { flex: 1 1 100%; max-width: 100%; }
  .gm-actions .btn__face { justify-content: center; white-space: normal; text-align: center; line-height: 1.1; }
}
