/*
Theme Name: MiniGamePix
Theme URI: https://minigamepix.com/
Author: MiniGamePix
Description: A browser-games portal: square tiles, no card panels, and a game page that puts the frame first. Ships with its own 107-game library, logo, icon set and share card. No plugin required.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: minigamepix
Tags: games, custom-colors, custom-menu, translation-ready, rtl-language-support
*/

/* ===========================================================================
   The rules

   1. The chrome is neutral — greys, white type, black shadows. The only other
      colour is one green, and it appears in five places: the logo, the play
      badge on hover, the liked state, the focus ring, and the badge label.
      Everything else coloured on the page is a game thumbnail, and there are
      107 of those.
   2. Tiles are square, and the artwork is the card. No panel, no border, no
      box around a picture that is already a box.
   3. Nothing here uses !important. The markup is this theme's own, so the
      cascade is enough; if you need to override something, you can.
   =========================================================================== */

/* Poppins, subset to latin + latin-ext and served from the theme: no request
   to a font CDN, no layout shift from a slow third party. Arabic and other
   scripts fall through to the system stack, which has real fonts for them. */
@font-face{
  font-family:"Poppins"; font-style:normal; font-weight:400; font-display:swap;
  src:url("assets/fonts/poppins-regular.woff2") format("woff2");
}
@font-face{
  font-family:"Poppins"; font-style:normal; font-weight:500; font-display:swap;
  src:url("assets/fonts/poppins-medium.woff2") format("woff2");
}
@font-face{
  font-family:"Poppins"; font-style:normal; font-weight:700; font-display:swap;
  src:url("assets/fonts/poppins-bold.woff2") format("woff2");
}

:root{
  --mgp-ink:        #0B0B0F;
  --mgp-surface:    #15151A;
  --mgp-surface-2:  #1E1E25;
  --mgp-line:       rgba(255,255,255,.10);
  --mgp-line-2:     rgba(255,255,255,.16);
  --mgp-fg:         #F4F4F6;
  --mgp-fg-dim:     #9B9BA6;
  --mgp-fg-faint:   #6E6E7A;

  /* Measured: 11.17:1 on the page background. The deep green is the same hue
     at 3.69:1 on white, for anything printed or on a light skin. */
  --mgp-accent:      #22E06B;
  --mgp-accent-deep: #179949;

  --mgp-radius-tile: 20%;
  --mgp-radius-box:  14px;
  --mgp-radius-pill: 999px;

  --mgp-gap: 16px;
  --mgp-card-min: 148px;
  --mgp-wrap: 1180px;

  --mgp-shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --mgp-shadow-2: 0 8px 20px rgba(0,0,0,.45);

  --mgp-font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
              Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", sans-serif;
}

@media (max-width:640px){ :root{ --mgp-card-min:102px; --mgp-gap:12px; } }
@media (min-width:1280px){ :root{ --mgp-card-min:168px; --mgp-gap:20px; } }

*,*::before,*::after{ box-sizing:border-box; }

html{ -webkit-text-size-adjust:100%; }

body{
  margin:0;
  background:var(--mgp-ink);
  color:var(--mgp-fg);
  font-family:var(--mgp-font);
  font-size:15px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}

img, svg, iframe{ max-width:100%; }
a{ color:inherit; text-decoration:none; }
.mgp-prose a{ text-decoration:underline; text-underline-offset:2px; }

.wrap{ width:100%; max-width:var(--mgp-wrap); margin:0 auto; padding:0 16px; }

.screen-reader-text{
  position:absolute; width:1px; height:1px; overflow:hidden;
  clip:rect(1px,1px,1px,1px); clip-path:inset(50%); white-space:nowrap;
}
.mgp-skip{
  position:absolute; left:-9999px; top:0; z-index:100;
  background:var(--mgp-accent); color:var(--mgp-ink);
  padding:10px 16px; border-radius:0 0 var(--mgp-radius-box) 0; font-weight:500;
}
.mgp-skip:focus{ left:0; }

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */
.mgp-head{
  position:sticky; top:0; z-index:40;
  background:rgba(11,11,15,.86);
  backdrop-filter:saturate(1.3) blur(12px);
  -webkit-backdrop-filter:saturate(1.3) blur(12px);
  border-bottom:1px solid var(--mgp-line);
}
.mgp-head-inner{ display:flex; align-items:center; gap:14px; min-height:64px; }
.mgp-logo{ display:inline-flex; align-items:center; flex:0 0 auto; }
.mgp-logo img{ height:30px; width:auto; display:block; }

