.github-body {
  /* DO NOT TOUCH */
  --bg-color: #0a0a0a;

  --text-main: #c9d1d9;
  --text-muted: #8b949e;
  --border-color: #262626;

  --color-level-0: #161b22; /* empty */
  --border-level-0: #161b22;

  --color-level-1: #0b2a4a; /* deep navy */
  --border-level-1: #0b2a4a;

  --color-level-2: #0b3f73; /* muted blue */
  --border-level-2: #0b3f73;

  --color-level-3: #1f6feb; /* GitHub blue */
  --border-level-3: #1f6feb;

  --color-level-4: #58a6ff; /* bright blue */
  --border-level-4: #58a6ff;

  --primary-btn: #1f6feb;
  --primary-btn-hover: #388bfd;

  --cell-size: 14px;
  --cell-gap: 4px;
  --border-radius: 2px;
}
@media (max-width: 768px) {
  .github-body {
    --cell-size: 10px;
    --cell-gap: 2px;
  }
}
@media (max-width: 640px) {
  .github-body {
    --cell-size: 8px;
    --cell-gap: 1px;
  }
}
@media (max-width: 480px) {
  .github-body {
    --cell-size: 7px;
    --cell-gap: 1px;
  }
}

.count-mask {
  overflow: hidden;
  display: inline-flex;
  position: relative;
  vertical-align: bottom;
}

