/*
Theme Name: Apkloop
Theme URI: https://wptheme.site/
Author: Jach
Author URI: https://wptheme.site/
Description: Tema claro estilo tienda de APKs inspirado en GameLoop. Incluye carrusel hero, secciones de Selección del editor, Pre-registro y Lo Más Nuevo con un tipo de contenido "Juego" totalmente editable desde el panel de WordPress. Paleta blanca con acentos naranja.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gameloop-mx
Tags: light, gaming, esports, custom-logo, custom-menu, featured-images, translation-ready, full-width-template
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  --bg: #ffffff;
  --bg-1: #fafafa;
  --bg-2: #f5f5f7;
  --bg-3: #eeeeef;
  --bg-elev: #ffffff;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.12);

  --purple: #ff7020;
  --purple-2: #ff5e00;
  --purple-soft: #ff902e;
  --purple-ink: #ffffff;
  --purple-glow: rgba(255, 94, 0, 0.25);

  --accent: #ff7020;
  --accent-2: #ff5e00;
  --accent-soft: #ff902e;
  --accent-ink: #ffffff;
  --glow: rgba(255, 94, 0, 0.35);
  --glow-soft: rgba(255, 144, 46, 0.15);

  --gold: #f5a623;

  --text: #1a1a1a;
  --text-2: #444444;
  --muted: #888888;
  --muted-2: #aaaaaa;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --container: 1240px;
  --header-h: 64px;
  --admin-bar-h: 0px;

  --font-display: "Barlow", system-ui, -apple-system, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, sans-serif;

  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* WordPress admin bar offset when logged in */
body.admin-bar { --admin-bar-h: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar { --admin-bar-h: 46px; }
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

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

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.1px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.site-main {
  flex: 1 0 auto;
  width: 100%;
  padding-bottom: 40px;
}

/* Light theme — clean white background */
body::before,
body::after { display: none; }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; transition: color 0.2s var(--ease); cursor: pointer; }
a:hover { color: var(--purple); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

ul { list-style: none; padding: 0; }

::selection { background: var(--purple); color: #fff; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; border: 2px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* ==========================================================================
   3. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.2px;
  color: var(--text);
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--purple);
  font-weight: 600;
}

/* ==========================================================================
   4. Layout helpers
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding-block: 44px; position: relative; }
.section--tight { padding-block: 26px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-title {
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.section-title::before { display: none; }

.see-all {
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  white-space: nowrap;
}
.see-all svg { width: 14px; height: 14px; transition: transform 0.2s var(--ease); }
.see-all:hover { color: var(--purple-2); }
.see-all:hover svg { transform: translateX(3px); }

/* ==========================================================================
   5. Buttons & pills
   ========================================================================== */
.btn {
  --bh: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--bh);
  padding: 0 16px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 20px;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #fff;
  box-shadow: 0 4px 14px -4px var(--glow);
}
.btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px var(--glow);
}
.btn-primary::after { display: none; }

.btn-purple {
  background: linear-gradient(135deg, var(--purple-soft), var(--purple));
  color: #fff;
  box-shadow: 0 4px 14px -4px var(--purple-glow);
}
.btn-purple:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px var(--purple-glow);
}

.btn-outline {
  background: var(--bg-elev);
  color: var(--purple);
  border: 1px solid var(--purple);
}
.btn-outline:hover {
  color: var(--purple-2);
  border-color: var(--purple-2);
  background: var(--glow-soft);
  box-shadow: none;
}

.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--line-strong); }
.btn-ghost:hover { color: var(--purple); border-color: var(--purple); }

.btn-sm { --bh: 30px; padding: 0 12px; font-size: 12px; border-radius: 16px; }
.btn-lg { --bh: 44px; padding: 0 28px; font-size: 15px; border-radius: 22px; }
.btn-block { width: 100%; }

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--muted);
  border: none;
  white-space: nowrap;
}

.badge-soon {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-2));
  box-shadow: 0 4px 14px -3px var(--glow);
}

/* Star rating */
.rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--gold);
}
.rating svg { width: 14px; height: 14px; fill: var(--gold); filter: none; }

/* ==========================================================================
   6. Header / Nav
   ========================================================================== */
.site-header {
  position: fixed;
  top: var(--admin-bar-h);
  left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.site-header--static {
  position: relative;
  top: auto;
}
body.header-static .hero,
body.header-static .page-hero,
body.header-static .game-detail {
  margin-top: 0;
}
body.header-static .site-main > .container:first-child,
body.header-static .catalog-layout,
body.header-static .trend-page {
  padding-top: 0;
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 220px) auto;
  gap: 12px 16px;
  align-items: center;
  width: 100%;
}

.brand { grid-column: 1; }
.primary-nav {
  grid-column: 2;
  margin-right: 0;
  min-width: 0;
}
.header-search-inline {
  grid-column: 3;
  width: 100%;
  max-width: 220px;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  contain: layout style;
}
.header-actions {
  grid-column: 4;
}

/* Logo */
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img, .brand .brand-mark { width: 34px; height: 34px; }
.brand .brand-logo { width: auto; object-fit: contain; }
.brand-mark {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff902e, #2b6bff 60%, #1b3df0);
  box-shadow: 0 0 18px -4px rgba(124, 77, 255, 0.7);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0;
  color: var(--text);
}
.brand-name b { color: var(--purple); font-weight: 700; }

