/* ============================================================================
   NotionMod — Índice de juegos y mods (raíz)
   ----------------------------------------------------------------------------
   Estilo propio del índice general (index.html raíz). Reutiliza las variables
   y nomenclatura `nm-` del sistema, pero solo para la vista de navegación.
   ========================================================================== */

:root {
  --nm-font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI Variable Display", "Segoe UI", Helvetica, Arial, sans-serif;

  --nm-blue: #3f8fd6;
  --nm-blue-2: #5eb2e6;
  --nm-blue-soft: #dceefa;
  --nm-blue-ink: #2d7eb0;
  --nm-blue-link: #1a5f96;

  --nm-bg: #ffffff;
  --nm-bg-soft: #f7f6f3;
  --nm-card: #ffffff;

  --nm-text: rgb(55, 53, 47);
  --nm-text-soft: rgba(55, 53, 47, 0.6);
  --nm-text-faint: rgba(55, 53, 47, 0.42);
  --nm-line: rgba(55, 53, 47, 0.09);

  --nm-radius: 16px;
  --nm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
  --nm-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--nm-font-sans);
  color: var(--nm-text);
  line-height: 1.6;
  background: var(--nm-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* Barra superior */
.nm-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--nm-line);
}

.nm-bar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 0.95rem;
}

.nm-bar-brand .nm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--nm-blue-2), var(--nm-blue));
  color: #fff;
  font-size: 1.05rem;
}

a.nm-bar-brand {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.nm-bar-brand:hover {
  opacity: 0.85;
}

.nm-lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  background: var(--nm-bg-soft);
  border: 1px solid var(--nm-line);
  border-radius: 999px;
  padding: 4px;
}

.nm-lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--nm-text-soft);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nm-lang-btn:hover {
  color: var(--nm-text);
}

.nm-lang-btn.is-active {
  background: #fff;
  color: var(--nm-blue-link);
  box-shadow: var(--nm-shadow-sm);
}

/* Contenido central */
.nm-view {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.nm-page-title {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 6px;
}

.nm-page-sub {
  color: var(--nm-text-soft);
  font-size: 1.02rem;
  margin: 0 0 34px;
}

/* Migas / volver */
.nm-crumbs {
  margin-bottom: 22px;
}

.nm-crumbs a {
  color: var(--nm-blue-link);
  font-weight: 600;
  font-size: 0.92rem;
}

.nm-crumbs a:hover {
  text-decoration: underline;
}

/* Hero de la página de juego */
.nm-game-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 6px;
}

.nm-game-hero-logo {
  flex: 0 0 auto;
}

.nm-game-hero-logo img {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  border: 1px solid var(--nm-line);
  box-shadow: var(--nm-shadow-md);
  object-fit: cover;
}

.nm-game-hero .nm-page-title {
  margin-bottom: 2px;
}

.nm-game-hero .nm-page-sub {
  margin-bottom: 26px;
}

.nm-mods-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--nm-line);
  padding-bottom: 10px;
  margin: 34px 0 20px;
}

/* Listado de juegos (índice raíz) */
.nm-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.nm-game-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--nm-card);
  border: 1px solid var(--nm-line);
  border-radius: var(--nm-radius);
  padding: 18px;
  box-shadow: var(--nm-shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}

.nm-game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--nm-shadow-md);
  border-color: rgba(63, 143, 214, 0.35);
}

.nm-game-card-logo,
.nm-game-card .nm-game-logo-fallback {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
}

.nm-game-card .nm-game-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--nm-blue-2), var(--nm-blue));
  color: #fff;
  font-weight: 800;
  font-size: 1.5rem;
}

.nm-game-card-body {
  min-width: 0;
  flex: 1 1 auto;
}

.nm-game-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

.nm-game-card-desc {
  color: var(--nm-text-soft);
  font-size: 0.9rem;
  margin: 0 0 8px;
}

.nm-game-card-link {
  color: var(--nm-blue-link);
  font-weight: 600;
  font-size: 0.88rem;
}

/* Listado de juegos (estructura antigua, se mantiene por compatibilidad) */
.nm-game + .nm-game {
  margin-top: 38px;
}

/* Tarjetas de mods */
.nm-mods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.nm-mod-card {
  display: block;
  background: var(--nm-card);
  border: 1px solid var(--nm-line);
  border-radius: var(--nm-radius);
  overflow: hidden;
  box-shadow: var(--nm-shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}

.nm-mod-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--nm-shadow-md);
  border-color: rgba(63, 143, 214, 0.35);
}

.nm-mod-card-cover {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
}

.nm-mod-card-body {
  padding: 14px 16px;
}

.nm-mod-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 4px;
}

.nm-mod-card-desc {
  color: var(--nm-text-soft);
  font-size: 0.88rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nm-empty {
  text-align: center;
  color: var(--nm-text-faint);
  padding: 40px 0;
}

@media (max-width: 640px) {
  .nm-view {
    padding: 28px 16px 48px;
  }
}