:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #121821;
  --panel-2: #171f2b;
  --text: #e8eef7;
  --muted: #8b98ab;
  --accent: #00ff86;
  --accent-dim: #00c868;
  --border: #243041;
  --danger: #ff6b6b;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(0, 255, 134, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

.header h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.stats,
.result-count {
  color: var(--muted);
}

input[type="search"] {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
}

input:focus {
  outline: 2px solid rgba(0, 255, 134, 0.25);
  border-color: var(--accent-dim);
}

.btn-primary {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  font: inherit;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #04140b;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.search-bar {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.item-thumb {
  width: 44px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.item-body {
  min-width: 0;
}

.item-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.item-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.btn-download {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(0, 255, 134, 0.35);
  white-space: nowrap;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  font: inherit;
  cursor: pointer;
}

.btn-download:hover {
  background: rgba(0, 255, 134, 0.08);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
}

@media (max-width: 640px) {
  .header {
    flex-direction: column;
  }

  .item {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .btn-download {
    grid-column: 2;
    justify-self: start;
  }
}