/* Primary nav */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}
.primary-nav ul { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.primary-nav .menu-item > a,
.primary-nav .nav-link {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-2);
  border-radius: var(--radius-xs);
  cursor: pointer;
  white-space: nowrap;
}
.primary-nav .menu-item > a::after,
.primary-nav .nav-link::after { display: none; }
.primary-nav .menu-item > a:hover,
.primary-nav .nav-link:hover,
.primary-nav .current-menu-item > a,
.primary-nav .nav-link.is-active { color: var(--purple); }

/* Dropdown submenu */
.primary-nav .menu-item-has-children { position: relative; }
.primary-nav .menu-item-has-children > a::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  margin-left: 2px;
  opacity: 0.55;
}
.primary-nav .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.22s var(--ease);
  box-shadow: var(--shadow-card);
  z-index: 40;
  pointer-events: none;
}
.primary-nav .sub-menu--categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
  min-width: 360px;
  padding: 12px 14px;
  left: auto;
  right: 0;
}
.primary-nav .menu-item-has-children:hover .sub-menu,
.primary-nav .menu-item-has-children:focus-within .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.primary-nav .sub-menu li a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
}
.primary-nav .sub-menu li a:hover { background: var(--bg-2); color: var(--purple); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius-xs);
  color: var(--text-2);
  transition: all 0.2s var(--ease);
}
.icon-btn:hover { color: var(--purple); background: var(--bg-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* Region selector */
.region { position: relative; }
.region-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.region-toggle:hover { color: var(--purple); background: var(--bg-2); }
.region-toggle svg { width: 18px; height: 18px; }
.region-flag {
  width: 20px; height: 14px; border-radius: 2px; object-fit: cover;
  box-shadow: 0 0 0 1px var(--line);
}
.region-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px;
  display: grid;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s var(--ease);
  box-shadow: var(--shadow-card);
  z-index: 50;
}
.region.is-open .region-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.region-menu a {
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
}
.region-menu a:hover,
.region-menu a.is-active { background: var(--bg-2); color: var(--purple); }

/* User account */
.user-account { position: relative; }
.user-account-btn svg { width: 20px; height: 20px; }
.user-account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px 0 4px;
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.user-account-toggle:hover { color: var(--purple); background: var(--bg-2); }
.user-account-toggle svg { width: 14px; height: 14px; opacity: 0.7; }
.user-account-avatar { width: 32px; height: 32px; border-radius: 50%; display: block; }
.user-account-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px;
  display: grid;
  gap: 2px;
  box-shadow: var(--shadow-card);
  z-index: 60;
}
.user-account-menu[hidden] { display: none !important; }
.user-account-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
}
.user-account-menu a:hover { background: var(--bg-2); color: var(--purple); }
.user-account.is-open .user-account-menu { display: grid; }

