/* ==========================================================================
   PixelPlay — stylesheet
   Mobile-first, dark neon theme. No frameworks, no external assets.
   ========================================================================== */

/* ------------------------------- Tokens ---------------------------------- */
:root {
  --bg: #070912;
  --bg-2: #0d1024;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-strong: rgba(255, 255, 255, 0.18);

  --text: #eaeeff;
  --muted: #8e98c4;
  --muted-2: #6b7499;

  --brand: #7c5cff;
  --brand-2: #22d3ee;
  --brand-3: #ff5c8a;
  --brand-4: #f5c451;

  --grad: linear-gradient(135deg, #7c5cff 0%, #22d3ee 100%);
  --grad-warm: linear-gradient(135deg, #ff5c8a 0%, #f5c451 100%);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;

  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.85);
  --shadow-glow: 0 12px 40px -12px rgba(124, 92, 255, 0.65);

  --maxw: 1200px;
  --header-h: 66px;

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

/* -------------------------------- Reset ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ambient background glow (pure CSS, no images) */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 900px;
  background:
    radial-gradient(600px 400px at 12% 8%, rgba(124, 92, 255, 0.30), transparent 60%),
    radial-gradient(560px 380px at 82% 0%, rgba(34, 211, 238, 0.22), transparent 62%),
    radial-gradient(520px 420px at 55% 45%, rgba(255, 92, 138, 0.14), transparent 65%);
  filter: blur(6px);
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; display: block; border: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-family: var(--font-display); letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: rgba(124, 92, 255, 0.4); }

/* Thin custom scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(124,92,255,.5) transparent; }
*::-webkit-scrollbar { height: 8px; width: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(124,92,255,.45); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------- Layout ---------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 30px);
  position: relative;
  z-index: 1;
}

main { position: relative; z-index: 1; }

.section { padding-block: 34px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 {
  font-size: clamp(1.35rem, 4.4vw, 1.9rem);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-head h2::before {
  content: "";
  width: 6px; height: 26px;
  border-radius: 99px;
  background: var(--grad);
  box-shadow: var(--shadow-glow);
}
.section-head p { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ------------------------------- Header ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 9, 18, 0.72);
  border-bottom: 1px solid var(--stroke);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--grad);
  display: grid; place-items: center;
  font-size: 1rem;
  box-shadow: var(--shadow-glow);
  flex: none;
}
.brand span b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Nav is shown inline at every width — no hamburger menu. */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.main-nav a {
  padding: 8px 11px;
  border-radius: 99px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); background: var(--surface-2); }

@media (min-width: 700px) {
  .main-nav { gap: 4px; }
  .main-nav a { padding: 9px 14px; font-size: 0.92rem; }
}

@media (max-width: 400px) {
  .site-header .wrap { gap: 6px; }
  .brand { font-size: 1rem; }
  .brand-mark { width: 30px; height: 30px; border-radius: 10px; font-size: 0.9rem; }
  .main-nav { gap: 0; }
  .main-nav a { padding: 6px 8px; font-size: 0.78rem; }
}

/* -------------------------------- Intro ---------------------------------- */
.home-intro { padding-block: 30px 6px; }
.home-intro h1 {
  font-size: clamp(1.5rem, 5.4vw, 2.3rem);
  line-height: 1.12;
  margin-bottom: 8px;
}
.hero-sub { color: var(--muted); font-size: clamp(0.92rem, 3vw, 1.02rem); max-width: 60ch; margin: 0; }

