/* ─── Tokens (mirrors menul Theme::P) ────────────────────────── */
:root {
  --bg-glass:      #0e1016;
  --bg-glass-top:  #1c202c;
  --bg-glass-bot:  #0a0c12;
  --panel:         rgba(22, 26, 36, 0.71);
  --panel-border:  rgba(255, 255, 255, 0.07);
  --stroke:        rgba(255, 255, 255, 0.11);
  --stroke-soft:   rgba(255, 255, 255, 0.055);

  --fg:        #ebf0fa;
  --fg-dim:    #aab4c8;
  --fg-muted:  #788296;

  --accent:        #56a0ff;
  --accent-dim:    #3d85e3;
  --accent-soft:   rgba(86, 160, 255, 0.31);
  --accent-glow:   rgba(86, 160, 255, 0.11);

  --danger:    #ff606e;
  --success:   #50dc8c;

  --r-card:  28px;
  --r-panel: 18px;
  --r-frame: 12px;
}

/* ─── Global ──────────────────────────────────────────────────── */
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-glass);
  color: var(--fg);
  font-feature-settings: "cv11", "ss01";
  min-height: 100vh;
}

/* Sticky footer без касания layout-context body:
   main растягивается до viewport_height минус суммарная высота header+footer.
   Footer идёт в нормальном потоке после main → прижат к низу страницы. */
body > main {
  min-height: calc(100vh - 150px);
}
/* Snap-to-bottom footer: убираем top-margin, иначе на маленьких экранах
   страница overflow'ит на эту величину. */
body > footer {
  margin-top: 0;
}

[x-cloak] { display: none !important; }

/* ─── Canvas FX layer ─────────────────────────────────────────── */
/* Zapped to fixed positioning via CSS (не зависим от Tailwind CDN,
   на случай если он тормозит — canvas всегда на месте). */
#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  /* No transform / will-change here — those hints can make Chrome
     promote the canvas to a separate compositor layer that ignores
     the alpha:false backing buffer hint, rendering as RGBA and
     letting the underlying CSS bg-grad bleed through.  We rely on
     the JS-side synthetic resize event (particles.js) to wake up the
     compositor without changing the layer's alpha treatment. */
}

/* ─── Background layers ──────────────────────────────────────── */
.bg-grad {
  background: linear-gradient(180deg,
    var(--bg-glass-top) 0%,
    var(--bg-glass)     45%,
    var(--bg-glass-bot) 100%);
}
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.4) 1px, transparent 1px);
  background-size: 56px 56px;
}
.radial-bg {
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(86,160,255,0.10), transparent 65%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(86,160,255,0.06), transparent 65%);
}

/* ─── Brand «fsociety» — pulsing halo + occasional glitch ─────── */
.brand-fsociety {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  position: relative;
  display: inline-block;
  line-height: 1;
  text-shadow:
    -1.4px 0 0  rgba(86,160,255,0.28),
     1.4px 0 0  rgba(86,160,255,0.28),
     0 -1.4px 0 rgba(86,160,255,0.28),
     0  1.4px 0 rgba(86,160,255,0.28),
    -2.8px 0 0  rgba(86,160,255,0.14),
     2.8px 0 0  rgba(86,160,255,0.14),
     0 -2.8px 0 rgba(86,160,255,0.14),
     0  2.8px 0 rgba(86,160,255,0.14),
    -4.2px 0 0  rgba(86,160,255,0.09),
     4.2px 0 0  rgba(86,160,255,0.09),
     0 -4.2px 0 rgba(86,160,255,0.09),
     0  4.2px 0 rgba(86,160,255,0.09),
    -5.6px 0 0  rgba(86,160,255,0.07),
     5.6px 0 0  rgba(86,160,255,0.07),
     1px 1px 0  rgba(0,0,0,0.7);
  animation: brand-pulse 4.8s ease-in-out infinite;
}
.brand-fsociety::before {
  content: attr(data-text);
  position: absolute;
  left: 1px; top: 0;
  color: var(--danger);
  opacity: 0;
  pointer-events: none;
  animation: brand-glitch 7s steps(1, end) infinite;
}
.brand-fsociety-sm { font-size: 1rem; }
.brand-fsociety-sm::before { left: 0.5px; }