/* Auth modal */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-modal[hidden] { display: none !important; }
.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}
.auth-modal__dialog {
  position: relative;
  width: min(100%, 420px);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow-card);
}
.auth-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
}
.auth-modal__close:hover { color: var(--purple); background: var(--bg-2); }
.auth-modal__close svg { width: 18px; height: 18px; }
.auth-modal__title {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}
.auth-modal__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  justify-content: center;
}
.auth-modal__tab {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-2);
  cursor: pointer;
}
.auth-modal__tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
}
.auth-modal__panel { display: none; }
.auth-modal__panel.is-active { display: block; }
.auth-modal__panel[hidden] { display: none !important; }
.auth-modal__hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.auth-modal__status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  line-height: 1.4;
}
.auth-modal__status.is-error {
  background: #fff0f0;
  color: #b42318;
  border: 1px solid #fecaca;
}
.auth-modal__status.is-success {
  background: #ecfdf3;
  color: #067647;
  border: 1px solid #abefc6;
}
.auth-form {
  display: grid;
  gap: 14px;
}
.auth-form label span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: #fff;
  font-size: 14px;
  box-sizing: border-box;
  cursor: text;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.auth-form__remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.auth-modal__switch {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.auth-modal__switch + .auth-modal__switch { margin-top: 8px; }
.auth-modal__link {
  border: 0;
  background: none;
  padding: 0;
  margin-left: 4px;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-modal__link:hover { color: var(--purple); }
body.auth-modal-open { overflow: hidden; }

/* Pre-register button states */
.btn.is-registered[data-pre-unregister] {
  opacity: 1;
  cursor: pointer;
  border-color: var(--line-strong);
  color: var(--muted);
  background: var(--bg-2);
}
.btn.is-registered[data-pre-unregister]:hover {
  border-color: #fca5a5;
  color: #b91c1c;
  background: #fef2f2;
}

/* User account panel */
.user-panel { padding: 32px 0 48px; }
.user-panel__head { margin-bottom: 28px; }
.user-panel__title { margin: 0 0 6px; font-size: clamp(26px, 3vw, 34px); }
.user-panel__sub { margin: 0; color: var(--muted); }
.user-panel__guest {
  max-width: 480px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.user-panel__section-title {
  margin: 0 0 18px;
  font-size: 20px;
}
.user-panel__group-title {
  margin: 24px 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-2);
}
.user-panel__empty { color: var(--muted); margin-bottom: 16px; }
.user-panel__list { display: grid; gap: 12px; }
.user-panel__item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.user-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.user-panel__remove { white-space: nowrap; }
.user-panel__thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.user-panel__thumb img { width: 100%; height: 100%; object-fit: cover; }
.user-panel__name { margin: 0 0 6px; font-size: 16px; }
.user-panel__name a { color: var(--text); }
.user-panel__hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.user-panel__badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.user-panel__badge--ready {
  background: #ecfdf3;
  color: #067647;
}
.user-panel__badge--pending {
  background: #fff7ed;
  color: #c2410c;
}

@media (max-width: 640px) {
  .user-panel__item {
    grid-template-columns: 56px 1fr;
  }
  .user-panel__actions,
  .user-panel__remove {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* Inline header search */
.header-search-inline {
  position: relative;
  z-index: 1;
  justify-self: end;
}
.header-search-inline .search-form {
  width: 100%;
  max-width: 100%;
  position: relative;
  overflow: hidden;
}
.header-search-inline .search-form input[type="search"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 16px 0 40px;
  border-radius: 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  cursor: text;
}
.header-search-inline .search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--purple);
  background: #fff;
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.header-search-inline .search-form input[type="search"]::placeholder { color: var(--muted); }
.header-search-inline .search-form .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.header-search-inline .search-form button[type="submit"] { display: none; }

/* Mobile-only search toggle */
.header-search-toggle { display: none; }

/* Mobile toggle */
.nav-toggle { display: none; width: 42px; height: 42px; border-radius: var(--radius-xs); }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px auto; border-radius: 2px; transition: 0.25s var(--ease); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Button icons */
.btn svg { width: 17px; height: 17px; }
.btn-lg svg { width: 19px; height: 19px; }
.btn-sm svg { width: 15px; height: 15px; }
.region-toggle svg:last-child { width: 14px; height: 14px; opacity: 0.7; }
.brand:hover { color: var(--text); }
.brand:hover .brand-name b { color: var(--purple-2); }

/* Header search panel */
.header-search {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid var(--line-strong);
  padding: 0 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s var(--ease), opacity 0.25s var(--ease), padding 0.3s var(--ease);
  box-shadow: var(--shadow-card);
}
.header-search.is-open { max-height: 120px; opacity: 1; padding: 16px 0; }
.header-search .search-form { max-width: var(--container); margin-inline: auto; padding-inline: 24px; }

/* Pagination */
.pagination, .navigation.pagination { display: flex; }
.pagination .nav-links, .navigation .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers {
  min-width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.2s var(--ease);
}
.page-numbers:hover { color: var(--purple); border-color: var(--purple); background: rgba(255, 94, 0, 0.06); }
.page-numbers.current {
  background: var(--purple);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px -4px var(--purple-glow);
}

/* ==========================================================================
   7. Hero slider
   ========================================================================== */
.hero { margin-top: var(--header-h); position: relative; padding: 20px 0 0; background: var(--bg); }
.hero-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  align-items: stretch;
}
.hero-main { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 380px; }
.hero-viewport { position: relative; overflow: hidden; height: 100%; border-radius: var(--radius-lg); }
.hero-track { display: flex; height: 100%; transition: transform 0.7s var(--ease); }
.hero-slide {
  position: relative;
  flex: 0 0 100%;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
}
.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 60%, transparent 100%),
              linear-gradient(0deg, rgba(0, 0, 0, 0.4) 0%, transparent 50%);
}
.hero-slide::after { display: none; }
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 32px 36px;
}
.hero-inner { max-width: 480px; }
.hero-tag {
  display: none;
}
.hero-title {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  text-transform: none;
  letter-spacing: 0;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  margin-bottom: 10px;
  font-weight: 700;
}
.hero-sub {
  font-size: clamp(14px, 1.4vw, 17px);
  color: rgba(255, 255, 255, 0.85);
  max-width: 420px;
  margin-bottom: 20px;
  font-weight: 400;
}
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-actions .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.5); }
.hero-actions .btn-ghost:hover { background: rgba(255,255,255,0.15); border-color: #fff; color: #fff; }
.hero-meta { display: flex; align-items: center; gap: 16px; margin-top: 16px; color: rgba(255,255,255,0.7); font-size: 13px; }
.hero-meta .rating { color: var(--gold); }

/* Hero sidebar tabs */
.hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-tab {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-2));
  border: none;
  transition: all 0.25s var(--ease);
  text-align: left;
  color: #fff;
  min-height: 0;
}
.hero-tab img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.hero-tab-info { min-width: 0; }
.hero-tab-name { font-weight: 600; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-tab-cat { font-size: 11px; color: rgba(255,255,255,0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-tab:hover { transform: translateX(-2px); filter: brightness(1.08); }
.hero-tab.is-active {
  box-shadow: 0 4px 16px var(--glow);
  transform: scale(1.02);
  filter: brightness(1.1);
}

/* arrows */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  color: var(--text);
  transition: all 0.2s var(--ease);
  opacity: 0;
  box-shadow: var(--shadow-card);
}
.hero:hover .hero-arrow { opacity: 1; }
.hero-arrow:hover { background: var(--purple); color: #fff; transform: translateY(-50%) scale(1.05); }
.hero-arrow svg { width: 20px; height: 20px; }
.hero-arrow--prev { left: 16px; }
.hero-arrow--next { right: 16px; }

/* dots */
.hero-dots {
  position: absolute;
  z-index: 5;
  left: 32px;
  bottom: 16px;
  display: flex;
  gap: 6px;
}
.hero-dots button {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.25s var(--ease);
}
.hero-dots button.is-active { width: 22px; background: var(--accent); }

/* Legacy horizontal tabs — hidden when sidebar layout is used */
.hero-tabs { display: none; }

/* ==========================================================================
   8. Game grid + cards
   ========================================================================== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.game-grid--4 { grid-template-columns: repeat(4, 1fr); }

.game-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 14px;
}
.game-card::after { display: none; }
.game-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.game-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-2);
  border-radius: 14px;
  aspect-ratio: auto;
}
.game-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.game-card:hover .game-thumb img { transform: scale(1.05); }
.game-thumb-overlay { display: none; }

.game-body { padding: 0; display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.game-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-card:hover .game-name { color: var(--purple); }
.game-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.game-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.game-meta .btn { margin-left: auto; flex-shrink: 0; }

/* compact list-style card (editor choice 2-col list look) */
.glist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 28px; }
.glist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.25s var(--ease);
}
.glist-item:hover { background: var(--bg-2); border-color: var(--line); transform: translateX(2px); }
.glist-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.glist-info { flex: 1; min-width: 0; }
.glist-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glist-cat { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.glist-item:hover .glist-name { color: var(--purple); }

/* Section list archives (Editor-Choice, Próximos Juegos, etc.) */
.section-archive--list,
.section-archive--editor {
  padding-top: var(--header-h);
  padding-bottom: 48px;
}
.editor-archive-inner {
  padding-top: 10px;
}
.editor-breadcrumbs {
  margin: 0 0 6px;
  padding: 0;
  gap: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  align-items: center;
}
.editor-breadcrumbs a,
.editor-breadcrumbs .breadcrumb-current {
  color: var(--muted);
}
.editor-breadcrumbs a:hover {
  color: var(--purple);
}
.editor-breadcrumbs .breadcrumb-sep {
  margin: 0 6px;
  color: var(--muted-2);
}
.editor-breadcrumbs .breadcrumb-current {
  color: var(--text-2);
}
.editor-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 2px;
  margin-top: 0;
}
.editor-list-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-radius: 14px;
  transition: background 0.22s var(--ease), padding 0.22s var(--ease), margin 0.22s var(--ease);
}
.editor-list-item:hover {
  background: var(--bg-2);
  padding: 18px 20px;
  margin-inline: -20px;
}
.editor-list-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
  background: var(--bg-2);
}
.editor-list-thumb .badge-soon {
  top: 4px;
  left: 4px;
  font-size: 8px;
  padding: 2px 6px;
  letter-spacing: 0.6px;
}
.editor-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.editor-list-body { flex: 1; min-width: 0; }
.editor-list-name {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  transition: color 0.2s var(--ease);
}
.editor-list-tags {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.45;
}
.stars-row {
  display: flex;
  align-items: center;
  gap: 2px;
}
.stars-row .star {
  display: inline-flex;
  line-height: 0;
}
.stars-row .star svg {
  width: 18px;
  height: 18px;
  fill: var(--muted-2);
}
.stars-row .star--on svg { fill: var(--purple); }
.stars-num {
  margin-left: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.editor-list-btn {
  flex-shrink: 0;
  min-width: 112px;
  justify-content: center;
  transition: background 0.22s var(--ease), color 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.editor-list-item:hover .editor-list-btn {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
  box-shadow: 0 4px 14px -4px var(--purple-glow);
  transform: none;
}
.editor-list-item:hover .editor-list-btn:hover {
  background: var(--purple-2);
  color: #fff;
  border-color: var(--purple-2);
  transform: none;
}
.editor-list-empty { color: var(--muted); }

/* Ranked section list (Top games / New games / Top apps) */
.ranked-list-item {
  gap: 14px;
}
.rank-list-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  border-radius: 50%;
  color: var(--muted);
}
.rank-list-num--1 {
  background: linear-gradient(135deg, #ffd66b, #ff9d2f);
  color: #2a1500;
}
.rank-list-num--2 {
  background: linear-gradient(135deg, #d9dde6, #aab0bd);
  color: #1a1d24;
}
.rank-list-num--3 {
  background: linear-gradient(135deg, #e6a36b, #c97b3a);
  color: #271403;
}
.rank-list-num--plain {
  width: 24px;
  height: auto;
  background: none;
  border-radius: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.editor-list-thumb .rank-thumb--mono {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--purple);
  background: var(--bg-3);
}

.share-sidebar {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
}
.share-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s var(--ease);
}
.share-btn:hover { transform: scale(1.06); }
.share-btn svg { width: 18px; height: 18px; }
.share-btn--facebook { background: #1877f2; }
.share-btn--reddit { background: #ff4500; }
.share-btn--twitter { background: #1da1f2; }
.share-btn--copy { background: var(--purple); }

@media (max-width: 900px) {
  .share-sidebar { display: none; }
  .editor-list-item { gap: 14px; }
  .editor-list-thumb { width: 72px; height: 72px; border-radius: 14px; }
  .editor-list-name { font-size: 16px; }
  .editor-list-btn { min-width: 96px; padding-inline: 12px; font-size: 13px; }
}

/* ==========================================================================
   9. Ranked lists (Top games / New games / Top apps)
   ========================================================================== */
.rank-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.rank-card {
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.rank-card .section-head {
  margin-bottom: 12px;
  min-width: 0;
  gap: 8px;
}
.rank-card .section-title {
  font-size: 16px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-card .see-all {
  flex-shrink: 0;
  font-size: 12px;
}
.rank-card .section-title::before { display: none; }
.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.rank-item:last-child { border-bottom: none; }
.rank-item .btn {
  flex-shrink: 0;
  margin-left: auto;
}
.rank-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--muted);
  flex-shrink: 0;
}
.rank-item:nth-child(1) .rank-num { background: linear-gradient(135deg, #ffd66b, #ff9d2f); color: #2a1500; }
.rank-item:nth-child(2) .rank-num { background: linear-gradient(135deg, #d9dde6, #aab0bd); color: #1a1d24; }
.rank-item:nth-child(3) .rank-num { background: linear-gradient(135deg, #e6a36b, #c97b3a); color: #271403; }
.rank-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.rank-thumb--mono { background: var(--bg-3); display: grid; place-items: center; font-weight: 700; color: var(--purple); }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-family: var(--font-display); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-cat {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-info .rating {
  margin-top: 2px;
  font-size: 12px;
}
.rank-info .rating svg {
  width: 12px;
  height: 12px;
}
.rank-item:hover .rank-name { color: var(--purple); }

/* ==========================================================================
   10. Topics
   ========================================================================== */
.topic-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
.topic-card {
  position: relative;
  min-height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.topic-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.1) 70%); }
.topic-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.topic-body { position: relative; z-index: 2; padding: 16px; width: 100%; }
.topic-title { font-size: 16px; margin-bottom: 10px; font-weight: 600; }
.topic-title a { color: #fff; }
.topic-title a:hover { color: #fff; opacity: 0.92; }
.topic-icons { display: flex; align-items: center; gap: 8px; }
.topic-icon {
  display: block;
  flex-shrink: 0;
  border-radius: 10px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.topic-icon:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28); }
.topic-icon img { width: 42px; height: 42px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.15); object-fit: cover; display: block; }
.topic-more {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  backdrop-filter: blur(4px);
  text-decoration: none;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.topic-more:hover { background: rgba(255, 255, 255, 0.22); color: #fff; transform: translateY(-2px); }

.section-archive--topics {
  padding-top: var(--header-h);
  padding-bottom: 48px;
}
.topic-pagination {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}
.topic-pagination .nav-links { justify-content: center; }

/* ==========================================================================
   11. Genre rows (icon grid)
   ========================================================================== */
.genre-section { padding-top: 28px; }
.genre-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 32px;
}
.genre-card {
  min-width: 0;
}
.genre-card .section-head {
  margin-bottom: 12px;
  gap: 10px;
}
.genre-card .section-title {
  font-size: clamp(17px, 1.8vw, 20px);
  font-weight: 700;
}
.genre-card .see-all {
  font-size: 13px;
}
.genre-panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 18px 20px;
}
.genre-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 12px;
}
.genre-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.genre-icon {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 10px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  flex-shrink: 0;
}
.genre-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.genre-item:hover .genre-icon { transform: translateY(-3px); border-color: var(--purple); box-shadow: var(--shadow-hover); }
.genre-name {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 10px;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
  width: 100%;
}
.genre-item:hover .genre-name { color: var(--purple); }
.genre-item .btn {
  margin-top: auto;
  min-width: 0;
  width: 100%;
  max-width: 108px;
  padding-inline: 10px;
  font-size: 12px;
}

.genre-item .btn {
  margin-top: auto;
  min-width: 0;
  width: 100%;
  max-width: 108px;
  padding-inline: 10px;
  font-size: 12px;
}

/* ==========================================================================
   11b. Catalog browser (Juegos / Aplicaciones / Categorías)
   ========================================================================== */
.catalog-page {
  padding-top: var(--header-h);
  padding-bottom: 48px;
}
.catalog-inner { padding-top: 10px; }
.catalog-breadcrumbs { margin-bottom: 18px; }
.catalog-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.catalog-sidebar-box {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 16px 16px;
}
.catalog-sidebar-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.catalog-sidebar-group + .catalog-sidebar-group { margin-top: 18px; }
.catalog-sidebar-label {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.catalog-sidebar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.catalog-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.25;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.catalog-cat:hover { background: rgba(255, 94, 0, 0.08); color: var(--purple); }
.catalog-cat.is-active {
  background: var(--purple);
  color: #fff;
}
.catalog-cat-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line);
}
.catalog-cat-icon--svg {
  display: grid;
  place-items: center;
  color: #5f6578;
  background: #fff;
}
.catalog-cat-icon--svg svg {
  width: 14px;
  height: 14px;
  display: block;
}
.catalog-cat-icon--svg.catalog-cat-icon--brand {
  background: linear-gradient(135deg, #ff902e, #ff5e00);
  border: none;
  color: #fff;
}
.catalog-cat-icon--svg.catalog-cat-icon--brand svg {
  width: 13px;
  height: 13px;
}
.catalog-cat.is-active .catalog-cat-icon--svg {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.catalog-cat.is-active .catalog-cat-icon--svg.catalog-cat-icon--brand {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.catalog-cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalog-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.catalog-title {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  color: var(--text);
}
.catalog-sort {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.catalog-sort-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.2s var(--ease);
}
.catalog-sort-link:hover,
.catalog-sort-link.is-active { color: var(--purple); }
.browse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.browse-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #fff;
  transition: background 0.2s var(--ease);
}
.browse-card:nth-child(2n) { border-right: none; }
.browse-card:hover { background: var(--bg-2); }
.browse-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.browse-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.browse-thumb--mono {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--purple);
}
.browse-info { min-width: 0; }
.browse-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browse-card:hover .browse-name { color: var(--purple); }
.browse-cat {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browse-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
}
.browse-rating svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.browse-btn {
  min-width: 96px;
  flex-shrink: 0;
  border-color: var(--purple);
  color: var(--purple);
}
.browse-btn:hover {
  background: rgba(255, 94, 0, 0.08);
  color: var(--purple);
}
.catalog-pagination {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}
.catalog-pagination .nav-links { justify-content: center; }
.catalog-empty { color: var(--muted); padding: 24px 0; }

/* ==========================================================================
   12. Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  flex-shrink: 0;
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  padding-block: 22px 24px;
  position: relative;
}
.site-footer::before { display: none; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted-2);
  font-size: 13px;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.footer-legal a,
.footer-legal-menu { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0; padding: 0; }
.footer-legal-menu li { margin: 0; }
.footer-legal a,
.footer-legal-menu a { color: var(--muted); }
.footer-legal a:hover,
.footer-legal-menu a:hover { color: var(--purple); }

/* ==========================================================================
   13. Single / Archive / Page content
   ========================================================================== */
.page-hero { margin-top: var(--header-h); padding: 56px 0 24px; }
.page-hero h1 { font-size: clamp(28px, 4vw, 44px); text-transform: uppercase; }
.page-hero-lead { margin-top: 10px; max-width: 52ch; color: var(--muted); font-size: 16px; line-height: 1.55; }
.breadcrumbs { color: var(--muted); font-size: 13px; margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--purple); }

.entry { max-width: 820px; margin-inline: auto; }
.entry h1, .entry h2, .entry h3 { margin: 1.4em 0 0.5em; }
.entry p { margin-bottom: 1em; color: var(--text-2); }
.entry a { color: var(--purple); text-decoration: underline; text-underline-offset: 3px; }
.entry img { border-radius: var(--radius); margin: 1.4em 0; }
.entry ul, .entry ol { margin: 0 0 1em 1.2em; color: var(--text-2); }
.entry ul { list-style: disc; }
.entry ol { list-style: decimal; }
.entry blockquote {
  border-left: 3px solid var(--purple);
  padding: 8px 18px;
  margin: 1.4em 0;
  background: var(--bg-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-2);
}

.game-page {
  margin-top: var(--header-h);
  padding: 10px 0 56px;
}
.game-page-top {
  margin-bottom: 10px;
}
.game-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 36px;
  align-items: start;
}
.game-page-main { min-width: 0; }

.game-hero {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin-bottom: 18px;
}
.game-hero-icon {
  width: 120px;
  height: 120px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  background: var(--bg-2);
}
.game-hero-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-hero-title {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
  color: var(--text);
}
.game-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
}
.game-hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.game-hero-meta-item:not(:last-child)::after {
  content: "|";
  margin-left: 6px;
  color: var(--muted-2);
}
.game-hero-meta .stars-row { gap: 1px; }
.game-hero-meta .stars-row .star svg { width: 14px; height: 14px; }
.game-hero-meta .stars-num { font-size: 13px; color: var(--text-2); }
.game-hero-dev { font-weight: 600; color: var(--text-2); }
.game-hero-cta {
  min-width: 148px;
  height: 48px;
  padding-inline: 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.game-block { margin-bottom: 22px; }
.game-block-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}
.game-gallery-block { margin-bottom: 18px; }
.game-gallery-block .game-block-title { margin-bottom: 8px; }
.game-desc-block { margin-bottom: 16px; }
.game-desc-block .entry { max-width: none; margin: 0; }
.game-desc-text {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.7;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}
.game-desc-text.is-collapsed {
  max-height: 5.1em;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent);
  mask-image: linear-gradient(180deg, #000 62%, transparent);
}
.game-desc-text p:last-child { margin-bottom: 0; }
.game-desc-toggle {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--purple);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.game-desc-toggle:hover { color: var(--purple-2); }

.game-gallery--play {
  position: relative;
  padding: 0 52px;
}

.game-gallery-viewport {
  overflow: hidden;
  border-radius: 16px;
}

.game-gallery-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.game-gallery-track::-webkit-scrollbar {
  display: none;
}

.game-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elev);
  color: var(--text-2);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s var(--ease), color 0.2s var(--ease);
}

.game-gallery-nav svg {
  width: 22px;
  height: 22px;
}

.game-gallery-nav:hover:not(:disabled) {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
  color: var(--text);
}

.game-gallery-nav:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.game-gallery-nav--prev {
  left: 0;
}

.game-gallery-nav--next {
  right: 0;
}

.game-gallery-slide {
  position: relative;
  flex: 0 0 calc(100% - 72px);
  min-width: 0;
  height: clamp(210px, 32vw, 360px);
  padding: 0;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  background: #0f0f10;
  scroll-snap-align: start;
  cursor: zoom-in;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.game-gallery-slide:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.game-gallery-slide--portrait {
  flex-basis: min(42%, 320px);
  height: clamp(320px, 48vw, 520px);
}

.game-gallery-slide--landscape {
  flex-basis: calc(100% - 72px);
}

.game-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.game-gallery-slide--portrait img {
  object-fit: cover;
}

.game-gallery-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  text-decoration: none;
  z-index: 2;
  cursor: pointer;
  border: none;
  padding: 0;
}

.game-gallery-play:hover {
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
}

.game-gallery-play svg {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35));
}

/* Lightbox — vista ampliada estilo Google Play */
.game-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.94);
}

.game-lightbox[hidden] {
  display: none !important;
}

.game-lightbox__bar {
  flex-shrink: 0;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: #000;
}

.game-lightbox__close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.game-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.game-lightbox__close svg {
  width: 24px;
  height: 24px;
}

.game-lightbox__body {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 16px 64px 32px;
}

.game-lightbox__figure {
  margin: 0;
  max-width: min(1200px, 100%);
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 56px - 48px);
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.game-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #1d2327;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.game-lightbox__nav:hover:not(:disabled) {
  transform: translateY(-50%) scale(1.05);
}

