/* ============================================================
   ATPLM.Go Studios · Catálogo General de Juegos (juegos.css)
   Design System: variables + componentes base
   ============================================================ */
:root {
  --atplm-red: #ff4136;
  --atplm-celeste: #4a90e2;
  --apple-green: #6aa84f;
  --apple-yellow: #f1c232;
  --purple: #8b5cf6;
  --orange: #f97316;
  --pink: #ec4899;
  --teal: #0d9488;
  --bg: #fdfdff;
  --bg-soft: #f4f6fb;
  --card: #ffffff;
  --border: #e7eaf2;
  --text: #334155;
  --text-soft: #64748b;
  --heading: #0f172a;
  --shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
  --accent: var(--atplm-celeste);
  --accent-soft: rgba(74, 144, 226, 0.1);
  --accent-soft-border: rgba(74, 144, 226, 0.22);
  --accent-glow: rgba(74, 144, 226, 0.14);
}

[data-theme="dark"] {
  --bg: #0b0f19;
  --bg-soft: #121829;
  --card: #151b2c;
  --border: rgba(255, 255, 255, 0.07);
  --text: #cbd5e1;
  --text-soft: #8b96a8;
  --heading: #f1f5f9;
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}

/* ============ TEMAS POR DIVISIÓN ============ */
body[data-div="original"] {
  --accent: var(--atplm-red);
  --accent-soft: rgba(255, 65, 54, 0.1);
  --accent-soft-border: rgba(255, 65, 54, 0.26);
  --accent-glow: rgba(255, 65, 54, 0.16);
}
body[data-div="odd-critters"] {
  --accent: var(--orange);
  --accent-soft: rgba(249, 115, 22, 0.1);
  --accent-soft-border: rgba(249, 115, 22, 0.26);
  --accent-glow: rgba(249, 115, 22, 0.16);
}
body[data-div="eclipse"] {
  --accent: var(--purple);
  --accent-soft: rgba(139, 92, 246, 0.12);
  --accent-soft-border: rgba(139, 92, 246, 0.28);
  --accent-glow: rgba(139, 92, 246, 0.18);
}
body[data-div="wild"] {
  --accent: var(--teal);
  --accent-soft: rgba(13, 148, 136, 0.1);
  --accent-soft-border: rgba(13, 148, 136, 0.26);
  --accent-glow: rgba(13, 148, 136, 0.16);
}
body[data-div="all"] {
  --accent: #5aa9f0;
  --accent-soft: rgba(90, 169, 240, 0.12);
  --accent-soft-border: rgba(90, 169, 240, 0.3);
  --accent-glow: rgba(90, 169, 240, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s, color 0.3s;
}

h1, h2, h3, h4 { color: var(--heading); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--accent, var(--atplm-celeste)); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ CARA BASE / UTILIDADES ============ */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }
.brand-name {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem; line-height: 1; letter-spacing: -0.5px;
}
.brand-name .r { color: var(--atplm-red); }
.brand-name .c { color: var(--atplm-celeste); }
.brand-sub {
  display: block; font-family: 'Inter', sans-serif;
  font-size: 8px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.22em; color: var(--text-soft); margin-top: 3px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; font-weight: 700; font-size: 0.9rem;
  padding: 12px 22px; border: none; cursor: pointer; text-decoration: none;
  transition: all 0.25s ease;
}
.btn-primary {
  background: var(--accent, var(--atplm-celeste)); color: #fff;
  box-shadow: 0 8px 22px var(--accent-glow);
}
.btn-primary:hover { filter: brightness(0.92); transform: translateY(-2px); }
.btn-dark {
  background: var(--heading); color: var(--bg);
}
[data-theme="dark"] .btn-dark { background: #fff; color: #0b0f19; }
.btn-dark:hover { opacity: 0.9; transform: translateY(-2px); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--text-soft); }
.btn-sm { padding: 8px 14px; font-size: 0.78rem; border-radius: 10px; }