@keyframes brand-pulse {
  0%, 100% { filter: brightness(0.85); }
  50%      { filter: brightness(1.0);  }
}
@keyframes brand-glitch {
  0%, 96%, 99.5%, 100% { opacity: 0; transform: translateX(0); }
  97%                  { opacity: 0.55; transform: translateX(1px); }
  98%                  { opacity: 0.3;  transform: translateX(-1px); }
  99%                  { opacity: 0.5;  transform: translateX(1px); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-fsociety, .brand-fsociety::before { animation: none; }
}

/* ─── Header backdrop ────────────────────────────────────────── */
/* The page <header> is z-50 (above the canvas), but with no background
   of its own the electric-monster strokes drawn on the canvas show
   straight through, washing out the nav text and the RU/EN/Telegram
   buttons.  Give the inner header bar a frosted-glass plate: dark
   translucent fill + backdrop-blur so the tentacles are still visible
   behind it as soft glow, but the text in front is always legible. */
header > div {
  background: rgba(14, 16, 22, 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--stroke-soft);
  border-radius: 14px;
  box-shadow:
    0 8px 28px -16px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ─── Navigation ─────────────────────────────────────────────── */
.nav-link {
  color: var(--fg-dim);
  transition: color .2s ease;
  position: relative;
  padding: 0.5rem 0;
}
.nav-link:hover { color: var(--fg); }
.nav-active { color: var(--fg); }
.nav-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-frame);
  color: var(--fg-dim);
  transition: all .2s ease;
}
.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: rgba(86,160,255,0.08);
  box-shadow: 0 0 20px rgba(86,160,255,0.18);
}

/* ─── Language switcher (RU/EN pill) ─────────────────────────── */
/* Two-button segmented control sitting beside the Telegram icon.
   Active button gets accent fill + brighter text; inactive is muted.
   localStorage persists the choice; i18n.js wires click → swap. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-frame);
  font-family: "JetBrains Mono", monospace;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 0.32rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  background: transparent;
  border: 0;
  border-radius: calc(var(--r-frame) - 4px);
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.lang-btn:hover { color: var(--fg-dim); }
.lang-btn.lang-active {
  color: var(--fg);
  background: rgba(86,160,255,0.16);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}

/* ─── Back link (game page) ──────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--fg-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color .2s ease;
}
.back-link:hover { color: var(--accent); }

/* ─── Undetected badge ───────────────────────────────────────── */
/* Status badge that screams "safe right now".  Uses success-green
   instead of accent-blue so it pops against the otherwise blue UI,
   includes a pulsing live-status dot to read as a real-time indicator
   (not just a static label).  Subtle outer glow + text-shadow give it
   weight without going gaudy. */
.badge-undetected {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding: 0.42rem 0.85rem;
  background:
    linear-gradient(180deg, rgba(80,220,140,0.18) 0%, rgba(80,220,140,0.08) 100%);
  border: 1px solid rgba(80,220,140,0.45);
  color: #7AE8A6;
  border-radius: 8px;
  text-transform: uppercase;
  width: fit-content;
  box-shadow:
    0 0 0 1px rgba(80,220,140,0.06),
    0 4px 16px -4px rgba(80,220,140,0.35);
  text-shadow: 0 0 10px rgba(80,220,140,0.45);
}
.badge-undetected svg {
  color: #7AE8A6;
  filter: drop-shadow(0 0 4px rgba(80,220,140,0.6));
}
/* Pulsing "live" dot.  Slotted in via ::before so the existing markup
   (with its inline shield SVG) keeps working — the dot sits left of
   the SVG and pulses on its own timeline. */
.badge-undetected::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #50DC8C;
  box-shadow: 0 0 0 0 rgba(80,220,140,0.55);
  animation: badge-pulse 2s ease-out infinite;
  flex-shrink: 0;
}
@keyframes badge-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(80,220,140,0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(80,220,140,0); }
  100% { box-shadow: 0 0 0 0   rgba(80,220,140,0); }
}
@media (prefers-reduced-motion: reduce) {
  .badge-undetected::before { animation: none; }
}

/* ─── Big game card (main catalog) ───────────────────────────── */
.game-card-big {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-card);
  overflow: hidden;
  text-decoration: none;
  border: 1px solid var(--panel-border);
  background: var(--bg-glass-bot);
  isolation: isolate;
  transition: all .4s cubic-bezier(.2,.7,.2,1);
}
.game-card-big:hover {
  transform: translateY(-6px);
  border-color: var(--accent-soft);
  box-shadow:
    0 25px 60px -20px rgba(86,160,255,0.45),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.game-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
  z-index: 0;
}
.game-card-big:hover .game-bg { transform: scale(1.06); }
.game-bg-pubg {
  background: linear-gradient(135deg, #d4a73e 0%, #8b6914 55%, #1a1a1a 100%);
}

.game-card-big::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
    rgba(14,16,22,0.15) 0%,
    rgba(14,16,22,0.55) 55%,
    rgba(14,16,22,0.96) 100%);
}

.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.game-title {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  margin-top: auto;
}

.game-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 0.5rem;
  transition: transform .25s ease;
}
.game-card-big:hover .game-cta { transform: translateX(4px); }

/* ─── Game page hero ─────────────────────────────────────────── */
.game-page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .game-page-grid { grid-template-columns: 5fr 7fr; gap: 2.5rem; }
}

