/*
 * games.css — Junkyard Animations
 * Scoped styles for the games listing page only.
 * Loaded via <link> in games.php — never in style.css.
 *
 * Depends on: style.css (CSS variables defined there)
 *
 * SECTIONS
 * ─────────────────────────────────────────────────────────────────
 *  1.  Page Wrapper       (.jg-wrap)
 *  2.  Page Title         (.jg-page-title)
 *  3.  Featured Game      (.jg-featured · inner · thumb · details)
 *  4.  Featured Stats     (.jg-fstat)
 *  5.  Featured Tags      (.jg-tag)
 *  6.  Play Button        (.jg-play-btn)
 *  7.  Section Title      (.jg-section-title)
 *  8.  Game Grid          (.jg-grid)
 *  9.  Game Card          (.jg-card · thumb · coming-soon · info)
 * 10.  Card Meta          (.jg-meta · .jg-genre · .jg-year)
 * 11.  Card Bottom Bar    (.jg-bottom · .ja-stars · .jg-comments · .jg-plays)
 * 12.  Mobile Responsive
 * ─────────────────────────────────────────────────────────────────
 */


/* ═══════════════════════════════════════════════════════════════
   1. PAGE WRAPPER
   ═══════════════════════════════════════════════════════════════ */

.jg-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 12px 0;   /* no bottom — the footer owns that gap */
}


/* ═══════════════════════════════════════════════════════════════
   2. PAGE TITLE
   ═══════════════════════════════════════════════════════════════ */

.jg-page-title {
  font-family: var(--font-heading);
  font-size: 30px;
  color: var(--gold);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-dark);
}
.jg-page-title span {
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--text-muted);
  margin-left: 6px;
}

#jaBody.light .jg-page-title        { color: #1a4080; border-color: var(--border-mid); }
#jaBody.light .jg-page-title span   { color: #15336b !important; }


/* ═══════════════════════════════════════════════════════════════
   3. FEATURED GAME
   ═══════════════════════════════════════════════════════════════ */

.jg-featured {
  position: relative;
  border: 2px solid var(--border-mid);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}
#jaBody.light .jg-featured { border-color: #6a9ad4; }

/* Critics choice badge */
.jg-featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-heading);
  font-size: 12px;
  background: var(--gold);
  color: var(--bg-mid);
  padding: 3px 12px;
  border-radius: 20px;
  z-index: 2;
  letter-spacing: 0.5px;
}

/* Two-column inner layout */
.jg-featured-inner {
  display: grid;
  grid-template-columns: 1fr 340px;
}

/* Left: thumbnail */
.jg-featured-thumb {
  position: relative;
  min-height: 280px;
  background: var(--bg-deep) center/cover no-repeat;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jg-featured-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  transition: background 0.2s;
}
.jg-featured-thumb:hover::after { background: rgba(0, 0, 0, 0.15); }

.jg-featured-play {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-size: 20px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 12px 28px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
  transition: all 0.2s;
}
.jg-featured-thumb:hover .jg-featured-play {
  background: rgba(245, 208, 32, 0.85);
  color: var(--bg-mid);
  border-color: var(--gold);
}

/* Right: details panel */
.jg-featured-details {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#jaBody.dark  .jg-featured-details { background: #0a1535; }
#jaBody.light .jg-featured-details { background: #2456a6; }

.jg-featured-title {
  font-family: var(--font-heading);
  font-size: 22px;
  line-height: 1.2;
  color: #14458c;
}
#jaBody.dark  .jg-featured-title { color: #f5d020; }
#jaBody.light .jg-featured-title { color: #f5d020; }

.jg-featured-desc {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
}
#jaBody.dark  .jg-featured-desc { color: #cfe0f5; }
#jaBody.light .jg-featured-desc { color: #ffffff; }


/* ═══════════════════════════════════════════════════════════════
   4. FEATURED STATS
   ═══════════════════════════════════════════════════════════════ */

.jg-featured-stats {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  overflow: hidden;
}
#jaBody.light .jg-featured-stats { border-color: #9ab8d8; }

.jg-fstat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-right: 1px solid var(--border-dark);
}
.jg-fstat:last-child { border-right: none; }
#jaBody.light .jg-fstat { border-color: #9ab8d8; }

.jg-fstat-n {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 2px;
}
#jaBody.light .jg-fstat-n { color: var(--bg-panel); }

.jg-fstat-l {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-muted);
}
#jaBody.light .jg-fstat-l { color: #5a7aaa; }


/* ═══════════════════════════════════════════════════════════════
   5. FEATURED TAGS
   ═══════════════════════════════════════════════════════════════ */

.jg-featured-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.jg-tag {
  font-family: var(--font-heading);
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--bg-panel);
  color: #f5d020;
  border: 1px solid var(--border-dark);
}
#jaBody.light .jg-tag { background: #14458c; color: #f5d020; border-color: #f5d020; }
#jaBody.dark  .jg-tag { background: var(--gold); color: #14458c; border-color: var(--gold-dark); }


/* ═══════════════════════════════════════════════════════════════
   6. PLAY BUTTON
   ═══════════════════════════════════════════════════════════════ */