.mgp-search{ position:relative; flex:1 1 auto; max-width:420px; }
.mgp-search .mgpi{
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  color:var(--mgp-fg-faint); pointer-events:none;
}
.mgp-search input{
  width:100%; min-height:38px;
  padding:7px 14px 7px 36px;
  font:inherit; font-size:14px;
  color:var(--mgp-fg);
  background:var(--mgp-surface);
  border:1px solid var(--mgp-line);
  border-radius:var(--mgp-radius-pill);
  outline:none;
}
.mgp-search input::placeholder{ color:var(--mgp-fg-faint); }
.mgp-search input:focus{ border-color:var(--mgp-line-2); background:var(--mgp-surface-2); }

.mgp-head-acts{ margin-left:auto; display:flex; gap:8px; }
.mgp-head-act{
  display:grid; place-items:center; width:38px; height:38px;
  border-radius:var(--mgp-radius-pill);
  background:var(--mgp-surface); border:1px solid var(--mgp-line);
  color:var(--mgp-fg-dim);
}
.mgp-head-act:hover{ background:var(--mgp-surface-2); color:var(--mgp-fg); }

@media (max-width:620px){
  .mgp-head-inner{ flex-wrap:wrap; padding-top:10px; padding-bottom:10px; min-height:0; }
  .mgp-search{ order:3; max-width:none; flex-basis:100%; }
}

/* ---------------------------------------------------------------------------
   Browse bar
   --------------------------------------------------------------------------- */
