:root {
  --bg: #07080c;
  --fg: #e7eaf0;
  --muted: #8b93a7;
  --accent: #6ee7ff;
  --up: #34d399;
  --down: #f87171;
  --card-bg: rgba(20, 24, 35, 0.86);
  --card-border: rgba(110, 231, 255, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 35%, #0d1422 0%, #07080c 70%);
  z-index: -1;
}

#container {
  position: fixed;
  inset: 0;
}

#loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  background: var(--bg);
  transition: opacity 0.4s;
}
#loader.hidden {
  opacity: 0;
  pointer-events: none;
}
.spin {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(110, 231, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 3D cards ---- */
.card {
  width: 110px;
  height: 140px;
  padding: 12px 10px 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: inherit;
  user-select: none;
  cursor: pointer;
  position: relative;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3),
    0 8px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent),
    0 12px 32px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(110, 231, 255, 0.22);
  transform: scale(1.06);
  z-index: 5;
}
.card .ticker {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  padding-right: 36px; /* room for the cap badge */
}
.card .name {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.25;
  max-height: 2.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: 4px;
}
.card .cap {
  position: absolute;
  top: 9px;
  right: 10px;
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.card .bottom {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.card .price {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.card .change {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.card .change.up { color: var(--up); }
.card .change.down { color: var(--down); }
.card .change.flat { color: var(--muted); }
.card .sector-bar {
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 3px;
  border-radius: 0 0 3px 3px;
}
