.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: var(--secondary-color);
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}

.library-header h1 {
  font-size: 20px;
  color: var(--accent-color);
}

.library-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.library-nav a, .library-nav button {
  text-decoration: none;
  color: var(--text-color);
  font-size: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px 12px;
  width: 200px;
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-color);
  font-family: var(--font-mono);
  font-size: 13px;
  width: 100%;
  outline: none;
}

.search-box input::placeholder {
  color: #666;
}

.library-filters {
  display: flex;
  gap: 8px;
  padding: 15px 20px;
  flex-wrap: wrap;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.category-btn {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
}

.category-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  width: 100%;
}

.game-card {
  background: var(--secondary-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.game-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(233, 69, 96, 0.2);
}

.game-card .cover {
  width: 100%;
  aspect-ratio: 256 / 240;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.game-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.game-card .cover .placeholder {
  color: #666;
  font-size: 40px;
}

.game-card .info {
  padding: 12px;
}

.game-card .info .title {
  font-size: 14px;
  color: var(--text-color);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card .info .category {
  font-size: 11px;
  color: #888;
  display: inline-block;
  background: var(--bg-color);
  padding: 2px 8px;
  border-radius: 10px;
}

.game-card .fav-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.game-card .fav-overlay:hover {
  background: rgba(0, 0, 0, 0.8);
}

.game-card .fav-overlay.favorited {
  color: var(--gold);
}

.library-empty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 14px;
  grid-column: 1 / -1;
}

.library-empty .icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.library-stats {
  text-align: center;
  padding: 10px;
  font-size: 12px;
  color: #666;
}

@media (max-width: 600px) {
  .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 12px;
  }

  .search-box {
    width: 140px;
  }

  .library-header {
    padding: 10px 15px;
  }

  .library-header h1 {
    font-size: 16px;
  }
}