.jg-play-btn {
  font-family: var(--font-heading);
  font-size: 15px;
  padding: 10px 0;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.5px;
  background: var(--gold);
  color: var(--bg-mid);
  transition: background 0.15s, transform 0.15s;
  width: 100%;
  position: relative;
  overflow: hidden;
  animation: jgPulse 2.6s ease-in-out infinite;
}
.jg-play-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,0.95) 50%, transparent 100%);
  transform: skewX(-20deg);
  pointer-events: none;
  animation: jgGlisten 2.6s ease-in-out infinite;
}
@keyframes jgGlisten {
  0%   { left: -130%; }
  45%  { left: 140%; }
  100% { left: 140%; }
}
@keyframes jgPulse {
  0%, 100% { box-shadow: 0 2px 10px rgba(0,0,0,0.28); }
  50%      { box-shadow: 0 0 18px rgba(245,208,32,0.7); }
}
.jg-play-btn:hover {
  background: var(--gold-light);
  transform: scale(1.02);
}


/* ═══════════════════════════════════════════════════════════════
   7. SECTION TITLE
   ═══════════════════════════════════════════════════════════════ */

.jg-section-title {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 10px;
  padding: 5px 0 5px 8px;
  border-left: 4px solid var(--gold);
}
#jaBody.light .jg-section-title { color: var(--bg-panel); border-color: var(--border-mid); }


/* ═══════════════════════════════════════════════════════════════
   8. GAME GRID
   ═══════════════════════════════════════════════════════════════ */

.jg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}


/* ═══════════════════════════════════════════════════════════════
   9. GAME CARD
   ═══════════════════════════════════════════════════════════════ */

.jg-card {
  border-radius: 5px;
  overflow: hidden;
  border: 2px solid var(--border-dark);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.jg-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

#jaBody.light .jg-card        { border-color: #9ab8d8; }
#jaBody.light .jg-card:hover  { border-color: #1a4a8a; }

/* Thumbnail area — background image set via inline style on the card,
   this element inherits it and sizes the visible image area */
.jg-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: inherit;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Coming Soon overlay */
.jg-coming-soon {
  font-family: var(--font-heading);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--gold);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--gold-dark);
  letter-spacing: 0.5px;
  opacity: 0;
  transition: opacity 0.2s;
}
.jg-card:hover .jg-coming-soon { opacity: 1; }


/* Info panel below thumbnail */
.jg-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
#jaBody.dark  .jg-info { background: var(--bg-deep); }
#jaBody.light .jg-info { background: #2456a6; }
#jaBody.dark  .jg-games-page .jg-info { background: var(--gold); }

.jg-title {
  font-family: var(--font-heading);
  font-size: 15px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#jaBody.dark  .jg-title { color: var(--gold); }
#jaBody.light .jg-title { color: #f5d020; }
#jaBody.dark  .jg-games-page .jg-title { color: #14458c; }

/* card description — readable in every mode (pages set their own size/font) */
#jaBody.dark  .jg-desc { color: #a8c4e4; }   /* light text on navy card  */
#jaBody.light .jg-desc { color: #ffffff; }   /* white text on royal-blue card */


/* ═══════════════════════════════════════════════════════════════
   10. CARD META
   ═══════════════════════════════════════════════════════════════ */

.jg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jg-genre {
  font-family: var(--font-heading);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 8px;
  background: var(--gold-dark);
  color: #0a2550;
  border: 1px solid var(--gold-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
#jaBody.light .jg-genre { background: #d0e4f8; color: #1a4a8a; border-color: #9ab8d8; }
#jaBody.dark  .jg-games-page .jg-genre { background: var(--bg-panel); color: #f5d020; border-color: var(--border-dark); }

.jg-year {
  font-family: var(--font-body);
  font-size: 13px;
  color: #14458c;
  margin-left: auto;
}
#jaBody.light .jg-year { color: #4db8e8; }
#jaBody.dark  .jg-year { color: var(--blue-link); }
#jaBody.dark  .jg-games-page .jg-year { color: #14458c; }


/* ═══════════════════════════════════════════════════════════════
   11. CARD BOTTOM BAR
   ═══════════════════════════════════════════════════════════════ */

.jg-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border-dark);
}
#jaBody.light .jg-bottom { border-color: #c0d8f0; }

/* Static star display — overrides style.css .ja-stars flex layout
   for this page's emoji star strings */
.jg-bottom .ja-stars {
  display: inline;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: -1px;
  margin-bottom: 0;
  gap: 0;
  flex: 1;
}

.jg-comments {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}
#jaBody.light .jg-comments { color: #5a7aaa; }

.jg-plays {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}
#jaBody.light .jg-plays { color: #5a7aaa; }


/* ═══════════════════════════════════════════════════════════════
   12. MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 700px) {
  /* Featured: stack thumbnail above details */
  .jg-featured-inner {
    grid-template-columns: 1fr;
  }
  .jg-featured-thumb {
    min-height: 200px;
  }
  .jg-featured-title { font-size: 18px; }

  /* Grid: 2 columns */
  .jg-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}

@media (max-width: 420px) {
  /* Grid: single column */
  .jg-grid { grid-template-columns: 1fr; }

  .jg-featured-thumb { min-height: 160px; }

  .jg-featured-stats { flex-wrap: wrap; }
  .jg-fstat { min-width: 50%; border-bottom: 1px solid var(--border-dark); }
  .jg-fstat:nth-child(2n) { border-right: none; }
}
