* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
}

.container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.95);
  margin: 10px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.header {
  padding: 20px 30px;
  text-align: center;
  border-bottom: 1px solid #eee;
  background: white;
  border-radius: 20px 20px 0 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

h1 {
  color: #333;
  margin: 0;
  font-size: 2.5em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.stats {
  margin-top: 10px;
  color: #666;
  font-size: 0.9em;
}

.search-container {
  padding: 20px 30px;
  background: white;
  border-bottom: 1px solid #eee;
}

.search-input {
  width: 100%;
  padding: 12px 20px;
  border: 2px solid #ddd;
  border-radius: 25px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  border-color: #667eea;
}

.viewport {
  flex: 1;
  overflow-y: auto;
  position: relative;
  padding: 0 30px;
}

.virtual-container {
  position: relative;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  padding: 20px 0;
}

.emoji-item {
  background: white;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  border: 1px solid #f0f0f0;
  height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.emoji-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: #667eea;
}

.emoji-svg {
  margin-bottom: 8px;
  flex-shrink: 0;
}

.emoji-name {
  font-size: 0.85em;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 2.4em;
}

.emoji-code {
  font-size: 0.75em;
  color: #888;
  font-family: monospace;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.no-results {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 1.1em;
}

@media (max-width: 768px) {
  .emoji-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .container {
    margin: 5px;
  }

  .header,
  .search-container {
    padding: 15px 20px;
  }

  .viewport {
    padding: 0 20px;
  }

  h1 {
    font-size: 2em;
  }

  .emoji-item {
    height: 120px;
    padding: 10px;
  }
}
