:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface2: #1e1e1e;
  --border: #2a2a2a;
  --accent: #fe2c55;
  --accent2: #25f4ee;
  --text: #f1f1f1;
  --muted: #888;
  --radius: 12px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.muted { color: var(--muted); font-size: 12px; }
.btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background .15s, border-color .15s;
}
.btn-refresh:hover { background: var(--border); border-color: #444; }
.btn-refresh.spinning svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Main ── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  width: 100%;
  flex: 1;
}

/* ── Profile card ── */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.profile-card .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}
.profile-info .nickname {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 2px;
}
.profile-info .handle {
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 6px;
}
.profile-info .bio {
  color: var(--muted);
  font-size: 13px;
  max-width: 480px;
}
.profile-skeleton {
  display: flex;
  align-items: center;
  gap: 20px;
}
.skel-lines { display: flex; flex-direction: column; gap: 10px; }

/* ── Skeletons ── */
.skel {
  background: linear-gradient(90deg, var(--surface2) 25%, #2a2a2a 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
  height: 16px;
}
.skel-avatar { width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0; }
.skel-line { height: 14px; }
.w80 { width: 180px; }
.w60 { width: 140px; }
.w40 { width: 90px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color .15s;
}
.stat-card:hover { border-color: #444; }
.skeleton-card { display: flex; align-items: center; justify-content: center; min-height: 88px; }
.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-value.accent { color: var(--accent); }
.stat-value.accent2 { color: var(--accent2); }
.stat-sub { font-size: 12px; color: var(--muted); }

/* ── Today's gains ── */
.today-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.today-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.today-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color .15s;
}
.today-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: .5;
}
.today-card.positive::before { background: #00c97a; opacity: 1; }
.today-card.negative::before { background: var(--accent); opacity: 1; }
.today-card:hover { border-color: #444; }
.today-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.today-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.today-value.up   { color: #00c97a; }
.today-value.down { color: var(--accent); }
.today-value.zero { color: var(--muted); }
.today-icon {
  font-size: 18px;
  position: absolute;
  top: 14px;
  right: 14px;
  opacity: .4;
}
.today-sub {
  font-size: 11px;
  color: var(--muted);
}

/* ── Chart ── */
.chart-section, .videos-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-header h2 {
  font-size: 16px;
  font-weight: 600;
}
.chart-wrap { position: relative; height: 260px; }

/* Tabs */
.tab-group { display: flex; gap: 6px; }
.tab {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: all .15s;
}
.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tab:hover:not(.active) { border-color: #555; color: var(--text); }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  user-select: none;
  white-space: nowrap;
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text); }
th.active { color: var(--accent); }
th.active::after { content: ' ▼'; font-size: 9px; }
th.active.asc::after { content: ' ▲'; }
.col-cover { width: 52px; }
.col-num { width: 90px; text-align: right; }
.col-date { width: 110px; }
td.col-num { text-align: right; font-variant-numeric: tabular-nums; }

.cover-thumb {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.cover-placeholder {
  width: 40px;
  height: 56px;
  background: var(--surface2);
  border-radius: 4px;
}
.desc-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.desc-cell a {
  color: var(--text);
  text-decoration: none;
}
.desc-cell a:hover { color: var(--accent); }
.er-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.er-high { background: rgba(254,44,85,.15); color: var(--accent); }
.er-mid { background: rgba(255,180,0,.1); color: #ffb400; }
.er-low { background: rgba(136,136,136,.12); color: var(--muted); }

tbody tr:hover { background: rgba(255,255,255,.03); }
tbody tr:last-child td { border-bottom: none; }

.skeleton-row td { padding: 12px; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  gap: 24px;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 999;
  max-width: 280px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: var(--accent); color: var(--accent); }

/* ── Error state ── */
.error-state {
  text-align: center;
  padding: 32px;
  color: var(--muted);
}
.error-state strong { display: block; color: var(--accent); margin-bottom: 6px; font-size: 15px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .today-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .today-grid { grid-template-columns: repeat(2, 1fr); }
  .header-right .muted { display: none; }
  main { padding: 16px 14px 40px; }
  .section-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .col-date, .col-shares { display: none; }
}