.section-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent, var(--atplm-celeste));
  background: var(--accent-soft); border: 1px solid var(--accent-soft-border);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 14px;
}
.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 900; letter-spacing: -0.5px; color: var(--heading);
}
.section-desc { color: var(--text-soft); margin-top: 10px; max-width: 640px; line-height: 1.6; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: 999px;
}
.badge-green { background: rgba(106, 168, 79, 0.1); color: #5a9443; border: 1px solid rgba(106, 168, 79, 0.25); }
.badge-warn { background: rgba(241, 194, 50, 0.12); color: #c99c12; border: 1px solid rgba(241, 194, 50, 0.3); }
.badge-purple { background: rgba(139, 92, 246, 0.1); color: #7c3aed; border: 1px solid rgba(139, 92, 246, 0.28); }
[data-theme="dark"] .badge-green { color: #8fd976; }
[data-theme="dark"] .badge-warn { color: #ffd75e; }
[data-theme="dark"] .badge-purple { color: #b29bff; }

.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active { opacity: 1; transform: translateY(0); }

/* ============ NAVBAR ============ */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
[data-theme="dark"] .topbar { background: rgba(11, 15, 25, 0.85); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav {
  display: flex; align-items: center; gap: 4px; list-style: none;
}
.nav a {
  text-decoration: none; color: var(--text);
  font-weight: 600; font-size: 0.88rem; padding: 9px 14px; border-radius: 10px;
  transition: all 0.2s;
}
.nav a:hover { background: var(--bg-soft); color: var(--heading); }
.nav a.active { background: var(--accent-soft); color: var(--accent, var(--atplm-celeste)); }
.nav a.back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--atplm-red); font-weight: 800;
}
.nav a.back:hover { background: rgba(255, 65, 54, 0.1); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--border); background: transparent;
  color: var(--text); cursor: pointer; font-size: 1rem; transition: all 0.2s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--heading); }
#menu-btn { display: none; }

/* ============ HERO ============ */
.hero {
  position: relative; overflow: hidden;
  padding: 70px 0 78px; text-align: center;
  background:
    radial-gradient(700px 420px at 50% -120px, var(--accent-glow), transparent 65%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 900; letter-spacing: -1px; }
.hero h1 .hl { color: var(--accent, var(--atplm-red)); }
.hero p { color: var(--text-soft); margin: 14px auto 0; max-width: 640px; line-height: 1.65; font-size: 1.05rem; }

/* ============ FILTROS ============ */
.div-pills {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  max-width: 820px; margin: 32px auto 0;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-family: inherit; font-weight: 800; font-size: 0.8rem;
  box-shadow: var(--shadow); transition: all 0.22s ease;
}
.pill:hover { transform: translateY(-2px); border-color: var(--accent-soft-border); }
.pill.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 10px 24px var(--accent-glow);
}
.pill-dot { font-size: 1rem; line-height: 1; }

.filters {
  max-width: 820px; margin: 18px auto 0;
  display: grid; grid-template-columns: 2fr auto auto; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 12px; box-shadow: var(--shadow);
  text-align: left;
}
.search-box { position: relative; display: flex; align-items: center; }
.search-box .ico {
  position: absolute; left: 14px; color: var(--text-soft); pointer-events: none;
}
.search-box input {
  width: 100%; height: 46px; border: none; outline: none; background: transparent;
  padding: 0 16px 0 40px; font-family: inherit; font-size: 0.9rem; font-weight: 600; color: var(--heading);
}
.filters select {
  height: 46px; padding: 0 34px 0 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  font-family: inherit; font-weight: 700; font-size: 0.8rem; outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

.catalog-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ============ TARJETAS DE JUEGO ============ */
.games-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px;
  margin-top: 26px;
}
.game-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 22px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow); transition: transform 0.28s ease, box-shadow 0.28s ease;
  border-top: 6px solid var(--accent, var(--atplm-celeste));
  animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.game-card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(15, 23, 42, 0.13); }
.game-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.game-icon {
  width: 54px; height: 54px; display: flex; justify-content: center; align-items: center;
  font-size: 1.8rem; border-radius: 14px; background: var(--bg-soft); flex-shrink: 0;
}
.game-title { font-size: 1.08rem; font-weight: 800; color: var(--heading); }
.game-division { font-size: 0.68rem; font-weight: 800; color: var(--dcolor, var(--text-soft)); display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.game-division a { color: inherit; text-decoration: none; }
.game-division a:hover { text-decoration: underline; }
.game-desc { font-size: 0.84rem; color: var(--text-soft); line-height: 1.6; flex: 1; }
.game-desc p { margin: 0 0 8px; }
.game-desc p:last-child { margin-bottom: 0; }
.game-desc ul, .game-desc ol { margin: 0 0 8px 18px; }
.game-desc li { margin-bottom: 2px; }
.game-desc strong { color: var(--heading); }
.game-desc a { color: var(--accent, var(--atplm-celeste)); }
.game-desc code { background: var(--bg-soft); border: 1px solid var(--border); padding: 0 5px; border-radius: 5px; font-size: 0.85em; }
.game-desc h1, .game-desc h2, .game-desc h3 { font-size: 0.92rem; color: var(--heading); margin: 0 0 6px; }
.game-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 0.66rem; font-weight: 700; color: var(--text-soft);
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px;
}
.game-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.game-price { font-weight: 900; font-size: 0.88rem; color: var(--heading); }
.game-card .btn { flex: 1; }
.btn-soon { background: var(--bg-soft); color: var(--text-soft); cursor: not-allowed; border: 1px dashed var(--border); }

.empty-state { text-align: center; color: var(--text-soft); padding: 60px 0; font-size: 0.95rem; }
.empty-state .big { font-size: 3rem; margin-bottom: 10px; }

/* ============ FOOTER ============ */
.footer { margin-top: auto; background: #0b0f19; color: #94a3b8; padding: 44px 0 26px; }
.footer a { color: #94a3b8; text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; padding-bottom: 26px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.footer h4 { color: #fff; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 14px; }
.footer ul { list-style: none; display: grid; gap: 9px; font-size: 0.85rem; font-weight: 600; }
.footer .brand-name { color: #fff; }
.footer-desc { font-size: 0.8rem; line-height: 1.6; margin-top: 12px; max-width: 380px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.socials a {
  width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.07); font-size: 0.95rem; transition: all 0.2s;
}
.socials a:hover { background: var(--atplm-red); color: #fff; transform: translateY(-3px); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding-top: 20px; font-size: 0.74rem; font-weight: 600; color: #64748b;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  #menu-btn { display: inline-flex; }
  .nav {
    position: fixed; inset: 0 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--bg); padding: 16px; gap: 6px;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    transform: translateY(-110%); transition: transform 0.3s ease; z-index: -1; margin: 0;
  }
  .nav.open { transform: translateY(0); }
  .nav a { padding: 13px 14px; font-size: 1rem; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .filters { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}