.github-body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: "bebas neue";
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}
@media (max-width: 640px) {
  .github-body {
    padding: 1rem 0.5rem;
    min-height: 80vh;
  }
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.gap-1 {
  gap: 4px;
}
.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
.animate-enter {
  animation: fadeIn 0.4s ease-out forwards;
  opacity: 0;
}
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.config-container {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  z-index: 10;
}
@media (max-width: 640px) {
  .config-container {
    position: relative;
    top: 0;
    right: 0;
    width: 100%;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
  }
}

.input-box {
  background: #171717;
  border: 1px solid var(--border-color);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
  width: 160px;
}
@media (max-width: 640px) {
  .input-box {
    width: 140px;
    font-size: 0.7rem;
  }
}
.input-box:focus {
  border-color: var(--primary-btn);
}

.load-btn {
  background: var(--primary-btn);
  color: white;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  transition:
    background 0.2s,
    box-shadow 0.2s;
}
.load-btn:hover {
  background: var(--primary-btn-hover);
  box-shadow: 0 0 15px rgba(34, 110, 197, 0.4);
}

.stats-row {
  display: flex;
  gap: 4rem;
  margin-bottom: 3rem;
  text-align: center;
}
@media (max-width: 768px) {
  .stats-row {
    gap: 2rem;
  }
}
@media (max-width: 640px) {
  .stats-row {
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
}
.stat-item h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1;
  transform: translateY(100%);
  opacity: 0;
}
@media (max-width: 768px) {
  .stat-item h2 {
    font-size: 2rem;
  }
}
@media (max-width: 640px) {
  .stat-item h2 {
    font-size: 1.5rem;
  }
}
.stat-item p {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .stat-item p {
    font-size: 0.55rem;
    letter-spacing: 0.1em;
  }
}
.text-green {
  color: #22a2e7;
}

.graph-wrapper {
  width: 100%;
  max-width: 1100px;
  position: relative;
}
@media (max-width: 768px) {
  .graph-wrapper {
    max-width: 100%;
    padding: 0;
  }
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
}
@media (max-width: 640px) {
  .section-title {
    margin-bottom: 1.5rem;
  }
}
.section-title h1 {
  font-size: 4rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: #e5e5e5;
  letter-spacing: 0.05em;
}
@media (max-width: 768px) {
  .section-title h1 {
    font-size: 2.25rem;
  }
}
@media (max-width: 640px) {
  .section-title h1 {
    font-size: 2.75rem;
  }
}
.section-title p {
  color: var(--text-muted);
  font-size: 2rem;
}
@media (max-width: 768px) {
  .section-title p {
    font-size: 1.1rem;
  }
}
@media (max-width: 640px) {
  .section-title p {
    font-size: 1.1rem;
  }
}

.layout-grid {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: flex-start;
}
@media (max-width: 1024px) {
  .layout-grid {
    gap: 1.5rem;
  }
}
@media (max-width: 768px) {
  .layout-grid {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .stats-row {
    gap: 2rem;
  }
  .stat-item h2 {
    font-size: 2rem;
  }
}
@media (max-width: 640px) {
  .layout-grid {
    padding: 0 0.5rem;
  }
}

.heatmap-container {
  flex: 1;
  width: 100%;
  overflow: visible;
}
@media (max-width: 768px) {
  .heatmap-container {
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }
}

.month-labels {
  position: relative;
  height: 1.5rem;
  min-width: min-content;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}
@media (max-width: 640px) {
  .month-labels {
    font-size: 0.7rem;
    height: 1.25rem;
    font-weight: 600;
  }
}
.month-label {
  position: absolute;
  top: 0;
  user-select: none;
}
@media (max-width: 640px) {
  .month-label {
    text-shadow: 0 0 4px var(--bg-color);
  }
}

.scroll-area {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
@media (max-width: 640px) {
  .scroll-area {
    padding-bottom: 1rem;
  }
}

.scroll-area::-webkit-scrollbar {
  height: 6px;
}
@media (max-width: 640px) {
  .scroll-area::-webkit-scrollbar {
    height: 8px;
  }
}
.scroll-area::-webkit-scrollbar-track {
  background: #0a0a0a;
}
.scroll-area::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}
.scroll-area::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.grid-flex {
  display: inline-flex;
  gap: var(--cell-gap);
  width: max-content;
}

.week-col {
  display: flex;
  flex-direction: column;
  gap: var(--cell-gap);
}
.day-cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border-radius: var(--border-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.2s,
    z-index 0.2s;
}
.day-cell:hover {
  transform: scale(1.4);
  z-index: 1;
  border-color: rgba(255, 255, 255, 0.8) !important;
}
@media (max-width: 640px) {
  .day-cell:hover {
    transform: scale(1.2);
  }
}
@media (hover: none) {
  .day-cell:active {
    transform: scale(1.2);
    z-index: 1;
    border-color: rgba(255, 255, 255, 0.8) !important;
  }
}

.level-0 {
  background-color: var(--color-level-0);
  border-color: var(--border-level-0);
}
.level-1 {
  background-color: var(--color-level-1);
  border-color: var(--border-level-1);
}
.level-2 {
  background-color: var(--color-level-2);
  border-color: var(--border-level-2);
}
.level-3 {
  background-color: var(--color-level-3);
  border-color: var(--border-level-3);
}
.level-4 {
  background-color: var(--color-level-4);
  border-color: var(--border-level-4);
  box-shadow: 0 0 6px rgba(134, 239, 172, 0.4);
}

.legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: monospace;
}
@media (max-width: 640px) {
  .legend {
    font-size: 0.6rem;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
  }
}

.scroll-hint-mobile {
  display: none;
  text-align: center;
  font-size: 0.7rem;
  color: var(--primary-btn);
  margin-top: 0.75rem;
  font-family: monospace;
  font-weight: 600;
  letter-spacing: 0.05em;
}
@media (max-width: 768px) {
  .scroll-hint-mobile {
    display: block;
    animation: pulseHint 2s ease-in-out infinite;
  }
}
@keyframes pulseHint {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}
.legend-squares {
  display: flex;
  gap: var(--cell-gap);
}

.year-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: monospace;
  font-size: 0.875rem;
  padding-top: 1.75rem;
}
@media (max-width: 1024px) {
  .year-selector {
    padding-top: 1rem;
  }
}
@media (max-width: 768px) {
  .year-selector {
    flex-direction: row;
    padding-top: 0;
    overflow-x: auto;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
}
@media (max-width: 640px) {
  .year-selector {
    font-size: 0.75rem;
    gap: 0.4rem;
  }
}

.year-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .year-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }
}
.year-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.year-btn.active {
  background: var(--primary-btn);
  color: white;
  border-color: var(--primary-btn);
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.3);
  transform: scale(1.1);
}
@media (max-width: 640px) {
  .year-btn.active {
    transform: scale(1.05);
  }
}

.tooltip {
  position: fixed;
  z-index: 1000;
  background: #171717;
  border: 1px solid #404040;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}
@media (max-width: 640px) {
  .tooltip {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
    max-width: 200px;
  }
}
.tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.tooltip-count {
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 2px;
  font-size: 0.85rem;
}
@media (max-width: 640px) {
  .tooltip-count {
    font-size: 0.75rem;
  }
}
.tooltip-date {
  color: var(--text-muted);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
@media (max-width: 640px) {
  .tooltip-date {
    font-size: 0.6rem;
  }
}
