/* Styles specific to the landing page */

body {
  /* Adjusted padding-top to account for fixed navbar height (56px) + desired 16px gap = 72px (4.5rem) */
  padding-top: 5.5rem; /* Increased from 4.5rem for better spacing */
}
.container {
  max-width: 1200px; /* max-w-7xl changed to 1200px */
  margin-left: auto;
  margin-right: auto;
  padding: 1rem; /* 16px */
  width: 100%; /* Ensure container always tries to take full width */
}
@media (min-width: 640px) { /* sm */
  .container {
    padding: 1.5rem; /* 24px */
  }
}
@media (min-width: 1024px) { /* lg */
  .container {
    padding: 2rem; /* 32px */
  }
}

h1, h2 {
  font-family: 'Karla', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
h1 {
  font-family: 'Karla', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* Corrected font to Karla */
  font-size: 2.25rem; /* 36px */
  font-weight: 800; /* font-extrabold */
  background-image: linear-gradient(to right, #33FF81, #498CE4); /* Linear gradient */
  -webkit-background-clip: text; /* Clip background to text for Webkit browsers */
  background-clip: text; /* Clip background to text for other browsers */
  color: transparent; /* Make text transparent to show background */
  letter-spacing: -0.05em; /* tracking-tight */
  line-height: 1.25; /* leading-tight */
  text-transform: uppercase; /* Added text-transform */
  text-align: left; /* Changed to left-align */
  margin-top: 0; /* ADDED: Remove default top margin from h1 */
  margin-bottom: 0; /* Removed margin-bottom to kill grey bar */
}
@media (min-width: 640px) { /* sm */
  h1 {
    font-size: 3rem; /* 48px */
  }
}
@media (min-width: 1024px) { /* lg */
  h1 {
    font-size: 3.75rem; /* 60px */
  }
}

.error-banner {
  background-color: rgba(255, 255, 255, 0.1); /* 10% white opacity (was red) */
  color: #fff; /* text-white (was red-100) */
  padding: 1rem; /* 16px */
  border-radius: 0.5rem; /* 8px */
  margin-bottom: 1.5rem; /* 24px */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-md */
  text-align: center;
}
.error-banner p {
  font-weight: 600; /* font-semibold */
  font-size: 1rem; /* 16px */
}
.error-banner p + p { /* second p tag */
  font-size: 1rem; /* 16px */
  margin-top: 0.5rem; /* 8px */
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr)); /* grid-cols-1 */
  gap: 1.5rem; /* 24px */
  margin-top: 1.5rem; /* Adjusted margin-top for spacing from h1 */
}
@media (min-width: 640px) { /* sm */
  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* sm:grid-cols-2 */
  }
}
@media (min-width: 1024px) { /* lg */
  .game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* lg:grid-cols-3 */
  }
}
@media (min-width: 1280px) { /* xl */
  .game-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* xl:grid-cols-4 */
  }
}

.game-tile {
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.1); /* 10% white opacity (was gray-800) */
  border-radius: 24px; /* Changed to 24px */
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 44px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
  transition: all 300ms ease-in-out; /* transition-all duration-300 */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px; /* Changed from 0.5rem to 8px */
  gap: 8px; /* Changed from 0.5rem to 8px */
}
.game-tile:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); /* hover:shadow-xl */
  transform: scale(1.02); /* hover:scale-[1.02] */
}
.game-tile-image-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1; /* Make it square */
  border-radius: 16px; /* Applied to all corners */
}
/* Removed md media query height adjustment as aspect-ratio handles it */
.game-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease-in-out; /* transition-transform duration-300 */
}
.game-tile-image-container:hover img {
  transform: scale(1.05); /* hover:scale-105 */
}

.game-tile-content {
  /* padding: 0.5rem; */ /* Removed as padding is now on .game-tile */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0; /* ADDED: Prevent content from overflowing or causing layout issues in flex/grid */
}
.game-tile-content h2 {
  font-size: 26px; /* Updated from 1.25rem (20px) to 26px */
  font-weight: 800; /* font-extrabold */
  color: #fff; /* text-white */
  line-height: 32px; /* Updated from 1.2 to 32px */
  margin-top: 0;
  margin-bottom: 0; /* Set to 0 to remove gap between h2 and p */
}
.game-tile-content p {
  font-size: 14px; /* Explicitly set to 14px */
  color: #d1d5db; /* gray-300 */
  line-height: 16px; /* Explicitly set to 16px */
  margin-top: 0; /* Added to remove gap from h2 */
  margin-bottom: 0; /* Changed to 0 */
  flex-grow: 1; /* Allow description to take available space */
}
.game-tile-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem; /* 12px */
  /* Removed padding-top: 0.5rem; */
  /* Removed border-top: 1px solid rgba(255, 255, 255, 0.1); */
  font-size: 12px; /* Explicitly set to 12px */
  line-height: 16px; /* Explicitly set to 16px */
  color: #9ca3af; /* gray-400 */
  gap: 8px; /* Changed from 0.5rem to 8px */
}

