/* ===================== Games Module — matches site theme (--primary/--accent from header.php) ===================== */
:root {
  --gm-success: #22C55E;
  --gm-danger: #EF4444;
  --gm-highlight: #FBBF24;
}

.gm-hero {
  background: linear-gradient(120deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 14px;
  border-bottom: 4px solid var(--accent);
  padding: 40px 30px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 30px;
}
.gm-hero::before, .gm-hero::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1);
}
.gm-hero::before { width: 220px; height: 220px; top: -80px; left: -60px; }
.gm-hero::after { width: 160px; height: 160px; bottom: -70px; right: -40px; }
.gm-hero .gm-hero-icon { font-size: 2.6rem; display: block; margin-bottom: 10px; position: relative; z-index: 2; }
.gm-hero h1 { font-family: var(--font-display); font-weight: 700; font-size: 2rem; margin-bottom: 8px; position: relative; z-index: 2; color: #fff; }
.gm-hero p { opacity: .92; font-size: 1.02rem; margin-bottom: 18px; position: relative; z-index: 2; }
.gm-hero .btn-light { border-radius: 50px; font-weight: 600; padding: 8px 22px; position: relative; z-index: 2; }

.gm-game-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  transition: transform .2s ease, box-shadow .2s ease;
  height: 100%;
  text-decoration: none;
  display: block;
  color: inherit;
}
.gm-game-card:hover { transform: translateY(-5px); box-shadow: 0 10px 24px rgba(22,36,30,.12); color: inherit; }
.gm-card-banner {
  height: 140px; display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  background-size: cover; background-position: center;
}
.gm-card-body { padding: 16px 18px 20px; }
.gm-game-card h5 { font-family: var(--font-display); font-weight: 600; margin-bottom: 6px; }
.gm-game-card p { color: var(--muted); font-size: .88rem; margin-bottom: 14px; }
.gm-play-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff; border: none; border-radius: 50px;
  padding: 7px 18px; font-weight: 600; font-size: .85rem;
}
.gm-badge-active { background: var(--accent); color: #fff; padding: 3px 10px; border-radius: 50px; font-size: .7rem; font-weight: 700; letter-spacing: .03em; }

/* ---- Play screen ---- */
.gm-play-shell { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 24px; }
.gm-play-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.gm-play-header h4 { margin: 0; font-weight: 700; color: var(--ink) !important; }
.gm-stat-pill { background: var(--primary-tint); border: 1px solid var(--border); border-radius: 50px; padding: 6px 16px; font-weight: 600; font-size: .9rem; color: var(--primary); }
.gm-back-link { color: var(--muted); text-decoration: none; font-size: .85rem; }
.gm-back-link:hover { color: var(--primary); }
.gm-game-area { background: var(--surface); border: 1px solid var(--border); color: var(--ink); border-radius: 12px; padding: 24px; min-height: 320px; }

/* ---- Recent plays / top players (below play area) ---- */
.gm-side-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; height: 100%; }
.gm-side-card h6 { font-weight: 700; margin-bottom: 14px; }
.gm-feed-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.gm-feed-row:last-child { border-bottom: none; }
.gm-feed-name { font-weight: 600; flex-grow: 1; }
.gm-feed-score { font-weight: 700; color: var(--primary); }
.gm-feed-time { color: var(--muted); font-size: .75rem; }


/* ===================== Icon-based avatars & rank badges (no real photos, prevents right-click full-image access) ===================== */
.gm-icon-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 1.05rem; flex-shrink: 0;
}
.gm-rank-badge {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
}
.gm-rank-badge-1 { background: linear-gradient(135deg, #FFD700, #F5A623); }
.gm-rank-badge-2 { background: linear-gradient(135deg, #C7CDD4, #9AA3AC); }
.gm-rank-badge-3 { background: linear-gradient(135deg, #D8985A, #A9652E); }

.gm-feed-row .gm-rank-badge { width: 40px; height: 40px; font-size: 1.1rem; padding-top: 4px; }
.gm-feed-row .gm-icon-avatar { width: 32px; height: 32px; font-size: .95rem; }

.gm-podium-rank-1 .gm-rank-badge { width: 100px; height: 100px; font-size: 2.6rem; }
.gm-podium-rank-2 .gm-rank-badge,
.gm-podium-rank-3 .gm-rank-badge { width: 78px; height: 78px; font-size: 2rem; padding-top: 4px; }

@media (max-width: 575.98px) {
  .gm-podium-rank-1 .gm-rank-badge { width: 75px; height: 75px; font-size: 2rem; }
  .gm-podium-rank-2 .gm-rank-badge,
  .gm-podium-rank-3 .gm-rank-badge { width: 60px; height: 60px; font-size: 1.5rem; }
}

/* ---- Leaderboard page ---- */
.gm-lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--border); }
.gm-lb-rank { font-weight: 800; width: 34px; text-align: center; font-size: 1.05rem; color: var(--muted); }
.gm-lb-rank.gm-rank-1 { color: #f59e0b; }
.gm-lb-rank.gm-rank-2 { color: #9ca3af; }
.gm-lb-rank.gm-rank-3 { color: #b45309; }
.gm-lb-name { font-weight: 600; flex-grow: 1; color: var(--ink); }
.gm-lb-score { font-weight: 800; color: var(--primary); }


/* ===================== Podium (Top 3 with frame badges) ===================== */
.gm-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.gm-podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gm-podium-name {
  font-weight: 700;
  margin-top: 8px;
  font-size: .88rem;
  color: var(--ink);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gm-podium-score { font-weight: 800; font-size: .82rem; margin-top: 2px; color: var(--muted); }
.gm-podium-rank-1 .gm-podium-score { color: #b8860b; font-size: .95rem; }
.gm-podium-rank-2 .gm-podium-score { color: #6b7280; }
.gm-podium-rank-3 .gm-podium-score { color: #b45309; }

@media (max-width: 575.98px) {
  .gm-hero h1 { font-size: 1.5rem; }
  .gm-podium { gap: 10px; }
  .gm-podium-name { font-size: .78rem; max-width: 95px; }
}

/* ===================== Universal ad-break overlay (used by ALL games) ===================== */
.gm-ad-overlay { max-width: 480px; margin: 40px auto; }
.gm-ad-box {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}
.gm-ad-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 10px;
}
.gm-ad-placeholder {
  background: var(--primary-tint);
  border-radius: 10px;
  padding: 50px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted);
  margin-bottom: 14px;
}
.gm-ad-placeholder i { font-size: 2.2rem; color: var(--primary); }
.gm-ad-footer { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: .85rem; color: var(--muted); }