.game-page-image {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-card);
  background-size: cover;
  background-position: center;
  background-color: var(--bg-glass-bot);
  border: 1px solid var(--panel-border);
  overflow: hidden;
}
.game-page-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(14,16,22,0.4) 100%);
  pointer-events: none;
}
.game-page-image-pubg {
  background: linear-gradient(135deg, #d4a73e 0%, #8b6914 55%, #1a1a1a 100%);
}

.game-page-info { display: flex; flex-direction: column; }

.game-page-title {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 2.5rem;
  letter-spacing: -0.025em;
  color: var(--fg);
  margin-top: 0.75rem;
  line-height: 1.1;
}
@media (min-width: 768px) {
  .game-page-title { font-size: 3rem; }
}

/* ─── Tariff selector (game page) ────────────────────────────── */
.tariff-selector {
  margin-top: 0.75rem;
  padding: 1.25rem;
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-panel);
}

.tariff-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-frame);
  text-decoration: none;
  transition: all .22s cubic-bezier(.4,0,.2,1);
}
.tariff-row:hover {
  background: rgba(86,160,255,0.10);
  border-color: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -8px rgba(86,160,255,0.5);
}
.tariff-row:active { transform: translateY(0); }

.tariff-row-label {
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.tariff-row-price {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--fg);
  white-space: nowrap;
}
.tariff-row-cta {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color .2s ease, transform .25s ease;
}
.tariff-row:hover .tariff-row-cta {
  color: var(--accent);
  transform: translateX(3px);
}

.tariff-row-hot {
  background: linear-gradient(180deg, rgba(86,160,255,0.14) 0%, rgba(86,160,255,0.04) 100%);
  border-color: var(--accent-soft);
}
.tariff-row-hot .tariff-row-price,
.tariff-row-hot .tariff-row-label { color: var(--accent); }

.tariff-row-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  padding: 0.15rem 0.45rem;
  background: rgba(86,160,255,0.18);
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ─── Game detail sections (below hero) ──────────────────────── */
.game-detail-section {
  margin-top: 3rem;
}
.game-detail-section + .game-detail-section {
  margin-top: 3.5rem;
}
.game-detail-h {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.game-detail-h::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.2rem;
  background: linear-gradient(180deg, var(--accent), transparent);
  border-radius: 2px;
}

/* ─── Video player ───────────────────────────────────────────── */
.game-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--bg-glass-bot);
  border: 1px solid var(--panel-border);
  box-shadow:
    0 25px 60px -25px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
.game-video-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
/* Subtle accent ring on focus / hover — feels alive without being noisy. */
.game-video-wrap:hover {
  border-color: var(--accent-soft);
  box-shadow:
    0 25px 60px -25px rgba(0,0,0,0.7),
    0 0 0 1px var(--accent-soft),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
.game-video-wrap::after {
  /* Inner top highlight for that "screen" feel */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--r-card);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ─── Feature grid (functionality list) ──────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

.feature-card {
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-panel);
  padding: 1.25rem 1.35rem 1.4rem;
  transition: border-color .2s ease, transform .2s ease;
}
.feature-card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-2px);
}
.feature-card-h {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.feature-card-h::before {
  content: "▸";
  font-size: 0.65rem;
}
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}
.feature-list li {
  font-size: 0.86rem;
  color: var(--fg-dim);
  line-height: 1.45;
  padding-left: 0.95rem;
  position: relative;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.8;
}
.feature-list li b,
.feature-list li strong {
  color: var(--fg);
  font-weight: 600;
}

/* ─── Screenshot gallery ─────────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}
.gallery-item {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-frame);
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background: var(--bg-glass-bot);
  cursor: zoom-in;
  transition: all .25s cubic-bezier(.2,.7,.2,1);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
  display: block;
}
.gallery-item:hover {
  border-color: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -12px rgba(86,160,255,0.35);
}
.gallery-item:hover img { transform: scale(1.05); }

/* ─── Lightbox (full-screen image viewer) ────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 10, 14, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--r-frame);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8);
}
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  color: var(--fg);
  font-family: "JetBrains Mono", monospace;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: all .2s ease;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.10);
  border-color: var(--accent-soft);
  color: var(--accent);
}

/* ─── System requirements table ──────────────────────────────── */
.sysreq {
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-panel);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
@media (min-width: 768px) {
  .sysreq { grid-template-columns: repeat(2, 1fr); }
}
.sysreq-row {
  display: grid;
  /* Wider key column — new labels include "Игровой клиент" / "USB-флешка"
     which overflow the previous 7.5rem allocation in JetBrains Mono. */
  grid-template-columns: 10.5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed var(--stroke-soft);
}
.sysreq-row:last-child { border-bottom: none; padding-bottom: 0; }
.sysreq-key {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sysreq-val {
  font-size: 0.92rem;
  color: var(--fg);
}
.sysreq-val em {
  font-style: normal;
  color: var(--accent);
}

/* ─── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
