*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3{ font-family: var(--font-display); margin: 0; line-height: 1.1; letter-spacing: -0.01em; }
p{ margin: 0; }
a{ color: inherit; }
img{ max-width: 100%; display: block; }
.container{ max-width: 1120px; margin-inline: auto; padding-inline: var(--space-md); }

/* ---------- Header ---------- */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 244, 252, 0.75);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container{
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md);
  padding-block: var(--space-sm);
}
.brand{ display: flex; align-items: center; gap: var(--space-2xs); font-family: var(--font-display); font-weight: 700; font-size: var(--step-md); text-decoration: none; color: var(--color-text); }
.brand__icon{
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  box-shadow: var(--shadow-glow);
  display: grid; place-items: center; color: var(--white); font-size: 1.2rem; flex-shrink: 0;
}
.header-nav{ display: flex; gap: var(--space-sm); align-items: center; }
.header-nav a{ text-decoration: none; }

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs);
  padding: 0.85rem 1.6rem; border-radius: var(--radius-pill);
  font-weight: 600; font-size: var(--step-xs); font-family: var(--font-body); border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.btn:hover{ transform: translateY(-2px) scale(1.01); }
.btn:active{ transform: translateY(0) scale(0.99); }
.btn--primary{ background: var(--gradient-primary); color: var(--white); box-shadow: var(--shadow-glow); }
.btn--primary:hover{ box-shadow: 0 12px 32px rgba(99, 102, 241, 0.55); }
.btn--accent{ background: var(--gradient-accent); color: var(--white); box-shadow: 0 8px 24px rgba(244, 114, 182, 0.35); }
.btn--accent:hover{ box-shadow: 0 12px 32px rgba(244, 114, 182, 0.5); }
.btn--outline{ background: var(--white); color: var(--violet-700); border-color: var(--color-border); box-shadow: var(--shadow-sm); }
.btn--outline:hover{ border-color: var(--violet-500); box-shadow: var(--shadow-md); }
.btn--sm{ padding: 0.55rem 1.1rem; font-size: var(--step-2xs); }
.btn--block{ width: 100%; }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  padding-block: var(--space-2xl) var(--space-xl);
  background: var(--gradient-hero), var(--paper);
  text-align: center;
  overflow: hidden;
}
.hero .eyebrow{
  display: inline-flex; align-items: center; gap: 0.4em;
  font-size: var(--step-2xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--fuchsia-600); margin-bottom: var(--space-xs);
  background: var(--white); padding: 0.4rem 0.9rem; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.hero h1{
  font-size: var(--step-2xl); font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p{ margin-top: var(--space-sm); color: var(--color-text-muted); max-width: 58ch; margin-inline: auto; font-size: var(--step-md); }
.hero__actions{ display: flex; justify-content: center; gap: var(--space-sm); margin-top: var(--space-lg); flex-wrap: wrap; }
.hero__visual{
  position: relative;
  max-width: 640px; margin: var(--space-xl) auto 0; aspect-ratio: 16/7;
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--violet-900), var(--paper));
}
.hero__visual canvas{ width: 100%; height: 100%; display: block; }

/* ---------- Filtros ---------- */
.filters{ padding-block: var(--space-lg); }
.filters__search{
  width: 100%; padding: 1rem 1.3rem; border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border); background: var(--color-surface);
  font-size: var(--step-sm); font-family: var(--font-body);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.filters__search:focus{ outline: none; border-color: var(--violet-500); box-shadow: 0 0 0 4px var(--violet-100); }
