/* =============================================
   VARIABLES — Tema oscuro gaming
   ============================================= */
:root {
  --color-bg: #0f0f0f;
  --color-surface: #1a1a2e;
  --color-surface-hover: #22223a;
  --color-primary: #e94560;
  --color-primary-hover: #c73650;
  --color-secondary: #16213e;
  --color-text: #eaeaea;
  --color-text-muted: #a0a0a0;
  --color-accent: #0f3460;
  --color-success: #4ecca3;
  --color-border: #2a2a4a;
  --font-main: "Segoe UI", "Inter", system-ui, sans-serif;
  --font-heading: "Segoe UI", "Inter", system-ui, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 32px rgba(233, 69, 96, 0.3);
  --transition: 0.2s ease;
}

/* =============================================
   RESET MÍNIMO
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

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

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

a {
  color: var(--color-primary);
}

/* =============================================
   BASE
   ============================================= */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  margin: 0 0 0.5em;
  line-height: 1.2;
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
  background-color: var(--color-secondary);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
}

.site-header__logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
}

.site-logo {
  max-height: 48px;
  width: auto;
  object-fit: contain;
}

.site-header__name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

/* =============================================
   MAIN
   ============================================= */
.site-main {
  flex: 1;
  padding: 2rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* =============================================
   HERO
   ============================================= */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.hero-logo {
  max-height: 120px;
  margin: 0 auto 1.5rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* =============================================
   GAMES GRID
   ============================================= */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 1rem 0;
}

/* =============================================
   GAME CARD
   ============================================= */
.game-card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-primary);
}

.game-card__image {
  width: 100%;
  height: 200px;
  background-color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.game-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card__placeholder {
  font-size: 4rem;
  line-height: 1;
}

.game-card__info {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.game-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.game-card__tagline {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

.game-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.game-card__version {
  font-size: 0.75rem;
  color: var(--color-success);
  font-weight: 600;
}

.game-card__tag {
  font-size: 0.7rem;
  background-color: var(--color-accent);
  color: var(--color-text);
  border-radius: 4px;
  padding: 0.15em 0.5em;
  text-transform: lowercase;
}

/* =============================================
   GAME DETAIL
   ============================================= */
.game-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 0;
}

.game-detail__header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.game-detail__logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: var(--radius);
  background-color: var(--color-accent);
  flex-shrink: 0;
}

.game-detail__header-info {
  flex: 1;
}

.game-detail__header-info h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.game-detail__tagline {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
}

.game-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.game-detail__meta span {
  font-size: 0.8rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.2em 0.6em;
  color: var(--color-text-muted);
}

/* =============================================
   SCREENSHOTS
   ============================================= */
.game-detail__screenshots {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.game-detail__screenshot {
  width: 320px;
  min-width: 280px;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}

.game-detail__screenshot:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow);
}

/* =============================================
   DESCRIPCIÓN
   ============================================= */
.game-detail__description {
  margin-bottom: 2rem;
  line-height: 1.8;
}

.game-detail__description p {
  margin: 0 0 1em;
  color: var(--color-text);
}

/* =============================================
   DESCARGAS
   ============================================= */
.game-detail__downloads {
  margin-bottom: 2rem;
}

.game-detail__downloads h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.download-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.download-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-primary);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background-color var(--transition), transform var(--transition);
  min-width: 120px;
  gap: 0.2rem;
}

.download-btn:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
}

.download-btn__platform {
  font-size: 0.95rem;
}

.download-btn__size {
  font-size: 0.75rem;
  opacity: 0.85;
  font-weight: 400;
}

/* =============================================
   TAGS
   ============================================= */
.game-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag {
  font-size: 0.8rem;
  background-color: var(--color-accent);
  color: var(--color-text);
  border-radius: 4px;
  padding: 0.25em 0.7em;
  text-transform: lowercase;
}

/* =============================================
   BACK LINK
   ============================================= */
.back-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--color-primary);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background-color: var(--color-secondary);
  border-top: 1px solid var(--color-border);
  text-align: center;
  padding: 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* =============================================
   404
   ============================================= */
.not-found {
  text-align: center;
  padding: 4rem 1rem;
}

.not-found h1 {
  font-size: 5rem;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.not-found p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
  padding: 1rem;
}

.lightbox-overlay img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  opacity: 0.8;
  transition: opacity var(--transition);
}

.lightbox-close:hover {
  opacity: 1;
}

/* =============================================
   RESPONSIVE — Tablet (≤ 1024px)
   ============================================= */
@media (max-width: 1024px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =============================================
   RESPONSIVE — Móvil (≤ 768px)
   ============================================= */
@media (max-width: 768px) {
  .site-main {
    padding: 1rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .game-detail__header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .game-detail__meta {
    justify-content: center;
  }

  .game-detail__header-info h1 {
    font-size: 1.5rem;
  }

  .download-buttons {
    flex-direction: column;
  }

  .download-btn {
    width: 100%;
  }

  .hero-logo {
    max-height: 80px;
  }
}
