:root {
  --bg-grad-start: #090c10;
  --bg-grad-end: #0f1420;
  --card: #121722;
  --border: #1a2030;
  --text: #e7eef7;
  --muted: #a7b0c0;
  --zero: #6b7280;
  --hl: #f6c560;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Titillium Web', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-grad-start), var(--bg-grad-end));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1316px;
  margin: 24px auto;
  padding: 0 16px;
}

header { margin-bottom: 16px; }
header h1 { margin: 0 0 6px 0; font-weight: 700; letter-spacing: 0.2px; }
header p { margin: 0; color: var(--muted); font-weight: 400; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.toolbar label { color: var(--muted); }

select, button {
  background: #171d2a;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
}
button { cursor: pointer; }
button:hover { background: #1a2232; }

#status { margin-left: auto; color: var(--muted); font-size: 14px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: #0d121c; }

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 860px;
  font-variant-numeric: tabular-nums;
}

thead th { position: sticky; top: 0; background: #0f1624; z-index: 2; }

th, td {
  text-align: center;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 14px;
  white-space: nowrap;
}
th:first-child, td:first-child {
  position: sticky;
  left: 0;
  background: #101728;
  z-index: 1;
  text-align: left;
  font-weight: 600;
}
tr:last-child td { border-bottom: none; }
th:last-child, td:last-child { border-right: none; }

.cell {
  position: relative;
  border-radius: 6px;
  padding: 10px 10px;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  cursor: default;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}
.cell.hovered { transform: scale(1.06); filter: brightness(1.15) saturate(1.2); box-shadow: 0 8px 18px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.06); }
.cell.ytd { font-weight: 700; border: 1px solid rgba(231, 238, 247, 0.18); }
.pos { color: #d8ffe1; }
.neg { color: #ffd8d8; }
.zero { color: #e6e7ea; }

.halving { outline: 2px dashed var(--hl); outline-offset: -3px; }
.badge {
    position: absolute;
    top: -9px;
    right: 14px;
    font-size: 9px;
    padding: 0px 3px;
    border-radius: 999px;
    /* background: rgba(246, 197, 96, 0.15); */
    color: #ffdf99;
    border: 1px solid rgba(246, 197, 96, 0.35);
}

.legend { display: flex; align-items: center; gap: 14px; margin-top: 12px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.swatch { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.dot-pos { background: hsl(145, 65%, 32%); }
.dot-neg { background: hsl(0, 70%, 32%); }
.dot-zero { background: var(--zero); }
.dot-halv { background: rgba(246, 197, 96, 0.15); border: 1px dashed var(--hl); }

footer { margin-top: 18px; color: var(--muted); font-size: 13px; }
a { color: #93c5fd; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Tooltip */
.tooltip {
  position: fixed;
  z-index: 50;
  display: none;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 21, 33, 0.96);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  font-size: 14px;
  pointer-events: none;
}

.tooltip .title { font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.tooltip .price { font-weight: 800; font-size: 18px; letter-spacing: 0.2px; }
.tooltip .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }


