:root {
  --bg: #0e1621;
  --surface: #182533;
  --surface-hover: #20304275;
  --text: #e8edf1;
  --text-dim: #7c8b98;
  --accent: #2ea6ff;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 12px 32px;
}

.logo-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: left;
  gap: 14px;
  margin-bottom: 20px;
  padding: 0 4px;
}

.logo-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 12px;
}

.header-titles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.site-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.site-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.2;
}

.search-container {
  position: sticky;
  top: 10px;
  z-index: 10;
  margin-bottom: 20px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 12px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-bar:focus-within {
  border-color: rgba(46, 166, 255, 0.6);
  box-shadow: 0 4px 24px rgba(46, 166, 255, 0.18), 0 0 0 2px rgba(46, 166, 255, 0.1);
  background: #1c2b3c;
}

.search-icon {
  font-size: 18px;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.search-bar:focus-within .search-icon {
  transform: scale(1.1);
  opacity: 1;
}

#search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

#search-input::placeholder {
  color: var(--text-dim);
  opacity: 0.85;
}

.clear-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.clear-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

.quick-tags {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 4px 2px;
  scrollbar-width: none;
}

.quick-tags::-webkit-scrollbar {
  display: none;
}

.tag-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-chip:hover, .tag-chip.active {
  background: rgba(46, 166, 255, 0.15);
  border-color: rgba(46, 166, 255, 0.4);
  color: var(--accent);
}

.tag-chip:active {
  transform: scale(0.95);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.tile:active {
  transform: scale(0.96);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile .tile-tags {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-state,
.hint-state {
  text-align: center;
  color: var(--text-dim);
  margin-top: 48px;
  font-size: 15px;
  line-height: 1.6;
}

@media (max-width: 380px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}