:root {
  --bg: #0b0c0f;
  --surface: #14161b;
  --surface-2: #1c1f27;
  --surface-3: #23262f;
  --text: #e8e9ec;
  --text-secondary: #9aa0a6;
  --accent: #E82127;
  --accent-hover: #ff2d33;
  --positive: #00c853;
  --negative: #ff1744;
  --border: rgba(255,255,255,0.06);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.page-wrapper { min-height: 100%; display: flex; flex-direction: column; }

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: rgba(11,12,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center; color: #fff;
}
.logo-mark svg { width: 18px; height: 18px; }
.logo-text { font-weight: 800; font-size: 18px; letter-spacing: -0.3px; }
.logo-text .accent { color: var(--accent); }
.nav-meta { display: flex; align-items: center; gap: 14px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.6px; color: var(--positive);
  background: rgba(0,200,83,0.12); padding: 6px 10px; border-radius: 999px;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--positive);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,200,83,0.45); }
  70% { box-shadow: 0 0 0 8px rgba(0,200,83,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,200,83,0); }
}
.last-update { font-size: 12px; color: var(--text-secondary); }

/* Container */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px; flex: 1; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1fr; gap: 18px;
  margin-bottom: 20px;
}
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.2fr 0.8fr; }
}
.hero-main {
  background: linear-gradient(180deg, rgba(232,33,39,0.12), rgba(232,33,39,0.02));
  border: 1px solid rgba(232,33,39,0.25);
  border-radius: var(--radius); padding: 22px 24px;
}
.hero-label { font-size: 12px; font-weight: 700; letter-spacing: 0.8px; color: var(--accent); text-transform: uppercase; margin-bottom: 6px; }
.hero-price-row { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.hero-price { font-size: clamp(40px, 5vw, 64px); font-weight: 800; letter-spacing: -1.5px; margin: 0; line-height: 1; }
.hero-change { font-size: 18px; font-weight: 700; padding: 6px 10px; border-radius: 10px; background: var(--surface-3); }
.up { color: var(--positive); }
.down { color: var(--negative); }
.hero-meta { margin-top: 10px; font-size: 13px; color: var(--text-secondary); }
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.stat-card .stat-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .stat-value { font-size: 18px; font-weight: 700; margin-top: 6px; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title { font-size: 16px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.icon { font-size: 18px; line-height: 1; }

/* Chart */
.chart-wrap { position: relative; height: 380px; }
.range-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.range-btn {
  background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s ease;
}
.range-btn:hover { color: var(--text); background: var(--surface-3); }
.range-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Grid */
.grid-two { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 960px) { .grid-two { grid-template-columns: 1fr 1fr; } }

/* News */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  transition: transform .15s ease, border-color .15s ease;
}
.news-item:hover { transform: translateY(-1px); border-color: rgba(232,33,39,0.35); }
.news-thumb {
  width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--surface-3);
}
.news-body { min-width: 0; }
.news-title { font-size: 14px; font-weight: 600; line-height: 1.35; margin: 0 0 6px; }
.news-title a { color: var(--text); text-decoration: none; }
.news-title a:hover { color: var(--accent-hover); text-decoration: underline; }
.news-meta { font-size: 12px; color: var(--text-secondary); }

/* Tweets */
.tweet-list { display: flex; flex-direction: column; gap: 12px; }
.tweet-item {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
}
.tweet-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tweet-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3);
  display: grid; place-items: center; font-size: 16px; flex-shrink: 0;
}
.tweet-name { font-weight: 700; font-size: 13px; }
.tweet-handle { color: var(--text-secondary); font-size: 12px; }
.tweet-text { font-size: 13px; line-height: 1.5; color: var(--text); }
.tweet-date { font-size: 11px; color: var(--text-secondary); margin-top: 8px; }

/* Key stats */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.stat-row .k { font-size: 12px; color: var(--text-secondary); }
.stat-row .v { font-size: 14px; font-weight: 700; }

/* Table */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  background: var(--surface-2); color: var(--text-secondary); font-weight: 600; text-align: left;
  padding: 12px 14px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.data-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.data-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Fallback */
.fallback-msg {
  padding: 18px; border-radius: 10px; background: rgba(232,33,39,0.08); border: 1px solid rgba(232,33,39,0.25);
  color: var(--text); font-size: 13px; text-align: center;
}
.hidden { display: none !important; }

/* Skeletons */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.6s infinite; border-radius: 10px;
}
.skeleton-text { display: inline-block; border-radius: 6px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Footer */
.footer { text-align: center; padding: 24px; color: var(--text-secondary); font-size: 12px; border-top: 1px solid var(--border); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2e3340; }