.game-lightbox__nav:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.game-lightbox__nav svg {
  width: 22px;
  height: 22px;
}

.game-lightbox__nav--prev {
  left: 16px;
}

.game-lightbox__nav--next {
  right: 16px;
}

body.game-lightbox-open {
  overflow: hidden;
}

/* Video trailer popup */
.game-video-modal {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: grid;
  place-items: center;
  padding: 24px;
}

.game-video-modal[hidden] {
  display: none !important;
}

.game-video-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.82);
  cursor: pointer;
}

.game-video-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.game-video-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.game-video-modal__close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.game-video-modal__close svg {
  width: 20px;
  height: 20px;
}

.game-video-modal__frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.game-video-modal__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

body.game-video-open {
  overflow: hidden;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.game-tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13px;
}

.game-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 28px;
  margin: 0;
}
.game-info-item { min-width: 0; }
.game-info-item dt {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.game-info-item dd {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.45;
}
.game-info-item dd a { color: var(--purple); text-decoration: none; }
.game-info-item dd a:hover { color: var(--purple-2); text-decoration: underline; }
.game-info-item--store { grid-column: span 1; }
.game-store-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  text-decoration: none;
}
.game-store-link svg { width: 22px; height: 22px; color: #34a853; }
.game-store-link:hover { color: var(--purple); }

.game-page-aside { min-width: 0; }
.aside-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 18px 8px;
  margin-bottom: 18px;
}
.aside-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.aside-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
.aside-card .see-all {
  font-size: 13px;
  white-space: nowrap;
  color: var(--purple);
}
.aside-card .see-all:hover {
  color: var(--purple-2);
}
.aside-card-list { display: flex; flex-direction: column; }

