/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;700;800;900&display=swap');

/* ===== Variáveis do Design System ===== */
:root {
  --bg: #0f1424;                 /* Azul profundo suave e confortável */
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e264a 0%, #0f1424 70%);
  --panel: rgba(26, 33, 56, 0.5); /* Glassmorphism macio */
  --panel-hover: rgba(33, 42, 71, 0.8);
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(99, 102, 241, 0.4);
  
  /* Paleta de Cores de Acento */
  --primary: #6366f1;            /* Indigo Gamer */
  --primary-glow: rgba(99, 102, 241, 0.3);
  --secondary: #10b981;          /* Verde Menta */
  --secondary-glow: rgba(16, 185, 129, 0.3);
  
  --ink: #f8fafc;                /* Branco suave */
  --muted: #94a3b8;              /* Cinza legível */
  
  --shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ===== Estilos Globais ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

html, body {
  background-color: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--ink);
  font-family: var(--font-body);
  scroll-behavior: smooth;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ===== Cabeçalho ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background: rgba(26, 33, 56, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 20px;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 2px solid var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 10px;
}

.nav a:hover, .nav a.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

/* ===== Hero Section ===== */
.hero {
  text-align: center;
  padding: 30px 20px;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  border-radius: 24px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.08);
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
  z-index: -1;
  animation: float-bg 20s infinite linear;
}

@keyframes float-bg {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 30px;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  margin-bottom: 12px;
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.hero h1 {
  font-family: var(--font-title);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 900;
  margin: 0 0 10px;
  letter-spacing: -1px;
  line-height: 1.2;
  background: linear-gradient(135deg, #fff 30%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--muted);
  font-size: 15px;
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ===== Filtros Interativos ===== */
.filter-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.filter-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 10px 20px;
  border-radius: 14px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: var(--primary);
  color: #0b0f19;
  border-color: var(--primary);
  box-shadow: 0 4px 15px var(--primary-glow);
  font-weight: 800;
}

/* ===== Grid de Jogos ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

/* ===== Cards de Jogos ===== */
.game-card {
  background: var(--panel);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  position: relative;
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  perspective: 1000px;
  /* Transição de fallback suave no mouseleave, controlada via JS ou classe */
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.game-card.tilted {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease; /* Remove delay do transform no mousemove */
}

.game-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.thumb-container {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #090c15;
  position: relative;
}

/* Imagem de fundo desfocada para dar efeito preenchedor nas laterais */
.thumb-blur {
  position: absolute;
  top: -15%;
  left: -15%;
  width: 130%;
  height: 130%;
  object-fit: cover;
  filter: blur(15px) brightness(0.5);
  opacity: 0.6;
  z-index: 1;
  pointer-events: none;
}

/* Imagem principal do jogo */
.thumb-main {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain; /* Exibe a imagem inteira sem distorções ou cortes */
  z-index: 2;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
  image-rendering: -webkit-optimize-contrast; /* Otimiza a nitidez das imagens redimensionadas */
  image-rendering: auto;
}

.game-card:hover .thumb-container img.thumb-main {
  transform: scale(1.04);
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Tags coloridas dinâmicas para categorias */
.tag-new {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.2);
}

.tag-rpg, .tag-idle {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
}

.tag-strategy {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.tag-moba, .tag-action {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.tag-space {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
}

.tag-rogue, .tag-survival {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.tag-casual, .tag-puzzle {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.g-title {
  font-family: var(--font-title);
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.g-desc {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.card-footer {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 50px;
  gap: 12px;
}

/* ===== Botões ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 14px;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--primary);
  color: #0b0f19;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  background: #818cf8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ===== Seção Sobre ===== */
.about-box {
  margin-top: 80px;
  padding: 50px 40px;
  background: linear-gradient(135deg, var(--panel), rgba(15, 20, 36, 0.8));
  border-radius: 28px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.about-box::after {
  content: '🎮';
  position: absolute;
  font-size: 120px;
  opacity: 0.02;
  bottom: -20px;
  right: -20px;
  pointer-events: none;
}

.about-box h2 {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.about-box p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}

/* ===== Rodapé ===== */
footer {
  margin-top: 80px;
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

footer p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ===== Classe de Animação de Filtro (Fade In) ===== */
.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===== Responsividade ===== */
@media (max-width: 768px) {
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }
  .hero {
    padding: 50px 15px;
  }
  header {
    flex-direction: column;
    gap: 15px;
    padding: 20px;
  }
  .about-box {
    padding: 30px 20px;
  }
}