.filter-group{ margin-bottom: var(--space-sm); }
.filter-group__label{ font-size: var(--step-2xs); font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-2xs); display: block; }
.filter-tags{ display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.filter-tag{
  padding: 0.55rem 1.1rem; border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border); background: var(--color-surface);
  font-size: var(--step-2xs); font-weight: 600; font-family: var(--font-body); cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.filter-tag:hover{ border-color: var(--violet-500); }
.filter-tag.is-active{ background: var(--gradient-primary); border-color: transparent; color: var(--white); box-shadow: var(--shadow-glow); }

/* ---------- Grid de juegos ---------- */
.games-section{ padding-block: var(--space-lg) var(--space-2xl); }
.games-count{ color: var(--color-text-muted); font-size: var(--step-xs); margin-bottom: var(--space-md); font-weight: 500; }
.games-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-md); }
.game-card{
  background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.game-card:hover{ box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: var(--violet-500); }
.game-card__photo{ width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--surface-muted); }
.game-card__photo-placeholder{
  width: 100%; aspect-ratio: 16/10; background: var(--gradient-primary);
  display: grid; place-items: center; font-size: 2.5rem;
}
.game-card__body{ padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-xs); flex: 1; }
.game-card__title{ font-size: var(--step-md); font-weight: 700; }
.game-card__tags{ display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.game-card__tag{ font-size: var(--step-2xs); font-weight: 600; padding: 0.25rem 0.7rem; border-radius: var(--radius-pill); }
.game-card__tag--setting{ background: var(--emerald-100); color: var(--emerald-600); }
.game-card__tag--participants{ background: var(--amber-100); color: var(--amber-600); }
.game-card__comment{ color: var(--color-text-muted); font-size: var(--step-xs); flex: 1; }
.game-card__footer{ display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); margin-top: var(--space-2xs); padding-top: var(--space-xs); border-top: 1px solid var(--color-border); }
.game-card__meta{ font-size: var(--step-2xs); color: var(--color-text-muted); }
.game-card__link{ font-size: var(--step-2xs); font-weight: 700; color: var(--violet-600); text-decoration: none; }
.game-card__link:hover{ color: var(--fuchsia-600); text-decoration: underline; }

.games-empty{
  text-align: center; padding: var(--space-2xl) var(--space-lg); color: var(--color-text-muted);
  border: 1.5px dashed var(--color-border); border-radius: var(--radius-lg);
  background: var(--surface-muted);
}
.games-empty strong{ display: block; font-family: var(--font-display); font-size: var(--step-md); color: var(--color-text); margin-bottom: var(--space-2xs); }

/* ---------- Formulario agregar juego (modal) ---------- */
.add-section{
  display: none;
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 5, 17, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: var(--space-xl) var(--space-md);
  overflow-y: auto;
}
.add-section.is-open{ display: flex; align-items: flex-start; justify-content: center; }
.add-card{
  position: relative;
  background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: var(--space-lg); max-width: 640px; width: 100%; margin: auto;
  border: 1px solid var(--color-border);
}
.modal-close{
  position: absolute; top: var(--space-sm); right: var(--space-sm);
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--surface-muted); color: var(--color-text-muted);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.modal-close:hover{ background: var(--violet-100); color: var(--violet-600); }
.add-card h2{ font-size: var(--step-xl); color: var(--violet-700); }
.add-card > p{ color: var(--color-text-muted); margin-top: var(--space-2xs); }
.field{ margin-top: var(--space-md); }
.field label{ display: block; font-size: var(--step-2xs); font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-2xs); }
.field input[type="text"], .field input[type="url"], .field textarea, .field input[type="file"]{
  width: 100%; padding: 0.8rem 1rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border); font-family: var(--font-body); font-size: var(--step-sm);
  background: var(--surface-muted); color: var(--color-text);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.field input:focus, .field textarea:focus{ outline: none; border-color: var(--violet-500); box-shadow: 0 0 0 4px var(--violet-100); background: var(--white); }
.field textarea{ min-height: 100px; resize: vertical; }
.field-note{ font-size: var(--step-2xs); color: var(--color-text-muted); margin-top: var(--space-2xs); }
.checkbox-group{ display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.checkbox-pill{
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.1rem; border-radius: var(--radius-pill); border: 1.5px solid var(--color-border);
  font-size: var(--step-2xs); font-weight: 600; cursor: pointer; background: var(--surface-muted);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.checkbox-pill:has(input:checked){ border-color: var(--violet-500); background: var(--violet-100); }
.checkbox-pill input{ accent-color: var(--violet-600); }
.add-card .btn{ margin-top: var(--space-lg); }
.form-status{ margin-top: var(--space-sm); font-size: var(--step-xs); text-align: center; }
.form-status.is-success{ color: var(--emerald-600); font-weight: 700; }
.form-status.is-error{ color: #b91c1c; font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer{ padding-block: var(--space-lg); text-align: center; color: var(--color-text-muted); font-size: var(--step-2xs); border-top: 1px solid var(--color-border); }

@media (max-width: 640px){
  .games-grid{ grid-template-columns: 1fr; }
  .hero{ padding-block: var(--space-xl) var(--space-lg); }
}