.sidebar-game-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.sidebar-game-item:last-child { border-bottom: 0; }
.sidebar-game-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  display: block;
  background: var(--bg-2);
}
.sidebar-game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sidebar-game-thumb--mono {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--purple);
  background: var(--bg-3);
}
.sidebar-game-body { min-width: 0; }
.sidebar-game-name {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--purple);
  text-decoration: none;
}
.sidebar-game-name:hover { color: var(--purple-2); }
.sidebar-game-cat {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.35;
}
.sidebar-game-body .stars-row .star svg { width: 12px; height: 12px; }
.sidebar-game-body .stars-row .star--on svg { fill: var(--purple); }
.sidebar-game-body .stars-num { font-size: 11px; color: var(--muted); }
.sidebar-game-btn {
  min-width: 88px;
  height: 34px;
  padding-inline: 10px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--purple);
  border-color: var(--purple);
}
.sidebar-game-btn:hover {
  color: var(--purple-2);
  border-color: var(--purple-2);
  background: var(--glow-soft);
}

/* Legacy alias kept for older markup */
.game-detail { display: grid; grid-template-columns: 320px 1fr; gap: 36px; margin-top: var(--header-h); padding-top: 48px; }
.game-detail-media { position: sticky; top: calc(var(--header-h) + var(--admin-bar-h) + 20px); align-self: start; }
.game-cover { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.game-detail h1 { font-size: clamp(28px, 4vw, 46px); text-transform: uppercase; margin-bottom: 12px; }
.game-detail .game-meta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }

