/* ==========================================================================
   Arcade theme - dark, mobile first, no framework.
   ========================================================================== */

:root {
  --bg: #0f1117;
  --bg-soft: #161a24;
  --bg-card: #1b2030;
  --bg-hover: #222840;
  --line: #262d40;
  --text: #e8ecf5;
  --text-dim: #9aa4bd;
  --accent: #6c5ce7;
  --accent-2: #00d1b2;
  --accent-hot: #ff5c8a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --wrap: 1240px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.25rem); }
h2 { font-size: clamp(1.15rem, 1rem + .8vw, 1.5rem); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.section { margin: 36px auto; }
.center { text-align: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* --------------------------------------------------------------- header -- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 17, 23, .92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hot)); color: #fff;
}
.brand-name { white-space: nowrap; }

.search { display: flex; align-items: center; background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 14px; max-width: 420px; width: 100%; justify-self: end; }
.search input {
  flex: 1; min-width: 0; background: none; border: 0; color: var(--text);
  font-size: .95rem; padding: 6px 0; outline: none;
}
.search input::placeholder { color: var(--text-dim); }
.search button {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff;
}

.site-nav { display: none; gap: 4px; align-items: center; }
.site-nav a { padding: 8px 12px; border-radius: 999px; color: var(--text-dim); font-size: .92rem; font-weight: 600; }
.site-nav a:hover { color: var(--text); background: var(--bg-hover); }
.site-nav .nav-cta { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-hot)); }
.site-nav .nav-cta:hover { filter: brightness(1.1); background: linear-gradient(135deg, var(--accent), var(--accent-hot)); }

.nav-toggle {
  display: grid; gap: 4px; width: 40px; height: 38px; padding: 9px 8px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

@media (min-width: 900px) {
  .header-inner { grid-template-columns: auto 1fr auto; }
  .site-nav { display: flex; }
  .nav-toggle { display: none; }
}

@media (max-width: 899px) {
  .header-inner { grid-template-columns: auto 1fr auto; row-gap: 0; }
  .search { order: 3; grid-column: 1 / -1; max-width: none; margin-bottom: 10px; }
  .site-nav {
    order: 4; grid-column: 1 / -1; display: none; flex-direction: column;
    align-items: stretch; padding-bottom: 12px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 11px 14px; border-radius: var(--radius-sm); background: var(--bg-card); }
}

/* ----------------------------------------------------------------- hero -- */

.hero {
  background:
    radial-gradient(900px 340px at 12% -10%, rgba(108, 92, 231, .35), transparent 65%),
    radial-gradient(700px 320px at 88% 0%, rgba(0, 209, 178, .18), transparent 60%),
    var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 44px 0 40px;
  text-align: center;
}
.hero h1 { margin-bottom: 10px; }
.hero p { color: var(--text-dim); margin: 0 auto; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: .95rem;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-hot)); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--bg-card); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg-hover); }

/* ------------------------------------------------------------- sections -- */

.page-head { padding: 28px 16px 4px; }
.page-head h1 { margin-bottom: 6px; }
.page-head p { color: var(--text-dim); margin: 0; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-link { color: var(--accent-2); font-size: .9rem; font-weight: 600; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

.sorts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sort { padding: 7px 14px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--line); color: var(--text-dim); font-size: .88rem; font-weight: 600; }
.sort:hover { color: var(--text); }
.sort.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.empty { color: var(--text-dim); padding: 30px 0; text-align: center; }

/* ---------------------------------------------------------- game tiles -- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; } }

.card {
  display: block; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }

/* GamePix cover art is 16:10 (1360x850 native). Matching that ratio means
   object-fit has nothing to crop, so no game art is cut off. */
.card-thumb { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--bg-soft); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.card-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(15, 17, 23, .55); color: #fff; opacity: 0; transition: opacity .18s ease;
}
.card:hover .card-play { opacity: 1; }

