:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a24;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent-green: #00ff88;
  --accent-red: #ff4466;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-yellow: #fbbf24;
  --gradient-start: #00ff88;
  --gradient-end: #8b5cf6;
  --border-color: #2a2a3a;
  --font-mono: 'Space Mono', monospace;
  --font-sans: 'Inter', -apple-system, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  z-index: 1000;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}

.logo-icon {
  font-size: 1.5rem;
}

nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--text-primary);
}

.nav-cta {
  background: var(--accent-purple);
  color: white !important;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
}

.nav-cta:hover {
  opacity: 0.9;
}

/* Hero */
main {
  padding-top: 80px;
}

.hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-green);
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  margin-bottom: 2rem;
  letter-spacing: 0.1em;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  max-width: 600px;
}

.input-container {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.5rem;
  transition: border-color 0.2s;
}

.input-container:focus-within {
  border-color: var(--accent-purple);
}

#wallet-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  outline: none;
}

#wallet-input::placeholder {
  color: var(--text-muted);
}

#analyze-btn {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: var(--bg-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  font-size: 1rem;
}

#analyze-btn:hover {
  transform: scale(1.02);
}

#analyze-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

#analyze-btn .btn-loading {
  display: none;
  animation: spin 1s linear infinite;
}

#analyze-btn.loading .btn-text {
  display: none;
}

#analyze-btn.loading .btn-loading {
  display: inline;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.disclaimer {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
}

/* Results Section */
.results {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.results.hidden {
  display: none;
}

.results-header {
  text-align: center;
  margin-bottom: 3rem;
}

.results-header h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.wallet-display {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.wallet-display button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-card.primary {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(139, 92, 246, 0.1));
  border-color: rgba(0, 255, 136, 0.3);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.stat-value.positive {
  color: var(--accent-green);
}

.stat-value.negative {
  color: var(--accent-red);
}

.stat-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Diagnosis */
.diagnosis-section {
  margin-bottom: 3rem;
}

.diagnosis-section h3,
.patterns-section h3,
.advice-section h3,
.share-section h3,
.donate-section h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.diagnosis-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
}

.diagnosis-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.diagnosis-emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.diagnosis-text {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Patterns */
.patterns-section {
  margin-bottom: 3rem;
}

.patterns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.pattern-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.pattern-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.pattern-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.pattern-value {
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Winners/Losers */
.winners-losers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.wl-column h3 {
  margin-bottom: 1rem;
}

.wl-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wl-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wl-token {
  font-family: var(--font-mono);
  font-weight: 600;
}

.wl-pnl {
  font-family: var(--font-mono);
  font-weight: 700;
}

.wl-pnl.positive {
  color: var(--accent-green);
}

.wl-pnl.negative {
  color: var(--accent-red);
}

/* Advice */
.advice-section {
  margin-bottom: 3rem;
}

.advice-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.advice-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.advice-icon {
  font-size: 1.5rem;
}

.advice-content h4 {
  margin-bottom: 0.25rem;
}

.advice-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Share & Donate */
.share-section,
.donate-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

.share-section p,
.donate-section p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.share-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

.share-btn:hover {
  transform: scale(1.02);
}

.share-btn.twitter {
  background: #1da1f2;
  color: white;
}

.share-btn.download {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.donate-address {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.donate-address code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-green);
}

.copy-btn {
  background: var(--accent-purple);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.donate-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* About Section */
.about-section {
  padding: 6rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.about-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

.about-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.about-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.about-card h3 {
  margin-bottom: 0.5rem;
}

.about-card p {
  color: var(--text-secondary);
}

/* FAQ */
.faq-section {
  padding: 4rem 2rem;
  max-width: 700px;
  margin: 0 auto;
}

.faq-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

details {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.5rem;
}

summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

details p {
  margin-top: 1rem;
  color: var(--text-secondary);
}

details a {
  color: var(--accent-purple);
}

/* Footer */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 2rem;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-mono);
  font-weight: 700;
}

.footer-tagline {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 0.25rem;
}

.footer-tagline a {
  color: var(--accent-purple);
  text-decoration: none;
}

.footer-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-legal {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-legal p {
  margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 1rem;
  }
  
  nav {
    gap: 1rem;
  }
  
  .logo-text {
    font-size: 0.85rem;
  }
  
  .input-container {
    flex-direction: column;
  }
  
  #analyze-btn {
    width: 100%;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .winners-losers {
    grid-template-columns: 1fr;
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--accent-green);
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  z-index: 1000;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Error state */
.error-message {
  background: rgba(255, 68, 102, 0.1);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  text-align: center;
}
