:root {
  --bg: #0b0d12;
  --bg-elevated: #14171f;
  --border: #23262f;
  --text: #ffffff;
  --text-dim: #a4a8b3;
  --accent: #7c5cff;
  --accent-2: #22c55e;
  --danger: #ef4444;
  --radius: 18px;
  --tap: 96px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  padding: 20px 20px 8px;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand-mark { font-size: 22px; }

.topbar-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-dim);
}

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

.section-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  margin: 18px 4px 10px;
  font-weight: 700;
}

/* pinned row - horizontal scroll of small circular items */
.pinned-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 4px 8px;
  scrollbar-width: none;
}
.pinned-row::-webkit-scrollbar { display: none; }

.pinned-item {
  flex: 0 0 auto;
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}

.pinned-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  border: 2px solid var(--accent);
}

.pinned-item span.label {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* spotlight - one special highlighted link, visually distinct from regular tool cards */
.spotlight {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(135deg, rgba(124,92,255,0.25), rgba(34,197,94,0.18));
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 1px rgba(124,92,255,0.15), 0 8px 24px rgba(124,92,255,0.15);
  transition: transform .12s ease, box-shadow .12s ease;
}
.spotlight:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(124,92,255,0.3), 0 10px 28px rgba(124,92,255,0.25); }
.spotlight:active { transform: scale(0.98); }

.spotlight-icon { font-size: 26px; flex: 0 0 auto; }

.spotlight-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }

.spotlight-title { font-weight: 800; font-size: 15px; }

.spotlight-sub { font-size: 12px; color: var(--text-dim); line-height: 1.3; }

.spotlight-arrow { font-size: 20px; color: var(--accent); flex: 0 0 auto; }

/* category tiles - big, one tap, no scroll needed for the choice itself */
.categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.category-tile {
  font-family: inherit;
  min-height: var(--tap);
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
  padding: 18px 10px;
}

.category-tile:active { transform: scale(0.96); }
.category-tile:hover { border-color: var(--accent); }

.category-tile .emoji { font-size: 28px; }
.category-tile .label { font-weight: 800; font-size: 14px; text-align: center; color: var(--text); }
.category-tile .count { font-size: 11px; color: var(--text-dim); font-weight: 600; }

/* tools view */
.tools-view { margin-top: 4px; }

.back-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  padding: 8px 4px;
  cursor: pointer;
}
.back-btn:hover { color: var(--text); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 4px;
}

.tool-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 6px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.tool-card:active { transform: scale(0.95); }
.tool-card:hover { border-color: var(--accent); }

.tool-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.tool-card .name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

.badge-new {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
  letter-spacing: 0.4px;
}

.footer {
  max-width: 720px;
  margin: 8px auto 0;
  padding: 0 16px 24px;
  text-align: center;
}

.suggest-btn {
  background: none;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  cursor: pointer;
}
.suggest-btn:hover { border-color: var(--accent); color: var(--text); }

@media (min-width: 640px) {
  .categories { grid-template-columns: repeat(3, 1fr); }
  .tools-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 900px) {
  #app { max-width: 900px; }
  .categories { grid-template-columns: repeat(5, 1fr); }
  .tools-grid { grid-template-columns: repeat(6, 1fr); }
}
