/* ==========================================================================
   BrowserGames.Pro — public site styles
   ========================================================================== */
:root {
  --bg: #0b0d1a;
  --bg-2: #11142a;
  --surface: #171b36;
  --surface-2: #20254a;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eef0ff;
  --muted: #9aa0c7;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --hot: #ff4d8d;
  --good: #3ddc97;
  --grad: linear-gradient(135deg, #7c5cff 0%, #4f8bff 50%, #22d3ee 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --max: 1440px;
  --pad: clamp(16px, 3vw, 32px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Outfit", var(--font);
  --tabbar-h: 0px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body {
  margin: 0;
  font: 15px/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: var(--tabbar-h);
}
img { max-width: 100%; height: auto; display: block; }
/* Page glow lives on a fixed, GPU-composited layer so scrolling never repaints it. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; will-change: transform;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(124, 92, 255, .18), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(34, 211, 238, .10), transparent 60%);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.i { width: 20px; height: 20px; flex: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 26, .97);
  transform: translateZ(0);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: var(--max); margin: 0 auto; padding: 10px var(--pad);
  display: flex; align-items: center; gap: 16px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.logo-img { height: 44px; width: auto; }
.logo-mark { width: 40px; height: 40px; transition: transform .25s; }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.05); }
.logo-word { font: 800 22px/1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.logo-word b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-word i { font-style: normal; font-weight: 600; font-size: 13px; color: var(--muted); margin-left: 1px; }
.search { position: relative; flex: 1; max-width: 640px; margin: 0 auto; display: flex; align-items: center; }
.search > .i { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 46px; padding: 0 44px 0 44px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124, 92, 255, .25); background: var(--surface-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search-kbd {
  position: absolute; right: 14px; font: 12px var(--font); color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px;
}
.search input:focus ~ .search-kbd { display: none; }
.suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; max-height: 70vh; overflow: auto; z-index: 60;
}
.sg-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-sm); }
.sg-item img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--bg-2); }
.sg-item strong { display: block; font-weight: 600; }
.sg-item small { color: var(--muted); }
.sg-item mark { background: none; color: var(--accent-2); }
.sg-item.is-active, .sg-item:hover { background: var(--surface-2); }
.sg-all { display: block; text-align: center; padding: 10px; color: var(--accent-2); font-weight: 600; border-top: 1px solid var(--line); margin-top: 4px; }
.sg-empty { padding: 14px; color: var(--muted); text-align: center; }

.top-actions { display: flex; gap: 8px; }
.pill {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 999px; font-weight: 600; white-space: nowrap;
  transition: background .2s, transform .15s;
}
.pill-ghost { background: var(--surface); border: 1px solid var(--line); }
.pill-ghost:hover { background: var(--surface-2); }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--hot); font-size: 11px; display: grid; place-items: center;
}

.cat-rail { border-top: 1px solid var(--line); }
.cat-rail-in {
  max-width: var(--max); margin: 0 auto; padding: 8px var(--pad);
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.cat-rail-in::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 34px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .2s, border-color .2s;
}
.chip:hover { background: var(--surface-2); border-color: var(--line-2); }
.chip.is-active { background: var(--grad); border-color: transparent; color: #fff; }
.chip small { color: var(--muted); font-size: 12px; }
.chip .i { width: 16px; height: 16px; color: var(--accent-2); }
.chip.is-active .i { color: #fff; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Layout ---------- */
.main { max-width: var(--max); margin: 0 auto; padding: 20px var(--pad) 40px; }
.block, .row { margin-top: 36px; }
.row, .block, .seo-block, .footer { content-visibility: auto; contain-intrinsic-size: auto 320px; }
.hero + .row, .row[data-recent-row] { content-visibility: visible; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.row-head h2 { font-size: clamp(19px, 2.2vw, 24px); display: flex; align-items: center; gap: 10px; }
.row-ico {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2); font-size: 18px; color: var(--accent-2);
}
.row-ico[style] { background: linear-gradient(140deg, hsl(var(--h) 85% 60%), hsl(calc(var(--h) + 35) 80% 45%)); color: #fff; box-shadow: 0 6px 16px hsl(var(--h) 80% 40% / .35); }
.row-ico .i { width: 18px; height: 18px; }

/* Category icon badge */
.cat-ico {
  display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px;
  color: #fff; background: linear-gradient(140deg, hsl(var(--h, 260) 85% 62%), hsl(calc(var(--h, 260) + 35) 80% 45%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 20px hsl(var(--h, 260) 80% 40% / .35);
}
.cat-ico .i { width: 24px; height: 24px; }
.cat-ico-lg { width: 54px; height: 54px; border-radius: 16px; }
.cat-ico-lg .i { width: 28px; height: 28px; }
.empty-art { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 24px; margin-bottom: 14px; background: var(--grad); color: #fff; box-shadow: 0 14px 34px rgba(124, 92, 255, .45); }
.empty-art .i { width: 44px; height: 44px; }
.row-tools { display: flex; align-items: center; gap: 6px; }
.row-more { display: inline-flex; align-items: center; gap: 2px; color: var(--accent-2); font-weight: 600; font-size: 14px; padding: 6px 8px; border-radius: 8px; }
.row-more:hover { background: var(--surface); }
.row-more .i { width: 16px; height: 16px; }
.row-nav {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
}
.row-nav:hover { background: var(--surface-2); }
.row-nav .i { width: 18px; height: 18px; }
.row-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(170px, 18vw, 230px);
  gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 4px 2px 10px; margin: -4px -2px 0; scrollbar-width: none;
}
.row-track::-webkit-scrollbar { display: none; }
.row-track > * { scroll-snap-align: start; }
.row-track, .cat-rail-in { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.row-ranked { grid-auto-columns: clamp(190px, 20vw, 250px); }
.row-ranked .card { margin-left: 46px; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 16vw, 200px), 1fr));
}
.grid-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 24px; text-align: left; }

/* ---------- Game card ---------- */
.card { position: relative; border-radius: var(--radius); contain: layout style; }
.card-link { display: block; border-radius: var(--radius); }
.card-media {
  position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--radius);
  overflow: hidden; background: linear-gradient(135deg, var(--surface), var(--surface-2));
  box-shadow: 0 0 0 1px var(--line);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.card-media img, .card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-media video { opacity: 0; transition: opacity .3s; }
.card.is-previewing .card-media video { opacity: 1; }
.card-play {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; display: grid; place-items: center; background: rgba(124, 92, 255, .92);
  box-shadow: 0 8px 24px rgba(124, 92, 255, .5);
  opacity: 0; transform: scale(.7); transition: opacity .2s, transform .2s;
}
.card-play .i { width: 22px; height: 22px; margin-left: 3px; color: #fff; }
.card-link:hover .card-media, .card-link:focus-visible .card-media {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 0 0 2px var(--accent), 0 16px 32px rgba(0, 0, 0, .45);
}
.card-link:hover .card-play, .card-link:focus-visible .card-play { opacity: 1; transform: scale(1); }
.card.is-previewing .card-play { opacity: 0; }
.card-body { display: block; padding: 9px 4px 0; }
.card-title { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-cat { display: block; font-size: 12.5px; color: var(--muted); }
.card-badge {
  position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  background: rgba(11, 13, 26, .82);
}
.card-badge-hot { background: linear-gradient(135deg, #ff4d8d, #ff8a3d); }
.card-rank {
  position: absolute; left: -48px; bottom: -8px; font: 800 76px/1 var(--display);
  color: var(--bg); -webkit-text-stroke: 2px rgba(255, 255, 255, .35);
  pointer-events: none;
}
.row-ranked .card-media { overflow: visible; }
.row-ranked .card-media img, .row-ranked .card-media video { border-radius: var(--radius); }
.card-fav {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(11, 13, 26, .78);
  opacity: 0; transition: opacity .2s, transform .15s, background .2s;
}
.card-fav .i { width: 17px; height: 17px; }
.card:hover .card-fav, .card-fav:focus-visible, .card-fav[aria-pressed="true"] { opacity: 1; }
.card-fav:hover { transform: scale(1.1); }
.card-fav[aria-pressed="true"], [data-fav][aria-pressed="true"] { color: var(--hot); }
.card-fav[aria-pressed="true"] .i, [data-fav][aria-pressed="true"] .i { fill: currentColor; }
@media (hover: none) { .card-fav { opacity: 1; width: 30px; height: 30px; } .card-play { display: none; } }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: clamp(20px, 3vw, 40px);
  align-items: center; padding: clamp(8px, 2vw, 24px) 0 8px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; padding: 6px 12px;
  border-radius: 999px; background: rgba(124, 92, 255, .14); border: 1px solid rgba(124, 92, 255, .35);
  color: #cbbfff; font-size: 13px; font-weight: 600;
}
.eyebrow .i { width: 15px; height: 15px; color: #ffd166; }
.hero h1 { font-size: clamp(30px, 4.6vw, 54px); font-weight: 800; }
.lead { color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); margin: 14px 0 22px; max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-cta.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 15px;
  transition: transform .15s, box-shadow .2s, background .2s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 28px rgba(124, 92, 255, .45); }
.btn-primary:hover { box-shadow: 0 14px 36px rgba(124, 92, 255, .6); transform: translateY(-1px); }
.btn-primary .i { width: 18px; height: 18px; }
.btn-ghost { background: var(--surface); border: 1px solid var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-xl { height: 58px; padding: 0 34px; font-size: 18px; }
.btn-block { width: 100%; margin-top: 14px; }

.spotlight { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; }
.spot-main { position: relative; display: block; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px var(--line-2); }
.spot-main .card-media { aspect-ratio: auto; height: 100%; min-height: 260px; border-radius: 0; box-shadow: none; }
.spot-main::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(5, 6, 15, .92)); pointer-events: none; }
.spot-main:hover .card-media { transform: scale(1.03); }
.spot-label { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 1; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.spot-label strong { font: 800 clamp(20px, 2.4vw, 30px)/1.1 var(--display); text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.tag-live { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 6px; background: linear-gradient(135deg, #ff4d8d, #ff8a3d); }
.spot-play { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; background: #fff; color: #11142a; font-weight: 700; font-size: 14px; }
.spot-play .i { width: 15px; height: 15px; }
.spot-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; }
.spot-side .card-body { padding-top: 6px; }
.spot-side .card-cat { display: none; }

/* ---------- Category tiles ---------- */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat-tile {
  --c: hsl(var(--h) 85% 62%);
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px;
  padding: 16px; border-radius: var(--radius); min-height: 104px;
  background: linear-gradient(140deg, hsl(var(--h) 70% 50% / .28), hsl(calc(var(--h) + 40) 70% 40% / .12));
  border: 1px solid hsl(var(--h) 70% 60% / .25);
  transition: transform .2s, border-color .2s;
}
.cat-tile:hover { transform: translateY(-3px); border-color: var(--c); }
.cat-tile .cat-ico { margin-bottom: 10px; }
.cat-tile:hover .cat-ico { transform: rotate(-6deg) scale(1.06); }
.cat-ico { transition: transform .2s; }
.cat-name { font: 700 16px var(--display); }
.cat-count { font-size: 12.5px; color: var(--muted); }

.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cat-card {
  display: block; border-radius: var(--radius); overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); transition: transform .2s, border-color .2s;
}
.cat-card:hover { transform: translateY(-3px); border-color: hsl(var(--h) 80% 60%); }
.cat-covers { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 2 / 1; gap: 2px; background: var(--bg-2); }
.cat-covers img { width: 100%; height: 100%; object-fit: cover; }
.cat-covers img:first-child { grid-row: span 2; }
.cat-card-body { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.cat-card:hover .cat-ico { transform: rotate(-6deg) scale(1.06); }
.cat-card-body strong { display: block; font-family: var(--display); font-size: 17px; }
.cat-card-body small { color: var(--muted); }

/* ---------- Tags ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 500;
}
.tag:hover { border-color: var(--accent); color: #fff; }
.tag small { color: var(--muted); font-size: 11.5px; }

/* ---------- Listing pages ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; opacity: .6; }
.crumbs a:hover { color: var(--text); }
.list-head { margin-bottom: 22px; }
.list-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.list-title h1 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; display: flex; align-items: center; gap: 12px; }
.list-title h1 small { font-size: .5em; color: var(--muted); font-weight: 600; }

.count-pill { padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; }
.list-intro { color: var(--muted); max-width: 70ch; margin: 8px 0 0; }
.list-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.seg { display: inline-flex; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.seg a { padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg a.is-on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.filter { position: relative; display: flex; align-items: center; flex: 1; max-width: 320px; }
.filter .i { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--muted); }
.filter input { width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.filter input:focus { outline: none; border-color: var(--accent); }

.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 32px 0 0; }
.pg-num, .pg-btn { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.pg-num:hover, .pg-btn:hover { background: var(--surface-2); }
.pg-num.is-current { background: var(--grad); border-color: transparent; }
.pg-btn .i { width: 16px; height: 16px; }
.pg-gap { color: var(--muted); padding: 0 4px; }
.load-more { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 32px; }
.load-more small { color: var(--muted); }

.empty { text-align: center; padding: 40px 0; }
.empty h1, .empty h2 { font-size: clamp(22px, 3vw, 32px); margin-bottom: 8px; }
.empty > p { color: var(--muted); }

.empty .hero-cta { margin: 20px 0; }
.empty-inline { color: var(--muted); display: flex; align-items: center; gap: 6px; padding: 18px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty-inline .i { width: 16px; height: 16px; color: var(--hot); }

/* ---------- Skeletons ---------- */
.skel .card-media { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skel .card-title { height: 12px; width: 70%; margin-top: 4px; border-radius: 6px; background: var(--surface); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Game page ---------- */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.player { border-radius: 20px; overflow: hidden; background: #000; box-shadow: var(--shadow), 0 0 0 1px var(--line-2); }
.player-stage { position: relative; aspect-ratio: var(--ar); max-height: calc(100vh - 220px); width: 100%; background: #05060f; margin: 0 auto; }
.player-frame, .player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-cover { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.cover-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(28px) brightness(.45) saturate(1.3); transform: scale(1.1); }
.cover-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; text-align: center; }
.cover-thumb { width: clamp(140px, 22vw, 240px); aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, .6), 0 0 0 2px rgba(255, 255, 255, .15); }
.cover-title { font-size: clamp(22px, 3vw, 34px); font-weight: 800; text-shadow: 0 2px 16px rgba(0, 0, 0, .6); }
.cover-hint { margin: 0; color: rgba(255, 255, 255, .7); font-size: 13px; }
#playBtn { position: relative; }
#playBtn::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid rgba(124, 92, 255, .7);
  animation: pulse 2.2s ease-out infinite; pointer-events: none; will-change: transform, opacity;
}
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(1.25, 1.5); opacity: 0; } }
.player.is-playing .player-cover { display: none; }
.player-exit { display: none; }

.player-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--surface); border-top: 1px solid var(--line);
}
.pb-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pb-title img { width: 40px; height: 30px; border-radius: 6px; object-fit: cover; }
.pb-title strong { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30ch; }
.pb-title a { font-size: 12.5px; color: var(--accent-2); }
.pb-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vote { display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 2px; }
.pb-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); transition: background .2s, color .2s; }
.pb-btn:hover { background: var(--surface-2); color: var(--text); }
.pb-btn .i { width: 18px; height: 18px; }
#likeBtn[aria-pressed="true"] { color: var(--good); }
#likeBtn[aria-pressed="true"] .i, #dislikeBtn[aria-pressed="true"] .i { fill: currentColor; fill-opacity: .25; }
#dislikeBtn[aria-pressed="true"] { color: var(--hot); }
#muteBtn[aria-pressed="true"] { color: var(--hot); }

.about { margin-top: 28px; padding: clamp(18px, 2.5vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.about h2 { font-size: 22px; margin-bottom: 12px; }
.about h3 { font-size: 17px; margin: 20px 0 8px; }
.prose { color: #cfd3f2; overflow-wrap: anywhere; }
.howto { padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--bg-2); border-radius: 0 10px 10px 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 20px 0; }
.facts div { padding: 10px 14px; background: var(--bg-2); border-radius: 12px; }
.facts dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.facts a { color: var(--accent-2); }

.game-side { position: sticky; top: 130px; }
.side-h { font-size: 18px; margin-bottom: 12px; }
.side-list { display: flex; flex-direction: column; gap: 8px; }
.mini { display: flex; gap: 12px; align-items: center; padding: 6px; border-radius: 12px; transition: background .2s; }
.mini:hover { background: var(--surface); }
.mini img { width: 104px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; flex: none; }
.mini strong { display: block; font-size: 14px; line-height: 1.3; }
.mini small { color: var(--muted); font-size: 12.5px; }
.row-compact { display: none; }

body.is-theater .game-layout { grid-template-columns: minmax(0, 1fr); }
body.is-theater .game-side { display: none; }
body.is-theater .row-compact { display: block; }
body.is-theater .player-stage { max-height: calc(100vh - 140px); }

/* Mobile immersive player */
body.is-immersive { overflow: hidden; }
body.is-immersive .player { position: fixed; inset: 0; z-index: 200; border-radius: 0; margin: 0; }
body.is-immersive .player-stage { position: absolute; inset: 0; aspect-ratio: auto; max-height: none; }
body.is-immersive .player-bar { display: none; }
body.is-immersive .player-exit {
  display: grid; place-items: center; position: absolute; z-index: 3; top: calc(8px + env(safe-area-inset-top)); left: 8px;
  width: 38px; height: 38px; border-radius: 50%; background: rgba(0, 0, 0, .7); color: #fff;
}

/* ---------- SEO block / FAQ ---------- */
.seo-block { margin-top: 48px; padding: clamp(20px, 3vw, 36px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.seo-block h2 { font-size: 22px; margin-bottom: 10px; }
.seo-block p { color: #cfd3f2; max-width: 85ch; }
.seo-block a { color: var(--accent-2); }
.faq { margin-top: 18px; display: grid; gap: 8px; }
.faq details { background: var(--bg-2); border-radius: 12px; padding: 0 16px; border: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: "+"; color: var(--accent-2); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: rgba(5, 6, 15, .5); margin-top: 40px; }
.footer-in { max-width: var(--max); margin: 0 auto; padding: 36px var(--pad); display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.footer-brand .logo-mark, .footer-brand .logo-img { margin-bottom: 0; }
.footer-brand > p { margin-top: 12px; }
.footer-brand p { color: var(--muted); font-size: 14px; max-width: 38ch; }
.footer-col h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.footer-col a { display: block; padding: 4px 0; font-size: 14px; color: #cfd3f2; }
.footer-col a:hover { color: #fff; }
.footer-copy { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 var(--pad) 24px; margin: 0; }

/* ---------- Mobile tab bar & toast ---------- */
.tabbar { display: none; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--tabbar-h)); z-index: 300;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 999px; background: #fff; color: #11142a; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); transition: opacity .25s, transform .25s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .game-side { display: none; }
  .row-compact { display: block; }
  .footer-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .spotlight { grid-template-columns: minmax(0, 1fr); }
  .spot-side { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .top-actions .pill span { display: none; }
  .top-actions .pill { width: 42px; padding: 0; justify-content: center; }
}
@media (max-width: 720px) {
  :root { --tabbar-h: calc(62px + env(safe-area-inset-bottom)); }
  html { scroll-padding-top: 120px; }
  .topbar-in { gap: 10px; padding-top: 8px; padding-bottom: 8px; }
  .logo-mark { width: 34px; height: 34px; }
  .logo-word { display: none; }
  .logo-img { height: 34px; }
  .top-actions { display: none; }
  .search input { height: 42px; font-size: 16px; }
  .search-kbd { display: none; }
  .cat-rail-in { padding-top: 6px; padding-bottom: 6px; }
  .chip { height: 32px; padding: 0 12px; font-size: 13.5px; }
  .main { padding-top: 14px; }
  .row-nav { display: none; }
  .row-track { grid-auto-columns: 42vw; gap: 12px; }
  .row-ranked { grid-auto-columns: 48vw; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .spot-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spot-main .card-media { min-height: 200px; }
  .hero-cta .btn { flex: 1; }
  .filter { flex-basis: 100%; max-width: none; }
  .cat-tiles { grid-template-columns: repeat(2, 1fr); }
  .player { border-radius: 14px; margin: 0 calc(var(--pad) * -1); border-radius: 0; }
  .player-stage { max-height: none; aspect-ratio: 4 / 3; }
  .pb-desk, .pb-label { display: none; }
  .pb-title strong { max-width: 18ch; }
  .footer-in { grid-template-columns: 1fr; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(11, 13, 26, .98); transform: translateZ(0); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 500; }
  .tabbar a.is-on { color: var(--text); }
  .tabbar a.is-on .i { color: var(--accent-2); }
  .tabbar .i { width: 22px; height: 22px; }
  .suggest { position: fixed; top: 64px; left: 8px; right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Info & guide pages (page.php) ---------- */
.doc-hero { padding: 8px 0 4px; max-width: 860px; }
.doc-hero h1 { font-size: clamp(30px, 4.4vw, 50px); font-weight: 800; }
.doc-hero .lead { max-width: 70ch; }
.doc-hero .lead a, .doc a { color: var(--accent-2); }
.doc-hero-info .lead { margin-bottom: 0; }
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; margin-top: 32px; }
.doc { padding: clamp(20px, 3vw, 36px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.doc-chips { margin-bottom: 22px; }
.doc-body { font-size: 16px; line-height: 1.7; }
.doc-body h2 { font-size: 22px; margin: 28px 0 8px; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body p { margin: 0 0 12px; max-width: 72ch; }
.doc-body ul { margin: 0 0 12px; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.doc-body li { position: relative; padding: 10px 14px 10px 40px; background: var(--bg-2); border-radius: 12px; }
.doc-body li::before { content: ""; position: absolute; left: 15px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 3px; background: var(--grad); }
.callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; margin-bottom: 26px; border-radius: 16px; background: linear-gradient(140deg, rgba(124, 92, 255, .2), rgba(34, 211, 238, .1)); border: 1px solid rgba(124, 92, 255, .35); }
.callout strong { display: block; font: 700 20px var(--display); }
.callout span { color: var(--muted); font-size: 14px; }
.cta-card { display: flex; align-items: center; gap: 16px; margin-top: 28px; padding: 18px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line-2); transition: border-color .2s, transform .2s; }
.cta-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.cta-card > span:nth-child(2) { flex: 1; }
.cta-card strong { display: block; font: 700 18px var(--display); }
.cta-card small { color: var(--muted); }
.cta-art { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--grad); color: #fff; flex: none; }
.cta-art .i { width: 28px; height: 28px; }
.doc-side { position: sticky; top: 130px; display: grid; gap: 16px; }
.side-card { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.side-card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; font-family: var(--font); }
.side-card > a { display: block; padding: 8px 10px; border-radius: 10px; font-size: 14.5px; font-weight: 500; }
.side-card > a:hover { background: var(--surface-2); }
.side-card > a.is-on { background: var(--surface-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 1000px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-side { position: static; }
}
@media (max-width: 720px) {
  .cta-card { flex-wrap: wrap; }
  .cta-card .btn { width: 100%; }
}

/* ---------- Search panel: recent + trending ---------- */
.sg-sec { padding: 8px 8px 4px; }
.sg-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.sg-clear { font-size: 12px; color: var(--accent-2); text-transform: none; letter-spacing: 0; }
.sg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-chip { padding: 6px 12px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 500; }
.sg-chip:hover { border-color: var(--accent); }
.sg-chip.is-recent::before { content: "↺ "; color: var(--muted); }

/* ---------- Header extras ---------- */
.lvl {
  position: absolute; bottom: -6px; right: -6px; padding: 1px 6px; border-radius: 6px;
  font-size: 10px; font-weight: 800; background: var(--grad); color: #fff; border: 2px solid var(--bg);
}
.pill-install { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(124, 92, 255, .4); }
.row-ico-reco { background: var(--grad); color: #fff; }

/* ---------- Celebration toast (achievements / level up) ---------- */
.celebrate {
  position: fixed; left: 50%; top: 90px; z-index: 320; display: flex; align-items: center; gap: 12px;
  padding: 12px 20px 12px 14px; border-radius: 18px; background: #fff; color: #11142a;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45), 0 0 0 3px rgba(124, 92, 255, .5);
  transform: translate(-50%, -20px) scale(.9); opacity: 0; pointer-events: none;
  transition: transform .35s cubic-bezier(.2, 1.4, .4, 1), opacity .25s;
}
.celebrate.is-on { transform: translate(-50%, 0) scale(1); opacity: 1; }
.cel-ico { font-size: 30px; line-height: 1; }
.celebrate small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #7c5cff; }
.celebrate strong { font: 800 17px var(--display); }

/* ---------- Player profile (My games) ---------- */
.profile {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 28px; align-items: center;
  padding: clamp(18px, 3vw, 28px); border-radius: 22px; margin-bottom: 8px;
  background: linear-gradient(140deg, rgba(124, 92, 255, .22), rgba(34, 211, 238, .08)), var(--surface);
  border: 1px solid rgba(124, 92, 255, .3);
}
.profile:empty { display: none; }
.pf-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.pf-info { flex: 1; min-width: 0; }
.pf-ring {
  --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(#22d3ee calc(var(--p) * 1%), rgba(255, 255, 255, .1) 0);
}
.pf-ring span { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font: 800 32px var(--display); }
.pf-info small { display: block; color: var(--muted); font-size: 13px; }
.pf-info strong { font: 800 26px var(--display); }
.pf-bar { width: 220px; max-width: 100%; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); margin: 6px 0; overflow: hidden; }
.pf-bar i { display: block; height: 100%; background: var(--grad); border-radius: inherit; }
.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pf-stats div { padding: 12px; border-radius: 14px; background: rgba(11, 13, 26, .45); text-align: center; }
.pf-stats b { display: block; font: 800 22px var(--display); }
.pf-stats small { color: var(--muted); font-size: 12px; }
.pf-ach { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(11, 13, 26, .45); border: 1px solid var(--line); opacity: .45; filter: grayscale(1); }
.ach.is-on { opacity: 1; filter: none; border-color: rgba(124, 92, 255, .45); }
.ach span { grid-row: span 2; font-size: 26px; }
.ach strong { font-size: 13.5px; }
.ach small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.pf-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- Game page extras ---------- */
.cover-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s; filter: brightness(.55) saturate(1.2); }
.player-cover.has-video .cover-video { opacity: 1; }
.player-cover.has-video .cover-bg { opacity: 0; }
.cover-rating { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(61, 220, 151, .16); color: #8ff0c4; font-size: 13px; font-weight: 600; }
.cover-rating .i { width: 15px; height: 15px; }
.next-nudge {
  position: fixed; right: 20px; bottom: calc(20px + var(--tabbar-h)); z-index: 150; width: 300px;
  padding: 12px; border-radius: 18px; background: var(--surface-2); border: 1px solid rgba(124, 92, 255, .45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5); transform: translateY(20px); opacity: 0; transition: transform .35s, opacity .35s;
}
.next-nudge.is-on { transform: none; opacity: 1; }
.next-nudge > small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); margin-bottom: 8px; }
.next-nudge a { display: flex; gap: 12px; align-items: center; }
.next-nudge img { width: 96px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.next-nudge strong { display: block; font-size: 14.5px; }
.next-nudge em { font-style: normal; font-size: 13px; color: var(--accent-2); font-weight: 600; }
.nn-x { position: absolute; top: 6px; right: 10px; font-size: 20px; color: var(--muted); }

/* ---------- Category guide block ---------- */
.cat-guide h3 { font-size: 17px; margin: 22px 0 10px; }
.top-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.top-list a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 600; }
.top-list a:hover { border-color: var(--accent); }
.top-list img { width: 64px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.tl-n { width: 26px; text-align: center; font: 800 18px var(--display); color: var(--accent-2); }

@media (max-width: 720px) {
  .profile { grid-template-columns: minmax(0, 1fr); }
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-ach { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .next-nudge { left: 12px; right: 12px; width: auto; }
  .celebrate { top: 70px; width: calc(100% - 24px); }
}

/* ---------- Ad slots (codes come from Admin → Settings → Ads) ---------- */
.ad {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 24px auto 0; padding: 22px 8px 10px; min-height: 90px; max-width: 100%; overflow: hidden;
  border-radius: 14px; background: rgba(255, 255, 255, .025); border: 1px dashed rgba(255, 255, 255, .07);
}
.ad-label { position: absolute; top: 5px; left: 10px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); opacity: .7; }
.ad-body { display: flex; justify-content: center; max-width: 100%; overflow: hidden; }
.ad-body iframe, .ad-body img, .ad-body ins { max-width: 100%; }
.ad-player_below { margin-top: 16px; }
.ad-sidebar { margin: 0 0 18px; min-height: 250px; }
.ad-row { margin-top: 36px; }
.grid > .ad-span { grid-column: 1 / -1; margin: 4px 0; }
/* Backfill the partial row left above a full-width ad. */
.grid:has(> .ad-span) { grid-auto-flow: row dense; }
@media (max-width: 720px) {
  .ad { min-height: 60px; padding-top: 20px; }
}
