:root {
  --bg: #ffffff;
  --bg-card: #f8fafc;
  --bg-input: #ffffff;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --accent: #111827;
  --accent-hover: #374151;
  --accent-muted: rgba(17, 24, 39, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { max-width: 760px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* Header */
header { padding: 32px 0 20px; border-bottom: 1px solid var(--border); }
.header-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-icon {
  width: 36px; height: 36px; background: #111827; color: white;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; letter-spacing: -0.02em;
}
.logo-text { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.tagline { color: var(--text-muted); font-size: 14px; }

/* Category Grid */
.category-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 28px 0;
}
.cat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 12px; text-align: center; cursor: pointer; transition: all 0.15s;
  text-decoration: none; color: var(--text); display: flex; flex-direction: column;
  align-items: center; gap: 8px;
}
.cat-card:hover { border-color: var(--border-hover); background: white; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.cat-icon { font-size: 28px; line-height: 1; color: var(--text-muted); }
.cat-label { font-size: 12px; font-weight: 600; color: var(--text); }

/* Generator view */
.back-btn {
  background: none; border: none; color: var(--text-muted); font-size: 13px;
  cursor: pointer; padding: 4px 0; margin-bottom: 12px; font-family: inherit;
}
.back-btn:hover { color: var(--text); }
.gen-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; color: var(--text); }

/* Options */
.options-panel { margin-bottom: 16px; }
.input-row { display: flex; gap: 8px; margin-bottom: 10px; }
.text-input {
  flex: 1; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-input);
  color: var(--text); font-size: 14px; font-family: inherit; outline: none;
  transition: border-color 0.15s;
}
.text-input:focus { border-color: var(--accent); }
.text-input::placeholder { color: var(--text-dim); }
.generate-btn {
  padding: 10px 20px; border-radius: var(--radius-sm); border: none;
  background: var(--accent); color: white; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s; font-family: inherit; white-space: nowrap;
}
.generate-btn:hover { background: var(--accent-hover); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-select {
  padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text-muted); font-size: 12px; font-family: inherit;
  outline: none; cursor: pointer;
}
.filter-select:focus { border-color: var(--accent); }

/* Sort bar */
.sort-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; color: var(--text-muted); }
.sort-bar label { font-weight: 500; }

/* Results heading */
.results-heading { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }

/* Results list */
.results-list { display: flex; flex-direction: column; margin-bottom: 24px; }
.name-row {
  display: flex; align-items: center; padding: 12px 0;
  border-bottom: 1px solid var(--border); transition: background 0.1s; gap: 12px;
}
.name-row:first-child { border-top: 1px solid var(--border); }
.name-row:hover { background: var(--accent-muted); margin: 0 -12px; padding: 12px; border-radius: 6px; }
.name-row .name { font-size: 15px; font-weight: 600; color: var(--text); min-width: 160px; flex-shrink: 0; }
.name-row .description { flex: 1; font-size: 13px; color: var(--text-muted); }
.name-row .copy-btn { flex-shrink: 0; }

/* Result avatar (for fantasy/DND/pirate types) */
.result-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
}

/* Prompt message (shown before generating) */
.prompt-msg {
  text-align: center; padding: 40px 20px; color: var(--text-dim); font-size: 14px;
  border: 1px dashed var(--border); border-radius: var(--radius); margin-bottom: 24px;
}

