:root {
  --bg: #050816;
  --bg-elevated: #0b1020;
  --accent: #40c463;
  --accent-soft: rgba(64, 196, 99, 0.15);
  --accent-danger: #ff4d4f;
  --text: #f5f7ff;
  --text-muted: #9ca3af;
  --border-subtle: #1f2933;
  --radius-lg: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  background: radial-gradient(circle at top, #111827, #020617 50%, #000);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  background: radial-gradient(circle at top left, rgba(64, 196, 99, 0.08), rgba(15, 23, 42, 0.95));
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.badge-live {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}

.badge-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.35);
}

.main-layout {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 1.5rem;
}

.content {
  width: 100%;
  max-width: 1100px;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.06), rgba(15, 23, 42, 0.96));
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1.5rem;
  box-shadow:
    0 24px 40px rgba(15, 23, 42, 0.8),
    0 0 0 1px rgba(15, 23, 42, 0.7);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.controls {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.timeframe-toggle,
.direction-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.timeframe-btn,
.direction-btn {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timeframe-btn.active,
.direction-btn.active {
  background: var(--accent-soft);
  color: #bbf7d0;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3);
}

.timeframe-btn:hover:not(.active),
.direction-btn:hover:not(.active) {
  border-color: rgba(148, 163, 184, 0.8);
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timestamp {
  opacity: 0.7;
}

.table-wrapper {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.98)
  );
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead {
  background: rgba(15, 23, 42, 0.95);
}

th,
td {
  padding: 0.6rem 0.9rem;
  text-align: left;
}

th {
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.96);
}

tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.92);
}

tbody tr:hover {
  background: radial-gradient(circle at left, rgba(56, 189, 248, 0.14), rgba(15, 23, 42, 0.98));
}

tbody td:first-child {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.cell-symbol {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cell-price,
.cell-volume {
  font-variant-numeric: tabular-nums;
}

.cell-change {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.cell-change.up {
  color: #4ade80;
}

.cell-change.down {
  color: var(--accent-danger);
}

.note {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.ad-container {
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  padding: 0.75rem;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.98));
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60px;
  position: relative;
}

.ad-container::before {
  content: "Ad space";
  font-size: 0.7rem;
  color: var(--text-muted);
  position: absolute;
  top: 6px;
  right: 10px;
  opacity: 0.7;
}

.site-footer {
  padding: 1rem 1.5rem 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 768px) {
  .main-layout {
    padding: 1rem;
  }

  .content {
    padding: 1rem;
  }

  .status-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .timeframe-toggle,
  .direction-toggle {
    width: 100%;
  }
}
