:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2330;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #0077ff;
  --accent-2: #5181b8;
  --like: #f43f5e;
  --view: #38bdf8;
  --comment: #34d399;
  --error: #f87171;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.bg-glow {
  position: fixed;
  inset: -20% auto auto 50%;
  width: 70vw;
  height: 50vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 119, 255, 0.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.header,
.container,
.footer {
  position: relative;
  z-index: 1;
}

.header {
  text-align: center;
  padding: 3rem 1.5rem 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #0077ff, #5181b8);
  font-weight: 700;
  font-size: 0.85rem;
}

.logo-text {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--muted);
}

.container {
  width: min(1100px, 100% - 2rem);
  margin: 0 auto 3rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.token-panel {
  margin-bottom: 1rem;
}

.token-details {
  margin: 0;
}

.token-summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.token-steps {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--muted);
}

.token-steps li {
  margin-bottom: 0.35rem;
}

.token-steps a {
  color: var(--accent-2);
}

.token-warn {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fbbf24;
  font-size: 0.9rem;
}

.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.field--grow {
  flex: 1 1 280px;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--muted);
}

.token-status {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.token-status--ok {
  color: var(--comment);
}

.token-status--err {
  color: var(--error);
}

.search-form {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .search-form {
    grid-template-columns: 1fr 180px auto;
    align-items: end;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

input,
select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 119, 255, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s;
}

.btn-primary {
  background: linear-gradient(135deg, #0077ff, #2b6cb0);
  color: #fff;
  min-width: 180px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: wait;
}

.btn-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hint {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: #fbbf24;
}

.error-box {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--error);
}

.results {
  margin-top: 1.5rem;
}

.community-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.community-card img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.community-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.community-card a {
  color: var(--accent-2);
  text-decoration: none;
}

.community-card a:hover {
  text-decoration: underline;
}

.community-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.scan-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab {
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tab--active {
  background: rgba(0, 119, 255, 0.15);
  border-color: var(--accent);
  color: var(--text);
}

.posts-grid {
  display: grid;
  gap: 1rem;
}

.post-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeIn 0.35s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-rank {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 2rem;
  line-height: 1;
}

.post-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.post-preview {
  margin: 0 0 0.75rem;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.post-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.stat--likes {
  color: var(--like);
}

.stat--views {
  color: var(--view);
}

.stat--comments {
  color: var(--comment);
}

.stat--reposts {
  color: #a78bfa;
}

.stat--highlight {
  font-size: 1rem;
}

.post-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.post-link {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}

.post-link:hover {
  text-decoration: underline;
}

.footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer code {
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