.game-info-pill {
  background-color: rgba(255, 255, 255, 0.08); /* A subtle background for the pill */
  padding: 8px; /* Changed from 0.5rem (8px) on all sides to 8px */
  border-radius: 9999px; /* Fully rounded corners */
  display: inline-flex; /* Allows padding and aligns content */
  align-items: center; /* Centers text vertically */
  white-space: nowrap; /* Prevents text from wrapping */
  line-height: 1; /* Ensures text is snugly within the pill */
  color: #fff; /* Explicitly set to white text */
}

.genre-filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px; /* Changed from 0.5rem to 8px */
  margin-top: 1rem; /* 16px space between h1 and filter */
  margin-bottom: 1rem; /* 16px space between filter and game grid */
}

.genre-filter-chip {
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.08); /* Same as info pills for consistency */
  padding: 8px 16px; /* Changed from 0.5rem 1rem to 8px 16px */
  border-radius: 9999px;
  color: #fff;
  font-size: 0.875rem; /* 14px for filter chips */
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
  border: 1px solid transparent; /* To prevent jump when active border appears */
}

.genre-filter-chip:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.genre-filter-chip.active {
  background-color: #33FF81; /* Green from H1 gradient */
  color: #000; /* Black text for contrast */
  font-weight: 700; /* Make active chip bold */
  border-color: #33FF81; /* Ensure border matches background */
}

@media (max-width: 767px) { /* breakpoint at 768px */
  /* Revert category filters to wrapping behavior */
  .genre-filter-container {
    /* Remove previous horizontal scrolling rules */
    /* width: 100%; */
    /* flex-wrap: nowrap; */
    /* overflow-x: auto; */
    /* -webkit-overflow-scrolling: touch; */
  }
  /* Remove previous flex-shrink rule */
  /* .genre-filter-chip { */
  /*   flex-shrink: 0; */
  /* } */

  /* Responsive tile changes */
  .game-grid {
    gap: 1rem; /* Slightly reduced gap between tiles for compact layout */
  }

  .game-tile {
    flex-direction: row; /* Image on left, content on right */
    align-items: flex-start; /* Align items to the top (image and content block) */
    padding: 12px; /* Adjusted padding for the row layout */
    gap: 12px; /* Gap between thumbnail and content */
  }

  .game-tile-image-container {
    width: 64px; /* Fixed width */
    height: 64px; /* Fixed height */
    aspect-ratio: auto; /* Override square aspect ratio */
    border-radius: 12px; /* Slightly reduced border-radius */
    flex-shrink: 0; /* Prevent image from shrinking */
  }

  .game-tile-content {
    flex-grow: 1; /* Allow content to take remaining space */
    /* Already display: flex; flex-direction: column; */
    justify-content: flex-start; /* Align content to the top within its container */
    gap: 4px; /* Smaller gap between h2, p, and footer */
  }

  .game-tile-content h2 {
    font-size: 1.1rem; /* Smaller title font size for compact tile */
    line-height: 1.3;
    margin-bottom: 0; /* Ensure no extra margin */
  }

  .game-tile-content p {
    font-size: 0.8rem; /* Smaller description font size */
    line-height: 1.4;
    -webkit-line-clamp: 2; /* Limit description to 2 lines */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0; /* Ensure no extra margin */
    flex-grow: 0; /* Prevents description from pushing footer down */
  }

  .game-tile-footer {
    margin-top: 6px; /* Reduced margin-top */
    flex-wrap: wrap; /* Allow tags to wrap if needed */
    justify-content: flex-start; /* Align tags to the left */
    gap: 6px; /* Smaller gap between pills */
    font-size: 0.7rem; /* Smaller font for pills */
    line-height: 1; /* Ensure pill text is compact */
  }

  .game-info-pill {
    padding: 4px 8px; /* Smaller padding for pills */
  }
}