.card-body { display: block; padding: 10px 12px 12px; }
.card-title {
  display: block; font-weight: 650; font-size: .92rem; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-cat { display: block; color: var(--text-dim); font-size: .78rem; margin-top: 3px; }

/* -------------------------------------------------------------- chips --- */

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--line);
  font-size: .9rem; font-weight: 600;
}
.chip:hover { border-color: var(--accent); background: var(--bg-hover); }
.chip span { color: var(--text-dim); font-size: .78rem; font-weight: 500; }
.chips-sm .chip { padding: 6px 12px; font-size: .82rem; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.cat-card {
  display: flex; flex-direction: column; gap: 3px; padding: 16px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
}
.cat-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.cat-name { font-weight: 700; }
.cat-count { color: var(--text-dim); font-size: .82rem; }

/* -------------------------------------------------------------- player -- */

.play { padding-top: 18px; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; color: var(--text-dim); font-size: .85rem; margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }

.player {
  position: relative;
  width: 100%;
  aspect-ratio: var(--game-ratio, 4 / 3);
  max-height: min(78vh, 760px);
  margin-inline: auto;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.player.is-portrait { max-width: min(100%, 520px); }

.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

.player-poster { position: absolute; inset: 0; }
.player-poster img { width: 100%; height: 100%; object-fit: cover; filter: blur(6px) brightness(.45); transform: scale(1.06); }
.player-poster-inner {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 20px; text-align: center;
}
.btn-play {
  background: linear-gradient(135deg, var(--accent), var(--accent-hot)); color: #fff;
  font-size: 1.05rem; padding: 14px 28px; box-shadow: var(--shadow);
}
.btn-play:hover { filter: brightness(1.1); }
.player-note { color: var(--text-dim); font-size: .82rem; margin: 0; }

.player:fullscreen, .player:-webkit-full-screen { max-height: none; border-radius: 0; aspect-ratio: auto; height: 100%; }

.player-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin: 16px 0 6px;
}
.player-bar h1 { margin: 0; font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); }
.player-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.tool {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-dim); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer;
}
.tool:hover { color: var(--text); border-color: var(--accent); }
.tool[aria-pressed="true"] { color: var(--accent-hot); border-color: var(--accent-hot); }
.tool[aria-pressed="true"] svg { fill: var(--accent-hot); }

.game-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin: 22px 0; padding: 0;
}
.game-facts > div { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.game-facts dt { color: var(--text-dim); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.game-facts dd { margin: 3px 0 0; font-weight: 650; font-size: .92rem; }

.game-about { margin-top: 22px; }

/* --------------------------------------------------------------- prose -- */

.prose { color: var(--text-dim); }
.prose.narrow { max-width: 72ch; }
.prose h2 { color: var(--text); margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose a { color: var(--accent-2); text-decoration: underline; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose code { background: var(--bg-card); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: .88em; color: var(--text); }

.prose h3 { color: var(--text); font-size: 1rem; margin-top: 1.4em; }
.page-meta { font-size: .82rem; color: var(--text-dim); font-style: italic; margin-top: -.4em; }

/* ------------------------------------------------------------ site map -- */

.sitemap-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 26px; }
.sitemap-cols h2 { font-size: 1.05rem; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { margin-bottom: 8px; }
.link-list a { color: var(--text-dim); font-size: .92rem; }
.link-list a:hover { color: var(--accent-2); text-decoration: underline; }
.link-list-wide { columns: 220px auto; column-gap: 26px; }
.link-list-wide li { break-inside: avoid; }
.sitemap-more { margin-top: 16px; }
.sitemap-more a { color: var(--accent-2); font-weight: 600; }

.check-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.check-table td { border-bottom: 1px solid var(--line); padding: 9px 8px; vertical-align: top; font-size: .9rem; }
.check-table .ok { color: var(--accent-2); font-weight: 700; }
.check-table .bad { color: var(--accent-hot); font-weight: 700; }

/* ---------------------------------------------------------- pagination -- */

.pagination { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin: 32px 0 8px; }
.page-btn {
  min-width: 40px; padding: 9px 13px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600;
}
.page-btn:hover { border-color: var(--accent); background: var(--bg-hover); }
.page-btn.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-gap { padding: 9px 4px; color: var(--text-dim); }

/* ----------------------------------------------------------------- ads -- */

.ad-slot { margin: 22px auto; text-align: center; min-height: 0; overflow: hidden; }
.ad-slot:empty { display: none; }

/*
 * Google asks that AdSense content units sit at least 150px away from a game,
 * so a player cannot hit an ad while reaching for the game. Breaking this is
 * treated as invalid click activity and costs you revenue, so the gap is
 * enforced here rather than left to whoever edits the template next.
 */
.play .ad-slot { margin-top: 150px; margin-bottom: 40px; }

/* -------------------------------------------------------------- footer -- */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 48px; padding: 34px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 26px; }
.footer-about p { color: var(--text-dim); font-size: .9rem; margin: 8px 0 0; }
.site-footer h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 7px; }
.site-footer li a { font-size: .9rem; color: var(--text); }
.site-footer li a:hover { color: var(--accent-2); }
.footer-legal { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 16px; }
.footer-legal p { color: var(--text-dim); font-size: .8rem; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .card:hover { transform: none; }
}
