/* Games portfolio: additions on top of the main portfolio's style.css */

/* Shorter hero than the main portfolio */
#hero.games-hero { min-height: auto; padding: calc(var(--header-h) + 72px) 0 56px; }
#hero.games-hero h1 { max-width: 14ch; }
#hero.games-hero .lead { max-width: 58ch; }
.games-hero .stats { margin-top: 48px; }

/* Card buttons */
.game-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn-play-main, .btn-apk-outline {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-play-main { background: var(--gradient); color: #fff; }
.btn-play-main:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(124, 92, 255, .7); }
.btn-apk-outline { border: 1px solid var(--border-strong); color: var(--text); background: transparent; }
.btn-apk-outline:hover { border-color: var(--accent-2); color: var(--accent-2); }
.btn-play-main i, .btn-apk-outline i { font-size: 18px; }
.btn-apk-outline small { font-weight: 500; opacity: .75; }

.games-empty { color: var(--text-muted); text-align: center; padding: 40px 0; }

/* Game pop-up */
.game-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 7, 14, .82); backdrop-filter: blur(6px); }
.game-modal[hidden] { display: none; }
.game-modal-box { display: flex; flex-direction: column; width: calc(var(--game-h) * 9 / 16 + 2px); max-width: 96vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 60px -20px rgba(34, 211, 238, .35); }
.game-modal-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 8px 16px;
  font-family: var(--font-head); font-weight: 600; font-size: 15px; color: #fff; border-bottom: 1px solid var(--border); }
.game-modal-actions { display: flex; gap: 6px; }
.game-modal-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; color: #fff; font-size: 20px; cursor: pointer; }
.game-modal-btn:hover { border-color: var(--accent-2); color: var(--accent-2); }
/* The game area itself is exactly 9:16 (bar height = 51px), so the portrait game fills it edge to edge */
.game-modal { --game-h: min(calc(92vh - 51px), calc(96vw * 16 / 9)); }
.game-modal iframe { height: var(--game-h); width: 100%; flex: none;
  border: 0; background: var(--bg); display: block; }
body.game-open { overflow: hidden; }
.game-modal-box:fullscreen { height: 100%; width: 100%; max-width: none; aspect-ratio: auto; border-radius: 0; border: 0; }
.game-modal-box:fullscreen iframe { flex: 1; height: auto; width: 100%; max-width: none; aspect-ratio: auto; }
@media (max-width: 600px), (max-height: 520px) {
  .game-modal-box { height: 100%; width: 100%; max-width: none; aspect-ratio: auto; border-radius: 0; border: 0; }
  .game-modal iframe { flex: 1; height: auto; width: 100%; max-width: none; aspect-ratio: auto; }
}

/* Optional display banner (AdSense) */
.ad-banner { margin: 0 0 28px; padding: 10px; text-align: center; border: 1px dashed var(--border); border-radius: 12px; min-height: 100px; }
.ad-banner[hidden] { display: none; }
.ad-label { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }

/* ---------- Personal ordering (game-ranking.js) ---------- */
.games-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 22px; }
.games-sort-buttons { display: inline-flex; gap: 6px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.games-sort-buttons button { border: 0; background: transparent; color: var(--text-muted); font: 600 14px var(--font-body); padding: 7px 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; transition: color .2s, background .2s; }
.games-sort-buttons button:hover { color: var(--text); }
.games-sort-buttons button.active { background: var(--gradient); color: #fff; }
.games-sort-note { color: var(--text-muted); font-size: 13px; }
.games-sort-reset { margin-left: auto; border: 0; background: none; color: var(--text-muted); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 0; }
.games-sort-reset:hover { color: var(--text); }
.project-img { position: relative; }
.game-badge { position: absolute; top: 12px; left: 12px; z-index: 2; padding: 5px 11px; border-radius: 999px; font: 700 12px var(--font-body); letter-spacing: .02em; color: #fff; background: rgba(11, 13, 23, .78); border: 1px solid var(--border-strong); backdrop-filter: blur(6px); }
.game-badge-continue { background: var(--gradient); border-color: transparent; }
.game-badge-fav { background: #f59e0b; border-color: transparent; color: #1b1300; }
.game-badge-pick { border-color: var(--accent-2); color: var(--accent-2); }
.game-badge-new { border-color: var(--ok); color: var(--ok); }
.game-played { display: inline-flex; align-items: center; gap: 5px; margin: -4px 0 8px; color: var(--accent-2); font-size: 13px; font-weight: 600; }
@media (max-width: 575px) { .games-sort-reset { margin-left: 0; } }
