/* Games (/games/, /en/games/): the one page with its own style. The header, the footer and the
   logo stay the site's; between them, an arcade at night. Class prefix: gm-.
   Headings are set in Handjet, a modular pixel face that has Arabic as well as Latin, loaded on
   this page only (SIL Open Font License, assets/fonts/handjet-OFL.txt). The sprite on the screen is
   the site's own 32-pixel icon, drawn big with its pixels showing. */
@font-face { font-family: "Handjet"; src: url("/assets/fonts/handjet-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Handjet"; src: url("/assets/fonts/handjet-arabic.woff2") format("woff2"); font-weight: 400 800; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

.gm {
  --gm-bg: #120a2e; --gm-bg2: #190e40; --gm-panel: #241659; --gm-ink: #f5f2ff; --gm-dim: #c1b8ec;
  --gm-cyan: #43e6ff; --gm-pink: #ff5fc9; --gm-gold: #ffc53d; --gm-deep: #1a0f3d; --gm-line: rgba(193,184,236,.22);
  --gm-px: "Handjet", var(--f-display);
  background: var(--gm-bg); color: var(--gm-ink);
}
/* The pixel grid under every section. */
.gm-hero, .gm-sec, .gm-cta {
  position: relative;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 8px 8px;
}

/* ---------- hero ---------- */
.gm-hero { padding-top: clamp(120px, 13vw, 160px); padding-bottom: clamp(56px, 7vw, 96px); background-color: var(--gm-bg); border-bottom: 3px solid var(--gm-pink); box-shadow: 0 3px 0 var(--gm-cyan); }
.gm-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.gm h1 {
  font-family: var(--gm-px); font-weight: 700; font-size: clamp(42px, 5.4vw, 76px); line-height: 1.02; letter-spacing: .01em;
  color: #fff; margin-bottom: 22px; text-wrap: balance;
  text-shadow: 3px 3px 0 var(--gm-pink), 6px 6px 0 rgba(67,230,255,.35);
}
[dir="rtl"] .gm h1 { line-height: 1.3; }
.gm .lead { font-size: var(--t-md); color: var(--gm-dim); max-width: 34em; }
.gm .actions { margin-top: 30px; }

/* Buttons that press like arcade buttons. */
.gm-btn {
  display: inline-flex; align-items: center; gap: .55em; padding: 14px 22px; border: 0; cursor: pointer;
  font-family: var(--f-ui); font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: transform .12s steps(2), box-shadow .12s steps(2), background-color .2s;
}
.gm-btn-gold { color: var(--gm-deep); background: var(--gm-gold); box-shadow: 0 0 0 3px var(--gm-deep), 5px 5px 0 3px var(--gm-pink); }
.gm-btn-gold:hover { transform: translate(-2px, -2px); box-shadow: 0 0 0 3px var(--gm-deep), 7px 7px 0 3px var(--gm-pink); }
.gm-btn-gold:active { transform: translate(3px, 3px); box-shadow: 0 0 0 3px var(--gm-deep), 2px 2px 0 3px var(--gm-pink); }
.gm-btn-line { color: var(--gm-ink); background: transparent; box-shadow: inset 0 0 0 2px var(--gm-cyan); }
.gm-btn-line:hover { background: rgba(67,230,255,.12); }

/* The screen: a cabinet's glass, scanlines over it, the cube hopping between the coins. */
.gm-screen {
  position: relative; width: 100%; max-width: 520px; aspect-ratio: 4 / 3; margin-inline: auto; overflow: hidden; direction: ltr;
  border-radius: 14px; background: radial-gradient(120% 90% at 50% 38%, #2c1b72, #120a2e 72%);
  box-shadow: 0 0 0 10px #2b1d63, 0 0 0 14px #0c0622, 0 30px 60px -20px rgba(0,0,0,.7), inset 0 0 70px rgba(67,230,255,.14);
}
.gm-screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.25) 0 2px, transparent 2px 4px);
}
.gm-hud { position: absolute; inset: 16px 22px auto; display: flex; justify-content: space-between; gap: 12px; font-family: var(--gm-px); font-size: clamp(16px, 1.7vw, 23px); letter-spacing: .06em; color: var(--gm-cyan); }
.gm-hud b { color: #fff; font-weight: 700; }
.gm-stage { position: absolute; inset: 20% 0 23%; }
.gm-ground { position: absolute; inset: auto 8% 0; height: 10px; background: repeating-linear-gradient(90deg, var(--gm-pink) 0 10px, #b43c90 10px 20px); box-shadow: 0 5px 0 #6e2159; }
.gm-sprite { position: absolute; left: 50%; bottom: 10px; width: 30%; height: auto; margin-left: -15%; image-rendering: pixelated; transform-origin: 50% 100%; animation: gm-hop 1.3s steps(8) infinite; }
@keyframes gm-hop {
  0%, 100% { transform: translateY(0) scale(1.1, .9); }
  20% { transform: translateY(-30%) scale(.95, 1.05); }
  45% { transform: translateY(-48%); }
  70% { transform: translateY(-30%) scale(.97, 1.03); }
}
.gm-coin { position: absolute; left: var(--x); top: var(--y); width: 4%; aspect-ratio: 1; background: var(--gm-gold); box-shadow: inset -3px -3px 0 #c98a12, inset 3px 3px 0 #fff0b8; animation: gm-spin 1.6s steps(4) infinite; animation-delay: var(--d); }
@keyframes gm-spin { 0%, 100% { transform: translateY(0) scaleX(1); } 25% { transform: translateY(-5px) scaleX(.5); } 50% { transform: translateY(-7px) scaleX(.15); } 75% { transform: translateY(-5px) scaleX(.5); } }
.gm-press { position: absolute; inset: auto 0 16px; text-align: center; font-family: var(--gm-px); font-weight: 700; font-size: clamp(20px, 2.3vw, 31px); letter-spacing: .12em; color: var(--gm-gold); animation: gm-blink 1.1s steps(1) infinite; }
@keyframes gm-blink { 50% { opacity: 0; } }

/* ---------- sections ---------- */
.gm-sec { padding-block: clamp(72px, 8vw, 120px); background-color: var(--gm-bg); }
.gm-make, .gm-levels-sec, .gm-related { background-color: var(--gm-bg2); }
.gm-h2 { font-family: var(--gm-px); font-weight: 700; font-size: clamp(36px, 4.2vw, 58px); line-height: 1.04; color: #fff; margin-bottom: 30px; }
[dir="rtl"] .gm-h2 { line-height: 1.3; }
.gm-lead { font-size: var(--t-md); color: var(--gm-dim); max-width: 38em; }

/* What we make: cartridges, each with its label. */
.gm-carts { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.gm-cart {
  position: relative; padding: 4px 16px 24px;
  background: linear-gradient(180deg, #3d2c8c, #2a1c66); box-shadow: inset 0 -8px 0 rgba(0,0,0,.28);
  clip-path: polygon(0 12px, 12px 12px, 12px 0, calc(100% - 12px) 0, calc(100% - 12px) 12px, 100% 12px, 100% 100%, 0 100%);
}
.gm-cart::before { content: ""; display: block; height: 14px; margin: 16px 8px 14px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.2) 0 6px, transparent 6px 12px); }
.gm-cart-label { display: flex; flex-direction: column; gap: 8px; min-height: 100%; padding: 18px 18px 22px; background: var(--gm-ink); color: var(--gm-deep); box-shadow: inset 0 5px 0 var(--gm-cyan); }
.gm-cart:nth-child(2) .gm-cart-label { box-shadow: inset 0 5px 0 var(--gm-pink); }
.gm-cart:nth-child(3) .gm-cart-label { box-shadow: inset 0 5px 0 var(--gm-gold); }
.gm-cart-label b { font-family: var(--gm-px); font-weight: 700; font-size: 29px; line-height: 1.05; }
[dir="rtl"] .gm-cart-label b { line-height: 1.3; }
.gm-cart-label span { font-size: 15.5px; line-height: 1.65; color: #3d3372; }

/* Codeator Arcade: the game select screen. */
.gm-arcade-head { max-width: 780px; margin-bottom: 36px; }
.gm-arcade-head .gm-h2 { margin-bottom: 16px; }
.gm-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.gm-chips li { padding: 6px 12px; font-family: var(--f-ui); font-weight: 500; font-size: 14px; color: var(--gm-cyan); box-shadow: inset 0 0 0 2px rgba(67,230,255,.45); }
.gm-games { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gm-game {
  display: flex; flex-direction: column; gap: 8px; padding: 22px 20px 24px;
  background: var(--gm-panel); box-shadow: inset 0 0 0 2px var(--gm-line);
  transition: transform .12s steps(2), box-shadow .12s steps(2);
}
.gm-game::before { content: ""; width: 14px; height: 14px; background: var(--gm-c, var(--gm-cyan)); box-shadow: 4px 4px 0 rgba(0,0,0,.3); }
.gm-game:nth-child(3n+2) { --gm-c: var(--gm-pink); }
.gm-game:nth-child(3n) { --gm-c: var(--gm-gold); }
.gm-game b { font-family: var(--gm-px); font-weight: 700; font-size: 30px; line-height: 1; color: #fff; }
.gm-game span { font-size: 15px; line-height: 1.6; color: var(--gm-dim); }
.gm-game:hover { transform: translate(-3px, -3px); box-shadow: inset 0 0 0 2px var(--gm-c, var(--gm-cyan)), 3px 3px 0 var(--gm-c, var(--gm-cyan)); }
.gm-stores { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 32px; }
.gm-site { font-family: var(--f-ui); font-weight: 500; font-size: 15.5px; color: var(--gm-cyan); }

/* How a game gets made: four levels, each a step higher than the last. */
.gm-levels { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.gm-level { min-height: calc(200px + var(--i) * 38px); padding: 20px 20px 26px; background: var(--gm-panel); box-shadow: inset 0 0 0 2px var(--gm-line), inset 0 -6px 0 rgba(0,0,0,.28); }
.gm-lv { display: inline-block; margin-bottom: 12px; padding: 3px 9px; font-family: var(--gm-px); font-size: 18px; letter-spacing: .05em; color: var(--gm-deep); background: var(--gm-cyan); }
.gm-level h3 { font-family: var(--gm-px); font-weight: 700; font-size: 30px; line-height: 1.05; color: #fff; margin-bottom: 8px; }
[dir="rtl"] .gm-level h3 { line-height: 1.3; }
.gm-level p { font-size: 15.5px; line-height: 1.65; color: var(--gm-dim); }
.gm-level:last-child { background: linear-gradient(180deg, #ffd35c, #f0a91e); box-shadow: inset 0 -6px 0 rgba(90,55,0,.3); }
.gm-level:last-child .gm-lv { background: var(--gm-deep); color: var(--gm-gold); }
.gm-level:last-child h3 { color: var(--gm-deep); }
.gm-level:last-child p { color: #3b2a06; }

/* FAQ on the dark. */
.gm-faq .qa-list, .gm-faq .qa { border-color: var(--gm-line); }
.gm-faq .qa summary { color: #fff; }
.gm-faq .qa summary:hover { color: var(--gm-cyan); }
.gm-faq .qa summary i { border-color: var(--gm-cyan); }
.gm-faq .qa summary i::before, .gm-faq .qa summary i::after { background: var(--gm-cyan); }
.gm-faq .qa[open] summary i { background: var(--gm-cyan); }
.gm-faq .qa[open] summary i::before, .gm-faq .qa[open] summary i::after { background: var(--gm-bg); }
.gm-faq .qa p { color: var(--gm-dim); }

/* CTA */
.gm-cta { padding-block: clamp(80px, 9vw, 120px); background-color: var(--gm-deep); border-top: 3px solid var(--gm-cyan); text-align: center; }
.gm-cta h2 { font-family: var(--gm-px); font-weight: 700; font-size: clamp(40px, 4.8vw, 66px); line-height: 1.05; color: #fff; text-shadow: 3px 3px 0 var(--gm-pink); }
[dir="rtl"] .gm-cta h2 { line-height: 1.3; }
.gm-cta p { margin: 16px auto 30px; max-width: 34em; font-size: var(--t-md); color: var(--gm-dim); }
.gm-cta .actions { justify-content: center; }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .gm-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .gm-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .gm-screen { max-width: 420px; }
  .gm-carts { grid-template-columns: minmax(0, 1fr); }
  .gm-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .gm-level { min-height: 0; }
}
@media (max-width: 600px) {
  .gm-games, .gm-levels { grid-template-columns: minmax(0, 1fr); }
}