.hero-search {
  display: flex;
  gap: 8px;
  margin: 18px 0 6px;
  background: var(--surface);
  border: 1px solid var(--stroke-strong);
  border-radius: 99px;
  padding: 6px 6px 6px 16px;
  max-width: 520px;
  transition: border-color .2s, box-shadow .2s;
}
.hero-search:focus-within { border-color: rgba(124,92,255,.75); box-shadow: var(--shadow-glow); }
.hero-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 0.98rem;
  padding: 10px 0;
}
.hero-search input::placeholder { color: var(--muted-2); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform .16s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { box-shadow: 0 16px 44px -10px rgba(124,92,255,.9); }
.btn-ghost { background: var(--surface); border: 1px solid var(--stroke-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }

/* -------------------------- Category modules ----------------------------- */
.cat-module { padding: 26px 0 4px; }
.cat-module + .cat-module { border-top: 1px solid var(--stroke); }

.cat-head { margin-bottom: 16px; }
.cat-head h3 {
  font-size: clamp(1.15rem, 4.2vw, 1.5rem);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.cat-head h3::before {
  content: "";
  width: 6px; height: 24px;
  border-radius: 99px;
  flex: none;
  background: var(--cat-accent, var(--brand));
  box-shadow: 0 0 22px -2px var(--cat-accent, var(--brand));
}
.cat-count {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 99px;
  padding: 4px 10px;
}
.cat-blurb { color: var(--muted); font-size: .88rem; margin: 0; }

.cat-module .card:hover { border-color: var(--cat-accent, var(--stroke-strong)); }
.cat-module .card-play i { background: linear-gradient(135deg, var(--cat-accent, var(--brand)), var(--brand-2)); }

/* --------------------------- Filter chips --------------------------------- */
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 9px 18px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s;
}
.chip:hover { color: var(--text); border-color: var(--stroke-strong); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }

/* -------------------------------- Cards ---------------------------------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 560px) { .game-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .game-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--stroke);
  transition: transform .22s ease, border-color .22s, box-shadow .22s;
  display: block;
}
.card:hover { transform: translateY(-5px); border-color: var(--stroke-strong); box-shadow: var(--shadow); }
.card-thumb { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg-2); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-thumb img { transform: scale(1.06); }
.card-cat {
  position: absolute; top: 10px; left: 10px;
  background: rgba(7,9,18,.72);
  backdrop-filter: blur(6px);
  border: 1px solid var(--stroke-strong);
  color: var(--text);
  font-size: 0.68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 99px;
}
.card-play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(rgba(7,9,18,.15), rgba(7,9,18,.7));
  opacity: 0; transition: opacity .25s;
}
.card:hover .card-play { opacity: 1; }
.card-play i {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: var(--shadow-glow);
  font-style: normal; font-size: 1rem; color: #fff;
}
.card-body { padding: 11px 12px 13px; }
.card-body h3 { font-size: 0.94rem; font-family: var(--font); font-weight: 700; margin-bottom: 5px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.76rem; color: var(--muted); }
.card-rating { color: var(--brand-4); font-weight: 700; }

.empty-state {
  display: none;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state.show { display: block; }
.empty-state b { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: 6px; }

/* ------------------------- Featured / promo strip ------------------------ */
.promo {
  margin: 8px 0 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke-strong);
  background:
    radial-gradient(500px 220px at 88% 20%, rgba(34,211,238,.22), transparent 65%),
    radial-gradient(460px 240px at 8% 90%, rgba(255,92,138,.2), transparent 65%),
    var(--bg-2);
  padding: 26px 22px;
  display: grid;
  gap: 16px;
}
@media (min-width: 760px) { .promo { grid-template-columns: 1.4fr 1fr; align-items: center; padding: 34px; } }
.promo h2 { font-size: clamp(1.4rem, 5vw, 2.1rem); margin-bottom: 10px; }
.promo p { color: var(--muted); max-width: 60ch; }
.promo-points { display: grid; gap: 10px; }
.promo-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--muted); }
.promo-points li b { color: var(--text); display: block; font-size: 0.95rem; }
.dot {
  width: 26px; height: 26px; border-radius: 9px; flex: none;
  background: var(--grad); display: grid; place-items: center; font-size: .8rem; color: #fff;
}

/* ------------------------------ Game page -------------------------------- */
.crumbs { padding: 18px 0 6px; font-size: 0.82rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--text); }

.play-layout { display: grid; gap: 24px; padding-bottom: 20px; }
@media (min-width: 980px) { .play-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; } }

.player-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--stroke-strong);
  background: #04050c;
  aspect-ratio: 16 / 11;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}
@media (max-width: 560px) { .player-frame { aspect-ratio: 3 / 4; } }
.player-frame img.player-cover, .player-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.player-frame iframe { display: none; background: #04050c; z-index: 3; }
.player-frame.playing iframe { display: block; }
.player-frame.playing .player-overlay { display: none; }

.player-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(rgba(4,5,12,.35), rgba(4,5,12,.8));
  z-index: 2;
  padding: 20px;
  text-align: center;
}
.player-overlay .po-inner { display: grid; gap: 14px; justify-items: center; }
.btn-play {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: var(--shadow-glow);
  transition: transform .2s;
  font-size: 1.7rem; color: #fff;
}
.btn-play:hover { transform: scale(1.07); }
.player-overlay small { color: var(--muted); font-size: .82rem; }