.mgp-main{ padding:22px 0 48px; }
.mgp-eyebrow{
  margin:0 0 10px; font-size:11px; font-weight:700; letter-spacing:1.4px;
  text-transform:uppercase; color:var(--mgp-fg-faint);
}
.mgp-chips{
  display:flex; gap:8px; overflow-x:auto; padding-bottom:4px;
  scrollbar-width:none; -ms-overflow-style:none;
  /* The row scrolls; fading the last chip says so without a scrollbar. */
  mask-image:linear-gradient(to right,#000 calc(100% - 40px),transparent);
  -webkit-mask-image:linear-gradient(to right,#000 calc(100% - 40px),transparent);
}
.mgp-chips::-webkit-scrollbar{ display:none; }
.mgp-chip{
  flex:0 0 auto;
  display:inline-flex; align-items:center; min-height:38px;
  padding:0 16px; font-size:14px; font-weight:500;
  color:var(--mgp-fg-dim);
  background:var(--mgp-surface);
  border:1px solid var(--mgp-line);
  border-radius:var(--mgp-radius-pill);
  white-space:nowrap;
}
.mgp-chip:hover{ background:var(--mgp-surface-2); color:var(--mgp-fg); }
/* White, not green: maximum contrast reads as "selected" at a glance, and the
   green means "play" — spending it on a filter would empty it. */
.mgp-chip.is-active{ background:#fff; color:var(--mgp-ink); border-color:#fff; }

/* ---------------------------------------------------------------------------
   Sections
   --------------------------------------------------------------------------- */
.mgp-sec{ margin-top:30px; }
.mgp-sec-head{ display:flex; align-items:baseline; gap:12px; margin-bottom:14px; }
.mgp-sec-title{ margin:0; font-size:21px; font-weight:700; letter-spacing:-.3px; }
.mgp-count{ margin-left:auto; font-size:13px; color:var(--mgp-fg-faint); }
.mgp-empty{ color:var(--mgp-fg-dim); }

/* ---------------------------------------------------------------------------
   Grid and card — the artwork is the card
   --------------------------------------------------------------------------- */
.mgp-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(var(--mgp-card-min),1fr));
  gap:var(--mgp-gap);
  align-items:start;
}
.mgp-card{ display:block; min-width:0; }
.mgp-card-art{
  position:relative; display:block;
  aspect-ratio:1/1;
  border-radius:var(--mgp-radius-tile);
  overflow:hidden;
  background:var(--mgp-surface);
  box-shadow:var(--mgp-shadow-1);
  transition:transform .14s ease, box-shadow .14s ease;
}
.mgp-card-art img{
  width:100%; height:100%; object-fit:cover; display:block;
}
/* An imported thumbnail lives on someone else's CDN and can simply not turn
   up — hotlink rules, an expired asset, a blocked network. A broken-image
   glyph on a games grid looks like a dead site, so the tile falls back to the
   game's own initial on the surface colour. */
.mgp-card-art.is-blank img, .mgp-bar-icon.is-blank, .mgp-poster img.is-blank{ display:none; }
.mgp-card-art.is-blank::after,
.mgp-bar-icon-fallback::after{
  content:attr(data-letter);
  position:absolute; inset:0;
  display:grid; place-items:center;
  font-size:2.4em; font-weight:700; color:var(--mgp-fg-faint);
  background:var(--mgp-surface-2);
}
.mgp-card:hover .mgp-card-art{ transform:translateY(-3px); box-shadow:var(--mgp-shadow-2); }
.mgp-card:active .mgp-card-art{ transform:translateY(-1px); }

.mgp-card-play{
  position:absolute; inset:0;
  display:grid; place-items:center;
  background:rgba(8,8,12,.42);
  opacity:0; transition:opacity .14s ease;
}
.mgp-card-play::after{
  content:""; width:0; height:0; margin-left:5px;
  border-left:20px solid var(--mgp-accent);
  border-top:13px solid transparent;
  border-bottom:13px solid transparent;
}
@media (hover:hover) and (pointer:fine){ .mgp-card:hover .mgp-card-play{ opacity:1; } }
@media (hover:none){ .mgp-card-play{ display:none; } }

.mgp-card-title{
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden;
  margin-top:8px;
  font-size:13px; font-weight:500; line-height:1.3; text-align:center;
  color:var(--mgp-fg);
}
.mgp-card-meta{
  display:block; margin-top:2px;
  font-size:11px; text-align:center; color:var(--mgp-fg-faint);
}

/* A strip: the same cards, one scrolling row. Twelve games in the space a
   grid spends on four. */
.mgp-strip{
  display:flex; gap:var(--mgp-gap);
  overflow-x:auto; padding-bottom:6px;
  scroll-snap-type:x proximity;
  scrollbar-width:none; -ms-overflow-style:none;
}
.mgp-strip::-webkit-scrollbar{ display:none; }
.mgp-strip .mgp-card{ flex:0 0 auto; width:124px; scroll-snap-align:start; }
@media (max-width:640px){ .mgp-strip .mgp-card{ width:96px; } }

/* Show more reveals what is already in the HTML — no second request, and a
   crawler sees every link whether or not the button is ever pressed. */
.mgp-card.is-clamped{ display:none; }
.mgp-more-wrap{ display:flex; justify-content:center; margin:26px 0 8px; }
.mgp-more{
  font:inherit; font-weight:500;
  padding:10px 24px;
  color:var(--mgp-fg);
  background:var(--mgp-surface);
  border:1px solid var(--mgp-line-2);
  border-radius:var(--mgp-radius-pill);
  cursor:pointer;
  transition:background .12s ease;
}
.mgp-more:hover{ background:var(--mgp-surface-2); }

/* ---------------------------------------------------------------------------
   Game page
   --------------------------------------------------------------------------- */
.mgp-play{ max-width:980px; margin:0 auto; }
.mgp-crumb{ margin:0 0 10px; font-size:12px; color:var(--mgp-fg-faint); }
.mgp-crumb a{ color:var(--mgp-fg-dim); }
.mgp-crumb a:hover{ color:var(--mgp-fg); }
.mgp-crumb span{ margin:0 6px; }

/* The frame takes the game's own shape: most of these are 440×700, and a wide
   box would letterbox them. --mgp-ar is set per game in the template. */
.mgp-frame{
  position:relative;
  aspect-ratio:var(--mgp-ar,16/10);
  max-height:76vh;
  margin:0 auto;
  background:#000;
  border-radius:var(--mgp-radius-box);
  overflow:hidden;
  box-shadow:var(--mgp-shadow-2);
}
.mgp-frame iframe{
  position:absolute; inset:0;
  width:100%; height:100%;
  border:0; display:block;
}
.mgp-frame:fullscreen{ max-height:none; border-radius:0; aspect-ratio:auto; width:100vw; height:100vh; }

/* Click to play. An imported game pulls megabytes and a pre-roll advert off
   another CDN; making that wait for a press keeps the page fast and keeps
   Core Web Vitals out of the provider's hands. */
.mgp-poster{
  position:absolute; inset:0; width:100%; height:100%;
  display:block; padding:0; border:0; margin:0;
  background:var(--mgp-surface); cursor:pointer; font:inherit; color:inherit;
  overflow:hidden;
}
.mgp-poster img{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; filter:blur(18px) saturate(.9) brightness(.55); transform:scale(1.1);
}
.mgp-poster-veil{ position:absolute; inset:0; background:rgba(8,8,12,.35); }
.mgp-poster-play{
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:84px; height:84px; border-radius:50%;
  background:var(--mgp-accent);
  box-shadow:0 10px 30px rgba(0,0,0,.45);
  transition:transform .14s ease;
}
.mgp-poster-play::after{
  content:""; position:absolute; left:52%; top:50%; transform:translate(-50%,-50%);
  width:0; height:0;
  border-left:26px solid var(--mgp-ink);
  border-top:17px solid transparent;
  border-bottom:17px solid transparent;
}
.mgp-poster:hover .mgp-poster-play{ transform:translate(-50%,-50%) scale(1.06); }
.mgp-poster:active .mgp-poster-play{ transform:translate(-50%,-50%) scale(.97); }
.mgp-poster-label{
  position:absolute; left:0; right:0; bottom:26px;
  text-align:center; font-size:14px; font-weight:500; color:var(--mgp-fg);
  text-shadow:0 1px 3px rgba(0,0,0,.6); padding:0 20px;
}
.mgp-frame.is-loading .mgp-poster-play{ animation:mgp-pulse 1s ease-in-out infinite; }
@keyframes mgp-pulse{ 50%{ opacity:.45; } }

.mgp-bar{
  display:flex; align-items:center; gap:14px;
  padding:14px 0 16px;
  border-bottom:1px solid var(--mgp-line);
}
.mgp-bar-icon{
  width:64px; height:64px; flex:0 0 auto;
  border-radius:22%; object-fit:cover; display:block;
  background:var(--mgp-surface);
}
.mgp-bar-text{ min-width:0; }
.mgp-bar-text h1{ margin:0; font-size:26px; font-weight:700; letter-spacing:-.4px; line-height:1.2; }
.mgp-bar-text p{ margin:3px 0 0; font-size:13px; color:var(--mgp-fg-faint); }
.mgp-bar-acts{ margin-left:auto; display:flex; gap:8px; }

.mgp-act{
  display:inline-flex; align-items:center; gap:7px;
  min-height:40px; padding:0 14px;
  font:inherit; font-size:13px; font-weight:500;
  color:var(--mgp-fg-dim);
  background:var(--mgp-surface);
  border:1px solid var(--mgp-line);
  border-radius:var(--mgp-radius-pill);
  cursor:pointer;
  transition:background .12s ease, color .12s ease;
}
.mgp-act:hover{ background:var(--mgp-surface-2); color:var(--mgp-fg); }
.mgp-act[aria-pressed="true"]{
  background:var(--mgp-accent); color:var(--mgp-ink); border-color:var(--mgp-accent);
}

.mgp-prose{ margin:20px 0 0; color:var(--mgp-fg-dim); max-width:66ch; }
.mgp-prose p{ margin:0 0 12px; }
.mgp-prose h2{ margin:22px 0 8px; font-size:16px; font-weight:700; color:var(--mgp-fg); }
.mgp-lede{ color:var(--mgp-fg); font-size:16px; }

.mgp-specs{
  margin:22px 0 0; max-width:560px;
  background:var(--mgp-surface);
  border:1px solid var(--mgp-line);
  border-radius:var(--mgp-radius-box);
  padding:4px 16px;
}
.mgp-specs dl{ margin:0; display:grid; grid-template-columns:auto 1fr; }
.mgp-specs dt, .mgp-specs dd{
  margin:0; padding:11px 0; font-size:13px;
  border-bottom:1px solid var(--mgp-line);
}
.mgp-specs dt{ color:var(--mgp-fg-faint); }
.mgp-specs dd{ text-align:right; font-weight:500; color:var(--mgp-fg); }
.mgp-specs dt:last-of-type, .mgp-specs dd:last-of-type{ border-bottom:0; }

@media (max-width:620px){
  .mgp-frame{ max-height:72vh; }
  .mgp-bar{ flex-wrap:wrap; }
  .mgp-bar-acts{ width:100%; order:3; margin-left:0; }
  .mgp-act{ flex:1 1 auto; justify-content:center; }
  .mgp-bar-text h1{ font-size:21px; }
}

/* ---------------------------------------------------------------------------
   Pagination, footer, icons
   --------------------------------------------------------------------------- */
.pagination{ margin-top:26px; display:flex; justify-content:center; }
.pagination .nav-links{ display:flex; gap:6px; flex-wrap:wrap; }
.pagination .page-numbers{
  display:inline-grid; place-items:center;
  min-width:38px; height:38px; padding:0 12px;
  font-size:14px; font-weight:500;
  color:var(--mgp-fg-dim);
  background:var(--mgp-surface);
  border:1px solid var(--mgp-line);
  border-radius:var(--mgp-radius-pill);
}
.pagination .page-numbers:hover{ background:var(--mgp-surface-2); color:var(--mgp-fg); }
.pagination .page-numbers.current{ background:#fff; color:var(--mgp-ink); border-color:#fff; }

.mgp-foot{ border-top:1px solid var(--mgp-line); padding:28px 0 40px; margin-top:40px; }
.mgp-foot-inner{ display:flex; flex-direction:column; align-items:center; gap:12px; text-align:center; }
.mgp-foot-logo img{ height:26px; }
.mgp-foot-menu{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:18px; }
.mgp-foot-menu a{ font-size:13px; color:var(--mgp-fg-dim); }
.mgp-foot-menu a:hover{ color:var(--mgp-fg); }
.mgp-foot-note{ margin:0; font-size:12px; color:var(--mgp-fg-faint); }

.mgpi{
  width:20px; height:20px; display:inline-block; vertical-align:-.22em;
  fill:none; stroke:currentColor; stroke-width:2;
  stroke-linecap:round; stroke-linejoin:round;
  flex:0 0 auto;
}
.mgpi-solid{ fill:currentColor; stroke-width:1.4; }

.mgp-page{ max-width:720px; margin:0 auto; }
.mgp-intro{ margin-bottom:18px; }

/* ---------------------------------------------------------------------------
   Accessibility
   --------------------------------------------------------------------------- */
:focus-visible{ outline:2px solid var(--mgp-accent); outline-offset:2px; }
.mgp-card:focus-visible{ outline:none; }
.mgp-card:focus-visible .mgp-card-art{
  transform:translateY(-3px);
  box-shadow:var(--mgp-shadow-2), 0 0 0 3px var(--mgp-accent);
}

@media (prefers-reduced-motion:reduce){
  *{ animation-duration:.001ms; animation-iteration-count:1; transition-duration:.001ms; }
  .mgp-card:hover .mgp-card-art{ transform:none; }
}
