.gr-update-heatmap {
  --heat-cell: 13px;
  --heat-empty: #edf1f6;
  --heat-1: #dceafd;
  --heat-2: #a7cbfb;
  --heat-3: #5f9df2;
  --heat-4: #2563eb;
  min-width: 0;
  padding: 20px 22px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  background: var(--bg-surface, #fff);
  box-shadow: var(--shadow-sm, 0 1px 2px rgb(0 0 0 / 5%));
  color: var(--text-main, #0f172a);
}

:root[data-theme="dark"] .gr-update-heatmap {
  --heat-empty: #202127;
  --heat-1: #173459;
  --heat-2: #23538b;
  --heat-3: #3474c0;
  --heat-4: #5b9fff;
}

.gr-home-view--hero .gr-update-heatmap {
  --heat-cell: 17px;
  max-width: 1400px;
  margin: 22px auto;
}

/* Hero 列表按当前 Tab 自然收起，不为其他 Tab 的最大高度留白。 */
.gr-home-view--hero .latest-games-section .results-grid {
  min-height: 0;
}

.gr-update-heatmap__head,
.gr-update-heatmap__foot,
.gr-update-heatmap__details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gr-update-heatmap__eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--primary, #2563eb);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
}

.gr-update-heatmap h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.gr-update-heatmap__summary {
  flex: none;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.gr-update-heatmap__summary strong {
  color: var(--primary, #2563eb);
  font-size: 16px;
}

.gr-update-heatmap__hint {
  margin: 5px 0 16px;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.gr-update-heatmap__scroll {
  overflow-x: auto;
  padding: 2px 0 8px;
}

.gr-update-heatmap__plot {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: max-content;
}

.gr-update-heatmap__weekdays,
.gr-update-heatmap__days {
  display: grid;
  grid-template-rows: repeat(7, var(--heat-cell));
  grid-auto-flow: column;
  row-gap: 3px;
}

.gr-update-heatmap__weekdays {
  grid-template-columns: 12px;
  color: var(--text-muted, #64748b);
  font-size: 10px;
  line-height: var(--heat-cell);
}

.gr-update-heatmap__days {
  grid-auto-columns: var(--heat-cell);
  column-gap: 3px;
}

.gr-update-heatmap__day,
.gr-update-heatmap__legend i {
  display: block;
  width: var(--heat-cell);
  height: var(--heat-cell);
  border: 0;
  border-radius: 3px;
  padding: 0;
  background: var(--heat-empty);
}

.gr-update-heatmap__day[data-level="1"], .gr-update-heatmap__legend i[data-level="1"] { background: var(--heat-1); }
.gr-update-heatmap__day[data-level="2"], .gr-update-heatmap__legend i[data-level="2"] { background: var(--heat-2); }
.gr-update-heatmap__day[data-level="3"], .gr-update-heatmap__legend i[data-level="3"] { background: var(--heat-3); }
.gr-update-heatmap__day[data-level="4"], .gr-update-heatmap__legend i[data-level="4"] { background: var(--heat-4); }

.gr-update-heatmap__day {
  cursor: pointer;
  transition: filter .18s ease, box-shadow .18s ease;
}

.gr-update-heatmap__day:hover { filter: brightness(.83); }
.gr-update-heatmap__day.is-selected { box-shadow: 0 0 0 2px var(--bg-surface, #fff), 0 0 0 4px var(--primary, #2563eb); }
.gr-update-heatmap__day:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }

.gr-update-heatmap__foot {
  margin-top: 7px;
  color: var(--text-muted, #64748b);
  font-size: 11px;
}

.gr-update-heatmap__legend { display: flex; align-items: center; gap: 4px; }
.gr-update-heatmap__legend i { width: 11px; height: 11px; }
.gr-update-heatmap__legend i:first-of-type { margin-left: 4px; }
.gr-update-heatmap__legend i:last-of-type { margin-right: 4px; }

.gr-update-heatmap__details {
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.gr-update-heatmap__details-head strong { font-size: 14px; }
.gr-update-heatmap__details-head span { color: var(--text-muted, #64748b); font-size: 12px; }

.gr-update-heatmap__games {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 16px;
  max-height: 172px;
  overflow-y: auto;
  margin-top: 12px;
}

.gr-update-heatmap__games a {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text-main, #0f172a);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.gr-update-heatmap__games a:hover,
.gr-update-heatmap__games a:focus-visible { color: var(--primary, #2563eb); text-decoration: underline; }
.gr-update-heatmap__empty { grid-column: 1 / -1; margin: 0; color: var(--text-muted, #64748b); font-size: 12px; }

@media (max-width: 600px) {
  .gr-update-heatmap { --heat-cell: 11px; padding: 16px; }
  .gr-home-view--hero .gr-update-heatmap { --heat-cell: 11px; }
  .gr-home-view--hero .gr-update-heatmap { margin: 16px 14px; }
  .gr-update-heatmap__head { align-items: flex-start; }
  .gr-update-heatmap h2 { font-size: 16px; }
  .gr-update-heatmap__summary { padding-top: 17px; }
  .gr-update-heatmap__games { grid-template-columns: 1fr; }
}