.player-loading {
  position: absolute; inset: 0;
  display: none; place-items: center;
  background: rgba(4,5,12,.85);
  z-index: 4;
  color: var(--muted); font-size: .9rem;
  gap: 10px;
}
.player-loading.show { display: grid; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--brand-2);
  animation: spin .8s linear infinite;
  margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.game-header { padding: 20px 0 6px; }
.game-header h1 { font-size: clamp(1.5rem, 6vw, 2.3rem); margin-bottom: 10px; }
.game-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag {
  padding: 5px 12px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--stroke);
  font-size: .76rem; color: var(--muted); font-weight: 600;
}
.tag.solid { background: var(--grad); color: #fff; border-color: transparent; }

.game-stats { display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--muted); font-size: .86rem; }
.game-stats b { color: var(--text); }

.actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }

.info-card {
  margin-top: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--surface);
  padding: 20px;
}
.info-card h2 { font-size: 1.1rem; margin-bottom: 12px; }
.info-card p { color: var(--muted); font-size: .92rem; }
.info-card .howto { border-top: 1px dashed var(--stroke-strong); margin-top: 16px; padding-top: 16px; }
.info-card .howto h3 { font-size: .98rem; margin-bottom: 8px; }
.info-card .howto p { margin: 0; }

.side-col h3 { font-size: 1rem; margin-bottom: 14px; }
.side-list { display: grid; gap: 10px; }
.side-item {
  display: flex; gap: 12px; align-items: center;
  padding: 9px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--stroke);
  transition: background .2s, transform .2s, border-color .2s;
}
.side-item:hover { background: var(--surface-2); border-color: var(--stroke-strong); transform: translateX(3px); }
.side-item img { width: 58px; height: 58px; border-radius: 11px; object-fit: cover; flex: none; }
.side-item b { display: block; font-size: .88rem; }
.side-item span { font-size: .75rem; color: var(--muted); }

/* ------------------------------- Doc pages ------------------------------- */
.doc-hero { padding: 44px 0 10px; }
.doc-hero h1 { font-size: clamp(1.8rem, 7vw, 2.8rem); margin-bottom: 12px; }
.doc-hero .updated { color: var(--muted-2); font-size: .82rem; }
.doc-hero .intro { color: var(--muted); max-width: 70ch; margin-top: 14px; font-size: 1.02rem; }

.doc {
  max-width: 820px;
  padding: 10px 0 60px;
}
.doc section {
  padding: 22px 0;
  border-bottom: 1px solid var(--stroke);
}
.doc section:last-of-type { border-bottom: 0; }
.doc h2 { font-size: 1.2rem; margin-bottom: 12px; }
.doc p { color: var(--muted); margin-bottom: 12px; }
.doc p:last-child { margin-bottom: 0; }
.doc .contact-note {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--stroke);
  color: var(--text);
  font-size: .92rem;
}

.contact-form { display: grid; gap: 14px; max-width: 560px; margin-top: 22px; }
.field { display: grid; gap: 7px; }
.field label { font-size: .84rem; color: var(--muted); font-weight: 600; }
.field input, .field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--stroke-strong);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: rgba(124,92,255,.8); outline: none; }

/* -------------------------------- Footer --------------------------------- */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--stroke);
  background: rgba(6, 8, 16, .7);
  padding: 36px 0 26px;
  position: relative; z-index: 1;
}
.footer-grid { display: grid; gap: 26px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.footer-brand p { color: var(--muted); font-size: .88rem; max-width: 40ch; margin-top: 12px; }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); margin-bottom: 12px; }
.footer-col a { display: block; padding: 5px 0; color: var(--muted); font-size: .88rem; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 28px; padding-top: 18px;
  border-top: 1px solid var(--stroke);
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  color: var(--muted-2); font-size: .8rem;
}

/* ---------------------------- Misc utilities ----------------------------- */
.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 100;
}
.skip-link:focus { left: 12px; }

.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
