#calendar {
  max-width: calc(4 * 140px);
  display: grid;
  grid-template-columns: repeat(4, auto);
  grid-template-rows: repeat(3, auto);
  gap: 1.5rem;
  margin: 2rem auto;
  justify-content: center;
  align-items: start;
  padding: 1rem 0;
  gap: 2rem;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.3);
  padding: 1.2rem;
  gap: 2px;
  margin-top: 20px;
}

.day-btn {
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  text-align: center;
  box-sizing: border-box;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s;
  border-radius: 5px;
  margin: 2px;
  background: #1a1f24;
  box-shadow: inset 0 0 3px rgba(255, 255, 255, 0.05),
    0 0 3px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease, box-shadow 0.3s ease;
}

.day-btn:hover {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}
.day-btn:active {
  transform: scale(0.95);
}
.day-btn.selected {
  background-color: var(--color-primary);
  color: white;
  font-weight: bold;
}

.day-btn.empty {
  visibility: hidden;
  pointer-events: none;
  background: transparent;
  border: none;
}
.font-bold {
  font-weight: bold;
}

.stage-micro {
  background: hsl(75, 45%, 40%);
  color: #0f1419;
}

.stage-nano {
  background: hsl(120, 50%, 42%);
  color: #0f1419;
}

.stage-macro {
  background: #599f4d; /* mature healthy green */
  color: #f6fff8;
}

.fail-day {
  position: relative;
}

.fail-day::after,
.fail-day::before {
  content: "";
  position: absolute;
  width: 66%;
  height: 2px;
  background: rgb(189 105 105);
  top: 46%;
  left: 6px;
  transform-origin: center;
  pointer-events: none;
}
.fail-day::after {
  transform: rotate(45deg);
}
.fail-day::before {
  transform: rotate(-45deg);
}
.current-stage {
  font-weight: bold;
  font-family: "Inter", "Segoe UI", sans-serif;
}

.month-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.month-header {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #888;
  margin-bottom: 0.75rem;
  opacity: 0.85;
  font-weight: 600;
  font-family: "Inter", "Segoe UI", sans-serif;
}

@media (max-width: 1224px) {
  #calendar {
    grid-template-columns: repeat(3, auto);
    grid-template-rows: repeat(4, auto);
    max-width: calc(3 * 140px);
  }
}

@media (max-width: 964px) {
  #calendar {
    grid-template-columns: repeat(2, auto);
    grid-template-rows: repeat(6, auto);
    max-width: calc(2 * 140px);
  }

  .days-grid {
    margin-bottom: 1rem;
  }
}

@media (max-width: 600px) {
  #calendar {
    grid-template-columns: repeat(1, auto);
    grid-template-rows: repeat(12, auto);
    max-width: calc(1 * 140px);
  }

  .days-grid {
    margin-bottom: 2rem;
  }
}
