/* =====================================================
   GAMES ZONE - visual layer only (game logic untouched)
   Loaded AFTER the page's inline <style>, so selectors here
   are scoped with .gm-* classes to win over old rules.
   ===================================================== */

/* ---------- Hero ---------- */
.gm-hero {
  position:relative; overflow:hidden; border-radius:var(--radius-lg); padding:26px 28px; margin-bottom:18px; color:#fff;
  background:var(--grad-brand); box-shadow:var(--shadow-md);
  display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap;
}
.gm-hero::before, .gm-hero::after { content:""; position:absolute; border-radius:50%; background:rgba(255,255,255,.09); pointer-events:none; }
.gm-hero::before { width:230px; height:230px; right:-60px; top:-100px; }
.gm-hero::after  { width:140px; height:140px; right:150px; bottom:-85px; }
.gm-hero > * { position:relative; z-index:1; }
.gm-hero h2 { margin:0 0 4px; font-size:26px; color:#fff; display:flex; align-items:center; gap:10px; }
.gm-hero p { margin:0; font-size:14px; opacity:.92; }
.gm-stats { display:flex; gap:12px; flex-wrap:wrap; }
.gm-stat { background:rgba(255,255,255,.16); border:1.5px solid rgba(255,255,255,.35); border-radius:var(--radius-md); padding:10px 18px; min-width:100px; text-align:center; }
.gm-stat b { display:block; font-size:22px; line-height:1.1; font-family:var(--font-display); }
.gm-stat span { font-size:12px; opacity:.9; }

.gm-note { display:flex; gap:10px; align-items:center; justify-content:center; text-align:center; border-radius:12px; padding:10px 16px; font-size:12.5px; color:var(--color-ink-soft); background:var(--color-bg-soft); border:1px dashed var(--color-border); margin-bottom:20px; }
.gm-note i { color:var(--color-primary); }

/* ---------- Game tiles (tabs) ---------- */
.game-tabs.gm-tabs { display:grid; gap:12px; grid-template-columns:repeat(auto-fill, minmax(118px, 1fr)); overflow:visible; padding:0; margin-bottom:22px; }
.game-tabs.gm-tabs button, .game-tabs.gm-tabs a.gm-quiz {
  position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
  padding:16px 8px 14px; border-radius:18px; border:1.5px solid var(--color-border); background:var(--color-surface);
  box-shadow:var(--shadow-sm); color:var(--color-ink); font-family:var(--font-body); font-size:12.5px; font-weight:700; line-height:1.25;
  text-align:center; text-decoration:none; white-space:normal; cursor:pointer; flex-shrink:1; -webkit-tap-highlight-color:transparent;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.game-tabs.gm-tabs button i, .game-tabs.gm-tabs a.gm-quiz i {
  width:46px; height:46px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:19px;
  background:var(--color-primary-light); color:var(--color-primary); transition:transform .25s ease, background .18s ease, color .18s ease;
}
.game-tabs.gm-tabs button:hover, .game-tabs.gm-tabs a.gm-quiz:hover { transform:translateY(-4px); box-shadow:var(--shadow-md); border-color:var(--color-primary); color:var(--color-ink); }
.game-tabs.gm-tabs button:hover i, .game-tabs.gm-tabs a.gm-quiz:hover i { transform:scale(1.12) rotate(-6deg); }
.game-tabs.gm-tabs button.active { background:var(--grad-brand); border-color:transparent; color:#fff; box-shadow:var(--shadow-md); transform:translateY(-2px); }
.game-tabs.gm-tabs button.active i { background:rgba(255,255,255,.22); color:#fff; }
.game-tabs.gm-tabs button.active::after {
  content:""; position:absolute; bottom:-8px; left:50%; width:14px; height:14px; background:#9E0400; transform:translateX(-50%) rotate(45deg); border-radius:3px; z-index:-1;
}
.game-tabs.gm-tabs a.gm-quiz { border-style:dashed; grid-column:auto; justify-self:stretch; }

/* ---------- "Now playing" bar ---------- */
.gm-now { display:flex; align-items:center; gap:12px; margin:6px 0 14px; padding:12px 18px; border-radius:14px; background:var(--color-surface); border:1.5px solid var(--color-border); box-shadow:var(--shadow-sm); }
.gm-now .ic { width:40px; height:40px; border-radius:50%; background:var(--grad-brand); color:#fff; display:flex; align-items:center; justify-content:center; font-size:16px; flex:0 0 auto; }
.gm-now b { font-size:16px; font-family:var(--font-display); }
.gm-now small { display:block; font-size:12px; color:var(--color-ink-soft); }
.gm-now .live { margin-left:auto; font-size:11px; font-weight:800; letter-spacing:.05em; color:var(--color-primary); display:inline-flex; gap:6px; align-items:center; }
.gm-now .live::before { content:""; width:8px; height:8px; border-radius:50%; background:var(--color-primary); animation:gmPulse 1.4s infinite; }
@keyframes gmPulse { 0%{box-shadow:0 0 0 0 rgba(225,6,0,.5)} 100%{box-shadow:0 0 0 9px rgba(225,6,0,0)} }

/* ---------- Game panel card ---------- */
.game-panel.active > .game-wrap { animation:gmIn .3s ease both; }
@keyframes gmIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
.game-panel > .game-wrap {
  max-width:560px; background:var(--color-surface); border:1.5px solid var(--color-border);
  border-radius:var(--radius-lg); padding:26px 22px 22px; box-shadow:var(--shadow-md);
}
.game-panel > .game-wrap > p:first-child { font-weight:600; color:var(--color-ink-soft); margin-top:0; }
.game-panel .game-wrap input[type="number"], .game-panel .game-wrap input[type="text"] {
  border:2px solid var(--color-border); background:var(--color-bg-soft); color:var(--color-ink); border-radius:12px; outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.game-panel .game-wrap input[type="number"]:focus, .game-panel .game-wrap input[type="text"]:focus { border-color:var(--color-primary); box-shadow:0 0 0 3px rgba(225,6,0,.15); }
.game-panel .game-wrap .btn { border-radius:12px; }

/* ---------- Top players list ---------- */
.gm-top { margin-top:22px; text-align:left; }
.gm-top-title { display:flex; align-items:center; gap:8px; font-weight:800; font-size:14px; margin-bottom:10px; }
.gm-top-title i { color:#f5b301; }
.leader-mini { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; }
.leader-mini li { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:9px 14px; border:1px solid var(--color-border); border-radius:12px; background:var(--color-bg-soft); font-size:13.5px; }
.leader-mini li:last-child { border-bottom:1px solid var(--color-border); }
.leader-mini li span:first-child { display:flex; align-items:center; gap:10px; min-width:0; }
.leader-mini li span:first-child b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:700; }
.leader-mini li span:last-child { font-weight:800; color:var(--color-primary); white-space:nowrap; }
.gm-rk { flex:0 0 auto; width:26px; height:26px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:12px; font-weight:800; background:var(--color-border); color:var(--color-ink-soft); }
.gm-rk.r1 { background:#f5b301; color:#fff; }
.gm-rk.r2 { background:#b8bcc4; color:#fff; }
.gm-rk.r3 { background:#cd7f32; color:#fff; }

/* ---------- Responsive ---------- */
@media (max-width:640px) {
  .gm-hero { padding:20px 18px; border-radius:var(--radius-md); }
  .gm-hero h2 { font-size:21px; }
  .gm-stats { width:100%; }
  .gm-stat { flex:1; min-width:0; padding:9px 10px; }
  .game-tabs.gm-tabs { grid-template-columns:repeat(3, 1fr); gap:10px; }
  .game-tabs.gm-tabs button, .game-tabs.gm-tabs a.gm-quiz { padding:12px 4px 10px; font-size:11.5px; border-radius:14px; }
  .game-tabs.gm-tabs button i, .game-tabs.gm-tabs a.gm-quiz i { width:38px; height:38px; font-size:16px; }
  .game-panel > .game-wrap { padding:20px 14px 16px; border-radius:var(--radius-md); }
}
@media (prefers-reduced-motion: reduce) {
  .game-panel.active > .game-wrap, .gm-now .live::before { animation:none; }
  .game-tabs.gm-tabs * { transition:none !important; }
}

/* ===== Side spacing — same left/right gap as the Home feed (16px mobile, --wide-pad on laptop/desktop) ===== */
.gm-page { padding-left: 16px; padding-right: 16px; }
@media (min-width: 1024px) {
  .gm-page { padding-left: var(--wide-pad, clamp(20px, 3vw, 56px)); padding-right: var(--wide-pad, clamp(20px, 3vw, 56px)); }
}