/* search form */
.search-form { display: flex; gap: 8px; max-width: 480px; }
.search-form input[type="search"] {
  flex: 1;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: inherit;
}
.search-form input[type="search"]:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-glow); }

/* ==========================================================================
   14. Animations
   ========================================================================== */
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }

/* Reveal only hides once JS is ready, so content never stays invisible. */
body.reveal-ready [data-reveal]:not(.is-visible) { opacity: 0; }
[data-reveal].is-visible { animation: fadeUp 0.7s var(--ease) forwards; }

.hero-slide.is-active .hero-tag { animation: slideInLeft 0.6s var(--ease) both 0.1s; }
.hero-slide.is-active .hero-title { animation: fadeUp 0.7s var(--ease) both 0.2s; }
.hero-slide.is-active .hero-sub { animation: fadeUp 0.7s var(--ease) both 0.34s; }
.hero-slide.is-active .hero-actions { animation: fadeUp 0.7s var(--ease) both 0.46s; }

/* ==========================================================================
   15. Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-layout { grid-template-columns: 1fr 240px; }
}

@media (max-width: 1024px) {
  .rank-row { grid-template-columns: 1fr; }
  .game-page-layout { grid-template-columns: 1fr; }
  .game-page-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .game-page-aside .aside-card { margin-bottom: 0; }
  .game-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-detail { grid-template-columns: 1fr; }
  .game-detail-media { position: static; max-width: 360px; }
  .hero-layout { grid-template-columns: 1fr; }
  .hero-sidebar { flex-direction: row; overflow-x: auto; }
  .hero-tab { min-width: 200px; flex: 0 0 auto; }
  .topic-row,
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .genre-rows { grid-template-columns: 1fr; }
  .catalog-layout { grid-template-columns: 1fr; }
  .browse-grid { grid-template-columns: 1fr; }
  .browse-card { border-right: none; }
}

@media (max-width: 1100px) {
  .header-inner {
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 170px) auto;
    gap: 10px 12px;
  }
  .header-search-inline { max-width: 170px; }
  .primary-nav .menu-item > a,
  .primary-nav .nav-link { padding: 0 8px; font-size: 13px; }
  .user-account-name { display: none; }
}

@media (max-width: 860px) {
  :root { --header-h: 56px; }
  .header-inner {
    grid-template-columns: auto 1fr auto;
  }
  .header-search-inline { display: none; }
  .primary-nav,
  .region .region-toggle .region-label,
  .header-search-inline { display: none; }
  .header-search-toggle { display: grid; }
  .header-search { display: block; }
  .nav-toggle { display: block; }

  .primary-nav {
    position: fixed;
    inset: calc(var(--header-h) + var(--admin-bar-h)) 0 0 auto;
    width: min(82vw, 340px);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 18px;
    background: #fff;
    border-left: 1px solid var(--line-strong);
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    overflow-y: auto;
    z-index: 99;
    box-shadow: var(--shadow-card);
  }
  .primary-nav.is-open { transform: translateX(0); display: flex; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 2px; width: 100%; }
  .primary-nav .menu-item > a,
  .primary-nav .nav-link { height: 48px; font-size: 16px; }
  .primary-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: var(--bg-2); margin: 4px 0 8px; }
  .primary-nav .sub-menu--categories { grid-template-columns: 1fr; min-width: 0; }

  .game-grid { grid-template-columns: 1fr; gap: 12px; }
  .glist { grid-template-columns: 1fr; }
  .topic-row,
  .topic-grid { grid-template-columns: 1fr; }
  .genre-rows { grid-template-columns: 1fr; gap: 24px; }
  .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-hero {
    grid-template-columns: 88px 1fr;
    gap: 16px;
  }
  .game-hero-cta {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }
  .game-hero-icon { width: 88px; height: 88px; border-radius: 18px; }
  .game-page-aside { grid-template-columns: 1fr; }
  .game-info-grid { grid-template-columns: 1fr; }
  .game-gallery--play {
    padding: 0 40px;
  }

  .game-gallery-slide {
    flex-basis: calc(100% - 40px);
    height: clamp(190px, 52vw, 260px);
  }

  .game-gallery-slide--portrait {
    flex-basis: min(72%, 240px);
    height: clamp(280px, 70vw, 420px);
  }

  .game-gallery-nav {
    width: 36px;
    height: 36px;
  }

  .game-gallery-nav svg {
    width: 18px;
    height: 18px;
  }

  .game-lightbox__body {
    padding: 12px 48px 24px;
  }

  .game-lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .game-lightbox__nav--prev {
    left: 8px;
  }

  .game-lightbox__nav--next {
    right: 8px;
  }
}

@media (max-width: 560px) {
  .container { padding-inline: 16px; }
  .section { padding-block: 28px; }
  .game-card { padding: 12px; gap: 10px; }
  .game-thumb { width: 56px; height: 56px; border-radius: 12px; }
  .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .genre-icon { width: 68px; height: 68px; }
  .catalog-sidebar-grid { grid-template-columns: 1fr; }
  .browse-card { grid-template-columns: 60px minmax(0, 1fr); }
  .browse-btn { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
  .game-name { font-size: 14px; }
  .hero-content { padding: 0 20px 28px; }
  .hero-arrow { display: none; }
  .btn { font-size: 12px; }
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-2));
  box-shadow: 0 4px 14px -4px var(--glow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px) scale(0.94);
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease),
    visibility 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  color: #fff;
  transform: translateY(-2px) scale(1);
  box-shadow: 0 8px 20px -6px var(--glow);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 768px) {
  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }

  .back-to-top svg {
    width: 20px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }
}

/* WP core helpers */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  word-wrap: normal !important;
}
.aligncenter { margin-inline: auto; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { color: var(--muted); font-size: 13px; text-align: center; }
.sticky, .gallery-caption, .bypostauthor { display: block; }
