/* Game AI: showcase portrait (9:16), halaman /game, dan layar main berbentuk ponsel.
   Kartu, baris geser, dan warna sampul sementara memakai video.css. */

/* ---- Halaman /game: rak kartu portrait ---- */
.games {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 28px 18px; padding: 16px 0 40px;
}
.gcard { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gcard .pcard { width: 100%; }
.gbody { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gbody h2 { font: 600 17px/1.25 var(--sans); }
.gmeta { font: 400 12px/1.4 var(--mono); color: var(--dim); }
.gbody .ringkas {
  font-size: 14px; color: var(--dim);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.gbody details summary { cursor: pointer; font: 500 12px/1.4 var(--mono); color: var(--accent); list-style: none; }
.gbody details summary::-webkit-details-marker { display: none; }
.gbody details summary::before { content: "▸ "; }
.gbody details[open] summary::before { content: "▾ "; }
.gbody details .prompt { margin-top: 8px; }
.gbody .btn-play { margin-top: 4px; align-self: stretch; justify-content: center; padding: 11px 16px; font-size: 15px; }

/* ---- Layar main: game portrait di tengah, seperti layar ponsel ---- */
.gplayer {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: #07080a; color: #eef1f3;
}
.gplayer[open] { display: flex; flex-direction: column; }
.gplayer::backdrop { background: #07080a; }
html:has(.gplayer[open]) { overflow: hidden; }

.gbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; background: #0d1014; }
.gbar-teks { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 14px; white-space: nowrap; overflow: hidden; }
.gjudul { font: 600 15px/1.2 var(--sans); }
.gkontrol { font: 400 12px/1.2 var(--mono); color: #8e979f; overflow: hidden; text-overflow: ellipsis; }
.gbtn {
  height: 36px; padding: 0 12px; cursor: pointer; white-space: nowrap;
  border-radius: 6px; background: #111418; color: #eef1f3; font: 500 13px/1 var(--mono);
}
.gbtn { border: 0; background: #181d23; }
.gbtn:hover { color: #7cf5c4; }
.gbtn[hidden] { display: none; }

.gstage { position: relative; flex: 1; min-height: 0; background: #000; }
/* Tinggi mengikuti layar, lebar dihitung dari rasio 9:16 */
.gstage iframe, .gstage .stage-kosong {
  position: absolute; top: 16px; bottom: 16px; left: 50%; transform: translateX(-50%);
  height: calc(100% - 32px); aspect-ratio: 9 / 16; max-width: calc(100% - 32px);
  border-radius: 16px; display: grid; place-items: center; background: #050a08;
}

@media (max-width: 640px) {
  .gbtn span, .gkontrol { display: none; }
  .gstage iframe, .gstage .stage-kosong {
    inset: 0; transform: none; width: 100%; height: 100%; max-width: none; aspect-ratio: auto; border: 0; border-radius: 0;
  }
}

.baris-head .jumlah { font: 500 13px/1 var(--sans); color: var(--dim); margin-left: 6px; }
.games > .tunggu, .k-grid > .tunggu { grid-column: 1 / -1; }
