/* ===== GAME FILTER SECTION ===== */
.game-filters-container {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--bg-dashboard);
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  flex-wrap: wrap;
  scroll-behavior: smooth;
}

.game-filters-container::-webkit-scrollbar {
  height: 4px;
}

.game-filters-container::-webkit-scrollbar-track {
  background: transparent;
}

.game-filters-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.game-filters-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.filter-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  white-space: nowrap;
  margin-right: 8px;
}

.filter-btn {
  padding: 8px 16px;
  background: rgba(139, 0, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text-main);
  background: rgba(139, 0, 255, 0.15);
}

.filter-btn.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: white;
  box-shadow: 0 0 15px rgba(139, 0, 255, 0.4);
}

/* ===== ENHANCED GAME CARD WITH ANIMATIONS ===== */
.game-card {
  position: relative;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: center;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(139, 0, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
}

.game-card:hover {
  transform: translateY(-12px) scale(1.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(139, 0, 255, 0.25);
}

.game-card:hover::before {
  opacity: 1;
}

.game-card-image-wrapper {
  position: relative;
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: linear-gradient(135deg, #1f1f2e, #0d0d13);
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover .game-card-image-wrapper img {
  transform: scale(1.15) rotate(2deg);
}

.game-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 6, 20, 0.7);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
  border-radius: 14px 14px 0 0;
  pointer-events: none;
}

.game-card:hover .game-card-overlay {
  opacity: 1;
}

/* ===== RATING BUTTON / THUMBS UP ===== */
.game-rating-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(139, 0, 255, 0.3);
  border: 2px solid rgba(139, 0, 255, 0.6);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  pointer-events: auto;
  opacity: 0;
  transform: scale(0);
}

.game-card:hover .game-rating-btn {
  opacity: 1;
  transform: scale(1);
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-rating-btn:hover {
  background: var(--accent);
  border-color: white;
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(139, 0, 255, 0.6);
}

.game-rating-btn.rated {
  background: #10b981;
  border-color: white;
  color: #ffffff;
}

.game-rating-btn.rated:hover {
  background: #34d399;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
}

/* Rating counter */
.rating-counter {
  position: absolute;
  top: 50px;
  right: 12px;
  background: var(--accent);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 9;
  pointer-events: none;
}

.game-card:hover .rating-counter {
  opacity: 1;
  transform: translateY(0);
}

@keyframes popIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes thumbsUp {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(-15deg) scale(1.1);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

.game-rating-btn.animate {
  animation: thumbsUp 0.6s ease-out;
}

/* ===== IMPROVED MOBILE LAYOUT ===== */
@media (max-width: 980px) {
  .game-filters-container {
    padding: 12px 12px;
    gap: 8px;
  }

  .filter-label {
    margin-right: 6px;
  }

  .filter-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

@media (max-width: 700px) {
  /* Stack everything nicely on phone */
  .main-content {
    height: auto;
    overflow-y: auto;
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .greeting {
    width: 100%;
  }

  .greeting h1 {
    font-size: 1.15rem;
    margin: 0;
  }

  .greeting p {
    font-size: 12px;
    margin-top: 2px;
  }

  #system-news-btn {
    width: 100%;
    justify-content: center;
  }

  .search-bar {
    width: 100%;
    max-width: 100%;
  }

  .top-bar-stats {
    display: flex !important;
    width: 100%;
    gap: 8px;
  }

  #battery-widget,
  #ny-time-widget {
    flex: 1;
    font-size: 11px;
    padding: 6px 8px;
  }

  /* Game filters - more compact on mobile */
  .game-filters-container {
    padding: 10px 8px;
    gap: 6px;
    overflow-x: auto;
  }

  .filter-label {
    font-size: 11px;
    margin-right: 4px;
  }

  .filter-btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  /* Game grid - better for mobile */
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    gap: 10px;
    padding: 0 8px 20px;
  }

  .game-card {
    height: auto;
    border-radius: 12px;
  }

  .game-card-image-wrapper {
    height: 110px;
  }

  .game-card > h3 {
    padding: 8px 8px 10px;
    font-size: 12px;
  }

  /* Make thumbs-up more accessible on touch */
  .game-rating-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
    top: 6px;
    right: 6px;
    opacity: 1;
    transform: scale(1);
  }

  .game-rating-btn:active {
    transform: scale(1.1);
  }

  .rating-counter {
    font-size: 10px;
    padding: 3px 6px;
  }

  /* Hero section optimized */
  .hero {
    margin: 8px;
    padding: 16px;
    border-radius: 12px;
  }

  .hero h2 {
    font-size: 1.25rem;
  }

  .hero h3 {
    font-size: 0.9rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 8px;
  }

  .hero-actions button {
    width: 100%;
    padding: 12px 16px;
  }

  /* Random button on mobile */
  .random-section {
    padding: 0 8px 12px;
  }

  .quick-action-btn {
    padding: 14px 16px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0 6px 16px;
  }

  .game-card {
    border-radius: 10px;
  }

  .game-card-image-wrapper {
    height: 100px;
    border-radius: 10px 10px 0 0;
  }

  .game-card > h3 {
    padding: 6px 6px 8px;
    font-size: 11px;
    line-height: 1.2;
  }

  .game-rating-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .rating-counter {
    font-size: 9px;
    padding: 2px 5px;
    top: 44px;
  }

  .top-bar-stats {
    flex-direction: column;
  }

  #battery-widget,
  #ny-time-widget {
    width: 100%;
  }

  .filter-btn {
    padding: 5px 8px;
    font-size: 10px;
  }
}

/* ===== NO GAMES FOUND MESSAGE ===== */
.no-games-found {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
  background: rgba(139, 0, 255, 0.03);
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  margin: 20px;
}

.no-games-found i {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--accent);
  opacity: 0.6;
}

/* ===== SMOOTH FADE IN FOR FILTERED GAMES ===== */
.game-card {
  animation: fadeInGame 0.4s ease-out forwards;
}

.game-card.hidden {
  display: none;
}

@keyframes fadeInGame {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for multiple cards */
.game-card:nth-child(1) {
  animation-delay: 0ms;
}
.game-card:nth-child(2) {
  animation-delay: 40ms;
}
.game-card:nth-child(3) {
  animation-delay: 80ms;
}
.game-card:nth-child(4) {
  animation-delay: 120ms;
}
.game-card:nth-child(5) {
  animation-delay: 160ms;
}
.game-card:nth-child(n + 6) {
  animation-delay: 200ms;
}