/* Copy button */
.copy-btn {
  padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font-size: 11px;
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.copy-btn:hover { background: var(--accent-muted); color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { background: var(--accent); color: white; border-color: var(--accent); }

/* Share bar (above results) */
.share-bar {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.share-bar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text-muted); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.share-bar-btn:hover { background: var(--accent-muted); color: var(--accent); border-color: var(--accent); }
.share-bar-btn svg { vertical-align: middle; }

/* Share button & dropdown */
.share-btn {
  padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font-size: 13px;
  cursor: pointer; transition: all 0.15s; font-family: inherit; line-height: 1;
}
.share-btn:hover { background: var(--accent-muted); color: var(--accent); border-color: var(--accent); }
.share-wrap { position: relative; flex-shrink: 0; }
.share-dropdown {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 100;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); min-width: 170px; padding: 4px 0;
  animation: dropIn 0.12s ease-out;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.share-dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  font-size: 13px; color: var(--text); cursor: pointer; transition: background 0.1s;
  border: none; background: none; width: 100%; font-family: inherit; text-align: left;
}
.share-dropdown-item:hover { background: var(--accent-muted); }
.share-dropdown-item .share-icon { width: 18px; text-align: center; flex-shrink: 0; font-size: 14px; }
/* Load more */
.load-more-wrap { text-align: center; padding: 12px 0 40px; }
.load-more-btn {
  padding: 8px 28px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.load-more-btn:hover { background: var(--accent-muted); color: var(--accent); border-color: var(--accent); }

/* Intro section */
.intro { margin: 24px 0; padding: 0 0 24px; border-bottom: 1px solid var(--border); }
.intro h2 { font-size: 22px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.intro h3 { font-size: 16px; font-weight: 600; margin: 20px 0 8px; color: var(--text); }
.intro p { font-size: 14px; line-height: 1.7; color: var(--text-muted); margin-bottom: 12px; }
.intro ol { padding-left: 20px; margin-bottom: 16px; }
.intro li { font-size: 14px; line-height: 1.7; color: var(--text-muted); margin-bottom: 6px; }
.intro strong { color: var(--text); }

.features-row { display: flex; gap: 16px; margin: 16px 0; flex-wrap: wrap; }
.feature-item {
  flex: 1; min-width: 100px; text-align: center; padding: 12px 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.feature-item strong { display: block; font-size: 20px; color: var(--text); }
.feature-item span { font-size: 11px; color: var(--text-dim); }

.how-it-works { list-style: none; padding: 0; counter-reset: step; }
.how-it-works li { counter-increment: step; padding: 8px 0 8px 32px; position: relative; }
.how-it-works li::before {
  content: counter(step); position: absolute; left: 0; top: 8px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: white;
  font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}

/* Feedback */
.feedback-section { margin: 24px 0; padding: 24px 0; border-top: 1px solid var(--border); }
.feedback-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.feedback-form { display: flex; gap: 8px; align-items: flex-start; }
.feedback-form textarea {
  flex: 1; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text); font-family: inherit; font-size: 14px;
  resize: vertical; min-height: 60px; outline: none; transition: border-color 0.15s;
}
.feedback-form textarea:focus { border-color: var(--accent); }
.feedback-form textarea::placeholder { color: var(--text-dim); }
.feedback-thanks { color: var(--text-muted); font-size: 14px; margin-top: 8px; }

/* Footer */
footer { margin-top: auto; padding: 32px 0 20px; border-top: 1px solid var(--border); background: var(--bg-card); }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 20px; }
.footer-col h4 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text); margin-bottom: 10px; }
.footer-col a { display: block; font-size: 13px; color: var(--text-muted); text-decoration: none; padding: 3px 0; transition: color 0.15s; }
.footer-col a:hover { color: var(--text); }
.footer-about { font-size: 12px; line-height: 1.6; color: var(--text-dim); }
.footer-bottom { text-align: center; font-size: 11px; color: var(--text-dim); padding-top: 16px; border-top: 1px solid var(--border); }

/* Mobile */
@media (max-width: 640px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cat-card { padding: 16px 8px; }
  .cat-icon { font-size: 24px; }
  .input-row { flex-direction: column; }
  .logo-text { font-size: 20px; }
  .name-row { flex-wrap: wrap; gap: 4px; }
  .name-row .name { min-width: unset; width: 100%; }
  .name-row .description { padding: 0; width: calc(100% - 60px); }
  .name-row .copy-btn { margin-left: auto; }
  .generate-btn { padding: 12px 20px; font-size: 15px; }
  .container { padding: 0 16px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .features-row { gap: 8px; }
  .feature-item { min-width: 70px; padding: 10px 6px; }
  .feature-item strong { font-size: 16px; }
}
@media (max-width: 400px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
